Set GNUMode only for the "gnu" language standard options, from Ken Dyck!

llvm-svn: 83064
This commit is contained in:
Douglas Gregor 2009-09-29 14:42:43 +00:00
parent a49cb4e494
commit 63b3556c9c
1 changed files with 17 additions and 3 deletions

View File

@ -518,8 +518,7 @@ static void InitializeLangOptions(LangOptions &Options, LangKind LK){
enum LangStds {
lang_unspecified,
lang_c89, lang_c94, lang_c99,
lang_gnu_START,
lang_gnu89 = lang_gnu_START, lang_gnu99,
lang_gnu89, lang_gnu99,
lang_cxx98, lang_gnucxx98,
lang_cxx0x, lang_gnucxx0x
};
@ -752,7 +751,22 @@ static void InitializeLanguageStandard(LangOptions &Options, LangKind LK,
}
// GNUMode - Set if we're in gnu99, gnu89, gnucxx98, etc.
Options.GNUMode = LangStd >= lang_gnu_START;
switch (LangStd) {
default: assert(0 && "Unknown language standard!");
case lang_gnucxx0x:
case lang_gnucxx98:
case lang_gnu99:
case lang_gnu89:
Options.GNUMode = 1;
break;
case lang_cxx0x:
case lang_cxx98:
case lang_c99:
case lang_c94:
case lang_c89:
Options.GNUMode = 0;
break;
}
if (Options.CPlusPlus) {
Options.C99 = 0;