summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-07-27 14:15:29 +0000
committerGabor Greif <ggreif@gmail.com>2010-07-27 14:15:29 +0000
commitd59498bc972722083dcb559cf7ad6a17c3287693 (patch)
tree54dc49c433346e3b5f37eb33bde44c7ef8089b6e /llvm/lib
parent7527b2ed5ca708b879d4ba779dfbaa8616307d86 (diff)
downloadbcm5719-llvm-d59498bc972722083dcb559cf7ad6a17c3287693.tar.gz
bcm5719-llvm-d59498bc972722083dcb559cf7ad6a17c3287693.zip
use ImmutableCallSite for const-corrgoodness
llvm-svn: 109503
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index b1df517c2a9..3e550f35c25 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -152,14 +152,14 @@ void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB) {
if (isa<CallInst>(II) || isa<InvokeInst>(II)) {
if (isa<DbgInfoIntrinsic>(II))
continue; // Debug intrinsics don't count as size.
-
- CallSite CS = CallSite::get(const_cast<Instruction*>(&*II));
-
+
+ ImmutableCallSite CS(cast<Instruction>(II));
+
// If this function contains a call to setjmp or _setjmp, never inline
// it. This is a hack because we depend on the user marking their local
// variables as volatile if they are live across a setjmp call, and they
// probably won't do this in callers.
- if (Function *F = CS.getCalledFunction()) {
+ if (const Function *F = CS.getCalledFunction()) {
if (F->isDeclaration() &&
(F->getName() == "setjmp" || F->getName() == "_setjmp"))
callsSetJmp = true;
OpenPOWER on IntegriCloud