123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- #pragma once
- #ifdef __GNUC__
- #pragma GCC diagnostic push
- #pragma GCC diagnostic ignored "-Wunused-parameter"
- #endif
- #ifndef LLVM_MC_MCSECTIONCOFF_H
- #define LLVM_MC_MCSECTIONCOFF_H
- #include "llvm/ADT/StringRef.h"
- #include "llvm/MC/MCSection.h"
- #include "llvm/MC/SectionKind.h"
- #include <cassert>
- namespace llvm {
- class MCSymbol;
- class MCSectionCOFF final : public MCSection {
-
-
-
-
- mutable unsigned Characteristics;
-
-
-
-
-
- mutable unsigned WinCFISectionID = ~0U;
-
-
- MCSymbol *COMDATSymbol;
-
-
- mutable int Selection;
- private:
- friend class MCContext;
-
- MCSectionCOFF(StringRef Name, unsigned Characteristics,
- MCSymbol *COMDATSymbol, int Selection, SectionKind K,
- MCSymbol *Begin)
- : MCSection(SV_COFF, Name, K, Begin), Characteristics(Characteristics),
- COMDATSymbol(COMDATSymbol), Selection(Selection) {
- assert((Characteristics & 0x00F00000) == 0 &&
- "alignment must not be set upon section creation");
- }
- public:
-
-
- bool shouldOmitSectionDirective(StringRef Name, const MCAsmInfo &MAI) const;
- unsigned getCharacteristics() const { return Characteristics; }
- MCSymbol *getCOMDATSymbol() const { return COMDATSymbol; }
- int getSelection() const { return Selection; }
- void setSelection(int Selection) const;
- void printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
- raw_ostream &OS,
- const MCExpr *Subsection) const override;
- bool useCodeAlign() const override;
- bool isVirtualSection() const override;
- StringRef getVirtualSectionKind() const override;
- unsigned getOrAssignWinCFISectionID(unsigned *NextID) const {
- if (WinCFISectionID == ~0U)
- WinCFISectionID = (*NextID)++;
- return WinCFISectionID;
- }
- static bool isImplicitlyDiscardable(StringRef Name) {
- return Name.startswith(".debug");
- }
- static bool classof(const MCSection *S) { return S->getVariant() == SV_COFF; }
- };
- }
- #endif
- #ifdef __GNUC__
- #pragma GCC diagnostic pop
- #endif
|