Remove dead code and some unused parameters

Found with CLion inspections
This commit is contained in:
Geza Lore 2020-06-01 17:49:42 +01:00
parent ae448e5ef9
commit a67ba04c37
25 changed files with 11 additions and 124 deletions

View File

@ -50,7 +50,6 @@ protected:
class ActiveNamer : public ActiveBaseVisitor {
private:
typedef std::map<string, AstActive*> ActiveNameMap;
// STATE
AstScope* m_scopep; // Current scope to add statement to
AstActive* m_iActivep; // For current scope, the IActive we're building

View File

@ -89,7 +89,7 @@ private:
}
// Move the SENTREE for each active up to the global level.
// This way we'll easily see what clock domains are identical
AstSenTree* wantp = m_finder.getSenTree(nodep->fileline(), sensesp);
AstSenTree* wantp = m_finder.getSenTree(sensesp);
UINFO(4, " lookdone\n");
if (wantp != sensesp) {
// Move the active's contents to the other active

View File

@ -46,7 +46,6 @@ private:
int m_funcNum; // Function number being built
public:
AstCFunc* builtFuncp() const { return m_tlFuncp; }
void add(AstNode* nodep) {
if (v3Global.opt.outputSplitCFuncs() && v3Global.opt.outputSplitCFuncs() < m_numStmts) {
m_funcp = NULL;

View File

@ -218,7 +218,7 @@ public:
//######################################################################
// Class class functions
void V3CUse::cUseAll(AstNetlist* nodep) {
void V3CUse::cUseAll() {
UINFO(2, __FUNCTION__ << ": " << endl);
// Call visitor separately for each module, so visitor state is cleared
for (AstNodeModule* modp = v3Global.rootp()->modulesp(); modp;

View File

@ -27,7 +27,7 @@
class V3CUse {
public:
static void cUseAll(AstNetlist* nodep);
static void cUseAll();
};
#endif // Guard

View File

@ -47,9 +47,6 @@ private:
// AstVarScope::user1p() -> AstVarScope*. Temporary signal that was created.
AstUser1InUse m_inuser1;
// TYPES
enum { DOUBLE_OR_RATE = 10 }; // How many | per ||, Determined experimentally as best
// STATE
AstNodeModule* m_modp; // Current module
AstTopScope* m_topScopep; // Current top scope

View File

@ -185,7 +185,6 @@ private:
CombineState m_state; // Major state
AstNodeModule* m_modp; // Current module
AstCFunc* m_funcp; // Current function
V3Hash m_lowerHash; // Hash of the statement we're building
CombCallVisitor m_call; // Tracking of function call users
int m_modNFuncs; // Number of functions made
AstNode* m_walkLast1p; // Final node that is the same in duplicate list

View File

@ -87,8 +87,6 @@ private:
bool m_inToggleOff; // In function/task etc
VarNameMap m_varnames; // Uniquification of inserted variable names
string m_beginHier; // AstBegin hier name for user coverage points
typedef vl_unordered_map<string, int> NameMap;
NameMap m_varNames; // Variable names made for uniq
HandleLines m_handleLines; // All line numbers for a given m_stateHandle
// METHODS

View File

@ -95,7 +95,6 @@ private:
AssignMap m_assignMap; // List of all simple assignments for each variable
bool m_elimUserVars; // Allow removal of user's vars
bool m_elimDTypes; // Allow removal of DTypes
bool m_elimScopes; // Allow removal of Scopes
bool m_elimCells; // Allow removal of Cells
bool m_sideEffect; // Side effects discovered in assign RHS
@ -443,7 +442,6 @@ public:
m_elimCells = elimCells;
m_elimUserVars = elimUserVars;
m_elimDTypes = elimDTypes;
m_elimScopes = elimScopes;
m_sideEffect = false;
// Prepare to remove some datatypes
nodep->typeTablep()->clearCache();

View File

@ -801,27 +801,6 @@ public:
//######################################################################
// EmitV class functions
void V3EmitV::emitv() {
UINFO(2, __FUNCTION__ << ": " << endl);
if (true) {
// All-in-one file
V3OutVFile of(v3Global.opt.makeDir() + "/" + v3Global.opt.prefix() + "__Vout.v");
of.putsHeader();
of.puts("# DESCR"
"IPTION: Verilator output: Verilog representation of internal tree for debug\n");
EmitVFileVisitor visitor(v3Global.rootp(), &of);
} else {
// Process each module in turn
for (AstNodeModule* modp = v3Global.rootp()->modulesp(); modp;
modp = VN_CAST(modp->nextp(), NodeModule)) {
V3OutVFile of(v3Global.opt.makeDir() + "/" + EmitCBaseVisitor::prefixNameProtect(modp)
+ "__Vout.v");
of.putsHeader();
EmitVFileVisitor visitor(modp, &of);
}
}
}
void V3EmitV::verilogForTree(AstNode* nodep, std::ostream& os) { EmitVStreamVisitor(nodep, os); }
void V3EmitV::verilogPrefixedTree(AstNode* nodep, std::ostream& os, const string& prefix,

View File

@ -27,7 +27,6 @@
class V3EmitV {
public:
static void emitv();
static void verilogForTree(AstNode* nodep, std::ostream& os = std::cout);
static void verilogPrefixedTree(AstNode* nodep, std::ostream& os, const string& prefix,
int flWidth, AstSenTree* domainp, bool user3mark);

View File

@ -43,9 +43,6 @@ class EmitXmlFileVisitor : public AstNVisitor {
// Outfile methods
V3OutFile* ofp() const { return m_ofp; }
virtual void puts(const string& str) { ofp()->puts(str); }
virtual void putbs(const string& str) { ofp()->putbs(str); }
virtual void putfs(AstNode*, const string& str) { putbs(str); }
virtual void putqs(AstNode*, const string& str) { putbs(str); }
virtual void putsNoTracking(const string& str) { ofp()->putsNoTracking(str); }
virtual void putsQuoted(const string& str) {
// Quote \ and " for use inside C programs

View File

@ -317,17 +317,6 @@ private:
VL_DO_DANGLING(replaceWithDelete(nodep, newp), nodep);
}
}
bool expandWide(AstNodeAssign* nodep, AstExtend* rhsp) {
UINFO(8, " Wordize ASSIGN(EXTEND) " << nodep << endl);
int w = 0;
for (w = 0; w < rhsp->lhsp()->widthWords(); w++) {
addWordAssign(nodep, w, newAstWordSelClone(rhsp->lhsp(), w));
}
for (; w < nodep->widthWords(); w++) {
addWordAssign(nodep, w, new AstConst(rhsp->fileline(), AstConst::SizedEData(), 0));
}
return true;
}
virtual void visit(AstSel* nodep) VL_OVERRIDE {
if (nodep->user1SetOnce()) return; // Process once

View File

@ -40,7 +40,6 @@ class FileLine;
class FileLineSingleton {
// TYPES
typedef std::map<string, int> FileNameNumMap;
typedef std::map<string, V3LangCode> FileLangNumMap;
// MEMBERS
FileNameNumMap m_namemap; // filenameno for each filename
std::deque<string> m_names; // filename text for each filenameno
@ -270,7 +269,6 @@ public:
}
private:
void v3errorEndFatalGuts(std::ostringstream& str);
string warnContext(bool secondary) const;
};
std::ostream& operator<<(std::ostream& os, FileLine* fileline);

View File

@ -203,8 +203,6 @@ private:
int m_instSelNum; // Current instantiation count 0..N-1
InstDeModVarVisitor m_deModVars; // State of variables for current cell module
typedef std::map<string, AstVar*> VarNameMap;
VL_DEBUG_FUNC; // Declare debug()
// VISITORS

View File

@ -46,8 +46,6 @@ void V3LinkLevel::modSortByLevel() {
// level() was computed for us in V3LinkCells
typedef std::vector<AstNodeModule*> ModVec;
ModVec mods; // Modules
ModVec tops; // Top level modules
for (AstNodeModule* nodep = v3Global.rootp()->modulesp(); nodep;

View File

@ -52,8 +52,6 @@ private:
ImplTypedefMap m_implTypedef; // Created typedefs for each <container,name>
FileLineSet m_filelines; // Filelines that have been seen
bool m_inAlways; // Inside an always
bool m_inGenerate; // Inside a generate
bool m_needStart; // Need start marker on lower AstParse
AstNodeModule* m_valueModp; // If set, move AstVar->valuep() initial values to this module
AstNodeModule* m_modp; // Current module
AstNodeFTask* m_ftaskp; // Current task
@ -535,8 +533,6 @@ public:
m_ftaskp = NULL;
m_dtypep = NULL;
m_inAlways = false;
m_inGenerate = false;
m_needStart = false;
m_valueModp = NULL;
iterate(rootp);
}

View File

@ -103,8 +103,6 @@
#include VL_INCLUDE_UNORDERED_MAP
#include VL_INCLUDE_UNORDERED_SET
class OrderMoveDomScope;
static bool domainsExclusive(const AstSenTree* fromp, const AstSenTree* top);
//######################################################################
@ -665,9 +663,7 @@ private:
SenTreeFinder m_finder; // Find global sentree's and add them
AstSenTree* m_comboDomainp; // Combo activation tree
AstSenTree* m_deleteDomainp; // Delete this from tree
AstSenTree* m_settleDomainp; // Initial activation tree
OrderInputsVertex* m_inputsVxp; // Top level vertex all inputs point from
OrderSettleVertex* m_settleVxp; // Top level vertex all settlement vertexes point from
OrderLogicVertex* m_logicVxp; // Current statement being tracked, NULL=ignored
AstTopScope* m_topScopep; // Current top scope being processed
AstScope* m_scopetopp; // Scope under TOPSCOPE
@ -976,13 +972,8 @@ private:
AstSenTree* combp
= new AstSenTree(nodep->fileline(), // Gets cloned() so ok if goes out of scope
new AstSenItem(nodep->fileline(), AstSenItem::Combo()));
m_comboDomainp = m_finder.getSenTree(nodep->fileline(), combp);
m_comboDomainp = m_finder.getSenTree(combp);
pushDeletep(combp); // Cleanup when done
AstSenTree* settlep
= new AstSenTree(nodep->fileline(), // Gets cloned() so ok if goes out of scope
new AstSenItem(nodep->fileline(), AstSenItem::Settle()));
m_settleDomainp = m_finder.getSenTree(nodep->fileline(), settlep);
pushDeletep(settlep); // Cleanup when done
// Fake AstSenTree we set domainp to indicate needs deletion
m_deleteDomainp = new AstSenTree(nodep->fileline(),
new AstSenItem(nodep->fileline(), AstSenItem::Settle()));
@ -1242,8 +1233,6 @@ public:
m_inPre = m_inPost = false;
m_comboDomainp = NULL;
m_deleteDomainp = NULL;
m_settleDomainp = NULL;
m_settleVxp = NULL;
m_inputsVxp = NULL;
m_activeSenVxp = NULL;
m_logicVxp = NULL;
@ -1549,7 +1538,7 @@ void OrderVisitor::processDomainsIterate(OrderEitherVertex* vertexp) {
newtree2p = NULL; // Below edit may replace it
V3Const::constifyExpensiveEdit(newtreep); // Remove duplicates
newtreep->multi(true); // Comment that it was made from 2 clock domains
domainp = m_finder.getSenTree(domainp->fileline(), newtreep);
domainp = m_finder.getSenTree(newtreep);
if (ddebug) { // LCOV_EXCL_START
UINFO(0, " dnew =" << newtreep << endl);
newtreep->dumpTree(cout);

View File

@ -20,7 +20,6 @@
// MTaskMoveVertex
// OrderEitherVertex
// OrderInputsVertex
// OrderSettleVertex
// OrderLogicVertex
// OrderVarVertex
// OrderVarStdVertex
@ -57,7 +56,6 @@ class OrderMoveDomScope;
enum OrderWeights {
WEIGHT_INPUT = 1, // Low weight just so dot graph looks nice
WEIGHT_COMBO = 1, // Breakable combo logic
WEIGHT_LOOPBE = 1, // Connection to loop begin/end
WEIGHT_POST = 2, // Post-delayed used var
WEIGHT_PRE = 3, // Breakable pre-delayed used var
WEIGHT_MEDIUM = 8, // Medium weight just so dot graph looks nice
@ -68,7 +66,6 @@ struct OrderVEdgeType {
enum en {
VERTEX_UNKNOWN = 0,
VERTEX_INPUTS,
VERTEX_SETTLE,
VERTEX_LOGIC,
VERTEX_VARSTD,
VERTEX_VARPRE,
@ -77,7 +74,6 @@ struct OrderVEdgeType {
VERTEX_VARSETTLE,
VERTEX_MOVE,
EDGE_STD,
EDGE_CHANGEDET,
EDGE_COMBOCUT,
EDGE_PRECUT,
EDGE_POSTCUT,
@ -85,10 +81,10 @@ struct OrderVEdgeType {
};
const char* ascii() const {
static const char* const names[]
= {"%E-vedge", "VERTEX_INPUTS", "VERTEX_SETTLE", "VERTEX_LOGIC",
"VERTEX_VARSTD", "VERTEX_VARPRE", "VERTEX_VARPOST", "VERTEX_VARPORD",
"VERTEX_VARSETTLE", "VERTEX_MOVE", "EDGE_STD", "EDGE_CHANGEDET",
"EDGE_COMBOCUT", "EDGE_PRECUT", "EDGE_POSTCUT", "_ENUM_END"};
= {"%E-vedge", "VERTEX_INPUTS", "VERTEX_LOGIC", "VERTEX_VARSTD",
"VERTEX_VARPRE", "VERTEX_VARPOST", "VERTEX_VARPORD", "VERTEX_VARSETTLE",
"VERTEX_MOVE", "EDGE_STD", "EDGE_COMBOCUT", "EDGE_PRECUT",
"EDGE_POSTCUT", "_ENUM_END"};
return names[m_e];
}
enum en m_e;
@ -122,15 +118,6 @@ public:
virtual void loopsVertexCb(V3GraphVertex* vertexp);
};
//! Graph for UNOPTFLAT loops
class UnoptflatGraph : public OrderGraph {
public:
UnoptflatGraph() {}
virtual ~UnoptflatGraph() {}
// Methods
virtual void loopsVertexCb(V3GraphVertex* vertexp);
};
//######################################################################
// Vertex types
@ -185,24 +172,6 @@ public:
virtual bool domainMatters() { return false; }
};
class OrderSettleVertex : public OrderEitherVertex {
OrderSettleVertex(V3Graph* graphp, const OrderSettleVertex& old)
: OrderEitherVertex(graphp, old) {}
public:
OrderSettleVertex(V3Graph* graphp, AstSenTree* domainp)
: OrderEitherVertex(graphp, NULL, domainp) {}
virtual ~OrderSettleVertex() {}
virtual OrderSettleVertex* clone(V3Graph* graphp) const {
return new OrderSettleVertex(graphp, *this);
}
virtual OrderVEdgeType type() const { return OrderVEdgeType::VERTEX_SETTLE; }
virtual string name() const { return "*SETTLE*"; }
virtual string dotColor() const { return "green"; }
virtual string dotName() const { return ""; }
virtual bool domainMatters() { return true; }
};
class OrderLogicVertex : public OrderEitherVertex {
AstNode* m_nodep;
@ -422,7 +391,6 @@ class MTaskMoveVertex : public V3GraphVertex {
protected:
friend class OrderVisitor;
friend class MTaskMoveVertexMaker;
public:
MTaskMoveVertex(V3Graph* graphp, OrderLogicVertex* logicp, const OrderEitherVertex* varp,
@ -487,17 +455,11 @@ public:
// When ordering combo blocks with stronglyConnected, follow edges not
// involving pre/pos variables
virtual bool followComboConnected() const { return true; }
virtual bool followSequentConnected() const { return true; }
static bool followComboConnected(const V3GraphEdge* edgep) {
const OrderEdge* oedgep = dynamic_cast<const OrderEdge*>(edgep);
if (!oedgep) v3fatalSrc("Following edge of non-OrderEdge type");
return (oedgep->followComboConnected());
}
static bool followSequentConnected(const V3GraphEdge* edgep) {
const OrderEdge* oedgep = dynamic_cast<const OrderEdge*>(edgep);
if (!oedgep) v3fatalSrc("Following edge of non-OrderEdge type");
return (oedgep->followSequentConnected());
}
};
class OrderComboCutEdge : public OrderEdge {
@ -519,7 +481,6 @@ public:
}
virtual string dotColor() const { return "yellowGreen"; }
virtual bool followComboConnected() const { return true; }
virtual bool followSequentConnected() const { return true; }
};
class OrderPostCutEdge : public OrderEdge {
@ -541,7 +502,6 @@ public:
}
virtual string dotColor() const { return "PaleGreen"; }
virtual bool followComboConnected() const { return false; }
virtual bool followSequentConnected() const { return true; }
};
class OrderPreCutEdge : public OrderEdge {
@ -563,7 +523,6 @@ public:
virtual ~OrderPreCutEdge() {}
virtual string dotColor() const { return "khaki"; }
virtual bool followComboConnected() const { return false; }
virtual bool followSequentConnected() const { return false; }
};
#endif // Guard

View File

@ -128,7 +128,7 @@ public:
m_topscopep = NULL;
m_trees.clear();
}
AstSenTree* getSenTree(FileLine* fl, AstSenTree* sensesp) {
AstSenTree* getSenTree(AstSenTree* sensesp) {
// Return a global sentree that matches given sense list.
AstSenTree* treep = m_trees.find(sensesp);
// Not found, form a new one

View File

@ -43,7 +43,6 @@ private:
bool m_fast;
AstCFunc* m_cfuncp; // Current CFUNC
VDouble0 m_statInstrLong; // Instruction count
bool m_counting; // Currently counting
double m_instrs; // Current instr count (for determining branch direction)
bool m_tracingCall; // Iterating into a CCall to a CFunc

View File

@ -36,7 +36,6 @@ class VSymEnt;
//######################################################################
// Symbol table
typedef std::set<VSymEnt*> VSymMap;
typedef std::set<const VSymEnt*> VSymConstMap;
class VSymEnt {

View File

@ -454,7 +454,7 @@ static void process() {
if (!v3Global.opt.lintOnly() && !v3Global.opt.xmlOnly() && !v3Global.opt.dpiHdrOnly()) {
// Create AstCUse to determine what class forward declarations/#includes needed in C
// Must be before V3EmitC
V3CUse::cUseAll(v3Global.rootp());
V3CUse::cUseAll();
// emitcInlines is first, as it may set needHInlines which other emitters read
V3EmitC::emitcInlines();

View File

@ -29,7 +29,6 @@
//######################################################################
// V3Options - Command line options
typedef std::vector<string> VlStringList;
typedef std::set<string> VlStringSet;
class VlcOptions {
@ -59,7 +58,6 @@ public:
m_unlink = false;
}
~VlcOptions() {}
void setDebugMode(int level);
// METHODS
void parseOptsList(int argc, char** argv);

View File

@ -39,7 +39,6 @@ private:
VlcSources m_sources; //< List of all source files to annotate
// METHODS
void createDir(const string& dirname);
void annotateCalc();
void annotateCalcNeeded();
void annotateOutputFiles(const string& dirname);