summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-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