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

Kai Nacke via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 07:31:47 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';
----------------
redstar wrote:

Changed.

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


More information about the llvm-commits mailing list