Skip to content

Commit c18e855

Browse files
ctillercopybara-github
authored andcommitted
[clang-format] Remove requirement that port_platform.h is at the top (grpc#36284)
Closes grpc#36284 COPYBARA_INTEGRATE_REVIEW=grpc#36284 from ctiller:port_platform-src-core-clang-format 99a9af9 PiperOrigin-RevId: 623689335
1 parent 0581eb1 commit c18e855

File tree

534 files changed

+707
-1064
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

534 files changed

+707
-1064
lines changed

src/core/.clang-format

-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ DerivePointerAlignment: false
55
PointerAlignment: Left
66
IncludeBlocks: Regroup
77
IncludeCategories:
8-
# port_platform.h is before almost everything
9-
- Regex: '^<grpc/(support|impl/codegen)/port_platform.h>'
10-
Priority: -100
118
# ruby.h is even more first if it's included
129
- Regex: '^<ruby/ruby.h>'
1310
Priority: -200

src/core/lib/address_utils/parse_address.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
//
1717
//
1818

19-
#include <grpc/support/port_platform.h>
20-
2119
#include "src/core/lib/address_utils/parse_address.h"
2220

21+
#include <grpc/support/port_platform.h>
22+
2323
#include "src/core/lib/iomgr/port.h" // IWYU pragma: keep
2424

2525
#ifdef GRPC_HAVE_VSOCK

src/core/lib/address_utils/parse_address.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
#ifndef GRPC_SRC_CORE_LIB_ADDRESS_UTILS_PARSE_ADDRESS_H
2020
#define GRPC_SRC_CORE_LIB_ADDRESS_UTILS_PARSE_ADDRESS_H
2121

22-
#include <grpc/support/port_platform.h>
23-
2422
#include <stdint.h>
2523

2624
#include "absl/status/statusor.h"
2725
#include "absl/strings/string_view.h"
2826

27+
#include <grpc/support/port_platform.h>
28+
2929
#include "src/core/lib/iomgr/error.h"
3030
#include "src/core/lib/iomgr/resolved_address.h"
3131
#include "src/core/lib/uri/uri_parser.h"

src/core/lib/address_utils/sockaddr_utils.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
//
1717
//
1818

19-
#include <grpc/support/port_platform.h>
20-
2119
#include "src/core/lib/address_utils/sockaddr_utils.h"
2220

2321
#include <errno.h>
2422
#include <inttypes.h>
23+
24+
#include <grpc/support/port_platform.h>
2525
#ifdef GRPC_HAVE_VSOCK
2626
#include <linux/vm_sockets.h>
2727
#endif

src/core/lib/address_utils/sockaddr_utils.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
#ifndef GRPC_SRC_CORE_LIB_ADDRESS_UTILS_SOCKADDR_UTILS_H
2020
#define GRPC_SRC_CORE_LIB_ADDRESS_UTILS_SOCKADDR_UTILS_H
2121

22-
#include <grpc/support/port_platform.h>
23-
2422
#include <stdint.h>
2523

2624
#include <string>
2725

2826
#include "absl/status/statusor.h"
2927

28+
#include <grpc/support/port_platform.h>
29+
3030
#include "src/core/lib/iomgr/resolved_address.h"
3131

3232
// Returns true if addr is an IPv4-mapped IPv6 address within the

src/core/lib/avl/avl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
#ifndef GRPC_SRC_CORE_LIB_AVL_AVL_H
1616
#define GRPC_SRC_CORE_LIB_AVL_AVL_H
1717

18-
#include <grpc/support/port_platform.h>
19-
2018
#include <stdlib.h>
2119

2220
#include <algorithm> // IWYU pragma: keep
2321
#include <iterator>
2422
#include <utility>
2523

24+
#include <grpc/support/port_platform.h>
25+
2626
#include "src/core/lib/gpr/useful.h"
2727
#include "src/core/lib/gprpp/ref_counted.h"
2828
#include "src/core/lib/gprpp/ref_counted_ptr.h"

src/core/lib/backoff/backoff.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
//
1717
//
1818

19-
#include <grpc/support/port_platform.h>
20-
2119
#include "src/core/lib/backoff/backoff.h"
2220

2321
#include <algorithm>
2422

23+
#include <grpc/support/port_platform.h>
24+
2525
namespace grpc_core {
2626

2727
BackOff::BackOff(const Options& options) : options_(options) { Reset(); }

src/core/lib/backoff/backoff.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
#ifndef GRPC_SRC_CORE_LIB_BACKOFF_BACKOFF_H
2020
#define GRPC_SRC_CORE_LIB_BACKOFF_BACKOFF_H
2121

22-
#include <grpc/support/port_platform.h>
23-
2422
#include "absl/random/random.h"
2523

24+
#include <grpc/support/port_platform.h>
25+
2626
#include "src/core/lib/gprpp/time.h"
2727

2828
namespace grpc_core {

src/core/lib/backoff/random_early_detection.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include <grpc/support/port_platform.h>
16-
1715
#include "src/core/lib/backoff/random_early_detection.h"
1816

1917
#include "absl/random/distributions.h"
2018

19+
#include <grpc/support/port_platform.h>
20+
2121
namespace grpc_core {
2222

2323
bool RandomEarlyDetection::Reject(uint64_t size, absl::BitGenRef bitsrc) const {

src/core/lib/backoff/random_early_detection.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
#ifndef GRPC_SRC_CORE_LIB_BACKOFF_RANDOM_EARLY_DETECTION_H
1616
#define GRPC_SRC_CORE_LIB_BACKOFF_RANDOM_EARLY_DETECTION_H
1717

18-
#include <grpc/support/port_platform.h>
19-
2018
#include <limits.h>
2119

2220
#include <cstdint>
2321

2422
#include "absl/random/bit_gen_ref.h"
2523

24+
#include <grpc/support/port_platform.h>
25+
2626
namespace grpc_core {
2727

2828
// Implements the random early detection algorithm - allows items to be rejected

src/core/lib/channel/call_finalization.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
#ifndef GRPC_SRC_CORE_LIB_CHANNEL_CALL_FINALIZATION_H
1616
#define GRPC_SRC_CORE_LIB_CHANNEL_CALL_FINALIZATION_H
1717

18-
#include <grpc/support/port_platform.h>
19-
2018
#include <utility>
2119

20+
#include <grpc/support/port_platform.h>
21+
2222
#include "src/core/lib/promise/context.h"
2323
#include "src/core/lib/resource_quota/arena.h"
2424
#include "src/core/lib/transport/call_final_info.h"

src/core/lib/channel/call_tracer.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@
1616
//
1717
//
1818

19-
#include <grpc/support/port_platform.h>
20-
2119
#include "src/core/lib/channel/call_tracer.h"
2220

2321
#include <memory>
2422
#include <utility>
2523
#include <vector>
2624

2725
#include <grpc/support/log.h>
26+
#include <grpc/support/port_platform.h>
2827

2928
#include "src/core/lib/channel/tcp_tracer.h"
3029
#include "src/core/lib/promise/context.h"

src/core/lib/channel/call_tracer.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,14 @@
1919
#ifndef GRPC_SRC_CORE_LIB_CHANNEL_CALL_TRACER_H
2020
#define GRPC_SRC_CORE_LIB_CHANNEL_CALL_TRACER_H
2121

22-
#include <grpc/support/port_platform.h>
23-
2422
#include <memory>
2523
#include <string>
2624

2725
#include "absl/status/status.h"
2826
#include "absl/strings/string_view.h"
2927
#include "absl/types/optional.h"
3028

29+
#include <grpc/support/port_platform.h>
3130
#include <grpc/support/time.h>
3231

3332
#include "src/core/lib/channel/channel_args.h"

src/core/lib/channel/channel_args.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
//
1717
//
1818

19-
#include <grpc/support/port_platform.h>
20-
2119
#include "src/core/lib/channel/channel_args.h"
2220

2321
#include <limits.h>
@@ -38,6 +36,7 @@
3836
#include <grpc/impl/channel_arg_names.h>
3937
#include <grpc/support/alloc.h>
4038
#include <grpc/support/log.h>
39+
#include <grpc/support/port_platform.h>
4140
#include <grpc/support/string_util.h>
4241

4342
#include "src/core/lib/gpr/useful.h"

src/core/lib/channel/channel_args.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
#ifndef GRPC_SRC_CORE_LIB_CHANNEL_CHANNEL_ARGS_H
2020
#define GRPC_SRC_CORE_LIB_CHANNEL_CHANNEL_ARGS_H
2121

22-
#include <grpc/support/port_platform.h>
23-
2422
#include <stddef.h>
2523
#include <stdint.h>
2624

@@ -37,6 +35,7 @@
3735

3836
#include <grpc/event_engine/event_engine.h>
3937
#include <grpc/grpc.h>
38+
#include <grpc/support/port_platform.h>
4039

4140
#include "src/core/lib/avl/avl.h"
4241
#include "src/core/lib/gpr/useful.h"

src/core/lib/channel/channel_args_preconditioning.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include <grpc/support/port_platform.h>
16-
1715
#include "src/core/lib/channel/channel_args_preconditioning.h"
1816

1917
#include <utility>
2018

19+
#include <grpc/support/port_platform.h>
20+
2121
namespace grpc_core {
2222

2323
void ChannelArgsPreconditioning::Builder::RegisterStage(Stage stage) {

src/core/lib/channel/channel_args_preconditioning.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@
1515
#ifndef GRPC_SRC_CORE_LIB_CHANNEL_CHANNEL_ARGS_PRECONDITIONING_H
1616
#define GRPC_SRC_CORE_LIB_CHANNEL_CHANNEL_ARGS_PRECONDITIONING_H
1717

18-
#include <grpc/support/port_platform.h>
19-
2018
#include <functional>
2119
#include <vector>
2220

2321
#include <grpc/grpc.h>
22+
#include <grpc/support/port_platform.h>
2423

2524
#include "src/core/lib/channel/channel_args.h"
2625

src/core/lib/channel/channel_stack.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
//
1717
//
1818

19-
#include <grpc/support/port_platform.h>
20-
2119
#include "src/core/lib/channel/channel_stack.h"
2220

2321
#include <stdint.h>
@@ -26,6 +24,7 @@
2624
#include <utility>
2725

2826
#include <grpc/support/log.h>
27+
#include <grpc/support/port_platform.h>
2928

3029
#include "src/core/lib/channel/channel_args.h"
3130
#include "src/core/lib/channel/channel_fwd.h"

src/core/lib/channel/channel_stack.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@
4444
// it can have an effect on the call status.
4545
//
4646

47-
#include <grpc/support/port_platform.h>
48-
4947
#include <stddef.h>
5048

5149
#include <functional>
@@ -56,6 +54,7 @@
5654
#include <grpc/slice.h>
5755
#include <grpc/status.h>
5856
#include <grpc/support/log.h>
57+
#include <grpc/support/port_platform.h>
5958
#include <grpc/support/time.h>
6059

6160
#include "src/core/lib/channel/channel_args.h"

src/core/lib/channel/channel_stack_builder.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
//
1717
//
1818

19-
#include <grpc/support/port_platform.h>
20-
2119
#include "src/core/lib/channel/channel_stack_builder.h"
2220

2321
#include <algorithm>
2422

23+
#include <grpc/support/port_platform.h>
24+
2525
#include "src/core/lib/channel/channel_args.h"
2626

2727
namespace grpc_core {

src/core/lib/channel/channel_stack_builder.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
#ifndef GRPC_SRC_CORE_LIB_CHANNEL_CHANNEL_STACK_BUILDER_H
1616
#define GRPC_SRC_CORE_LIB_CHANNEL_CHANNEL_STACK_BUILDER_H
1717

18-
#include <grpc/support/port_platform.h>
19-
2018
#include <string>
2119
#include <vector>
2220

2321
#include "absl/status/statusor.h"
2422
#include "absl/strings/string_view.h"
2523

24+
#include <grpc/support/port_platform.h>
25+
2626
#include "src/core/lib/channel/channel_args.h"
2727
#include "src/core/lib/channel/channel_fwd.h"
2828
#include "src/core/lib/gprpp/ref_counted_ptr.h"

src/core/lib/channel/channel_stack_builder_impl.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
//
1717
//
1818

19-
#include <grpc/support/port_platform.h>
20-
2119
#include "src/core/lib/channel/channel_stack_builder_impl.h"
2220

2321
#include <string.h>
@@ -36,6 +34,7 @@
3634

3735
#include <grpc/support/alloc.h>
3836
#include <grpc/support/log.h>
37+
#include <grpc/support/port_platform.h>
3938

4039
#include "src/core/lib/channel/channel_fwd.h"
4140
#include "src/core/lib/channel/channel_stack.h"

src/core/lib/channel/channel_stack_builder_impl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
#ifndef GRPC_SRC_CORE_LIB_CHANNEL_CHANNEL_STACK_BUILDER_IMPL_H
1616
#define GRPC_SRC_CORE_LIB_CHANNEL_CHANNEL_STACK_BUILDER_IMPL_H
1717

18-
#include <grpc/support/port_platform.h>
19-
2018
#include "absl/status/statusor.h"
2119

20+
#include <grpc/support/port_platform.h>
21+
2222
#include "src/core/lib/channel/channel_fwd.h"
2323
#include "src/core/lib/channel/channel_stack_builder.h"
2424
#include "src/core/lib/gprpp/ref_counted_ptr.h"

src/core/lib/channel/channel_stack_trace.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#include <grpc/support/port_platform.h>
16-
1715
#include "src/core/lib/channel/channel_stack_trace.h"
1816

17+
#include <grpc/support/port_platform.h>
18+
1919
grpc_core::TraceFlag grpc_trace_channel_stack(false, "channel_stack");

src/core/lib/channel/channel_trace.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
//
1717
//
1818

19-
#include <grpc/support/port_platform.h>
20-
2119
#include "src/core/lib/channel/channel_trace.h"
2220

2321
#include <memory>
@@ -27,6 +25,7 @@
2725

2826
#include <grpc/support/alloc.h>
2927
#include <grpc/support/json.h>
28+
#include <grpc/support/port_platform.h>
3029

3130
#include "src/core/lib/channel/channelz.h"
3231
#include "src/core/lib/gpr/string.h"

src/core/lib/channel/channel_trace.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@
1919
#ifndef GRPC_SRC_CORE_LIB_CHANNEL_CHANNEL_TRACE_H
2020
#define GRPC_SRC_CORE_LIB_CHANNEL_CHANNEL_TRACE_H
2121

22-
#include <grpc/support/port_platform.h>
23-
2422
#include <stddef.h>
2523
#include <stdint.h>
2624

2725
#include <grpc/slice.h>
26+
#include <grpc/support/port_platform.h>
2827
#include <grpc/support/sync.h>
2928
#include <grpc/support/time.h>
3029

0 commit comments

Comments
 (0)