Enable support for '-x objective-c++-header'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61963 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 77fb3c8..268c26b 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -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;
     }