Skip to content

Commit

Permalink
Added missing declaration of directive-getter in utils.
Browse files Browse the repository at this point in the history
  • Loading branch information
azreika committed Nov 16, 2020
1 parent 8259a59 commit ed86b2f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ast/utility/Utils.cpp
Expand Up @@ -82,10 +82,10 @@ std::vector<Clause*> getClauses(const Program& program, const Relation& rel) {
return getClauses(program, rel.getQualifiedName());
}

std::vector<Directive*> getDirectives(const Program& program, const QualifiedName& relationName) {
std::vector<Directive*> getDirectives(const Program& program, const QualifiedName& name) {
std::vector<Directive*> directives;
for (Directive* dir : program.getDirectives()) {
if (dir->getQualifiedName() == relationName) {
if (dir->getQualifiedName() == name) {
directives.push_back(dir);
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/ast/utility/Utils.h
Expand Up @@ -29,6 +29,7 @@ namespace souffle::ast {
class Atom;
class Clause;
class Constraint;
class Directive;
class FunctorDeclaration;
class IntrinsicFunctor;
class Literal;
Expand Down Expand Up @@ -116,6 +117,15 @@ std::vector<Clause*> getClauses(const Program& program, const Relation& rel);
*/
Relation* getRelation(const Program& program, const QualifiedName& name);

/**
* Returns the set of directives associated with a given relation in a program.
*
* @param program the program
* @param name the name of the relation to search for
* @return a vector of all associated directives
*/
std::vector<Directive*> getDirectives(const Program& program, const QualifiedName& relationName);

/**
* Remove relation and all its clauses from the program.
*
Expand Down

0 comments on commit ed86b2f

Please sign in to comment.