Fix clang unused warning.

This commit is contained in:
Wilson Snyder 2020-04-06 08:53:19 -04:00
parent b6c21ad21a
commit f13bd1aec4
2 changed files with 7 additions and 6 deletions

View File

@ -162,10 +162,10 @@ void V3CCtors::cctorsAll() {
}
}
if (v3Global.opt.coverage()) {
V3CCtorsVisitor configure_coverage
(modp, "_configure_coverage",
EmitCBaseVisitor::symClassVar()+ ", bool first", "vlSymsp, first",
"if (0 && vlSymsp && first) {} // Prevent unused\n");
V3CCtorsVisitor configure_coverage(
modp, "_configure_coverage",
EmitCBaseVisitor::symClassVar() + ", bool first", "vlSymsp, first",
"if (false && vlSymsp && first) {} // Prevent unused\n");
for (AstNode* np = modp->stmtsp(); np; np = np->nextp()) {
if (AstCoverDecl* coverp = VN_CAST(np, CoverDecl)) {
AstNode* backp = coverp->backp();

View File

@ -2137,8 +2137,9 @@ void EmitCImp::emitCtorImp(AstNodeModule* modp) {
void EmitCImp::emitConfigureImp(AstNodeModule* modp) {
puts("\nvoid " + prefixNameProtect(modp) + "::" + protect("__Vconfigure") + "("
+ symClassName() + "* vlSymsp, bool first) {\n");
puts( "if (0 && first) {} // Prevent unused\n");
puts( "if (false && first) {} // Prevent unused\n");
puts( "this->__VlSymsp = vlSymsp;\n"); // First, as later stuff needs it.
puts( "if (false && this->__VlSymsp) {} // Prevent unused\n");
if (v3Global.opt.coverage() ) {
puts(protect("_configure_coverage")+"(vlSymsp, first);\n");
}
@ -3451,7 +3452,7 @@ class EmitCTrace : EmitCStmts {
if (nodep->symProlog()) puts(EmitCBaseVisitor::symTopAssign()+"\n");
puts("int c = code;\n");
puts("if (0 && vcdp && c) {} // Prevent unused\n");
puts("if (false && vcdp && c) {} // Prevent unused\n");
if (nodep->funcType() == AstCFuncType::TRACE_INIT) {
puts("vcdp->module(vlSymsp->name()); // Setup signal names\n");
} else if (nodep->funcType() == AstCFuncType::TRACE_INIT_SUB) {