xo-jit: use Environment for toplevel lambdas

This commit is contained in:
Roland Conybeare 2024-06-30 20:03:55 -04:00
commit 1f0c0cb71d
4 changed files with 16 additions and 286 deletions

View file

@ -9,22 +9,21 @@ namespace xo {
using std::cerr;
using std::endl;
int32_t
llvm::AllocaInst *
activation_record::lookup_var(const std::string & x) const {
auto ix = name2ix_map_.find(x);
auto ix = frame_.find(x);
if (ix == name2ix_map_.end()) {
if (ix == frame_.end()) {
cerr << "activation_record::lookup_var: no binding for variable x"
<< xtag("x", x)
<< endl;
return -1;
return nullptr;
}
return ix->second;
} /*lookup_var*/
#ifdef OBSOLETE
llvm::AllocaInst *
activation_record::alloc_var(const std::string & x,
llvm::AllocaInst * alloca)
@ -39,7 +38,6 @@ namespace xo {
frame_[x] = alloca;
return alloca;
} /*alloc_var*/
#endif
} /*namespace jit*/
} /*namespace xo*/