mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 04:24:00 +00:00
Do not attribute static allocas to the call site's DebugLoc.
When functions are inlined, instructions without debug information are attributed to the call site's DebugLoc. After inlining, inlined static allocas are moved to the caller's entry block, adjacent to the caller's original static alloca instructions. By retaining the call site's DebugLoc, these instructions could cause instructions that were subsequently inserted at the entry block to pick up the same DebugLoc. Patch by Wolfgang Pieb! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220255 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -856,6 +856,12 @@ static void fixupLineNumbers(Function *Fn, Function::iterator FI,
|
||||
// originates from the call location. This is important for
|
||||
// ((__always_inline__, __nodebug__)) functions which must use caller
|
||||
// location for all instructions in their function body.
|
||||
|
||||
// Don't update static allocas, as they may get moved later.
|
||||
if (auto *AI = dyn_cast<AllocaInst>(BI))
|
||||
if (isa<Constant>(AI->getArraySize()))
|
||||
continue;
|
||||
|
||||
BI->setDebugLoc(TheCallDL);
|
||||
} else {
|
||||
BI->setDebugLoc(updateInlinedAtInfo(DL, TheCallDL, BI->getContext()));
|
||||
|
Reference in New Issue
Block a user