Internals: Remove V3LinkParse's need of class links. No functional change intended.

This commit is contained in:
Wilson Snyder
2024-09-20 18:26:23 -04:00
parent 92dd8ee8f5
commit 80cba789f4
6 changed files with 47 additions and 12 deletions
+4 -12
View File
@@ -45,7 +45,6 @@ class LinkParseVisitor final : public VNVisitor {
using ImplTypedefMap = std::map<const std::pair<void*, std::string>, AstTypedef*>;
// STATE
AstPackage* const m_stdPackagep; // SystemVerilog std package
AstVar* m_varp = nullptr; // Variable we're under
ImplTypedefMap m_implTypedef; // Created typedefs for each <container,name>
std::unordered_set<FileLine*> m_filelines; // Filelines that have been seen
@@ -192,9 +191,7 @@ class LinkParseVisitor final : public VNVisitor {
if (!nodep->lifetime().isNone()) {
m_lifetime = nodep->lifetime();
} else {
const AstClassOrPackageRef* const classPkgRefp
= VN_AS(nodep->classOrPackagep(), ClassOrPackageRef);
if (classPkgRefp && VN_IS(classPkgRefp->classOrPackageNodep(), Class)) {
if (nodep->classMethod()) {
// Class methods are automatic by default
m_lifetime = VLifetime::AUTOMATIC;
} else if (nodep->dpiImport() || VN_IS(nodep, Property)) {
@@ -841,10 +838,8 @@ class LinkParseVisitor final : public VNVisitor {
VL_DO_DANGLING(nodep->unlinkFrBack()->deleteTree(), nodep);
}
}
void visit(AstClassOrPackageRef* nodep) override {
if (nodep->name() == "std" && !nodep->classOrPackagep()) {
nodep->classOrPackagep(m_stdPackagep);
}
void visit(AstClassOrPackageRef* nodep) override { //
iterateChildren(nodep);
}
void visit(AstClocking* nodep) override {
cleanFileline(nodep);
@@ -917,10 +912,7 @@ class LinkParseVisitor final : public VNVisitor {
public:
// CONSTRUCTORS
explicit LinkParseVisitor(AstNetlist* rootp)
: m_stdPackagep{rootp->stdPackagep()} {
iterate(rootp);
}
explicit LinkParseVisitor(AstNetlist* rootp) { iterate(rootp); }
~LinkParseVisitor() override {
V3Stats::addStatSum(V3Stats::STAT_SOURCE_MODULES, m_statModules);
}