summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-06-15 00:19:52 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-06-15 00:19:52 +0000
commit577be0fed36f4d26e767a39a7838c63e90574e13 (patch)
tree8afdece13c65d90f0cbc5d5debfca52bc64c2f0e /llvm/lib/CodeGen/AsmPrinter
parentcbf614a93b1d59655e7749df1a31b5cb4ac29972 (diff)
downloadbcm5719-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.cpp5
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);
OpenPOWER on IntegriCloud