aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/IntrinsicLowering.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-07-06 14:46:23 +0000
committerDuncan Sands <baldrick@free.fr>2007-07-06 14:46:23 +0000
commitf664e41b201bad27ed3661bf50cd71f54242c114 (patch)
tree883e6e4e8708942497327e75f0b97e46b1ba7e32 /lib/CodeGen/IntrinsicLowering.cpp
parentd8ebb3a0c2b42c5dedf96cfb7f2f3e87c91e1c23 (diff)
The exception handling intrinsics return values,
so must be lowered to a value, not nothing at all. Subtle point: I made eh_selector return 0 and eh_typeid_for return 1. This means that only cleanups (destructors) will be run as the exception unwinds [if eh_typeid_for returned 0 then it would be as if the first catch always matched, and the corresponding handler would be run], which is probably want you want in the CBE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37947 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/IntrinsicLowering.cpp')
-rw-r--r--lib/CodeGen/IntrinsicLowering.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp
index 1e811d61e7..8ae4df6dde 100644
--- a/lib/CodeGen/IntrinsicLowering.cpp
+++ b/lib/CodeGen/IntrinsicLowering.cpp
@@ -706,9 +706,17 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
case Intrinsic::dbg_region_end:
case Intrinsic::dbg_func_start:
case Intrinsic::dbg_declare:
+ break; // Simply strip out debugging intrinsics
+
case Intrinsic::eh_exception:
case Intrinsic::eh_selector:
- break; // Simply strip out debugging and eh intrinsics
+ CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
+ break;
+
+ case Intrinsic::eh_typeid_for:
+ // Return something different to eh_selector.
+ CI->replaceAllUsesWith(ConstantInt::get(CI->getType(), 1));
+ break;
case Intrinsic::var_annotation:
break; // Strip out annotate intrinsic