Open llvmbot opened 10 years ago
Most of Clang's codegen uses CodeGenModule::SetLLVMFunctionAttributesForDefinition
which (correctly?) sets UWTable
based on CodeGenOpts.UnwindTables
.
Global ctors/dtors use CGDeclCXX.cpp:CreateGlobalInitOrDestructFunction
which doesn't handle UWTable (and looks like it doesn't adequately check for nounwind
- it just checks LangOpts.Exceptions
, whereas CodeGenModule
uses CodeGenModule.cpp:hasUnwindExceptions
, which checks LangOpts.Exceptions
, LangOpts.CXXEcxeptions
, and LangOpts.ObjCExceptions
)
We should probably factor out the common parts of SetLLVMFunctionAttributesForDefinition
(the ones that don't actually rely on the Clang AST Decl
object) and reuse them from CreateGlobalInitOrDetsructFunction
.
Extended Description
When compiling
clang fails to add uwtable to
_GLOBAL__I_a
. This means that when building without exceptions, we don't add an entry for it in .eh_table, which violates the ABI.GCC produces one: