Skip to content

Commit 3f16861

Browse files
committed
Address comments
1 parent 112a1a4 commit 3f16861

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7554,7 +7554,8 @@ SmallVector<unsigned> ModuleSummaryIndexBitcodeReader::parseAllocInfoContext(
75547554
ArrayRef<uint64_t> Record, unsigned &I) {
75557555
SmallVector<unsigned> StackIdList;
75567556
// For backwards compatibility with old format before radix tree was
7557-
// used, simply see if we found a radix tree array record.
7557+
// used, simply see if we found a radix tree array record (and thus if
7558+
// the RadixArray is non-empty).
75587559
if (RadixArray.empty()) {
75597560
unsigned NumStackEntries = Record[I++];
75607561
assert(Record.size() - I >= NumStackEntries);

llvm/lib/Bitcode/Writer/BitcodeWriter.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4616,14 +4616,15 @@ void ModuleBitcodeWriterBase::writePerModuleGlobalValueSummary() {
46164616
auto *Summary = VI.getSummaryList()[0].get();
46174617
FunctionSummary *FS = cast<FunctionSummary>(Summary);
46184618
collectMemProfCallStacks(
4619-
FS, /*GetStackIndex*/ [&](unsigned I) { return I; }, CallStacks);
4619+
FS, /*GetStackIndex*/ [](unsigned I) { return I; }, CallStacks);
46204620
}
46214621
// Finalize the radix tree, write it out, and get the map of positions in the
46224622
// linearized tree array.
46234623
DenseMap<CallStackId, LinearCallStackId> CallStackPos;
4624-
if (!CallStacks.empty())
4624+
if (!CallStacks.empty()) {
46254625
CallStackPos =
46264626
writeMemoryProfileRadixTree(std::move(CallStacks), Stream, RadixAbbrev);
4627+
}
46274628

46284629
// Keep track of the current index into the CallStackPos map.
46294630
CallStackId CallStackCount = 0;
@@ -4862,9 +4863,10 @@ void IndexBitcodeWriter::writeCombinedGlobalValueSummary() {
48624863
// Finalize the radix tree, write it out, and get the map of positions in the
48634864
// linearized tree array.
48644865
DenseMap<CallStackId, LinearCallStackId> CallStackPos;
4865-
if (!CallStacks.empty())
4866+
if (!CallStacks.empty()) {
48664867
CallStackPos =
48674868
writeMemoryProfileRadixTree(std::move(CallStacks), Stream, RadixAbbrev);
4869+
}
48684870

48694871
// Keep track of the current index into the CallStackPos map.
48704872
CallStackId CallStackCount = 0;

0 commit comments

Comments
 (0)