diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-08-20 16:04:27 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-08-20 16:04:27 +0000 |
commit | 5d26768e2661faa7ce0b55ffff4be8b3969fbbf5 (patch) | |
tree | 7d3df9e026a4e019d9821a82a382ab48ed6a403a /include/clang/Serialization/ASTWriter.h | |
parent | eb3f04e60fa17dba27344ed89fd1b9134bb6839c (diff) |
Introduce the mechanism for building an AST on-disk hash table for name lookup inside a DeclContext but don't use it yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111635 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Serialization/ASTWriter.h')
-rw-r--r-- | include/clang/Serialization/ASTWriter.h | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/include/clang/Serialization/ASTWriter.h b/include/clang/Serialization/ASTWriter.h index 15977efe76..9ef14925bc 100644 --- a/include/clang/Serialization/ASTWriter.h +++ b/include/clang/Serialization/ASTWriter.h @@ -20,7 +20,6 @@ #include "clang/Serialization/ASTBitCodes.h" #include "clang/Serialization/ASTDeserializationListener.h" #include "clang/Sema/SemaConsumer.h" -#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Bitcode/BitstreamWriter.h" @@ -50,24 +49,6 @@ class SourceManager; class SwitchCase; class TargetInfo; -/// A structure for putting "fast"-unqualified QualTypes into a -/// DenseMap. This uses the standard pointer hash function. -struct UnsafeQualTypeDenseMapInfo { - static inline bool isEqual(QualType A, QualType B) { return A == B; } - static inline QualType getEmptyKey() { - return QualType::getFromOpaquePtr((void*) 1); - } - static inline QualType getTombstoneKey() { - return QualType::getFromOpaquePtr((void*) 2); - } - static inline unsigned getHashValue(QualType T) { - assert(!T.getLocalFastQualifiers() && - "hash invalid for types with fast quals"); - uintptr_t v = reinterpret_cast<uintptr_t>(T.getAsOpaquePtr()); - return (unsigned(v) >> 4) ^ (unsigned(v) >> 9); - } -}; - /// \brief Writes an AST file containing the contents of a translation unit. /// /// The ASTWriter class produces a bitstream containing the serialized @@ -146,8 +127,7 @@ private: /// allow for the const/volatile qualifiers. /// /// Keys in the map never have const/volatile qualifiers. - llvm::DenseMap<QualType, serialization::TypeIdx, UnsafeQualTypeDenseMapInfo> - TypeIdxs; + serialization::TypeIdxMap TypeIdxs; /// \brief Offset of each type in the bitstream, indexed by /// the type's ID. @@ -368,13 +348,13 @@ public: serialization::TypeID GetOrCreateTypeID(QualType T); /// \brief Determine the type ID of an already-emitted type. - serialization::TypeID getTypeID(QualType T); + serialization::TypeID getTypeID(QualType T) const; /// \brief Force a type to be emitted and get its index. serialization::TypeIdx GetOrCreateTypeIdx(QualType T); /// \brief Determine the type index of an already-emitted type. - serialization::TypeIdx getTypeIdx(QualType T); + serialization::TypeIdx getTypeIdx(QualType T) const; /// \brief Emits a reference to a declarator info. void AddTypeSourceInfo(TypeSourceInfo *TInfo, RecordData &Record); |