Skip to content

Commit ad94fde

Browse files
committed
Remove MCSA_WeakReference/MCSA_Global from the loop
1 parent 8b71056 commit ad94fde

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

llvm/include/llvm/MC/MCSymbolGOFF.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ class MCSymbolGOFF : public MCSymbol {
6363
GOFF::ESDLinkageType getLinkage() const { return Linkage; }
6464

6565
GOFF::ESDBindingScope getBindingScope() const {
66-
return isExternal() ? (isExported() ? GOFF::ESD_BSC_ImportExport
67-
: GOFF::ESD_BSC_Library)
68-
: GOFF::ESD_BSC_Section;
66+
return (isExternal() || !isDefined()) ? isExported()
67+
? GOFF::ESD_BSC_ImportExport
68+
: GOFF::ESD_BSC_Library
69+
: GOFF::ESD_BSC_Section;
6970
}
7071

7172
GOFF::ESDBindingStrength getBindingStrength() const {

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2942,9 +2942,6 @@ bool AsmPrinter::doFinalization(Module &M) {
29422942
for (auto &GO : M.global_objects()) {
29432943
if (GO.isDeclaration()) {
29442944
MCSymbol *Sym = TM.getSymbol(&GO);
2945-
OutStreamer->emitSymbolAttribute(Sym, GO.hasExternalWeakLinkage()
2946-
? MCSA_WeakReference
2947-
: MCSA_Global);
29482945
OutStreamer->emitSymbolAttribute(Sym, isa<Function>(GO)
29492946
? MCSA_ELF_TypeFunction
29502947
: MCSA_ELF_TypeObject);

llvm/lib/MC/MCAsmInfoGOFF.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ using namespace llvm;
2222
MCAsmInfoGOFF::MCAsmInfoGOFF() {
2323
Data64bitsDirective = "\t.quad\t";
2424
HasDotTypeDotSizeDirective = false;
25+
WeakRefDirective = "WXTRN";
2526
PrivateGlobalPrefix = "L#";
2627
PrivateLabelPrefix = "L#";
2728
ZeroDirective = "\t.space\t";

llvm/lib/MC/MCSymbolGOFF.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ bool MCSymbolGOFF::setSymbolAttribute(MCSymbolAttr Attribute) {
2727
case MCSA_IndirectSymbol:
2828
case MCSA_Internal:
2929
case MCSA_LazyReference:
30+
case MCSA_Local:
3031
case MCSA_NoDeadStrip:
3132
case MCSA_SymbolResolver:
3233
case MCSA_AltEntry:
@@ -54,9 +55,6 @@ bool MCSymbolGOFF::setSymbolAttribute(MCSymbolAttr Attribute) {
5455
case MCSA_Global:
5556
setExternal(true);
5657
break;
57-
case MCSA_Local:
58-
setExternal(false);
59-
break;
6058
case MCSA_Weak:
6159
case MCSA_WeakReference:
6260
setExternal(true);

0 commit comments

Comments
 (0)