[llvm] [nfc][llvm-profdata]Refactor llvm-profdata showInstrProfile (PR #71328)

David Li via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 10:18:06 PST 2023


david-xl wrote:

> The patch is currently adding new C++ structs to reduce the number of arguments.
> 
> Another option is to move option definitions (
> 
> https://github.com/llvm/llvm-project/blob/45ca24edc0b9f2541efb0ae3c668ee7af82e22f4/llvm/tools/llvm-profdata/llvm-profdata.cpp#L2954-L3042
> 
> ) from function scope to a namespace (like `namespace show_prof{`), so the option definitions are visible to `showInstrProfile` and `showSampleProfile` (no need to pass long list of parameters) . The downside is that, not all options apply to both functions.
> Thoughts about these two options?

Moving show options to show_prof namespace looks reasonable to me. Need to make sure  the --help option for the 'show' command  works properly though.

https://github.com/llvm/llvm-project/pull/71328


More information about the llvm-commits mailing list