summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm/MC/MCSection.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include/llvm/MC/MCSection.h')
-rw-r--r--llvm/include/llvm/MC/MCSection.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/include/llvm/MC/MCSection.h b/llvm/include/llvm/MC/MCSection.h
index 99d11c40c4e..4dbf4ba6f02 100644
--- a/llvm/include/llvm/MC/MCSection.h
+++ b/llvm/include/llvm/MC/MCSection.h
@@ -61,9 +61,12 @@ private:
/// yet.
bool BundleGroupBeforeFirstInst = false;
+ /// Whether this section has had instructions emitted into it.
+ unsigned HasInstructions : 1;
+
protected:
MCSection(SectionVariant V, SectionKind K, MCSymbol *Begin)
- : Begin(Begin), Variant(V), Kind(K) {}
+ : Begin(Begin), HasInstructions(false), Variant(V), Kind(K) {}
SectionVariant Variant;
SectionKind Kind;
@@ -105,6 +108,9 @@ public:
BundleGroupBeforeFirstInst = IsFirst;
}
+ bool hasInstructions() const { return HasInstructions; }
+ void setHasInstructions(bool Value) { HasInstructions = Value; }
+
virtual void PrintSwitchToSection(const MCAsmInfo &MAI, raw_ostream &OS,
const MCExpr *Subsection) const = 0;
OpenPOWER on IntegriCloud