From 3084a61e9825651617873b624df33387fb6e593a Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Wed, 11 Aug 2010 22:55:12 +0000 Subject: -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 --- clang/lib/Basic/IdentifierTable.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'clang/lib/Basic/IdentifierTable.cpp') 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(); } -- cgit v1.2.3