Skip to content

Commit 126ad82

Browse files
committed
Move loop to AsmPrinter
1 parent f07556a commit 126ad82

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2937,6 +2937,21 @@ bool AsmPrinter::doFinalization(Module &M) {
29372937
}
29382938
}
29392939

2940+
// Emit symbol attributes for declarations (GOFF only).
2941+
if (TM.getTargetTriple().isOSBinFormatGOFF()) {
2942+
for (auto &GO : M.global_objects()) {
2943+
if (GO.isDeclaration()) {
2944+
MCSymbol *Sym = TM.getSymbol(&GO);
2945+
OutStreamer->emitSymbolAttribute(Sym, GO.hasExternalWeakLinkage()
2946+
? MCSA_WeakReference
2947+
: MCSA_Global);
2948+
OutStreamer->emitSymbolAttribute(Sym, isa<Function>(GO)
2949+
? MCSA_ELF_TypeFunction
2950+
: MCSA_ELF_TypeObject);
2951+
}
2952+
}
2953+
}
2954+
29402955
// Allow the target to emit any magic that it wants at the end of the file,
29412956
// after everything else has gone out.
29422957
emitEndOfAsmFile(M);

llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,18 +1113,6 @@ void SystemZAsmPrinter::emitEndOfAsmFile(Module &M) {
11131113
if (TT.isOSzOS()) {
11141114
emitADASection();
11151115
emitIDRLSection(M);
1116-
// Emit EXTRN declarations.
1117-
for (auto &GO : M.global_objects()) {
1118-
if (GO.isDeclaration()) {
1119-
MCSymbol *Sym = TM.getSymbol(&GO);
1120-
OutStreamer->emitSymbolAttribute(Sym, GO.hasExternalWeakLinkage()
1121-
? MCSA_WeakReference
1122-
: MCSA_Global);
1123-
OutStreamer->emitSymbolAttribute(Sym, isa<Function>(GO)
1124-
? MCSA_ELF_TypeFunction
1125-
: MCSA_ELF_TypeObject);
1126-
}
1127-
}
11281116
}
11291117
emitAttributes(M);
11301118
}

0 commit comments

Comments
 (0)