diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2006-12-12 05:05:00 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2006-12-12 05:05:00 +0000 |
| commit | b341b0861dcfdfd4453b32169a86302a275b81c9 (patch) | |
| tree | c407db06dc5ffde18fc136ce1a87da9ede9f33c2 /llvm/lib/Transforms/Utils/LowerInvoke.cpp | |
| parent | 6e5fe376ec898e651526107485d2a0f6e4000789 (diff) | |
| download | bcm5719-llvm-b341b0861dcfdfd4453b32169a86302a275b81c9.tar.gz bcm5719-llvm-b341b0861dcfdfd4453b32169a86302a275b81c9.zip | |
Change inferred getCast into specific getCast. Passes all tests.
llvm-svn: 32469
Diffstat (limited to 'llvm/lib/Transforms/Utils/LowerInvoke.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Utils/LowerInvoke.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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<Constant>(Args[i]), - FT->getParamType(i)); + if (Args[i]->getType()->isInteger()) + Args[i] = ConstantExpr::getIntegerCast(cast<Constant>(Args[i]), + FT->getParamType(i), true); + else + Args[i] = ConstantExpr::getBitCast(cast<Constant>(Args[i]), + FT->getParamType(i)); (new CallInst(WriteFn, Args, "", IB))->setTailCall(); } |

