mirror of https://github.com/YosysHQ/yosys.git
Add optional nullstr argument to log_id()
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
parent
6c5049f016
commit
e70ebe557c
|
@ -94,7 +94,9 @@ const char *log_signal(const RTLIL::SigSpec &sig, bool autoint = true);
|
||||||
const char *log_const(const RTLIL::Const &value, bool autoint = true);
|
const char *log_const(const RTLIL::Const &value, bool autoint = true);
|
||||||
const char *log_id(RTLIL::IdString id);
|
const char *log_id(RTLIL::IdString id);
|
||||||
|
|
||||||
template<typename T> static inline const char *log_id(T *obj) {
|
template<typename T> static inline const char *log_id(T *obj, const char *nullstr = nullptr) {
|
||||||
|
if (nullstr && obj == nullptr)
|
||||||
|
return nullstr;
|
||||||
return log_id(obj->name);
|
return log_id(obj->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue