[llvm-commits] [llvm] r109503 - /llvm/trunk/lib/Analysis/InlineCost.cpp
Gabor Greif
ggreif at gmail.com
Tue Jul 27 07:15:29 PDT 2010
Author: ggreif
Date: Tue Jul 27 09:15:29 2010
New Revision: 109503
URL: http://llvm.org/viewvc/llvm-project?rev=109503&view=rev
Log:
use ImmutableCallSite for const-corrgoodness
Modified:
llvm/trunk/lib/Analysis/InlineCost.cpp
Modified: llvm/trunk/lib/Analysis/InlineCost.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InlineCost.cpp?rev=109503&r1=109502&r2=109503&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/InlineCost.cpp (original)
+++ llvm/trunk/lib/Analysis/InlineCost.cpp Tue Jul 27 09:15:29 2010
@@ -152,14 +152,14 @@
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;
More information about the llvm-commits
mailing list