[cfe-commits] r61963 - /cfe/trunk/Driver/clang.cpp

Ted Kremenek kremenek at apple.com
Thu Jan 8 16:38:08 PST 2009


Author: kremenek
Date: Thu Jan  8 18:38:08 2009
New Revision: 61963

URL: http://llvm.org/viewvc/llvm-project?rev=61963&view=rev
Log:
Enable support for '-x objective-c++-header'.

Modified:
    cfe/trunk/Driver/clang.cpp

Modified: cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/clang.cpp?rev=61963&r1=61962&r2=61963&view=diff

==============================================================================
--- cfe/trunk/Driver/clang.cpp (original)
+++ cfe/trunk/Driver/clang.cpp Thu Jan  8 18:38:08 2009
@@ -255,7 +255,8 @@
   langkind_objc_cpp,
   langkind_objc_pch,
   langkind_objcxx,
-  langkind_objcxx_cpp
+  langkind_objcxx_cpp,
+  langkind_objcxx_pch
 };
 
 /* TODO: GCC also accepts:
@@ -283,7 +284,9 @@
                     clEnumValN(langkind_c_pch,"c-header",
                                "Precompiled C header"),
                     clEnumValN(langkind_objc_pch, "objective-c-header",
-                               "Precompiled Objective C header"),
+                               "Precompiled Objective-C header"),
+                    clEnumValN(langkind_objcxx_pch, "objective-c++-header",
+                               "Precompiled Objective-C++ header"),
                     clEnumValEnd));
 
 static llvm::cl::opt<bool>
@@ -354,13 +357,27 @@
   // FIXME: implement -fpreprocessed mode.
   bool NoPreprocess = false;
   bool PCH = false;
+
+  // Test for 'PCH'.
+  switch (LK) {
+    default:
+      break;
+    case langkind_c_pch:
+      LK = langkind_c;
+      PCH = true;
+      break;
+    case langkind_objc_pch:
+      LK = langkind_objc;
+      PCH = true;
+      break;
+    case langkind_objcxx_pch:
+      LK = langkind_objcxx;
+      PCH = true;
+      break;
+  }
   
   switch (LK) {
   default: assert(0 && "Unknown language kind!");
-  case langkind_c_pch:
-    InitializeCOptions(Options);
-    PCH = true;
-    break;
   case langkind_asm_cpp:
     Options.AsmPreprocessor = 1;
     // FALLTHROUGH
@@ -376,10 +393,6 @@
   case langkind_cxx:
     Options.CPlusPlus = 1;
     break;
-  case langkind_objc_pch:
-    InitializeObjCOptions(Options);
-    PCH = true;
-    break;
   case langkind_objc_cpp:
     NoPreprocess = true;
     // FALLTHROUGH
@@ -522,6 +535,7 @@
     case langkind_cxx_cpp:
     case langkind_objcxx:
     case langkind_objcxx_cpp:
+    case langkind_objcxx_pch:
       LangStd = lang_gnucxx98;
       break;
     }





More information about the cfe-commits mailing list