Internals: Auto-set useRandimizeMethods if new a AstRandCase. No functional change

This commit is contained in:
Wilson Snyder 2025-11-23 17:14:19 -05:00
parent 6ab8d56993
commit 840c8f5782
2 changed files with 1 additions and 1 deletions

View File

@ -972,6 +972,7 @@ public:
AstRandCase(FileLine* fl, AstCaseItem* itemsp)
: ASTGEN_SUPER_RandCase(fl) {
addItemsp(itemsp);
v3Global.useRandomizeMethods(true);
}
ASTGEN_MEMBERS_AstRandCase;
int instrCount() const override { return INSTR_COUNT_BRANCH; }

View File

@ -5500,7 +5500,6 @@ class WidthVisitor final : public VNVisitor {
// IEEE says each item is a int (32-bits), and sizes are based on natural sizing,
// but we'll sum to a 64-bit number then math is faster.
assertAtStatement(nodep);
v3Global.useRandomizeMethods(true);
AstNodeDType* const itemDTypep = nodep->findUInt32DType();
for (AstCaseItem *nextip, *itemp = nodep->itemsp(); itemp; itemp = nextip) {
nextip = VN_AS(itemp->nextp(), CaseItem); // Prelim may cause the node to get replaced