[llvm] 80d00bf - [ProfileData] Use default member initialization (NFC) (#94860)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 8 10:00:46 PDT 2024


Author: Kazu Hirata
Date: 2024-06-08T10:00:41-07:00
New Revision: 80d00bf811cc3361c78e55243f8c5aa8deffdb0a

URL: https://github.com/llvm/llvm-project/commit/80d00bf811cc3361c78e55243f8c5aa8deffdb0a
DIFF: https://github.com/llvm/llvm-project/commit/80d00bf811cc3361c78e55243f8c5aa8deffdb0a.diff

LOG: [ProfileData] Use default member initialization (NFC) (#94860)

Identified with modernize-use-default-member-init.

Added: 
    

Modified: 
    llvm/include/llvm/ProfileData/InstrProfReader.h
    llvm/include/llvm/ProfileData/SampleProfWriter.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ProfileData/InstrProfReader.h b/llvm/include/llvm/ProfileData/InstrProfReader.h
index 34dba870d8da3..f89e6eab9fdaf 100644
--- a/llvm/include/llvm/ProfileData/InstrProfReader.h
+++ b/llvm/include/llvm/ProfileData/InstrProfReader.h
@@ -708,7 +708,7 @@ class IndexedInstrProfReader : public InstrProfReader {
   const uint8_t *BinaryIdsStart = nullptr;
 
   // Index to the current record in the record array.
-  unsigned RecordIndex;
+  unsigned RecordIndex = 0;
 
   // Read the profile summary. Return a pointer pointing to one byte past the
   // end of the summary data if it exists or the input \c Cur.
@@ -721,7 +721,7 @@ class IndexedInstrProfReader : public InstrProfReader {
       std::unique_ptr<MemoryBuffer> DataBuffer,
       std::unique_ptr<MemoryBuffer> RemappingBuffer = nullptr)
       : DataBuffer(std::move(DataBuffer)),
-        RemappingBuffer(std::move(RemappingBuffer)), RecordIndex(0) {}
+        RemappingBuffer(std::move(RemappingBuffer)) {}
   IndexedInstrProfReader(const IndexedInstrProfReader &) = delete;
   IndexedInstrProfReader &operator=(const IndexedInstrProfReader &) = delete;
 

diff  --git a/llvm/include/llvm/ProfileData/SampleProfWriter.h b/llvm/include/llvm/ProfileData/SampleProfWriter.h
index 963a4d4918e56..5398a44f13ba3 100644
--- a/llvm/include/llvm/ProfileData/SampleProfWriter.h
+++ b/llvm/include/llvm/ProfileData/SampleProfWriter.h
@@ -169,7 +169,7 @@ class SampleProfileWriterText : public SampleProfileWriter {
 
 protected:
   SampleProfileWriterText(std::unique_ptr<raw_ostream> &OS)
-      : SampleProfileWriter(OS), Indent(0) {}
+      : SampleProfileWriter(OS) {}
 
   std::error_code writeHeader(const SampleProfileMap &ProfileMap) override {
     LineCount = 0;
@@ -180,7 +180,7 @@ class SampleProfileWriterText : public SampleProfileWriter {
   /// Indent level to use when writing.
   ///
   /// This is used when printing inlined callees.
-  unsigned Indent;
+  unsigned Indent = 0;
 
   friend ErrorOr<std::unique_ptr<SampleProfileWriter>>
   SampleProfileWriter::create(std::unique_ptr<raw_ostream> &OS,


        


More information about the llvm-commits mailing list