upb: use the new reflection headers

Reflection headers now live in upb/reflection/ so update our include statements to
reflect this. (See what I did there?)

PiperOrigin-RevId: 474596615
pull/13171/head
Eric Salo 2 years ago committed by Copybara-Service
parent 38d8430923
commit edecfd5eb0
  1. 18
      BUILD
  2. 2
      benchmarks/benchmark.cc
  3. 2
      python/convert.c
  4. 4
      python/convert.h
  5. 2
      python/descriptor.c
  6. 2
      python/descriptor.h
  7. 2
      python/descriptor_containers.c
  8. 2
      python/descriptor_containers.h
  9. 2
      python/descriptor_pool.c
  10. 2
      python/map.c
  11. 2
      python/map.h
  12. 4
      python/message.c
  13. 2
      python/message.h
  14. 2
      python/repeated.h
  15. 2
      upb/bindings/lua/def.c
  16. 2
      upb/bindings/lua/msg.c
  17. 4
      upb/bindings/lua/upb.h
  18. 2
      upb/conformance_upb.c
  19. 2
      upb/json_decode.c
  20. 2
      upb/json_decode.h
  21. 2
      upb/json_decode_test.cc
  22. 2
      upb/json_encode.c
  23. 2
      upb/json_encode.h
  24. 5
      upb/json_encode_test.cc
  25. 2
      upb/msg_test.cc
  26. 4
      upb/test_cpp.cc
  27. 2
      upb/text_encode.c
  28. 2
      upb/text_encode.h
  29. 2
      upb/util/compare.h
  30. 2
      upb/util/def_to_proto.c
  31. 2
      upb/util/def_to_proto.h
  32. 4
      upb/util/def_to_proto_test.cc
  33. 2
      upb/util/required_fields.c
  34. 4
      upb/util/required_fields.h
  35. 4
      upb/util/required_fields_test.cc
  36. 6
      upbc/protoc-gen-upbdefs.cc

18
BUILD

