mirror of
https://github.com/PashaBibko/LX.git
synced 2026-04-03 17:39:02 +00:00
Added 2 comments
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user