From 7e29381f48967c0f9588bb749cd3702b170c3709 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 4 Jun 2017 11:12:17 +0200 Subject: Adjust Clang language selection --- build2/cc/compile.cxx | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) (limited to 'build2') diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx index d5566b8..b301709 100644 --- a/build2/cc/compile.cxx +++ b/build2/cc/compile.cxx @@ -75,7 +75,7 @@ namespace build2 langopt (const match_data& md) const { bool m (md.mod); - preprocessed p (md.pp); + //preprocessed p (md.pp); switch (cid) { @@ -92,28 +92,15 @@ namespace build2 } case compiler_id::clang: { - switch (p) + // Clang has *-cpp-output (but not c++-module-cpp-output) and they + // handle comments and line continuations. However, currently this + // is only by accident since these modes are essentially equivalent + // to their cpp-output-less versions. + // + switch (x_lang) { - case preprocessed::none: - case preprocessed::includes: - case preprocessed::modules: - { - switch (x_lang) - { - case lang::c: return "c"; - case lang::cxx: return m ? "c++-module" : "c++"; - } - } - case preprocessed::all: - { - switch (x_lang) - { - case lang::c: return "cpp-output"; - case lang::cxx: return (m - ? "c++-module-cpp-output" - : "c++-cpp-output"); - } - } + case lang::c: return "c"; + case lang::cxx: return m ? "c++-module" : "c++"; } } case compiler_id::msvc: -- cgit v1.1