diff options
Diffstat (limited to 'include/llvm/MC/MCSectionELF.h')
-rw-r--r-- | include/llvm/MC/MCSectionELF.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/include/llvm/MC/MCSectionELF.h b/include/llvm/MC/MCSectionELF.h index dabd787b0d45f..00c289c6bd6eb 100644 --- a/include/llvm/MC/MCSectionELF.h +++ b/include/llvm/MC/MCSectionELF.h @@ -14,12 +14,10 @@ #ifndef LLVM_MC_MCSECTIONELF_H #define LLVM_MC_MCSECTIONELF_H -#include "llvm/ADT/Twine.h" +#include "llvm/ADT/StringRef.h" #include "llvm/MC/MCSection.h" #include "llvm/MC/MCSymbolELF.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/ELF.h" -#include "llvm/Support/raw_ostream.h" +#include "llvm/MC/SectionKind.h" namespace llvm { @@ -47,17 +45,18 @@ class MCSectionELF final : public MCSection { const MCSymbolELF *Group; - /// Depending on the type of the section this is sh_link or sh_info. - const MCSectionELF *Associated; + /// sh_info for SHF_LINK_ORDER (can be null). + const MCSymbol *AssociatedSymbol; private: friend class MCContext; + MCSectionELF(StringRef Section, unsigned type, unsigned flags, SectionKind K, unsigned entrySize, const MCSymbolELF *group, unsigned UniqueID, - MCSymbol *Begin, const MCSectionELF *Associated) + MCSymbol *Begin, const MCSymbolELF *AssociatedSymbol) : MCSection(SV_ELF, K, Begin), SectionName(Section), Type(type), Flags(flags), UniqueID(UniqueID), EntrySize(entrySize), Group(group), - Associated(Associated) { + AssociatedSymbol(AssociatedSymbol) { if (Group) Group->setIsSignature(); } @@ -78,7 +77,8 @@ public: void setFlags(unsigned F) { Flags = F; } const MCSymbolELF *getGroup() const { return Group; } - void PrintSwitchToSection(const MCAsmInfo &MAI, raw_ostream &OS, + void PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T, + raw_ostream &OS, const MCExpr *Subsection) const override; bool UseCodeAlign() const override; bool isVirtualSection() const override; @@ -86,7 +86,8 @@ public: bool isUnique() const { return UniqueID != ~0U; } unsigned getUniqueID() const { return UniqueID; } - const MCSectionELF *getAssociatedSection() const { return Associated; } + const MCSection *getAssociatedSection() const { return &AssociatedSymbol->getSection(); } + const MCSymbol *getAssociatedSymbol() const { return AssociatedSymbol; } static bool classof(const MCSection *S) { return S->getVariant() == SV_ELF; @@ -95,4 +96,4 @@ public: } // end namespace llvm -#endif +#endif // LLVM_MC_MCSECTIONELF_H |