diff options
author | dim <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
commit | 173a4f43a911175643bda81ee675e8d9269056ea (patch) | |
tree | 47df2c12b57214af6c31e47404b005675b8b7ffc /include/clang/Serialization/Module.h | |
parent | 88f7a7d5251a2d813460274c92decc143a11569b (diff) | |
download | FreeBSD-src-173a4f43a911175643bda81ee675e8d9269056ea.zip FreeBSD-src-173a4f43a911175643bda81ee675e8d9269056ea.tar.gz |
Vendor import of clang RELEASE_350/final tag r216957 (effectively, 3.5.0 release):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_350/final@216957
Diffstat (limited to 'include/clang/Serialization/Module.h')
-rw-r--r-- | include/clang/Serialization/Module.h | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/include/clang/Serialization/Module.h b/include/clang/Serialization/Module.h index 89c604f..4952039 100644 --- a/include/clang/Serialization/Module.h +++ b/include/clang/Serialization/Module.h @@ -18,17 +18,21 @@ #include "clang/Basic/SourceLocation.h" #include "clang/Serialization/ASTBitCodes.h" #include "clang/Serialization/ContinuousRangeMap.h" -#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/SetVector.h" #include "llvm/Bitcode/BitstreamReader.h" +#include <memory> #include <string> +namespace llvm { +template <typename Info> class OnDiskChainedHashTable; +template <typename Info> class OnDiskIterableChainedHashTable; +} + namespace clang { class FileEntry; class DeclContext; class Module; -template<typename Info> class OnDiskChainedHashTable; namespace serialization { @@ -49,7 +53,7 @@ struct DeclContextInfo { DeclContextInfo() : NameLookupTableData(), LexicalDecls(), NumLexicalDecls() {} - OnDiskChainedHashTable<reader::ASTDeclContextNameLookupTrait> + llvm::OnDiskIterableChainedHashTable<reader::ASTDeclContextNameLookupTrait> *NameLookupTableData; // an ASTDeclContextNameLookupTable. const KindDeclIDPair *LexicalDecls; unsigned NumLexicalDecls; @@ -57,11 +61,12 @@ struct DeclContextInfo { /// \brief The input file that has been loaded from this AST file, along with /// bools indicating whether this was an overridden buffer or if it was -/// out-of-date. +/// out-of-date or not-found. class InputFile { enum { Overridden = 1, - OutOfDate = 2 + OutOfDate = 2, + NotFound = 3 }; llvm::PointerIntPair<const FileEntry *, 2, unsigned> Val; @@ -79,9 +84,16 @@ public: Val.setPointerAndInt(File, intVal); } + static InputFile getNotFound() { + InputFile File; + File.Val.setInt(NotFound); + return File; + } + const FileEntry *getFile() const { return Val.getPointer(); } bool isOverridden() const { return Val.getInt() == Overridden; } bool isOutOfDate() const { return Val.getInt() == OutOfDate; } + bool isNotFound() const { return Val.getInt() == NotFound; } }; /// \brief Information about a module that has been loaded by the ASTReader. @@ -107,6 +119,13 @@ public: /// \brief The file name of the module file. std::string FileName; + /// \brief The name of the module. + std::string ModuleName; + + std::string getTimestampFilename() const { + return FileName + ".timestamp"; + } + /// \brief The original source file name that was used to build the /// primary AST file, which may have been modified for /// relocatable-pch support. @@ -124,6 +143,8 @@ public: /// allow resolving headers even after headers+PCH was moved to a new path. std::string OriginalDir; + std::string ModuleMapPath; + /// \brief Whether this precompiled header is a relocatable PCH file. bool RelocatablePCH; @@ -139,7 +160,7 @@ public: /// \brief The memory buffer that stores the data associated with /// this AST file. - OwningPtr<llvm::MemoryBuffer> Buffer; + std::unique_ptr<llvm::MemoryBuffer> Buffer; /// \brief The size of this file, in bits. uint64_t SizeInBits; @@ -159,6 +180,9 @@ public: /// If module A depends on and imports module B, both modules will have the /// same DirectImportLoc, but different ImportLoc (B's ImportLoc will be a /// source location inside module A). + /// + /// WARNING: This is largely useless. It doesn't tell you when a module was + /// made visible, just when the first submodule of that module was imported. SourceLocation DirectImportLoc; /// \brief The source location where this module was first imported. @@ -177,6 +201,12 @@ public: /// \brief The input files that have been loaded from this AST file. std::vector<InputFile> InputFilesLoaded; + /// \brief If non-zero, specifies the time when we last validated input + /// files. Zero means we never validated them. + /// + /// The time is specified in seconds since the start of the Epoch. + uint64_t InputFilesValidationTimestamp; + // === Source Locations === /// \brief Cursor used to read source location entries. |