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:
Geza Lore
2021-10-24 11:43:48 +01:00
parent 20e896ec21
commit 381c87a1eb
18 changed files with 131 additions and 142 deletions
+1 -1
View File
@@ -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();
}