]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/generate.h
Rename members of visitors to indicate which are "return values"
[libs/gl.git] / source / glsl / generate.h
index dc90b6eb5d36dc9b363ff0acbd01ba364c3f6a00..bcb70c04c6da49c0df7dc294d37d38139bbd8fda 100644 (file)
@@ -61,13 +61,12 @@ class VariableResolver: private TraversingVisitor
 {
 private:
        Stage *stage;
-       Block *builtins;
-       std::map<std::string, VariableDeclaration *> *members;
-       RefPtr<InterfaceBlockReference> iface_ref;
+       std::map<std::string, VariableDeclaration *> *r_members;
+       RefPtr<InterfaceBlockReference> r_iface_ref;
        std::string block_interface;
        bool record_target;
-       VariableDeclaration *assignment_target;
-       bool self_referencing;
+       VariableDeclaration *r_assignment_target;
+       bool r_self_referencing;
 
 public:
        VariableResolver();
@@ -75,8 +74,6 @@ public:
        void apply(Stage &);
 
 private:
-       Block *next_block(Block &);
-
        virtual void enter(Block &);
        virtual void visit(VariableReference &);
        virtual void visit(InterfaceBlockReference &);
@@ -93,7 +90,7 @@ class FunctionResolver: private TraversingVisitor
 {
 private:
        Stage *stage;
-       std::map<std::string, std::vector<FunctionDeclaration *> > functions;
+       std::map<std::string, std::vector<FunctionDeclaration *> > declarations;
 
 public:
        void apply(Stage &);
@@ -144,39 +141,6 @@ private:
        virtual void visit(Passthrough &);
 };
 
-/** Reorders declarations to ensure that declarations always appear before
-references. */
-class DeclarationReorderer: private TraversingVisitor
-{
-private:
-       enum DeclarationKind
-       {
-               NO_DECLARATION,
-               LAYOUT,
-               STRUCT,
-               VARIABLE,
-               FUNCTION
-       };
-
-       DeclarationKind kind;
-       std::set<Node *> ordered_funcs;
-       std::set<Node *> needed_funcs;
-
-public:
-       DeclarationReorderer();
-
-       void apply(Stage &s) { s.content.visit(*this); }
-
-private:
-       virtual void visit(Block &);
-       virtual void visit(FunctionCall &);
-       virtual void visit(InterfaceLayout &) { kind = LAYOUT; }
-       virtual void visit(StructDeclaration &) { kind = STRUCT; }
-       virtual void visit(VariableDeclaration &);
-       virtual void visit(InterfaceBlock &) { kind = VARIABLE; }
-       virtual void visit(FunctionDeclaration &);
-};
-
 } // namespace SL
 } // namespace GL
 } // namespace Msp