From f0084e1333a11fc9e0e90718515e5777a8552c26 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Wed, 28 Jul 2010 15:52:43 +0000 Subject: [PATCH] simplify llvm-svn: 109589 --- llvm/lib/Transforms/Utils/BasicInliner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/Utils/BasicInliner.cpp b/llvm/lib/Transforms/Utils/BasicInliner.cpp index f0e31efa30c4..23a30cc58507 100644 --- a/llvm/lib/Transforms/Utils/BasicInliner.cpp +++ b/llvm/lib/Transforms/Utils/BasicInliner.cpp @@ -82,8 +82,8 @@ void BasicInlinerImpl::inlineFunctions() { Function *F = *FI; for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) for (BasicBlock::iterator I = BB->begin(); I != BB->end(); ++I) { - CallSite CS = CallSite::get(I); - if (CS.getInstruction() && CS.getCalledFunction() + CallSite CS(cast(I)); + if (CS && CS.getCalledFunction() && !CS.getCalledFunction()->isDeclaration()) CallSites.push_back(CS); }