diff options
author | myrtle <gatecat@ds0.me> | 2022-08-10 11:25:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-10 11:25:34 +0100 |
commit | 66722096edaff35f1620ebfc9acaab13ae149377 (patch) | |
tree | 8b189e44b65afabfaddb3402ab8aac544df9ba83 /common/kernel/basectx.cc | |
parent | 06ce27ed38279cfa3455e248ea2b2c773cdf6324 (diff) | |
parent | 77c82b0fbf15892b0c8222bac89564f3f024493e (diff) | |
download | nextpnr-66722096edaff35f1620ebfc9acaab13ae149377.tar.gz nextpnr-66722096edaff35f1620ebfc9acaab13ae149377.tar.bz2 nextpnr-66722096edaff35f1620ebfc9acaab13ae149377.zip |
Merge pull request #1010 from YosysHQ/gatecat/idf
refactor: id(stringf(...)) to new idf(...) helper
Diffstat (limited to 'common/kernel/basectx.cc')
-rw-r--r-- | common/kernel/basectx.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/common/kernel/basectx.cc b/common/kernel/basectx.cc index 82cdd835..777d06e1 100644 --- a/common/kernel/basectx.cc +++ b/common/kernel/basectx.cc @@ -26,6 +26,18 @@ NEXTPNR_NAMESPACE_BEGIN +IdString BaseCtx::idf(const char *fmt, ...) const +{ + std::string string; + va_list ap; + + va_start(ap, fmt); + string = vstringf(fmt, ap); + va_end(ap); + + return id(string); +} + const char *BaseCtx::nameOfBel(BelId bel) const { const Context *ctx = getCtx(); |