From 562b9551bfb0377dfd377056e747562fd9740474 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Fri, 9 Aug 2019 04:12:49 -0400 Subject: [PATCH] Internals: Remove some unused arguments. No functional change intended. --- src/V3Simulate.h | 40 +++++++++++++++------------------------- src/V3Table.cpp | 2 +- 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/src/V3Simulate.h b/src/V3Simulate.h index eaea7a256..6e54a4483 100644 --- a/src/V3Simulate.h +++ b/src/V3Simulate.h @@ -205,7 +205,7 @@ public: m_whyNotOptimizable += stack.str(); } } - inline bool optimizable() const { return m_whyNotNodep==NULL; } + bool optimizable() const { return m_whyNotNodep==NULL; } string whyNotMessage() const { return m_whyNotOptimizable; } AstNode* whyNotNodep() const { return m_whyNotNodep; } @@ -215,7 +215,7 @@ public: // Simulation METHODS private: - AstConst* allocConst(AstNode* nodep, uint32_t value) { + AstConst* allocConst(AstNode* nodep) { // Save time - kept a list of allocated but unused values // It would be more efficient to do this by size, but the extra accounting // slows things down more than we gain. @@ -225,10 +225,9 @@ private: //UINFO(7,"Num Reuse "<width()<num().nodep(nodep); - constp->num().setLong(value); } else { //UINFO(7,"Num New "<width()<fileline(), AstConst::WidthedValue(), nodep->width(), value); + constp = new AstConst(nodep->fileline(), AstConst::WidthedValue(), nodep->width(), 0); UASSERT_OBJ(dtypep == constp->dtypep(), nodep, "Unexpected dtype"); m_constAllps[constp->dtypep()].push_back(constp); } @@ -237,24 +236,24 @@ private: return constp; } private: - AstConst* newValue(AstNode* nodep, uint32_t value=0) { + AstConst* newValue(AstNode* nodep) { // Set a constant value for this node if (!nodep->user3p()) { - AstConst* constp = allocConst(nodep, value); + AstConst* constp = allocConst(nodep); setValue(nodep, constp); return constp; } else { - return (fetchConst(nodep)); + return fetchConst(nodep); } } - AstConst* newOutValue(AstNode* nodep, uint32_t value=0) { + AstConst* newOutValue(AstNode* nodep) { // Set a constant value for this node if (!nodep->user2p()) { - AstConst* constp = allocConst(nodep, value); + AstConst* constp = allocConst(nodep); setOutValue(nodep, constp); return constp; } else { - return (fetchOutConst(nodep)); + return fetchOutConst(nodep); } } void newOutValue(AstNode* nodep, const AstConst* constr) { @@ -281,35 +280,27 @@ public: void newValue(AstNode* nodep, const AstConst* constp) { newValue(nodep)->num().opAssign(constp->num()); } - V3Number* fetchNumber(AstNode* nodep) { - return &fetchConst(nodep)->num(); - } V3Number* fetchNumberNull(AstNode* nodep) { AstConst* constp = fetchConstNull(nodep); if (constp) { return &constp->num(); } - return NULL; } - V3Number* fetchOutNumber(AstNode* nodep) { - return &fetchOutConst(nodep)->num(); - } V3Number* fetchOutNumberNull(AstNode* nodep) { AstConst* constp = fetchOutConstNull(nodep); if (constp) { return &constp->num(); } - return NULL; } private: - inline void setValue(AstNode* nodep, const AstConst* constp) { + void setValue(AstNode* nodep, const AstConst* constp) { UINFO(9," set num "<name()<<" on "<user3p((void*)constp); } - inline void setOutValue(AstNode* nodep, const AstConst* constp) { - UINFO(9," set num "<name()<<" on "<name()<<" on "<user2p((void*)constp); } @@ -429,7 +420,7 @@ private: } else { nodep->v3fatalSrc("Variable value should have been set before any visitor called."); } - constp = allocConst(nodep, 0); // Any value; just so recover from error + constp = allocConst(nodep); // Any value; just so recover from error } setValue(nodep, constp); } @@ -631,14 +622,14 @@ private: iterateAndNextNull(selp->lsbp()); // Bit index if (AstVarRef* varrefp = VN_CAST(selp->fromp(), VarRef)) { outVarrefpRef = varrefp; - lsbRef = *fetchNumber(selp->lsbp()); + lsbRef = fetchConst(selp->lsbp())->num(); return; // And presumably still optimizable() } else if (AstSel* subselp = VN_CAST(selp->lhsp(), Sel)) { V3Number sublsb(nodep); handleAssignSelRecurse(nodep, subselp, outVarrefpRef, sublsb/*ref*/, depth+1); if (optimizable()) { lsbRef = sublsb; - lsbRef.opAdd(sublsb, *fetchNumber(selp->lsbp())); + lsbRef.opAdd(sublsb, fetchConst(selp->lsbp())->num()); } } else { clearOptimizable(nodep, "Select LHS isn't simple variable"); @@ -925,7 +916,6 @@ private: AstConst* resultConstp = new AstConst(nodep->fileline(), AstConst::String(), result); setValue(nodep, resultConstp); m_stringValuesp.push_back(resultConstp); - } } diff --git a/src/V3Table.cpp b/src/V3Table.cpp index 249b619d7..acdc21984 100644 --- a/src/V3Table.cpp +++ b/src/V3Table.cpp @@ -311,7 +311,7 @@ private: // We're just using32 bit arithmetic, because there's no // way the input table can be 2^32 bytes! UASSERT_OBJ(shift <= 32, nodep, "shift overflow"); - UINFO(8," Input "<name()<<" = "<<*(simvis.fetchNumber(invscp))<name()<<" = "<