X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fvisitor.cpp;h=c740d1188a15cf2f02614f19248ddd2a2c259e75;hb=f639d088c478fe5d266f9f5779928735b5176976;hp=3d832c73789b635e25978d23be803ff7ad164507;hpb=2989fc60f0fd98282962a0105bcba055193e2f8c;p=libs%2Fgl.git diff --git a/source/glsl/visitor.cpp b/source/glsl/visitor.cpp index 3d832c73..c740d118 100644 --- a/source/glsl/visitor.cpp +++ b/source/glsl/visitor.cpp @@ -39,7 +39,8 @@ void TraversingVisitor::visit(BinaryExpression &binary) void TraversingVisitor::visit(Assignment &assign) { - visit(static_cast(assign)); + assign.left->visit(*this); + assign.right->visit(*this); } void TraversingVisitor::visit(FunctionCall &call) @@ -102,9 +103,9 @@ void TraversingVisitor::visit(Iteration &iter) iter.init_statement->visit(*this); if(iter.condition) iter.condition->visit(*this); + iter.body.visit(*this); if(iter.loop_expression) iter.loop_expression->visit(*this); - iter.body.visit(*this); } void TraversingVisitor::visit(Passthrough &pass) @@ -154,10 +155,10 @@ void NodeRemover::visit(Block &block) } } -void NodeRemover::visit(StructDeclaration &strct) +void NodeRemover::visit(TypeDeclaration &type) { - if(to_remove->count(&strct)) - remove_from_map(stage->types, strct.name, strct); + if(to_remove->count(&type)) + remove_from_map(stage->types, type.name, type); } void NodeRemover::visit(VariableDeclaration &var) @@ -177,9 +178,9 @@ void NodeRemover::visit(InterfaceBlock &iface) { if(to_remove->count(&iface)) { - remove_from_map(stage->interface_blocks, iface.name, iface); + remove_from_map(stage->interface_blocks, iface.interface+iface.name, iface); if(!iface.instance_name.empty()) - remove_from_map(stage->interface_blocks, iface.instance_name, iface); + remove_from_map(stage->interface_blocks, "_"+iface.instance_name, iface); } SetFlag set_recursive(recursive_remove, recursive_remove || to_remove->count(&iface)); TraversingVisitor::visit(iface);