From 1bc0f04789a8aeede49db5cdda298bc828a19f7f Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Fri, 1 Mar 2013 08:57:58 +0100 Subject: Added id2cstr API --- kernel/rtlil.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'kernel/rtlil.h') diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 15fec269..b5338a33 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$"; -- cgit v1.2.3