diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-07-27 14:15:29 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-07-27 14:15:29 +0000 |
commit | 0de11e0e66269aa63710416c2671c6ca33d065ff (patch) | |
tree | 44f9e87196f471bba6e54fbce5c79b759a235c1e /lib/Analysis/InlineCost.cpp | |
parent | 50da18171e17d22ef8009f01b7b4f332c5ec24ab (diff) | |
download | external_llvm-0de11e0e66269aa63710416c2671c6ca33d065ff.zip external_llvm-0de11e0e66269aa63710416c2671c6ca33d065ff.tar.gz external_llvm-0de11e0e66269aa63710416c2671c6ca33d065ff.tar.bz2 |
use ImmutableCallSite for const-corrgoodness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109503 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/InlineCost.cpp')
-rw-r--r-- | lib/Analysis/InlineCost.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Analysis/InlineCost.cpp b/lib/Analysis/InlineCost.cpp index b1df517..3e550f3 100644 --- a/lib/Analysis/InlineCost.cpp +++ b/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; |