unused_nodes.erase(var.declaration);
map<VariableDeclaration *, Node *>::iterator i = assignments.find(var.declaration);
if(i!=assignments.end())
+ {
unused_nodes.erase(i->second);
+ assignments.erase(i);
+ }
}
}
TraversingVisitor::visit(expr);
if(assignment && assignment_target)
{
+ Node *&assign = assignments[assignment_target];
+ if(assign)
+ unused_nodes.insert(assign);
+ assign = &expr;
if(assignment_target->interface!="out" || (stage->type!=FRAGMENT && !assignment_target->linked_declaration))
- {
unused_nodes.insert(&expr);
- assignments[assignment_target] = &expr;
- }
else
unused_nodes.erase(assignment_target);
}