Skip to content

Commit

Permalink
Revert using Abseil system includes. (#4594)
Browse files Browse the repository at this point in the history
* Revert using Abseil system includes.

* Fix missing include.
  • Loading branch information
fruffy authored Apr 2, 2024
1 parent f7fbbcf commit a0520c8
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 49 deletions.
3 changes: 1 addition & 2 deletions backends/p4tools/modules/testgen/test/small-step/util.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#include "util.h"

#include <absl/strings/substitute.h>

#include <string>

#include "absl/strings/substitute.h"
#include "test/gtest/helpers.h"

#include "backends/p4tools/modules/testgen/test/gtest_utils.h"
Expand Down
15 changes: 0 additions & 15 deletions bazel/abseil.patch

This file was deleted.

6 changes: 0 additions & 6 deletions bazel/p4c_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
3 changes: 1 addition & 2 deletions control-plane/p4RuntimeSymbolTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ limitations under the License.
*/
#include "p4RuntimeSymbolTable.h"

#include <absl/strings/str_split.h>

#include "absl/strings/str_split.h"
#include "lib/cstring.h"
#include "lib/iterator_range.h"
#include "p4RuntimeArchHandler.h"
Expand Down
5 changes: 2 additions & 3 deletions frontends/common/resolveReferences/referenceMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ limitations under the License.
#ifndef COMMON_RESOLVEREFERENCES_REFERENCEMAP_H_
#define COMMON_RESOLVEREFERENCES_REFERENCEMAP_H_

#include <absl/container/flat_hash_map.h>
#include <absl/container/flat_hash_set.h>

#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"
Expand Down
3 changes: 1 addition & 2 deletions frontends/common/resolveReferences/resolveReferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ limitations under the License.
#ifndef COMMON_RESOLVEREFERENCES_RESOLVEREFERENCES_H_
#define COMMON_RESOLVEREFERENCES_RESOLVEREFERENCES_H_

#include <absl/container/flat_hash_map.h>

#include "absl/container/flat_hash_map.h"
#include "ir/ir.h"
#include "lib/cstring.h"
#include "lib/iterator_range.h"
Expand Down
5 changes: 2 additions & 3 deletions frontends/p4/def_use.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ limitations under the License.
#ifndef FRONTENDS_P4_DEF_USE_H_
#define FRONTENDS_P4_DEF_USE_H_

#include <absl/container/flat_hash_set.h>
#include <absl/container/inlined_vector.h>

#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"
Expand Down
3 changes: 1 addition & 2 deletions frontends/p4/simplifyDefUse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ limitations under the License.

#include "simplifyDefUse.h"

#include <absl/container/flat_hash_set.h>

#include "absl/container/flat_hash_set.h"
#include "frontends/p4/def_use.h"
#include "frontends/p4/methodInstance.h"
#include "frontends/p4/parserCallGraph.h"
Expand Down
7 changes: 3 additions & 4 deletions frontends/p4/typeChecking/typeConstraints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ limitations under the License.

#include "typeConstraints.h"

#include <absl/strings/str_cat.h>
#include <absl/strings/str_join.h>
#include <absl/strings/str_split.h>

#include "absl/strings/str_cat.h"
#include "absl/strings/str_join.h"
#include "absl/strings/str_split.h"
#include "typeUnification.h"

namespace P4 {
Expand Down
5 changes: 2 additions & 3 deletions frontends/p4/typeMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ limitations under the License.
#ifndef FRONTENDS_P4_TYPEMAP_H_
#define FRONTENDS_P4_TYPEMAP_H_

#include <absl/container/flat_hash_map.h>
#include <absl/container/flat_hash_set.h>

#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"

Expand Down
3 changes: 1 addition & 2 deletions ir/visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ limitations under the License.
#include <stdlib.h>
#include <time.h>

#include <absl/container/flat_hash_map.h>

#include "absl/container/flat_hash_map.h"
#include "ir/ir-generated.h"
#include "lib/hash.h"

Expand Down
3 changes: 1 addition & 2 deletions lib/bitrange.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@ limitations under the License.
#ifndef LIB_BITRANGE_H_
#define LIB_BITRANGE_H_

#include <absl/numeric/bits.h>

#include <algorithm>
#include <iosfwd>
#include <limits>
#include <optional>
#include <utility>

#include "absl/numeric/bits.h"
#include "bitvec.h"
#include "exceptions.h"
#include "hash.h"
Expand Down
2 changes: 1 addition & 1 deletion test/gtest/complex_bitwise.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <absl/strings/substitute.h>
#include <gtest/gtest.h>

#include <optional>

#include "absl/strings/substitute.h"
#include "frontends/common/parseInput.h"
#include "frontends/common/resolveReferences/referenceMap.h"
#include "frontends/p4/toP4/toP4.h"
Expand Down
2 changes: 1 addition & 1 deletion test/gtest/diagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

#include <absl/strings/substitute.h>
#include <gtest/gtest.h>

#include <optional>

#include "absl/strings/substitute.h"
#include "frontends/common/applyOptionsPragmas.h"
#include "test/gtest/helpers.h"

Expand Down
2 changes: 1 addition & 1 deletion test/gtest/p4runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ limitations under the License.

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include <absl/strings/substitute.h>
#include <google/protobuf/util/message_differencer.h>
#include <gtest/gtest.h>

Expand All @@ -25,6 +24,7 @@ limitations under the License.
#include <string>
#include <vector>

#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"
Expand Down

0 comments on commit a0520c8

Please sign in to comment.