diff --git a/lib/Analysis/InlineCost.cpp b/lib/Analysis/InlineCost.cpp index b1df517c2a9..3e550f35c25 100644 --- a/lib/Analysis/InlineCost.cpp +++ b/lib/Analysis/InlineCost.cpp @@ -152,14 +152,14 @@ void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB) { if (isa(II) || isa(II)) { if (isa(II)) continue; // Debug intrinsics don't count as size. - - CallSite CS = CallSite::get(const_cast(&*II)); - + + ImmutableCallSite CS(cast(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;