+/**
+Assigns sizes to arrays which don't have a size. Geometry shader inputs are
+sized by topology. Other arrays are sized by their use with literal indices.
+*/
+class ArraySizer: private TraversingVisitor
+{
+private:
+ std::map<VariableDeclaration *, int> max_indices;
+ unsigned input_size = 0;
+ VariableDeclaration *r_declaration;
+
+public:
+ void apply(Stage &);
+
+private:
+ virtual void visit(VariableReference &);
+ virtual void visit(MemberAccess &);
+ virtual void visit(Swizzle &);
+ virtual void visit(UnaryExpression&);
+ virtual void visit(BinaryExpression &);
+ virtual void visit(TernaryExpression &);
+ virtual void visit(FunctionCall &);
+ virtual void visit(InterfaceLayout &);
+ virtual void visit(VariableDeclaration &);
+};
+