summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
commit9d97420473c99e761fcea0280cfa85a38ff6d6d9 (patch)
tree82993790aa599bbc6597f9ebb7429de3fe9c9dd4 /llvm/lib
parent71ed4aaa3178bd1d5485dfe0346c79cd3e25f385 (diff)
downloadbcm5719-llvm-9d97420473c99e761fcea0280cfa85a38ff6d6d9.tar.gz
bcm5719-llvm-9d97420473c99e761fcea0280cfa85a38ff6d6d9.zip
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. llvm-svn: 37947
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/IntrinsicLowering.cpp10
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp3
2 files changed, 11 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/IntrinsicLowering.cpp b/llvm/lib/CodeGen/IntrinsicLowering.cpp
index 1e811d61e7c..8ae4df6dde2 100644
--- a/llvm/lib/CodeGen/IntrinsicLowering.cpp
+++ b/llvm/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
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 8af76b1cd18..3312542d390 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -2716,7 +2716,8 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
unsigned TypeID = MMI->getTypeIDFor(GV);
setValue(&I, DAG.getConstant(TypeID, MVT::i32));
} else {
- setValue(&I, DAG.getConstant(0, MVT::i32));
+ // Return something different to eh_selector.
+ setValue(&I, DAG.getConstant(1, MVT::i32));
}
return 0;
OpenPOWER on IntegriCloud