summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2014-04-17 12:22:14 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2014-04-17 12:22:14 +0000
commitcd1fc4bc1b64e9c5d78543f0e9eabb95afdbb0aa (patch)
tree51c508d85847df336129bbe4b9fcc55103a685d6 /llvm/lib/Transforms
parentae8e0d8da9de8eb1cf81fb0e24e9dfda43957aab (diff)
downloadbcm5719-llvm-cd1fc4bc1b64e9c5d78543f0e9eabb95afdbb0aa.tar.gz
bcm5719-llvm-cd1fc4bc1b64e9c5d78543f0e9eabb95afdbb0aa.zip
Inliner::OptimizationRemark: Fix crash in clang/test/Frontend/optimization-remark.c on some hosts, including --vg.
DebugLoc in Callsite would not live after Inliner. It should be copied before Inliner. llvm-svn: 206459
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/Inliner.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp
index 17be3b2b447..6d3ceef86c8 100644
--- a/llvm/lib/Transforms/IPO/Inliner.cpp
+++ b/llvm/lib/Transforms/IPO/Inliner.cpp
@@ -518,6 +518,9 @@ bool Inliner::runOnSCC(CallGraphSCC &SCC) {
if (!shouldInline(CS))
continue;
+ // Get DebugLoc to report. CS will be invalid after Inliner.
+ DebugLoc DLoc = CS.getInstruction()->getDebugLoc();
+
// Attempt to inline the function.
if (!InlineCallIfPossible(CS, InlineInfo, InlinedArrayAllocas,
InlineHistoryID, InsertLifetime, DL))
@@ -526,7 +529,7 @@ bool Inliner::runOnSCC(CallGraphSCC &SCC) {
// Report the inline decision.
Caller->getContext().emitOptimizationRemark(
- DEBUG_TYPE, *Caller, CS.getInstruction()->getDebugLoc(),
+ DEBUG_TYPE, *Caller, DLoc,
Twine(Callee->getName() + " inlined into " + Caller->getName()));
// If inlining this function gave us any new call sites, throw them
OpenPOWER on IntegriCloud