Add support for llvm.setjmp and longjmp. Only 3 SingleSource/UnitTests fail now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19404 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-01-08 22:48:57 +00:00
parent 906b20a1d7
commit 64e14b1679

View File

@ -569,6 +569,7 @@ void SelectionDAGLowering::visitStore(StoreInst &I) {
}
void SelectionDAGLowering::visitCall(CallInst &I) {
const char *RenameFn = 0;
if (Function *F = I.getCalledFunction())
switch (F->getIntrinsicID()) {
case 0: break; // Not an intrinsic.
@ -584,6 +585,8 @@ void SelectionDAGLowering::visitCall(CallInst &I) {
// readport, writeport, readio, writeio
assert(0 && "This intrinsic is not implemented yet!");
return;
case Intrinsic::setjmp: RenameFn = "setjmp"; break;
case Intrinsic::longjmp: RenameFn = "longjmp"; break;
case Intrinsic::memcpy: visitMemCpy(I); return;
case Intrinsic::memset: visitMemSet(I); return;
case Intrinsic::memmove: visitMemMove(I); return;
@ -594,7 +597,11 @@ void SelectionDAGLowering::visitCall(CallInst &I) {
return;
}
SDOperand Callee = getValue(I.getOperand(0));
SDOperand Callee;
if (!RenameFn)
Callee = getValue(I.getOperand(0));
else
Callee = DAG.getExternalSymbol(RenameFn, TLI.getPointerTy());
std::vector<std::pair<SDOperand, const Type*> > Args;
for (unsigned i = 1, e = I.getNumOperands(); i != e; ++i) {