Summary
In this chapter, you learned how throwing and catching exceptions works in LLVM and about which IR code you need to generate to exploit this feature. To enhance the scope of IR, you learned how you can attach various metadata to instructions. Metadata for type-based aliases provides additional information to the LLVM optimizer and helps with certain optimizations to produce better machine code. Users always appreciate the possibility of using a source-level debugger, and through adding debug information to the IR code you are able to provide this important feature of a compiler.
Optimizing the IR code is a core task of LLVM. In the next chapter, we will learn how the pass manager works and how we can influence the optimization pipeline the pass manager governs.