From 593da4e38f9d86bdf537c8d5b5dc6333dea60ea2 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Wed, 4 Jun 2025 21:43:30 -0400 Subject: [PATCH] Internals: Fix missing const. No functional change. --- src/V3AstNodeDType.h | 2 +- src/V3AstNodes.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/V3AstNodeDType.h b/src/V3AstNodeDType.h index 8542bfa1f..635095644 100644 --- a/src/V3AstNodeDType.h +++ b/src/V3AstNodeDType.h @@ -158,7 +158,7 @@ public: bool widthSized() const VL_MT_SAFE { return !m_widthMin || m_widthMin == m_width; } bool generic() const VL_MT_SAFE { return m_generic; } void generic(bool flag) { m_generic = flag; } - std::pair dimensions(bool includeBasic); + std::pair dimensions(bool includeBasic) const; uint32_t arrayUnpackedElements() const; // 1, or total multiplication of all dimensions static int uniqueNumInc() { return ++s_uniqueNum; } const char* charIQWN() const { diff --git a/src/V3AstNodes.cpp b/src/V3AstNodes.cpp index d046745a4..9b5c9947f 100644 --- a/src/V3AstNodes.cpp +++ b/src/V3AstNodes.cpp @@ -1034,11 +1034,11 @@ uint32_t AstNodeDType::arrayUnpackedElements() const { return entries; } -std::pair AstNodeDType::dimensions(bool includeBasic) { +std::pair AstNodeDType::dimensions(bool includeBasic) const { // How many array dimensions (packed,unpacked) does this Var have? uint32_t packed = 0; uint32_t unpacked = 0; - for (AstNodeDType* dtypep = this; dtypep;) { + for (const AstNodeDType* dtypep = this; dtypep;) { dtypep = dtypep->skipRefp(); // Skip AstRefDType/AstTypedef, or return same node if (const AstNodeArrayDType* const adtypep = VN_CAST(dtypep, NodeArrayDType)) { if (VN_IS(adtypep, PackArrayDType)) {