diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-01-09 00:38:08 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-01-09 00:38:08 +0000 |
commit | f890191057ac0ab5d1178ded62c660ff03151b04 (patch) | |
tree | 62da4f8a5d2648b965d78ac308a8f4c39db872c8 | |
parent | e338ccdedb8ecb026482703d8b9a3ade1f238f7b (diff) |
Enable support for '-x objective-c++-header'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61963 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | Driver/clang.cpp | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/Driver/clang.cpp b/Driver/clang.cpp index 77fb3c8f01..268c26b0df 100644 --- a/Driver/clang.cpp +++ b/Driver/clang.cpp @@ -255,7 +255,8 @@ enum LangKind { 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 @@ BaseLang("x", llvm::cl::desc("Base language to compile"), 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 @@ static bool InitializeLangOptions(LangOptions &Options, LangKind LK){ // 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 @@ static bool InitializeLangOptions(LangOptions &Options, LangKind LK){ 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 @@ static void InitializeLanguageStandard(LangOptions &Options, LangKind LK, case langkind_cxx_cpp: case langkind_objcxx: case langkind_objcxx_cpp: + case langkind_objcxx_pch: LangStd = lang_gnucxx98; break; } |