summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDeclCXX.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-07-06 04:38:10 +0000
committerJohn McCall <rjmccall@apple.com>2010-07-06 04:38:10 +0000
commit466e2210375026eacb9eb572341e170243bd2db2 (patch)
tree814d36c678db41197b23cc6a3fa565dd45f8fbe2 /clang/lib/CodeGen/CGDeclCXX.cpp
parentc7c8c3d66b18669f8cdf0ad706be0438f721fdd0 (diff)
downloadbcm5719-llvm-466e2210375026eacb9eb572341e170243bd2db2.tar.gz
bcm5719-llvm-466e2210375026eacb9eb572341e170243bd2db2.zip
When creating functions to run global initializers and destructors, mark them
as nounwind in -fno-exceptions. Fixes rdar://problem/8090834. llvm-svn: 107639
Diffstat (limited to 'clang/lib/CodeGen/CGDeclCXX.cpp')
-rw-r--r--clang/lib/CodeGen/CGDeclCXX.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDeclCXX.cpp b/clang/lib/CodeGen/CGDeclCXX.cpp
index d7d01847ea4..ec3f38667b7 100644
--- a/clang/lib/CodeGen/CGDeclCXX.cpp
+++ b/clang/lib/CodeGen/CGDeclCXX.cpp
@@ -152,6 +152,9 @@ CreateGlobalInitOrDestructFunction(CodeGenModule &CGM,
CGM.getContext().Target.getStaticInitSectionSpecifier())
Fn->setSection(Section);
+ if (!CGM.getLangOptions().Exceptions)
+ Fn->setDoesNotThrow();
+
return Fn;
}
OpenPOWER on IntegriCloud