forked from OSchip/llvm-project
Move Ordinal from MCSectionData to MCSection. NFC.
Part of the work to merge MCSectionData and MCSection. llvm-svn: 238137
This commit is contained in:
parent
e7134b2d78
commit
1f02022027
|
@ -559,9 +559,6 @@ private:
|
||||||
FragmentListType Fragments;
|
FragmentListType Fragments;
|
||||||
MCSection *Section;
|
MCSection *Section;
|
||||||
|
|
||||||
/// Ordinal - The section index in the assemblers section list.
|
|
||||||
unsigned Ordinal;
|
|
||||||
|
|
||||||
/// LayoutOrder - The index of this section in the layout order.
|
/// LayoutOrder - The index of this section in the layout order.
|
||||||
unsigned LayoutOrder;
|
unsigned LayoutOrder;
|
||||||
|
|
||||||
|
@ -600,8 +597,8 @@ public:
|
||||||
bool hasInstructions() const { return HasInstructions; }
|
bool hasInstructions() const { return HasInstructions; }
|
||||||
void setHasInstructions(bool Value) { HasInstructions = Value; }
|
void setHasInstructions(bool Value) { HasInstructions = Value; }
|
||||||
|
|
||||||
unsigned getOrdinal() const { return Ordinal; }
|
unsigned getOrdinal() const;
|
||||||
void setOrdinal(unsigned Value) { Ordinal = Value; }
|
void setOrdinal(unsigned Value);
|
||||||
|
|
||||||
unsigned getLayoutOrder() const { return LayoutOrder; }
|
unsigned getLayoutOrder() const { return LayoutOrder; }
|
||||||
void setLayoutOrder(unsigned Value) { LayoutOrder = Value; }
|
void setLayoutOrder(unsigned Value) { LayoutOrder = Value; }
|
||||||
|
|
|
@ -39,10 +39,13 @@ private:
|
||||||
MCSymbol *End;
|
MCSymbol *End;
|
||||||
/// The alignment requirement of this section.
|
/// The alignment requirement of this section.
|
||||||
unsigned Alignment;
|
unsigned Alignment;
|
||||||
|
/// The section index in the assemblers section list.
|
||||||
|
unsigned Ordinal;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
MCSection(SectionVariant V, SectionKind K, MCSymbol *Begin)
|
MCSection(SectionVariant V, SectionKind K, MCSymbol *Begin)
|
||||||
: Begin(Begin), End(nullptr), Alignment(1), Variant(V), Kind(K) {}
|
: Begin(Begin), End(nullptr), Alignment(1), Ordinal(~UINT32_C(0)),
|
||||||
|
Variant(V), Kind(K) {}
|
||||||
SectionVariant Variant;
|
SectionVariant Variant;
|
||||||
SectionKind Kind;
|
SectionKind Kind;
|
||||||
|
|
||||||
|
@ -67,6 +70,9 @@ public:
|
||||||
unsigned getAlignment() const { return Alignment; }
|
unsigned getAlignment() const { return Alignment; }
|
||||||
void setAlignment(unsigned Value) { Alignment = Value; }
|
void setAlignment(unsigned Value) { Alignment = Value; }
|
||||||
|
|
||||||
|
unsigned getOrdinal() const { return Ordinal; }
|
||||||
|
void setOrdinal(unsigned Value) { Ordinal = Value; }
|
||||||
|
|
||||||
virtual void PrintSwitchToSection(const MCAsmInfo &MAI, raw_ostream &OS,
|
virtual void PrintSwitchToSection(const MCAsmInfo &MAI, raw_ostream &OS,
|
||||||
const MCExpr *Subsection) const = 0;
|
const MCExpr *Subsection) const = 0;
|
||||||
|
|
||||||
|
|
|
@ -293,13 +293,16 @@ MCEncodedFragmentWithFixups::~MCEncodedFragmentWithFixups() {
|
||||||
MCSectionData::MCSectionData() : Section(nullptr) {}
|
MCSectionData::MCSectionData() : Section(nullptr) {}
|
||||||
|
|
||||||
MCSectionData::MCSectionData(MCSection &Section, MCAssembler *A)
|
MCSectionData::MCSectionData(MCSection &Section, MCAssembler *A)
|
||||||
: Section(&Section), Ordinal(~UINT32_C(0)),
|
: Section(&Section), BundleLockState(NotBundleLocked),
|
||||||
BundleLockState(NotBundleLocked), BundleLockNestingDepth(0),
|
BundleLockNestingDepth(0), BundleGroupBeforeFirstInst(false),
|
||||||
BundleGroupBeforeFirstInst(false), HasInstructions(false) {
|
HasInstructions(false) {
|
||||||
if (A)
|
if (A)
|
||||||
A->getSectionList().push_back(this);
|
A->getSectionList().push_back(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned MCSectionData::getOrdinal() const { return Section->getOrdinal(); }
|
||||||
|
void MCSectionData::setOrdinal(unsigned Value) { Section->setOrdinal(Value); }
|
||||||
|
|
||||||
MCSectionData::iterator
|
MCSectionData::iterator
|
||||||
MCSectionData::getSubsectionInsertionPoint(unsigned Subsection) {
|
MCSectionData::getSubsectionInsertionPoint(unsigned Subsection) {
|
||||||
if (Subsection == 0 && SubsectionFragmentMap.empty())
|
if (Subsection == 0 && SubsectionFragmentMap.empty())
|
||||||
|
|
Loading…
Reference in New Issue