xo-jit: compiler nit: (clang 15)
This commit is contained in:
parent
9439f0f221
commit
855887df71
7 changed files with 2607 additions and 0 deletions
47
src/jit/activation_record.new.cpp
Normal file
47
src/jit/activation_record.new.cpp
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/* @file activation_record.cpp */
|
||||
|
||||
#include "activation_record.hpp"
|
||||
#include "xo/indentlog/print/tag.hpp"
|
||||
#include <iostream>
|
||||
|
||||
namespace xo {
|
||||
namespace jit {
|
||||
using std::cerr;
|
||||
using std::endl;
|
||||
|
||||
int32_t
|
||||
activation_record::lookup_var(const std::string & x) const {
|
||||
|
||||
auto ix = name2ix_map_.find(x);
|
||||
|
||||
if (ix == name2ix_map_.end()) {
|
||||
cerr << "activation_record::lookup_var: no binding for variable x"
|
||||
<< xtag("x", x)
|
||||
<< endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ix->second;
|
||||
} /*lookup_var*/
|
||||
|
||||
#ifdef OBSOLETE
|
||||
llvm::AllocaInst *
|
||||
activation_record::alloc_var(const std::string & x,
|
||||
llvm::AllocaInst * alloca)
|
||||
{
|
||||
if (frame_.find(x) != frame_.end()) {
|
||||
cerr << "activation_record::alloc_var: variable x already present in frame"
|
||||
<< xtag("x", x)
|
||||
<< endl;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
frame_[x] = alloca;
|
||||
return alloca;
|
||||
} /*alloc_var*/
|
||||
#endif
|
||||
} /*namespace jit*/
|
||||
} /*namespace xo*/
|
||||
|
||||
|
||||
/* end activation_record.cpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue