[llvm-commits] CVS: llvm/lib/CWriter/Writer.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Aug 6 13:05:01 PDT 2003


Changes in directory llvm/lib/CWriter:

Writer.cpp updated: 1.113 -> 1.114

---
Log message:

The HAVE_JUMP code is dead, these intrinsics should _never_ be expanded


---
Diffs of the changes:

Index: llvm/lib/CWriter/Writer.cpp
diff -u llvm/lib/CWriter/Writer.cpp:1.113 llvm/lib/CWriter/Writer.cpp:1.114
--- llvm/lib/CWriter/Writer.cpp:1.113	Thu Jul 31 12:47:24 2003
+++ llvm/lib/CWriter/Writer.cpp	Wed Aug  6 13:04:40 2003
@@ -1123,32 +1123,15 @@
         return;
         
       case LLVMIntrinsic::setjmp:
-#ifdef HAVE_JUMP
-        Out << "setjmp(*(jmp_buf*)";
-        writeOperand(I.getOperand(1));
-        Out << ")";
-#else
-        //
-        // For right now, we don't really support non-local jumps.  So
-        // make setjmp() always evaluate to zero for now.
-        //
-        Out << "(0)";
-#endif
+        // 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
+        // to work.
+        Out << "0";
         return;
       case LLVMIntrinsic::longjmp:
-#ifdef HAVE_JUMP
-        Out << "longjmp(*(jmp_buf*)";
-        writeOperand(I.getOperand(1));
-        Out << ", ";
-        writeOperand(I.getOperand(2));
-        Out << ")";
-#else
-        //
-        // For right now, we don't really support non-local jumps.  So
-        // make longjmp() abort the program.
-        //
+        // Treat longjmp the same as setjmp
         Out << "abort()";
-#endif
         return;
       }
     }





More information about the llvm-commits mailing list