diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-11-30 22:46:56 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-11-30 22:46:56 +0000 |
commit | bdbb285aed1bb1e20090a16929f4c1da33d2d5c5 (patch) | |
tree | 382aa4763cb99e5964ccbf8f5b1467f31f357dd5 /include/clang/Basic/IdentifierTable.h | |
parent | e365c50a21cb02e0219433db0c4461566ad4a597 (diff) |
Implemented serialization of SelectorTable and Selectors.
Modified serialization of IdentifierTable to self-register itself with
the Deserializer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44471 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/IdentifierTable.h')
-rw-r--r-- | include/clang/Basic/IdentifierTable.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h index 79d8573221..f783c50c2a 100644 --- a/include/clang/Basic/IdentifierTable.h +++ b/include/clang/Basic/IdentifierTable.h @@ -195,7 +195,7 @@ public: void Emit(llvm::Serializer& S) const; /// Create - Deserialize an IdentifierTable from a bitstream. - static IdentifierTable* Create(llvm::Deserializer& D); + static IdentifierTable* CreateAndRegister(llvm::Deserializer& D); private: /// This ctor is not intended to be used by anyone except for object @@ -227,7 +227,7 @@ class Selector { InfoPtr = reinterpret_cast<uintptr_t>(SI); assert((InfoPtr & ArgFlags) == 0 &&"Insufficiently aligned IdentifierInfo"); } - Selector(intptr_t V) : InfoPtr(V) {} + Selector(uintptr_t V) : InfoPtr(V) {} public: friend class SelectorTable; // only the SelectorTable can create these. @@ -269,6 +269,12 @@ public: static Selector getTombstoneMarker() { return Selector(uintptr_t(-2)); } + + // Emit - Emit a selector to bitcode. + void Emit(llvm::Serializer& S) const; + + // ReadVal - Read a selector from bitcode. + static Selector ReadVal(llvm::Deserializer& D); }; /// SelectorTable - This table allows us to fully hide how we implement @@ -292,6 +298,12 @@ public: Selector getNullarySelector(IdentifierInfo *ID) { return Selector(ID, 0); } + + // Emit - Emit a SelectorTable to bitcode. + void Emit(llvm::Serializer& S) const; + + // Create - Reconstitute a SelectorTable from bitcode. + static SelectorTable* CreateAndRegister(llvm::Deserializer& D); }; } // end namespace clang |