aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/ExprTypeConvert.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-02-14 03:07:17 +0000
committerChris Lattner <sabre@nondot.org>2003-02-14 03:07:17 +0000
commit6b403233f7565ab0a04973ba9c16573b235007e1 (patch)
treeb46739263ce7ddd87a551c3c147651c6ede26c9c /lib/Transforms/ExprTypeConvert.cpp
parentbc7b48657d625d5acefa9ac1de8bfe15fdb0ebd2 (diff)
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
Diffstat (limited to 'lib/Transforms/ExprTypeConvert.cpp')
-rw-r--r--lib/Transforms/ExprTypeConvert.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Transforms/ExprTypeConvert.cpp b/lib/Transforms/ExprTypeConvert.cpp
index 92a88773a0..73db901889 100644
--- a/lib/Transforms/ExprTypeConvert.cpp
+++ b/lib/Transforms/ExprTypeConvert.cpp
@@ -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