Internals: Rename VStringSet/VStringList. No functional change.
This commit is contained in:
parent
7ef3b808ea
commit
8c7c6c594a
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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<std::string>;
|
||||
using V3StringSet = std::set<std::string>;
|
||||
|
||||
// ######################################################################
|
||||
|
||||
// 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-<srcfile/tag> <level>
|
||||
DebugLevelMap m_dumpLevel; // argument: --dumpi-<srcfile/tag> <level>
|
||||
std::map<const string, string> m_parameters; // Parameters
|
||||
std::map<const string, V3HierarchicalBlockOption> m_hierBlocks; // main switch: --hierarchical-block
|
||||
V3StringSet m_fDfgPeepholeDisabled; // argument: -f[no-]dfg-peephole-<name>
|
||||
VStringSet m_fDfgPeepholeDisabled; // argument: -f[no-]dfg-peephole-<name>
|
||||
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -24,12 +24,16 @@
|
|||
|
||||
#include <iomanip>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
using VStringList = std::vector<std::string>;
|
||||
using VStringSet = std::set<std::string>;
|
||||
|
||||
//######################################################################
|
||||
// Global string-related functions
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue