aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CallGen.cc
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-22 13:56:44 +0000
committer_ov4 <ov4@ov4.org>2026-10-22 13:56:44 +0000
commit312a19c781da1c31ff1e3dc71c319663a8be9148 (patch)
tree80d63213c0d11b1fcf3d67ef6e51289fe4b5096e /lib/CodeGen/CallGen.cc
parent5eccd90b47b327917ad0e5858c79ca8fab27cd74 (diff)
feat(codegen): accept pointer types to any C type in EXTERN
A pseudocode pointer type now counts as a C type, in EXTERN signatures and as a C-struct field, when it finally points to a non-void C type or a C struct, as in TYPE PInt = ^C_INT. A pointer cycle such as TYPE P = ^P and a pointer to a pseudocode type stay rejected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'lib/CodeGen/CallGen.cc')
-rw-r--r--lib/CodeGen/CallGen.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/CodeGen/CallGen.cc b/lib/CodeGen/CallGen.cc
index a5567b7..576520d 100644
--- a/lib/CodeGen/CallGen.cc
+++ b/lib/CodeGen/CallGen.cc
@@ -134,8 +134,7 @@ bool CodeGen::marshalCallArgs(const FuncSig &Signature,
Value *CodeGen::emitVariadicArgument(ExprAST *Expr, const std::string &Callee, size_t Position,
const TypeInfo *&Promoted) {
const TypeInfo *Info = isWholeArrayVar(Expr) ? nullptr : getExprTypeInfo(Expr);
- const TypeInfo *Record = Info && Info->Kind == TypeKind::Pointer
- ? Types->resolve(Info->Pointer.PointeeTypeName) : Info;
+ const TypeInfo *Record = Types->pointerBase(Info);
std::string Why;
if (Record && Record->isRecord() && !Record->IsClass && !Types->isCStruct(Record, &Why)) {
reportError("Variadic argument %zu to %s uses record %s, which is not a C struct: %s",