Skip to content

Commit 80d00bf

Browse files
[ProfileData] Use default member initialization (NFC) (#94860)
Identified with modernize-use-default-member-init.
1 parent bafff3e commit 80d00bf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

llvm/include/llvm/ProfileData/InstrProfReader.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ class IndexedInstrProfReader : public InstrProfReader {
708708
const uint8_t *BinaryIdsStart = nullptr;
709709

710710
// Index to the current record in the record array.
711-
unsigned RecordIndex;
711+
unsigned RecordIndex = 0;
712712

713713
// Read the profile summary. Return a pointer pointing to one byte past the
714714
// end of the summary data if it exists or the input \c Cur.
@@ -721,7 +721,7 @@ class IndexedInstrProfReader : public InstrProfReader {
721721
std::unique_ptr<MemoryBuffer> DataBuffer,
722722
std::unique_ptr<MemoryBuffer> RemappingBuffer = nullptr)
723723
: DataBuffer(std::move(DataBuffer)),
724-
RemappingBuffer(std::move(RemappingBuffer)), RecordIndex(0) {}
724+
RemappingBuffer(std::move(RemappingBuffer)) {}
725725
IndexedInstrProfReader(const IndexedInstrProfReader &) = delete;
726726
IndexedInstrProfReader &operator=(const IndexedInstrProfReader &) = delete;
727727

llvm/include/llvm/ProfileData/SampleProfWriter.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class SampleProfileWriterText : public SampleProfileWriter {
169169

170170
protected:
171171
SampleProfileWriterText(std::unique_ptr<raw_ostream> &OS)
172-
: SampleProfileWriter(OS), Indent(0) {}
172+
: SampleProfileWriter(OS) {}
173173

174174
std::error_code writeHeader(const SampleProfileMap &ProfileMap) override {
175175
LineCount = 0;
@@ -180,7 +180,7 @@ class SampleProfileWriterText : public SampleProfileWriter {
180180
/// Indent level to use when writing.
181181
///
182182
/// This is used when printing inlined callees.
183-
unsigned Indent;
183+
unsigned Indent = 0;
184184

185185
friend ErrorOr<std::unique_ptr<SampleProfileWriter>>
186186
SampleProfileWriter::create(std::unique_ptr<raw_ostream> &OS,

0 commit comments

Comments
 (0)