From e70ebe557cd02f52f32a297fa63008dba25e4f6a Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 13 Jan 2019 17:00:58 +0100 Subject: [PATCH] Add optional nullstr argument to log_id() Signed-off-by: Clifford Wolf --- kernel/log.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); } -- 2.30.2