summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2017-05-26 17:05:15 +0000
committerDavid Blaikie <dblaikie@gmail.com>2017-05-26 17:05:15 +0000
commit7f2b717b52f9a3884ef0f1d8a3704097892d988c (patch)
tree01c40454b8ec75229e092becef68ff73d36d1209 /llvm/lib
parentdde28a8c92683e068cec7901353f4f3d8f3bc9a0 (diff)
downloadbcm5719-llvm-7f2b717b52f9a3884ef0f1d8a3704097892d988c.tar.gz
bcm5719-llvm-7f2b717b52f9a3884ef0f1d8a3704097892d988c.zip
DebugInfo: Don't include locations for debug-having code inlined into nodebug functions
This produced 'strange' DWARF anyway - the CU would have no ranges (or at least not a range including the inlined code) nor any subprogram or inlined_subroutine - yet the line table would have entries for these instructions. (this actually becomes more relevant with changes coming after this, where a CU without any contents will be omitted entirely - so there would be no line table to put this on anyway) llvm-svn: 304004
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index b696312fd28..3ea4c1c2775 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1036,6 +1036,10 @@ void DwarfDebug::beginInstruction(const MachineInstr *MI) {
DebugHandlerBase::beginInstruction(MI);
assert(CurMI);
+ const auto *SP = MI->getParent()->getParent()->getFunction()->getSubprogram();
+ if (!SP || SP->getUnit()->getEmissionKind() == DICompileUnit::NoDebug)
+ return;
+
// Check if source location changes, but ignore DBG_VALUE and CFI locations.
if (MI->isMetaInstruction())
return;
OpenPOWER on IntegriCloud