diff options
-rw-r--r-- | common/nextpnr.cc | 2 | ||||
-rw-r--r-- | common/nextpnr.h | 13 | ||||
-rw-r--r-- | common/pycontainers.h | 10 | ||||
-rw-r--r-- | common/pywrappers.h | 6 |
4 files changed, 5 insertions, 26 deletions
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<BaseCtx *> 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<BaseCtx *> 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<std::string, int>; idstring_idx_to_str = new std::vector<const std::string *>; 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 <typename T, typename value_conv> struct map_wrapper x.base[PythonConversion::string_converter<K>().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 <typename T> struct map_wrapper_uptr x.base[PythonConversion::string_converter<K>().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 <typename T> struct conv_to_str template <typename T> struct deref_and_wrap { - inline ContextualWrapper<T&> operator()(Context *ctx, T *x) + inline ContextualWrapper<T &> operator()(Context *ctx, T *x) { if (x == nullptr) throw bad_wrap(); - return ContextualWrapper<T&>(ctx, *x); + return ContextualWrapper<T &>(ctx, *x); } using arg_type = T *; - using ret_type = ContextualWrapper<T&>; + using ret_type = ContextualWrapper<T &>; }; // Function wrapper |