[PATCH] D144190: [AIX][clang] Storage Locations for Constant Pointers

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 15 00:06:34 PDT 2023


hubert.reinterpretcast accepted this revision.
hubert.reinterpretcast added a comment.
This revision is now accepted and ready to land.

LGTM with minor comments!



================
Comment at: clang/lib/Driver/ToolChains/AIX.cpp:132
+    // possible. Then `-bforceimprw` changes such sections to RW if they contain
+    // imported symbols that needs to be resolved.
+    CmdArgs.push_back("-bforceimprw");
----------------
Minor nit: needs => need


================
Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:728-729
+    if (HasRoptr) {
+      // On AIX, data_sections is on by default. We only need to check
+      // if data_sections is explicitly turned off.
+      if (!Args.hasFlag(options::OPT_fdata_sections,
----------------
Remove the comment. The `hasFlag` check requires no special reasoning.


================
Comment at: clang/test/CodeGen/PowerPC/aix-roptr.c:13
+char c1 = 10;
+char c2 = 20;
+char* const c1_ptr = &c1;
----------------
Remove `c2`. Not needed for the test.


================
Comment at: clang/test/CodeGen/PowerPC/aix-roptr.c:27-30
+
+int main() {
+    *(char**)&c1_ptr = &c2;
+}
----------------
Remove `main`. Not needed for the test.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144190



More information about the cfe-commits mailing list