3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-06 06:03:23 +00:00

Added id2cstr API

This commit is contained in:
Clifford Wolf 2013-03-01 08:57:58 +01:00
parent 8a6b0a3520
commit 1bc0f04789
3 changed files with 17 additions and 10 deletions

View file

@ -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$";