From: Chris Lattner Date: Thu, 1 May 2003 21:02:53 +0000 (+0000) Subject: Fix bug: LevelRaise/2003-05-01-CallCast.ll X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=cdeb81d41273220bb35171fe9eeee44f46d8d8b1;p=oota-llvm.git Fix bug: LevelRaise/2003-05-01-CallCast.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5975 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp index 2e9d8c2f8c8..b2c6b05ab46 100644 --- a/lib/Transforms/LevelRaise.cpp +++ b/lib/Transforms/LevelRaise.cpp @@ -491,7 +491,8 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) { const FunctionType *FTy = cast(PTy->getElementType()); // Is the call to a vararg variable with no real parameters? - if (FTy->isVarArg() && FTy->getNumParams() == 0) { + if (FTy->isVarArg() && FTy->getNumParams() == 0 && + !CI->getCalledFunction()) { // If so, insert a new cast instruction, casting it to a function type // that matches the current arguments... //