Add support for the sig(set|long)jmp intrinsics
authorChris Lattner <sabre@nondot.org>
Mon, 18 Aug 2003 16:06:09 +0000 (16:06 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 18 Aug 2003 16:06:09 +0000 (16:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7951 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CBackend/CBackend.cpp
lib/Target/CBackend/Writer.cpp
lib/Target/SparcV9/SparcV9InstrSelection.cpp
lib/Target/X86/InstSelectSimple.cpp
lib/Target/X86/X86ISelSimple.cpp

index 0443c1847571f7f68e59d7aeb20d0eeda353113b..4bc354bdee1267a387cc7afaff4c8304e3313398 100644 (file)
@@ -1139,6 +1139,7 @@ void CWriter::visitCallInst(CallInst &I) {
         return;
         
       case LLVMIntrinsic::setjmp:
+      case LLVMIntrinsic::sigsetjmp:
         // This instrinsic should never exist in the program, but until we get
         // setjmp/longjmp transformations going on, we should codegen it to
         // something reasonable.  This will allow code that never calls longjmp
@@ -1146,7 +1147,9 @@ void CWriter::visitCallInst(CallInst &I) {
         Out << "0";
         return;
       case LLVMIntrinsic::longjmp:
-        // Treat longjmp the same as setjmp
+      case LLVMIntrinsic::siglongjmp:
+        // Longjmp is not implemented, and never will be.  It would cause an
+        // exception throw.
         Out << "abort()";
         return;
       }
index 0443c1847571f7f68e59d7aeb20d0eeda353113b..4bc354bdee1267a387cc7afaff4c8304e3313398 100644 (file)
@@ -1139,6 +1139,7 @@ void CWriter::visitCallInst(CallInst &I) {
         return;
         
       case LLVMIntrinsic::setjmp:
+      case LLVMIntrinsic::sigsetjmp:
         // This instrinsic should never exist in the program, but until we get
         // setjmp/longjmp transformations going on, we should codegen it to
         // something reasonable.  This will allow code that never calls longjmp
@@ -1146,7 +1147,9 @@ void CWriter::visitCallInst(CallInst &I) {
         Out << "0";
         return;
       case LLVMIntrinsic::longjmp:
-        // Treat longjmp the same as setjmp
+      case LLVMIntrinsic::siglongjmp:
+        // Longjmp is not implemented, and never will be.  It would cause an
+        // exception throw.
         Out << "abort()";
         return;
       }
index 970c5fdcf0ad446a3f4e2acc99332b32c724c36c..ee24333495129794beb50640b62fd48aee7dab30 100644 (file)
@@ -1433,6 +1433,7 @@ bool CodeGenIntrinsic(LLVMIntrinsic::ID iid, CallInst &callInstr,
                    addReg(callInstr.getOperand(1)));
     return true;
 
+  case LLVMIntrinsic::sigsetjmp:
   case LLVMIntrinsic::setjmp: {
     // act as if we return 0
     unsigned g0 = target.getRegInfo().getZeroRegNum();
@@ -1441,6 +1442,7 @@ bool CodeGenIntrinsic(LLVMIntrinsic::ID iid, CallInst &callInstr,
     return true;
   }
 
+  case LLVMIntrinsic::siglongjmp:
   case LLVMIntrinsic::longjmp: {
     // call abort()
     Module* M = callInstr.getParent()->getParent()->getParent();
index 2cc4e8367dfbdb5114695d258fcc86a7f6ea3a64..26e908ff043d686e81f4e0074413fd3236a37200 100644 (file)
@@ -978,10 +978,12 @@ void ISel::visitIntrinsicCall(LLVMIntrinsic::ID ID, CallInst &CI) {
     return;
 
   case LLVMIntrinsic::longjmp:
+  case LLVMIntrinsic::siglongjmp:
     BuildMI(X86::CALLpcrel32, 1).addExternalSymbol("abort", true); 
     return;
 
   case LLVMIntrinsic::setjmp:
+  case LLVMIntrinsic::sigsetjmp:
     // Setjmp always returns zero...
     BuildMI(BB, X86::MOVir32, 1, getReg(CI)).addZImm(0);
     return;
index 2cc4e8367dfbdb5114695d258fcc86a7f6ea3a64..26e908ff043d686e81f4e0074413fd3236a37200 100644 (file)
@@ -978,10 +978,12 @@ void ISel::visitIntrinsicCall(LLVMIntrinsic::ID ID, CallInst &CI) {
     return;
 
   case LLVMIntrinsic::longjmp:
+  case LLVMIntrinsic::siglongjmp:
     BuildMI(X86::CALLpcrel32, 1).addExternalSymbol("abort", true); 
     return;
 
   case LLVMIntrinsic::setjmp:
+  case LLVMIntrinsic::sigsetjmp:
     // Setjmp always returns zero...
     BuildMI(BB, X86::MOVir32, 1, getReg(CI)).addZImm(0);
     return;