[llvm] [GOFF] Emit symbols for functions. (PR #144437)
Kai Nacke via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 8 11:04:22 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:
After checking the semantics, we do not need the `isInSection` check. Testing for `isDefined` is enough.
https://github.com/llvm/llvm-project/pull/144437
More information about the llvm-commits
mailing list