diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2010-04-17 20:17:31 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2010-04-17 20:17:31 +0000 |
commit | eb5d7b752651283de5abfcc2f91df7227582a08d (patch) | |
tree | cda94be17b44b43c9ecae1c215cfcf22e319964c /lib/Basic/IdentifierTable.cpp | |
parent | 046c294a43024874ff35656c6e785b64e72f1f36 (diff) |
Add support for '-fgnu-keywords' and '-fasm' to Clang's driver. They are not
implemented precisely the same as GCC, but the distinction GCC makes isn't
useful to represent. This allows parsing code which uses GCC-specific keywords
('asm', etc.) without parsing in a fully GNU mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101667 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/IdentifierTable.cpp')
-rw-r--r-- | lib/Basic/IdentifierTable.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp index 3da19ca16d..ed0de8c4af 100644 --- a/lib/Basic/IdentifierTable.cpp +++ b/lib/Basic/IdentifierTable.cpp @@ -78,9 +78,9 @@ namespace { /// identifiers because they are language keywords. This causes the lexer to /// automatically map matching identifiers to specialized token codes. /// -/// The C90/C99/CPP/CPP0x flags are set to 0 if the token should be +/// The C90/C99/CPP/CPP0x flags are set to 2 if the token should be /// enabled in the specified langauge, set to 1 if it is an extension -/// in the specified language, and set to 2 if disabled in the +/// in the specified language, and set to 0 if disabled in the /// specified language. static void AddKeyword(llvm::StringRef Keyword, tok::TokenKind TokenCode, unsigned Flags, @@ -90,7 +90,7 @@ static void AddKeyword(llvm::StringRef Keyword, else if (LangOpts.CPlusPlus && (Flags & KEYCXX)) AddResult = 2; else if (LangOpts.CPlusPlus0x && (Flags & KEYCXX0X)) AddResult = 2; else if (LangOpts.C99 && (Flags & KEYC99)) AddResult = 2; - else if (LangOpts.GNUMode && (Flags & KEYGNU)) AddResult = 1; + else if (LangOpts.GNUKeywords && (Flags & KEYGNU)) AddResult = 1; else if (LangOpts.Microsoft && (Flags & KEYMS)) AddResult = 1; else if (LangOpts.Bool && (Flags & BOOLSUPPORT)) AddResult = 2; else if (LangOpts.AltiVec && (Flags & KEYALTIVEC)) AddResult = 2; |