From 41e66dade1599576ffeb81941b6cbadb51e77c5d Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 6 Aug 2016 12:33:46 +0000 Subject: [Inliner] Use function_ref for functors which are never taken ownership of. llvm-svn: 277922 --- llvm/lib/Transforms/IPO/Inliner.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'llvm/lib') diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp index 3294fd3e26f..d676c09222a 100644 --- a/llvm/lib/Transforms/IPO/Inliner.cpp +++ b/llvm/lib/Transforms/IPO/Inliner.cpp @@ -94,7 +94,7 @@ typedef DenseMap> InlinedArrayAllocasTy; static bool InlineCallIfPossible( CallSite CS, InlineFunctionInfo &IFI, InlinedArrayAllocasTy &InlinedArrayAllocas, int InlineHistory, - bool InsertLifetime, std::function &AARGetter, + bool InsertLifetime, function_ref AARGetter, ImportedFunctionsInliningStatistics &ImportedFunctionsStats) { Function *Callee = CS.getCalledFunction(); Function *Caller = CS.getCaller(); @@ -252,7 +252,7 @@ static void emitAnalysis(CallSite CS, const Twine &Msg) { static bool shouldBeDeferred(Function *Caller, CallSite CS, InlineCost IC, int &TotalSecondaryCost, - std::function &GetInlineCost) { + function_ref GetInlineCost) { // For now we only handle local or inline functions. if (!Caller->hasLocalLinkage() && !Caller->hasLinkOnceODRLinkage()) @@ -323,7 +323,7 @@ shouldBeDeferred(Function *Caller, CallSite CS, InlineCost IC, /// Return true if the inliner should attempt to inline at the given CallSite. static bool shouldInline(CallSite CS, - std::function GetInlineCost) { + function_ref GetInlineCost) { InlineCost IC = GetInlineCost(CS); if (IC.isAlways()) { @@ -408,8 +408,8 @@ inlineCallsImpl(CallGraphSCC &SCC, CallGraph &CG, std::function GetAssumptionCache, ProfileSummaryInfo *PSI, TargetLibraryInfo &TLI, bool InsertLifetime, - std::function GetInlineCost, - std::function AARGetter, + function_ref GetInlineCost, + function_ref AARGetter, ImportedFunctionsInliningStatistics &ImportedFunctionsStats) { SmallPtrSet SCCFunctions; DEBUG(dbgs() << "Inliner visiting SCC:"); -- cgit v1.2.3