]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/visitor.h
Use accurate assignment targets in ExpressionInliner
[libs/gl.git] / source / glsl / visitor.h
index 6fe1868ca8221a4619fc30cb889524b68f7b9f9e..30ab25444f2aabe89636309b29d8a9dc56ed519d 100644 (file)
@@ -23,6 +23,7 @@ public:
        virtual void visit(VariableReference &) { }
        virtual void visit(InterfaceBlockReference &) { }
        virtual void visit(MemberAccess &) { }
+       virtual void visit(Swizzle &) { }
        virtual void visit(UnaryExpression &) { }
        virtual void visit(BinaryExpression &) { }
        virtual void visit(Assignment &) { }
@@ -58,6 +59,7 @@ public:
        virtual void visit(Block &);
        virtual void visit(ParenthesizedExpression &);
        virtual void visit(MemberAccess &);
+       virtual void visit(Swizzle &);
        virtual void visit(UnaryExpression &);
        virtual void visit(BinaryExpression &);
        virtual void visit(Assignment &);
@@ -74,20 +76,6 @@ public:
        virtual void visit(Return &);
 };
 
-/** Gathers nodes of a particular type from the syntax tree. */
-template<typename T>
-class NodeGatherer: private TraversingVisitor
-{
-private:
-       std::vector<T *> nodes;
-
-public:
-       const std::vector<T *> &apply(Stage &s) { s.content.visit(*this); return nodes; }
-
-private:
-       virtual void visit(T &n) { nodes.push_back(&n); }
-};
-
 /** Removes a set of nodes from the syntax tree. */
 class NodeRemover: private TraversingVisitor
 {