[llvm] [GOFF] Emit symbols for functions. (PR #144437)

Kai Nacke via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 10 08:28:50 PST 2025


================
@@ -183,17 +191,81 @@ void SystemZHLASMAsmStreamer::emitInstruction(const MCInst &Inst,
   EmitEOL();
 }
 
+static void emitXATTR(raw_ostream &OS, StringRef Name,
+                      GOFF::ESDLinkageType Linkage,
+                      GOFF::ESDExecutable Executable,
+                      GOFF::ESDBindingScope BindingScope) {
+  llvm::ListSeparator Sep(",");
+  OS << Name << " XATTR ";
+  OS << Sep << "LINKAGE(" << (Linkage == GOFF::ESD_LT_OS ? "OS" : "XPLINK")
+     << ")";
+  if (Executable != GOFF::ESD_EXE_Unspecified)
+    OS << Sep << "REFERENCE("
+       << (Executable == GOFF::ESD_EXE_CODE ? "CODE" : "DATA") << ")";
+  if (BindingScope != GOFF::ESD_BSC_Unspecified) {
+    OS << Sep << "SCOPE(";
+    switch (BindingScope) {
+    case GOFF::ESD_BSC_Section:
+      OS << "SECTION";
+      break;
+    case GOFF::ESD_BSC_Module:
+      OS << "MODULE";
+      break;
+    case GOFF::ESD_BSC_Library:
+      OS << "LIBRARY";
+      break;
+    case GOFF::ESD_BSC_ImportExport:
+      OS << "EXPORT";
+      break;
+    default:
+      break;
+    }
+    OS << ')';
+  }
+  OS << '\n';
+}
+
+static bool sameNameAsCSECT(MCSymbolGOFF *Sym) {
+  if (!Sym->isTemporary() && Sym->isDefined() && Sym->isInSection()) {
----------------
redstar wrote:

Well, there is no support for absolute symbols in HLASM and GOFF, so getting an assertion is IMHO ok. The more interesting question is if we can generate an error during isel when we seen an absolute symbol.

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


More information about the llvm-commits mailing list