1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
llvm-mirror/lib/Passes
Arthur Eubanks 31acdea7b2 [opt][NewPM] Add a --print-passes flag to print all available passes
It seems nicer to list passes given a flag rather than displaying all
passes in opt --help.

This is awkwardly structured because a PassBuilder is required, but
reusing the PassBuilder in runPassPipeline() doesn't work because we
read the input IR before getting to runPassPipeline(). So printing the
list of passes needs to happen before reading the input IR. If we remove
the legacy PM code in main() and move everything from NewPMDriver.cpp
into opt.cpp, we can create the PassBuilder before reading IR and check
if we should print the list of passes and exit. But until then this hack
seems fine.

Compared to the legacy PM, the new PM passes are lacking descriptions.
We'll need to figure out a way to add descriptions if we think this is
important.

Also, this only works for passes specified in PassRegistry.def. If we
want to print other custom registered passes, we'll need a different
mechanism.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D96101
2021-02-10 11:22:12 -08:00
..
CMakeLists.txt [NewPM][HelloWorld] Move HelloWorld to Utils 2021-02-03 12:59:40 -08:00
PassBuilder.cpp [opt][NewPM] Add a --print-passes flag to print all available passes 2021-02-10 11:22:12 -08:00
PassPlugin.cpp
PassRegistry.def [CSSPGO] Introducing distribution factor for pseudo probe. 2021-02-02 11:55:01 -08:00
StandardInstrumentations.cpp Introduce -print-changed=[diff | diff-quiet] which show changes in patch-like format 2021-02-08 10:11:22 -05:00