summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-08-06 12:33:46 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-08-06 12:33:46 +0000
commit41e66dade1599576ffeb81941b6cbadb51e77c5d (patch)
tree6e0d17bd0ddcf4daa9d46cc5b31f747b2241f67f /llvm/lib/Transforms
parenta3d4def878e30e1dc38c006dc49731959619fc67 (diff)
downloadbcm5719-llvm-41e66dade1599576ffeb81941b6cbadb51e77c5d.tar.gz
bcm5719-llvm-41e66dade1599576ffeb81941b6cbadb51e77c5d.zip
[Inliner] Use function_ref for functors which are never taken ownership of.
llvm-svn: 277922
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/Inliner.cpp10
1 files changed, 5 insertions, 5 deletions
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<ArrayType *, std::vector<AllocaInst *>> InlinedArrayAllocasTy;
static bool InlineCallIfPossible(
CallSite CS, InlineFunctionInfo &IFI,
InlinedArrayAllocasTy &InlinedArrayAllocas, int InlineHistory,
- bool InsertLifetime, std::function<AAResults &(Function &)> &AARGetter,
+ bool InsertLifetime, function_ref<AAResults &(Function &)> 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<InlineCost(CallSite CS)> &GetInlineCost) {
+ function_ref<InlineCost(CallSite CS)> 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<InlineCost(CallSite CS)> GetInlineCost) {
+ function_ref<InlineCost(CallSite CS)> GetInlineCost) {
InlineCost IC = GetInlineCost(CS);
if (IC.isAlways()) {
@@ -408,8 +408,8 @@ inlineCallsImpl(CallGraphSCC &SCC, CallGraph &CG,
std::function<AssumptionCache &(Function &)> GetAssumptionCache,
ProfileSummaryInfo *PSI, TargetLibraryInfo &TLI,
bool InsertLifetime,
- std::function<InlineCost(CallSite CS)> GetInlineCost,
- std::function<AAResults &(Function &)> AARGetter,
+ function_ref<InlineCost(CallSite CS)> GetInlineCost,
+ function_ref<AAResults &(Function &)> AARGetter,
ImportedFunctionsInliningStatistics &ImportedFunctionsStats) {
SmallPtrSet<Function *, 8> SCCFunctions;
DEBUG(dbgs() << "Inliner visiting SCC:");
OpenPOWER on IntegriCloud