================
@@ -1016,6 +1021,59 @@ void SystemZAsmPrinter::emitMachineConstantPoolValue(
   OutStreamer->emitValue(Expr, Size);
 }
 
+// Emit the ctor or dtor list taking into account the init priority.
+void SystemZAsmPrinter::emitXXStructorList(const DataLayout &DL,
+                                           const Constant *List, bool IsCtor) {
+  if (!TM.getTargetTriple().isOSBinFormatGOFF())
+    return AsmPrinter::emitXXStructorList(DL, List, IsCtor);
+
+  SmallVector<Structor, 8> Structors;
+  preprocessXXStructorList(DL, List, Structors);
+  if (Structors.empty())
+    return;
+
+  const Align Align = llvm::Align(4);
+  const TargetLoweringObjectFile &Obj = getObjFileLowering();
+  for (Structor &S : Structors) {
+    MCSection *OutputSection =
+        (IsCtor ? Obj.getStaticCtorSection(S.Priority, nullptr)
+                : Obj.getStaticDtorSection(S.Priority, nullptr));
+    OutStreamer->switchSection(OutputSection);
----------------
amy-kwan wrote:

```suggestion
    MCSectionGOFF *Section = static_cast<MCSectionGOFF *>
        (IsCtor ? Obj.getStaticCtorSection(S.Priority, nullptr)
                : Obj.getStaticDtorSection(S.Priority, nullptr));
    OutStreamer->switchSection(Section);
```

https://github.com/llvm/llvm-project/pull/171476
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to