diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-17 09:15:18 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-17 09:15:18 +0000 |
| commit | 39e50838bd12057d9305575f50c63990984df01a (patch) | |
| tree | 6ff2b45ed79aff00582c62942c2a283d92329b4f /lib/CodeGen/FunctionGen.cc | |
| parent | e1f41ed9fafaf7eb4f2da6878a3fabcf2f7c021e (diff) | |
feat(codegen): GLOBAL variables as LLVM globals
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'lib/CodeGen/FunctionGen.cc')
| -rw-r--r-- | lib/CodeGen/FunctionGen.cc | 2 |
1 files changed, 1 insertions, 1 deletions
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<SymbolInfo> 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(); |
