[SystemZ] Move some SystemZTargetStreamer classes to proper file (#132476)

Now that we have a SystemZTargetStreamer file from
https://github.com/llvm/llvm-project/pull/130535, move some
TargetStreamer classes and methods from TargetDesc to the proper file.

---------

Co-authored-by: Tony Tao <tonytao@ca.ibm.com>
diff --git a/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp b/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp
index 0fb5c30..c010c2c0 100644
--- a/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp
+++ b/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp
@@ -183,47 +183,13 @@
   return new SystemZGNUInstPrinter(MAI, MII, MRI);
 }
 
-void SystemZTargetStreamer::emitConstantPools() {
-  // Emit EXRL target instructions.
-  if (EXRLTargets2Sym.empty())
-    return;
-  // Switch to the .text section.
-  const MCObjectFileInfo &OFI = *Streamer.getContext().getObjectFileInfo();
-  Streamer.switchSection(OFI.getTextSection());
-  for (auto &I : EXRLTargets2Sym) {
-    Streamer.emitLabel(I.second);
-    const MCInstSTIPair &MCI_STI = I.first;
-    Streamer.emitInstruction(MCI_STI.first, *MCI_STI.second);
-  }
-  EXRLTargets2Sym.clear();
-}
-
-namespace {
-class SystemZTargetAsmStreamer : public SystemZTargetStreamer {
-  formatted_raw_ostream &OS;
-
-public:
-  SystemZTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS)
-      : SystemZTargetStreamer(S), OS(OS) {}
-  void emitMachine(StringRef CPU) override {
-    OS << "\t.machine " << CPU << "\n";
-  }
-};
-
-class SystemZTargetELFStreamer : public SystemZTargetStreamer {
-public:
-  SystemZTargetELFStreamer(MCStreamer &S) : SystemZTargetStreamer(S) {}
-  void emitMachine(StringRef CPU) override {}
-};
-} // end namespace
-
 static MCTargetStreamer *createAsmTargetStreamer(MCStreamer &S,
                                                  formatted_raw_ostream &OS,
                                                  MCInstPrinter *InstPrint) {
   if (S.getContext().getTargetTriple().isOSzOS())
     return new SystemZTargetHLASMStreamer(S, OS);
   else
-    return new SystemZTargetAsmStreamer(S, OS);
+    return new SystemZTargetGNUStreamer(S, OS);
 }
 
 static MCStreamer *createAsmStreamer(MCContext &Ctx,
diff --git a/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZTargetStreamer.cpp b/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZTargetStreamer.cpp
index 1946cd1..a4506ed 100644
--- a/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZTargetStreamer.cpp
+++ b/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZTargetStreamer.cpp
@@ -13,9 +13,25 @@
 //===----------------------------------------------------------------------===//
 
 #include "SystemZTargetStreamer.h"
+#include "llvm/MC/MCObjectFileInfo.h"
 
 using namespace llvm;
 
+void SystemZTargetStreamer::emitConstantPools() {
+  // Emit EXRL target instructions.
+  if (EXRLTargets2Sym.empty())
+    return;
+  // Switch to the .text section.
+  const MCObjectFileInfo &OFI = *Streamer.getContext().getObjectFileInfo();
+  Streamer.switchSection(OFI.getTextSection());
+  for (auto &I : EXRLTargets2Sym) {
+    Streamer.emitLabel(I.second);
+    const MCInstSTIPair &MCI_STI = I.first;
+    Streamer.emitInstruction(MCI_STI.first, *MCI_STI.second);
+  }
+  EXRLTargets2Sym.clear();
+}
+
 void SystemZTargetHLASMStreamer::emitExtern(StringRef Sym) {
   getStreamer().emitRawText(Twine(" EXTRN ") + Twine(Sym));
 }
diff --git a/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZTargetStreamer.h b/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZTargetStreamer.h
index 26be26e..1561710 100644
--- a/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZTargetStreamer.h
+++ b/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZTargetStreamer.h
@@ -82,6 +82,23 @@
                                    const MCSymbol *Lo) override;
 };
 
+class SystemZTargetELFStreamer : public SystemZTargetStreamer {
+public:
+  SystemZTargetELFStreamer(MCStreamer &S) : SystemZTargetStreamer(S) {}
+  void emitMachine(StringRef CPU) override {}
+};
+
+class SystemZTargetGNUStreamer : public SystemZTargetStreamer {
+  formatted_raw_ostream &OS;
+
+public:
+  SystemZTargetGNUStreamer(MCStreamer &S, formatted_raw_ostream &OS)
+      : SystemZTargetStreamer(S), OS(OS) {}
+  void emitMachine(StringRef CPU) override {
+    OS << "\t.machine " << CPU << "\n";
+  }
+};
+
 } // end namespace llvm
 
 #endif // LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETSTREAMER_H