3838namespace tvm {
3939namespace runtime {
4040
41- #if TVM_LOG_DEBUG
41+ #if TVM_DEBUG_WITH_ABI_CHANGE
4242#define TVM_MAP_FAIL_IF_CHANGED () \
4343 ICHECK (state_marker == self->state_marker) << "Concurrent modification of the Map";
4444#else
4545#define TVM_MAP_FAIL_IF_CHANGED ()
46- #endif // TVM_LOG_DEBUG
46+ #endif // TVM_DEBUG_WITH_ABI_CHANGE
4747
4848#if (USE_FALLBACK_STL_MAP != 0)
4949
@@ -241,11 +241,11 @@ class MapNode : public Object {
241241 using pointer = KVType*;
242242 using reference = KVType&;
243243/* ! \brief Default constructor */
244- #if TVM_LOG_DEBUG
244+ #if TVM_DEBUG_WITH_ABI_CHANGE
245245 iterator () : state_marker(0 ), index(0 ), self(nullptr ) {}
246246#else
247247 iterator () : index(0 ), self(nullptr ) {}
248- #endif // TVM_LOG_DEBUG
248+ #endif // TVM_DEBUG_WITH_ABI_CHANGE
249249 /* ! \brief Compare iterators */
250250 bool operator ==(const iterator& other) const {
251251 TVM_MAP_FAIL_IF_CHANGED ()
@@ -280,15 +280,15 @@ class MapNode : public Object {
280280 }
281281
282282 protected:
283- #if TVM_LOG_DEBUG
283+ #if TVM_DEBUG_WITH_ABI_CHANGE
284284 uint64_t state_marker;
285285 /* ! \brief Construct by value */
286286 iterator (uint64_t index, const MapNode* self)
287287 : state_marker(self->state_marker), index(index), self(self) {}
288288
289289#else
290290 iterator (uint64_t index, const MapNode* self) : index(index), self(self) {}
291- #endif // TVM_LOG_DEBUG
291+ #endif // TVM_DEBUG_WITH_ABI_CHANGE
292292 /* ! \brief The position on the array */
293293 uint64_t index;
294294 /* ! \brief The container it points to */
@@ -304,9 +304,9 @@ class MapNode : public Object {
304304 static inline ObjectPtr<MapNode> Empty ();
305305
306306 protected:
307- #if TVM_LOG_DEBUG
307+ #if TVM_DEBUG_WITH_ABI_CHANGE
308308 uint64_t state_marker;
309- #endif // TVM_LOG_DEBUG
309+ #endif // TVM_DEBUG_WITH_ABI_CHANGE
310310 /* !
311311 * \brief Create the map using contents from the given iterators.
312312 * \param first Begin of iterator
@@ -1233,9 +1233,9 @@ inline ObjectPtr<Object> MapNode::CreateFromRange(IterType first, IterType last)
12331233inline void MapNode::InsertMaybeReHash (const KVType& kv, ObjectPtr<Object>* map) {
12341234 constexpr uint64_t kSmallMapMaxSize = SmallMapNode::kMaxSize ;
12351235 MapNode* base = static_cast <MapNode*>(map->get ());
1236- #if TVM_LOG_DEBUG
1236+ #if TVM_DEBUG_WITH_ABI_CHANGE
12371237 base->state_marker ++;
1238- #endif // TVM_LOG_DEBUG
1238+ #endif // TVM_DEBUG_WITH_ABI_CHANGE
12391239 if (base->slots_ < kSmallMapMaxSize ) {
12401240 SmallMapNode::InsertMaybeReHash (kv, map);
12411241 } else if (base->slots_ == kSmallMapMaxSize ) {
0 commit comments