We’ve only touched the very basics of the LLVM IR. Please visit the LLVM Language Reference Manual at https://llvm.org/docs/LangRef.html to…
The SSA form was developed in the late 1980s. Since then, it has been widely used in compilers because it…
The provided target data layout must match what the backend expects. Its purpose is to communicate the captured information to…
Before generating the IR code, it’s good to know the main elements of the IR language. In Chapter 2, The…
Having created a decorated abstract syntax tree (AST) for your programming language, the next task is to generate the LLVM…
These rules are embedded into the semantic analyzer while creating the AST nodes for an expression. Likewise, the type and…
This must be done reliably because we do not want to add names to the wrong scope in case of…
Equipped with this knowledge, we can now implement all the parts. First, we must create the definition of the AST…
Naturally, the AST nodes are a part of a class hierarchy. A declaration always has a name. Other attributes depend…
Let’s have a look at the scope of names first. The scope of a name is the range where the…