A class is a collection of data and methods. A class can inherit from another class, potentially adding more data…
To set multiple attributes, you can use the llvm::AttrBuilder class. The other way to provide additional information is to use…
With the addition of arrays and records to the code generator, you can note that sometimes, the generated code does…
The getelementptr instruction is the workhorse for address calculations. As such, it needs some more explanation. The first operand, [8…
In LLVM, the IR code is run through a pipeline of passes. Each pass performs a single task, such as…
Now, only the target machine is missing. With the target machine, we define the CPU architecture we’d like to generate…
Functions (and also global variables) have a linkage style attached. With the linkage style, we define the visibility of a…
In general, you translate expressions, as shown in Chapter 2, The Structure of a Compiler. The only interesting part is…
How can we optimize a phi instruction and why should we do it? Although the SSA form is advantageous for…
If the current basic block we are looking at has only one predecessor, then we search there for the value…