Merge the used symbol scanning of MCObjectStreamer and RecordStreamer.
[oota-llvm.git] / include / llvm / MC / MCAtom.h
index ad8291fe7b2c96e7d5c3353aa1b7f35f7120b9fb..e9d0fbacc1e2a0a95715d96c0c77b954a3b3fe96 100644 (file)
@@ -32,6 +32,7 @@ class MCDataAtom;
 /// \brief Represents a contiguous range of either instructions (a TextAtom)
 /// or data (a DataAtom).  Address ranges are expressed as _closed_ intervals.
 class MCAtom {
+  virtual void anchor();
 public:
   virtual ~MCAtom() {}
 
@@ -139,13 +140,13 @@ public:
 
   const MCDecodedInst &back() const { return Insts.back(); }
   const MCDecodedInst &at(size_t n) const { return Insts.at(n); }
-  uint64_t size() const { return Insts.size(); }
+  size_t size() const { return Insts.size(); }
   /// @}
 
   /// \name Atom type specific split/truncate logic.
   /// @{
-  MCTextAtom *split(uint64_t SplitPt) LLVM_OVERRIDE;
-  void     truncate(uint64_t TruncPt) LLVM_OVERRIDE;
+  MCTextAtom *split(uint64_t SplitPt) override;
+  void     truncate(uint64_t TruncPt) override;
   /// @}
 
   // Class hierarchy.
@@ -178,8 +179,8 @@ public:
 
   /// \name Atom type specific split/truncate logic.
   /// @{
-  MCDataAtom *split(uint64_t SplitPt) LLVM_OVERRIDE;
-  void     truncate(uint64_t TruncPt) LLVM_OVERRIDE;
+  MCDataAtom *split(uint64_t SplitPt) override;
+  void     truncate(uint64_t TruncPt) override;
   /// @}
 
   // Class hierarchy.
@@ -188,7 +189,9 @@ private:
   friend class MCModule;
   // Private constructor - only callable by MCModule
   MCDataAtom(MCModule *P, uint64_t Begin, uint64_t End)
-    : MCAtom(DataAtom, P, Begin, End), Data(End - Begin) {}
+    : MCAtom(DataAtom, P, Begin, End) {
+    Data.reserve(End + 1 - Begin);
+  }
 };
 
 }