From 39e50838bd12057d9305575f50c63990984df01a Mon Sep 17 00:00:00 2001 From: _ov4 Date: Sat, 17 Oct 2026 09:15:18 +0000 Subject: feat(codegen): GLOBAL variables as LLVM globals Co-Authored-By: Claude Opus 5.5 --- include/cps/CodeGen.h | 1 + include/cps/TypeSystem.h | 1 + 2 files changed, 2 insertions(+) (limited to 'include') diff --git a/include/cps/CodeGen.h b/include/cps/CodeGen.h index 6e0fab1..d624ca6 100644 --- a/include/cps/CodeGen.h +++ b/include/cps/CodeGen.h @@ -41,6 +41,7 @@ class CodeGen { bool isVisible(size_t Owner) const; void selectUnit(size_t Unit); void importSymbols(); + void runGlobalPrePass(const SourceUnit &Unit, int Phase); IdentifierMap Symbols; IdentifierMap> ClassMethods; std::string CurrentClass; diff --git a/include/cps/TypeSystem.h b/include/cps/TypeSystem.h index d699067..1391345 100644 --- a/include/cps/TypeSystem.h +++ b/include/cps/TypeSystem.h @@ -112,6 +112,7 @@ struct SymbolInfo { llvm::Constant *ConstantValue = nullptr; // Non-null for CONSTANT; no storage. unsigned ScopeID = 0; bool IsReference = false; // Storage is a slot containing the current object address. + bool IsGlobal = false; }; class TypeSystem { -- cgit v1.3.1-4-g156e