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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61963 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ted Kremenek 2009-01-09 00:38:08 +00:00
Родитель e338ccdedb
Коммит f890191057
1 изменённых файлов: 24 добавлений и 10 удалений

Просмотреть файл

@ -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;
}