Go to the documentation of this file.
33 class ExprLocalFunctionNode;
74 _type = ((firstType.
isFP(1) ? secondType : firstType).setLifetime(firstType, secondType));
96 typedef std::map<std::string, std::unique_ptr<ExprLocalVar>>
VarDictType;
98 typedef std::map<std::string, ExprLocalFunctionNode*>
FuncDictType;
133 void add(
const std::string& name, std::unique_ptr<ExprLocalVar> var);
154 std::unique_ptr<ExprVarEnv> newEnv(
new ExprVarEnv);
156 all.emplace_back(std::move(newEnv));
164 std::unique_ptr<ExprVarEnv> newEnv(
new ExprVarEnv);
165 newEnv->resetAndSetParent(parent);
166 all.emplace_back(std::move(newEnv));
167 return all.back().get();
172 std::vector<std::unique_ptr<ExprVarEnv>>
all;
The result is computed int int< br >< div style="margin-left: 40px;"> Picks values randomly between loRange and hiRange based on supplied index(which is automatically hashed).  
ExprLocalVar * find(const std::string &name)
Find a variable name by name (recursive to parents)
ExprLocalFunctionNode * findFunction(const std::string &name)
Find a function by name (recursive to parents)
std::vector< std::unique_ptr< ExprLocalVar > > shadowedVariables
Variables that have been superceded (and thus are inaccessible)
ExprVarEnv * createDescendant(ExprVarEnv *parent)
Create a descendant scope from the provided parent, does not clobber current.
ExprLocalVar(const ExprType &type)
ExprVarEnv & operator=(ExprVarEnv &other)
ExprEvalResult(int n, double *fp)
std::vector< std::unique_ptr< ExprVarEnv > > all
All owned symbol tables.
ExprLocalVar join (merge) references. Remembers which variables are possible assigners to this.
ExprLocalVar const * lookup(const std::string &name) const
Find a const variable reference name by name (recursive to parents)
LLVM_VALUE codegenMerges(LLVM_BUILDER builder, int mergeIndex) LLVM_BODY
ExprType type() const
returns type of the variable
virtual LLVM_VALUE codegen(LLVM_BUILDER, const std::string &name, LLVM_VALUE referenceType) LLVM_BODY
LLVM value that has been allocated.
Variable scope for tracking variable lookup.
void resetAndSetParent(ExprVarEnv *parent)
Resets the scope (deletes all variables) and sets parent.
std::vector< std::vector< std::pair< std::string, ExprLocalVarPhi * > > > _mergedVariables
Keep track of all merged variables in.
void reset()
Reset to factory state (one empty environment that is current)
int buildInterpreter(Interpreter *interpreter) const
Allocates variable for interpreter.
ExprEvalResult(const char **c)
ExprVarEnv * current()
Return the current variable scope.
virtual LLVM_VALUE varPtr()
LLVM value that has been pre-done.
Variable scope builder is used by the type checking and code gen to track visiblity of variables and ...
bool isFP() const
Direct is predicate checks.
ExprVarEnv * _parent
Parent variable environment has all variablesf rom previou scope (for lookup)
void addFunction(const std::string &name, ExprLocalFunctionNode *prototype)
Add a function.
ExprVarEnv * _currentEnv
The current symbol table (should be a pointer owned by all)
void add(const std::string &name, std::unique_ptr< ExprLocalVar > var)
Add a variable refernece.
std::map< std::string, std::unique_ptr< ExprLocalVar > > VarDictType
size_t mergeBranches(const ExprType &type, ExprVarEnv &env1, ExprVarEnv &env2)
Add all variables into scope by name, but modify their lifetimes to the given type's lifetime.
void setPhi(ExprLocalVar *phi)
sets the representative phi node (like a brute force set unioning operation) phi is the set represent...
ExprType & setLifetime(const ExprType &a)
Assign the lifetime from type a to be my type.
Node that contains local function.
ExprLocalVarPhi(ExprType condLife, ExprLocalVar *thenVar, ExprLocalVar *elseVar)
ExprVarEnvBuilder()
Creates an empty builder with one current scope entry.
ExprVarEnv()
Create a scope with no parent.
static bool valuesCompatible(const ExprType &a, const ExprType &b)
Checks if value types are compatible.
std::vector< std::pair< std::string, ExprLocalVarPhi * > > & merge(size_t index)
std::map< std::string, ExprLocalFunctionNode * > FuncDictType
void setCurrent(ExprVarEnv *env)
Set a new current variable scope.
ExprEvalResult(int n, double *fp, const char **c)
const ExprLocalVar * getPhi() const
get the primary representative phi node (i.e. the global parent of a dependent phi node)
ExprLocalVar reference, all local variables in seexpr are subclasses of this or this itself.
virtual void setPhi(ExprLocalVar *phi)
sets the representative phi node (like a brute force set unioning operation) phi is the set represent...