From e44bdc6a2a0cf624b08046ecc7e5c5d5d9d2d66c Mon Sep 17 00:00:00 2001 From: _ov4 Date: Fri, 16 Oct 2026 13:21:05 +0000 Subject: fix(compiler): correct CIE semantics and diagnostic locations Use standard WHILE headers and default-public class fields, resolve pseudocode identifiers without case sensitivity, and check signed i64 literal boundaries before conversion. Preserve source locations across recursive emission and function diagnostics. Add 22 regression cases and update compiler examples and documentation. Validated all 69 CTest entries with the original Linux Actions seed and verified the release package's embedded, native and IR output paths. --- include/cps/FunctionGen.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'include/cps/FunctionGen.h') diff --git a/include/cps/FunctionGen.h b/include/cps/FunctionGen.h index 80c91ea..4bf4519 100644 --- a/include/cps/FunctionGen.h +++ b/include/cps/FunctionGen.h @@ -1,4 +1,5 @@ #pragma once +#include "cps/Identifier.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/Module.h" #include "cps/FunctionAST.h" @@ -34,6 +35,7 @@ struct ParamSig { // dispatch on declared parameter types and modes instead of inferring them // back from LLVM types. struct FuncSig { + std::string Name; std::string ReturnTypeName; std::vector Params; }; @@ -55,10 +57,12 @@ private: TypeSystem &Types; ExceptionHandler &Exceptions; - std::map &Symbols; + IdentifierMap &Symbols; bool &HadError; + int &DiagnosticLine; + void reportError(const char *Fmt, ...); - std::map Signatures; + IdentifierMap Signatures; ArrayParamBinder BindArrayParam; void createArgumentAllocas(llvm::Function *F, const std::vector &Params); @@ -69,9 +73,9 @@ public: llvm::IRBuilder<> &B, TypeSystem &TS, ExceptionHandler &EH, - std::map &Sym, - bool &HadErrorFlag) - : Context(C), Module(M), Builder(B), Types(TS), Exceptions(EH), Symbols(Sym), HadError(HadErrorFlag) {} + IdentifierMap &Sym, + bool &HadErrorFlag, int &Line) + : Context(C), Module(M), Builder(B), Types(TS), Exceptions(EH), Symbols(Sym), HadError(HadErrorFlag), DiagnosticLine(Line) {} llvm::Type *getLLVMType(const std::string &TypeName); -- cgit v1.3.1-4-g156e