You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
523 B
C++
23 lines
523 B
C++
#ifndef FORSPLL_VAR_HPP
|
|
#define FORSPLL_VAR_HPP
|
|
|
|
#include <llvm/IR/Type.h>
|
|
#include <llvm/IR/DerivedTypes.h>
|
|
|
|
struct Var {
|
|
llvm::Value *value;
|
|
bool callable;
|
|
|
|
Var(llvm::Value *v = nullptr, bool c = false):
|
|
value(v), callable(c) {}
|
|
|
|
static Var lookup(const std::string& name, int skip = 0);
|
|
static void pushScope();
|
|
static void popScope();
|
|
static Var& addGlobal(const std::string& name, Var var);
|
|
static Var& addLocal(const std::string& name, Var var);
|
|
};
|
|
|
|
#endif // FORSPLL_VAR_HPP
|
|
|