X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fvisitor.cpp;h=bee312fd187d333fd94ef529d81d5fa489898f58;hb=9bec9da4ec633a541cf6048beed99629fefae2b9;hp=9bbd4914b1a0a289caa3c48a3504fa6c79e0c11d;hpb=518f751d385b733adbf43fe4056403740709edec;p=libs%2Fgl.git diff --git a/source/glsl/visitor.cpp b/source/glsl/visitor.cpp index 9bbd4914..bee312fd 100644 --- a/source/glsl/visitor.cpp +++ b/source/glsl/visitor.cpp @@ -7,12 +7,6 @@ namespace Msp { namespace GL { namespace SL { -void NodeVisitor::visit(Assignment &assign) -{ - visit(static_cast(assign)); -} - - void TraversingVisitor::visit(Block &block) { if(&block!=current_block) @@ -43,6 +37,11 @@ void TraversingVisitor::visit(BinaryExpression &binary) binary.right->visit(*this); } +void TraversingVisitor::visit(Assignment &assign) +{ + visit(static_cast(assign)); +} + void TraversingVisitor::visit(FunctionCall &call) { for(NodeArray::iterator i=call.arguments.begin(); i!=call.arguments.end(); ++i) @@ -103,9 +102,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) @@ -155,10 +154,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) @@ -189,7 +188,7 @@ void NodeRemover::visit(InterfaceBlock &iface) void NodeRemover::visit(FunctionDeclaration &func) { if(to_remove->count(&func)) - remove_from_map(stage->functions, func.name+func.signature, func); + remove_from_map(stage->functions, func.name, func); TraversingVisitor::visit(func); }