aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorMichael Kuperstein <michael.m.kuperstein@intel.com>2014-12-11 12:41:10 +0000
committerMichael Kuperstein <michael.m.kuperstein@intel.com>2014-12-11 12:41:10 +0000
commitfffb6996c9aed10bdf8e40d09cc71fa9f70527ff (patch)
tree761ee695d0bd23d6d64d7a5d21a913f4e77f6290 /llvm/lib/Transforms/Utils/InlineFunction.cpp
parent0b1db0a535e3eeef8dbce0d4ec98419392f05777 (diff)
downloadllvm-fffb6996c9aed10bdf8e40d09cc71fa9f70527ff.zip
llvm-fffb6996c9aed10bdf8e40d09cc71fa9f70527ff.tar.gz
llvm-fffb6996c9aed10bdf8e40d09cc71fa9f70527ff.tar.bz2
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
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp6
1 files changed, 6 insertions, 0 deletions
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<DbgDeclareInst>(BI)) {
+ LLVMContext &Ctx = BI->getContext();
+ MDNode *InlinedAt = BI->getDebugLoc().getInlinedAt(Ctx);
+ DDI->setOperand(1, MetadataAsValue::get(
+ Ctx, createInlinedVariable(DDI->getVariable(),
+ InlinedAt, Ctx)));
}
}
}