[PATCH] D147710: Add an option to print out annotation remark count.
Zain Jaffal via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 6 13:58:57 PDT 2023
zjaffal added a comment.
Thanks all for your comments I will update the patch accordingly
================
Comment at: llvm/tools/llvm-remarkutil/RemarkUtil.cpp:305
+ assert(CountArg != Remark.Args.end() &&
+ "Expected instruction count remarks to have a NumInstructions key?");
+ OF->os() << Remark.FunctionName << "," << CountArg->Val << "\n";
----------------
thegameg wrote:
> paquette wrote:
> > paquette wrote:
> > > I think the message on this assert is incorrect
> > And yeah these probably shouldn't be asserts. IIUC this should only happen if you provide a file without annotation remarks. In which case, either print nothing, or provide an error which says "file did not contain any annotation remarks" or something.
> I think the latter is not a bad idea to keep as an assert or some sort of hard error: it's technically a malformed annotation remark to not have a `count` field (is that true, @zjaffal?). But yes, the message is wrong
All annotation remarks should have a count so I think this assert should still be there.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D147710/new/
https://reviews.llvm.org/D147710
More information about the llvm-commits
mailing list