Skip to content

Commit 08ce5eb

Browse files
kazutakahirataPhilippRados
authored andcommitted
[memprof] Use MinimumSupportedVersion in place of Verion0 (NFC) (llvm#114723)
I'm planning to remove old versions of the MemProf indexed formats at some point. Replacing these occurrences of Version0 with MinimumSupportedVersion allows me to touch fewer places when I remove old versions in the future. Note that these two parameters being touched in this patch have nothing to do with the default MemProf version that llvm-profdata uses, which is controlled by MemProfVersionRequested in llvm-profdata.cpp.
1 parent 1c5ffab commit 08ce5eb

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

llvm/include/llvm/ProfileData/InstrProfReader.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,8 @@ class InstrProfReaderRemapper {
669669
class IndexedMemProfReader {
670670
private:
671671
/// The MemProf version.
672-
memprof::IndexedVersion Version = memprof::Version0;
672+
memprof::IndexedVersion Version =
673+
static_cast<memprof::IndexedVersion>(memprof::MinimumSupportedVersion);
673674
/// MemProf profile schema (if available).
674675
memprof::MemProfSchema Schema;
675676
/// MemProf record profile data on-disk indexed via llvm::md5(FunctionName).

llvm/include/llvm/ProfileData/InstrProfWriter.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,16 @@ class InstrProfWriter {
8686
// MemprofGenerateRandomHotness is enabled. The random seed can be either
8787
// provided by MemprofGenerateRandomHotnessSeed, or if that is 0, one will be
8888
// generated in the writer using the current time.
89-
InstrProfWriter(
90-
bool Sparse = false, uint64_t TemporalProfTraceReservoirSize = 0,
91-
uint64_t MaxTemporalProfTraceLength = 0, bool WritePrevVersion = false,
92-
memprof::IndexedVersion MemProfVersionRequested = memprof::Version0,
93-
bool MemProfFullSchema = false, bool MemprofGenerateRandomHotness = false,
94-
unsigned MemprofGenerateRandomHotnessSeed = 0);
89+
InstrProfWriter(bool Sparse = false,
90+
uint64_t TemporalProfTraceReservoirSize = 0,
91+
uint64_t MaxTemporalProfTraceLength = 0,
92+
bool WritePrevVersion = false,
93+
memprof::IndexedVersion MemProfVersionRequested =
94+
static_cast<memprof::IndexedVersion>(
95+
memprof::MinimumSupportedVersion),
96+
bool MemProfFullSchema = false,
97+
bool MemprofGenerateRandomHotness = false,
98+
unsigned MemprofGenerateRandomHotnessSeed = 0);
9599
~InstrProfWriter();
96100

97101
StringMap<ProfilingData> &getProfileData() { return FunctionData; }

0 commit comments

Comments
 (0)