@ -326,15 +326,31 @@ cc_library(
cc_library(
name = "generated_reflection_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me",
srcs = [
"upb/reflection/common.h",
"upb/reflection/def_pool.h",
"upb/reflection/def_type.h",
"upb/reflection/enum_def.h",
"upb/reflection/enum_value_def.h",
"upb/reflection/extension_range.h",
"upb/reflection/field_def.h",
"upb/reflection/file_def.h",
"upb/reflection/message_def.h",
"upb/reflection/method_def.h",
"upb/reflection/oneof_def.h",
"upb/reflection/service_def.h",
],
hdrs = [
"upb/def.h",
"upb/port_def.inc",
"upb/port_undef.inc",
"upb/reflection/def.h",
],
copts = UPB_DEFAULT_COPTS,
visibility = ["//visibility:public"],
deps = [
":descriptor_upb_proto",
":reflection",
":table_internal",
],
)

@ -35,7 +35,7 @@
#include "benchmarks/descriptor.upb.h"
#include "benchmarks/descriptor.upbdefs.h"
#include "benchmarks/descriptor_sv.pb.h"
#include "upb/def.hpp"
#include "upb/reflection/def.hpp"
upb_StringView descriptor = benchmarks_descriptor_proto_upbdefinit.descriptor;
namespace protobuf = ::google::protobuf;

@ -30,7 +30,7 @@
#include "python/message.h"
#include "python/protobuf.h"
#include "upb/map.h"
#include "upb/reflection.h"
#include "upb/reflection/message.h"
#include "upb/util/compare.h"
// Must be last.

@ -29,8 +29,8 @@
#define PYUPB_CONVERT_H__
#include "protobuf.h"
#include "upb/def.h"
#include "upb/reflection.h"
#include "upb/reflection/def.h"
#include "upb/reflection/message.h"
// Converts `val` to a Python object according to the type information in `f`.
// Any newly-created Python objects that reference non-primitive data from `val`

@ -32,7 +32,7 @@
#include "python/descriptor_pool.h"
#include "python/message.h"
#include "python/protobuf.h"
#include "upb/def.h"
#include "upb/reflection/def.h"
#include "upb/util/def_to_proto.h"
// -----------------------------------------------------------------------------

@ -31,7 +31,7 @@
#include <stdbool.h>
#include "python/python_api.h"
#include "upb/def.h"
#include "upb/reflection/def.h"
typedef enum {
kPyUpb_Descriptor = 0,

@ -29,7 +29,7 @@
#include "python/descriptor.h"
#include "python/protobuf.h"
#include "upb/def.h"
#include "upb/reflection/def.h"
// Implements __repr__ as str(dict(self)).
static PyObject* PyUpb_DescriptorMap_Repr(PyObject* _self) {

@ -43,7 +43,7 @@
#include <stdbool.h>
#include "protobuf.h"
#include "upb/def.h"
#include "upb/reflection/def.h"
// -----------------------------------------------------------------------------
// PyUpb_GenericSequence

@ -32,7 +32,7 @@
#include "python/descriptor.h"
#include "python/message.h"
#include "python/protobuf.h"
#include "upb/def.h"
#include "upb/reflection/def.h"
#include "upb/util/def_to_proto.h"
// -----------------------------------------------------------------------------

@ -30,8 +30,8 @@
#include "python/convert.h"
#include "python/message.h"
#include "python/protobuf.h"
#include "upb/def.h"
#include "upb/map.h"
#include "upb/reflection/def.h"
// -----------------------------------------------------------------------------
// MapContainer

@ -31,7 +31,7 @@
#include <stdbool.h>
#include "python/python_api.h"
#include "upb/def.h"
#include "upb/reflection/def.h"
// Creates a new repeated field stub for field `f` of message object `parent`.
// Precondition: `parent` must be a stub.

@ -32,8 +32,8 @@
#include "python/extension_dict.h"
#include "python/map.h"
#include "python/repeated.h"
#include "upb/def.h"
#include "upb/reflection.h"
#include "upb/reflection/def.h"
#include "upb/reflection/message.h"
#include "upb/text_encode.h"
#include "upb/util/required_fields.h"

@ -31,7 +31,7 @@
#include <stdbool.h>
#include "python/protobuf.h"
#include "upb/reflection.h"
#include "upb/reflection/message.h"
// Removes the wrapper object for this field from the unset subobject cache.
void PyUpb_Message_CacheDelete(PyObject* _self, const upb_FieldDef* f);

@ -31,7 +31,7 @@
#include <stdbool.h>
#include "python/python_api.h"
#include "upb/def.h"
#include "upb/reflection/def.h"
// Creates a new repeated field stub for field `f` of message object `parent`.
// Precondition: `parent` must be a stub.

@ -25,7 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "upb/def.h"
#include "upb/reflection/def.h"
#include <float.h>
#include <math.h>

@ -43,7 +43,7 @@
#include "upb/json_encode.h"
#include "upb/map.h"
#include "upb/port_def.inc"
#include "upb/reflection.h"
#include "upb/reflection/message.h"
#include "upb/text_encode.h"
/*

@ -33,9 +33,9 @@
#define UPB_LUA_UPB_H_
#include "lauxlib.h"
#include "upb/def.h"
#include "upb/msg.h"
#include "upb/reflection.h"
#include "upb/reflection/def.h"
#include "upb/reflection/message.h"
/* Lua changes its API in incompatible ways in every minor release.
* This is some shim code to paper over the differences. */

@ -43,7 +43,7 @@
#include "upb/encode.h"
#include "upb/json_decode.h"
#include "upb/json_encode.h"
#include "upb/reflection.h"
#include "upb/reflection/message.h"
#include "upb/text_encode.h"
// Must be last.

@ -39,7 +39,7 @@
#include "upb/internal/atoi.h"
#include "upb/internal/unicode.h"
#include "upb/map.h"
#include "upb/reflection.h"
#include "upb/reflection/message.h"
// Must be last.
#include "upb/port_def.inc"

@ -28,7 +28,7 @@
#ifndef UPB_JSONDECODE_H_
#define UPB_JSONDECODE_H_
#include "upb/def.h"
#include "upb/reflection/def.h"
// Must be last.
#include "upb/port_def.inc"

@ -31,9 +31,9 @@
#include "google/protobuf/struct.upb.h"
#include "gtest/gtest.h"
#include "upb/def.hpp"
#include "upb/json_test.upb.h"
#include "upb/json_test.upbdefs.h"
#include "upb/reflection/def.hpp"
#include "upb/upb.hpp"
static upb_test_Box* JsonDecode(const char* json, upb_Arena* a) {

@ -39,7 +39,7 @@
#include "upb/internal/encode.h"
#include "upb/internal/vsnprintf_compat.h"
#include "upb/map.h"
#include "upb/reflection.h"
#include "upb/reflection/message.h"
// Must be last.
#include "upb/port_def.inc"

@ -28,7 +28,7 @@
#ifndef UPB_JSONENCODE_H_
#define UPB_JSONENCODE_H_
#include "upb/def.h"
#include "upb/reflection/def.h"
// Must be last.
#include "upb/port_def.inc"

@ -25,12 +25,13 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "upb/json_encode.h"
#include "google/protobuf/struct.upb.h"
#include "gtest/gtest.h"
#include "upb/def.hpp"
#include "upb/json_encode.h"
#include "upb/json_test.upb.h"
#include "upb/json_test.upbdefs.h"
#include "upb/reflection/def.hpp"
#include "upb/upb.hpp"
static std::string JsonEncode(const upb_test_Box* msg, int options) {

@ -28,12 +28,12 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "google/protobuf/test_messages_proto3.upb.h"
#include "upb/def.hpp"
#include "upb/fuzz_test_util.h"
#include "upb/json_decode.h"
#include "upb/json_encode.h"
#include "upb/msg_test.upb.h"
#include "upb/msg_test.upbdefs.h"
#include "upb/reflection/def.hpp"
#include "upb/upb.hpp"
// begin:google_only

@ -38,10 +38,10 @@
#include "google/protobuf/timestamp.upb.h"
#include "google/protobuf/timestamp.upbdefs.h"
#include "gtest/gtest.h"
#include "upb/def.h"
#include "upb/def.hpp"
#include "upb/json_decode.h"
#include "upb/json_encode.h"
#include "upb/reflection/def.h"
#include "upb/reflection/def.hpp"
#include "upb/test_cpp.upb.h"
#include "upb/test_cpp.upbdefs.h"
#include "upb/upb.h"

@ -37,7 +37,7 @@
#include "upb/internal/encode.h"
#include "upb/internal/vsnprintf_compat.h"
#include "upb/map.h"
#include "upb/reflection.h"
#include "upb/reflection/message.h"
// Must be last.
#include "upb/port_def.inc"

@ -28,7 +28,7 @@
#ifndef UPB_TEXTENCODE_H_
#define UPB_TEXTENCODE_H_
#include "upb/def.h"
#include "upb/reflection/def.h"
// Must be last.
#include "upb/port_def.inc"

@ -28,7 +28,7 @@
#ifndef UPB_UTIL_COMPARE_H_
#define UPB_UTIL_COMPARE_H_
#include "upb/def.h"
#include "upb/reflection/def.h"
#ifdef __cplusplus
extern "C" {

@ -33,7 +33,7 @@
#include <stdio.h>
#include "upb/internal/vsnprintf_compat.h"
#include "upb/reflection.h"
#include "upb/reflection/message.h"
/* Must be last. */
#include "upb/port_def.inc"

@ -28,7 +28,7 @@
#ifndef UPB_UTIL_DEF_TO_PROTO_H_
#define UPB_UTIL_DEF_TO_PROTO_H_
#include "upb/def.h"
#include "upb/reflection/def.h"
#ifdef __cplusplus
extern "C" {

@ -27,13 +27,13 @@
#include "upb/util/def_to_proto.h"
#include "gmock/gmock.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/descriptor.upbdefs.h"
#include "google/protobuf/dynamic_message.h"
#include "google/protobuf/util/message_differencer.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "upb/def.hpp"
#include "upb/reflection/def.hpp"
#include "upb/upb.hpp"
#include "upb/util/def_to_proto_test.upbdefs.h"

@ -34,7 +34,7 @@
#include "upb/internal/vsnprintf_compat.h"
#include "upb/map.h"
#include "upb/reflection.h"
#include "upb/reflection/message.h"
// Must be last.
#include "upb/port_def.inc"

@ -28,8 +28,8 @@
#ifndef UPB_UTIL_REQUIRED_FIELDS_H_
#define UPB_UTIL_REQUIRED_FIELDS_H_
#include "upb/def.h"
#include "upb/reflection.h"
#include "upb/reflection/def.h"
#include "upb/reflection/message.h"
/* Must be last. */
#include "upb/port_def.inc"

@ -27,11 +27,11 @@
#include "upb/util/required_fields.h"
#include "absl/strings/string_view.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "upb/def.hpp"
#include "absl/strings/string_view.h"
#include "upb/json_decode.h"
#include "upb/reflection/def.hpp"
#include "upb/upb.hpp"
#include "upb/util/required_fields_test.upb.h"
#include "upb/util/required_fields_test.upbdefs.h"

@ -69,14 +69,14 @@ void WriteDefHeader(const protobuf::FileDescriptor* file, Output& output) {
output(
"#ifndef $0_UPBDEFS_H_\n"
"#define $0_UPBDEFS_H_\n\n"
"#include \"upb/def.h\"\n"
"#include \"upb/reflection/def.h\"\n"
"#include \"upb/port_def.inc\"\n"
"#ifdef __cplusplus\n"
"extern \"C\" {\n"
"#endif\n\n",
ToPreproc(file->name()));
output("#include \"upb/def.h\"\n");
output("#include \"upb/reflection/def.h\"\n");
output("\n");
output("#include \"upb/port_def.inc\"\n");
output("\n");
@ -102,7 +102,7 @@ void WriteDefHeader(const protobuf::FileDescriptor* file, Output& output) {
void WriteDefSource(const protobuf::FileDescriptor* file, Output& output) {
EmitFileWarning(file, output);
output("#include \"upb/def.h\"\n");
output("#include \"upb/reflection/def.h\"\n");
output("#include \"$0\"\n", DefHeaderFilename(file->name()));
output("#include \"$0\"\n", HeaderFilename(file));
output("\n");

Loading…
Cancel
Save