Page MenuHomePhabricator

Add hasProfileData() to check if a function has profile data. NFC.
ClosedPublic

Authored by eraman on Dec 20 2017, 12:43 PM.

Details

Summary

This replaces calls to getEntryCount().hasValue() with hasProfileData
that does the same thing. This refactoring is useful to do before adding
synthetic function entry counts but also a useful cleanup IMO even
otherwise. I have used hasProfileData instead of hasRealProfileData as
David had earlier suggested since I think profile implies "real" and I
use the phrase "synthetic entry count" and not "synthetic profile count"
but I am fine calling it hasRealProfileData if you prefer.

Diff Detail

Repository
rL LLVM

Event Timeline

eraman created this revision.Dec 20 2017, 12:43 PM
vsk accepted this revision.Dec 20 2017, 1:05 PM
vsk added a subscriber: vsk.

Looks like a nice cleanup to me.

This revision is now accepted and ready to land.Dec 20 2017, 1:05 PM

I prefer hasProfileData to be hasRealProfileData -- unless we want to make hasProfileData to mean has real profile data and ignores synthetic entry count later.

davidxl accepted this revision.Dec 21 2017, 9:55 AM

LGTM

Perhaps change the new interface documentation slightly to reflect that it is for real profile data.

LGTM

Perhaps change the new interface documentation slightly to reflect that it is for real profile data.

Expanded the comments to indicate that this returns true if entry counts from a profile run are present. Once I add synthetic counts, I can make it clear that we are looking for real counts.

Will submit with this comment change.

This revision was automatically updated to reflect the committed changes.