Chapter 5: Basics of IR Code Generation
Having created a decorated Abstract Syntax Tree (AST) for your programming language, the next task is to generate the LLVM IR code from it. LLVM IR code resembles three-address code, with a human-readable representation. Therefore, we need a systematic approach to translate language concepts such as control structures into the lower level of LLVM IR.
In this chapter, you will learn about the basics of LLVM IR, and how to generate IR for control flow structures from the AST. You will also learn how to generate LLVM IR for expressions in Static Single Assignment (SSA) form, using a modern algorithm. Finally, you will learn how to emit assembler text and object code.
This chapter will cover the following ...
Get Learn LLVM 12 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.