From b6ef02ead6125b73344ec3fbe240dec0ae8d5218 Mon Sep 17 00:00:00 2001 From: Matthew Ballance Date: Wed, 23 Oct 2024 16:39:43 +0000 Subject: [PATCH] Avoid duplicate constraint generation Signed-off-by: Matthew Ballance --- src/TaskBuildTypeConstraints.cpp | 13 +++++++++++-- src/TaskBuildTypeFunctions.cpp | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/TaskBuildTypeConstraints.cpp b/src/TaskBuildTypeConstraints.cpp index 1515a7d..4232af3 100644 --- a/src/TaskBuildTypeConstraints.cpp +++ b/src/TaskBuildTypeConstraints.cpp @@ -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::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) { diff --git a/src/TaskBuildTypeFunctions.cpp b/src/TaskBuildTypeFunctions.cpp index 54836c0..ba15539 100644 --- a/src/TaskBuildTypeFunctions.cpp +++ b/src/TaskBuildTypeFunctions.cpp @@ -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()); @@ -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) {