From 8c7c6c594aab1b7ab5789f55ccc625d7abf555e6 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 27 Sep 2025 20:51:37 -0400 Subject: [PATCH] Internals: Rename VStringSet/VStringList. No functional change. --- src/V3EmitMk.cpp | 8 ++++---- src/V3File.cpp | 2 +- src/V3HierBlock.cpp | 12 ++++++------ src/V3HierBlock.h | 4 ++-- src/V3Options.cpp | 2 +- src/V3Options.h | 35 ++++++++++++++++------------------- src/V3Param.cpp | 2 +- src/V3String.h | 4 ++++ src/Verilator.cpp | 2 +- 9 files changed, 36 insertions(+), 35 deletions(-) diff --git a/src/V3EmitMk.cpp b/src/V3EmitMk.cpp index 004018326..bf73ff12d 100644 --- a/src/V3EmitMk.cpp +++ b/src/V3EmitMk.cpp @@ -686,20 +686,20 @@ public: of.puts("\t-DVM_SOLVER_DEFAULT='\"" + V3OutFormatter::quoteNameControls(solver) + "\"' \\\n"); if (!v3Global.opt.libCreate().empty()) of.puts("\t-fPIC \\\n"); - const V3StringList& cFlags = v3Global.opt.cFlags(); + const VStringList& cFlags = v3Global.opt.cFlags(); for (const string& i : cFlags) of.puts(" " + i + " \\\n"); of.puts("\n"); of.puts("# User LDLIBS (from -LDFLAGS on Verilator command line)\n"); of.puts("VM_USER_LDLIBS = \\\n"); - const V3StringList& ldLibs = v3Global.opt.ldLibs(); + const VStringList& ldLibs = v3Global.opt.ldLibs(); for (const string& i : ldLibs) of.puts(" " + i + " \\\n"); of.puts("\n"); - V3StringSet dirs; + VStringSet dirs; of.puts("# User .cpp files (from .cpp's on Verilator command line)\n"); of.puts("VM_USER_CLASSES = \\\n"); - const V3StringSet& cppFiles = v3Global.opt.cppFiles(); + const VStringSet& cppFiles = v3Global.opt.cppFiles(); for (const auto& cppfile : cppFiles) { of.puts(" " + V3Os::filenameNonDirExt(cppfile) + " \\\n"); const string dir diff --git a/src/V3File.cpp b/src/V3File.cpp index 5b6f40e98..464bd0e86 100644 --- a/src/V3File.cpp +++ b/src/V3File.cpp @@ -978,7 +978,7 @@ V3OutFile::~V3OutFile() { } void V3OutFile::putsForceIncs() { - const V3StringList& forceIncs = v3Global.opt.forceIncs(); + const VStringList& forceIncs = v3Global.opt.forceIncs(); for (const string& i : forceIncs) puts("#include \"" + i + "\"\n"); } diff --git a/src/V3HierBlock.cpp b/src/V3HierBlock.cpp index ceb37ce1c..038ec1ae3 100644 --- a/src/V3HierBlock.cpp +++ b/src/V3HierBlock.cpp @@ -158,8 +158,8 @@ V3HierBlock::StrGParams V3HierBlock::stringifyParams(const V3HierBlockParams::GP return strParams; } -V3StringList V3HierBlock::commandArgs(bool forCMake) const { - V3StringList opts; +VStringList V3HierBlock::commandArgs(bool forCMake) const { + VStringList opts; const string prefix = hierPrefix(); if (!forCMake) { opts.push_back(" --prefix " + prefix); @@ -200,8 +200,8 @@ V3StringList V3HierBlock::commandArgs(bool forCMake) const { return opts; } -V3StringList V3HierBlock::hierBlockArgs() const { - V3StringList opts; +VStringList V3HierBlock::hierBlockArgs() const { + VStringList opts; const StrGParams gparamsStr = stringifyParams(params().gparams(), false); opts.push_back("--hierarchical-block "); string s = modp()->origName(); // origName @@ -260,7 +260,7 @@ void V3HierBlock::writeCommandArgsFile(bool forCMake) const { *of << "-Mdir " << v3Global.opt.makeDir() << "/" << hierPrefix() << " \n"; } V3HierWriteCommonInputs(this, of.get(), forCMake); - const V3StringList& commandOpts = commandArgs(false); + const VStringList& commandOpts = commandArgs(false); for (const string& opt : commandOpts) *of << opt << "\n"; *of << hierBlockArgs().front() << "\n"; for (const V3HierBlock* const hierblockp : m_children) { @@ -471,7 +471,7 @@ void V3HierBlockPlan::writeCommandArgsFiles(bool forCMake) const { } V3HierWriteCommonInputs(nullptr, of.get(), forCMake); if (!forCMake) { - const V3StringSet& cppFiles = v3Global.opt.cppFiles(); + const VStringSet& cppFiles = v3Global.opt.cppFiles(); for (const string& i : cppFiles) *of << i << "\n"; *of << "--top-module " << v3Global.rootp()->topModulep()->name() << "\n"; *of << "--prefix " << v3Global.opt.prefix() << "\n"; diff --git a/src/V3HierBlock.h b/src/V3HierBlock.h index d479a5483..c02240dab 100644 --- a/src/V3HierBlock.h +++ b/src/V3HierBlock.h @@ -102,8 +102,8 @@ public: const AstNodeModule* modp() const { return m_modp; } // For emitting Makefile and CMakeLists.txt - V3StringList commandArgs(bool forCMake) const VL_MT_DISABLED; - V3StringList hierBlockArgs() const VL_MT_DISABLED; + VStringList commandArgs(bool forCMake) const VL_MT_DISABLED; + VStringList hierBlockArgs() const VL_MT_DISABLED; string hierPrefix() const VL_MT_DISABLED; string hierSomeFilename(bool withDir, const char* prefix, const char* suffix) const VL_MT_DISABLED; diff --git a/src/V3Options.cpp b/src/V3Options.cpp index a6a7fd449..bb1a3ac37 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -151,7 +151,7 @@ VTimescale::VTimescale(const string& value, bool& badr) // Parse "--hierarchical-block orig_name,mangled_name,param0_name,param0_value,... " option. // The format of value is as same as -G option. (can be string literal surrounded by ") V3HierarchicalBlockOption::V3HierarchicalBlockOption(const string& opts) { - V3StringList vals; + VStringList vals; bool inStr = false; string cur; static const string hierBlock("--hierarchical-block"); diff --git a/src/V3Options.h b/src/V3Options.h index 58255fc93..d57dce68e 100644 --- a/src/V3Options.h +++ b/src/V3Options.h @@ -186,9 +186,6 @@ constexpr bool operator==(const TraceFormat& lhs, const TraceFormat& rhs) { constexpr bool operator==(const TraceFormat& lhs, TraceFormat::en rhs) { return lhs.m_e == rhs; } constexpr bool operator==(TraceFormat::en lhs, const TraceFormat& rhs) { return lhs == rhs.m_e; } -using V3StringList = std::vector; -using V3StringSet = std::set; - // ###################################################################### // Information given by --hierarchical-block option @@ -227,23 +224,23 @@ private: V3OptionsImp* m_impp; // Slow hidden options // clang-format off - V3StringSet m_cppFiles; // argument: C++ files to link against - V3StringList m_cFlags; // argument: user CFLAGS - V3StringList m_ldLibs; // argument: user LDFLAGS - V3StringList m_makeFlags; // argument: user MAKEFLAGS - V3StringSet m_compilerIncludes; // argument: user --compiler-include - V3StringSet m_futures; // argument: -Wfuture- list - V3StringSet m_future0s; // argument: -future list - V3StringSet m_future1s; // argument: -future1 list + VStringSet m_cppFiles; // argument: C++ files to link against + VStringList m_cFlags; // argument: user CFLAGS + VStringList m_ldLibs; // argument: user LDFLAGS + VStringList m_makeFlags; // argument: user MAKEFLAGS + VStringSet m_compilerIncludes; // argument: user --compiler-include + VStringSet m_futures; // argument: -Wfuture- list + VStringSet m_future0s; // argument: -future list + VStringSet m_future1s; // argument: -future1 list VFileLibSet m_libraryFiles; // argument: Verilog -v files VFileLibList m_vFiles; // argument: Verilog files to read VFileLibSet m_vltFiles; // argument: Verilator config files to read - V3StringList m_forceIncs; // argument: -FI + VStringList m_forceIncs; // argument: -FI DebugLevelMap m_debugLevel; // argument: --debugi- DebugLevelMap m_dumpLevel; // argument: --dumpi- std::map m_parameters; // Parameters std::map m_hierBlocks; // main switch: --hierarchical-block - V3StringSet m_fDfgPeepholeDisabled; // argument: -f[no-]dfg-peephole- + VStringSet m_fDfgPeepholeDisabled; // argument: -f[no-]dfg-peephole- bool m_preprocOnly = false; // main switch: -E bool m_preprocResolve = false; // main switch: --preproc-resolve @@ -702,15 +699,15 @@ public: string xInitial() const { return m_xInitial; } string xmlOutput() const { return m_xmlOutput; } - const V3StringSet& cppFiles() const { return m_cppFiles; } - const V3StringList& cFlags() const { return m_cFlags; } - const V3StringSet& compilerIncludes() const { return m_compilerIncludes; } - const V3StringList& ldLibs() const { return m_ldLibs; } - const V3StringList& makeFlags() const { return m_makeFlags; } + const VStringSet& cppFiles() const { return m_cppFiles; } + const VStringList& cFlags() const { return m_cFlags; } + const VStringSet& compilerIncludes() const { return m_compilerIncludes; } + const VStringList& ldLibs() const { return m_ldLibs; } + const VStringList& makeFlags() const { return m_makeFlags; } const VFileLibSet& libraryFiles() const { return m_libraryFiles; } const VFileLibList& vFiles() const { return m_vFiles; } const VFileLibSet& vltFiles() const { return m_vltFiles; } - const V3StringList& forceIncs() const { return m_forceIncs; } + const VStringList& forceIncs() const { return m_forceIncs; } bool hasParameter(const string& name); string parameter(const string& name); diff --git a/src/V3Param.cpp b/src/V3Param.cpp index e61e052dc..df3013a15 100644 --- a/src/V3Param.cpp +++ b/src/V3Param.cpp @@ -265,7 +265,7 @@ class ParamProcessor final { // All module names that are loaded from source code // Generated modules by this visitor is not included - V3StringSet m_allModuleNames; + VStringSet m_allModuleNames; CloneMap m_originalParams; // Map between parameters of copied parameteized classes and their // original nodes diff --git a/src/V3String.h b/src/V3String.h index a8d55ea01..874e732e8 100644 --- a/src/V3String.h +++ b/src/V3String.h @@ -24,12 +24,16 @@ #include #include +#include #include #include #include #include #include +using VStringList = std::vector; +using VStringSet = std::set; + //###################################################################### // Global string-related functions diff --git a/src/Verilator.cpp b/src/Verilator.cpp index 3b82360b7..b1947f8d8 100644 --- a/src/Verilator.cpp +++ b/src/Verilator.cpp @@ -797,7 +797,7 @@ static bool verilate(const string& argString) { } static string buildMakeCmd(const string& makefile, const string& target) { - const V3StringList& makeFlags = v3Global.opt.makeFlags(); + const VStringList& makeFlags = v3Global.opt.makeFlags(); const int jobs = v3Global.opt.buildJobs(); UASSERT(jobs >= 0, "-j option parser in V3Options.cpp filters out negative value");