Added 2 comments

This commit is contained in:
Pasha Bibko
2025-04-28 21:28:15 +01:00
parent ce8f1619a4
commit d0bb16f263

View File

@@ -92,9 +92,11 @@ namespace LX::AST
llvm::Value* VariableAccess::GenIR(InfoLLVM& LLVM)
{
// Loads the variable from the current scope //
llvm::AllocaInst* var = LLVM.scope->GetVar(m_Name);
ThrowIf<Scope::VariableDoesntExist>(var == nullptr);
// Creates the load within the AST //
return LLVM.builder.CreateLoad(llvm::Type::getInt32Ty(LLVM.context), var, m_Name + "_val");
}
}