aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
diff options
context:
space:
mode:
authorSriraman Tallam <tmsriram@google.com>2020-09-24 14:37:56 -0700
committerSriraman Tallam <tmsriram@google.com>2020-09-24 14:41:49 -0700
commite39286510deb59730c40fa662a44e73f484ea1c2 (patch)
tree50c2e4ddfecfa45feb8c3f0a0e5771f38bcde6df /llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
parent506b6170cb513f1cb6e93a3b690c758f9ded18ac (diff)
downloadllvm-e39286510deb59730c40fa662a44e73f484ea1c2.zip
llvm-e39286510deb59730c40fa662a44e73f484ea1c2.tar.gz
llvm-e39286510deb59730c40fa662a44e73f484ea1c2.tar.bz2
Temporary fix for D85085 debug_loc bug with basic block sections.
Until then, this one line fix removes the assert fail with basic block sections with debug info. Bug tracking this: #47549 This fix does not generate loc list or DW_AT_const_value if the argument is mentioned in a different section than the start of the function. Temporarily fixes bugzilla : https://bugs.llvm.org/show_bug.cgi?id=47549 Differential Revision: https://reviews.llvm.org/D87787
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
index 9693248..826c507 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
@@ -220,10 +220,16 @@ void DebugHandlerBase::beginFunction(const MachineFunction *MF) {
// doing that violates the ranges that are calculated in the history map.
// However, we currently do not emit debug values for constant arguments
// directly at the start of the function, so this code is still useful.
+ // FIXME: If the first mention of an argument is in a unique section basic
+ // block, we cannot always assign the CurrentFnBeginLabel as it lies in a
+ // different section. Temporarily, we disable generating loc list
+ // information or DW_AT_const_value when the block is in a different
+ // section.
const DILocalVariable *DIVar =
Entries.front().getInstr()->getDebugVariable();
if (DIVar->isParameter() &&
- getDISubprogram(DIVar->getScope())->describes(&MF->getFunction())) {
+ getDISubprogram(DIVar->getScope())->describes(&MF->getFunction()) &&
+ Entries.front().getInstr()->getParent()->sameSection(&MF->front())) {
if (!IsDescribedByReg(Entries.front().getInstr()))
LabelsBeforeInsn[Entries.front().getInstr()] = Asm->getFunctionBegin();
if (Entries.front().getInstr()->getDebugExpression()->isFragment()) {