void DependencyCollector::visit(FunctionCall &call)
{
if(call.declaration)
+ {
dependencies.insert(call.declaration);
+ call.declaration->visit(*this);
+ }
TraversingVisitor::visit(call);
}
TraversingVisitor::visit(var);
}
+void DependencyCollector::visit(FunctionDeclaration &func)
+{
+ if(!visited_functions.count(&func))
+ {
+ visited_functions.insert(&func);
+ TraversingVisitor::visit(func);
+ }
+}
+
} // namespace SL
} // namespace GL
} // namespace Msp
private:
std::set<Node *> dependencies;
std::set<Node *> locals;
+ std::set<FunctionDeclaration *> visited_functions;
public:
std::set<Node *> apply(FunctionDeclaration &);
virtual void visit(InterfaceBlockReference &);
virtual void visit(FunctionCall &);
virtual void visit(VariableDeclaration &);
+ virtual void visit(FunctionDeclaration &);
};
} // namespace SL