Make sure we also print passes with params when using "opt -print-passes".
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
could you add to the existing -print-passes test one loop pass and one function pass?
formatting
I'm worried that these will get out of sync with the actual implementation, but maybe that doesn't matter so much
another worry is that I believe some of these parsers accept multiple options, but that's not really mentioned in the semicolon separated list, WDYT?
Yes. I'm a bit worried as well. I considered to leave out the actual params in the printout, but wanted to make them visible.
One idea I had was to reference a static string (or a function returning the string) in PassBuilder.cpp instead of listing the params in the PassRegistry. That string/function could be placed next to the parser function, and maybe then it would be more easy to see that the string should be updated when changing the parser function.
Maybe the ideal solution would be to make the parameter parsing a bit more generic, and base it on options listed in the PassRegistery definition. But that is also a bit more work.
As you say, maybe it doesn't matter that much if it goes out of sync. Someone will eventually notice and fix it. At least if someone will base some kind of fuzzy testing on parsing of the "-print-passes" output.
another worry is that I believe some of these parsers accept multiple options, but that's not really mentioned in the semicolon separated list, WDYT?
I do not have any good ideas on how to document the rules for that in the output.
I used semicolon as separator as that is how params are separated when using multiple options. But I do not think that it is obvious that all those are more or less optional. Neither does it say which options that are default, etc. I just wanted to somehow list all options (including the ones with "no-" prefix) to give the user some hints on what the parser accepts. The details are still in the code implementing the parsers, unfortunately.
clang-format not found in user’s local PATH; not linting file.