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

Chris Lattner sabre at nondot.org
Thu Feb 5 22:19:20 PST 2009


Author: lattner
Date: Fri Feb  6 00:19:20 2009
New Revision: 63924

URL: http://llvm.org/viewvc/llvm-project?rev=63924&view=rev
Log:
add support for -x c++-header, update comment.

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=63924&r1=63923&r2=63924&view=diff

==============================================================================
--- cfe/trunk/Driver/clang.cpp (original)
+++ cfe/trunk/Driver/clang.cpp Fri Feb  6 00:19:20 2009
@@ -267,6 +267,7 @@
   langkind_c_pch,
   langkind_cxx,
   langkind_cxx_cpp,
+  langkind_cxx_pch,
   langkind_objc,
   langkind_objc_cpp,
   langkind_objc_pch,
@@ -276,9 +277,7 @@
 };
 
 /* TODO: GCC also accepts:
-   c-header c++-header objective-c-header objective-c++-header
-   assembler
-   ada, f77*, ratfor (!), f95, java, treelang
+   assembler, ada, f77*, ratfor (!), f95, java, treelang
  */
 static llvm::cl::opt<LangKind>
 BaseLang("x", llvm::cl::desc("Base language to compile"),
@@ -292,15 +291,17 @@
                     clEnumValN(langkind_asm_cpp,     "assembler-with-cpp",
                                "Preprocessed asm"),
                     clEnumValN(langkind_cxx_cpp,   "c++-cpp-output",
-                               "Preprocessed C++"),                    
+                               "Preprocessed C++"),
                     clEnumValN(langkind_objc_cpp,  "objective-c-cpp-output",
                                "Preprocessed Objective C"),
-                    clEnumValN(langkind_objcxx_cpp,"objective-c++-cpp-output",
+                    clEnumValN(langkind_objcxx_cpp, "objective-c++-cpp-output",
                                "Preprocessed Objective C++"),
-                    clEnumValN(langkind_c_pch,"c-header",
+                    clEnumValN(langkind_c_pch, "c-header",
                                "Precompiled C header"),
                     clEnumValN(langkind_objc_pch, "objective-c-header",
                                "Precompiled Objective-C header"),
+                    clEnumValN(langkind_cxx_pch, "c++-header",
+                               "Precompiled C++ header"),
                     clEnumValN(langkind_objcxx_pch, "objective-c++-header",
                                "Precompiled Objective-C++ header"),
                     clEnumValEnd));
@@ -376,20 +377,24 @@
 
   // 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;
+  default:
+    break;
+  case langkind_c_pch:
+    LK = langkind_c;
+    PCH = true;
+    break;
+  case langkind_objc_pch:
+    LK = langkind_objc;
+    PCH = true;
+    break;
+  case langkind_cxx_pch:
+    LK = langkind_cxx;
+    PCH = true;
+    break;
+  case langkind_objcxx_pch:
+    LK = langkind_objcxx;
+    PCH = true;
+    break;
   }
   
   switch (LK) {





More information about the cfe-commits mailing list