mirror of
https://github.com/verilator/verilator.git
synced 2026-09-05 00:41:39 +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:
@@ -68,7 +68,7 @@ class EmitCConstPool final : public EmitCConstInit {
|
||||
void emitVars(const AstConstPool* poolp) {
|
||||
std::vector<const AstVar*> varps;
|
||||
for (AstNode* nodep = poolp->modp()->stmtsp(); nodep; nodep = nodep->nextp()) {
|
||||
if (const AstVar* const varp = VN_CAST_CONST(nodep, Var)) { varps.push_back(varp); }
|
||||
if (const AstVar* const varp = VN_CAST(nodep, Var)) { varps.push_back(varp); }
|
||||
}
|
||||
|
||||
if (varps.empty()) return; // Constant pool is empty, so we are done
|
||||
|
||||
Reference in New Issue
Block a user