Skip to content

Commit

Permalink
tree_unwrapper.cc: Optimized policy search condition checks
Browse files Browse the repository at this point in the history
Co-authored-by: Mariusz Glebocki <[email protected]>
  • Loading branch information
jbylicki and mglb authored Jun 27, 2023
1 parent 8b72f45 commit e0115e0
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions verilog/formatting/tree_unwrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -863,14 +863,13 @@ void TreeUnwrapper::SetIndentationsAndCreatePartitions(
break;
}
case NodeEnum::kDataDeclaration: {
if ((GetParamListFromDataDeclaration(node) ||
!SearchSyntaxTree(node, NodekPortActualList()).empty()) &&
style_.always_wrap_module_instantiations) {
VisitIndentedSection(node, 0, PartitionPolicyEnum::kAlwaysExpand);
} else {
VisitIndentedSection(node, 0,
PartitionPolicyEnum::kFitOnLineElseExpand);
}
const auto policy =
(style_.always_wrap_module_instantiations &&
(GetParamListFromDataDeclaration(node) ||
!SearchSyntaxTree(node, NodekPortActualList()).empty()))
? PartitionPolicyEnum::kAlwaysExpand
: PartitionPolicyEnum::kFitOnLineElseExpand;
VisitIndentedSection(node, 0, policy);
break;
}

Expand Down

0 comments on commit e0115e0

Please sign in to comment.