From b341b0861dcfdfd4453b32169a86302a275b81c9 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Tue, 12 Dec 2006 05:05:00 +0000 Subject: Change inferred getCast into specific getCast. Passes all tests. llvm-svn: 32469 --- llvm/lib/Transforms/Utils/LowerInvoke.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Transforms/Utils/LowerInvoke.cpp') diff --git a/llvm/lib/Transforms/Utils/LowerInvoke.cpp b/llvm/lib/Transforms/Utils/LowerInvoke.cpp index dfeb8349f4a..4fbd43c6f4d 100644 --- a/llvm/lib/Transforms/Utils/LowerInvoke.cpp +++ b/llvm/lib/Transforms/Utils/LowerInvoke.cpp @@ -215,8 +215,12 @@ void LowerInvoke::writeAbortMessage(Instruction *IB) { unsigned NumArgs = FT->getNumParams(); for (unsigned i = 0; i != 3; ++i) if (i < NumArgs && FT->getParamType(i) != Args[i]->getType()) - Args[i] = ConstantExpr::getCast(cast(Args[i]), - FT->getParamType(i)); + if (Args[i]->getType()->isInteger()) + Args[i] = ConstantExpr::getIntegerCast(cast(Args[i]), + FT->getParamType(i), true); + else + Args[i] = ConstantExpr::getBitCast(cast(Args[i]), + FT->getParamType(i)); (new CallInst(WriteFn, Args, "", IB))->setTailCall(); } -- cgit v1.2.3