diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2021-08-09 11:49:09 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2021-08-09 20:46:56 +0100 |
commit | f5a2d78072fc161e8ca3117126030041f1503c3f (patch) | |
tree | ba78501ade69cba3dc0030ae7e8b6899b6082a33 /gcc/tree-vectorizer.h | |
parent | 1354603bf7d2ef8cd0cb1f76e801732020502987 (diff) | |
download | gcc-f5a2d78072fc161e8ca3117126030041f1503c3f.zip gcc-f5a2d78072fc161e8ca3117126030041f1503c3f.tar.gz gcc-f5a2d78072fc161e8ca3117126030041f1503c3f.tar.bz2 |
libstdc++: Reduce use of debug containers in <regex>
The std::regex code uses std::map and std::vector, which means that when
_GLIBCXX_DEBUG is defined it uses the debug versions of those
containers. That no longer compiles, because I changed <regex> to
include <bits/stl_map.h> and <bits/stl_vector.h> instead of <map> and
<vector>, so the debug versions aren't defined, and std::map doesn't
compile. There is also a use of std::stack, which defaults to std::deque
which is the debug deque when _GLIBCXX_DEBUG is defined.
Using std::map, std::vector, and std::deque is probably a mistake, and
we should qualify them with _GLIBCXX_STD_C instead so that the debug
versions aren't used. We do not need the overhead of checking our own
uses of those containers, which should be correct anyway. The exception
is the vector base class of std::match_results, which exposes iterators
to users, so can benefit from debug mode checks for its iterators. For
other accesses to the vector elements, match_results already does its
own checks, so can access the _GLIBCXX_STD_C::vector base class
directly.
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:
* include/bits/regex.h (basic_regex::transform_primary): Use
_GLIBCXX_STD_C::vector for local variable.
* include/bits/regex.tcc (__regex_algo_impl): Use reference to
_GLIBCXX_STD_C::vector base class of match_results.
* include/bits/regex_automaton.tcc (_StateSeq:_M_clone): Use
_GLIBCXX_STD_C::map and _GLIBCXX_STD_C::deque for local
variables.
* include/bits/regex_compiler.h (_BracketMatcher): Use
_GLIBCXX_STD_C::vector for data members.
* include/bits/regex_executor.h (_Executor): Likewise.
* include/std/regex [_GLIBCXX_DEBUG]: Include <debug/vector>.
Diffstat (limited to 'gcc/tree-vectorizer.h')
0 files changed, 0 insertions, 0 deletions