[bolt] Remove redundaunt virtual specifiers (NFC)
authorKazu Hirata <kazu@google.com>
Sat, 30 Jul 2022 17:35:51 +0000 (10:35 -0700)
committerKazu Hirata <kazu@google.com>
Sat, 30 Jul 2022 17:35:51 +0000 (10:35 -0700)
Identified with modernize-use-override.

bolt/include/bolt/Core/DebugData.h
bolt/include/bolt/Core/JumpTable.h
bolt/include/bolt/Profile/DataReader.h
bolt/include/bolt/Profile/YAMLProfileReader.h
bolt/lib/Target/X86/X86MCPlusBuilder.cpp

index fad14c1..a937014 100644 (file)
@@ -226,22 +226,22 @@ public:
   static void setAddressWriter(DebugAddrWriter *AddrW) { AddrWriter = AddrW; }
 
   /// Add ranges with caching.
-  virtual uint64_t addRanges(
+  uint64_t addRanges(
       DebugAddressRangesVector &&Ranges,
       std::map<DebugAddressRangesVector, uint64_t> &CachedRanges) override;
 
   /// Add ranges and return offset into section.
-  virtual uint64_t addRanges(const DebugAddressRangesVector &Ranges) override;
+  uint64_t addRanges(const DebugAddressRangesVector &Ranges) override;
 
-  virtual std::unique_ptr<DebugBufferVector> releaseBuffer() override {
+  std::unique_ptr<DebugBufferVector> releaseBuffer() override {
     return std::move(RangesBuffer);
   }
 
   /// Needs to be invoked before each \p CU is processed.
-  void virtual initSection(DWARFUnit &CU) override;
+  void initSection(DWARFUnit &CU) override;
 
   /// Writes out range lists for a current CU being processed.
-  void virtual finalizeSection() override;
+  void finalizeSection() override;
 
   // Returns true if section is empty.
   bool empty() { return RangesBuffer->empty(); }
@@ -391,15 +391,15 @@ public:
   DebugAddrWriterDwarf5(BinaryContext *BC) : DebugAddrWriter(BC) {}
 
   /// Creates consolidated .debug_addr section, and builds DWOID to offset map.
-  virtual AddressSectionBuffer finalize() override;
+  AddressSectionBuffer finalize() override;
   /// Given DWARFUnit \p Unit returns offset of this CU in to .debug_addr
   /// section.
-  virtual uint64_t getOffset(DWARFUnit &Unit) override;
+  uint64_t getOffset(DWARFUnit &Unit) override;
 
 protected:
   /// Given DWARFUnit \p Unit returns either DWO ID or it's offset within
   /// .debug_info.
-  virtual uint64_t getCUID(DWARFUnit &Unit) override {
+  uint64_t getCUID(DWARFUnit &Unit) override {
     if (Unit.isDWOUnit()) {
       DWARFUnit *SkeletonCU = Unit.getLinkedUnit();
       return SkeletonCU->getOffset();
@@ -561,9 +561,9 @@ public:
   static void setAddressWriter(DebugAddrWriter *AddrW) { AddrWriter = AddrW; }
 
   /// Stores location lists internally to be written out during finalize phase.
-  virtual void addList(AttrInfo &AttrVal, DebugLocationsVector &LocList,
-                       DebugInfoBinaryPatcher &DebugInfoPatcher,
-                       DebugAbbrevWriter &AbbrevWriter) override;
+  void addList(AttrInfo &AttrVal, DebugLocationsVector &LocList,
+               DebugInfoBinaryPatcher &DebugInfoPatcher,
+               DebugAbbrevWriter &AbbrevWriter) override;
 
   /// Writes out locations in to a local buffer and applies debug info patches.
   void finalize(DebugInfoBinaryPatcher &DebugInfoPatcher,
@@ -685,7 +685,7 @@ public:
 
   /// This function takes in \p BinaryContents, applies patches to it and
   /// returns an updated string.
-  virtual std::string patchBinary(StringRef BinaryContents) override;
+  std::string patchBinary(StringRef BinaryContents) override;
 };
 
 class DebugInfoBinaryPatcher : public SimpleBinaryPatcher {
@@ -843,7 +843,7 @@ public:
     std::string Value;
   };
 
-  virtual PatcherKind getKind() const override {
+  PatcherKind getKind() const override {
     return PatcherKind::DebugInfoBinaryPatcher;
   }
 
@@ -853,23 +853,23 @@ public:
 
   /// This function takes in \p BinaryContents, and re-writes it with new
   /// patches inserted into it. It returns an updated string.
-  virtual std::string patchBinary(StringRef BinaryContents) override;
+  std::string patchBinary(StringRef BinaryContents) override;
 
   /// Adds a patch to put the integer \p NewValue encoded as a 64-bit
   /// little-endian value at offset \p Offset.
-  virtual void addLE64Patch(uint64_t Offset, uint64_t NewValue) override;
+  void addLE64Patch(uint64_t Offset, uint64_t NewValue) override;
 
   /// Adds a patch to put the integer \p NewValue encoded as a 32-bit
   /// little-endian value at offset \p Offset.
   /// The \p OldValueSize is the size of the old value that will be replaced.
-  virtual void addLE32Patch(uint64_t Offset, uint32_t NewValue,
-                            uint32_t OldValueSize = 4) override;
+  void addLE32Patch(uint64_t Offset, uint32_t NewValue,
+                    uint32_t OldValueSize = 4) override;
 
   /// Add a patch at \p Offset with \p Value using unsigned LEB128 encoding with
   /// size \p OldValueSize.
   /// The \p OldValueSize is the size of the old value that will be replaced.
-  virtual void addUDataPatch(uint64_t Offset, uint64_t Value,
-                             uint32_t OldValueSize) override;
+  void addUDataPatch(uint64_t Offset, uint64_t Value,
+                     uint32_t OldValueSize) override;
 
   /// Adds a label \p Offset for DWARF UNit.
   /// Used to recompute relative references.
index 9615025..2f85232 100644 (file)
@@ -109,7 +109,7 @@ public:
   /// starting at (or containing) 'Addr'.
   std::pair<size_t, size_t> getEntriesForAddress(const uint64_t Addr) const;
 
-  virtual bool isJumpTable() const override { return true; }
+  bool isJumpTable() const override { return true; }
 
   /// Change all entries of the jump table in \p JTAddress pointing to
   /// \p OldDest to \p NewDest. Return false if unsuccessful.
@@ -120,7 +120,7 @@ public:
   void updateOriginal();
 
   /// Print for debugging purposes.
-  virtual void print(raw_ostream &OS) const override;
+  void print(raw_ostream &OS) const override;
 };
 
 } // namespace bolt
index 60cedfe..4253fc1 100644 (file)
@@ -268,18 +268,18 @@ public:
 
   bool isTrustedSource() const override { return false; }
 
-  virtual Error preprocessProfile(BinaryContext &BC) override;
+  Error preprocessProfile(BinaryContext &BC) override;
 
-  virtual Error readProfilePreCFG(BinaryContext &BC) override;
+  Error readProfilePreCFG(BinaryContext &BC) override;
 
-  virtual Error readProfile(BinaryContext &BC) override;
+  Error readProfile(BinaryContext &BC) override;
 
-  virtual bool hasLocalsWithFileName() const override;
+  bool hasLocalsWithFileName() const override;
 
-  virtual bool mayHaveProfileData(const BinaryFunction &BF) override;
+  bool mayHaveProfileData(const BinaryFunction &BF) override;
 
   /// Return all event names used to collect this profile
-  virtual StringSet<> getEventNames() const override { return EventNames; }
+  StringSet<> getEventNames() const override { return EventNames; }
 
 protected:
   /// Read profile information available for the function.
index 3c21a8e..255ab07 100644 (file)
@@ -33,9 +33,9 @@ public:
 
   Error preprocessProfile(BinaryContext &BC) override;
 
-  virtual bool hasLocalsWithFileName() const override;
+  bool hasLocalsWithFileName() const override;
 
-  virtual bool mayHaveProfileData(const BinaryFunction &BF) override;
+  bool mayHaveProfileData(const BinaryFunction &BF) override;
 
   /// Check if the file contains YAML.
   static bool isYAML(StringRef Filename);
index b6343aa..c9a9228 100644 (file)
@@ -574,7 +574,7 @@ public:
     }
   };
 
-  virtual std::unique_ptr<MCInstMatcher>
+  std::unique_ptr<MCInstMatcher>
   matchAdd(std::unique_ptr<MCInstMatcher> A,
            std::unique_ptr<MCInstMatcher> B) const override {
     return std::unique_ptr<MCInstMatcher>(
@@ -612,7 +612,7 @@ public:
     }
   };
 
-  virtual std::unique_ptr<MCInstMatcher>
+  std::unique_ptr<MCInstMatcher>
   matchLoadAddr(std::unique_ptr<MCInstMatcher> Target) const override {
     return std::unique_ptr<MCInstMatcher>(new LEAMatcher(std::move(Target)));
   }