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 | 4ba01ec869a82800490747646b8b02cab203484f (patch) | |
tree | e67432ab43f7332f1e3971e1b5e084fa759ed7d7 /llvm/lib/Transforms/IPO/PartialInlining.cpp | |
parent | 894874e7aff94d5b2a630df7693f91f8b9fff410 (diff) | |
download | llvm-4ba01ec869a82800490747646b8b02cab203484f.zip llvm-4ba01ec869a82800490747646b8b02cab203484f.tar.gz llvm-4ba01ec869a82800490747646b8b02cab203484f.tar.bz2 |
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.
llvm-svn: 102137
Diffstat (limited to 'llvm/lib/Transforms/IPO/PartialInlining.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/PartialInlining.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/IPO/PartialInlining.cpp b/llvm/lib/Transforms/IPO/PartialInlining.cpp index f8ec722..07525ea 100644 --- a/llvm/lib/Transforms/IPO/PartialInlining.cpp +++ b/llvm/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. |