Quiz time
Now that you have completed reading this chapter, try answering the following questions to test your knowledge:
- You want to enable the debug log for a specific pass using
debug-only
and your compiler refuses, producingUnknown command line argument '-debug-only=MyPass'
as an error message. How would you fix that?
The debug-only
option is only available when you build LLVM with assertions enabled.
To fix that, rebuild LLVM while enabling assertions.
See the Printing the debug log section for more details.
- How can you find the string to pass to the
debug-only
option for a specific pass?
The string to use with the debug-only
option can be found in the DEBUG_TYPE
macro. This is instantiated in the file that implements the pass you’re interested in.
See the Printing the debug log section for more details.
- Given some input IR, what tool could you use to create a standalone function from a basic block...