Skip to content

Commit 39e1e31

Browse files
[memprof] Drop memprof:: in unit tests (NFC)
This patch replaces memprof::Foo with Foo if we have corresponding: using llvm::memprof::Foo;
1 parent ce44640 commit 39e1e31

File tree

2 files changed

+28
-32
lines changed

2 files changed

+28
-32
lines changed

llvm/unittests/ProfileData/InstrProfTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ IndexedMemProfRecord
393393
makeRecordV2(std::initializer_list<::llvm::memprof::CallStackId> AllocFrames,
394394
std::initializer_list<::llvm::memprof::CallStackId> CallSiteFrames,
395395
const MemInfoBlock &Block, const memprof::MemProfSchema &Schema) {
396-
llvm::memprof::IndexedMemProfRecord MR;
396+
IndexedMemProfRecord MR;
397397
for (const auto &CSId : AllocFrames)
398398
MR.AllocSites.emplace_back(CSId, Block, Schema);
399399
for (const auto &CSId : CallSiteFrames)
@@ -533,7 +533,7 @@ TEST_F(InstrProfTest, test_caller_callee_pairs) {
533533
/*AllocFrames=*/{0x111, 0x222},
534534
/*CallSiteFrames=*/{}, MIB, memprof::getHotColdSchema());
535535

536-
memprof::IndexedMemProfData MemProfData;
536+
IndexedMemProfData MemProfData;
537537
MemProfData.Frames.try_emplace(0, 0x123, 1, 2, false);
538538
MemProfData.Frames.try_emplace(1, 0x234, 3, 4, true);
539539
MemProfData.Frames.try_emplace(2, 0x123, 5, 6, false);

llvm/unittests/ProfileData/MemProfTest.cpp

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@ TEST(MemProf, RecordSerializationRoundTripVerion2) {
277277
/*dealloc_timestamp=*/2000, /*alloc_cpu=*/3,
278278
/*dealloc_cpu=*/4, /*Histogram=*/0, /*HistogramSize=*/0);
279279

280-
llvm::SmallVector<llvm::memprof::CallStackId> CallStackIds = {0x123, 0x456};
280+
llvm::SmallVector<CallStackId> CallStackIds = {0x123, 0x456};
281281

282-
llvm::SmallVector<llvm::memprof::CallStackId> CallSiteIds = {0x333, 0x444};
282+
llvm::SmallVector<CallStackId> CallSiteIds = {0x333, 0x444};
283283

284284
IndexedMemProfRecord Record;
285285
for (const auto &CSId : CallStackIds) {
@@ -308,9 +308,9 @@ TEST(MemProf, RecordSerializationRoundTripVersion2HotColdSchema) {
308308
Info.TotalLifetime = 33;
309309
Info.TotalLifetimeAccessDensity = 44;
310310

311-
llvm::SmallVector<llvm::memprof::CallStackId> CallStackIds = {0x123, 0x456};
311+
llvm::SmallVector<CallStackId> CallStackIds = {0x123, 0x456};
312312

313-
llvm::SmallVector<llvm::memprof::CallStackId> CallSiteIds = {0x333, 0x444};
313+
llvm::SmallVector<CallStackId> CallSiteIds = {0x333, 0x444};
314314

315315
IndexedMemProfRecord Record;
316316
for (const auto &CSId : CallStackIds) {
@@ -422,7 +422,7 @@ TEST(MemProf, SymbolizationFilter) {
422422
}
423423

424424
TEST(MemProf, BaseMemProfReader) {
425-
llvm::memprof::IndexedMemProfData MemProfData;
425+
IndexedMemProfData MemProfData;
426426
Frame F1(/*Hash=*/IndexedMemProfRecord::getGUID("foo"), /*LineOffset=*/20,
427427
/*Column=*/5, /*IsInlineFrame=*/true);
428428
Frame F2(/*Hash=*/IndexedMemProfRecord::getGUID("bar"), /*LineOffset=*/10,
@@ -455,7 +455,7 @@ TEST(MemProf, BaseMemProfReader) {
455455
}
456456

457457
TEST(MemProf, BaseMemProfReaderWithCSIdMap) {
458-
llvm::memprof::IndexedMemProfData MemProfData;
458+
IndexedMemProfData MemProfData;
459459
Frame F1(/*Hash=*/IndexedMemProfRecord::getGUID("foo"), /*LineOffset=*/20,
460460
/*Column=*/5, /*IsInlineFrame=*/true);
461461
Frame F2(/*Hash=*/IndexedMemProfRecord::getGUID("bar"), /*LineOffset=*/10,
@@ -562,8 +562,8 @@ MemInfoBlock makePartialMIB() {
562562
TEST(MemProf, MissingCallStackId) {
563563
// Use a non-existent CallStackId to trigger a mapping error in
564564
// toMemProfRecord.
565-
llvm::memprof::IndexedAllocationInfo AI(0xdeadbeefU, makePartialMIB(),
566-
llvm::memprof::getHotColdSchema());
565+
IndexedAllocationInfo AI(0xdeadbeefU, makePartialMIB(),
566+
llvm::memprof::getHotColdSchema());
567567

568568
IndexedMemProfRecord IndexedMR;
569569
IndexedMR.AllocSites.push_back(AI);
@@ -584,8 +584,8 @@ TEST(MemProf, MissingCallStackId) {
584584
}
585585

586586
TEST(MemProf, MissingFrameId) {
587-
llvm::memprof::IndexedAllocationInfo AI(0x222, makePartialMIB(),
588-
llvm::memprof::getHotColdSchema());
587+
IndexedAllocationInfo AI(0x222, makePartialMIB(),
588+
llvm::memprof::getHotColdSchema());
589589

590590
IndexedMemProfRecord IndexedMR;
591591
IndexedMR.AllocSites.push_back(AI);
@@ -611,9 +611,8 @@ TEST(MemProf, MissingFrameId) {
611611
TEST(MemProf, RadixTreeBuilderEmpty) {
612612
llvm::DenseMap<FrameId, llvm::memprof::LinearFrameId> MemProfFrameIndexes;
613613
llvm::MapVector<CallStackId, llvm::SmallVector<FrameId>> MemProfCallStackData;
614-
llvm::DenseMap<llvm::memprof::FrameId, llvm::memprof::FrameStat>
615-
FrameHistogram =
616-
llvm::memprof::computeFrameHistogram<FrameId>(MemProfCallStackData);
614+
llvm::DenseMap<FrameId, llvm::memprof::FrameStat> FrameHistogram =
615+
llvm::memprof::computeFrameHistogram<FrameId>(MemProfCallStackData);
617616
llvm::memprof::CallStackRadixTreeBuilder<FrameId> Builder;
618617
Builder.build(std::move(MemProfCallStackData), &MemProfFrameIndexes,
619618
FrameHistogram);
@@ -626,12 +625,11 @@ TEST(MemProf, RadixTreeBuilderEmpty) {
626625
TEST(MemProf, RadixTreeBuilderOne) {
627626
llvm::DenseMap<FrameId, llvm::memprof::LinearFrameId> MemProfFrameIndexes = {
628627
{11, 1}, {12, 2}, {13, 3}};
629-
llvm::SmallVector<llvm::memprof::FrameId> CS1 = {13, 12, 11};
628+
llvm::SmallVector<FrameId> CS1 = {13, 12, 11};
630629
llvm::MapVector<CallStackId, llvm::SmallVector<FrameId>> MemProfCallStackData;
631630
MemProfCallStackData.insert({hashCallStack(CS1), CS1});
632-
llvm::DenseMap<llvm::memprof::FrameId, llvm::memprof::FrameStat>
633-
FrameHistogram =
634-
llvm::memprof::computeFrameHistogram<FrameId>(MemProfCallStackData);
631+
llvm::DenseMap<FrameId, llvm::memprof::FrameStat> FrameHistogram =
632+
llvm::memprof::computeFrameHistogram<FrameId>(MemProfCallStackData);
635633
llvm::memprof::CallStackRadixTreeBuilder<FrameId> Builder;
636634
Builder.build(std::move(MemProfCallStackData), &MemProfFrameIndexes,
637635
FrameHistogram);
@@ -649,14 +647,13 @@ TEST(MemProf, RadixTreeBuilderOne) {
649647
TEST(MemProf, RadixTreeBuilderTwo) {
650648
llvm::DenseMap<FrameId, llvm::memprof::LinearFrameId> MemProfFrameIndexes = {
651649
{11, 1}, {12, 2}, {13, 3}};
652-
llvm::SmallVector<llvm::memprof::FrameId> CS1 = {12, 11};
653-
llvm::SmallVector<llvm::memprof::FrameId> CS2 = {13, 12, 11};
650+
llvm::SmallVector<FrameId> CS1 = {12, 11};
651+
llvm::SmallVector<FrameId> CS2 = {13, 12, 11};
654652
llvm::MapVector<CallStackId, llvm::SmallVector<FrameId>> MemProfCallStackData;
655653
MemProfCallStackData.insert({hashCallStack(CS1), CS1});
656654
MemProfCallStackData.insert({hashCallStack(CS2), CS2});
657-
llvm::DenseMap<llvm::memprof::FrameId, llvm::memprof::FrameStat>
658-
FrameHistogram =
659-
llvm::memprof::computeFrameHistogram<FrameId>(MemProfCallStackData);
655+
llvm::DenseMap<FrameId, llvm::memprof::FrameStat> FrameHistogram =
656+
llvm::memprof::computeFrameHistogram<FrameId>(MemProfCallStackData);
660657
llvm::memprof::CallStackRadixTreeBuilder<FrameId> Builder;
661658
Builder.build(std::move(MemProfCallStackData), &MemProfFrameIndexes,
662659
FrameHistogram);
@@ -679,18 +676,17 @@ TEST(MemProf, RadixTreeBuilderSuccessiveJumps) {
679676
llvm::DenseMap<FrameId, llvm::memprof::LinearFrameId> MemProfFrameIndexes = {
680677
{11, 1}, {12, 2}, {13, 3}, {14, 4}, {15, 5}, {16, 6}, {17, 7}, {18, 8},
681678
};
682-
llvm::SmallVector<llvm::memprof::FrameId> CS1 = {14, 13, 12, 11};
683-
llvm::SmallVector<llvm::memprof::FrameId> CS2 = {15, 13, 12, 11};
684-
llvm::SmallVector<llvm::memprof::FrameId> CS3 = {17, 16, 12, 11};
685-
llvm::SmallVector<llvm::memprof::FrameId> CS4 = {18, 16, 12, 11};
679+
llvm::SmallVector<FrameId> CS1 = {14, 13, 12, 11};
680+
llvm::SmallVector<FrameId> CS2 = {15, 13, 12, 11};
681+
llvm::SmallVector<FrameId> CS3 = {17, 16, 12, 11};
682+
llvm::SmallVector<FrameId> CS4 = {18, 16, 12, 11};
686683
llvm::MapVector<CallStackId, llvm::SmallVector<FrameId>> MemProfCallStackData;
687684
MemProfCallStackData.insert({hashCallStack(CS1), CS1});
688685
MemProfCallStackData.insert({hashCallStack(CS2), CS2});
689686
MemProfCallStackData.insert({hashCallStack(CS3), CS3});
690687
MemProfCallStackData.insert({hashCallStack(CS4), CS4});
691-
llvm::DenseMap<llvm::memprof::FrameId, llvm::memprof::FrameStat>
692-
FrameHistogram =
693-
llvm::memprof::computeFrameHistogram<FrameId>(MemProfCallStackData);
688+
llvm::DenseMap<FrameId, llvm::memprof::FrameStat> FrameHistogram =
689+
llvm::memprof::computeFrameHistogram<FrameId>(MemProfCallStackData);
694690
llvm::memprof::CallStackRadixTreeBuilder<FrameId> Builder;
695691
Builder.build(std::move(MemProfCallStackData), &MemProfFrameIndexes,
696692
FrameHistogram);
@@ -746,7 +742,7 @@ TEST(MemProf, YAMLParser) {
746742

747743
llvm::memprof::YAMLMemProfReader YAMLReader;
748744
YAMLReader.parse(YAMLData);
749-
llvm::memprof::IndexedMemProfData MemProfData = YAMLReader.takeMemProfData();
745+
IndexedMemProfData MemProfData = YAMLReader.takeMemProfData();
750746

751747
Frame F1(0x100, 11, 10, true);
752748
Frame F2(0x200, 22, 20, false);

0 commit comments

Comments
 (0)