aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-08 22:48:57 +0000
committerChris Lattner <sabre@nondot.org>2005-01-08 22:48:57 +0000
commit64e14b1679fa3649b286402ea254d663ac43ef91 (patch)
tree55678d8e08d6375cf53039c372e2240051701903
parent906b20a1d7347f97750753bec2b8fe9c09b02b9c (diff)
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
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index ac486894dd..f6d497988f 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<std::pair<SDOperand, const Type*> > Args;
for (unsigned i = 1, e = I.getNumOperands(); i != e; ++i) {