Skip to content

Commit 8bc2eb8

Browse files
[memprof] Rename "v2" functions and tests (NFC) (#156247)
I'm planning to remove the V2 support. Now, some functions and tests should not be removed just because they have "v2" in their names. This patch renames them. - makeRecordV2: Renamed to makeRecord. This has "V2" in the name because the concept of call stack ID came out as part of V2. It is still useful for use with V3 and V4. - test_memprof_v4_{partial,full}_schema: Upgraded to use V4. These tests perform serialization/deserialization roundtrip tests of a MemProfRecord with {partial,full} schema.
1 parent 0247358 commit 8bc2eb8

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

llvm/unittests/ProfileData/InstrProfTest.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,9 @@ MemInfoBlock makePartialMIB() {
392392
}
393393

394394
IndexedMemProfRecord
395-
makeRecordV2(std::initializer_list<::llvm::memprof::CallStackId> AllocFrames,
396-
std::initializer_list<::llvm::memprof::CallStackId> CallSiteFrames,
397-
const MemInfoBlock &Block, const memprof::MemProfSchema &Schema) {
395+
makeRecord(std::initializer_list<::llvm::memprof::CallStackId> AllocFrames,
396+
std::initializer_list<::llvm::memprof::CallStackId> CallSiteFrames,
397+
const MemInfoBlock &Block, const memprof::MemProfSchema &Schema) {
398398
IndexedMemProfRecord MR;
399399
for (const auto &CSId : AllocFrames)
400400
MR.AllocSites.emplace_back(CSId, Block, Schema);
@@ -436,16 +436,16 @@ MATCHER_P(EqualsRecord, Want, "") {
436436
return true;
437437
}
438438

439-
TEST_F(InstrProfTest, test_memprof_v2_full_schema) {
439+
TEST_F(InstrProfTest, test_memprof_v4_full_schema) {
440440
const MemInfoBlock MIB = makeFullMIB();
441441

442-
Writer.setMemProfVersionRequested(memprof::Version2);
442+
Writer.setMemProfVersionRequested(memprof::Version4);
443443
Writer.setMemProfFullSchema(true);
444444

445445
ASSERT_THAT_ERROR(Writer.mergeProfileKind(InstrProfKind::MemProf),
446446
Succeeded());
447447

448-
const IndexedMemProfRecord IndexedMR = makeRecordV2(
448+
const IndexedMemProfRecord IndexedMR = makeRecord(
449449
/*AllocFrames=*/{0x111, 0x222},
450450
/*CallSiteFrames=*/{0x333}, MIB, memprof::getFullSchema());
451451
IndexedMemProfData MemProfData = getMemProfDataForTest();
@@ -470,16 +470,16 @@ TEST_F(InstrProfTest, test_memprof_v2_full_schema) {
470470
EXPECT_THAT(WantRecord, EqualsRecord(Record));
471471
}
472472

473-
TEST_F(InstrProfTest, test_memprof_v2_partial_schema) {
473+
TEST_F(InstrProfTest, test_memprof_v4_partial_schema) {
474474
const MemInfoBlock MIB = makePartialMIB();
475475

476-
Writer.setMemProfVersionRequested(memprof::Version2);
476+
Writer.setMemProfVersionRequested(memprof::Version4);
477477
Writer.setMemProfFullSchema(false);
478478

479479
ASSERT_THAT_ERROR(Writer.mergeProfileKind(InstrProfKind::MemProf),
480480
Succeeded());
481481

482-
const IndexedMemProfRecord IndexedMR = makeRecordV2(
482+
const IndexedMemProfRecord IndexedMR = makeRecord(
483483
/*AllocFrames=*/{0x111, 0x222},
484484
/*CallSiteFrames=*/{0x333}, MIB, memprof::getHotColdSchema());
485485
IndexedMemProfData MemProfData = getMemProfDataForTest();
@@ -525,7 +525,7 @@ TEST_F(InstrProfTest, test_caller_callee_pairs) {
525525
// Line: 7, Column: 8
526526
// new(...)
527527

528-
const IndexedMemProfRecord IndexedMR = makeRecordV2(
528+
const IndexedMemProfRecord IndexedMR = makeRecord(
529529
/*AllocFrames=*/{0x111, 0x222},
530530
/*CallSiteFrames=*/{}, MIB, memprof::getHotColdSchema());
531531

@@ -584,7 +584,7 @@ TEST_F(InstrProfTest, test_memprof_merge) {
584584
ASSERT_THAT_ERROR(Writer2.mergeProfileKind(InstrProfKind::MemProf),
585585
Succeeded());
586586

587-
const IndexedMemProfRecord IndexedMR = makeRecordV2(
587+
const IndexedMemProfRecord IndexedMR = makeRecord(
588588
/*AllocFrames=*/{0x111, 0x222},
589589
/*CallSiteFrames=*/{}, makePartialMIB(), memprof::getHotColdSchema());
590590

0 commit comments

Comments
 (0)