diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-06-15 00:19:52 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-06-15 00:19:52 +0000 |
commit | 577be0fed36f4d26e767a39a7838c63e90574e13 (patch) | |
tree | 8afdece13c65d90f0cbc5d5debfca52bc64c2f0e /llvm/lib/CodeGen/AsmPrinter | |
parent | cbf614a93b1d59655e7749df1a31b5cb4ac29972 (diff) | |
download | bcm5719-llvm-577be0fed36f4d26e767a39a7838c63e90574e13.tar.gz bcm5719-llvm-577be0fed36f4d26e767a39a7838c63e90574e13.zip |
[CodeView] Don't emit debuginfo for imported symbols
Emitting symbol information requires us to have a definition for the
symbol. A symbol reference is insufficient.
This fixes PR28123.
llvm-svn: 272738
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index a90ce05249e..3b7815f3e0b 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -249,7 +249,8 @@ void CodeViewDebug::endModule() { // Emit per-function debug information. for (auto &P : FnDebugInfo) - emitDebugInfoForFunction(P.first, P.second); + if (!P.first->isDeclarationForLinker()) + emitDebugInfoForFunction(P.first, P.second); // Emit global variable debug information. emitDebugInfoForGlobals(); @@ -1318,7 +1319,7 @@ void CodeViewDebug::emitDebugInfoForGlobals() { MCSymbol *EndLabel = nullptr; for (const DIGlobalVariable *G : CU->getGlobalVariables()) { if (const auto *GV = dyn_cast_or_null<GlobalVariable>(G->getVariable())) { - if (!GV->hasComdat()) { + if (!GV->hasComdat() && !GV->isDeclarationForLinker()) { if (!EndLabel) { OS.AddComment("Symbol subsection for globals"); EndLabel = beginCVSubsection(ModuleSubstreamKind::Symbols); |