The inliner needs to fix up debug information for llvm.dbg.declare, not only for llvm.dbg.value.

Patch by Amjad Aboud

Differential Revision: http://reviews.llvm.org/D6525


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224015 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Michael Kuperstein
2014-12-11 12:41:10 +00:00
parent 0378ed4368
commit 1696b35ff1
2 changed files with 102 additions and 0 deletions

View File

@@ -872,6 +872,12 @@ static void fixupLineNumbers(Function *Fn, Function::iterator FI,
DVI->setOperand(2, MetadataAsValue::get(
Ctx, createInlinedVariable(DVI->getVariable(),
InlinedAt, Ctx)));
} else if (DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(BI)) {
LLVMContext &Ctx = BI->getContext();
MDNode *InlinedAt = BI->getDebugLoc().getInlinedAt(Ctx);
DDI->setOperand(1, MetadataAsValue::get(
Ctx, createInlinedVariable(DDI->getVariable(),
InlinedAt, Ctx)));
}
}
}