mirror of
https://github.com/ziglang/zig.git
synced 2025-12-27 16:43:07 +00:00
The previous implementation of calling conventions was hacky and broken. This commit reworks lowerFnParamTy into iterateParamTypes which returns enum tags indicating how to handle each parameter. This is then used in the three places that matter: * lowering a function type to llvm type * converting function parameters to the canonical type representation (with respect to isByRef). * converting canonical type representation to function arguments at callsites (again with respect to isByRef). As a result, we are one step closer to the C ABI tests passing. Before this commit, attempting to build them crashed the compiler. I isolated the broken function and verified that it now is lowered correctly. I will keep working on this one piece at a time until all the C ABI tests pass, and then I will enable all of them in the CI.