diff options
Diffstat (limited to 'var.hpp')
-rw-r--r-- | var.hpp | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -21,14 +21,21 @@ #include <llvm/IR/Type.h> #include <llvm/IR/DerivedTypes.h> +#include <list> +#include <map> +#include <string> + struct Var { llvm::Value *value; - bool callable; + bool native; + + Var(llvm::Value *v = nullptr, bool n = false): + value(v), native(n) {} - Var(llvm::Value *v = nullptr, bool c = false): - value(v), callable(c) {} + static std::list<std::map<std::string, Var>> vars; static Var lookup(const std::string& name, int skip = 0); + static Var lookupLocal(const std::string& name); static void pushScope(); static void popScope(); static Var& addGlobal(const std::string& name, Var var); |