Fix bug: LevelRaise/2003-05-01-CallCast.ll

llvm-svn: 5975
This commit is contained in:
Chris Lattner 2003-05-01 21:02:53 +00:00
parent a0cde203ae
commit 802c63d964
1 changed files with 2 additions and 1 deletions

View File

@ -491,7 +491,8 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) {
const FunctionType *FTy = cast<FunctionType>(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...
//