diff --git a/backends/p4tools/modules/testgen/test/small-step/util.cpp b/backends/p4tools/modules/testgen/test/small-step/util.cpp index 4e08fe26012..3670eb819fb 100644 --- a/backends/p4tools/modules/testgen/test/small-step/util.cpp +++ b/backends/p4tools/modules/testgen/test/small-step/util.cpp @@ -1,9 +1,8 @@ #include "util.h" -#include - #include +#include "absl/strings/substitute.h" #include "test/gtest/helpers.h" #include "backends/p4tools/modules/testgen/test/gtest_utils.h" diff --git a/bazel/abseil.patch b/bazel/abseil.patch deleted file mode 100644 index 2f0bb644c05..00000000000 --- a/bazel/abseil.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/absl/base/BUILD.bazel b/absl/base/BUILD.bazel -index 0eb735da..5dd4aa67 100644 ---- a/absl/base/BUILD.bazel -+++ b/absl/base/BUILD.bazel -@@ -137,6 +137,10 @@ cc_library( - "policy_checks.h", - ], - copts = ABSL_DEFAULT_COPTS, -+ # This library is the root of the absl dependency tree. -+ # If we add this `includes` path here, then all absl headers -+ # can be included via angle brackets in external projects. -+ includes = ["../.."], - linkopts = ABSL_DEFAULT_LINKOPTS, - ) - diff --git a/bazel/p4c_deps.bzl b/bazel/p4c_deps.bzl index e34fa4ab762..5388d0fb81d 100644 --- a/bazel/p4c_deps.bzl +++ b/bazel/p4c_deps.bzl @@ -77,12 +77,6 @@ filegroup( name = "com_google_absl", url = "https://github.com/abseil/abseil-cpp/releases/download/20240116.1/abseil-cpp-20240116.1.tar.gz", strip_prefix = "abseil-cpp-20240116.1", - # We patch Abseil to support bracketed system includes. - # Patch is sourced from https://github.com/abseil/abseil-cpp/pull/1637. - # Discussion around Abseil's lack of support for bracketed system includes: - # https://github.com/abseil/abseil-cpp/issues/740 - patches = ["@com_github_p4lang_p4c//:bazel/abseil.patch"], - patch_args = ["-p1"], sha256 = "3c743204df78366ad2eaf236d6631d83f6bc928d1705dd0000b872e53b73dc6a", ) if not native.existing_rule("com_google_protobuf"): diff --git a/control-plane/p4RuntimeSymbolTable.cpp b/control-plane/p4RuntimeSymbolTable.cpp index d63c0befa50..555ca6dd305 100644 --- a/control-plane/p4RuntimeSymbolTable.cpp +++ b/control-plane/p4RuntimeSymbolTable.cpp @@ -15,8 +15,7 @@ limitations under the License. */ #include "p4RuntimeSymbolTable.h" -#include - +#include "absl/strings/str_split.h" #include "lib/cstring.h" #include "lib/iterator_range.h" #include "p4RuntimeArchHandler.h" diff --git a/frontends/common/resolveReferences/referenceMap.h b/frontends/common/resolveReferences/referenceMap.h index e00ea126e46..c07e2afeab0 100644 --- a/frontends/common/resolveReferences/referenceMap.h +++ b/frontends/common/resolveReferences/referenceMap.h @@ -17,9 +17,8 @@ limitations under the License. #ifndef COMMON_RESOLVEREFERENCES_REFERENCEMAP_H_ #define COMMON_RESOLVEREFERENCES_REFERENCEMAP_H_ -#include -#include - +#include "absl/container/flat_hash_map.h" +#include "absl/container/flat_hash_set.h" #include "frontends/common/programMap.h" #include "ir/ir.h" #include "ir/visitor.h" diff --git a/frontends/common/resolveReferences/resolveReferences.h b/frontends/common/resolveReferences/resolveReferences.h index b1666c04406..55ece6e5127 100644 --- a/frontends/common/resolveReferences/resolveReferences.h +++ b/frontends/common/resolveReferences/resolveReferences.h @@ -17,8 +17,7 @@ limitations under the License. #ifndef COMMON_RESOLVEREFERENCES_RESOLVEREFERENCES_H_ #define COMMON_RESOLVEREFERENCES_RESOLVEREFERENCES_H_ -#include - +#include "absl/container/flat_hash_map.h" #include "ir/ir.h" #include "lib/cstring.h" #include "lib/iterator_range.h" diff --git a/frontends/p4/def_use.h b/frontends/p4/def_use.h index 27dd475693e..8b39e4d9698 100644 --- a/frontends/p4/def_use.h +++ b/frontends/p4/def_use.h @@ -17,9 +17,8 @@ limitations under the License. #ifndef FRONTENDS_P4_DEF_USE_H_ #define FRONTENDS_P4_DEF_USE_H_ -#include -#include - +#include "absl/container/flat_hash_set.h" +#include "absl/container/inlined_vector.h" #include "frontends/common/resolveReferences/referenceMap.h" #include "ir/ir.h" #include "lib/alloc_trace.h" diff --git a/frontends/p4/simplifyDefUse.cpp b/frontends/p4/simplifyDefUse.cpp index 5e4313694e2..fe914dbac39 100644 --- a/frontends/p4/simplifyDefUse.cpp +++ b/frontends/p4/simplifyDefUse.cpp @@ -16,8 +16,7 @@ limitations under the License. #include "simplifyDefUse.h" -#include - +#include "absl/container/flat_hash_set.h" #include "frontends/p4/def_use.h" #include "frontends/p4/methodInstance.h" #include "frontends/p4/parserCallGraph.h" diff --git a/frontends/p4/typeChecking/typeConstraints.cpp b/frontends/p4/typeChecking/typeConstraints.cpp index 617d1e7abb8..71144722bb3 100644 --- a/frontends/p4/typeChecking/typeConstraints.cpp +++ b/frontends/p4/typeChecking/typeConstraints.cpp @@ -16,10 +16,9 @@ limitations under the License. #include "typeConstraints.h" -#include -#include -#include - +#include "absl/strings/str_cat.h" +#include "absl/strings/str_join.h" +#include "absl/strings/str_split.h" #include "typeUnification.h" namespace P4 { diff --git a/frontends/p4/typeMap.h b/frontends/p4/typeMap.h index b434e8c2841..e0d636b6d30 100644 --- a/frontends/p4/typeMap.h +++ b/frontends/p4/typeMap.h @@ -17,9 +17,8 @@ limitations under the License. #ifndef FRONTENDS_P4_TYPEMAP_H_ #define FRONTENDS_P4_TYPEMAP_H_ -#include -#include - +#include "absl/container/flat_hash_map.h" +#include "absl/container/flat_hash_set.h" #include "frontends/common/programMap.h" #include "frontends/p4/typeChecking/typeSubstitution.h" diff --git a/ir/visitor.cpp b/ir/visitor.cpp index 1a61ca2290e..be1b116e691 100644 --- a/ir/visitor.cpp +++ b/ir/visitor.cpp @@ -19,8 +19,7 @@ limitations under the License. #include #include -#include - +#include "absl/container/flat_hash_map.h" #include "ir/ir-generated.h" #include "lib/hash.h" diff --git a/lib/bitrange.h b/lib/bitrange.h index 1f70b8d8045..0100cab7e49 100644 --- a/lib/bitrange.h +++ b/lib/bitrange.h @@ -17,14 +17,13 @@ limitations under the License. #ifndef LIB_BITRANGE_H_ #define LIB_BITRANGE_H_ -#include - #include #include #include #include #include +#include "absl/numeric/bits.h" #include "bitvec.h" #include "exceptions.h" #include "hash.h" diff --git a/test/gtest/complex_bitwise.cpp b/test/gtest/complex_bitwise.cpp index 0743caec6b0..f0e28102d8d 100644 --- a/test/gtest/complex_bitwise.cpp +++ b/test/gtest/complex_bitwise.cpp @@ -1,8 +1,8 @@ -#include #include #include +#include "absl/strings/substitute.h" #include "frontends/common/parseInput.h" #include "frontends/common/resolveReferences/referenceMap.h" #include "frontends/p4/toP4/toP4.h" diff --git a/test/gtest/diagnostics.cpp b/test/gtest/diagnostics.cpp index 6d8202897d7..2febb2e6cf6 100644 --- a/test/gtest/diagnostics.cpp +++ b/test/gtest/diagnostics.cpp @@ -14,11 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include #include #include +#include "absl/strings/substitute.h" #include "frontends/common/applyOptionsPragmas.h" #include "test/gtest/helpers.h" diff --git a/test/gtest/p4runtime.cpp b/test/gtest/p4runtime.cpp index 7750073de01..381f1199516 100644 --- a/test/gtest/p4runtime.cpp +++ b/test/gtest/p4runtime.cpp @@ -16,7 +16,6 @@ limitations under the License. #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" -#include #include #include @@ -25,6 +24,7 @@ limitations under the License. #include #include +#include "absl/strings/substitute.h" #include "control-plane/p4/config/v1/p4types.pb.h" #include "control-plane/p4/v1/p4runtime.pb.h" #include "p4/config/v1/p4info.pb.h"