LLVM IR API – cheat sheet
Now that you know the LLVM IR representation, we can use it to anchor the various APIs that you saw in this and previous chapters.
The result is the cheat sheet presented in Figure 7.3:

Figure 7.3: LLVM IR API cheat sheet
In Figure 7.3, we represented the scopes of the various classes, with their names framed in the top-right correct of the related scope. This cheat sheet shows four scopes, from innermost scope to outermost: Instruction
, BasicBlock
, Function
, and Module
. Within a scope, we showed a few methods, in italics, that you can call when you have a hold of the related instance, meaning you can call the methods in the BasicBlock scope if you hold a pointer on such an instance. The black arrows show what the results of the methods point to.
This cheat sheet is obviously not exhaustive, but we believe it should give you a better grasp of how LLVM IR is structured and how it maps to the related APIs.
From this point forward...