Skip to content

Commit

Permalink
Clean and format #include directives.
Browse files Browse the repository at this point in the history
Change-Id: Iba5a0f3a18245a22f68ba1c3d533200cc577a596
Reviewed-on: https://code-review.googlesource.com/c/re2/+/63130
Reviewed-by: Alex Chernyakhovsky <[email protected]>
Reviewed-by: Paul Wankadia <[email protected]>
  • Loading branch information
junyer committed May 28, 2024
1 parent 9d2c825 commit 71f37d0
Show file tree
Hide file tree
Showing 60 changed files with 207 additions and 123 deletions.
7 changes: 7 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ cc_library(
"@abseil-cpp//absl/container:flat_hash_map",
"@abseil-cpp//absl/container:flat_hash_set",
"@abseil-cpp//absl/container:inlined_vector",
"@abseil-cpp//absl/hash",
"@abseil-cpp//absl/log:absl_check",
"@abseil-cpp//absl/log:absl_log",
"@abseil-cpp//absl/strings",
Expand Down Expand Up @@ -165,6 +166,7 @@ cc_test(
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/log:absl_check",
"@abseil-cpp//absl/log:absl_log",
"@abseil-cpp//absl/strings",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
Expand Down Expand Up @@ -239,6 +241,7 @@ cc_test(
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/log:absl_check",
"@abseil-cpp//absl/log:absl_log",
"@abseil-cpp//absl/types:optional",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
Expand All @@ -254,6 +257,7 @@ cc_test(
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/log:absl_check",
"@abseil-cpp//absl/log:absl_log",
"@abseil-cpp//absl/strings",
"@abseil-cpp//absl/strings:str_format",
"@googletest//:gtest",
"@googletest//:gtest_main",
Expand Down Expand Up @@ -333,6 +337,7 @@ cc_test(
srcs = ["re2/testing/string_generator_test.cc"],
deps = [
":testing",
"@abseil-cpp//absl/strings",
"@googletest//:gtest",
"@googletest//:gtest_main",
],
Expand All @@ -349,6 +354,7 @@ cc_test(
"@abseil-cpp//absl/flags:flag",
"@abseil-cpp//absl/log:absl_check",
"@abseil-cpp//absl/log:absl_log",
"@abseil-cpp//absl/strings",
"@abseil-cpp//absl/strings:str_format",
"@googletest//:gtest",
"@googletest//:gtest_main",
Expand Down Expand Up @@ -423,6 +429,7 @@ cc_binary(
"@abseil-cpp//absl/flags:flag",
"@abseil-cpp//absl/log:absl_check",
"@abseil-cpp//absl/log:absl_log",
"@abseil-cpp//absl/strings",
"@abseil-cpp//absl/strings:str_format",
"@abseil-cpp//absl/synchronization",
"@google_benchmark//:benchmark_main",
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ set(ABSL_DEPS
absl_flags
absl_flat_hash_map
absl_flat_hash_set
absl_hash
absl_inlined_vector
absl_optional
absl_span
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ABSL_DEPS=\
absl_flags\
absl_flat_hash_map\
absl_flat_hash_set\
absl_hash\
absl_inlined_vector\
absl_optional\
absl_span\
Expand Down
10 changes: 8 additions & 2 deletions python/_re2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

#include <stddef.h>
#include <sys/types.h>

#include <memory>
#include <stdexcept>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "absl/strings/string_view.h"
#include "pybind11/buffer_info.h"
#include "pybind11/gil.h"
#include "pybind11/pybind11.h"
#include "pybind11/pytypes.h"
#include "re2/filtered_re2.h"
#include "re2/re2.h"
#include "re2/set.h"
Expand Down
3 changes: 1 addition & 2 deletions re2/bitmap256.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

#include <stdint.h>

#include "absl/base/macros.h"
#include "absl/base/attributes.h"
#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"

namespace re2 {

Expand Down
7 changes: 4 additions & 3 deletions re2/bitmap256.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
#ifndef RE2_BITMAP256_H_
#define RE2_BITMAP256_H_

#ifdef _MSC_VER
#include <intrin.h>
#endif
#include <stdint.h>
#include <string.h>

#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"

#ifdef _MSC_VER
#include <intrin.h>
#endif

namespace re2 {

class Bitmap256 {
Expand Down
2 changes: 2 additions & 0 deletions re2/bitstate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
#include <stddef.h>
#include <stdint.h>
#include <string.h>

#include <limits>
#include <utility>

#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"
#include "absl/strings/string_view.h"
#include "re2/pod_array.h"
#include "re2/prog.h"
#include "re2/regexp.h"
Expand Down
6 changes: 4 additions & 2 deletions re2/compile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@

#include <stdint.h>
#include <string.h>

#include <string>
#include <utility>

#include "absl/base/macros.h"
#include "absl/container/flat_hash_map.h"
#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"
#include "util/utf.h"
#include "absl/strings/string_view.h"
#include "re2/pod_array.h"
#include "re2/prog.h"
#include "re2/re2.h"
#include "re2/regexp.h"
#include "re2/walker-inl.h"
#include "util/utf.h"

namespace re2 {

Expand Down
9 changes: 6 additions & 3 deletions re2/dfa.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,32 @@
#include <stdint.h>
#include <stdio.h>
#include <string.h>

#include <algorithm>
#include <atomic>
#include <deque>
#include <new>
#include <memory>
#include <string>
#include <utility>
#include <vector>

#include "absl/base/attributes.h"
#include "absl/base/call_once.h"
#include "absl/base/macros.h"
#include "absl/base/thread_annotations.h"
#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
#include "absl/hash/hash.h"
#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"
#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
#include "absl/synchronization/mutex.h"
#include "absl/types/span.h"
#include "util/strutil.h"
#include "re2/pod_array.h"
#include "re2/prog.h"
#include "re2/re2.h"
#include "re2/sparse_set.h"
#include "util/strutil.h"

// Silence "zero-sized array in struct/union" warning for DFA::State::next_.
#ifdef _MSC_VER
Expand Down
4 changes: 3 additions & 1 deletion re2/filtered_re2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
#include "re2/filtered_re2.h"

#include <stddef.h>

#include <string>
#include <utility>
#include <vector>

#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"
#include "absl/strings/string_view.h"
#include "re2/prefilter.h"
#include "re2/prefilter_tree.h"

Expand Down
2 changes: 2 additions & 0 deletions re2/fuzzing/re2_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
#include <fuzzer/FuzzedDataProvider.h>
#include <stddef.h>
#include <stdint.h>

#include <algorithm>
#include <string>
#include <vector>

#include "absl/strings/string_view.h"
#include "re2/filtered_re2.h"
#include "re2/re2.h"
#include "re2/regexp.h"
Expand Down
1 change: 0 additions & 1 deletion re2/mimics_pcre.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
//
// Regexp::MimicsPCRE checks for any of these conditions.

#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"
#include "re2/regexp.h"
#include "re2/walker-inl.h"
Expand Down
3 changes: 2 additions & 1 deletion re2/nfa.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@

#include <stdio.h>
#include <string.h>

#include <algorithm>
#include <deque>
#include <string>
#include <utility>
#include <vector>

#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"
#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
#include "re2/pod_array.h"
#include "re2/prog.h"
#include "re2/regexp.h"
Expand Down
5 changes: 3 additions & 2 deletions re2/onepass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,21 @@

#include <stdint.h>
#include <string.h>

#include <algorithm>
#include <map>
#include <string>
#include <vector>

#include "absl/container/fixed_array.h"
#include "absl/container/inlined_vector.h"
#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"
#include "absl/strings/str_format.h"
#include "util/utf.h"
#include "absl/strings/string_view.h"
#include "re2/pod_array.h"
#include "re2/prog.h"
#include "re2/sparse_set.h"
#include "util/utf.h"

// Silence "zero-sized array in struct/union" warning for OneState::action.
#ifdef _MSC_VER
Expand Down
8 changes: 4 additions & 4 deletions re2/parse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@
// and recognizes the Perl escape sequences \d, \s, \w, \D, \S, and \W.
// See regexp.h for rationale.

#include <ctype.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>

#include <algorithm>
#include <map>
#include <string>
#include <vector>

#include "absl/base/attributes.h"
#include "absl/base/macros.h"
#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"
#include "absl/strings/ascii.h"
#include "util/utf.h"
#include "absl/strings/string_view.h"
#include "re2/pod_array.h"
#include "re2/regexp.h"
#include "re2/unicode_casefold.h"
#include "re2/unicode_groups.h"
#include "re2/walker-inl.h"
#include "util/utf.h"

#if defined(RE2_USE_ICU)
#include "unicode/uniset.h"
Expand Down
5 changes: 3 additions & 2 deletions re2/prefilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
#include "re2/prefilter.h"

#include <stddef.h>
#include <stdint.h>

#include <string>
#include <utility>
#include <vector>

#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"
#include "absl/strings/str_format.h"
#include "util/utf.h"
#include "re2/re2.h"
#include "re2/regexp.h"
#include "re2/unicode_casefold.h"
#include "re2/walker-inl.h"
#include "util/utf.h"

namespace re2 {

Expand Down
3 changes: 1 addition & 2 deletions re2/prefilter_tree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#include "re2/prefilter_tree.h"

#include <stddef.h>

#include <algorithm>
#include <cmath>
#include <memory>
#include <string>
#include <utility>
#include <vector>
Expand All @@ -16,7 +16,6 @@
#include "absl/log/absl_log.h"
#include "absl/strings/str_format.h"
#include "re2/prefilter.h"
#include "re2/re2.h"

namespace re2 {

Expand Down
23 changes: 15 additions & 8 deletions re2/prog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,30 @@

#include "re2/prog.h"

#if defined(__AVX2__)
#include <immintrin.h>
#ifdef _MSC_VER
#include <intrin.h>
#endif
#endif
#include <stdint.h>
#include <string.h>

#include <algorithm>
#include <memory>
#include <string>
#include <utility>
#include <vector>

#include "absl/base/macros.h"
#include "absl/base/attributes.h"
#include "absl/log/absl_check.h"
#include "absl/log/absl_log.h"
#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
#include "re2/bitmap256.h"
#include "re2/pod_array.h"
#include "re2/sparse_array.h"
#include "re2/sparse_set.h"

#if defined(__AVX2__)
#include <immintrin.h>
#ifdef _MSC_VER
#include <intrin.h>
#endif
#endif

namespace re2 {

Expand Down
Loading

0 comments on commit 71f37d0

Please sign in to comment.