]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/syntax.h
Store types and interface blocks in Stage
[libs/gl.git] / source / glsl / syntax.h
index f7e778b89ef65d417afd1f44751930311c5e94ed..49699f2ed3811880e5ecbfb0495549379ff41784 100644 (file)
@@ -108,9 +108,7 @@ struct Block: Node
 {
        NodeList<Statement> body;
        bool use_braces;
-       std::map<std::string, StructDeclaration *> types;
        std::map<std::string, VariableDeclaration *> variables;
-       std::map<std::string, InterfaceBlock *> interfaces;
        Block *parent;
 
        Block();
@@ -305,6 +303,7 @@ struct VariableDeclaration: Statement
 
        VariableDeclaration();
        VariableDeclaration(const VariableDeclaration &);
+       ~VariableDeclaration();
 
        virtual VariableDeclaration *clone() const { return new VariableDeclaration(*this); }
        virtual void visit(NodeVisitor &);
@@ -321,6 +320,7 @@ struct InterfaceBlock: Statement
 
        InterfaceBlock();
        InterfaceBlock(const InterfaceBlock &);
+       ~InterfaceBlock();
 
        virtual InterfaceBlock *clone() const { return new InterfaceBlock(*this); }
        virtual void visit(NodeVisitor &);
@@ -399,6 +399,8 @@ struct Stage
        Type type;
        Stage *previous;
        Block content;
+       std::map<std::string, StructDeclaration *> types;
+       std::map<std::string, InterfaceBlock *> interface_blocks;
        std::map<std::string, unsigned> locations;
        Features required_features;