Fix bug: LevelRaise/2003-02-13-CallRaise.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5562 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-02-14 03:07:17 +00:00
parent bc7b48657d
commit 6b403233f7

View File

@ -512,6 +512,8 @@ Value *ConvertExpressionToType(Value *V, const Type *Ty, ValueMapCache &VMC) {
const FunctionType *NewTy =
FunctionType::get(Ty, ArgTys, FT->isVarArg());
const PointerType *NewPTy = PointerType::get(NewTy);
if (Ty == Type::VoidTy)
Name = ""; // Make sure not to name calls that now return void!
Res = new CallInst(Constant::getNullValue(NewPTy),
std::vector<Value*>(I->op_begin()+1, I->op_end()),
@ -1154,6 +1156,9 @@ static void ConvertOperandToType(User *U, Value *OldVal, Value *NewVal,
const FunctionType *NewTy = cast<FunctionType>(NewPTy->getElementType());
const FunctionType::ParamTypes &PTs = NewTy->getParamTypes();
if (NewTy->getReturnType() == Type::VoidTy)
Name = ""; // Make sure not to name a void call!
// Get an iterator to the call instruction so that we can insert casts for
// operands if needbe. Note that we do not require operands to be
// convertable, we can insert casts if they are convertible but not