diff options
author | Adrian Prantl <aprantl@apple.com> | 2016-01-22 17:43:43 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2016-01-22 17:43:43 +0000 |
commit | c96da8faa65b723899744b0fc5c23f4b286fcc02 (patch) | |
tree | a8573d46a492dd1cb316e52e7d23f3e524c8fd6c /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | fc80b6e5d816005a6ea33fc9107579a16bb73ae0 (diff) | |
download | bcm5719-llvm-c96da8faa65b723899744b0fc5c23f4b286fcc02.tar.gz bcm5719-llvm-c96da8faa65b723899744b0fc5c23f4b286fcc02.zip |
Module Debugging: Use a nonzero DWO id for precompiled headers.
PCH files don't have a module signature and LLVM uses a nonzero DWO id as
an indicator for skeleton / module CUs. This change pins the DWO id for PCH
files to a known constant value.
The correct long-term solution here is to implement a module signature
that is an actual dterministic hash (at the moment module signatures are
just random nonzero numbers) and then enable this for PCH files as well.
<rdar://problem/24290667>
llvm-svn: 258507
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 28e28489681..4e0cc3f8574 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1740,11 +1740,14 @@ CGDebugInfo::getOrCreateModuleRef(ExternalASTSource::ASTSourceDescriptor Mod, bool IsRootModule = M ? !M->Parent : true; if (CreateSkeletonCU && IsRootModule) { + // PCH files don't have a signature field in the control block, + // but LLVM detects skeleton CUs by looking for a non-zero DWO id. + uint64_t Signature = Mod.getSignature() ? Mod.getSignature() : ~1U; llvm::DIBuilder DIB(CGM.getModule()); DIB.createCompileUnit(TheCU->getSourceLanguage(), Mod.getModuleName(), Mod.getPath(), TheCU->getProducer(), true, StringRef(), 0, Mod.getASTFile(), - llvm::DIBuilder::FullDebug, Mod.getSignature()); + llvm::DIBuilder::FullDebug, Signature); DIB.finalize(); } llvm::DIModule *Parent = |