Enabling MC-based tools
In this section, you will learn how to connect the assembly syntax and encoding information that you described in the previous sections so that you can use some of the MC-based tools. This section focuses specifically on the llvm-mc
command-line tool, which is the LLVM-provided way for developers to test the MC layer of their backend.
For this chapter, we will not enable all the capabilities of the MC layer that you saw in Figure 12.2, instead we focus on enabling three MC components that, put together, enable an assembler-like type of experience, meaning that you will be able to test your assembly code syntax and generate encodings from it. Looking back to Figure 12.2, we will specifically enable the arrows representing the printing, the parsing, and (some of) the assembling. The reason we need all three components is because we want to enable the testing from .s
to .o
files (that is, the parsing to assembling), but when using the llvm-mc
tool, the printing...