Skip to content

Commit

Permalink
Revert "[AIX][XCOFF] emit symbol visibility for xcoff object file."
Browse files Browse the repository at this point in the history
This reverts commit a081868.

Based on the Hubert Tong'comment  https://reviews.llvm.org/D84265#inline-799085
  • Loading branch information
diggerlin committed Aug 27, 2020
1 parent a14a280 commit 6923b0a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 471 deletions.
5 changes: 0 additions & 5 deletions llvm/include/llvm/MC/MCSectionXCOFF.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ class MCSectionXCOFF final : public MCSection {
XCOFF::StorageClass getStorageClass() const {
return QualName->getStorageClass();
}

XCOFF::VisibilityType getVisibilityType() const {
return QualName->getVisibilityType();
}

XCOFF::SymbolType getCSectType() const { return Type; }
MCSymbolXCOFF *getQualNameSymbol() const { return QualName; }

Expand Down
23 changes: 10 additions & 13 deletions llvm/lib/MC/XCOFFObjectWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ struct Symbol {
XCOFF::StorageClass getStorageClass() const {
return MCSym->getStorageClass();
}

XCOFF::VisibilityType getVisibilityType() const {
return MCSym->getVisibilityType();
}

StringRef getSymbolTableName() const { return MCSym->getSymbolTableName(); }
Symbol(const MCSymbolXCOFF *MCSym) : MCSym(MCSym), SymbolTableIndex(-1) {}
};
Expand Down Expand Up @@ -574,12 +569,13 @@ void XCOFFObjectWriter::writeSymbolTableEntryForCsectMemberLabel(
W.write<uint32_t>(CSectionRef.Address + SymbolOffset);
W.write<int16_t>(SectionIndex);
// Basic/Derived type. See the description of the n_type field for symbol
// table entries for a detailed description. Since we support visibility, and
// all other bits are either optionally set or reserved, we only set bits 0-3
// for symbol's visibility and leave other bits to zero.
// table entries for a detailed description. Since we don't yet support
// visibility, and all other bits are either optionally set or reserved, this
// is always zero.
// TODO FIXME How to assert a symbol's visibilty is default?
// TODO Set the function indicator (bit 10, 0x0020) for functions
// when debugging is enabled.
W.write<uint16_t>(SymbolRef.getVisibilityType());
W.write<uint16_t>(0);
W.write<uint8_t>(SymbolRef.getStorageClass());
// Always 1 aux entry for now.
W.write<uint8_t>(1);
Expand Down Expand Up @@ -610,12 +606,13 @@ void XCOFFObjectWriter::writeSymbolTableEntryForControlSection(
// n_scnum
W.write<int16_t>(SectionIndex);
// Basic/Derived type. See the description of the n_type field for symbol
// table entries for a detailed description. Since we support visibility, and
// all other bits are either optionally set or reserved, we only set bits 0-3
// for symbol's visibility and leave other bits to zero.
// table entries for a detailed description. Since we don't yet support
// visibility, and all other bits are either optionally set or reserved, this
// is always zero.
// TODO FIXME How to assert a symbol's visibilty is default?
// TODO Set the function indicator (bit 10, 0x0020) for functions
// when debugging is enabled.
W.write<uint16_t>(CSectionRef.MCCsect->getVisibilityType());
W.write<uint16_t>(0);
// n_sclass
W.write<uint8_t>(StorageClass);
// Always 1 aux entry for now.
Expand Down
Loading

0 comments on commit 6923b0a

Please sign in to comment.