mirror of
https://github.com/YosysHQ/yosys
synced 2025-09-10 11:41:26 +00:00
Make ID()
macro return a reference to the underlying IdString
instead of copying it
Lambda return type deduction infers `IdString` here.
This commit is contained in:
parent
b2ccfb2d0e
commit
ddf7ba5a34
1 changed files with 1 additions and 1 deletions
|
@ -285,7 +285,7 @@ RTLIL::IdString new_id_suffix(std::string file, int line, std::string func, std:
|
|||
//
|
||||
// sed -i.orig -r 's/"\\\\([a-zA-Z0-9_]+)"/ID(\1)/g; s/"(\$[a-zA-Z0-9_]+)"/ID(\1)/g;' <filename>
|
||||
//
|
||||
#define ID(_id) ([]() { const char *p = "\\" #_id, *q = p[1] == '$' ? p+1 : p; \
|
||||
#define ID(_id) ([]() -> const RTLIL::IdString & { const char *p = "\\" #_id, *q = p[1] == '$' ? p+1 : p; \
|
||||
static const YOSYS_NAMESPACE_PREFIX RTLIL::IdString id(q); return id; })()
|
||||
namespace ID = RTLIL::ID;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue