diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-22 23:07:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-22 23:07:58 +0000 |
commit | 60915146f4d35e12f10dcdaa155596fac79184da (patch) | |
tree | ac5782ad8e8a3ff4627855e7f04872b92f66e658 /lib/Transforms/IPO/PartialInlining.cpp | |
parent | 9517144f5395ee88f0e5a22afd2ca1905a344e68 (diff) |
refactor the interface to InlineFunction so that most of the in/out
arguments are handled with a new InlineFunctionInfo class. This
makes it easier to extend InlineFunction to return more info in the
future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102137 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/PartialInlining.cpp')
-rw-r--r-- | lib/Transforms/IPO/PartialInlining.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Transforms/IPO/PartialInlining.cpp b/lib/Transforms/IPO/PartialInlining.cpp index f8ec722273..07525eaada 100644 --- a/lib/Transforms/IPO/PartialInlining.cpp +++ b/lib/Transforms/IPO/PartialInlining.cpp @@ -120,15 +120,17 @@ Function* PartialInliner::unswitchFunction(Function* F) { // Extract the body of the if. Function* extractedFunction = ExtractCodeRegion(DT, toExtract); + InlineFunctionInfo IFI; + // Inline the top-level if test into all callers. std::vector<User*> Users(duplicateFunction->use_begin(), duplicateFunction->use_end()); for (std::vector<User*>::iterator UI = Users.begin(), UE = Users.end(); UI != UE; ++UI) - if (CallInst* CI = dyn_cast<CallInst>(*UI)) - InlineFunction(CI); - else if (InvokeInst* II = dyn_cast<InvokeInst>(*UI)) - InlineFunction(II); + if (CallInst *CI = dyn_cast<CallInst>(*UI)) + InlineFunction(CI, IFI); + else if (InvokeInst *II = dyn_cast<InvokeInst>(*UI)) + InlineFunction(II, IFI); // Ditch the duplicate, since we're done with it, and rewrite all remaining // users (function pointers, etc.) back to the original function. |