struct AggregateMember
{
const VariableDeclaration *declaration = 0;
+ unsigned index = 0;
RefPtr<Expression> initializer;
std::vector<RefPtr<Expression> *> references;
};
virtual void visit(StructDeclaration &) { }
virtual void visit(VariableDeclaration &);
virtual void visit(InterfaceBlock &) { }
+ virtual void visit(FunctionDeclaration &);
};
/** Replaces expressions consisting entirely of literals with the results of
virtual void visit(Iteration &);
};
+/** Removes code which is never executed due to flow control statements. */
class UnreachableCodeRemover: private TraversingVisitor
{
private:
struct VariableInfo
{
- InterfaceBlock *interface_block = 0;
std::vector<AssignmentInfo *> assignments;
bool initialized = false;
bool output = false;
Stage *stage = 0;
BlockVariableMap variables;
std::list<AssignmentInfo> assignments;
- InterfaceBlock *interface_block = 0;
Assignment *r_assignment = 0;
bool assignment_target = false;
bool r_side_effects = false;