Fix the dependency chain for internal/arena.h

Clean up a few other superfluous #include's and forward declarations

PiperOrigin-RevId: 456851942
pull/13171/head
Protobuf Team Bot 2 years ago committed by Copybara-Service
parent 83f4988561
commit 8d0d13f2bc
  1. 22
      BUILD
  2. 2
      upb/alloc.h
  3. 2
      upb/arena.h
  4. 3
      upb/array.c
  5. 1
      upb/array.h
  6. 3
      upb/map.c
  7. 1
      upb/map.h

22
BUILD

@ -106,7 +106,6 @@ cc_library(
"upb/arena.c",
"upb/decode.c",
"upb/encode.c",
"upb/internal/arena.h",
"upb/internal/decode.h",
"upb/internal/table.h",
"upb/internal/upb.h",
@ -130,6 +129,7 @@ cc_library(
copts = UPB_DEFAULT_COPTS,
visibility = ["//visibility:public"],
deps = [
":arena_internal",
":extension_registry",
":fastdecode",
":port",
@ -270,13 +270,13 @@ cc_library(
"upb/decode.h",
"upb/decode_fast.c",
"upb/decode_fast.h",
"upb/internal/arena.h",
"upb/internal/decode.h",
"upb/msg.h",
"upb/msg_internal.h",
],
copts = UPB_DEFAULT_COPTS,
deps = [
":arena_internal",
":extension_registry",
":port",
":table",
@ -407,7 +407,6 @@ cc_library(
cc_library(
name = "json",
srcs = [
"upb/internal/arena.h",
"upb/internal/upb.h",
"upb/json_decode.c",
"upb/json_encode.c",
@ -708,6 +707,20 @@ sh_test(
# Internal C/C++ libraries #####################################################
cc_library(
name = "arena_internal",
srcs = [
"upb/alloc.h",
"upb/arena.h",
],
hdrs = ["upb/internal/arena.h"],
copts = UPB_DEFAULT_COPTS,
visibility = ["//:__subpackages__"],
deps = [
":port",
],
)
cc_library(
name = "table",
hdrs = [
@ -738,6 +751,7 @@ upb_amalgamation(
"upb.h",
],
libs = [
":arena_internal",
":collections",
":descriptor_upb_proto",
":extension_registry",
@ -764,6 +778,7 @@ upb_amalgamation(
"php-upb.h",
],
libs = [
":arena_internal",
":collections",
":descriptor_upb_proto",
":descriptor_upb_proto_reflection",
@ -793,6 +808,7 @@ upb_amalgamation(
"ruby-upb.h",
],
libs = [
":arena_internal",
":collections",
":descriptor_upb_proto",
":extension_registry",

@ -28,13 +28,13 @@
#ifndef UPB_ALLOC_H_
#define UPB_ALLOC_H_
// Must be last.
#include "upb/port_def.inc"
#ifdef __cplusplus
extern "C" {
#endif
struct upb_alloc;
typedef struct upb_alloc upb_alloc;
/* A combined `malloc()`/`free()` function.

@ -28,7 +28,6 @@
#ifndef UPB_ARENA_H_
#define UPB_ARENA_H_
#include <stdbool.h>
#include <string.h>
#include "upb/alloc.h"
@ -54,7 +53,6 @@ extern "C" {
typedef void upb_CleanupFunc(void* ud);
struct upb_Arena;
typedef struct upb_Arena upb_Arena;
typedef struct {

@ -29,8 +29,9 @@
#include <string.h>
#include "upb/internal/table.h"
#include "upb/msg.h"
// Must be last.
#include "upb/port_def.inc"
static const char _upb_CTypeo_sizelg2[12] = {

@ -28,7 +28,6 @@
#ifndef UPB_ARRAY_H_
#define UPB_ARRAY_H_
#include "google/protobuf/descriptor.upb.h"
#include "upb/message_value.h"
// Must be last.

@ -29,8 +29,9 @@
#include <string.h>
#include "upb/internal/table.h"
#include "upb/msg.h"
// Must be last.
#include "upb/port_def.inc"
/* Strings/bytes are special-cased in maps. */

@ -28,7 +28,6 @@
#ifndef UPB_MAP_H_
#define UPB_MAP_H_
#include "google/protobuf/descriptor.upb.h"
#include "upb/message_value.h"
// Must be last.

Loading…
Cancel
Save