[llvm] [SystemZ][z/OS] Simplify the GOFF section handling (PR #101068)

Ulrich Weigand via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 6 04:39:25 PDT 2024


================
@@ -25,26 +24,22 @@ class MCExpr;
 
 class MCSectionGOFF final : public MCSection {
 private:
-  MCSection *Parent;
-  uint32_t Subsection;
-
   friend class MCContext;
-  MCSectionGOFF(StringRef Name, SectionKind K, MCSection *P, uint32_t Sub)
-      : MCSection(SV_GOFF, Name, K.isText(), /*IsVirtual=*/false, nullptr),
-        Parent(P), Subsection(Sub) {}
+  MCSectionGOFF(StringRef Name, SectionKind K)
+      : MCSection(SV_GOFF, Name, K.isText(), /*IsVirtual=*/false, nullptr) {}
 
 public:
   void printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
                             raw_ostream &OS,
-                            uint32_t /*Subsection*/) const override {
+                            uint32_t Subsection) const override {
     OS << "\t.section\t\"" << getName() << "\"\n";
+    if (Subsection) {
+      OS << "\t.subsection\t" << Subsection << '\n';
----------------
uweigand wrote:

Shouldn't the long-term goal to be to move to HLASM-style output for GOFF?   This wouldn't have either the .section or .subsection directive, and it's not quite clear what "subsection" would even mean in this context ...

What are the actual requirements for the placement of PPA1, and how would those be formulated in HLASM syntax?

https://github.com/llvm/llvm-project/pull/101068


More information about the llvm-commits mailing list