mirror of
https://github.com/PashaBibko/LX.git
synced 2026-04-04 09:59:03 +00:00
Variables can now be read from
This commit is contained in:
@@ -92,6 +92,9 @@ namespace LX::AST
|
||||
|
||||
llvm::Value* VariableAccess::GenIR(InfoLLVM& LLVM)
|
||||
{
|
||||
return nullptr;
|
||||
llvm::AllocaInst* var = LLVM.scope->GetVar(m_Name);
|
||||
ThrowIf<Scope::VariableDoesntExist>(var == nullptr);
|
||||
|
||||
return LLVM.builder.CreateLoad(llvm::Type::getInt32Ty(LLVM.context), var, m_Name + "_val");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user