Skip to content

Commit

Permalink
Avoid duplicate constraint generation
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
  • Loading branch information
mballance committed Oct 23, 2024
1 parent 6db2f9d commit b6ef02e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/TaskBuildTypeConstraints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,18 @@ TaskBuildTypeConstraints::~TaskBuildTypeConstraints() {
}

void TaskBuildTypeConstraints::build(ast::ISymbolTypeScope *ast_type) {
DEBUG_ENTER("build (%d children)", ast_type->getChildren().size());
m_subtype_c.clear();
m_depth = 0;
ast_type->accept(m_this);
m_depth = 1;
for (std::vector<ast::IScopeChildUP>::const_iterator
it=ast_type->getChildren().begin();
it!=ast_type->getChildren().end(); it++) {
DEBUG_ENTER("accept %d", (it-ast_type->getChildren().begin()));
(*it)->accept(m_this);
DEBUG_LEAVE("accept %d", (it-ast_type->getChildren().begin()));
}
// ast_type->accept(m_this);
DEBUG_LEAVE("build");
}

void TaskBuildTypeConstraints::visitAction(ast::IAction *i) {
Expand Down
2 changes: 2 additions & 0 deletions src/TaskBuildTypeFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ void TaskBuildTypeFunctions::visitSymbolFunctionScope(ast::ISymbolFunctionScope
}

void TaskBuildTypeFunctions::visitConstraintBlock(ast::IConstraintBlock *i) {
#ifdef UNDEFINED
DEBUG_ENTER("visitConstraintBlock %s (%d)",
i->getName().c_str(), i->getConstraints().size());

Expand All @@ -102,6 +103,7 @@ void TaskBuildTypeFunctions::visitConstraintBlock(ast::IConstraintBlock *i) {
m_arl_type->addConstraint(cb, true);

DEBUG_LEAVE("visitConstraintBlock %s", i->getName().c_str());
#endif // UNDEFINED
}

void TaskBuildTypeFunctions::visitConstraintScope(ast::IConstraintScope *i) {
Expand Down

0 comments on commit b6ef02e

Please sign in to comment.