mirror of
https://github.com/verilator/verilator.git
synced 2026-10-08 02:53:12 +02:00
Remove VN_CAST_CONST and VN_AS_CONST.
The _CONST suffix on these macros is only lexical notation, pointer constness can be preserved by overloading the underlying implementations appropriately. Given that the compiler will catch invalid const usage (trying to assign a non-const pointer to a const pointer variable, etc.), and that the declarations of symbols should make their constness obvious, I see no reason to keep the _CONST flavours.
This commit is contained in:
+1
-1
@@ -416,7 +416,7 @@ class SplitUnpackedVarVisitor final : public AstNVisitor, public SplitVarImpl {
|
||||
}
|
||||
static int outerMostSizeOfUnpackedArray(const AstVar* nodep) {
|
||||
const AstUnpackArrayDType* const dtypep
|
||||
= VN_AS_CONST(nodep->dtypep()->skipRefp(), UnpackArrayDType);
|
||||
= VN_AS(nodep->dtypep()->skipRefp(), UnpackArrayDType);
|
||||
UASSERT_OBJ(dtypep, nodep, "Must be unapcked array");
|
||||
return dtypep->elementsConst();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user