Internals: More const. No functional change intended.

This commit is contained in:
Wilson Snyder
2021-11-26 17:55:36 -05:00
parent 010084201a
commit cd737065f2
110 changed files with 1917 additions and 1836 deletions
+5 -5
View File
@@ -180,7 +180,7 @@ private:
// See SubstVisitor
//
// STATE
int m_origStep; // Step number where subst was recorded
const int m_origStep; // Step number where subst was recorded
bool m_ok = true; // No misassignments found
// METHODS
@@ -274,7 +274,7 @@ private:
entryp->assignWhole(m_assignStep, nodep);
}
}
} else if (AstWordSel* wordp = VN_CAST(nodep->lhsp(), WordSel)) {
} else if (const AstWordSel* const wordp = VN_CAST(nodep->lhsp(), WordSel)) {
if (AstVarRef* const varrefp = VN_CAST(wordp->lhsp(), VarRef)) {
if (VN_IS(wordp->rhsp(), Const) && isSubstVar(varrefp->varp())) {
const int word = VN_AS(wordp->rhsp(), Const)->toUInt();
@@ -315,7 +315,7 @@ private:
SubstVarEntry* const entryp = getEntryp(varrefp);
if (AstNode* const substp = entryp->substWord(nodep, word)) {
// Check that the RHS hasn't changed value since we recorded it.
SubstUseVisitor visitor{substp, entryp->getWordStep(word)};
const SubstUseVisitor visitor{substp, entryp->getWordStep(word)};
if (visitor.ok()) {
VL_DO_DANGLING(replaceSubstEtc(nodep, substp), nodep);
} else {
@@ -340,9 +340,9 @@ private:
if (nodep->access().isWriteOrRW()) {
UINFO(8, " ASSIGNcpx " << nodep << endl);
entryp->assignComplex();
} else if (AstNode* substp = entryp->substWhole(nodep)) {
} else if (AstNode* const substp = entryp->substWhole(nodep)) {
// Check that the RHS hasn't changed value since we recorded it.
SubstUseVisitor visitor{substp, entryp->getWholeStep()};
const SubstUseVisitor visitor{substp, entryp->getWholeStep()};
if (visitor.ok()) {
UINFO(8, " USEwhole " << nodep << endl);
VL_DO_DANGLING(replaceSubstEtc(nodep, substp), nodep);