[llvm-commits] CVS: llvm/lib/VMCore/IntrinsicLowering.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Feb 15 16:26:01 PST 2004


Changes in directory llvm/lib/VMCore:

IntrinsicLowering.cpp updated: 1.10 -> 1.11

---
Log message:

By default, llvm.setjmp/llvm.longjmp intrinsics get lowered to their libc counterparts


---
Diffs of the changes:  (+15 -3)

Index: llvm/lib/VMCore/IntrinsicLowering.cpp
diff -u llvm/lib/VMCore/IntrinsicLowering.cpp:1.10 llvm/lib/VMCore/IntrinsicLowering.cpp:1.11
--- llvm/lib/VMCore/IntrinsicLowering.cpp:1.10	Sun Feb 15 16:16:39 2004
+++ llvm/lib/VMCore/IntrinsicLowering.cpp	Sun Feb 15 16:24:51 2004
@@ -81,13 +81,25 @@
     // never optimized (ie, right out of the CFE), or if it has been hacked on
     // by the lowerinvoke pass.  In both cases, the right thing to do is to
     // convert the call to an explicit setjmp or longjmp call.
-  case Intrinsic::setjmp:
-  case Intrinsic::sigsetjmp:
+  case Intrinsic::setjmp: {
+    static Function *SetjmpFCache = 0;
+    Value *V = ReplaceCallWith("setjmp", CI, CI->op_begin()+1, CI->op_end(),
+                               Type::IntTy, SetjmpFCache);
     if (CI->getType() != Type::VoidTy)
-      CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
+      CI->replaceAllUsesWith(V);
     break;
+  }
+  case Intrinsic::sigsetjmp: 
+     if (CI->getType() != Type::VoidTy)
+       CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
+     break;
 
   case Intrinsic::longjmp:
+    static Function *LongjmpFCache = 0;
+    ReplaceCallWith("longjmp", CI, CI->op_begin()+1, CI->op_end(),
+                    Type::VoidTy, LongjmpFCache);
+    break;
+
   case Intrinsic::siglongjmp:
     // Insert the call to abort
     static Function *AbortFCache = 0;





More information about the llvm-commits mailing list