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 | 646395bbcaa849c94bc2a3246c71d809ca719f01 (patch) | |
tree | 2a4d80ab05b4680e243ffc9d6977439e4e5e27a3 /lib/Frontend/PCHReader.cpp | |
parent | b3a29f132794f67108bccc9c7cc3795365e8a965 (diff) |
-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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110868 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReader.cpp')
-rw-r--r-- | lib/Frontend/PCHReader.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index 68acbb2faf..a09b89deea 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -657,6 +657,8 @@ public: unsigned Bits = ReadUnalignedLE16(d); bool CPlusPlusOperatorKeyword = Bits & 0x01; Bits >>= 1; + bool HasRevertedTokenIDToIdentifier = Bits & 0x01; + Bits >>= 1; bool Poisoned = Bits & 0x01; Bits >>= 1; bool ExtensionToken = Bits & 0x01; @@ -677,7 +679,9 @@ public: Reader.SetIdentifierInfo(ID, II); // Set or check the various bits in the IdentifierInfo structure. - // FIXME: Load token IDs lazily, too? + // Token IDs are read-only. + if (HasRevertedTokenIDToIdentifier) + II->RevertTokenIDToIdentifier(); II->setObjCOrBuiltinID(ObjCOrBuiltinID); assert(II->isExtensionToken() == ExtensionToken && "Incorrect extension token flag"); |