Internals: Avoid emit inheritance in V3EmitCBase. No functional change intended.

This commit is contained in:
Wilson Snyder
2023-03-18 12:23:17 -04:00
parent 053f760e2a
commit 82e653a739
15 changed files with 61 additions and 62 deletions
+3 -4
View File
@@ -802,7 +802,7 @@ private:
// Convert input/inout DPI arguments to Internal types
string args;
args += ("(" + EmitCBaseVisitor::symClassName()
args += ("(" + EmitCBase::symClassName()
+ "*)(__Vscopep->symsp())"); // Upcast w/o overhead
AstNode* argnodesp = nullptr;
for (AstNode* stmtp = nodep->stmtsp(); stmtp; stmtp = stmtp->nextp()) {
@@ -1181,15 +1181,14 @@ private:
cfuncp->isConstructor(true);
AstClass* const classp = m_statep->getClassp(nodep);
if (classp->extendsp()) {
cfuncp->baseCtors(
EmitCBaseVisitor::prefixNameProtect(classp->extendsp()->classp()));
cfuncp->baseCtors(EmitCBase::prefixNameProtect(classp->extendsp()->classp()));
}
}
if (cfuncp->dpiExportImpl()) cfuncp->cname(nodep->cname());
if (!nodep->dpiImport() && !nodep->taskPublic()) {
// Need symbol table
cfuncp->argTypes(EmitCBaseVisitor::symClassVar());
cfuncp->argTypes(EmitCBase::symClassVar());
if (cfuncp->name() == "new") {
const string stmt = VIdProtect::protect("_ctor_var_reset") + "(vlSymsp);\n";
cfuncp->addInitsp(new AstCStmt{nodep->fileline(), stmt});