Practical way to call delphi "register" (i386) calling convention method with llvm

Is there a good way (preferably without changing llvm itself) to call a function in delphi’s “register” calling convention with llvm/i386 backend? Basically the first three are passed in EAX, EDX, and ECX, and the remaining parameters are pushed onto the stack in order of declaration (floats on the stack)?

clang uses that convention for something like the following:

__attribute((regparm(3))) void f(int,int,int,int);
void g() {f(1,2,3,4);}
1 Like