From: Chris Lattner Date: Sat, 8 Jan 2005 22:48:57 +0000 (+0000) Subject: Add support for llvm.setjmp and longjmp. Only 3 SingleSource/UnitTests fail now. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=64e14b1679fa3649b286402ea254d663ac43ef91;p=oota-llvm.git 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 --- diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index ac486894dd8..f6d497988fc 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -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 > Args; for (unsigned i = 1, e = I.getNumOperands(); i != e; ++i) {