[PATCH] D74166: [AIX][Frontend] Static init implementation for AIX considering no priority

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 12 19:55:25 PDT 2020


hubert.reinterpretcast added inline comments.


================
Comment at: clang/test/CodeGen/static-init.cpp:8
+// RUN:   FileCheck %s
 
 struct test {
----------------
Xiangling_L wrote:
> jasonliu wrote:
> > Looks like the non-inline comments are easier to get ignored and missed, so I will copy paste the non-inlined comment I previously had:
> > ```
> > -fregister_global_dtors_with_atexit does not seem to work properly in current implementation.
> > We should consider somehow disabling/report_fatal_error it instead of letting it generate invalid code on AIX.
> > ```
> Thanks for doing so!
> 
> The semantic of `global_dtors` here on AIX is `__sterm` function, which we are never gonna register with `__atexit`. I am thinking we can disable it in a follow-up driver patch with the handling of `-fno-use-cxa-atexit`.
The semantic of `global_dtors` is not limited to the `__sterm` functions associated with C++ cleanup actions. With respect to user-declared `__attribute__((__destructor__))` functions, the option could improve the interleaving of those cleanup actions with cleanup actions registered by user-declared `__attribute__((__constructor__))` functions.

This provides that rationale for separating the `__sterm` functions associated with the C++ cleanup actions from the other "destructor" functions.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74166/new/

https://reviews.llvm.org/D74166





More information about the cfe-commits mailing list