Internals: Add more const. No functional change intended.

This commit is contained in:
Wilson Snyder
2021-11-13 13:50:44 -05:00
parent 4cb5c1e1db
commit 37e3c6da70
85 changed files with 1172 additions and 1115 deletions
+12 -12
View File
@@ -54,11 +54,11 @@ private:
// VISITORS
virtual void visit(AstVarRef* nodep) override {
AstVarScope* vscp = nodep->varScopep();
const AstVarScope* const vscp = nodep->varScopep();
UASSERT_OBJ(vscp, nodep, "Scope not assigned");
if (AstVarScope* newvscp = reinterpret_cast<AstVarScope*>(vscp->user4p())) {
if (AstVarScope* const newvscp = reinterpret_cast<AstVarScope*>(vscp->user4p())) {
UINFO(9, " Replace " << nodep << " to " << newvscp << endl);
AstVarRef* newrefp = new AstVarRef(nodep->fileline(), newvscp, nodep->access());
AstVarRef* const newrefp = new AstVarRef(nodep->fileline(), newvscp, nodep->access());
nodep->replaceWith(newrefp);
VL_DO_DANGLING(nodep->deleteTree(), nodep);
}
@@ -186,11 +186,11 @@ private:
}
void squashAssignposts() {
for (auto& itr : m_assignposts) {
LifePostLocation* app = &itr.second;
AstVarRef* lhsp = VN_AS(app->nodep->lhsp(), VarRef); // original var
AstVarRef* rhsp = VN_AS(app->nodep->rhsp(), VarRef); // dly var
AstVarScope* dlyVarp = rhsp->varScopep();
AstVarScope* origVarp = lhsp->varScopep();
LifePostLocation* const app = &itr.second;
AstVarRef* const lhsp = VN_AS(app->nodep->lhsp(), VarRef); // original var
AstVarRef* const rhsp = VN_AS(app->nodep->rhsp(), VarRef); // dly var
AstVarScope* const dlyVarp = rhsp->varScopep();
AstVarScope* const origVarp = lhsp->varScopep();
// Scrunch these:
// X1: __Vdly__q = __PVT__clk_clocks;
@@ -275,7 +275,7 @@ private:
}
virtual void visit(AstVarRef* nodep) override {
// Consumption/generation of a variable,
AstVarScope* vscp = nodep->varScopep();
AstVarScope* const vscp = nodep->varScopep();
UASSERT_OBJ(vscp, nodep, "Scope not assigned");
LifeLocation loc(m_execMTaskp, ++m_sequence);
@@ -292,9 +292,9 @@ private:
virtual void visit(AstAssignPost* nodep) override {
// Don't record ASSIGNPOST in the read/write maps, record them in a
// separate map
if (AstVarRef* rhsp = VN_CAST(nodep->rhsp(), VarRef)) {
if (AstVarRef* const rhsp = VN_CAST(nodep->rhsp(), VarRef)) {
// rhsp is the dly var
AstVarScope* dlyVarp = rhsp->varScopep();
AstVarScope* const dlyVarp = rhsp->varScopep();
UASSERT_OBJ(m_assignposts.find(dlyVarp) == m_assignposts.end(), nodep,
"LifePostLocation attempted duplicate dlyvar map addition");
LifeLocation loc(m_execMTaskp, ++m_sequence);
@@ -318,7 +318,7 @@ private:
m_mtasksGraphp = nodep->depGraphp();
for (V3GraphVertex* mtaskVxp = m_mtasksGraphp->verticesBeginp(); mtaskVxp;
mtaskVxp = mtaskVxp->verticesNextp()) {
ExecMTask* mtaskp = dynamic_cast<ExecMTask*>(mtaskVxp);
ExecMTask* const mtaskp = dynamic_cast<ExecMTask*>(mtaskVxp);
m_execMTaskp = mtaskp;
m_sequence = 0;
iterate(mtaskp->bodyp());