Skip to content

Commit

Permalink
[FSMToSV] Erase typescope if empty (#4093)
Browse files Browse the repository at this point in the history
  • Loading branch information
mortbopet authored Oct 13, 2022
1 parent a50c98d commit 9ec9654
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Conversion/FSMToSV/FSMToSV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,10 @@ void FSMToSVPass::runOnOperation() {
instance.replaceAllUsesWith(hwInstance);
instance.erase();
}

// If the typescope is empty (no FSMs were converted), erase it.
if (typeScope.getBodyBlock()->empty())
typeScope.erase();
}

} // end anonymous namespace
Expand Down

0 comments on commit 9ec9654

Please sign in to comment.