]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/generate.h
Refactor FunctionInliner to do any necessary declaration reordering
[libs/gl.git] / source / glsl / generate.h
index 977ed156f4490ab9e282b328d59c6c88074db3f2..48fc742342bdf042aa32bdbd5686e61e1e43bbe0 100644 (file)
@@ -141,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