hans created this revision.
hans added reviewers: var-const, ldionne.
Herald added a project: All.
hans requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

This is a follow-up to D153672 <https://reviews.llvm.org/D153672> which removed 
the old debug mode and moved many of those checks to the regular asserts mode.

The tree invariant check is too expensive for the regular asserts mode, making 
element removal `O(n)` instead of `O(log n)`, so disable it until there is a 
new debug assert category it can be put in.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154417

Files:
  libcxx/include/__tree


Index: libcxx/include/__tree
===================================================================
--- libcxx/include/__tree
+++ libcxx/include/__tree
@@ -376,7 +376,8 @@
 {
     _LIBCPP_ASSERT_UNCATEGORIZED(__root != nullptr, "Root node should not be 
null");
     _LIBCPP_ASSERT_UNCATEGORIZED(__z != nullptr, "The node to remove should 
not be null");
-    _LIBCPP_ASSERT_UNCATEGORIZED(std::__tree_invariant(__root), "The tree 
invariants should hold");
+    // TODO: Use in the new debug mode:
+    // _LIBCPP_DEBUG_ASSERT(std::__tree_invariant(__root), "The tree 
invariants should hold");
     // __z will be removed from the tree.  Client still needs to 
destruct/deallocate it
     // __y is either __z, or if __z has two children, __tree_next(__z).
     // __y will have at most one child.


Index: libcxx/include/__tree
===================================================================
--- libcxx/include/__tree
+++ libcxx/include/__tree
@@ -376,7 +376,8 @@
 {
     _LIBCPP_ASSERT_UNCATEGORIZED(__root != nullptr, "Root node should not be null");
     _LIBCPP_ASSERT_UNCATEGORIZED(__z != nullptr, "The node to remove should not be null");
-    _LIBCPP_ASSERT_UNCATEGORIZED(std::__tree_invariant(__root), "The tree invariants should hold");
+    // TODO: Use in the new debug mode:
+    // _LIBCPP_DEBUG_ASSERT(std::__tree_invariant(__root), "The tree invariants should hold");
     // __z will be removed from the tree.  Client still needs to destruct/deallocate it
     // __y is either __z, or if __z has two children, __tree_next(__z).
     // __y will have at most one child.
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to