]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/visitor.h
Rearrange secondary operations in GLSL compiler
[libs/gl.git] / source / glsl / visitor.h
index 756584c2e262289783a6f58ec75cbfc2c6ec5a46..8bfcac0fd490b85bb2db1c32dfca371a4e786363 100644 (file)
@@ -89,7 +89,7 @@ private:
        std::vector<T *> nodes;
 
 public:
-       const std::vector<T *> &apply(Stage &s) { visit(s.content); return nodes; }
+       const std::vector<T *> &apply(Stage &s) { nodes.clear(); visit(s.content); return nodes; }
 
 private:
        using TraversingVisitor::visit;
@@ -100,12 +100,12 @@ class NodeRemover: private TraversingVisitor
 {
 private:
        Stage *stage;
-       std::set<Node *> to_remove;
+       const std::set<Node *> *to_remove;
 
 public:
-       NodeRemover(const std::set<Node *> &);
+       NodeRemover();
 
-       void apply(Stage &);
+       void apply(Stage &, const std::set<Node *> &);
 
 private:
        using TraversingVisitor::visit;