[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
Thu Jun 11 20:52:48 PDT 2020


hubert.reinterpretcast added inline comments.


================
Comment at: clang/lib/AST/ItaniumMangle.cpp:5231
+  CXXNameMangler Mangler(*this, Out);
+  Mangler.getStream() << "__cxx_global_var_destruct_";
+  if (shouldMangleDeclName(D))
----------------
I believe these are actually paired with the `__dtor_` functions. The prefix can be `__finalize_`.


================
Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:562
 
+static StringRef getTransformedFileName(llvm::Module &M, SmallString<128> FileName) {
+  FileName = llvm::sys::path::filename(M.getName());
----------------
`FileName` should be a reference?


================
Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:643
+  // When not using sinit and sterm functions, include the filename in the
+  // symbol name. Including "sub_" matches gcc and makes sure these symbols
+  // appear lexicographically behind the symbols with priority emitted above.
----------------
The binding of the second sentence in relation to "not using sinit and sterm" is not clear in this new version. I still recommend introducing a "block" with a colon.


================
Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:645
+  // appear lexicographically behind the symbols with priority emitted above.
+  StringRef FuncName;
+  SmallString<128> Storage;
----------------
Use a `SmallString` for `FuncName`.


================
Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:646
+  StringRef FuncName;
+  SmallString<128> Storage;
+  if (UseSinitAndSterm)
----------------
Move `Storage` into the `else` block and use it only for calling `getTransformedFileName`.


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

https://reviews.llvm.org/D74166





More information about the cfe-commits mailing list