diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-07-28 22:50:26 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-07-28 22:50:26 +0000 |
commit | 62f0aac99d5e3c6d2e23e002dd57d9a8f4e6cf2d (patch) | |
tree | d89b0c670cd72edbcc266cc3aaf82c1f2e2bfd57 /llvm/lib/Transforms/IPO/Inliner.cpp | |
parent | cfc2a57fcdac7ba32ebbd8f4c4b571427ceaabed (diff) | |
download | bcm5719-llvm-62f0aac99d5e3c6d2e23e002dd57d9a8f4e6cf2d.tar.gz bcm5719-llvm-62f0aac99d5e3c6d2e23e002dd57d9a8f4e6cf2d.zip |
simplify by using CallSite constructors; virtually eliminates CallSite::get from the tree
llvm-svn: 109687
Diffstat (limited to 'llvm/lib/Transforms/IPO/Inliner.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/Inliner.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp index 9bb01f5699f..876e80e5371 100644 --- a/llvm/lib/Transforms/IPO/Inliner.cpp +++ b/llvm/lib/Transforms/IPO/Inliner.cpp @@ -238,11 +238,11 @@ bool Inliner::shouldInline(CallSite CS) { bool someOuterCallWouldNotBeInlined = false; for (Value::use_iterator I = Caller->use_begin(), E =Caller->use_end(); I != E; ++I) { - CallSite CS2 = CallSite::get(*I); + CallSite CS2(*I); // If this isn't a call to Caller (it could be some other sort // of reference) skip it. - if (CS2.getInstruction() == 0 || CS2.getCalledFunction() != Caller) + if (!CS2 || CS2.getCalledFunction() != Caller) continue; InlineCost IC2 = getInlineCost(CS2); @@ -334,10 +334,10 @@ bool Inliner::runOnSCC(CallGraphSCC &SCC) { for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) { - CallSite CS = CallSite::get(I); + CallSite CS(cast<Value>(I)); // If this isn't a call, or it is a call to an intrinsic, it can // never be inlined. - if (CS.getInstruction() == 0 || isa<IntrinsicInst>(I)) + if (!CS || isa<IntrinsicInst>(I)) continue; // If this is a direct call to an external function, we can never inline |