mirror of
https://github.com/verilator/verilator.git
synced 2025-05-04 14:36:55 +00:00
Fix clang unused warning.
This commit is contained in:
parent
b6c21ad21a
commit
f13bd1aec4
@ -162,10 +162,10 @@ void V3CCtors::cctorsAll() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (v3Global.opt.coverage()) {
|
if (v3Global.opt.coverage()) {
|
||||||
V3CCtorsVisitor configure_coverage
|
V3CCtorsVisitor configure_coverage(
|
||||||
(modp, "_configure_coverage",
|
modp, "_configure_coverage",
|
||||||
EmitCBaseVisitor::symClassVar()+ ", bool first", "vlSymsp, first",
|
EmitCBaseVisitor::symClassVar() + ", bool first", "vlSymsp, first",
|
||||||
"if (0 && vlSymsp && first) {} // Prevent unused\n");
|
"if (false && vlSymsp && first) {} // Prevent unused\n");
|
||||||
for (AstNode* np = modp->stmtsp(); np; np = np->nextp()) {
|
for (AstNode* np = modp->stmtsp(); np; np = np->nextp()) {
|
||||||
if (AstCoverDecl* coverp = VN_CAST(np, CoverDecl)) {
|
if (AstCoverDecl* coverp = VN_CAST(np, CoverDecl)) {
|
||||||
AstNode* backp = coverp->backp();
|
AstNode* backp = coverp->backp();
|
||||||
|
@ -2137,8 +2137,9 @@ void EmitCImp::emitCtorImp(AstNodeModule* modp) {
|
|||||||
void EmitCImp::emitConfigureImp(AstNodeModule* modp) {
|
void EmitCImp::emitConfigureImp(AstNodeModule* modp) {
|
||||||
puts("\nvoid " + prefixNameProtect(modp) + "::" + protect("__Vconfigure") + "("
|
puts("\nvoid " + prefixNameProtect(modp) + "::" + protect("__Vconfigure") + "("
|
||||||
+ symClassName() + "* vlSymsp, bool first) {\n");
|
+ 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( "this->__VlSymsp = vlSymsp;\n"); // First, as later stuff needs it.
|
||||||
|
puts( "if (false && this->__VlSymsp) {} // Prevent unused\n");
|
||||||
if (v3Global.opt.coverage() ) {
|
if (v3Global.opt.coverage() ) {
|
||||||
puts(protect("_configure_coverage")+"(vlSymsp, first);\n");
|
puts(protect("_configure_coverage")+"(vlSymsp, first);\n");
|
||||||
}
|
}
|
||||||
@ -3451,7 +3452,7 @@ class EmitCTrace : EmitCStmts {
|
|||||||
if (nodep->symProlog()) puts(EmitCBaseVisitor::symTopAssign()+"\n");
|
if (nodep->symProlog()) puts(EmitCBaseVisitor::symTopAssign()+"\n");
|
||||||
|
|
||||||
puts("int c = code;\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) {
|
if (nodep->funcType() == AstCFuncType::TRACE_INIT) {
|
||||||
puts("vcdp->module(vlSymsp->name()); // Setup signal names\n");
|
puts("vcdp->module(vlSymsp->name()); // Setup signal names\n");
|
||||||
} else if (nodep->funcType() == AstCFuncType::TRACE_INIT_SUB) {
|
} else if (nodep->funcType() == AstCFuncType::TRACE_INIT_SUB) {
|
||||||
|
Loading…
Reference in New Issue
Block a user