mirror of
https://github.com/YosysHQ/yosys
synced 2026-06-15 05:15:45 +00:00
Pass IdString by value instead of by const reference.
When IdString refcounting was expensive, it made sense to pass it by const reference instead of by value, to avoid refcount churn. Now that IdString is not refcounted, it's slightly more efficient to pass it by value.
This commit is contained in:
parent
64a933d77b
commit
46cb05c471
15 changed files with 108 additions and 108 deletions
|
|
@ -756,7 +756,7 @@ struct CxxrtlWorker {
|
|||
// 1b. Generated identifiers for internal names (beginning with `$`) start with `i_`.
|
||||
// 2. An underscore is escaped with another underscore, i.e. `__`.
|
||||
// 3. Any other non-alnum character is escaped with underscores around its lowercase hex code, e.g. `@` as `_40_`.
|
||||
std::string mangle_name(const RTLIL::IdString &name)
|
||||
std::string mangle_name(RTLIL::IdString name)
|
||||
{
|
||||
std::string mangled;
|
||||
bool first = true;
|
||||
|
|
@ -786,7 +786,7 @@ struct CxxrtlWorker {
|
|||
return mangled;
|
||||
}
|
||||
|
||||
std::string mangle_module_name(const RTLIL::IdString &name, bool is_blackbox = false)
|
||||
std::string mangle_module_name(RTLIL::IdString name, bool is_blackbox = false)
|
||||
{
|
||||
// Class namespace.
|
||||
if (is_blackbox)
|
||||
|
|
@ -794,19 +794,19 @@ struct CxxrtlWorker {
|
|||
return mangle_name(name);
|
||||
}
|
||||
|
||||
std::string mangle_memory_name(const RTLIL::IdString &name)
|
||||
std::string mangle_memory_name(RTLIL::IdString name)
|
||||
{
|
||||
// Class member namespace.
|
||||
return "memory_" + mangle_name(name);
|
||||
}
|
||||
|
||||
std::string mangle_cell_name(const RTLIL::IdString &name)
|
||||
std::string mangle_cell_name(RTLIL::IdString name)
|
||||
{
|
||||
// Class member namespace.
|
||||
return "cell_" + mangle_name(name);
|
||||
}
|
||||
|
||||
std::string mangle_wire_name(const RTLIL::IdString &name)
|
||||
std::string mangle_wire_name(RTLIL::IdString name)
|
||||
{
|
||||
// Class member namespace.
|
||||
return mangle_name(name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue