unbreak with clang16 by not trying to increment a boolean; set it instead

This commit is contained in:
robert 2023-11-15 19:44:31 +00:00
parent 2b889571a8
commit dc9644a025
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,21 @@
Index: src/V3EmitCSyms.cpp
--- src/V3EmitCSyms.cpp.orig
+++ src/V3EmitCSyms.cpp
@@ -329,7 +329,7 @@ void EmitCSyms::emitSymHdr() {
{ // Scope names
bool did = false;
for (ScopeNames::iterator it = m_scopeNames.begin(); it != m_scopeNames.end(); ++it) {
- if (!did++) puts("\n// SCOPE NAMES\n");
+ if (!did) { did = true; puts("\n// SCOPE NAMES\n"); }
puts("VerilatedScope __Vscope_"+it->second.m_symName+";\n");
}
}
@@ -432,7 +432,7 @@ void EmitCSyms::emitSymImp() {
{ // Setup scope names
bool did = false;
for (ScopeNames::iterator it = m_scopeNames.begin(); it != m_scopeNames.end(); ++it) {
- if (!did++) puts("// Setup scope names\n");
+ if (!did) { did = true; puts("// Setup scope names\n"); }
puts("__Vscope_"+it->second.m_symName+".configure(this,name(),");
putsQuoted(it->second.m_prettyName);
puts(");\n");

View File

@ -0,0 +1,13 @@
Index: src/V3EmitC.cpp
--- src/V3EmitC.cpp.orig
+++ src/V3EmitC.cpp
@@ -1904,7 +1904,8 @@ void EmitCImp::emitInt(AstNodeModule* modp) {
bool did = false;
for (AstNode* nodep=modp->stmtsp(); nodep; nodep = nodep->nextp()) {
if (AstCell* cellp=nodep->castCell()) {
- if (!did++) {
+ if (!did) {
+ did = true;
putsDecoration("// CELLS\n");
if (modp->isTop()) puts("// Public to allow access to /*verilator_public*/ items;\n");
if (modp->isTop()) puts("// otherwise the application code can consider these internals.\n");