Skip to content

Commit f9a0b46

Browse files
[memprof] Remove getFullSchema in MemProfTest.cpp (#90072)
This patch removes getFullSchema in MemProfTest.cpp in favor of llvm::memprof::PortableMemInfoBlock::getFullSchema as they do exactly the same thing.
1 parent 39adc8f commit f9a0b46

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

llvm/unittests/ProfileData/MemProfTest.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,6 @@ MATCHER_P4(FrameContains, FunctionName, LineOffset, Column, Inline, "") {
122122
return false;
123123
}
124124

125-
MemProfSchema getFullSchema() {
126-
MemProfSchema Schema;
127-
#define MIBEntryDef(NameTag, Name, Type) Schema.push_back(Meta::Name);
128-
#include "llvm/ProfileData/MIBEntryDef.inc"
129-
#undef MIBEntryDef
130-
return Schema;
131-
}
132-
133125
TEST(MemProf, FillsValue) {
134126
std::unique_ptr<MockSymbolizer> Symbolizer(new MockSymbolizer());
135127

@@ -248,7 +240,7 @@ TEST(MemProf, PortableWrapper) {
248240
/*dealloc_timestamp=*/2000, /*alloc_cpu=*/3,
249241
/*dealloc_cpu=*/4);
250242

251-
const auto Schema = getFullSchema();
243+
const auto Schema = llvm::memprof::PortableMemInfoBlock::getFullSchema();
252244
PortableMemInfoBlock WriteBlock(Info);
253245

254246
std::string Buffer;
@@ -271,7 +263,7 @@ TEST(MemProf, PortableWrapper) {
271263
// Version0 and Version1 serialize IndexedMemProfRecord in the same format, so
272264
// we share one test.
273265
TEST(MemProf, RecordSerializationRoundTripVersion0And1) {
274-
const MemProfSchema Schema = getFullSchema();
266+
const auto Schema = llvm::memprof::PortableMemInfoBlock::getFullSchema();
275267

276268
MemInfoBlock Info(/*size=*/16, /*access_count=*/7, /*alloc_timestamp=*/1000,
277269
/*dealloc_timestamp=*/2000, /*alloc_cpu=*/3,
@@ -305,7 +297,7 @@ TEST(MemProf, RecordSerializationRoundTripVersion0And1) {
305297
}
306298

307299
TEST(MemProf, RecordSerializationRoundTripVerion2) {
308-
const MemProfSchema Schema = getFullSchema();
300+
const auto Schema = llvm::memprof::PortableMemInfoBlock::getFullSchema();
309301

310302
MemInfoBlock Info(/*size=*/16, /*access_count=*/7, /*alloc_timestamp=*/1000,
311303
/*dealloc_timestamp=*/2000, /*alloc_cpu=*/3,

0 commit comments

Comments
 (0)