From bd4a0732f2f261f8269a71c2090bc3e9d001eca6 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sun, 20 Mar 2011 20:52:32 +0000 Subject: [PATCH] __cxa_atexit does not throw. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127977 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGDeclCXX.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/CodeGen/CGDeclCXX.cpp b/lib/CodeGen/CGDeclCXX.cpp index ed25b6db38..cb1c8ed192 100644 --- a/lib/CodeGen/CGDeclCXX.cpp +++ b/lib/CodeGen/CGDeclCXX.cpp @@ -138,6 +138,8 @@ CodeGenFunction::EmitCXXGlobalDtorRegistration(llvm::Constant *DtorFn, llvm::Constant *AtExitFn = CGM.CreateRuntimeFunction(AtExitFnTy, "__cxa_atexit"); + if (llvm::Function *Fn = dyn_cast(AtExitFn)) + Fn->setDoesNotThrow(); llvm::Constant *Handle = CGM.CreateRuntimeVariable(Int8PtrTy, "__dso_handle"); -- 2.40.0