[PATCH] D157483: [AIX] Handle ReadOnlyWithRel kind on AIX.

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 23 21:36:58 PDT 2023


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/lib/MC/MCSectionXCOFF.cpp:44
   }
 
   // Initialized TLS data.
----------------
Move the code to here.


================
Comment at: llvm/lib/MC/MCSectionXCOFF.cpp:80-82
     assert((getKind().isBSSExtern() || getKind().isBSSLocal() ||
             getKind().isReadOnlyWithRel()) &&
            "Unexepected section kind for toc-data");
----------------
Update this because of the other proposed changes.


================
Comment at: llvm/lib/MC/MCSectionXCOFF.cpp:123-131
+  if (getKind().isReadOnlyWithRel()) {
+    if (getMappingClass() != XCOFF::XMC_RW &&
+        getMappingClass() != XCOFF::XMC_RO)
+      report_fatal_error(
+          "Unexepected storage-mapping class for ReadOnlyWithRel kind");
+    printCsectDirective(OS);
+    return;
----------------
Given the structure of the function, I think the code should be moved to right after the `isReadOnly` block. Once moved, the `XMC_TD` case would need to be allowed in this code too.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157483



More information about the llvm-commits mailing list