Hands-On Debugging LLVM IR Passes
Before we start diving into machine intermediate representation (IR), which is the topic of the next chapter, we thought it was important to provide an overview of the tools the LLVM project offers so that you can debug your compiler.
In this chapter, you’ll learn how to do the following:
- Leverage the logging mechanisms that LLVM offers to debug your passes
- Reduce test cases using the tools provided by the LLVM infrastructure
- Enable the sanitizers to identify memory leaks, memory corruptions, or undefined behavior
- Interact with the LLVM code base through a debugger
You’ll be able to use this knowledge as a guideline when you’re tackling your first compiler issues. This knowledge should also boost your productivity as a lot of the tasks that you must perform to work with a compiler can be automated or sped up by leveraging the tools that will be presented in this chapter.