[llvm] [GOFF] Emit symbols for functions. (PR #144437)
Ulrich Weigand via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 8 10:38:11 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()) {
----------------
uweigand wrote:
Why do we need the `isInSection` test here? If we do need it, why don't we need it at any of the other places where we check whether we have an ED section?
If we actually should have that test, maybe have a `MCSymbolGOFF::isInEDSection` combined predicate?
https://github.com/llvm/llvm-project/pull/144437
More information about the llvm-commits
mailing list