aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2018-11-29 22:33:09 +0000
committerAdrian Prantl <aprantl@apple.com>2018-11-29 22:33:09 +0000
commit55fcb4e90eab0777ced11e6607ee83ed724b4fd8 (patch)
treeb3412066f26d23bd2e21922894c7d568578e3fd8 /clang/lib/Frontend/CompilerInvocation.cpp
parent12ccfed3ff841b773463c508f5629d2a5b092d16 (diff)
downloadllvm-55fcb4e90eab0777ced11e6607ee83ed724b4fd8.zip
llvm-55fcb4e90eab0777ced11e6607ee83ed724b4fd8.tar.gz
llvm-55fcb4e90eab0777ced11e6607ee83ed724b4fd8.tar.bz2
[-gmodules] Honor -fdebug-prefix-map in the debug info inside PCMs.
This patch passes -fdebug-prefix-map (a feature for renaming source paths in the debug info) through to the per-module codegen options and adds the debug prefix map to the module hash. <rdar://problem/46045865> Differential Revision: https://reviews.llvm.org/D55037 llvm-svn: 347926
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 8840e2e..f511fdc 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -3264,6 +3264,12 @@ std::string CompilerInvocation::getModuleHash() const {
code = ext->hashExtension(code);
}
+ // When compiling with -gmodules, also hash -fdebug-prefix-map as it
+ // affects the debug info in the PCM.
+ if (getCodeGenOpts().DebugTypeExtRefs)
+ for (const auto &KeyValue : getCodeGenOpts().DebugPrefixMap)
+ code = hash_combine(code, KeyValue.first, KeyValue.second);
+
// Extend the signature with the enabled sanitizers, if at least one is
// enabled. Sanitizers which cannot affect AST generation aren't hashed.
SanitizerSet SanHash = LangOpts->Sanitize;