summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/MC/MCAssembler.h7
-rw-r--r--llvm/include/llvm/MC/MCObjectStreamer.h4
-rw-r--r--llvm/include/llvm/MC/MCSection.h8
3 files changed, 8 insertions, 11 deletions
diff --git a/llvm/include/llvm/MC/MCAssembler.h b/llvm/include/llvm/MC/MCAssembler.h
index da3fb9f2faf..ee7583e0e82 100644
--- a/llvm/include/llvm/MC/MCAssembler.h
+++ b/llvm/include/llvm/MC/MCAssembler.h
@@ -557,10 +557,6 @@ private:
//
// FIXME: This could all be kept private to the assembler implementation.
- /// HasInstructions - Whether this section has had instructions emitted into
- /// it.
- unsigned HasInstructions : 1;
-
/// Mapping from subsection number to insertion point for subsection numbers
/// below that number.
SmallVector<std::pair<unsigned, MCFragment *>, 1> SubsectionFragmentMap;
@@ -574,9 +570,6 @@ public:
MCSection &getSection() const { return *Section; }
- bool hasInstructions() const { return HasInstructions; }
- void setHasInstructions(bool Value) { HasInstructions = Value; }
-
/// \name Fragment Access
/// @{
diff --git a/llvm/include/llvm/MC/MCObjectStreamer.h b/llvm/include/llvm/MC/MCObjectStreamer.h
index 284dd55443d..646603975f5 100644
--- a/llvm/include/llvm/MC/MCObjectStreamer.h
+++ b/llvm/include/llvm/MC/MCObjectStreamer.h
@@ -146,9 +146,7 @@ public:
bool emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo,
unsigned Size) override;
- bool mayHaveInstructions(MCSection &Sec) const override {
- return Assembler->getOrCreateSectionData(Sec).hasInstructions();
- }
+ bool mayHaveInstructions(MCSection &Sec) const override;
};
} // end namespace llvm
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