diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-14 03:29:04 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-14 03:29:04 +0000 |
| commit | 699e18b65b07af73ccd14b28f83572b1843c7d37 (patch) | |
| tree | 98b98269e02eb9052b2af698383a858d63b120a7 /lib/CodeGen/FunctionGen.cc | |
| parent | 3ef7f8b778dce23af25965b379126b9dd95d1c27 (diff) | |
feat(types): add native C scalar types and imported aliases
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'lib/CodeGen/FunctionGen.cc')
| -rw-r--r-- | lib/CodeGen/FunctionGen.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/FunctionGen.cc b/lib/CodeGen/FunctionGen.cc index afa6074..480d9ba 100644 --- a/lib/CodeGen/FunctionGen.cc +++ b/lib/CodeGen/FunctionGen.cc @@ -117,6 +117,12 @@ Function *FunctionGen::emitPrototype(PrototypeAST *Proto) { std::vector<Type*> ArgTypes; for (const ParamDecl &P : Proto->getParams()) { + const TypeInfo *Info = Types.resolve(P.TypeName); + if (Info && Info->isVoid()) { + fprintf(stderr, "error: parameter %s cannot have void type\n", P.Name.c_str()); + HadError = true; + return nullptr; + } ParamSig PS; PS.TypeName = P.TypeName; PS.IsByRef = P.Mode == PassMode::ByRef; |
