diff options
Diffstat (limited to 'common/nextpnr.h')
-rw-r--r-- | common/nextpnr.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/nextpnr.h b/common/nextpnr.h index bb55d4ff..3d9a66ca 100644 --- a/common/nextpnr.h +++ b/common/nextpnr.h @@ -437,6 +437,13 @@ struct BaseCtx const Context *getCtx() const { return reinterpret_cast<const Context *>(this); } + template<typename T> const char *nameOf(const T *obj) + { + if (obj == nullptr) + return ""; + return obj->name.c_str(getCtx()); + } + // -------------------------------------------------------------- bool allUiReload = true; |