From 0eeb40b975170a4daaeddb19cae7b8576e0c1501 Mon Sep 17 00:00:00 2001 From: Arkadiusz Kozdra Date: Thu, 18 Aug 2022 00:08:43 +0200 Subject: [PATCH] Fix converting subclasses to string (#3552) --- src/V3Common.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/V3Common.cpp b/src/V3Common.cpp index 0d5ca45f3..ad4ecaf6e 100644 --- a/src/V3Common.cpp +++ b/src/V3Common.cpp @@ -87,10 +87,10 @@ static void makeToStringMiddle(AstClass* nodep) { } } if (nodep->extendsp() && nodep->extendsp()->classp()->user1()) { - string stmt = "out += \""; + string stmt = "out += "; if (!comma.empty()) stmt += "\", \"+ "; // comma = ", "; // Nothing further so not needed - stmt += nodep->extendsp()->dtypep()->nameProtect(); + stmt += EmitCBaseVisitor::prefixNameProtect(nodep->extendsp()->dtypep()); stmt += "::to_string_middle();\n"; nodep->user1(true); // So what we extend dumps this funcp->addStmtsp(new AstCStmt{nodep->fileline(), stmt}); @@ -104,13 +104,13 @@ static void makeToStringMiddle(AstClass* nodep) { void V3Common::commonAll() { UINFO(2, __FUNCTION__ << ": " << endl); + // NODE STATE + // Entire netlist: + // AstClass::user1() -> bool. True if class needs to_string dumper + const VNUser1InUse m_inuser1; // Create common contents for each module for (AstNode* nodep = v3Global.rootp()->modulesp(); nodep; nodep = nodep->nextp()) { if (AstClass* const classp = VN_CAST(nodep, Class)) { - // NODE STATE - // Entire netlist: - // AstClass::user1() -> bool. True if class needs to_string dumper - const VNUser1InUse m_inuser1; // Create ToString methods makeVlToString(classp); makeToString(classp);