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

Xiangling Liao via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 5 08:45:41 PST 2020


Xiangling_L marked 4 inline comments as done.
Xiangling_L added inline comments.


================
Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:283
   llvm::FunctionCallee atexit =
-      CGM.CreateRuntimeFunction(atexitTy, "atexit", llvm::AttributeList(),
-                                /*Local=*/true);
+      CGM.CreateRuntimeFunction(atexitTy, "atexit", llvm::AttributeList());
   if (llvm::Function *atexitFn = dyn_cast<llvm::Function>(atexit.getCallee()))
----------------
sfertile wrote:
> The default value for `Local` is false, was this change intentional? If so why is it needed?
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. 




================
Comment at: clang/lib/CodeGen/ItaniumCXXABI.cpp:531
+
+  bool isCXXGlobalInitAndDtorFuncInternal() const override { return false; }
+
----------------
yusra.syeda wrote:
> Perhaps adding a check to see if the OS is AIX before setting linkage to external will be useful here.
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.


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