I'm looking to refactor Clang's ABI logic and I'm interested in
feedback about the approach.
The current situation seems to be that much of the ABI logic is inside
lib/CodeGen/TargetInfo.cpp and there is a class for each of the
targets ('WebAssemblyABIInfo', 'X86_32ABIInfo', 'X86_64ABIInfo',
etc.). I'm looking to move each of the classes out into their own
header/source files in a new lib/CodeGen/Target directory:
To give you an idea of this, I've created a small patch that moves
SwiftABIInfo into this new directory. I'm looking to apply these
changes incrementally (i.e. for each change move one or two classes
out), since this minimises conflicts with any work taking place on the
To give some background, I have an LLVM frontend that needs to
generate C ABI compliant LLVM IR. I created a library that is a
fork of Clang's ABI logic, but now I'm looking to modify the library
to use Clang's logic directly, as recommended in a previous
discussion. In general my goal is to simplify the ABI logic in both
LLVM and Clang and this seems like a good starting point.
What do you think?