aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index bc336d2069..05a7a954d7 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -2952,7 +2952,11 @@ void SelectionDAGLowering::LowerCallTo(Instruction &I,
Args.push_back(Entry);
}
- if (ExceptionHandling && MMI && LandingPad) {
+ bool MarkTryRange = LandingPad ||
+ // C++ requires special handling of 'nounwind' calls.
+ (Attrs && Attrs->paramHasAttr(0, ParamAttr::NoUnwind));
+
+ if (MarkTryRange && ExceptionHandling && MMI) {
// Insert a label before the invoke call to mark the try range. This can be
// used to detect deletion of the invoke via the MachineModuleInfo.
BeginLabel = MMI->NextLabelID();
@@ -2969,7 +2973,7 @@ void SelectionDAGLowering::LowerCallTo(Instruction &I,
setValue(&I, Result.first);
DAG.setRoot(Result.second);
- if (ExceptionHandling && MMI && LandingPad) {
+ if (MarkTryRange && ExceptionHandling && MMI) {
// Insert a label at the end of the invoke call to mark the try range. This
// can be used to detect deletion of the invoke via the MachineModuleInfo.
EndLabel = MMI->NextLabelID();