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

Jason Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 10 09:57:05 PDT 2020


jasonliu added a comment.

-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.



================
Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:594
+           "Cannot produce a unique identifier for this module based on strong "
+           "external symbols.");
+    GlobalUniqueModuleId = GlobalUniqueModuleId.substr(1);
----------------
I think report_fatal_error is more appropriate here? Since we know some case will trigger this, and we do not want those case to silently pass in non-assertion mode?


================
Comment at: clang/lib/CodeGen/ItaniumCXXABI.cpp:4452
+
+  // Emit __sterm function to unregister __srterm and call __srterm.
+  emitCXXGlobalVarDeclDestructFunc(D, dtorStub, addr);
----------------
This comment is confusing.
This is not emitting `__sterm` function, this is emitting `__cxx_global_var_destruct` functions. And again, we do not have `__srterm` function in this implementation. 


================
Comment at: clang/lib/CodeGen/ItaniumCXXABI.cpp:4468
+  const CGFunctionInfo &FI = CGM.getTypes().arrangeNullaryFunction();
+  llvm::Function *StermFn = CGM.CreateGlobalInitOrDestructFunction(
+      FTy, FnName.str(), FI, D.getLocation());
----------------
nit: this is not sterm function.


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