diff options
author | John McCall <rjmccall@apple.com> | 2010-07-06 04:38:10 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-07-06 04:38:10 +0000 |
commit | 044cc54a7d83c90857187c4cd4a0fd33664a7f7f (patch) | |
tree | 17dce7259c2e49b8f09ee0e40590230f03461dee /lib/CodeGen/CGDeclCXX.cpp | |
parent | 5dd3af78a12d049d4591505570fcde79c2cc7bb0 (diff) |
When creating functions to run global initializers and destructors, mark them
as nounwind in -fno-exceptions. Fixes rdar://problem/8090834.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107639 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDeclCXX.cpp')
-rw-r--r-- | lib/CodeGen/CGDeclCXX.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/CGDeclCXX.cpp b/lib/CodeGen/CGDeclCXX.cpp index d7d01847ea..ec3f38667b 100644 --- a/lib/CodeGen/CGDeclCXX.cpp +++ b/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; } |