This is an archive of the discontinued LLVM Phabricator instance.

[profiledata] Avoid creating a temporary vector in getNumValueData
ClosedPublic

Authored by alexander-shaposhnikov on Jul 3 2017, 5:34 PM.

Details

Summary

getValueSitesForKind returns ArrayRef which has a cast operator to std::vector,
as a result a temporary is created if the type of the variable is const std::vector & .

Test plan: make check-all

Diff Detail

Repository
rL LLVM

Event Timeline

dblaikie edited edge metadata.Jul 3 2017, 5:51 PM

Could you roll the expression into the range-for loop range expression? Naming the container doesn't seem to add much value.

Could you roll the expression into the range-for loop range expression? Naming the container doesn't seem to add much value.

dblaikie accepted this revision.Jul 3 2017, 6:07 PM

Looks good - thanks!

This revision is now accepted and ready to land.Jul 3 2017, 6:07 PM
This revision was automatically updated to reflect the committed changes.