diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-22 13:51:44 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-22 13:51:44 +0000 |
| commit | 5eccd90b47b327917ad0e5858c79ca8fab27cd74 (patch) | |
| tree | 56e5c4110560679047e8813ab221742a0ab739f6 /include/cps/FunctionGen.h | |
| parent | e3cc6c585a15fe4478dd2312bf5d390896729a31 (diff) | |
feat(codegen): pass C-struct records by value as variadic arguments
A variadic EXTERN call is now arranged by clang per call, from the fixed
parameter count and the promoted argument types. C-struct records pass
unchanged in variadic positions, as C11 6.5.2.2p6-7 and 7.16.1.1p2
allow; a record that is not a C struct names the offending field.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'include/cps/FunctionGen.h')
| -rw-r--r-- | include/cps/FunctionGen.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/cps/FunctionGen.h b/include/cps/FunctionGen.h index 8b63d67..6c5c7c0 100644 --- a/include/cps/FunctionGen.h +++ b/include/cps/FunctionGen.h @@ -122,7 +122,9 @@ public: llvm::Function *emitFunctionDef(FunctionDefAST *FuncAST, const std::function<void(StmtAST*)> &StmtEmitter, unsigned ScopeID); - llvm::Value *emitCall(const FuncSig &Sig, const std::vector<llvm::Value*> &Args); + // Variadic holds the promoted types of an EXTERN call's variadic arguments. + llvm::Value *emitCall(const FuncSig &Sig, const std::vector<llvm::Value*> &Args, + const std::vector<const TypeInfo *> &Variadic = {}); void emitReturn(llvm::Value *RetVal); }; |
