diff options
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index eb1c50f..b3733a2 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -41,6 +41,7 @@ #include "clang/Lex/HeaderSearchOptions.h" #include "clang/Lex/PreprocessorOptions.h" #include "clang/Sema/CodeCompleteOptions.h" +#include "clang/Serialization/ASTBitCodes.h" #include "clang/Serialization/ModuleFileExtension.h" #include "clang/StaticAnalyzer/Core/AnalyzerOptions.h" #include "llvm/ADT/APInt.h" @@ -3635,6 +3636,11 @@ std::string CompilerInvocation::getModuleHash() const { // CityHash, but this will do for now. hash_code code = hash_value(getClangFullRepositoryVersion()); + // Also include the serialization version, in case LLVM_APPEND_VC_REV is off + // and getClangFullRepositoryVersion() doesn't include git revision. + code = hash_combine(code, serialization::VERSION_MAJOR, + serialization::VERSION_MINOR); + // Extend the signature with the language options #define LANGOPT(Name, Bits, Default, Description) \ code = hash_combine(code, LangOpts->Name); |