Skip to content

Commit

Permalink
Internals: Fix misnamed member. No functional change.
Browse files Browse the repository at this point in the history
  • Loading branch information
wsnyder committed Sep 16, 2023
1 parent 19f7279 commit 05d04a3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/V3Randomize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class RandomizeVisitor final : public VNVisitor {
const VNUser2InUse m_inuser2;

// STATE
VMemberMap memberMap; // Member names cached for fast lookup
VMemberMap m_memberMap; // Member names cached for fast lookup
AstNodeModule* m_modp = nullptr; // Current module
const AstNodeFTask* m_ftaskp = nullptr; // Current function/task
size_t m_enumValueTabCount = 0; // Number of tables with enum values created
Expand Down Expand Up @@ -215,7 +215,7 @@ class RandomizeVisitor final : public VNVisitor {
}
}
void addPrePostCall(AstClass* classp, AstFunc* funcp, const string& name) {
if (AstTask* userFuncp = VN_CAST(memberMap.findMember(classp, name), Task)) {
if (AstTask* userFuncp = VN_CAST(m_memberMap.findMember(classp, name), Task)) {
AstTaskRef* const callp
= new AstTaskRef{userFuncp->fileline(), userFuncp->name(), nullptr};
callp->taskp(userFuncp);
Expand Down
4 changes: 2 additions & 2 deletions src/V3Timing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class TimingSuspendableVisitor final : public VNVisitor {
const VNUser5InUse m_user5InUse;

// STATE
VMemberMap memberMap; // Member names cached for fast lookup
VMemberMap m_memberMap; // Member names cached for fast lookup
AstClass* m_classp = nullptr; // Current class
AstNode* m_procp = nullptr; // NodeProcedure/CFunc/Begin we're under
uint8_t m_underFork = F_NONE; // F_NONE or flags of a fork we are under
Expand Down Expand Up @@ -265,7 +265,7 @@ class TimingSuspendableVisitor final : public VNVisitor {
// the root of the inheritance hierarchy and check if the original method is
// virtual or not.
if (auto* const overriddenp
= VN_CAST(memberMap.findMember(cextp->classp(), nodep->name()), CFunc)) {
= VN_CAST(m_memberMap.findMember(cextp->classp(), nodep->name()), CFunc)) {
// Suspendability and process affects typing, so they propagate both ways
DepVtx* const overriddenSVxp = getSuspendDepVtx(overriddenp);
DepVtx* const overriddenPVxp = getNeedsProcDepVtx(overriddenp);
Expand Down
26 changes: 14 additions & 12 deletions src/V3Width.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class WidthVisitor final : public VNVisitor {
using DTypeMap = std::map<const std::string, AstPatMember*>;

// STATE
VMemberMap memberMap; // Member names cached for fast lookup
VMemberMap m_memberMap; // Member names cached for fast lookup
WidthVP* m_vup = nullptr; // Current node state
const AstCell* m_cellp = nullptr; // Current cell for arrayed instantiations
const AstEnumItem* m_enumItemp = nullptr; // Current enum item
Expand Down Expand Up @@ -2640,7 +2640,8 @@ class WidthVisitor final : public VNVisitor {
AstPackage* const packagep = getItemPackage(nodep);
if (packagep && packagep->name() == "std") {
// Change type of m_process to VlProcessRef
if (AstVar* const varp = VN_CAST(memberMap.findMember(nodep, "m_process"), Var)) {
if (AstVar* const varp
= VN_CAST(m_memberMap.findMember(nodep, "m_process"), Var)) {
AstNodeDType* const dtypep = varp->getChildDTypep();
if (!varp->dtypep()) {
VL_DO_DANGLING(pushDeletep(dtypep->unlinkFrBack()), dtypep);
Expand All @@ -2652,7 +2653,7 @@ class WidthVisitor final : public VNVisitor {
}
// Mark that self requires process instance
if (AstNodeFTask* const ftaskp
= VN_CAST(memberMap.findMember(nodep, "self"), NodeFTask)) {
= VN_CAST(m_memberMap.findMember(nodep, "self"), NodeFTask)) {
ftaskp->setNeedProcess();
}
}
Expand Down Expand Up @@ -2761,7 +2762,7 @@ class WidthVisitor final : public VNVisitor {
AstClass* const first_classp = adtypep->classp();
UASSERT_OBJ(first_classp, nodep, "Unlinked");
for (AstClass* classp = first_classp; classp;) {
if (AstNode* const foundp = memberMap.findMember(classp, nodep->name())) {
if (AstNode* const foundp = m_memberMap.findMember(classp, nodep->name())) {
if (AstVar* const varp = VN_CAST(foundp, Var)) {
if (!varp->didWidth()) userIterate(varp, nullptr);
if (varp->lifetime().isStatic()) {
Expand Down Expand Up @@ -2837,7 +2838,7 @@ class WidthVisitor final : public VNVisitor {
bool memberSelStruct(AstMemberSel* nodep, AstNodeUOrStructDType* adtypep) {
// Returns true if ok
if (AstMemberDType* const memberp
= VN_CAST(memberMap.findMember(adtypep, nodep->name()), MemberDType)) {
= VN_CAST(m_memberMap.findMember(adtypep, nodep->name()), MemberDType)) {
if (m_attrp) { // Looking for the base of the attribute
nodep->dtypep(memberp);
UINFO(9, " MEMBERSEL(attr) -> " << nodep << endl);
Expand Down Expand Up @@ -3500,10 +3501,10 @@ class WidthVisitor final : public VNVisitor {
AstClass* const first_classp = adtypep->classp();
if (nodep->name() == "randomize") {
V3Randomize::newRandomizeFunc(first_classp);
memberMap.clear();
m_memberMap.clear();
} else if (nodep->name() == "srandom") {
V3Randomize::newSRandomFunc(first_classp);
memberMap.clear();
m_memberMap.clear();
}
UASSERT_OBJ(first_classp, nodep, "Unlinked");
for (AstClass* classp = first_classp; classp;) {
Expand All @@ -3526,7 +3527,7 @@ class WidthVisitor final : public VNVisitor {
}
}
if (AstNodeFTask* const ftaskp
= VN_CAST(memberMap.findMember(classp, nodep->name()), NodeFTask)) {
= VN_CAST(m_memberMap.findMember(classp, nodep->name()), NodeFTask)) {
userIterate(ftaskp, nullptr);
if (ftaskp->lifetime().isStatic()) {
AstNodeExpr* argsp = nullptr;
Expand Down Expand Up @@ -3795,7 +3796,8 @@ class WidthVisitor final : public VNVisitor {

classp = refp->classp();
UASSERT_OBJ(classp, nodep, "Unlinked");
if (AstNodeFTask* const ftaskp = VN_CAST(memberMap.findMember(classp, "new"), Func)) {
if (AstNodeFTask* const ftaskp
= VN_CAST(m_memberMap.findMember(classp, "new"), Func)) {
nodep->taskp(ftaskp);
nodep->classOrPackagep(classp);
} else {
Expand Down Expand Up @@ -3963,7 +3965,7 @@ class WidthVisitor final : public VNVisitor {
// '{member:value} or '{data_type: default_value}
if (const AstText* textp = VN_CAST(patp->keyp(), Text)) {
// member: value
memp = VN_CAST(memberMap.findMember(vdtypep, textp->text()),
memp = VN_CAST(m_memberMap.findMember(vdtypep, textp->text()),
MemberDType);
if (!memp) {
patp->keyp()->v3error("Assignment pattern key '"
Expand Down Expand Up @@ -5609,10 +5611,10 @@ class WidthVisitor final : public VNVisitor {
UASSERT_OBJ(classp, nodep, "Should have failed in V3LinkDot");
if (nodep->name() == "randomize") {
nodep->taskp(V3Randomize::newRandomizeFunc(classp));
memberMap.clear();
m_memberMap.clear();
} else if (nodep->name() == "srandom") {
nodep->taskp(V3Randomize::newSRandomFunc(classp));
memberMap.clear();
m_memberMap.clear();
} else if (nodep->name() == "get_randstate") {
methodOkArguments(nodep, 0, 0);
classp->baseMostClassp()->needRNG(true);
Expand Down

0 comments on commit 05d04a3

Please sign in to comment.