mirror of
https://github.com/PashaBibko/LX.git
synced 2026-04-04 01:49:05 +00:00
Changed how scopes work
Also added logging and GenIR functions for VariableDeclaration
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user