mirror of
https://github.com/verilator/verilator.git
synced 2026-09-03 08:24:31 +02:00
astgen: Enforce the use of aliased operand accessors (#4688)
This patch enforces the use of the most specific accessors for operands which have an '@astgen alias' declaration, by making the superclass accessors of the same operands private. This ensures client code is cleaner as you can't use multiple different methods to reference the same operands (which we used to in some places). Also prep for some refactoring.
This commit is contained in:
+4
-4
@@ -731,7 +731,7 @@ private:
|
||||
} else {
|
||||
if (isImpure(nodep)) return;
|
||||
FileLine* const fl = nodep->fileline();
|
||||
AstNodeExpr* lhsp = nodep->lhsp()->unlinkFrBack();
|
||||
AstNodeExpr* lhsp = nodep->srcp()->unlinkFrBack();
|
||||
AstNodeExpr* newp;
|
||||
const int lhswidth = lhsp->widthMin();
|
||||
if (lhswidth == 1) {
|
||||
@@ -739,7 +739,7 @@ private:
|
||||
newp = new AstNegate{fl, lhsp};
|
||||
} else {
|
||||
UINFO(8, " REPLICATE " << nodep << endl);
|
||||
const AstConst* const constp = VN_AS(nodep->rhsp(), Const);
|
||||
const AstConst* const constp = VN_AS(nodep->countp(), Const);
|
||||
UASSERT_OBJ(constp, nodep,
|
||||
"Replication value isn't a constant. Checked earlier!");
|
||||
const uint32_t times = constp->toUInt();
|
||||
@@ -765,9 +765,9 @@ private:
|
||||
UINFO(8, " Wordize ASSIGN(REPLICATE) " << nodep << endl);
|
||||
if (!doExpandWide(rhsp)) return false;
|
||||
FileLine* const fl = nodep->fileline();
|
||||
AstNodeExpr* const lhsp = rhsp->lhsp();
|
||||
AstNodeExpr* const lhsp = rhsp->srcp();
|
||||
const int lhswidth = lhsp->widthMin();
|
||||
const AstConst* const constp = VN_AS(rhsp->rhsp(), Const);
|
||||
const AstConst* const constp = VN_AS(rhsp->countp(), Const);
|
||||
UASSERT_OBJ(constp, rhsp, "Replication value isn't a constant. Checked earlier!");
|
||||
const uint32_t times = constp->toUInt();
|
||||
for (int w = 0; w < rhsp->widthWords(); ++w) {
|
||||
|
||||
Reference in New Issue
Block a user