[libcxx-commits] [PATCH] D101003: [libc++] <span>, like <string_view>, has no use for debug iterators.
Arthur O'Dwyer via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Apr 29 15:05:45 PDT 2021
Quuxplusone updated this revision to Diff 341672.
Quuxplusone added a comment.
oops, update again
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101003/new/
https://reviews.llvm.org/D101003
Files:
libcxx/include/__config
libcxx/include/span
Index: libcxx/include/span
===================================================================
--- libcxx/include/span
+++ libcxx/include/span
@@ -200,7 +200,11 @@
using const_pointer = const _Tp *;
using reference = _Tp &;
using const_reference = const _Tp &;
- using iterator = __wrap_iter<pointer>;
+#if (_LIBCPP_DEBUG == 2) || defined(_LIBCPP_ABI_SPAN_POINTER_ITERATORS)
+ using iterator = pointer;
+#else
+ using iterator = __wrap_iter<pointer>;
+#endif
using reverse_iterator = _VSTD::reverse_iterator<iterator>;
static constexpr size_type extent = _Extent;
@@ -375,7 +379,11 @@
using const_pointer = const _Tp *;
using reference = _Tp &;
using const_reference = const _Tp &;
- using iterator = __wrap_iter<pointer>;
+#if (_LIBCPP_DEBUG == 2) || defined(_LIBCPP_ABI_SPAN_POINTER_ITERATORS)
+ using iterator = pointer;
+#else
+ using iterator = __wrap_iter<pointer>;
+#endif
using reverse_iterator = _VSTD::reverse_iterator<iterator>;
static constexpr size_type extent = dynamic_extent;
Index: libcxx/include/__config
===================================================================
--- libcxx/include/__config
+++ libcxx/include/__config
@@ -106,6 +106,8 @@
# define _LIBCPP_ABI_OPTIMIZED_FUNCTION
// All the regex constants must be distinct and nonzero.
# define _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO
+// Use raw pointers, not wrapped ones, for std::span's iterator type.
+# define _LIBCPP_ABI_SPAN_POINTER_ITERATORS
// Re-worked external template instantiations for std::string with a focus on
// performance and fast-path inlining.
# define _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101003.341672.patch
Type: text/x-patch
Size: 1841 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210429/261b6626/attachment.bin>
More information about the libcxx-commits
mailing list