Integrating a new target into the clang frontend
In the previous chapters, we developed the M88k target’s backend implementation within LLVM. To complete the compiler implementation for the M88k target, we will investigate connecting our new target to the frontend by adding a clang implementation for our M88k target.
Implementing the driver integration within clang
Let’s start by adding driver integration into clang for M88k:
- The first change we will be making is inside the
clang/include/clang/Basic/TargetInfo.h
file. TheBuiltinVaListKind
enum lists the different kinds of__builtin_va_list
types for each target, which is used for variadic functions support, so a corresponding type for M88k is added:enum BuiltinVaListKind { . . . // typedef struct __va_list_tag { // int __va_arg; // int *__va_stk; // ...