summaryrefslogtreecommitdiff
path: root/kernel/log.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-08-02 15:44:10 +0200
committerClifford Wolf <clifford@clifford.at>2014-08-02 15:44:10 +0200
commite590ffc84dac1cb1ea833c5e7a71e958b63f7352 (patch)
tree8f70383c1f30a3655b800a14cac24e8e88809ced /kernel/log.cc
parent8fd1c269ac7322f21408c1f99e7e4c275789c056 (diff)
Improvements in new RTLIL::IdString implementation
Diffstat (limited to 'kernel/log.cc')
-rw-r--r--kernel/log.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/log.cc b/kernel/log.cc
index 1595596a..f67d64c2 100644
--- a/kernel/log.cc
+++ b/kernel/log.cc
@@ -205,11 +205,11 @@ const char *log_signal(const RTLIL::SigSpec &sig, bool autoint)
const char *log_id(RTLIL::IdString str)
{
- if (str.size() > 1 && str[0] == '\\' && str[1] != '$')
- string_buf.push_back(str.substr(1));
- else
- string_buf.push_back(str.str());
- return string_buf.back().c_str();
+ const char *p = str;
+ log_assert(RTLIL::IdString::global_refcount_storage_[str.index_] > 1);
+ if (p[0] == '\\' && p[1] != '$' && p[1] != 0)
+ return p+1;
+ return p;
}
void log_cell(RTLIL::Cell *cell, std::string indent)