mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Fix line numbers for code inlined from __nodebug__ functions.
Instructions from __nodebug__ functions don't have file:line information even when inlined into no-nodebug functions. As a result, intrinsics (SSE and other) from <*intrin.h> clang headers _never_ have file:line information. With this change, an instruction without !dbg metadata gets one from the call instruction when inlined. Fixes PR19001. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210459 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -466,7 +466,13 @@ static void fixupLineNumbers(Function *Fn, Function::iterator FI,
|
||||
for (BasicBlock::iterator BI = FI->begin(), BE = FI->end();
|
||||
BI != BE; ++BI) {
|
||||
DebugLoc DL = BI->getDebugLoc();
|
||||
if (!DL.isUnknown()) {
|
||||
if (DL.isUnknown()) {
|
||||
// If the inlined instruction has no line number, make it look as if it
|
||||
// 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.
|
||||
BI->setDebugLoc(TheCallDL);
|
||||
} else {
|
||||
BI->setDebugLoc(updateInlinedAtInfo(DL, TheCallDL, BI->getContext()));
|
||||
if (DbgValueInst *DVI = dyn_cast<DbgValueInst>(BI)) {
|
||||
LLVMContext &Ctx = BI->getContext();
|
||||
|
Reference in New Issue
Block a user