Page MenuHomePhabricator

[AIX][Frontend] Static init implementation for AIX considering no priority
Needs ReviewPublic

Authored by Xiangling_L on Feb 6 2020, 2:00 PM.


  • Provides no piroirity supoort && disables/ignores three priority related attributes: init_priority, ctor attr, dtor attr;
    • '-qunique' in xlclang compiler equivalent behavior of emitting sinit and sterm functions name using getUniqueModuleId() function in LLVM;
    • Add a simple testcase to emit IR sample with sinit80000000, srterm(__dtor), and sterm80000000

Diff Detail

Event Timeline

Xiangling_L created this revision.Feb 6 2020, 2:00 PM
Xiangling_L planned changes to this revision.Feb 6 2020, 2:05 PM

Rebase to incorparate XL C++ ABI name && comdat changes;

Xiangling_L edited the summary of this revision. (Show Details)

Update the testcase;

Rebase on the latest master branch.

Clean the formatting issues;

Overall the patch LGTM, aside from 1 change we may want to make.


Perhaps adding a check to see if the OS is AIX before setting linkage to external will be useful here.

Please fix the formatting issues flagged by the pre-merge checks.

sfertile added inline comments.Mar 4 2020, 12:26 PM

The default value for Local is false, was this change intentional? If so why is it needed?

Xiangling_L marked 4 inline comments as done.Mar 5 2020, 8:44 AM
Xiangling_L added inline comments.

Thanks for pointing this out. I believe this is a bug. I was supposed to only let Local in unregisterGlobalDtorWithUnAtExit as default value false. Because it is only used in relation to Windows.


Since we are already under the context that XLCXXABI is an AIX C++ ABI, I kinda feel it's a duplication to add OS check.

Xiangling_L marked 2 inline comments as done.

Fix the formatting issue;
Address the 1st round reviews;

Rebase on the latest master branch;