]> granicus.if.org Git - clang/commitdiff
Module debugging: Make the module format part of the module hash instead
authorAdrian Prantl <aprantl@apple.com>
Tue, 12 Jan 2016 21:01:56 +0000 (21:01 +0000)
committerAdrian Prantl <aprantl@apple.com>
Tue, 12 Jan 2016 21:01:56 +0000 (21:01 +0000)
of the file name. This is consistent with how other HeaderSearchOptions
are handled.

Due to the other inputs of the module hash (revision number) this is not
really testable in a meaningful way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257520 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/CompilerInvocation.cpp
lib/Lex/HeaderSearch.cpp

index 26bf013e0c24a59e75c872c5efe1aa8534805d5c..237a44704096855fbae721e472007ad2141bea65 100644 (file)
@@ -2202,8 +2202,11 @@ std::string CompilerInvocation::getModuleHash() const {
     code = hash_combine(code, I->first, I->second);
   }
 
-  // Extend the signature with the sysroot.
-  code = hash_combine(code, hsOpts.Sysroot, hsOpts.UseBuiltinIncludes,
+  // Extend the signature with the sysroot and other header search options.
+  code = hash_combine(code, hsOpts.Sysroot,
+                      hsOpts.ModuleFormat,
+                      hsOpts.UseDebugInfo,
+                      hsOpts.UseBuiltinIncludes,
                       hsOpts.UseStandardSystemIncludes,
                       hsOpts.UseStandardCXXIncludes,
                       hsOpts.UseLibcxx);
index 8a686a7f3d74e5a91d3c996598aef93b8ef88924..2d005dd2e1f07c437a9645fe5948629533f364ab 100644 (file)
@@ -153,8 +153,7 @@ std::string HeaderSearch::getModuleFileName(StringRef ModuleName,
     auto FileName = llvm::sys::path::filename(ModuleMapPath);
 
     llvm::hash_code Hash =
-      llvm::hash_combine(DirName.lower(), FileName.lower(),
-                         HSOpts->ModuleFormat, HSOpts->UseDebugInfo);
+      llvm::hash_combine(DirName.lower(), FileName.lower());
 
     SmallString<128> HashStr;
     llvm::APInt(64, size_t(Hash)).toStringUnsigned(HashStr, /*Radix*/36);