diff options
Diffstat (limited to 'clang/include/clang')
-rw-r--r-- | clang/include/clang/Serialization/ASTBitCodes.h | 5 | ||||
-rw-r--r-- | clang/include/clang/Serialization/ASTReader.h | 1 | ||||
-rw-r--r-- | clang/include/clang/Serialization/Module.h | 6 | ||||
-rw-r--r-- | clang/include/clang/Serialization/ModuleManager.h | 9 |
4 files changed, 20 insertions, 1 deletions
diff --git a/clang/include/clang/Serialization/ASTBitCodes.h b/clang/include/clang/Serialization/ASTBitCodes.h index 26e0ecde15c..241c62e4ced 100644 --- a/clang/include/clang/Serialization/ASTBitCodes.h +++ b/clang/include/clang/Serialization/ASTBitCodes.h @@ -288,7 +288,10 @@ namespace clang { /// \brief Record code for the module map file that was used to build this /// AST file. - MODULE_MAP_FILE = 14 + MODULE_MAP_FILE = 14, + + /// \brief Record code for the signature that identifiers this AST file. + SIGNATURE = 15 }; /// \brief Record types that occur within the input-files block diff --git a/clang/include/clang/Serialization/ASTReader.h b/clang/include/clang/Serialization/ASTReader.h index 730a257bca8..d967ec8d212 100644 --- a/clang/include/clang/Serialization/ASTReader.h +++ b/clang/include/clang/Serialization/ASTReader.h @@ -1125,6 +1125,7 @@ private: SourceLocation ImportLoc, ModuleFile *ImportedBy, SmallVectorImpl<ImportedModule> &Loaded, off_t ExpectedSize, time_t ExpectedModTime, + serialization::ASTFileSignature ExpectedSignature, unsigned ClientLoadCapabilities); ASTReadResult ReadControlBlock(ModuleFile &F, SmallVectorImpl<ImportedModule> &Loaded, diff --git a/clang/include/clang/Serialization/Module.h b/clang/include/clang/Serialization/Module.h index a889e8b6540..f6889cfe8e1 100644 --- a/clang/include/clang/Serialization/Module.h +++ b/clang/include/clang/Serialization/Module.h @@ -97,6 +97,8 @@ public: bool isNotFound() const { return Val.getInt() == NotFound; } }; +typedef unsigned ASTFileSignature; + /// \brief Information about a module that has been loaded by the ASTReader. /// /// Each instance of the Module class corresponds to a single AST file, which @@ -152,6 +154,10 @@ public: /// \brief The file entry for the module file. const FileEntry *File; + /// \brief The signature of the module file, which may be used along with size + /// and modification time to identify this particular file. + ASTFileSignature Signature; + /// \brief Whether this module has been directly imported by the /// user. bool DirectlyImported; diff --git a/clang/include/clang/Serialization/ModuleManager.h b/clang/include/clang/Serialization/ModuleManager.h index 96c3619510a..3d10fad0a1b 100644 --- a/clang/include/clang/Serialization/ModuleManager.h +++ b/clang/include/clang/Serialization/ModuleManager.h @@ -179,6 +179,12 @@ public: /// \param ExpectedModTime The expected modification time of the module /// file, used for validation. This will be zero if unknown. /// + /// \param ExpectedSignature The expected signature of the module file, used + /// for validation. This will be zero if unknown. + /// + /// \param ReadSignature Reads the signature from an AST file without actually + /// loading it. + /// /// \param Module A pointer to the module file if the module was successfully /// loaded. /// @@ -191,6 +197,9 @@ public: SourceLocation ImportLoc, ModuleFile *ImportedBy, unsigned Generation, off_t ExpectedSize, time_t ExpectedModTime, + ASTFileSignature ExpectedSignature, + std::function<ASTFileSignature(llvm::BitstreamReader &)> + ReadSignature, ModuleFile *&Module, std::string &ErrorStr); |