Overview of stack lowering
In Chapter 15, you learned that stack locations are represented in LLVM with the concept of a frame index. As a reminder, a frame index is an identifier for a stack slot. You can think of a stack slot as a chunk of memory that is reserved somewhere in your stack. The purpose of this chunk of memory is to hold some values, for instance, an array local to your function, or a value that was spilled by the register allocator.
Let us start by digging into what this stack slot represents and the type of application programming interface (API) you can use to handle it.
Handling of stack slots
Depending on what the stack slot contains, its actual location in your stack may be prescribed by your ABI. In other words, values that are tied to the ABI must appear at an exact location in your stack, for instance, where you lay out the incoming arguments of your next function call. Conversely, values that are not tied to the ABI can be placed more freely in...