diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-08-11 22:55:12 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-08-11 22:55:12 +0000 |
commit | 3084a61e9825651617873b624df33387fb6e593a (patch) | |
tree | 210bf7c60b9cdfaf0ba9adff20bc620256159939 /clang/lib/Basic/IdentifierTable.cpp | |
parent | 599669983434af7a75047de35e802f66fa4b3c6e (diff) | |
download | bcm5719-llvm-3084a61e9825651617873b624df33387fb6e593a.tar.gz bcm5719-llvm-3084a61e9825651617873b624df33387fb6e593a.zip |
-Make TokenID of IdentifierInfo read-only, remove setTokenID().
-There are 2 instances that change the TokenID for GNU libstdc++ 4.2 compatibility.
To handler those cases introduce a RevertedTokenID bitfield, RevertTokenIDToIdentifier() and hasRevertedTokenIDToIdentifier() methods.
Store the bitfield in PCH.
llvm-svn: 110868
Diffstat (limited to 'clang/lib/Basic/IdentifierTable.cpp')
-rw-r--r-- | clang/lib/Basic/IdentifierTable.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp index 1f0c52bdc19..c7b16c99c96 100644 --- a/clang/lib/Basic/IdentifierTable.cpp +++ b/clang/lib/Basic/IdentifierTable.cpp @@ -35,6 +35,7 @@ IdentifierInfo::IdentifierInfo() { IsCPPOperatorKeyword = false; NeedsHandleIdentifier = false; IsFromPCH = false; + RevertedTokenID = false; FETokenInfo = 0; Entry = 0; } @@ -101,8 +102,7 @@ static void AddKeyword(llvm::StringRef Keyword, // Don't add this keyword if disabled in this language. if (AddResult == 0) return; - IdentifierInfo &Info = Table.get(Keyword); - Info.setTokenID(TokenCode); + IdentifierInfo &Info = Table.get(Keyword, TokenCode); Info.setIsExtensionToken(AddResult == 1); } @@ -111,8 +111,7 @@ static void AddKeyword(llvm::StringRef Keyword, static void AddCXXOperatorKeyword(llvm::StringRef Keyword, tok::TokenKind TokenCode, IdentifierTable &Table) { - IdentifierInfo &Info = Table.get(Keyword); - Info.setTokenID(TokenCode); + IdentifierInfo &Info = Table.get(Keyword, TokenCode); Info.setIsCPlusPlusOperatorKeyword(); } |