#ifndef LLVM_MC_MCSECTION_H
#define LLVM_MC_MCSECTION_H
#include "llvm/ADT/StringRef.h"
#include "llvm/MC/SectionKind.h"
#include "llvm/Support/Compiler.h"
namespace llvm {
class MCAsmInfo;
class MCExpr;
class MCSymbol;
class raw_ostream;
class MCSection {
public:
enum SectionVariant { SV_COFF = 0, SV_ELF, SV_MachO };
private:
MCSection(const MCSection &) = delete;
void operator=(const MCSection &) = delete;
mutable const MCSymbol *Begin;
protected:
MCSection(SectionVariant V, SectionKind K)
: Begin(nullptr), Variant(V), Kind(K) {}
SectionVariant Variant;
SectionKind Kind;
public:
virtual ~MCSection();
SectionKind getKind() const { return Kind; }
SectionVariant getVariant() const { return Variant; }
const MCSymbol *getBeginSymbol() const { return Begin; }
void setBeginSymbol(const MCSymbol &L) const {
assert(!Begin);
Begin = &L;
}
virtual void PrintSwitchToSection(const MCAsmInfo &MAI, raw_ostream &OS,
const MCExpr *Subsection) const = 0;
virtual bool UseCodeAlign() const = 0;
virtual bool isVirtualSection() const = 0;
};
}
#endif