Internals: Improve astgen type enums to be switch statement friendly (#6362)

- Remove _ENUM_END, so -Wswitch does not demand it's covered. Use the
  new NUM_TYPES constexpr member instead.
- Remove 'at' prefix. This seems historical and is not particularly  useful.
- Fix some cppcheck warts while at it
This commit is contained in:
Geza Lore
2025-09-03 13:56:11 +01:00
committed by GitHub
parent 8bf2240d40
commit 5161cea8cd
12 changed files with 119 additions and 124 deletions
+2 -2
View File
@@ -177,7 +177,7 @@ class CCtorsVisitor final : public VNVisitor {
// If can be referred to by base pointer, need virtual delete
funcp->isVirtual(classp->isExtended());
funcp->slow(false);
insertSc(funcp, classp, VNType::atScDtor);
insertSc(funcp, classp, VNType::ScDtor);
classp->addStmtsp(funcp);
}
}
@@ -188,7 +188,7 @@ class CCtorsVisitor final : public VNVisitor {
m_varResetp = nullptr;
m_cfuncp = nodep;
iterateChildren(nodep);
if (nodep->name() == "new") insertSc(nodep, m_modp, VNType::atScCtor);
if (nodep->name() == "new") insertSc(nodep, m_modp, VNType::ScCtor);
}
void visit(AstVar* nodep) override {
if (nodep->needsCReset()) {