From fffb6996c9aed10bdf8e40d09cc71fa9f70527ff Mon Sep 17 00:00:00 2001 From: Michael Kuperstein Date: Thu, 11 Dec 2014 12:41:10 +0000 Subject: 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 llvm-svn: 224015 --- llvm/lib/Transforms/Utils/InlineFunction.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp') diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index 147237e..0441d97 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -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(BI)) { + LLVMContext &Ctx = BI->getContext(); + MDNode *InlinedAt = BI->getDebugLoc().getInlinedAt(Ctx); + DDI->setOperand(1, MetadataAsValue::get( + Ctx, createInlinedVariable(DDI->getVariable(), + InlinedAt, Ctx))); } } } -- cgit v1.1