xo-jit: progress towards explicit stack frames [wip, incomplete]

This commit is contained in:
Roland Conybeare 2024-06-26 14:38:48 -04:00
commit 71df4f824d
4 changed files with 118 additions and 8 deletions

View file

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