diff --git a/include/verilated.cpp b/include/verilated.cpp index 0421b0438..3d3f8bddc 100644 --- a/include/verilated.cpp +++ b/include/verilated.cpp @@ -2556,7 +2556,7 @@ const char* Verilated::catName(const char* n1, const char* n2, const char* delim // Keeping these out of class Verilated to avoid having to include // in verilated.h (for compilation speed) -typedef std::list> VoidPCbList; +using VoidPCbList = std::list>; static struct { VerilatedMutex s_flushMutex; VoidPCbList s_flushCbs VL_GUARDED_BY(s_flushMutex); diff --git a/include/verilated.h b/include/verilated.h index 580cc2753..980beda10 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -569,10 +569,10 @@ public: // But for internal use only class VerilatedScope final { public: - typedef enum : vluint8_t { + enum Type : vluint8_t { SCOPE_MODULE, SCOPE_OTHER - } Type; // Type of a scope, currently module is only interesting + }; // Type of a scope, currently module is only interesting private: // Fastpath: VerilatedSyms* m_symsp = nullptr; ///< Symbol table diff --git a/include/verilated_cov.cpp b/include/verilated_cov.cpp index 85904d9d6..a4311e4fb 100644 --- a/include/verilated_cov.cpp +++ b/include/verilated_cov.cpp @@ -92,9 +92,9 @@ public: class VerilatedCovImp final : public VerilatedCovContext { private: // TYPES - typedef std::map ValueIndexMap; - typedef std::map IndexValueMap; - typedef std::deque ItemList; + using ValueIndexMap = std::map; + using IndexValueMap = std::map; + using ItemList = std::deque; // MEMBERS VerilatedMutex m_mutex; ///< Protects all members @@ -357,8 +357,7 @@ public: os << "# SystemC::Coverage-3\n"; // Build list of events; totalize if collapsing hierarchy - typedef std::map> EventMap; - EventMap eventCounts; + std::map> eventCounts; for (const auto& itemp : m_items) { std::string name; std::string hier; diff --git a/include/verilated_heavy.h b/include/verilated_heavy.h index cfc013b2c..6b0f52039 100644 --- a/include/verilated_heavy.h +++ b/include/verilated_heavy.h @@ -49,7 +49,7 @@ extern std::string VL_TO_STRING_W(int words, WDataInP obj); class VlURNG final { public: - typedef size_t result_type; + using result_type = size_t; static constexpr size_t min() { return 0; } static constexpr size_t max() { return 1ULL << 31; } size_t operator()() { return VL_MASK_I(31) & VL_RANDOM_I(32); } @@ -142,10 +142,10 @@ template std::string VL_TO_STRING(const VlWide& o template class VlQueue final { private: // TYPES - typedef std::deque Deque; + using Deque = std::deque; public: - typedef typename Deque::const_iterator const_iterator; + using const_iterator = typename Deque::const_iterator; private: // MEMBERS @@ -497,10 +497,10 @@ template std::string VL_TO_STRING(const VlQueue& obj) { template class VlAssocArray final { private: // TYPES - typedef std::map Map; + using Map = std::map; public: - typedef typename Map::const_iterator const_iterator; + using const_iterator = typename Map::const_iterator; private: // MEMBERS @@ -801,10 +801,10 @@ void VL_WRITEMEM_N(bool hex, int bits, const std::string& filename, template class VlUnpacked final { private: // TYPES - typedef std::array Array; + using Array = std::array; public: - typedef typename Array::const_iterator const_iterator; + using const_iterator = typename Array::const_iterator; private: // MEMBERS diff --git a/include/verilated_imp.h b/include/verilated_imp.h index 4c462d0f1..62a5671b8 100644 --- a/include/verilated_imp.h +++ b/include/verilated_imp.h @@ -80,7 +80,7 @@ public: /// This assumes no thread starts pushing the next tick until the previous has drained. /// If more aggressiveness is needed, a double-buffered scheme might work well. class VerilatedEvalMsgQueue final { - typedef std::multiset VerilatedThreadQueue; + using VerilatedThreadQueue = std::multiset; std::atomic m_depth; ///< Current depth of queue (see comments below) @@ -180,7 +180,7 @@ class VerilatedFpList final { std::size_t m_sz = 0; public: - typedef FILE* const* const_iterator; + using const_iterator = FILE* const*; explicit VerilatedFpList() {} const_iterator begin() const { return m_fp; } const_iterator end() const { return m_fp + m_sz; } @@ -398,8 +398,8 @@ protected: friend class VerilatedImp; // TYPES - typedef std::map, void*> UserMap; - typedef std::map ExportNameMap; + using UserMap = std::map, void*>; + using ExportNameMap = std::map; // MEMBERS // Nothing below here is save-restored; users expected to re-register appropriately diff --git a/include/verilated_threads.h b/include/verilated_threads.h index c7ddc4467..2231dded9 100644 --- a/include/verilated_threads.h +++ b/include/verilated_threads.h @@ -47,9 +47,9 @@ // VlMTaskVertex and VlThreadpool will work with multiple symbol table types. // Since the type is opaque to VlMTaskVertex and VlThreadPool, represent it // as a void* here. -typedef void* VlThrSymTab; +using VlThrSymTab = void*; -typedef void (*VlExecFnp)(bool, VlThrSymTab); +using VlExecFnp = void (*)(bool, VlThrSymTab); /// Track dependencies for a single MTask. class VlMTaskVertex final { @@ -251,7 +251,7 @@ public: class VlThreadPool final { // TYPES - typedef std::vector ProfileTrace; + using ProfileTrace = std::vector; // MEMBERS std::vector m_workers; // our workers diff --git a/include/verilated_trace.h b/include/verilated_trace.h index d5f9a5cb6..56d6373ca 100644 --- a/include/verilated_trace.h +++ b/include/verilated_trace.h @@ -114,8 +114,8 @@ public: //========================================================================= // Generic tracing internals - typedef void (*initCb_t)(void*, T_Derived*, uint32_t); // Type of init callbacks - typedef void (*dumpCb_t)(void*, T_Derived*); // Type of all but init callbacks + using initCb_t = void (*)(void*, T_Derived*, vluint32_t); // Type of init callbacks + using dumpCb_t = void (*)(void*, T_Derived*); // Type of all but init callbacks private: struct CallbackRecord { diff --git a/include/verilated_vcd_c.h b/include/verilated_vcd_c.h index 37adbdd50..02431c9a0 100644 --- a/include/verilated_vcd_c.h +++ b/include/verilated_vcd_c.h @@ -76,7 +76,7 @@ private: std::vector m_suffixes; ///< VCD line end string codes + metadata const char* m_suffixesp; ///< Pointer to first element of above - typedef std::map NameMap; + using NameMap = std::map; NameMap* m_namemapp = nullptr; ///< List of names for the header void bufferResize(vluint64_t minsize); diff --git a/include/verilated_vpi.cpp b/include/verilated_vpi.cpp index 2a9afdaeb..f788dabf3 100644 --- a/include/verilated_vpi.cpp +++ b/include/verilated_vpi.cpp @@ -456,7 +456,7 @@ public: //====================================================================== -typedef PLI_INT32 (*VerilatedPliCb)(struct t_cb_data*); +using VerilatedPliCb = PLI_INT32 (*)(struct t_cb_data*); class VerilatedVpiCbHolder final { // Holds information needed to call a callback @@ -502,8 +502,8 @@ class VerilatedVpiError; class VerilatedVpiImp final { enum { CB_ENUM_MAX_VALUE = cbAtEndOfSimTime + 1 }; // Maxium callback reason - typedef std::list VpioCbList; - typedef std::map, VerilatedVpiCbHolder> VpioTimedCbs; + using VpioCbList = std::list; + using VpioTimedCbs = std::map, VerilatedVpiCbHolder>; // All only medium-speed, so use singleton function VpioCbList m_cbObjLists[CB_ENUM_MAX_VALUE]; // Callbacks for each supported reason diff --git a/src/V3Active.cpp b/src/V3Active.cpp index c90016af5..221bada4f 100644 --- a/src/V3Active.cpp +++ b/src/V3Active.cpp @@ -211,7 +211,7 @@ private: AstActive* m_cActivep = nullptr; // For current scope, the SActive(combo) we're building SenTreeSet m_activeSens; // Sen lists for each active we've made - typedef std::unordered_map ActiveMap; + using ActiveMap = std::unordered_map; ActiveMap m_activeMap; // Map sentree to active, for folding. // METHODS diff --git a/src/V3Ast.h b/src/V3Ast.h index fa9e03d79..3c838d9c4 100644 --- a/src/V3Ast.h +++ b/src/V3Ast.h @@ -42,7 +42,7 @@ class VFlagBitPacked {}; class VFlagChildDType {}; // Used by parser.y to select constructor that sets childDType // Used as key for another map, needs operator<, hence not an unordered_set -typedef std::set MTaskIdSet; // Set of mtaskIds for Var sorting +using MTaskIdSet = std::set; // Set of mtaskIds for Var sorting //###################################################################### @@ -2468,7 +2468,7 @@ class AstNodeUOrStructDType VL_NOT_FINAL : public AstNodeDType { // A struct or union; common handling private: // TYPES - typedef std::map MemberNameMap; + using MemberNameMap = std::map; // MEMBERS string m_name; // Name from upper typedef, if any bool m_packed; diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h index ae7a23f27..d47b7767a 100644 --- a/src/V3AstNodes.h +++ b/src/V3AstNodes.h @@ -296,7 +296,7 @@ public: class AstClass final : public AstNodeModule { // TYPES - typedef std::map MemberNameMap; + using MemberNameMap = std::map; // MEMBERS MemberNameMap m_members; // Members or method children AstClassPackage* m_classOrPackagep = nullptr; // Class package this is under @@ -4980,7 +4980,7 @@ class AstInitArray final : public AstNode { // Parents: ASTVAR::init() // Children: AstInitItem public: - typedef std::map KeyItemMap; + using KeyItemMap = std::map; private: KeyItemMap m_map; // Node value for each array index @@ -9180,7 +9180,7 @@ class AstTypeTable final : public AstNode { AstQueueDType* m_queueIndexp = nullptr; AstBasicDType* m_basicps[AstBasicDTypeKwd::_ENUM_MAX]; // - typedef std::map DetailedMap; + using DetailedMap = std::map; DetailedMap m_detailedMap; public: diff --git a/src/V3Broken.cpp b/src/V3Broken.cpp index 5df76d8e7..613b4cf2f 100644 --- a/src/V3Broken.cpp +++ b/src/V3Broken.cpp @@ -41,7 +41,7 @@ class BrokenTable VL_NOT_FINAL : public AstNVisitor { private: // MEMBERS // For each node, we keep if it exists or not. - typedef std::unordered_map NodeMap; // Performance matters (when --debug) + using NodeMap = std::unordered_map; // Performance matters (when --debug) static NodeMap s_nodes; // Set of all nodes that exist // BITMASK enum { FLAG_ALLOCATED = 0x01 }; // new() and not delete()ed diff --git a/src/V3CUse.cpp b/src/V3CUse.cpp index 8aa7c1513..3eb65f13e 100644 --- a/src/V3CUse.cpp +++ b/src/V3CUse.cpp @@ -40,7 +40,7 @@ class CUseState final { private: // MEMBERS AstNodeModule* m_modInsertp; // Current module to insert AstCUse under - typedef std::pair UseString; + using UseString = std::pair; std::map m_didUse; // What we already used // NODE STATE diff --git a/src/V3Combine.cpp b/src/V3Combine.cpp index f74364a4b..bb9c081aa 100644 --- a/src/V3Combine.cpp +++ b/src/V3Combine.cpp @@ -67,7 +67,7 @@ class CombCallVisitor final : CombBaseVisitor { // Find all CCALLS of each CFUNC, so that we can later rename them private: // NODE STATE - typedef std::multimap CallMmap; + using CallMmap = std::multimap; CallMmap m_callMmap; // Associative array of {function}{call} // METHODS public: diff --git a/src/V3Config.cpp b/src/V3Config.cpp index 93b4ebecf..c8b9f936d 100644 --- a/src/V3Config.cpp +++ b/src/V3Config.cpp @@ -33,7 +33,7 @@ // cache of resolved entities. Entities stored in this container need an update // function that takes a reference of this type to join multiple entities into one. template class V3ConfigWildcardResolver { - typedef std::map Map; + using Map = std::map; Map m_mapWildcard; // Wildcard strings to entities Map m_mapResolved; // Resolved strings to converged entities @@ -111,7 +111,7 @@ public: } }; -typedef V3ConfigWildcardResolver V3ConfigVarResolver; +using V3ConfigVarResolver = V3ConfigWildcardResolver; //###################################################################### // Function or task: Have variables and properties @@ -148,7 +148,7 @@ public: } }; -typedef V3ConfigWildcardResolver V3ConfigFTaskResolver; +using V3ConfigFTaskResolver = V3ConfigWildcardResolver; //###################################################################### // Modules have tasks, variables, named blocks and properties @@ -212,7 +212,7 @@ public: } }; -typedef V3ConfigWildcardResolver V3ConfigModuleResolver; +using V3ConfigModuleResolver = V3ConfigWildcardResolver; //###################################################################### // Files have: @@ -246,14 +246,14 @@ std::ostream& operator<<(std::ostream& os, const V3ConfigIgnoresLine& rhs) { // Some attributes are attached to entities of the occur on a fileline // and multiple attributes can be attached to a line -typedef std::bitset V3ConfigLineAttribute; +using V3ConfigLineAttribute = std::bitset; // File entity class V3ConfigFile final { - typedef std::map LineAttrMap; // Map line->bitset of attributes - typedef std::multiset IgnLines; // list of {line,code,on} - typedef std::pair WaiverSetting; // Waive code if string matches - typedef std::vector Waivers; // List of {code,wildcard string} + using LineAttrMap = std::map; // Map line->bitset of attributes + using IgnLines = std::multiset; // list of {line,code,on} + using WaiverSetting = std::pair; // Waive code if string matches + using Waivers = std::vector; // List of {code,wildcard string} LineAttrMap m_lineAttrs; // Atributes to line mapping IgnLines m_ignLines; // Ignore line settings @@ -338,7 +338,7 @@ public: } }; -typedef V3ConfigWildcardResolver V3ConfigFileResolver; +using V3ConfigFileResolver = V3ConfigWildcardResolver; //###################################################################### // Resolve modules and files in the design diff --git a/src/V3Coverage.cpp b/src/V3Coverage.cpp index 7ad84e8cb..d7aee3ee0 100644 --- a/src/V3Coverage.cpp +++ b/src/V3Coverage.cpp @@ -40,7 +40,7 @@ class CoverageVisitor final : public AstNVisitor { private: // TYPES - typedef std::set LinenoSet; + using LinenoSet = std::set; struct ToggleEnt { string m_comment; // Comment for coverage dump diff --git a/src/V3Dead.cpp b/src/V3Dead.cpp index f05ac9394..b08c5e78c 100644 --- a/src/V3Dead.cpp +++ b/src/V3Dead.cpp @@ -79,7 +79,7 @@ private: AstUser1InUse m_inuser1; // TYPES - typedef std::multimap AssignMap; + using AssignMap = std::multimap; // STATE AstNodeModule* m_modp = nullptr; // Current module diff --git a/src/V3Delayed.cpp b/src/V3Delayed.cpp index 553f38d59..db00cd2aa 100644 --- a/src/V3Delayed.cpp +++ b/src/V3Delayed.cpp @@ -94,7 +94,7 @@ private: bool m_inDly = false; // True in delayed assignments bool m_inLoop = false; // True in for loops bool m_inInitial = false; // True in initial blocks - typedef std::map, AstVar*> VarMap; + using VarMap = std::map, AstVar*>; VarMap m_modVarMap; // Table of new var names created under module VDouble0 m_statSharedSet; // Statistic tracking std::unordered_map m_scopeVecMap; // Next var number for each scope diff --git a/src/V3Descope.cpp b/src/V3Descope.cpp index c9aa2bc88..3e40fa3ee 100644 --- a/src/V3Descope.cpp +++ b/src/V3Descope.cpp @@ -42,7 +42,7 @@ private: AstUser1InUse m_inuser1; // TYPES - typedef std::multimap FuncMmap; + using FuncMmap = std::multimap; // STATE AstNodeModule* m_modp = nullptr; // Current module diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index 95942d878..0a1416f1d 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -41,8 +41,8 @@ constexpr int EMITC_NUM_CONSTW class EmitCStmts VL_NOT_FINAL : public EmitCBaseVisitor { private: - typedef std::vector VarVec; - typedef std::map VarSortMap; // Map size class to VarVec + using VarVec = std::vector; + using VarSortMap = std::map; // Map size class to VarVec bool m_suppressSemi; AstVarRef* m_wideTempRefp; // Variable that _WW macros should be setting @@ -2957,7 +2957,7 @@ void EmitCStmts::emitVarSort(const VarSortMap& vmap, VarVec* sortedp) { } // MacroTask mode. Sort by MTask-affinity group first, size second. - typedef std::map MTaskVarSortMap; + using MTaskVarSortMap = std::map; MTaskVarSortMap m2v; for (VarSortMap::const_iterator it = vmap.begin(); it != vmap.end(); ++it) { int size_class = it->first; diff --git a/src/V3EmitCSyms.cpp b/src/V3EmitCSyms.cpp index d0cfe9632..cbdff09a8 100644 --- a/src/V3EmitCSyms.cpp +++ b/src/V3EmitCSyms.cpp @@ -71,11 +71,11 @@ class EmitCSyms final : EmitCBaseVisitor { , m_modp{modp} , m_scopep{scopep} {} }; - typedef std::map ScopeNames; - typedef std::pair ScopeModPair; - typedef std::pair ModVarPair; - typedef std::vector ScopeNameList; - typedef std::map ScopeNameHierarchy; + using ScopeNames = std::map; + using ScopeModPair = std::pair; + using ModVarPair = std::pair; + using ScopeNameList = std::vector; + using ScopeNameHierarchy = std::map; struct CmpName { bool operator()(const ScopeModPair& lhsp, const ScopeModPair& rhsp) const { return lhsp.first->name() < rhsp.first->name(); @@ -401,7 +401,7 @@ void EmitCSyms::emitSymHdr() { AstCFunc* funcp = itr.second.m_cfuncp; if (funcp->dpiExport()) { string cbtype = protect(v3Global.opt.prefix() + "__Vcb_" + funcp->cname() + "_t"); - types["typedef void (*" + cbtype + ") (" + cFuncArgs(funcp) + ");\n"] = 1; + types["using " + cbtype + " = void (*) (" + cFuncArgs(funcp) + ");\n"] = 1; } } for (const auto& i : types) puts(i.first); diff --git a/src/V3Error.h b/src/V3Error.h index 89e9878c1..1b8ff02ed 100644 --- a/src/V3Error.h +++ b/src/V3Error.h @@ -226,8 +226,8 @@ inline std::ostream& operator<<(std::ostream& os, const V3ErrorCode& rhs) { class V3Error final { // Base class for any object that wants debugging and error reporting - typedef std::set MessagesSet; - typedef void (*ErrorExitCb)(void); + using MessagesSet = std::set; + using ErrorExitCb = void (*)(void); private: static bool s_describedWarnings; // Told user how to disable warns diff --git a/src/V3File.cpp b/src/V3File.cpp index 9edea35ea..63920e061 100644 --- a/src/V3File.cpp +++ b/src/V3File.cpp @@ -328,7 +328,7 @@ void V3File::createMakeDir() { // VInFilterImp class VInFilterImp final { - typedef VInFilter::StrList StrList; + using StrList = VInFilter::StrList; std::map m_contentsMap; // Cache of file contents bool m_readEof = false; // Received EOF on read diff --git a/src/V3File.h b/src/V3File.h index 35df9efbe..b198a10b4 100644 --- a/src/V3File.h +++ b/src/V3File.h @@ -79,7 +79,7 @@ class VInFilterImp; class VInFilter final { public: // TYPES - typedef std::list StrList; + using StrList = std::list; private: VInFilterImp* m_impp; diff --git a/src/V3Gate.cpp b/src/V3Gate.cpp index cb329f785..913c6c645 100644 --- a/src/V3Gate.cpp +++ b/src/V3Gate.cpp @@ -37,7 +37,7 @@ #include #include -typedef std::list GateVarRefList; +using GateVarRefList = std::list; constexpr int GATE_DEDUP_MAX_DEPTH = 20; diff --git a/src/V3Graph.h b/src/V3Graph.h index 399a93982..1b03c8a7e 100644 --- a/src/V3Graph.h +++ b/src/V3Graph.h @@ -37,7 +37,7 @@ class OrderLogicVertex; // Most graph algorithms accept an arbitrary function that returns // True for those edges we should honor. -typedef bool (*V3EdgeFuncP)(const V3GraphEdge* edgep); +using V3EdgeFuncP = bool (*)(const V3GraphEdge* edgep); //============================================================================= // When the Graph represents a directional acyclical graph (DAG), following diff --git a/src/V3GraphAcyc.cpp b/src/V3GraphAcyc.cpp index f18a432f7..cd0663a5c 100644 --- a/src/V3GraphAcyc.cpp +++ b/src/V3GraphAcyc.cpp @@ -56,7 +56,7 @@ public: class GraphAcycEdge final : public V3GraphEdge { // userp() is always used to point to the head original graph edge private: - typedef std::list OrigEdgeList; // List of orig edges, see also GraphAcyc's decl + using OrigEdgeList = std::list; // List of orig edges, see also GraphAcyc's decl V3GraphEdge* origEdgep() const { OrigEdgeList* oEListp = static_cast(userp()); if (!oEListp) v3fatalSrc("No original edge associated with acyc edge " << this); @@ -89,8 +89,8 @@ struct GraphAcycEdgeCmp { // CLASSES class GraphAcyc final { private: - typedef std::list - OrigEdgeList; // List of orig edges, see also GraphAcycEdge's decl + using OrigEdgeList + = std::list; // List of orig edges, see also GraphAcycEdge's decl // GRAPH USERS // origGraph // GraphVertex::user() GraphAycVerted* New graph node diff --git a/src/V3GraphDfa.cpp b/src/V3GraphDfa.cpp index 135187e3e..a619c23d9 100644 --- a/src/V3GraphDfa.cpp +++ b/src/V3GraphDfa.cpp @@ -58,8 +58,8 @@ class GraphNfaToDfa final : GraphAlg<> { // Edges from DFA to DFA indicate a completed input transition private: // TYPES - typedef std::deque DfaStates; - typedef std::multimap HashMap; + using DfaStates = std::deque; + using HashMap = std::multimap; // MEMBERS uint32_t m_step; // Processing step, so we can avoid clearUser all the time diff --git a/src/V3GraphDfa.h b/src/V3GraphDfa.h index 1a102bf47..854a4074f 100644 --- a/src/V3GraphDfa.h +++ b/src/V3GraphDfa.h @@ -108,7 +108,7 @@ public: //============================================================================ /// Abstract type indicating a specific "input" to the NFA /// DFA assumes each .toInt() is unique -typedef VNUser DfaInput; +using DfaInput = VNUser; //============================================================================ // Edge types diff --git a/src/V3GraphStream.h b/src/V3GraphStream.h index 4f62b50eb..196aa60ef 100644 --- a/src/V3GraphStream.h +++ b/src/V3GraphStream.h @@ -80,7 +80,7 @@ private: VL_UNCOPYABLE(VxHolderCmp); }; - typedef std::set ReadyVertices; + using ReadyVertices = std::set; // MEMBERS VxHolderCmp m_vxHolderCmp; // Vertext comparison functor @@ -227,6 +227,6 @@ private: // GraphStreamUnordered is GraphStream using a plain pointer compare to // break ties in the graph order. This WILL return nodes in // nondeterministic order. -typedef GraphStream> GraphStreamUnordered; +using GraphStreamUnordered = GraphStream>; #endif // Guard diff --git a/src/V3Hashed.h b/src/V3Hashed.h index 9ee62f099..07bdcb7d4 100644 --- a/src/V3Hashed.h +++ b/src/V3Hashed.h @@ -50,8 +50,8 @@ class V3Hashed final : public VHashedBase { // TYPES public: - typedef std::multimap HashMmap; - typedef HashMmap::iterator iterator; + using HashMmap = std::multimap; + using iterator = HashMmap::iterator; private: // MEMBERS diff --git a/src/V3HierBlock.cpp b/src/V3HierBlock.cpp index 3dd3f730e..afa858503 100644 --- a/src/V3HierBlock.cpp +++ b/src/V3HierBlock.cpp @@ -240,7 +240,7 @@ class HierBlockUsageCollectVisitor final : public AstNVisitor { AstUser1InUse m_inuser1; // STATE - typedef std::unordered_set ModuleSet; + using ModuleSet = std::unordered_set; V3HierBlockPlan* const m_planp; AstModule* m_modp = nullptr; // The current module AstModule* m_hierBlockp = nullptr; // The nearest parent module that is a hierarchical block @@ -355,8 +355,8 @@ void V3HierBlockPlan::createPlan(AstNetlist* nodep) { } V3HierBlockPlan::HierVector V3HierBlockPlan::hierBlocksSorted() const { - typedef std::unordered_map> - ChildrenMap; + using ChildrenMap + = std::unordered_map>; ChildrenMap childrenOfHierBlock; HierVector sorted; diff --git a/src/V3HierBlock.h b/src/V3HierBlock.h index 38caf5b8f..b9fac2c58 100644 --- a/src/V3HierBlock.h +++ b/src/V3HierBlock.h @@ -40,13 +40,13 @@ class AstVar; class V3HierBlock final { public: - typedef std::vector GParams; - typedef std::unordered_set HierBlockSet; + using GParams = std::vector; + using HierBlockSet = std::unordered_set; private: // TYPES // Parameter name, stringified value - typedef std::vector> StrGParams; + using StrGParams = std::vector>; // MEMBERS const AstNodeModule* m_modp; // Hierarchical block module @@ -96,16 +96,16 @@ public: // Holds relashonship between AstNodeModule and V3HierBlock class V3HierBlockPlan final { - typedef std::unordered_map HierMap; + using HierMap = std::unordered_map; HierMap m_blocks; V3HierBlockPlan() = default; VL_UNCOPYABLE(V3HierBlockPlan); public: - typedef HierMap::iterator iterator; - typedef HierMap::const_iterator const_iterator; - typedef std::vector HierVector; + using iterator = HierMap::iterator; + using const_iterator = HierMap::const_iterator; + using HierVector = std::vector; VL_DEBUG_FUNC; // Declare debug() bool isHierBlock(const AstNodeModule* modp) const; diff --git a/src/V3Inline.cpp b/src/V3Inline.cpp index d4c57a51a..73a1c0332 100644 --- a/src/V3Inline.cpp +++ b/src/V3Inline.cpp @@ -69,12 +69,12 @@ private: AstNodeModule* m_modp = nullptr; // Current module VDouble0 m_statUnsup; // Statistic tracking - typedef std::vector ModVec; + using ModVec = std::vector; ModVec m_allMods; // All modules, in top-down order. // Within the context of a given module, LocalInstanceMap maps // from child modules to the count of each child's local instantiations. - typedef std::unordered_map LocalInstanceMap; + using LocalInstanceMap = std::unordered_map; // We keep a LocalInstanceMap for each module in the design std::unordered_map m_instances; diff --git a/src/V3LanguageWords.h b/src/V3LanguageWords.h index dfcd6f83f..c5b19317d 100644 --- a/src/V3LanguageWords.h +++ b/src/V3LanguageWords.h @@ -27,7 +27,7 @@ class V3LanguageWords final { // List of common reserved keywords private: - typedef std::map KeywordMap; + using KeywordMap = std::map; struct Singleton { KeywordMap s_kwdMap; // List of keywords, and what language applies Singleton() { init(); } @@ -36,7 +36,7 @@ private: }; public: - typedef KeywordMap::const_iterator const_iterator; + using const_iterator = KeywordMap::const_iterator; // METHODS static const_iterator begin() { return s().s_kwdMap.begin(); } static const_iterator end() { return s().s_kwdMap.end(); } diff --git a/src/V3Life.cpp b/src/V3Life.cpp index 356d50ebd..2b7dc0541 100644 --- a/src/V3Life.cpp +++ b/src/V3Life.cpp @@ -123,7 +123,7 @@ class LifeBlock final { // LIFE MAP // For each basic block, we'll make a new map of what variables that if/else is changing - typedef std::unordered_map LifeMap; + using LifeMap = std::unordered_map; LifeMap m_map; // Current active lifetime map for current scope LifeBlock* m_aboveLifep; // Upper life, or nullptr LifeState* m_statep; // Current global state @@ -278,7 +278,7 @@ private: // LIFE MAP // For each basic block, we'll make a new map of what variables that if/else is changing - typedef std::unordered_map LifeMap; + using LifeMap = std::unordered_map; // cppcheck-suppress memleak // cppcheck bug - it is deleted LifeBlock* m_lifep; // Current active lifetime map for current scope diff --git a/src/V3LifePost.cpp b/src/V3LifePost.cpp index 9aea9b950..c74ff31da 100644 --- a/src/V3LifePost.cpp +++ b/src/V3LifePost.cpp @@ -145,7 +145,7 @@ private: // Map each varscope to one or more locations where it's accessed. // These maps will not include any ASSIGNPOST accesses: - typedef std::unordered_map> LocMap; + using LocMap = std::unordered_map>; LocMap m_reads; // VarScope read locations LocMap m_writes; // VarScope write locations diff --git a/src/V3LinkDot.cpp b/src/V3LinkDot.cpp index 7a536434f..0126b6e44 100644 --- a/src/V3LinkDot.cpp +++ b/src/V3LinkDot.cpp @@ -140,8 +140,8 @@ public: private: // TYPES - typedef std::unordered_map ScopeAliasMap; - typedef std::vector> IfaceModSyms; + using ScopeAliasMap = std::unordered_map; + using IfaceModSyms = std::vector>; static LinkDotState* s_errorThisp; // Last self, for error reporting only diff --git a/src/V3LinkLevel.cpp b/src/V3LinkLevel.cpp index 96ef55d56..fd118f4a9 100644 --- a/src/V3LinkLevel.cpp +++ b/src/V3LinkLevel.cpp @@ -171,7 +171,7 @@ void V3LinkLevel::wrapTopCell(AstNetlist* rootp) { UASSERT_OBJ(newmodp && newmodp->isTop(), rootp, "No TOP module found to insert under"); // Find all duplicate signal names (if multitop) - typedef std::unordered_set NameSet; + using NameSet = std::unordered_set; NameSet ioNames; NameSet dupNames; // For all modules, skipping over new top diff --git a/src/V3LinkLevel.h b/src/V3LinkLevel.h index 4f52f7a60..9c42e6700 100644 --- a/src/V3LinkLevel.h +++ b/src/V3LinkLevel.h @@ -27,7 +27,7 @@ class V3LinkLevel final { private: - typedef std::vector ModVec; + using ModVec = std::vector; static void timescaling(const ModVec& mods); static void wrapTopCell(AstNetlist* rootp); diff --git a/src/V3LinkParse.cpp b/src/V3LinkParse.cpp index e5913888f..6f95b8eda 100644 --- a/src/V3LinkParse.cpp +++ b/src/V3LinkParse.cpp @@ -44,7 +44,7 @@ private: AstUser2InUse m_inuser2; // TYPES - typedef std::map, AstTypedef*> ImplTypedefMap; + using ImplTypedefMap = std::map, AstTypedef*>; // STATE AstVar* m_varp = nullptr; // Variable we're under diff --git a/src/V3Number.h b/src/V3Number.h index 92693fcd8..248461947 100644 --- a/src/V3Number.h +++ b/src/V3Number.h @@ -312,8 +312,8 @@ public: // STATICS static int log2b(uint32_t num); - typedef V3Number& (*UniopFuncp)(V3Number&); - typedef V3Number& (*BiopFuncp)(V3Number&, V3Number&); + using UniopFuncp = V3Number& (*)(V3Number&); + using BiopFuncp = V3Number& (*)(V3Number&, V3Number&); // MATH // "this" is the output, as we need the output width before some computations diff --git a/src/V3Options.cpp b/src/V3Options.cpp index c54149d81..eb0ff8828 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -54,7 +54,7 @@ class V3OptionsImp final { public: // TYPES - typedef std::map> DirMap; // Directory listing + using DirMap = std::map>; // Directory listing // STATE std::list m_allArgs; // List of every argument encountered diff --git a/src/V3Options.h b/src/V3Options.h index 4db85011a..27c9b0126 100644 --- a/src/V3Options.h +++ b/src/V3Options.h @@ -152,8 +152,8 @@ inline bool operator==(const TraceFormat& lhs, const TraceFormat& rhs) { inline bool operator==(const TraceFormat& lhs, TraceFormat::en rhs) { return lhs.m_e == rhs; } inline bool operator==(TraceFormat::en lhs, const TraceFormat& rhs) { return lhs == rhs.m_e; } -typedef std::vector V3StringList; -typedef std::set V3StringSet; +using V3StringList = std::vector; +using V3StringSet = std::set; //###################################################################### @@ -161,7 +161,7 @@ typedef std::set V3StringSet; class V3HierarchicalBlockOption final { public: // key:parameter name, value:value (as string) - typedef std::map ParamStrMap; + using ParamStrMap = std::map; private: string m_origName; // module name @@ -178,7 +178,7 @@ public: const ParamStrMap params() const { return m_parameters; } }; -typedef std::map V3HierBlockOptSet; +using V3HierBlockOptSet = std::map; //###################################################################### // V3Options - Command line options @@ -187,7 +187,7 @@ class V3Options final { public: private: // TYPES - typedef std::map DebugSrcMap; + using DebugSrcMap = std::map; // MEMBERS (general options) V3OptionsImp* m_impp; // Slow hidden options diff --git a/src/V3Order.cpp b/src/V3Order.cpp index 464f219c5..b68138ade 100644 --- a/src/V3Order.cpp +++ b/src/V3Order.cpp @@ -136,8 +136,8 @@ private: const AstSenTree* m_domainp; // Domain all vertices belong to const AstScope* m_scopep; // Scope all vertices belong to - typedef std::pair DomScopeKey; - typedef std::map DomScopeMap; + using DomScopeKey = std::pair; + using DomScopeMap = std::map; static DomScopeMap s_dsMap; // Structure registered for each dom/scope pairing public: @@ -421,8 +421,8 @@ template class ProcessMoveBuildGraph { // works the same way for both cases. // TYPES - typedef std::pair VxDomPair; - typedef std::unordered_map Logic2Move; + using VxDomPair = std::pair; + using Logic2Move = std::unordered_map; public: class MoveVertexMaker VL_NOT_FINAL { @@ -729,7 +729,7 @@ private: void process(); void processCircular(); - typedef std::deque VertexVec; + using VertexVec = std::deque; void processInputs(); void processInputsInIterate(OrderEitherVertex* vertexp, VertexVec& todoVec); void processInputsOutIterate(OrderEitherVertex* vertexp, VertexVec& todoVec); diff --git a/src/V3Param.cpp b/src/V3Param.cpp index a067f2c35..113ace5c6 100644 --- a/src/V3Param.cpp +++ b/src/V3Param.cpp @@ -67,11 +67,11 @@ // Hierarchical block and parameter db (modules without parameter is also handled) class ParameterizedHierBlocks final { - typedef std::multimap HierBlockOptsByOrigName; - typedef HierBlockOptsByOrigName::const_iterator HierMapIt; - typedef std::map HierBlockModMap; - typedef std::map> ParamConstMap; - typedef std::map GParamsMap; // key:parameter name value:parameter + using HierBlockOptsByOrigName = std::multimap; + using HierMapIt = HierBlockOptsByOrigName::const_iterator; + using HierBlockModMap = std::map; + using ParamConstMap = std::map>; + using GParamsMap = std::map; // key:parameter name value:parameter // MEMBERS // key:Original module name, value:HiearchyBlockOption* @@ -232,10 +232,10 @@ class ParamProcessor final { // TYPES // Note may have duplicate entries - typedef std::deque> IfaceRefRefs; + using IfaceRefRefs = std::deque>; // STATE - typedef std::unordered_map CloneMap; + using CloneMap = std::unordered_map; struct ModInfo { AstNodeModule* m_modp; // Module with specified name CloneMap m_cloneMap; // Map of old-varp -> new cloned varp @@ -252,7 +252,7 @@ class ParamProcessor final { // Generated modules by this visitor is not included V3StringSet m_allModuleNames; - typedef std::pair ValueMapValue; + using ValueMapValue = std::pair; std::map m_valueMap; // Hash of node hash to (param value, name) int m_nextValue = 1; // Next value to use in m_valueMap @@ -261,7 +261,7 @@ class ParamProcessor final { // Database to get protect-lib wrapper that matches parameters in hierarchical Verilation ParameterizedHierBlocks m_hierBlocks; // Default parameter values key:parameter name, value:default value (can be nullptr) - typedef std::map DefaultValueMap; + using DefaultValueMap = std::map; // Default parameter values of hierarchical blocks std::map m_defaultParameterValues; diff --git a/src/V3ParseSym.h b/src/V3ParseSym.h index 17ab5de56..e73ede79f 100644 --- a/src/V3ParseSym.h +++ b/src/V3ParseSym.h @@ -32,7 +32,7 @@ class V3ParseSym final { // TYPES - typedef std::vector SymStack; + using SymStack = std::vector; private: // MEMBERS diff --git a/src/V3Partition.cpp b/src/V3Partition.cpp index fe3e761f0..3d443f4ca 100644 --- a/src/V3Partition.cpp +++ b/src/V3Partition.cpp @@ -247,7 +247,7 @@ private: // MEMBERS V3Graph m_graph; // A graph V3GraphVertex* m_vx[50]; // All vertices within the graph - typedef std::unordered_map CpMap; + using CpMap = std::unordered_map; CpMap m_cp; // Vertex-to-CP map CpMap m_seen; // Set of vertices we've seen @@ -353,7 +353,7 @@ public: class LogicMTask final : public AbstractLogicMTask { public: // TYPES - typedef std::list VxList; + using VxList = std::list; struct CmpLogicMTask { bool operator()(const LogicMTask* ap, const LogicMTask* bp) const { @@ -442,7 +442,7 @@ private: // our edge with them. The SortByValueMap supports iterating over // relatives in longest-to-shortest CP order. We rely on this ordering // in more than one place. - typedef SortByValueMap EdgeSet; + using EdgeSet = SortByValueMap; std::array m_edges; public: @@ -1035,9 +1035,9 @@ private: // TODO: might get a little more speed by making this a // std::unordered_set and defining hash and equal_to functors for the // SiblingMC: - typedef std::set SibSet; - typedef std::unordered_set SibpSet; - typedef std::unordered_map MTask2Sibs; + using SibSet = std::set; + using SibpSet = std::unordered_set; + using MTask2Sibs = std::unordered_map; // New CP information for mtaskp reflecting an upcoming merge struct NewCp { @@ -1756,10 +1756,10 @@ private: class PartFixDataHazards final { private: // TYPES - typedef std::set LogicMTaskSet; - typedef std::map TasksByRank; - typedef std::set OvvSet; - typedef std::unordered_map Olv2MTaskMap; + using LogicMTaskSet = std::set; + using TasksByRank = std::map; + using OvvSet = std::set; + using Olv2MTaskMap = std::unordered_map; // MEMBERS V3Graph* m_mtasksp; // Mtask graph @@ -2031,11 +2031,11 @@ private: uint32_t m_sandbagNumerator; // Numerator padding for est runtime uint32_t m_sandbagDenom; // Denomerator padding for est runtime - typedef std::unordered_map MTaskStateMap; + using MTaskStateMap = std::unordered_map; MTaskStateMap m_mtaskState; // State for each mtask. MTaskCmp m_mtaskCmp; // Comparison functor - typedef std::set ReadyMTasks; + using ReadyMTasks = std::set; ReadyMTasks m_ready; // MTasks ready to be assigned next; all their // // dependencies are already assigned. @@ -2449,7 +2449,7 @@ void V3Partition::go(V3Graph* mtasksp) { // order though, otherwise we break CmpLogicMTask for still-existing // EdgeSet's that haven't destructed yet. { - typedef std::set SortedMTaskSet; + using SortedMTaskSet = std::set; SortedMTaskSet sorted; for (V3GraphVertex* itp = mtasksp->verticesBeginp(); itp; itp = itp->verticesNextp()) { LogicMTask* mtaskp = dynamic_cast(itp); diff --git a/src/V3Partition.h b/src/V3Partition.h index f8fc86b10..12f58f830 100644 --- a/src/V3Partition.h +++ b/src/V3Partition.h @@ -26,7 +26,7 @@ #include class LogicMTask; -typedef std::unordered_map Vx2MTaskMap; +using Vx2MTaskMap = std::unordered_map; //************************************************************************* /// V3Partition takes the fine-grained logic graph from V3Order and diff --git a/src/V3PartitionGraph.h b/src/V3PartitionGraph.h index d824950ce..8bc4baf3f 100644 --- a/src/V3PartitionGraph.h +++ b/src/V3PartitionGraph.h @@ -40,7 +40,7 @@ public: class AbstractLogicMTask VL_NOT_FINAL : public AbstractMTask { public: // TYPES - typedef std::list VxList; + using VxList = std::list; // CONSTRUCTORS AbstractLogicMTask(V3Graph* graphp) : AbstractMTask{graphp} {} diff --git a/src/V3PreProc.cpp b/src/V3PreProc.cpp index d2cb6814f..c71070add 100644 --- a/src/V3PreProc.cpp +++ b/src/V3PreProc.cpp @@ -108,8 +108,8 @@ public: class V3PreProcImp final : public V3PreProc { public: // TYPES - typedef std::map DefinesMap; - typedef VInFilter::StrList StrList; + using DefinesMap = std::map; + using StrList = VInFilter::StrList; // debug() -> see V3PreShellImp::debug; use --debugi-V3PreShell diff --git a/src/V3Randomize.cpp b/src/V3Randomize.cpp index 3fb49c16f..1289b5a0d 100644 --- a/src/V3Randomize.cpp +++ b/src/V3Randomize.cpp @@ -39,8 +39,8 @@ private: // AstClass::user1() -> bool. Set true to indicate needs randomize processing AstUser1InUse m_inuser1; - typedef std::unordered_set DerivedSet; - typedef std::unordered_map BaseToDerivedMap; + using DerivedSet = std::unordered_set; + using BaseToDerivedMap = std::unordered_map; BaseToDerivedMap m_baseToDerivedMap; // Mapping from base classes to classes that extend them diff --git a/src/V3Scope.cpp b/src/V3Scope.cpp index c7188841f..5363f3c6a 100644 --- a/src/V3Scope.cpp +++ b/src/V3Scope.cpp @@ -46,7 +46,7 @@ private: // TYPES // These cannot be unordered unless make a specialized hashing pair (gcc-8) - typedef std::map, AstVarScope*> VarScopeMap; + using VarScopeMap = std::map, AstVarScope*>; // STATE, inside processing a single module AstNodeModule* m_modp = nullptr; // Current module diff --git a/src/V3Scoreboard.h b/src/V3Scoreboard.h index 3584bf4a8..926453bc3 100644 --- a/src/V3Scoreboard.h +++ b/src/V3Scoreboard.h @@ -44,8 +44,8 @@ template KeySet; - typedef std::map Val2Keys; + using KeySet = std::set; + using Val2Keys = std::map; // MEMBERS std::unordered_map m_keys; // Map each key to its value. Not sorted. @@ -58,11 +58,11 @@ public: class const_iterator VL_NOT_FINAL { // TYPES public: - typedef const_iterator value_type; - typedef const_iterator reference; // See comment on operator*() - typedef void pointer; - typedef std::ptrdiff_t difference_type; - typedef std::bidirectional_iterator_tag iterator_category; + using value_type = const_iterator; + using reference = const_iterator; // See comment on operator*() + using pointer = void; + using difference_type = std::ptrdiff_t; + using iterator_category = std::bidirectional_iterator_tag; protected: friend class SortByValueMap; @@ -195,8 +195,8 @@ public: class iterator final : public const_iterator { public: // TYPES - typedef iterator value_type; - typedef iterator reference; + using value_type = iterator; + using reference = iterator; // pointer, difference_type, and iterator_category inherit from // const_iterator @@ -222,8 +222,8 @@ public: } }; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; + using reverse_iterator = std::reverse_iterator; + using const_reverse_iterator = std::reverse_iterator; // METHODS private: @@ -359,8 +359,8 @@ private: return cmp.operator()(*ap, *bp); } }; - typedef SortByValueMap SortedMap; - typedef T_Score (*UserScoreFnp)(const T_Elem*); + using SortedMap = SortByValueMap; + using UserScoreFnp = T_Score (*)(const T_Elem*); // MEMBERS std::unordered_set m_unknown; // Elements with unknown scores diff --git a/src/V3SenTree.h b/src/V3SenTree.h index a04d68b2f..501157652 100644 --- a/src/V3SenTree.h +++ b/src/V3SenTree.h @@ -48,7 +48,7 @@ private: }; // MEMBERS - typedef std::unordered_set Set; + using Set = std::unordered_set; Set m_trees; // Set of sensitive blocks, for folding. public: diff --git a/src/V3Simulate.h b/src/V3Simulate.h index 0112b8673..3fa35da56 100644 --- a/src/V3Simulate.h +++ b/src/V3Simulate.h @@ -60,8 +60,8 @@ public: ~SimStackNode() = default; }; -typedef std::deque ConstDeque; -typedef std::unordered_map ConstPile; +using ConstDeque = std::deque; +using ConstPile = std::unordered_map; class SimulateVisitor VL_NOT_FINAL : public AstNVisitor { // Simulate a node tree, returning value of variables diff --git a/src/V3Split.cpp b/src/V3Split.cpp index af5b9921b..4c8b1a60d 100644 --- a/src/V3Split.cpp +++ b/src/V3Split.cpp @@ -615,8 +615,8 @@ private: VL_UNCOPYABLE(ReorderVisitor); }; -typedef std::unordered_set ColorSet; -typedef std::vector AlwaysVec; +using ColorSet = std::unordered_set; +using AlwaysVec = std::vector; class IfColorVisitor final : public AstNVisitor { // MEMBERS @@ -752,7 +752,7 @@ protected: virtual void visit(AstNodeIf* nodep) override { const ColorSet& colors = m_ifColorp->colors(nodep); - typedef std::unordered_map CloneMap; + using CloneMap = std::unordered_map; CloneMap clones; for (unsigned int color : colors) { diff --git a/src/V3SplitVar.cpp b/src/V3SplitVar.cpp index 262d15b08..435d77b46 100644 --- a/src/V3SplitVar.cpp +++ b/src/V3SplitVar.cpp @@ -285,9 +285,9 @@ public: class UnpackRefMap final { public: - typedef std::map, AstNodeComparator> MapType; - typedef MapType::iterator MapIt; - typedef MapType::value_type::second_type::iterator SetIt; + using MapType = std::map, AstNodeComparator>; + using MapIt = MapType::iterator; + using SetIt = MapType::value_type::second_type::iterator; private: MapType m_map; @@ -379,10 +379,10 @@ public: } }; -typedef std::map SplitVarRefsMap; +using SplitVarRefsMap = std::map; class SplitUnpackedVarVisitor final : public AstNVisitor, public SplitVarImpl { - typedef std::set VarSet; + using VarSet = std::set; VarSet m_foundTargetVar; UnpackRefMap m_refs; AstNodeModule* m_modp = nullptr; @@ -879,8 +879,8 @@ class PackedVarRef final { } public: - typedef std::vector::iterator iterator; - typedef std::vector::const_iterator const_iterator; + using iterator = std::vector::iterator; + using const_iterator = std::vector::const_iterator; std::vector& lhs() { UASSERT(m_dedupDone, "cannot read before dedup()"); return m_lhs; diff --git a/src/V3Stats.cpp b/src/V3Stats.cpp index f155bba1d..1f8687bc5 100644 --- a/src/V3Stats.cpp +++ b/src/V3Stats.cpp @@ -34,7 +34,7 @@ class StatsVisitor final : public AstNVisitor { private: // NODE STATE/TYPES - typedef std::map NameMap; // Number of times a name appears + using NameMap = std::map; // Number of times a name appears // STATE string m_stage; // Name of the stage we are scanning diff --git a/src/V3StatsReport.cpp b/src/V3StatsReport.cpp index 0c5d4b43f..a57aacab2 100644 --- a/src/V3StatsReport.cpp +++ b/src/V3StatsReport.cpp @@ -32,7 +32,7 @@ class StatsReport final { // TYPES - typedef std::vector StatColl; + using StatColl = std::vector; // STATE std::ofstream& os; ///< Output stream diff --git a/src/V3String.h b/src/V3String.h index b5e14cb3a..e151fd758 100644 --- a/src/V3String.h +++ b/src/V3String.h @@ -193,7 +193,7 @@ class VSpellCheck final { static constexpr unsigned NUM_CANDIDATE_LIMIT = 10000; // Avoid searching huge netlists static constexpr unsigned LENGTH_LIMIT = 100; // Maximum string length to search // TYPES - typedef unsigned int EditDistance; + using EditDistance = unsigned int; // MEMBERS std::vector m_candidates; // Strings we try to match public: diff --git a/src/V3SymTable.h b/src/V3SymTable.h index 304a2f882..12c1e1ba3 100644 --- a/src/V3SymTable.h +++ b/src/V3SymTable.h @@ -36,12 +36,12 @@ class VSymEnt; //###################################################################### // Symbol table -typedef std::unordered_set VSymConstMap; +using VSymConstMap = std::unordered_set; class VSymEnt final { // Symbol table that can have a "superior" table for resolving upper references // MEMBERS - typedef std::multimap IdNameMap; + using IdNameMap = std::multimap; IdNameMap m_idNameMap; // Hash of variables by name AstNode* m_nodep; // Node that entry belongs to VSymEnt* m_fallbackp; // Table "above" this one in name scope, for fallback resolution @@ -60,7 +60,7 @@ class VSymEnt final { static constexpr int debug() { return 0; } // NOT runtime, too hot of a function #endif public: - typedef IdNameMap::const_iterator const_iterator; + using const_iterator = IdNameMap::const_iterator; const_iterator begin() const { return m_idNameMap.begin(); } const_iterator end() const { return m_idNameMap.end(); } @@ -280,7 +280,7 @@ public: class VSymGraph final { // Collection of symbol tables // TYPES - typedef std::vector SymStack; + using SymStack = std::vector; // MEMBERS VSymEnt* m_symRootp; // Root symbol table diff --git a/src/V3TSP.cpp b/src/V3TSP.cpp index ea33d5236..afd103a27 100644 --- a/src/V3TSP.cpp +++ b/src/V3TSP.cpp @@ -71,7 +71,7 @@ private: template class TspGraphTmpl : public V3Graph { public: // TYPES - typedef TspVertexTmpl Vertex; + using Vertex = TspVertexTmpl; // MEMBERS std::unordered_map m_vertices; // T_Key to Vertex lookup map @@ -151,7 +151,7 @@ public: std::unordered_set visited_set; EdgeCmp cmp; - typedef std::set PendingEdgeSet; + using PendingEdgeSet = std::set; // This is the set of pending edges from visited to unvisited // nodes. PendingEdgeSet pendingEdges(cmp); @@ -221,7 +221,7 @@ public: std::list odds = keysToVertexList(oddKeys); std::unordered_set unmatchedOdds; - typedef typename std::list::iterator VertexListIt; + using VertexListIt = typename std::list::iterator; for (VertexListIt it = odds.begin(); it != odds.end(); ++it) { outp->addVertex((*it)->key()); unmatchedOdds.insert(*it); @@ -246,7 +246,7 @@ public: // bidir edge will collide in the pendingEdges set here, but this // is OK, we'll ignore the direction on the edge anyway. EdgeCmp cmp; - typedef std::set PendingEdgeSet; + using PendingEdgeSet = std::set; PendingEdgeSet pendingEdges(cmp); for (VertexListIt it = odds.begin(); it != odds.end(); ++it) { @@ -408,7 +408,7 @@ void V3TSP::tspSort(const V3TSP::StateVec& states, V3TSP::StateVec* resultp) { } // Build the initial graph from the starting state set. - typedef TspGraphTmpl Graph; + using Graph = TspGraphTmpl; Graph graph; for (const auto& state : states) graph.addVertex(state); for (V3TSP::StateVec::const_iterator it = states.begin(); it != states.end(); ++it) { @@ -613,7 +613,7 @@ void V3TSP::selfTestStates() { } void V3TSP::selfTestString() { - typedef TspGraphTmpl Graph; + using Graph = TspGraphTmpl; Graph graph; graph.addVertex("0"); graph.addVertex("1"); diff --git a/src/V3TSP.h b/src/V3TSP.h index cb81103f7..956fb97d2 100644 --- a/src/V3TSP.h +++ b/src/V3TSP.h @@ -43,7 +43,7 @@ public: virtual ~TspStateBase() = default; }; -typedef std::vector StateVec; +using StateVec = std::vector; // Given an unsorted set of TspState's, sort them to minimize // the transition cost for walking the sorted list. diff --git a/src/V3Task.cpp b/src/V3Task.cpp index 02f1136b7..7c8e6c76c 100644 --- a/src/V3Task.cpp +++ b/src/V3Task.cpp @@ -103,8 +103,8 @@ private: AstUser4InUse m_inuser4; // TYPES - typedef std::map, AstVarScope*> VarToScopeMap; - typedef std::unordered_map FuncToClassMap; + using VarToScopeMap = std::map, AstVarScope*>; + using FuncToClassMap = std::unordered_map; // MEMBERS VarToScopeMap m_varToScopeMap; // Map for Var -> VarScope mappings FuncToClassMap m_funcToClassMap; // Map for ctor func -> class @@ -385,7 +385,7 @@ private: IM_AFTER, // Pointing at last inserted stmt, insert after IM_WHILE_PRECOND // Pointing to for loop, add to body end }; - typedef std::map> DpiNames; + using DpiNames = std::map>; // STATE TaskStateVisitor* m_statep; // Common state between visitors diff --git a/src/V3Task.h b/src/V3Task.h index 03de4ea32..162801f16 100644 --- a/src/V3Task.h +++ b/src/V3Task.h @@ -27,8 +27,8 @@ //============================================================================ -typedef std::pair V3TaskConnect; // [port, pin-connects-to] -typedef std::vector V3TaskConnects; // [ [port, pin-connects-to] ... ] +using V3TaskConnect = std::pair; // [port, pin-connects-to] +using V3TaskConnects = std::vector; // [ [port, pin-connects-to] ... ] //============================================================================ diff --git a/src/V3Trace.cpp b/src/V3Trace.cpp index bcbd89506..49ee14933 100644 --- a/src/V3Trace.cpp +++ b/src/V3Trace.cpp @@ -184,9 +184,9 @@ private: VDouble0 m_statUniqCodes; // Statistic tracking // All activity numbers applying to a given trace - typedef std::set ActCodeSet; + using ActCodeSet = std::set; // For activity set, what traces apply - typedef std::multimap TraceVec; + using TraceVec = std::multimap; // METHODS VL_DEBUG_FUNC; // Declare debug() diff --git a/src/V3Tristate.cpp b/src/V3Tristate.cpp index b834c47ff..a4b7515d7 100644 --- a/src/V3Tristate.cpp +++ b/src/V3Tristate.cpp @@ -117,7 +117,7 @@ class TristateGraph final { // TYPES public: - typedef std::vector VarVec; + using VarVec = std::vector; private: // MEMBERS @@ -328,8 +328,8 @@ class TristateVisitor final : public TristateBaseVisitor { AstUser5InUse m_inuser5; // TYPES - typedef std::vector RefVec; - typedef std::unordered_map VarMap; + using RefVec = std::vector; + using VarMap = std::unordered_map; enum : uint8_t { U2_GRAPHING = 1, // bit[0] if did m_graphing visit U2_NONGRAPH = 2, // bit[1] if did !m_graphing visit diff --git a/src/V3Waiver.h b/src/V3Waiver.h index 8be22fbec..cff1df336 100644 --- a/src/V3Waiver.h +++ b/src/V3Waiver.h @@ -24,7 +24,7 @@ class V3Waiver final { // TYPES - typedef std::vector WaiverList; + using WaiverList = std::vector; static WaiverList s_waiverList; public: diff --git a/src/V3Width.cpp b/src/V3Width.cpp index 21cc16c4c..babc99a49 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -198,8 +198,8 @@ public: class WidthVisitor final : public AstNVisitor { private: // TYPES - typedef std::map, AstVar*> TableMap; - typedef std::map PatVecMap; + using TableMap = std::map, AstVar*>; + using PatVecMap = std::map; // STATE WidthVP* m_vup = nullptr; // Current node state diff --git a/src/VlcOptions.h b/src/VlcOptions.h index 29b88f1e1..fc76f4b76 100644 --- a/src/VlcOptions.h +++ b/src/VlcOptions.h @@ -29,7 +29,7 @@ //###################################################################### // V3Options - Command line options -typedef std::set VlStringSet; +using VlStringSet = std::set; class VlcOptions final { // MEMBERS (general options) diff --git a/src/VlcPoint.h b/src/VlcPoint.h index f05dfecb2..8be685d2c 100644 --- a/src/VlcPoint.h +++ b/src/VlcPoint.h @@ -93,15 +93,15 @@ public: class VlcPoints final { private: // MEMBERS - typedef std::map NameMap; // Sorted by name (ordered) + using NameMap = std::map; // Sorted by name (ordered) NameMap m_nameMap; //< Name to point-number std::vector m_points; //< List of all points vluint64_t m_numPoints = 0; //< Total unique points public: // ITERATORS - typedef NameMap ByName; - typedef ByName::iterator iterator; + using ByName = NameMap; + using iterator = ByName::iterator; ByName::iterator begin() { return m_nameMap.begin(); } ByName::iterator end() { return m_nameMap.end(); } diff --git a/src/VlcSource.h b/src/VlcSource.h index 7cb274f35..f4ac07a6c 100644 --- a/src/VlcSource.h +++ b/src/VlcSource.h @@ -60,8 +60,8 @@ public: class VlcSource final { public: // TYPES - typedef std::map ColumnMap; // Map of {column} - typedef std::map LinenoMap; // Map of {lineno}{column} + using ColumnMap = std::map; // Map of {column} + using LinenoMap = std::map; // Map of {lineno}{column} private: // MEMBERS @@ -101,7 +101,7 @@ public: class VlcSources final { public: // TYPES - typedef std::map NameMap; + using NameMap = std::map; private: // MEMBERS @@ -109,7 +109,7 @@ private: public: // ITERATORS - typedef NameMap::iterator iterator; + using iterator = NameMap::iterator; NameMap::iterator begin() { return m_sources.begin(); } NameMap::iterator end() { return m_sources.end(); } diff --git a/src/VlcTest.h b/src/VlcTest.h index e2aa8adc0..7aa4cb77a 100644 --- a/src/VlcTest.h +++ b/src/VlcTest.h @@ -87,7 +87,7 @@ public: class VlcTests final { public: // TYPES - typedef std::vector ByName; + using ByName = std::vector; private: // MEMBERS @@ -95,7 +95,7 @@ private: public: // ITERATORS - typedef ByName::iterator iterator; + using iterator = ByName::iterator; ByName::iterator begin() { return m_tests.begin(); } ByName::iterator end() { return m_tests.end(); } diff --git a/src/config_build.h.in b/src/config_build.h.in index a43093249..528066ae1 100644 --- a/src/config_build.h.in +++ b/src/config_build.h.in @@ -67,7 +67,7 @@ #include // Avoid needing std:: prefixes on some very common items -typedef std::string string; +using string = std::string; using std::cout; using std::endl; using std::make_pair;