Internals: Cleanup Emit towards constructor/destructor output.

This commit is contained in:
Wilson Snyder
2020-02-02 21:15:07 -05:00
parent 73f5e3f808
commit 2ca9f73b31
5 changed files with 67 additions and 34 deletions
+6 -4
View File
@@ -110,7 +110,10 @@ class EmitCSyms : EmitCBaseVisitor {
void nameCheck(AstNode* nodep) {
// Prevent GCC compile time error; name check all things that reach C++ code
if (nodep->name() != "") {
if (nodep->name() != ""
&& !(VN_IS(nodep, CFunc)
&& (VN_CAST(nodep, CFunc)->isConstructor()
|| VN_CAST(nodep, CFunc)->isDestructor()))) {
string rsvd = m_words.isKeyword(nodep->name());
if (rsvd != "") {
// Generally V3Name should find all of these and throw SYMRSVDWORD.
@@ -387,10 +390,9 @@ void EmitCSyms::emitSymHdr() {
puts("#include \"verilated.h\"\n");
}
// for
puts("\n// INCLUDE MODULE CLASSES\n");
for (AstNodeModule* nodep = v3Global.rootp()->modulesp();
nodep; nodep=VN_CAST(nodep->nextp(), NodeModule)) {
for (AstNodeModule* nodep = v3Global.rootp()->modulesp(); nodep;
nodep = VN_CAST(nodep->nextp(), NodeModule)) {
puts("#include \"" + prefixNameProtect(nodep) + ".h\"\n");
}