From 3fc684359aaf3d5b3afafa3f73d3740961221b62 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Fri, 3 Mar 2023 18:49:26 -0500 Subject: [PATCH] Fix prettyName in structure dumps, partial (#4001) --- src/V3AstNodeExpr.h | 2 ++ src/V3Common.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/V3AstNodeExpr.h b/src/V3AstNodeExpr.h index 6190da6cb..3ccc3a36f 100644 --- a/src/V3AstNodeExpr.h +++ b/src/V3AstNodeExpr.h @@ -1392,6 +1392,7 @@ public: const char* broken() const override; void dump(std::ostream& str) const override; string name() const override { return m_name; } + void name(const string& name) override { m_name = name; } string emitVerilog() override { V3ERROR_NA_RETURN(""); } string emitC() override { V3ERROR_NA_RETURN(""); } bool cleanOut() const override { return false; } @@ -1850,6 +1851,7 @@ public: } ASTGEN_MEMBERS_AstStructSel; string name() const override { return m_name; } + void name(const string& name) override { m_name = name; } string emitVerilog() override { V3ERROR_NA_RETURN(""); } string emitC() override { V3ERROR_NA_RETURN(""); } bool cleanOut() const override { return false; } diff --git a/src/V3Common.cpp b/src/V3Common.cpp index 68999f3fd..72f900eb1 100644 --- a/src/V3Common.cpp +++ b/src/V3Common.cpp @@ -79,7 +79,7 @@ static void makeVlToString(AstNodeUOrStructDType* nodep) { } else { stmt += ", "; } - stmt += itemp->nameProtect() + ":\" + "; + stmt += VIdProtect::protect(itemp->prettyName()) + ":\" + "; if (VN_IS(itemp->dtypep()->skipRefp(), BasicDType) && itemp->isWide()) { stmt += "VL_TO_STRING_W"; } else {