Add optional nullstr argument to log_id()

Signed-off-by: Clifford Wolf <[email protected]>
This commit is contained in:
Clifford Wolf
2019-01-15 11:06:48 +01:00
parent 6c5049f016
commit e70ebe557c
+3 -1
View File
@@ -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_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);
}