This is an archive of the discontinued LLVM Phabricator instance.

[MemProf] Add helper to access the back (last) call stack id
ClosedPublic

Authored by tejohnson on Feb 2 2023, 7:03 AM.

Details

Summary

This is split out of D140908 as suggested.

Diff Detail

Event Timeline

tejohnson created this revision.Feb 2 2023, 7:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2023, 7:03 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
tejohnson requested review of this revision.Feb 2 2023, 7:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2023, 7:03 AM
snehasish accepted this revision.Feb 2 2023, 8:52 AM

lgtm

llvm/include/llvm/Analysis/MemoryProfileInfo.h
141

nit: I prefer the prior version with an early check since it's easier to read than a nested ternary.

if (!N) {
 Iter = nullptr;
 return;
}

Iter = End ? N->StackIdIndices.end() : N->StackIdIndices.begin();

Also writing it out made it clear that the change in this diff is ensuring that Iter is initialized to nullptr.

This revision is now accepted and ready to land.Feb 2 2023, 8:52 AM
tejohnson updated this revision to Diff 494640.Feb 3 2023, 7:50 AM

Address comments

This revision was landed with ongoing or failed builds.Feb 3 2023, 7:51 AM
This revision was automatically updated to reflect the committed changes.