summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
commit222e70a9fa1c5fe3c3b9328d3605f0a187177843 (patch)
treebee1e437f73ecebb7b942a3cd8ef30163a445bb4 /llvm/lib
parent36239e2df9ce492030dd6634e34acf410438b08a (diff)
downloadbcm5719-llvm-222e70a9fa1c5fe3c3b9328d3605f0a187177843.tar.gz
bcm5719-llvm-222e70a9fa1c5fe3c3b9328d3605f0a187177843.zip
Fix bug: LevelRaise/2003-02-13-CallRaise.ll
llvm-svn: 5562
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/ExprTypeConvert.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/ExprTypeConvert.cpp b/llvm/lib/Transforms/ExprTypeConvert.cpp
index 92a88773a05..73db901889d 100644
--- a/llvm/lib/Transforms/ExprTypeConvert.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud