aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/ExpressionGen.cc
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-22 13:51:44 +0000
committer_ov4 <ov4@ov4.org>2026-10-22 13:51:44 +0000
commit5eccd90b47b327917ad0e5858c79ca8fab27cd74 (patch)
tree56e5c4110560679047e8813ab221742a0ab739f6 /lib/CodeGen/ExpressionGen.cc
parente3cc6c585a15fe4478dd2312bf5d390896729a31 (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 'lib/CodeGen/ExpressionGen.cc')
-rw-r--r--lib/CodeGen/ExpressionGen.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/ExpressionGen.cc b/lib/CodeGen/ExpressionGen.cc
index ece055a..d7a4ba7 100644
--- a/lib/CodeGen/ExpressionGen.cc
+++ b/lib/CodeGen/ExpressionGen.cc
@@ -231,9 +231,10 @@ Value *CodeGen::emitCall(const std::string &Callee,
}
std::vector<Value*> Args;
+ std::vector<const TypeInfo *> Variadic;
const FuncSig *Sig = resolveCall(Name, ArgExprs, Explicit);
- if (!Sig || !marshalCallArgs(*Sig, ArgExprs, Line, Args)) return nullptr;
- return FuncGen->emitCall(*Sig, Args);
+ if (!Sig || !marshalCallArgs(*Sig, ArgExprs, Line, Args, &Variadic)) return nullptr;
+ return FuncGen->emitCall(*Sig, Args, Variadic);
}
Value *CodeGen::emitAllocationSize(ExprAST *Expr) {