From: Clifford Wolf Date: Sun, 13 Jan 2019 16:00:58 +0000 (+0100) Subject: Add optional nullstr argument to log_id() X-Git-Tag: yosys-0.9~329 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e70ebe557cd02f52f32a297fa63008dba25e4f6a;p=yosys.git Add optional nullstr argument to log_id() Signed-off-by: Clifford Wolf --- diff --git a/kernel/log.h b/kernel/log.h index e1f54a197..759939025 100644 --- a/kernel/log.h +++ b/kernel/log.h @@ -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 static inline const char *log_id(T *obj) { +template static inline const char *log_id(T *obj, const char *nullstr = nullptr) { + if (nullstr && obj == nullptr) + return nullstr; return log_id(obj->name); }