On Mar 11, 2013, at 6:13 PM, Aaron Ballman <[email protected]> wrote:
> The way MSVC handles it is by registering an atexit handler:
> 
> ; 6    : C c;
> 
> push OFFSET ??__Fc@@YAXXZ ; `dynamic atexit destructor for 'c''
> call _atexit
> pop ecx
> ret 0
> 
> This is analogous to what clang does when passing -fno-use-cxa-atexit, which 
> is:
> 
> define internal void @__cxx_global_var_init() {
> entry:
>  %0 = call i32 @atexit(void ()* @__dtor_c) #1
>  ret void
> }

Okay.  Would you mind abstracting this through the C++ ABI, then?
Make some sort of "register dynamic destructor" method, have CGF publish
a general method to do that via atexit, and move the __cxa_atexit-specific
stuff into ItaniumCXXABI.cpp.

John.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to