Close unique sections when switching away from them.
[oota-llvm.git] / include / llvm / MC / MCSection.h
index ab8968ef2baf0a4e6918b6d2a25f253fb38bccb0..fc0fc7bc8ffa2f5cd8235d7e38cef6f654c7a4e1 100644 (file)
@@ -39,10 +39,11 @@ private:
   mutable MCSymbol *End;
 
 protected:
-  MCSection(SectionVariant V, SectionKind K, MCSymbol *Begin)
-      : Begin(Begin), End(nullptr), Variant(V), Kind(K) {}
+  MCSection(SectionVariant V, SectionKind K, MCSymbol *Begin, bool Unique)
+      : Begin(Begin), End(nullptr), Variant(V), Kind(K), Unique(Unique) {}
   SectionVariant Variant;
   SectionKind Kind;
+  bool Unique;
 
 public:
   virtual ~MCSection();
@@ -54,6 +55,7 @@ public:
   MCSymbol *getBeginSymbol() const { return Begin; }
   MCSymbol *getEndSymbol(MCContext &Ctx) const;
   bool hasEnded() const;
+  bool isUnique() const { return Unique; }
 
   virtual void PrintSwitchToSection(const MCAsmInfo &MAI, raw_ostream &OS,
                                     const MCExpr *Subsection) const = 0;