From 872a1216a74580458e9f62bc7077c50ca6aff1da Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Fri, 2 Mar 2012 06:58:19 -0500 Subject: [PATCH] Internals: Fix enum widthTotalBytes. --- src/V3AstNodes.h | 3 ++- src/V3Width.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h index ea331c5b4..b28f9a4ab 100644 --- a/src/V3AstNodes.h +++ b/src/V3AstNodes.h @@ -241,6 +241,7 @@ public: struct AstBasicDType : public AstNodeDType { // Builtin atomic/vectored data type + // Children: RANGE (converted to constant in V3Width) private: AstBasicDTypeKwd m_keyword; // What keyword created it bool m_implicit; // Implicitly declared @@ -446,7 +447,7 @@ struct AstEnumDType : public AstNodeDType { virtual AstBasicDType* basicp() const { return dtypep()->basicp(); } // (Slow) recurse down to find basic data type virtual AstNodeDType* skipRefp() const { return dtypep()->skipRefp(); } virtual int widthAlignBytes() const { return dtypep()->widthAlignBytes(); } - virtual int widthTotalBytes() const { return dtypep()->widthAlignBytes(); } + virtual int widthTotalBytes() const { return dtypep()->widthTotalBytes(); } }; //###################################################################### diff --git a/src/V3Width.cpp b/src/V3Width.cpp index bd6fa289c..097883115 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -86,7 +86,7 @@ class WidthVP : public AstNUser { // Parameters to pass down hierarchy with visit functions. int m_width; // Expression width, for (2+2), it's 32 bits int m_widthMin; // Minimum width, for (2+2), it's 2 bits, for 32'2+32'2 it's 32 bits - Stage m_stage; // If true, report errors + Stage m_stage; // If true, report errors public: WidthVP(int width, int widthMin, Stage stage) : m_width(width), m_widthMin(widthMin), m_stage(stage) {} int width() const { return m_width; } @@ -243,7 +243,7 @@ private: virtual void visit(AstTime* nodep, AstNUser*) { nodep->dtypeChgUInt64(); } virtual void visit(AstTimeD* nodep, AstNUser*) { nodep->dtypeChgDouble(); } virtual void visit(AstTestPlusArgs* nodep, AstNUser*) { nodep->dtypeChgSigned32(); } - virtual void visit(AstScopeName* nodep, AstNUser* vup) { nodep->dtypeChgUInt64(); } // A pointer, but not that it matters + virtual void visit(AstScopeName* nodep, AstNUser*) { nodep->dtypeChgUInt64(); } // A pointer, but not that it matters // Special cases. So many.... virtual void visit(AstNodeCond* nodep, AstNUser* vup) {