Skip to content

Commit

Permalink
Visit top instances, ignore other root members
Browse files Browse the repository at this point in the history
  • Loading branch information
povik committed Aug 23, 2024
1 parent 5aaa6e7 commit 6182f32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ struct InferredMemoryDetector :
return;
visitor.visitDefault(symbol);
});
root.visit(first_pass);
visitDefault(root);
for (auto top : root.topInstances) {
top->visit(first_pass);
visitDefault(*top);
}
}

struct LHSVisitor : public ast::ASTVisitor<LHSVisitor, true, true> {
Expand Down
3 changes: 2 additions & 1 deletion src/slang_frontend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2450,7 +2450,8 @@ struct SlangFrontend : Frontend {
compilation->forceElaborate(body);
visitor.visitDefault(body);
});
compilation->getRoot().visit(elab);
for (auto instance : compilation->getRoot().topInstances)
instance->visit(elab);

if (compilation->hasIssuedErrors()) {
if (!driver.reportCompilation(*compilation, /* quiet */ false))
Expand Down

0 comments on commit 6182f32

Please sign in to comment.