Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions llvm/include/llvm/ProfileData/InstrProfReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/ProfileData/SampleProfWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down
Loading