diff options
Diffstat (limited to 'llvm/lib/Transforms/IPO/Inliner.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/Inliner.cpp | 5 |
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 |