[PATCH] D147710: Add an option to print out annotation remark count.

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 09:43:16 PDT 2023


thegameg added inline comments.


================
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";
----------------
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


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