From: Argyrios Kyrtzidis Date: Wed, 11 Aug 2010 23:27:58 +0000 (+0000) Subject: Switch on PCH for C++. C++ fans all over the world rejoice. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e5c35377020d6c38d16434c9f373a5fa9bb4f2eb;p=clang Switch on PCH for C++. C++ fans all over the world rejoice. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110879 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index c1a16ea177..967d9f8332 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -179,10 +179,8 @@ void Clang::AddPreprocessingOptions(const Driver &D, const Arg *A = it; if (A->getOption().matches(options::OPT_include)) { - // Use PCH if the user requested it, except for C++ (for now). + // Use PCH if the user requested it. bool UsePCH = D.CCCUsePCH; - if (types::isCXX(Inputs[0].getType())) - UsePCH = false; bool FoundPTH = false; bool FoundPCH = false; @@ -789,10 +787,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, !IsOpt)) CmdArgs.push_back("-mrelax-all"); } else if (isa(JA)) { - // Use PCH if the user requested it, except for C++ (for now). + // Use PCH if the user requested it. bool UsePCH = D.CCCUsePCH; - if (types::isCXX(Inputs[0].getType())) - UsePCH = false; if (UsePCH) CmdArgs.push_back("-emit-pch"); diff --git a/test/Driver/cxx-pth.cpp b/test/Driver/cxx-pth.cpp deleted file mode 100644 index 97afb5ebe8..0000000000 --- a/test/Driver/cxx-pth.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// Test forced PTH for CXX support. - -// RUN: %clangxx -x c++-header %s -### 2> %t.log -// RUN: FileCheck -check-prefix EMIT -input-file %t.log %s - -// EMIT: "{{.*}}/clang{{.*}}" {{.*}} "-emit-pth" "{{.*}}.cpp.gch" "-x" "c++-header" "{{.*}}.cpp" - -// RUN: touch %t.h.gch -// RUN: %clangxx -E -include %t.h %s -### 2> %t.log -// RUN: FileCheck -check-prefix USE -input-file %t.log %s - -// USE: "{{.*}}/clang{{.*}}" {{.*}}"-include-pth" "{{.*}}.h.gch" {{.*}}"-x" "c++" "{{.*}}.cpp"