Changed how scopes work

Also added logging and GenIR functions for VariableDeclaration
This commit is contained in:
Pasha Bibko
2025-04-27 21:48:16 +01:00
parent a64aa28432
commit 88ce75ceb1
8 changed files with 41 additions and 67 deletions

View File

@@ -70,5 +70,10 @@ namespace LX::AST
// Function for generating LLVN IR (Intermediate representation) //
llvm::Value* VariableDeclaration::GenIR(InfoLLVM& LLVM)
{
// Creates the variable within the scope //
LLVM.scope->CreateVar(m_Name);
// Creates the declaration within the IR //
return LLVM.builder.CreateAlloca(LLVM.builder.getInt32Ty(), nullptr, m_Name);
}
}