C++11: Use nullptr. No functional change.

This commit is contained in:
Wilson Snyder
2020-08-16 11:44:05 -04:00
parent 7c54a451a9
commit c0127599df
175 changed files with 2072 additions and 2036 deletions
+19 -18
View File
@@ -189,9 +189,9 @@ private:
// See top of this file for transformation
// Return the new LHS for the assignment, Null = unlink
// Find selects
AstNode* newlhsp = NULL; // NULL = unlink old assign
AstSel* bitselp = NULL;
AstArraySel* arrayselp = NULL;
AstNode* newlhsp = nullptr; // nullptr = unlink old assign
AstSel* bitselp = nullptr;
AstArraySel* arrayselp = nullptr;
if (VN_IS(lhsp, Sel)) {
bitselp = VN_CAST(lhsp, Sel);
arrayselp = VN_CAST(bitselp->fromp(), ArraySel);
@@ -226,7 +226,7 @@ private:
string bitvarname = (string("__Vdlyvdim") + cvtToStr(dimension) + "__"
+ oldvarp->shortName() + "__v" + cvtToStr(modVecNum));
AstVarScope* bitvscp
= createVarSc(varrefp->varScopep(), bitvarname, dimp->width(), NULL);
= createVarSc(varrefp->varScopep(), bitvarname, dimp->width(), nullptr);
AstAssign* bitassignp = new AstAssign(
nodep->fileline(), new AstVarRef(nodep->fileline(), bitvscp, true), dimp);
nodep->addNextHere(bitassignp);
@@ -235,7 +235,7 @@ private:
}
//
//=== Bitselect: __Vdlyvlsb__
AstNode* bitreadp = NULL; // Code to read Vdlyvlsb
AstNode* bitreadp = nullptr; // Code to read Vdlyvlsb
if (bitselp) {
AstNode* lsbvaluep = bitselp->lsbp()->unlinkFrBack();
if (VN_IS(bitselp->fromp(), Const)) {
@@ -245,7 +245,7 @@ private:
string bitvarname = (string("__Vdlyvlsb__") + oldvarp->shortName() + "__v"
+ cvtToStr(modVecNum));
AstVarScope* bitvscp
= createVarSc(varrefp->varScopep(), bitvarname, lsbvaluep->width(), NULL);
= createVarSc(varrefp->varScopep(), bitvarname, lsbvaluep->width(), nullptr);
AstAssign* bitassignp = new AstAssign(
nodep->fileline(), new AstVarRef(nodep->fileline(), bitvscp, true), lsbvaluep);
nodep->addNextHere(bitassignp);
@@ -269,7 +269,7 @@ private:
//
//=== Setting/not setting boolean: __Vdlyvset__
AstVarScope* setvscp;
AstAssignPre* setinitp = NULL;
AstAssignPre* setinitp = nullptr;
if (nodep->user3p()) {
// Simplistic optimization. If the previous statement in same scope was also a =>,
@@ -281,7 +281,7 @@ private:
} else { // Create new one
string setvarname
= (string("__Vdlyvset__") + oldvarp->shortName() + "__v" + cvtToStr(modVecNum));
setvscp = createVarSc(varrefp->varScopep(), setvarname, 1, NULL);
setvscp = createVarSc(varrefp->varScopep(), setvarname, 1, nullptr);
setinitp = new AstAssignPre(nodep->fileline(),
new AstVarRef(nodep->fileline(), setvscp, true),
new AstConst(nodep->fileline(), 0));
@@ -316,7 +316,7 @@ private:
checkActivePost(varrefp, oldactivep);
if (setinitp) oldactivep->addStmtsp(setinitp);
} else { // first time we've dealt with this memory
finalp = new AstAlwaysPost(nodep->fileline(), NULL /*sens*/, NULL /*body*/);
finalp = new AstAlwaysPost(nodep->fileline(), nullptr /*sens*/, nullptr /*body*/);
UINFO(9, " Created " << finalp << endl);
AstActive* newactp = createActivePost(varrefp);
newactp->addStmtsp(finalp);
@@ -332,8 +332,9 @@ private:
UASSERT_OBJ(postLogicp, nodep,
"Delayed assignment misoptimized; prev var found w/o associated IF");
} else {
postLogicp = new AstIf(nodep->fileline(),
new AstVarRef(nodep->fileline(), setvscp, false), NULL, NULL);
postLogicp
= new AstIf(nodep->fileline(), new AstVarRef(nodep->fileline(), setvscp, false),
nullptr, nullptr);
UINFO(9, " Created " << postLogicp << endl);
finalp->addBodysp(postLogicp);
finalp->user3p(setvscp); // Remember IF's vset variable
@@ -357,7 +358,7 @@ private:
virtual void visit(AstCFunc* nodep) override {
m_cfuncp = nodep;
iterateChildren(nodep);
m_cfuncp = NULL;
m_cfuncp = nullptr;
}
virtual void visit(AstActive* nodep) override {
m_activep = nodep;
@@ -371,7 +372,7 @@ private:
virtual void visit(AstAssignDly* nodep) override {
m_inDly = true;
m_nextDlyp
= VN_CAST(nodep->nextp(), AssignDly); // Next assignment in same block, maybe NULL.
= VN_CAST(nodep->nextp(), AssignDly); // Next assignment in same block, maybe nullptr.
if (m_cfuncp) {
nodep->v3warn(E_UNSUPPORTED,
"Unsupported: Delayed assignment inside public function/task");
@@ -399,7 +400,7 @@ private:
iterateChildren(nodep);
}
m_inDly = false;
m_nextDlyp = NULL;
m_nextDlyp = nullptr;
}
virtual void visit(AstVarRef* nodep) override {
@@ -421,7 +422,7 @@ private:
}
if (!dlyvscp) { // First use of this delayed variable
string newvarname = (string("__Vdly__") + nodep->varp()->shortName());
dlyvscp = createVarSc(oldvscp, newvarname, 0, NULL);
dlyvscp = createVarSc(oldvscp, newvarname, 0, nullptr);
AstNodeAssign* prep;
AstBasicDType* basicp = oldvscp->dtypep()->basicp();
if (basicp && basicp->isEventValue()) {
@@ -477,9 +478,9 @@ public:
// CONSTRUCTORS
explicit DelayedVisitor(AstNetlist* nodep) {
m_inDly = false;
m_activep = NULL;
m_cfuncp = NULL;
m_nextDlyp = NULL;
m_activep = nullptr;
m_cfuncp = nullptr;
m_nextDlyp = nullptr;
m_inLoop = false;
m_inInitial = false;