diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-16 13:21:05 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-16 13:21:05 +0000 |
| commit | e44bdc6a2a0cf624b08046ecc7e5c5d5d9d2d66c (patch) | |
| tree | f5276cc0dd2f34e4d30a58f80223912265a1c5a0 /lib/CodeGen/Designator.cc | |
| parent | e1e789ac0249149a4aa1671f5f9260d488cb617a (diff) | |
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.
Diffstat (limited to 'lib/CodeGen/Designator.cc')
| -rw-r--r-- | lib/CodeGen/Designator.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/Designator.cc b/lib/CodeGen/Designator.cc index afaf0a4..fcc6919 100644 --- a/lib/CodeGen/Designator.cc +++ b/lib/CodeGen/Designator.cc @@ -15,6 +15,7 @@ void CodeGen::runTypePrePass(const std::vector<std::unique_ptr<StmtAST>> &Statem std::string Err; for (const auto &S : Statements) { + SaveAndRestore<int> Location(DiagnosticLine, S->getLine()); bool Ok = true; if (auto *C = dynamic_cast<CTypeDeclAST*>(S.get())) Ok = Types->defineCAlias(C->getName(), C->getExpression(), Err); @@ -28,6 +29,7 @@ void CodeGen::runTypePrePass(const std::vector<std::unique_ptr<StmtAST>> &Statem } for (const auto &S : Statements) { + SaveAndRestore<int> Location(DiagnosticLine, S->getLine()); bool Ok = true; if (auto *E = dynamic_cast<EnumTypeDeclAST*>(S.get())) { Ok = Types->defineEnum(E->getName(), E->getValueNames(), Err); @@ -44,6 +46,7 @@ void CodeGen::runTypePrePass(const std::vector<std::unique_ptr<StmtAST>> &Statem // of its storage plus the type name stored there. Array indexing goes through // ArrayHandler's checked pipeline; dereferences emit the null-pointer check. bool CodeGen::emitLValue(ExprAST *E, LValueInfo &Out) { + SaveAndRestore<int> Location(DiagnosticLine, E && E->getLine() ? E->getLine() : DiagnosticLine); if (auto *Var = dynamic_cast<VariableExprAST*>(E)) { const SymbolInfo *Info = getSymbolInfo(Var->getName()); if (!Info) { |
