<div dir="ltr">Ah, right, I'd only got the InstrProfWriter APIs when moving function_ref to the last arg - thanks for the catch!<br><br>Updated the InstrProfRecord APIs as suggested (& checked all mentions of function_ref seem to be the last arg now, I think.<br><br><div class="gmail_quote"><div dir="ltr">On Sun, Jul 9, 2017 at 7:06 PM David Li via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">davidxl added inline comments.<br>
<br>
<br>
================<br>
Comment at: include/llvm/ProfileData/InstrProf.h:585<br>
+ void merge(function_ref<void(instrprof_error)> Warn,<br>
+ InstrProfValueSiteRecord &Input, uint64_t Weight = 1);<br>
/// Scale up value profile data counts.<br>
----------------<br>
It is better to get rid of the default weight and move Warn to be the last here.<br>
<br>
<br>
================<br>
Comment at: include/llvm/ProfileData/InstrProf.h:660<br>
/// \p Weight.<br>
- void scale(uint64_t Weight);<br>
+ void scale(function_ref<void(instrprof_error)> Warn, uint64_t Weight);<br>
<br>
----------------<br>
can Warn be moved to the last for this one?<br>
<br>
<br>
================<br>
Comment at: include/llvm/ProfileData/InstrProf.h:729<br>
// Scale merged value counts by \p Weight.<br>
- void mergeValueProfData(uint32_t ValueKind, InstrProfRecord &Src,<br>
+ void mergeValueProfData(function_ref<void(instrprof_error)> Warn,<br>
+ uint32_t ValueKind, InstrProfRecord &Src,<br>
----------------<br>
Same here<br>
<br>
<br>
================<br>
Comment at: include/llvm/ProfileData/InstrProf.h:734<br>
// Scale up value profile data count.<br>
- void scaleValueProfData(uint32_t ValueKind, uint64_t Weight);<br>
+ void scaleValueProfData(function_ref<void(instrprof_error)> Warn,<br>
+ uint32_t ValueKind, uint64_t Weight);<br>
----------------<br>
Same here<br>
<br>
<br>
<a href="https://reviews.llvm.org/D35149" rel="noreferrer" target="_blank">https://reviews.llvm.org/D35149</a><br>
<br>
<br>
<br>
</blockquote></div></div>