Fix break under foreach loop (#3230).

Internals: Move Foreach handling into V3Width.
This commit is contained in:
Wilson Snyder
2021-12-11 15:06:33 -05:00
parent 00ef0519f5
commit 984ee624ed
14 changed files with 315 additions and 80 deletions
+16
View File
@@ -107,6 +107,22 @@ private:
// Done the loop
m_insStmtp = nullptr; // Next thing should be new statement
}
virtual void visit(AstForeach* nodep) override {
// Special, as statements need to be put in different places
// Body insert just before themselves
m_insStmtp = nullptr; // First thing should be new statement
iterateChildren(nodep);
// Done the loop
m_insStmtp = nullptr; // Next thing should be new statement
}
virtual void visit(AstJumpBlock* nodep) override {
// Special, as statements need to be put in different places
// Body insert just before themselves
m_insStmtp = nullptr; // First thing should be new statement
iterateChildren(nodep);
// Done the loop
m_insStmtp = nullptr; // Next thing should be new statement
}
virtual void visit(AstNodeIf* nodep) override {
m_insStmtp = nodep;
iterateAndNextNull(nodep->condp());