diff options
author | Clifford Wolf <clifford@clifford.at> | 2013-03-01 08:57:58 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2013-03-01 09:01:49 +0100 |
commit | 1bc0f04789a8aeede49db5cdda298bc828a19f7f (patch) | |
tree | c3ea2839965eb5716f15ce084639d57fa9c94e0b /kernel/rtlil.h | |
parent | 8a6b0a35207578342c10113b29ca3a303092c37a (diff) | |
download | yosys-1bc0f04789a8aeede49db5cdda298bc828a19f7f.tar.gz yosys-1bc0f04789a8aeede49db5cdda298bc828a19f7f.tar.bz2 yosys-1bc0f04789a8aeede49db5cdda298bc828a19f7f.zip |
Added id2cstr API
Diffstat (limited to 'kernel/rtlil.h')
-rw-r--r-- | kernel/rtlil.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 15fec2690..b5338a33c 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -110,6 +110,13 @@ namespace RTLIL return str; } + static const char *id2cstr(std::string str) __attribute__((unused)); + static const char *id2cstr(std::string str) { + if (str.size() > 1 && str[0] == '\\' && str[1] != '$') + return str.c_str() + 1; + return str.c_str(); + } + static IdString new_id(std::string file, int line, std::string func) __attribute__((unused)); static IdString new_id(std::string file, int line, std::string func) { std::string str = "$auto$"; |