diff --git a/common/nextpnr.cc b/common/nextpnr.cc index a197eaff..3861e5fe 100644 --- a/common/nextpnr.cc +++ b/common/nextpnr.cc @@ -27,8 +27,6 @@ assertion_failure::assertion_failure(std::string msg, std::string expr_str, std: { } -std::unordered_set IdString::global_ctx; - void IdString::set(const BaseCtx *ctx, const std::string &s) { auto it = ctx->idstring_str_to_idx->find(s); diff --git a/common/nextpnr.h b/common/nextpnr.h index 6a45875b..ec0c2f9f 100644 --- a/common/nextpnr.h +++ b/common/nextpnr.h @@ -118,16 +118,6 @@ struct IdString bool operator!=(const IdString &other) const { return index != other.index; } bool empty() const { return index == 0; } - - // --- deprecated old API --- - - static std::unordered_set global_ctx; - - NPNR_DEPRECATED const std::string &global_str() const - { - assert(global_ctx.size() == 1); - return str(*global_ctx.begin()); - } }; NEXTPNR_NAMESPACE_END @@ -252,8 +242,6 @@ struct BaseCtx BaseCtx() { - IdString::global_ctx.insert(this); - idstring_str_to_idx = new std::unordered_map; idstring_idx_to_str = new std::vector; IdString::initialize_add(this, "", 0); @@ -262,7 +250,6 @@ struct BaseCtx ~BaseCtx() { - IdString::global_ctx.erase(this); delete idstring_str_to_idx; delete idstring_idx_to_str; } diff --git a/common/pycontainers.h b/common/pycontainers.h index 260a9dd6..f4251558 100644 --- a/common/pycontainers.h +++ b/common/pycontainers.h @@ -276,10 +276,7 @@ template struct map_wrapper x.base[PythonConversion::string_converter().from_str(x.ctx, i)] = v; } - static size_t len(wrapped_map &x) - { - return x.base.size(); - } + static size_t len(wrapped_map &x) { return x.base.size(); } static void del(T const &x, std::string const &i) { @@ -399,10 +396,7 @@ template struct map_wrapper_uptr x.base[PythonConversion::string_converter().from_str(x.ctx, i)] = typename T::mapped_type(v); } - static size_t len(wrapped_map &x) - { - return x.base.size(); - } + static size_t len(wrapped_map &x) { return x.base.size(); } static void del(T const &x, std::string const &i) { diff --git a/common/pywrappers.h b/common/pywrappers.h index 0643eb0a..be274aad 100644 --- a/common/pywrappers.h +++ b/common/pywrappers.h @@ -129,15 +129,15 @@ template struct conv_to_str template struct deref_and_wrap { - inline ContextualWrapper operator()(Context *ctx, T *x) + inline ContextualWrapper operator()(Context *ctx, T *x) { if (x == nullptr) throw bad_wrap(); - return ContextualWrapper(ctx, *x); + return ContextualWrapper(ctx, *x); } using arg_type = T *; - using ret_type = ContextualWrapper; + using ret_type = ContextualWrapper; }; // Function wrapper