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 --- lib/CodeGen/FunctionGen.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/CodeGen/FunctionGen.cc') diff --git a/lib/CodeGen/FunctionGen.cc b/lib/CodeGen/FunctionGen.cc index cc88a78..220a97a 100644 --- a/lib/CodeGen/FunctionGen.cc +++ b/lib/CodeGen/FunctionGen.cc @@ -220,7 +220,7 @@ Function *FunctionGen::emitFunctionDef(FunctionDefAST *FuncAST, IdentifierMap OldSymbols = Symbols; Symbols.clear(); for (const auto &[Name, Info] : OldSymbols) { - if (Info.ConstantValue && Info.ScopeID == 0) Symbols.emplace(Name, Info); + if (Info.IsGlobal || (Info.ConstantValue && Info.ScopeID == 0)) Symbols.emplace(Name, Info); } bool IsMethod = !Proto->getOwnerClass().empty(); -- cgit v1.3.1-4-g156e