diff options
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Serialization/ASTReaderInternals.h')
-rw-r--r-- | contrib/llvm/tools/clang/lib/Serialization/ASTReaderInternals.h | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/contrib/llvm/tools/clang/lib/Serialization/ASTReaderInternals.h b/contrib/llvm/tools/clang/lib/Serialization/ASTReaderInternals.h index 99e8be5..3a1dfcf 100644 --- a/contrib/llvm/tools/clang/lib/Serialization/ASTReaderInternals.h +++ b/contrib/llvm/tools/clang/lib/Serialization/ASTReaderInternals.h @@ -15,6 +15,7 @@ #include "clang/Basic/OnDiskHashTable.h" #include "clang/AST/DeclarationName.h" +#include "llvm/Support/Endian.h" #include <utility> #include <sys/stat.h> @@ -26,7 +27,7 @@ struct HeaderFileInfo; namespace serialization { -class Module; +class ModuleFile; namespace reader { @@ -34,14 +35,15 @@ namespace reader { /// in an AST file. class ASTDeclContextNameLookupTrait { ASTReader &Reader; - Module &F; + ModuleFile &F; public: /// \brief Pair of begin/end iterators for DeclIDs. /// /// Note that these declaration IDs are local to the module that contains this /// particular lookup t - typedef std::pair<DeclID *, DeclID *> data_type; + typedef llvm::support::ulittle32_t LE32DeclID; + typedef std::pair<LE32DeclID *, LE32DeclID *> data_type; /// \brief Special internal key for declaration names. /// The hash table creates keys for comparison; we do not create @@ -56,7 +58,7 @@ public: typedef DeclNameKey internal_key_type; explicit ASTDeclContextNameLookupTrait(ASTReader &Reader, - Module &F) + ModuleFile &F) : Reader(Reader), F(F) { } static bool EqualKey(const internal_key_type& a, @@ -84,7 +86,7 @@ typedef OnDiskChainedHashTable<ASTDeclContextNameLookupTrait> /// \brief Class that performs lookup for an identifier stored in an AST file. class ASTIdentifierLookupTrait { ASTReader &Reader; - Module &F; + ModuleFile &F; // If we know the IdentifierInfo in advance, it is here and we will // not build a new one. Used when deserializing information about an @@ -98,7 +100,7 @@ public: typedef external_key_type internal_key_type; - ASTIdentifierLookupTrait(ASTReader &Reader, Module &F, + ASTIdentifierLookupTrait(ASTReader &Reader, ModuleFile &F, IdentifierInfo *II = 0) : Reader(Reader), F(F), KnownII(II) { } @@ -127,6 +129,9 @@ public: IdentifierInfo *ReadData(const internal_key_type& k, const unsigned char* d, unsigned DataLen); + + ASTReader &getReader() const { return Reader; } + }; /// \brief The on-disk hash table used to contain information about @@ -138,7 +143,7 @@ typedef OnDiskChainedHashTable<ASTIdentifierLookupTrait> /// method pool stored in an AST file. class ASTSelectorLookupTrait { ASTReader &Reader; - Module &F; + ModuleFile &F; public: struct data_type { @@ -150,7 +155,7 @@ public: typedef Selector external_key_type; typedef external_key_type internal_key_type; - ASTSelectorLookupTrait(ASTReader &Reader, Module &F) + ASTSelectorLookupTrait(ASTReader &Reader, ModuleFile &F) : Reader(Reader), F(F) { } static bool EqualKey(const internal_key_type& a, @@ -185,7 +190,7 @@ typedef OnDiskChainedHashTable<ASTSelectorLookupTrait> /// and symlinks. class HeaderFileInfoTrait { ASTReader &Reader; - Module &M; + ModuleFile &M; HeaderSearch *HS; const char *FrameworkStrings; const char *SearchPath; @@ -210,7 +215,7 @@ public: typedef HeaderFileInfo data_type; - HeaderFileInfoTrait(ASTReader &Reader, Module &M, HeaderSearch *HS, + HeaderFileInfoTrait(ASTReader &Reader, ModuleFile &M, HeaderSearch *HS, const char *FrameworkStrings, const char *SearchPath = 0) : Reader(Reader), M(M), HS(HS), FrameworkStrings(FrameworkStrings), |