]> granicus.if.org Git - clang/commitdiff
Switch on PCH for C++. C++ fans all over the world rejoice.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 11 Aug 2010 23:27:58 +0000 (23:27 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 11 Aug 2010 23:27:58 +0000 (23:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110879 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/cxx-pth.cpp [deleted file]

index c1a16ea1771d422a6f5ccc454b706be215703cf1..967d9f8332e241794a5b574fab40d8c12e9fd026 100644 (file)
@@ -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<PrecompileJobAction>(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 (file)
index 97afb5e..0000000
+++ /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"