[PATCH] D153907: [AIX] [TOC] Add -mtocdata/-mno-tocdata options on AIX

Chris Bowler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 18 07:55:57 PDT 2023


cebowleratibm added inline comments.


================
Comment at: lib/Driver/ToolChains/Clang.cpp:7136
+                                                             : AddressInTOC;
+      if (OptionType == ExplicitOptionDefaultOverride) {
+        for (const char *Val : Arg->getValues())
----------------
unless there's a performance reason for keeping the `if` out of the loop, the code reads a little tighter if you push the if inside a single for loop.

I don't feel strongly but thought I'd point it out.  Use your discretion.


================
Comment at: test/CodeGen/PowerPC/toc-data-attribute.c:12
+int *i;
+int __attribute__((aligned(128))) j = 0;
+float k = 100.00;
----------------
`j` is overaligned to be toc data.  Are you expecting a diagnostic or for it to be quietly handled notoc-data?

I suggest splitting out the symbols that can't be toc data to another test and check for a diagnostic.  If they're warnings then I suggest also checking that the IR did not apply the toc-data attribute.


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

https://reviews.llvm.org/D153907



More information about the llvm-commits mailing list