thegameg added a comment.

In D135488#4049050 <https://reviews.llvm.org/D135488#4049050>, @nickdesaulniers 
wrote:

> In D135488#4049035 <https://reviews.llvm.org/D135488#4049035>, @paulkirth 
> wrote:
>
>> Actually if we add
>>
>>   if (!isFunctionInPrintList(MF.getName()))
>>        return false;
>>
>> we can filter by name

I would rather have a more generic mechanism for remarks or diagnostics in 
general. Even if it uses `isFunctionInPrintList`, I'd rather have a real flag 
that doesn't require `-mllvm`.

> Does name mangling complicate that? Perhaps a C++ user would give an 
> unmangled name, but MF would be looking at mangled names?

Agreed. A regex would help a little there.

> Anyways, it's not a pressing issue. I won't block this patch on that. I just 
> redirect all the output to a file then scan that.

You can easily process the yaml output from `-fsave-optimization-record` with 
the `optrecord` module:

  import optrecord
  import re
  
  all_remarks, file_remarks, _ = 
optrecord.gather_results(optrecord.find_opt_files(<INPUT_FILE>), 1, False)
  for r in optrecord.itervalues(all_remarks):
    if re.match(<REGEX>, r.Function):
      print(r)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135488/new/

https://reviews.llvm.org/D135488

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to