Change inferred getCast into specific getCast. Passes all tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32469 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2006-12-12 05:05:00 +00:00
parent a30fc5ed04
commit 4da49122f3
9 changed files with 39 additions and 22 deletions

View File

@ -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();
}