Skip to content

Commit 6923b0a

Browse files
author
diggerlin
committed
Revert "[AIX][XCOFF] emit symbol visibility for xcoff object file."
This reverts commit a081868. Based on the Hubert Tong'comment https://reviews.llvm.org/D84265#inline-799085
1 parent a14a280 commit 6923b0a

File tree

3 files changed

+10
-471
lines changed

3 files changed

+10
-471
lines changed

llvm/include/llvm/MC/MCSectionXCOFF.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,6 @@ class MCSectionXCOFF final : public MCSection {
6666
XCOFF::StorageClass getStorageClass() const {
6767
return QualName->getStorageClass();
6868
}
69-
70-
XCOFF::VisibilityType getVisibilityType() const {
71-
return QualName->getVisibilityType();
72-
}
73-
7469
XCOFF::SymbolType getCSectType() const { return Type; }
7570
MCSymbolXCOFF *getQualNameSymbol() const { return QualName; }
7671

llvm/lib/MC/XCOFFObjectWriter.cpp

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@ struct Symbol {
6969
XCOFF::StorageClass getStorageClass() const {
7070
return MCSym->getStorageClass();
7171
}
72-
73-
XCOFF::VisibilityType getVisibilityType() const {
74-
return MCSym->getVisibilityType();
75-
}
76-
7772
StringRef getSymbolTableName() const { return MCSym->getSymbolTableName(); }
7873
Symbol(const MCSymbolXCOFF *MCSym) : MCSym(MCSym), SymbolTableIndex(-1) {}
7974
};
@@ -574,12 +569,13 @@ void XCOFFObjectWriter::writeSymbolTableEntryForCsectMemberLabel(
574569
W.write<uint32_t>(CSectionRef.Address + SymbolOffset);
575570
W.write<int16_t>(SectionIndex);
576571
// Basic/Derived type. See the description of the n_type field for symbol
577-
// table entries for a detailed description. Since we support visibility, and
578-
// all other bits are either optionally set or reserved, we only set bits 0-3
579-
// for symbol's visibility and leave other bits to zero.
572+
// table entries for a detailed description. Since we don't yet support
573+
// visibility, and all other bits are either optionally set or reserved, this
574+
// is always zero.
575+
// TODO FIXME How to assert a symbol's visibilty is default?
580576
// TODO Set the function indicator (bit 10, 0x0020) for functions
581577
// when debugging is enabled.
582-
W.write<uint16_t>(SymbolRef.getVisibilityType());
578+
W.write<uint16_t>(0);
583579
W.write<uint8_t>(SymbolRef.getStorageClass());
584580
// Always 1 aux entry for now.
585581
W.write<uint8_t>(1);
@@ -610,12 +606,13 @@ void XCOFFObjectWriter::writeSymbolTableEntryForControlSection(
610606
// n_scnum
611607
W.write<int16_t>(SectionIndex);
612608
// Basic/Derived type. See the description of the n_type field for symbol
613-
// table entries for a detailed description. Since we support visibility, and
614-
// all other bits are either optionally set or reserved, we only set bits 0-3
615-
// for symbol's visibility and leave other bits to zero.
609+
// table entries for a detailed description. Since we don't yet support
610+
// visibility, and all other bits are either optionally set or reserved, this
611+
// is always zero.
612+
// TODO FIXME How to assert a symbol's visibilty is default?
616613
// TODO Set the function indicator (bit 10, 0x0020) for functions
617614
// when debugging is enabled.
618-
W.write<uint16_t>(CSectionRef.MCCsect->getVisibilityType());
615+
W.write<uint16_t>(0);
619616
// n_sclass
620617
W.write<uint8_t>(StorageClass);
621618
// Always 1 aux entry for now.

0 commit comments

Comments
 (0)