diff --git a/.bazelignore b/.bazelignore index 35656cd2d7..dc5c301299 100644 --- a/.bazelignore +++ b/.bazelignore @@ -1,6 +1,4 @@ # These are fetched as external repositories. third_party/abseil-cpp third_party/googletest -# upb is its own Bazel repository for now. -upb/ _build/ diff --git a/.github/workflows/test_python.yml b/.github/workflows/test_python.yml index 61d336bee1..8b00ada212 100644 --- a/.github/workflows/test_python.yml +++ b/.github/workflows/test_python.yml @@ -20,7 +20,7 @@ jobs: version: [ "3.7", "3.8", "3.9", "3.10" ] include: - type: Pure - targets: //python/... @upb//python/... //python:python_version + targets: //python/... //upb/python/... //python:python_version flags: --define=use_fast_cpp_protos=false - type: C++ targets: //python/... //python:python_version @@ -57,7 +57,7 @@ jobs: version: [ "3.10" ] include: - type: Pure - targets: //python/... @upb//python/... //python:python_version + targets: //python/... //upb/python/... //python:python_version - type: C++ targets: //python/... //python:python_version flags: --define=use_fast_cpp_protos=true diff --git a/.github/workflows/test_upb.yml b/.github/workflows/test_upb.yml index b2a152ba64..4c82671c64 100644 --- a/.github/workflows/test_upb.yml +++ b/.github/workflows/test_upb.yml @@ -19,10 +19,10 @@ jobs: config: - { name: "Fastbuild" } - { name: "Optimized", flags: "-c opt" } - - { name: "FastTable", flags: "--@upb//:fasttable_enabled=true" } - - { name: "ASAN", flags: "--config=asan -c dbg", exclude-targets: "-@upb//benchmarks:benchmark -@upb//python/..." } - - { name: "UBSAN", flags: "--config=ubsan -c dbg", exclude-targets: "-@upb//benchmarks:benchmark -@upb//python/... -@upb//lua/..." } - - { name: "32-bit", flags: "--copt=-m32 --linkopt=-m32", exclude-targets: "-@upb//benchmarks:benchmark -@upb//python/..." } + - { name: "FastTable", flags: "--//upb:fasttable_enabled=true" } + - { name: "ASAN", flags: "--config=asan -c dbg", exclude-targets: "-//upb/benchmarks:benchmark -//upb/python/..." } + - { name: "UBSAN", flags: "--config=ubsan -c dbg", exclude-targets: "-//upb/benchmarks:benchmark -//upb/python/... -//upb/lua/..." } + - { name: "32-bit", flags: "--copt=-m32 --linkopt=-m32", exclude-targets: "-//upb/benchmarks:benchmark -//upb/python/..." } # TODO: b/297027295 - Add 32-bit ASAN test name: ${{ matrix.config.name }} @@ -39,7 +39,7 @@ jobs: image: us-docker.pkg.dev/protobuf-build/containers/test/linux/sanitize@sha256:04cd765285bc52cbbf51d66c8c66d8603579cf0f19cc42df26b09d2c270541fb credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} bazel-cache: upb-bazel - bazel: test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 @upb//... ${{ matrix.config.flags }} + bazel: test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 //upb/... ${{ matrix.config.flags }} exclude-targets: ${{ matrix.config.exclude-targets }} linux-gcc: @@ -58,12 +58,7 @@ jobs: image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/gcc:12.2-6.3.0-518b4fcd8d0ded2484c94f02e835526cacfdac2d" credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} bazel-cache: "upb-bazel-gcc" - # The other test runs use the protobuf workspace. For this one let's - # cd into upb and use its workspace instead, to make sure we cover - # that use case. - bash: >- - cd upb && - bazel test $BAZEL_FLAGS --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 -c opt //... + bazel: test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 -c opt //upb/... windows: strategy: @@ -80,7 +75,7 @@ jobs: with: credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} bazel-cache: "upb-bazel-windows" - bazel: test --cxxopt=/std:c++17 --host_cxxopt=/std:c++17 @upb//upb/... @upb//upbc/... @upb//python/... @upb//protos/... @upb//protos_generator/... + bazel: test --cxxopt=/std:c++17 --host_cxxopt=/std:c++17 //upb/upb/... //upb/upbc/... //upb/python/... //upb/protos/... //upb/protos_generator/... macos: strategy: @@ -101,7 +96,7 @@ jobs: with: credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }} bazel-cache: "upb-bazel-macos" - bazel: ${{ matrix.config.bazel-command }} --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 ${{ matrix.config.flags }} @upb//... + bazel: ${{ matrix.config.bazel-command }} --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 ${{ matrix.config.flags }} //upb/... no-python: strategy: @@ -123,4 +118,4 @@ jobs: which python3 && mv `which python3` /tmp && ! which python3 && - bazel test $BAZEL_FLAGS --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 @upb//python/... -- -@upb//python/dist:source_wheel + bazel test $BAZEL_FLAGS --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 //upb/python/... -- -//upb/python/dist:source_wheel diff --git a/BUILD.bazel b/BUILD.bazel index a5fa012e12..88a1999682 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -294,13 +294,13 @@ alias( alias( name = "python_srcs", actual = "//python:python_srcs", - visibility = ["@upb//:__subpackages__"], + visibility = ["//upb:__subpackages__"], ) alias( name = "python_test_srcs", actual = "//python:python_test_srcs", - visibility = ["@upb//:__subpackages__"], + visibility = ["//upb:__subpackages__"], ) alias( diff --git a/WORKSPACE b/WORKSPACE index 73aada1d3a..95a31a050a 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -7,15 +7,6 @@ local_repository( path = "examples", ) -# We will soon merge upb and protobuf into the same Bazel repository, but for -# now we depend on the separate Bazel repo in the upb/ directory. This is -# important to ensure that the CI tests exercise upb at head instead of relying -# on a stale version from protobuf_deps.bzl. -local_repository( - name = "upb", - path = "upb", -) - # Load common dependencies first to ensure we use the correct version load("//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS", "protobuf_deps") @@ -116,13 +107,13 @@ ruby_bundle( gemfile = "//ruby:Gemfile", ) -load("@upb//bazel:workspace_deps.bzl", "upb_deps") +load("//upb/bazel:workspace_deps.bzl", "upb_deps") upb_deps() http_archive( name = "lua", - build_file = "@upb//bazel:lua.BUILD", + build_file = "//upb/bazel:lua.BUILD", sha256 = "b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b", strip_prefix = "lua-5.2.4", urls = [ @@ -143,11 +134,11 @@ http_archive( urls = ["https://github.com/googleapis/googleapis/archive/30ed2662a85403cbdeb9ea38df1e414a2a276b83.zip"], strip_prefix = "googleapis-30ed2662a85403cbdeb9ea38df1e414a2a276b83", sha256 = "4dfc28101127d22abd6f0f6308d915d490c4594c0cfcf7643769c446d6763a46", - build_file = "@upb//benchmarks:BUILD.googleapis", + build_file = "//upb/benchmarks:BUILD.googleapis", patch_cmds = ["find google -type f -name BUILD.bazel -delete"], ) -load("@upb//bazel:system_python.bzl", "system_python") +load("//upb/bazel:system_python.bzl", "system_python") system_python( name = "system_python", @@ -158,9 +149,9 @@ load("@system_python//:pip.bzl", "pip_parse") pip_parse( name = "pip_deps", - requirements = "@upb//python:requirements.txt", + requirements = "//upb/python:requirements.txt", requirements_overrides = { - "3.11": "@upb//python:requirements_311.txt", + "3.11": "//upb/python:requirements_311.txt", }, ) diff --git a/objectivec/BUILD.bazel b/objectivec/BUILD.bazel index c59bf0e60c..70727ccd1d 100644 --- a/objectivec/BUILD.bazel +++ b/objectivec/BUILD.bazel @@ -1,6 +1,6 @@ load("@rules_cc//cc:defs.bzl", "objc_library") load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") -load("@upb//cmake:build_defs.bzl", "staleness_test") +load("//upb/cmake:build_defs.bzl", "staleness_test") load("//conformance:defs.bzl", "conformance_test") load(":defs.bzl", "objc_proto_camel_case_name") diff --git a/php/BUILD.bazel b/php/BUILD.bazel index dc40603497..966b3e2c5e 100644 --- a/php/BUILD.bazel +++ b/php/BUILD.bazel @@ -4,7 +4,7 @@ load("@rules_pkg//:mappings.bzl", "pkg_files", "pkg_filegroup", "strip_prefix") load("@rules_pkg//:pkg.bzl", "pkg_tar") -load("@upb//cmake:build_defs.bzl", "staleness_test") +load("//upb/cmake:build_defs.bzl", "staleness_test") load("//build_defs:internal_shell.bzl", "inline_sh_binary") load("//conformance:defs.bzl", "conformance_test") load("//:protobuf_version.bzl", "PROTOBUF_PHP_VERSION", "PROTOC_VERSION") @@ -85,14 +85,14 @@ conformance_test( genrule( name = "copy_php_amalgamation_h", - srcs = ["@upb//:php-upb.h"], + srcs = ["//upb:php-upb.h"], outs = ["generated-in/ext/google/protobuf/php-upb.h"], cmd = "cp $< $@", ) genrule( name = "copy_php_amalgamation_c", - srcs = ["@upb//:php-upb.c"], + srcs = ["//upb:php-upb.c"], outs = ["generated-in/ext/google/protobuf/php-upb.c"], cmd = "cp $< $@", ) diff --git a/python/BUILD.bazel b/python/BUILD.bazel index 192c08a9a4..45fedf13a5 100644 --- a/python/BUILD.bazel +++ b/python/BUILD.bazel @@ -46,7 +46,7 @@ internal_py_proto_library( srcs_version = "PY2AND3", visibility = [ "//:__pkg__", - "@upb//:__subpackages__", + "//upb:__subpackages__", ], ) @@ -152,7 +152,7 @@ py_library( srcs_version = "PY2AND3", visibility = [ "//:__pkg__", - "@upb//:__subpackages__", + "//upb:__subpackages__", ], ) @@ -170,7 +170,7 @@ py_library( srcs_version = "PY3", visibility = [ "//:__pkg__", - "@upb//:__subpackages__", + "//upb:__subpackages__", ], ) @@ -437,7 +437,7 @@ pkg_files( "tox.ini", ], strip_prefix = "", - visibility = ["@upb//:__subpackages__"], + visibility = ["//upb:__subpackages__"], ) pkg_files( diff --git a/python/README.md b/python/README.md index dc4b1d07ff..baa58c2c99 100644 --- a/python/README.md +++ b/python/README.md @@ -21,8 +21,8 @@ If for some reason you wish to build the packages directly from this repo, you can use the following Bazel commands: ``` -$ bazel build @upb//python/dist:source_wheel -$ bazel build @upb//python/dist:binary_wheel +$ bazel build //upb/python/dist:source_wheel +$ bazel build //upb/python/dist:binary_wheel ``` The binary wheel will build against whatever version of Python is installed on @@ -49,7 +49,7 @@ following values: better performance than any of the previous backends, and it is now the default. It is distributed in our PyPI packages, and requires no special installation. The code for this module lives in - [@upb/python](https://github.com/protocolbuffers/upb/tree/main/python). + [upb/python](https://github.com/protocolbuffers/protobuf/tree/main/upb/python). 1. **cpp**: This extension module wraps the C++ protobuf library. It is deprecated and is no longer released in our PyPI packages, however it is still used in some legacy cases where apps want to perform zero-copy message diff --git a/python/google/protobuf/internal/numpy/BUILD.bazel b/python/google/protobuf/internal/numpy/BUILD.bazel index d88ae8aec1..5c1c16627d 100644 --- a/python/google/protobuf/internal/numpy/BUILD.bazel +++ b/python/google/protobuf/internal/numpy/BUILD.bazel @@ -18,6 +18,6 @@ internal_py_test( ], visibility = [ "//python:__pkg__", - "@upb//python/pb_unit_tests:__pkg__", + "//upb/python/pb_unit_tests:__pkg__", ] ) diff --git a/regenerate_stale_files.sh b/regenerate_stale_files.sh index db0d13c222..c96693ac10 100755 --- a/regenerate_stale_files.sh +++ b/regenerate_stale_files.sh @@ -18,7 +18,7 @@ ${BazelBin} test src/google/protobuf:well_known_types_staleness_test "$@" || ./b ${BazelBin} test objectivec:well_known_types_staleness_test "$@" || ./bazel-bin/objectivec/well_known_types_staleness_test --fix ${BazelBin} test php:test_amalgamation_staleness "$@" || ./bazel-bin/php/test_amalgamation_staleness --fix ${BazelBin} test ruby/ext/google/protobuf_c:test_amalgamation_staleness "$@" || ./bazel-bin/ruby/ext/google/protobuf_c/test_amalgamation_staleness --fix -(cd upb; ${BazelBin} test cmake:test_generated_files "$@" || ./bazel-bin/cmake/test_generated_files --fix) +${BazelBin} test upb/cmake:test_generated_files "$@" || ./bazel-bin/upb/cmake/test_generated_files --fix # Generate C# code. # This doesn't currently have Bazel staleness tests, but there's an existing diff --git a/ruby/ext/google/protobuf_c/BUILD.bazel b/ruby/ext/google/protobuf_c/BUILD.bazel index b2a6310c1e..755a249ce1 100644 --- a/ruby/ext/google/protobuf_c/BUILD.bazel +++ b/ruby/ext/google/protobuf_c/BUILD.bazel @@ -1,6 +1,6 @@ load("@build_bazel_rules_apple//apple:apple_binary.bzl", "apple_binary") load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") -load("@upb//cmake:build_defs.bzl", "staleness_test") +load("//upb/cmake:build_defs.bzl", "staleness_test") package(default_visibility = ["//ruby:__subpackages__"]) @@ -31,7 +31,7 @@ genrule( name = "copy_sources", srcs = PROTOBUF_C_SOURCES + [ "glue.c", - "@upb//:gen_ruby_amalgamation", + "//upb:gen_ruby_amalgamation", ], outs = ["copy/%s" % src for src in PROTOBUF_C_SOURCES] + [ "copy/glue.c", @@ -155,14 +155,14 @@ pkg_files( genrule( name = "copy_ruby_amalgamation_h", - srcs = ["@upb//:ruby-upb.h"], + srcs = ["//upb:ruby-upb.h"], outs = ["generated-in/ruby-upb.h"], cmd = "cp $< $@", ) genrule( name = "copy_ruby_amalgamation_c", - srcs = ["@upb//:ruby-upb.c"], + srcs = ["//upb:ruby-upb.c"], outs = ["generated-in/ruby-upb.c"], cmd = "cp $< $@", ) diff --git a/rust/aspects.bzl b/rust/aspects.bzl index 4639f7965c..506f18e828 100644 --- a/rust/aspects.bzl +++ b/rust/aspects.bzl @@ -9,7 +9,7 @@ load("@rules_rust//rust/private:providers.bzl", "CrateInfo", "DepInfo", "DepVari # buildifier: disable=bzl-visibility load("@rules_rust//rust/private:rustc.bzl", "rustc_compile_action") load("@rules_rust//rust:defs.bzl", "rust_common") -load("@upb//bazel:upb_proto_library.bzl", "UpbWrappedCcInfo", "upb_proto_library_aspect") +load("//upb/bazel:upb_proto_library.bzl", "UpbWrappedCcInfo", "upb_proto_library_aspect") load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain") proto_common = proto_common_do_not_use diff --git a/rust/upb_kernel/BUILD b/rust/upb_kernel/BUILD index ecff4ce26f..653063cb7e 100644 --- a/rust/upb_kernel/BUILD +++ b/rust/upb_kernel/BUILD @@ -8,6 +8,6 @@ cc_library( "//rust:__subpackages__", ], deps = [ - "@upb//:upb", + "//upb", ], ) diff --git a/rust/upb_kernel/upb_api.c b/rust/upb_kernel/upb_api.c index 985749da23..c4eb226ba3 100644 --- a/rust/upb_kernel/upb_api.c +++ b/rust/upb_kernel/upb_api.c @@ -8,4 +8,4 @@ #define UPB_BUILD_API -#include "upb/mem/arena.h" // IWYU pragma: keep +#include "upb/upb/mem/arena.h" // IWYU pragma: keep diff --git a/src/BUILD.bazel b/src/BUILD.bazel index 0de1a4eb19..96b7001169 100644 --- a/src/BUILD.bazel +++ b/src/BUILD.bazel @@ -4,7 +4,7 @@ # Most rules are under google/protobuf. This package exists for convenience. load("@rules_pkg//:mappings.bzl", "pkg_filegroup", "pkg_files", "strip_prefix") -load("@upb//cmake:build_defs.bzl", "staleness_test") +load("//upb/cmake:build_defs.bzl", "staleness_test") load("//conformance:defs.bzl", "conformance_test") pkg_files( diff --git a/src/google/protobuf/BUILD.bazel b/src/google/protobuf/BUILD.bazel index acbc6a108e..6e70f79336 100644 --- a/src/google/protobuf/BUILD.bazel +++ b/src/google/protobuf/BUILD.bazel @@ -5,7 +5,7 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_proto_library", "cc_test") load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") load("@rules_proto//proto:defs.bzl", "proto_library") -load("@upb//cmake:build_defs.bzl", "staleness_test") +load("//upb/cmake:build_defs.bzl", "staleness_test") load("//build_defs:cpp_opts.bzl", "COPTS", "LINK_OPTS") package( @@ -636,7 +636,6 @@ filegroup( ], visibility = [ "//:__subpackages__", - "@upb//:__subpackages__", ], ) @@ -786,7 +785,7 @@ proto_library( visibility = [ "//:__pkg__", "//conformance:__pkg__", - "@upb//:__subpackages__", + "//upb:__subpackages__", ], ) @@ -797,7 +796,7 @@ proto_library( visibility = [ "//:__pkg__", "//conformance:__pkg__", - "@upb//:__subpackages__", + "//upb:__subpackages__", ], deps = [ ":any_proto", diff --git a/src/google/protobuf/compiler/BUILD.bazel b/src/google/protobuf/compiler/BUILD.bazel index b5ee0c1a66..e85d9f5854 100644 --- a/src/google/protobuf/compiler/BUILD.bazel +++ b/src/google/protobuf/compiler/BUILD.bazel @@ -200,7 +200,7 @@ filegroup( filegroup( name = "plugin_proto_src", srcs = ["plugin.proto"], - visibility = ["@upb//:__subpackages__"], + visibility = ["//upb:__subpackages__"], ) exports_files( diff --git a/upb/BUILD b/upb/BUILD index adea12ff35..e1ab3447ec 100644 --- a/upb/BUILD +++ b/upb/BUILD @@ -7,14 +7,14 @@ load("@rules_python//python:defs.bzl", "py_binary") load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") -load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") load( - "//bazel:upb_proto_library.bzl", + "//upb/bazel:upb_proto_library.bzl", "upb_proto_library_copts", "upb_proto_reflection_library", ) load( - "//upbc:bootstrap_compiler.bzl", + "//upb/upbc:bootstrap_compiler.bzl", "bootstrap_cc_library", "bootstrap_upb_proto_library", ) @@ -26,13 +26,13 @@ load( # begin:github_only load( - "//bazel:amalgamation.bzl", + "//upb/bazel:amalgamation.bzl", "upb_amalgamation", ) # end:github_only # begin:google_only -# package(default_applicable_licenses = ["//:license"]) +# package(default_applicable_licenses = ["//upb:license"]) # # license( # name = "license", @@ -49,7 +49,7 @@ exports_files( "BUILD", "WORKSPACE", ], - visibility = ["//cmake:__pkg__"], + visibility = ["//upb/cmake:__pkg__"], ) config_setting( @@ -66,7 +66,7 @@ bool_flag( config_setting( name = "fasttable_enabled_setting", - flag_values = {"//:fasttable_enabled": "true"}, + flag_values = {"//upb:fasttable_enabled": "true"}, visibility = ["//visibility:public"], ) @@ -109,7 +109,7 @@ cc_library( hdrs = ["upb/generated_code_support.h"], copts = UPB_DEFAULT_COPTS, textual_hdrs = [ - "//upb/port:inc", + "//upb/upb/port:inc", ], visibility = ["//visibility:public"], deps = [ @@ -133,7 +133,7 @@ cc_library( name = "generated_cpp_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", copts = UPB_DEFAULT_COPTS, textual_hdrs = [ - "//upb/port:inc", + "//upb/upb/port:inc", ], visibility = ["//visibility:public"], ) @@ -146,7 +146,7 @@ cc_library( ], copts = UPB_DEFAULT_COPTS, textual_hdrs = [ - "//upb/port:inc", + "//upb/upb/port:inc", ], visibility = ["//visibility:public"], deps = [ @@ -164,16 +164,16 @@ bootstrap_upb_proto_library( google3_src_files = ["net/proto2/proto/descriptor.proto"], google3_src_rules = ["//net/proto2/proto:descriptor_proto_source"], oss_src_files = ["google/protobuf/descriptor.proto"], - oss_src_rules = ["@com_google_protobuf//:descriptor_proto_srcs"], + oss_src_rules = ["//:descriptor_proto_srcs"], oss_strip_prefix = "third_party/protobuf/github/bootstrap/src", - proto_lib_deps = ["@com_google_protobuf//:descriptor_proto"], + proto_lib_deps = ["//:descriptor_proto"], visibility = ["//visibility:public"], ) upb_proto_reflection_library( name = "descriptor_upb_proto_reflection", visibility = ["//visibility:public"], - deps = ["@com_google_protobuf//:descriptor_proto"], + deps = ["//:descriptor_proto"], ) # TODO(b/232091617): Once we can delete the deprecated forwarding headers @@ -273,196 +273,196 @@ bootstrap_cc_library( alias( name = "base", - actual = "//upb/base", + actual = "//upb/upb/base", visibility = ["//visibility:public"], ) alias( name = "base_internal", - actual = "//upb/base:internal", + actual = "//upb/upb/base:internal", visibility = ["//visibility:public"], ) alias( name = "collections", - actual = "//upb/collections", + actual = "//upb/upb/collections", visibility = ["//visibility:public"], ) alias( name = "collections_internal", - actual = "//upb/collections:internal", + actual = "//upb/upb/collections:internal", visibility = ["//visibility:public"], ) alias( name = "collections_split64", - actual = "//upb/collections:split64", + actual = "//upb/upb/collections:split64", visibility = ["//visibility:public"], ) alias( name = "hash", - actual = "//upb/hash", + actual = "//upb/upb/hash", visibility = ["//visibility:public"], ) alias( name = "json", - actual = "//upb/json", + actual = "//upb/upb/json", visibility = ["//visibility:public"], ) alias( name = "lex", - actual = "//upb/lex", + actual = "//upb/upb/lex", visibility = ["//visibility:public"], ) alias( name = "mem", - actual = "//upb/mem", + actual = "//upb/upb/mem", visibility = ["//visibility:public"], ) alias( name = "mem_internal", - actual = "//upb/mem:internal", - visibility = ["//:__subpackages__"], + actual = "//upb/upb/mem:internal", + visibility = ["//upb:__subpackages__"], ) alias( name = "message", - actual = "//upb/message", + actual = "//upb/upb/message", visibility = ["//visibility:public"], ) alias( name = "message_accessors", - actual = "//upb/message:accessors", + actual = "//upb/upb/message:accessors", visibility = ["//visibility:public"], ) alias( name = "message_accessors_internal", - actual = "//upb/message:accessors_internal", - visibility = ["//:friends"], + actual = "//upb/upb/message:accessors_internal", + visibility = ["//upb:friends"], ) alias( name = "message_copy", - actual = "//upb/message:copy", + actual = "//upb/upb/message:copy", visibility = ["//visibility:public"], ) alias( name = "message_internal", - actual = "//upb/message:internal", + actual = "//upb/upb/message:internal", visibility = ["//visibility:public"], ) alias( name = "message_internal_types", - actual = "//upb/message:internal_types", + actual = "//upb/upb/message:internal_types", visibility = ["//visibility:public"], ) alias( name = "message_promote", - actual = "//upb/message:promote", + actual = "//upb/upb/message:promote", visibility = ["//visibility:public"], ) alias( name = "message_split64", - actual = "//upb/message:split64", + actual = "//upb/upb/message:split64", visibility = ["//visibility:public"], ) alias( name = "message_tagged_ptr", - actual = "//upb/message:tagged_ptr", - visibility = ["//:friends"], + actual = "//upb/upb/message:tagged_ptr", + visibility = ["//upb:friends"], ) alias( name = "message_types", - actual = "//upb/message:types", + actual = "//upb/upb/message:types", visibility = ["//visibility:public"], ) alias( name = "mini_descriptor", - actual = "//upb/mini_descriptor", + actual = "//upb/upb/mini_descriptor", visibility = ["//visibility:public"], ) alias( name = "mini_descriptor_internal", - actual = "//upb/mini_descriptor:internal", - visibility = ["//:__subpackages__"], + actual = "//upb/upb/mini_descriptor:internal", + visibility = ["//upb:__subpackages__"], ) alias( name = "mini_table", - actual = "//upb/mini_table", - visibility = ["//:friends"], + actual = "//upb/upb/mini_table", + visibility = ["//upb:friends"], ) # begin:google_only # alias( # name = "mini_table_compat", -# actual = "//upb/mini_table:compat", +# actual = "//upb/upb/mini_table:compat", # compatible_with = ["//buildenv/target:non_prod"], -# visibility = ["//:friends"], +# visibility = ["//upb:friends"], # ) # end:google_only alias( name = "mini_table_internal", - actual = "//upb/mini_table:internal", + actual = "//upb/upb/mini_table:internal", visibility = ["//visibility:public"], ) alias( name = "port", - actual = "//upb/port", + actual = "//upb/upb/port", visibility = ["//visibility:public"], ) alias( name = "text", - actual = "//upb/text", + actual = "//upb/upb/text", visibility = ["//visibility:public"], ) alias( name = "wire", - actual = "//upb/wire", + actual = "//upb/upb/wire", visibility = ["//visibility:public"], ) alias( name = "wire_internal", - actual = "//upb/wire:internal", + actual = "//upb/upb/wire:internal", visibility = ["//visibility:public"], ) alias( name = "wire_reader", - actual = "//upb/wire:reader", + actual = "//upb/upb/wire:reader", visibility = ["//visibility:public"], ) alias( name = "wire_types", - actual = "//upb/wire:types", + actual = "//upb/upb/wire:types", visibility = ["//visibility:public"], ) alias( name = "eps_copy_input_stream", - actual = "//upb/wire:eps_copy_input_stream", + actual = "//upb/upb/wire:eps_copy_input_stream", visibility = ["//visibility:public"], ) @@ -664,7 +664,7 @@ exports_files( "third_party/lunit/console.lua", "third_party/lunit/lunit.lua", ], - visibility = ["//lua:__pkg__"], + visibility = ["//upb/lua:__pkg__"], ) filegroup( @@ -681,8 +681,8 @@ filegroup( ], ), visibility = [ - "//cmake:__pkg__", - "//python/dist:__pkg__", + "//upb/cmake:__pkg__", + "//upb/python/dist:__pkg__", ] ) # end:github_only @@ -720,7 +720,7 @@ filegroup( # "upb_UnknownToMessage_Status", # "upb_WireType", # ], -# visibility = ["//:__subpackages__"], +# visibility = ["//upb:__subpackages__"], # ) # # end:google_only diff --git a/upb/WORKSPACE b/upb/WORKSPACE deleted file mode 100644 index c0e0a134c9..0000000000 --- a/upb/WORKSPACE +++ /dev/null @@ -1,91 +0,0 @@ -workspace(name = "upb") - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("//bazel:workspace_deps.bzl", "upb_deps") - -local_repository( - name = "com_google_protobuf", - path = "..", -) - -load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") -protobuf_deps() - -upb_deps() - -load("@utf8_range//:workspace_deps.bzl", "utf8_range_deps") -utf8_range_deps() - -http_archive( - name = "lua", - build_file = "//bazel:lua.BUILD", - sha256 = "b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b", - strip_prefix = "lua-5.2.4", - urls = [ - "https://mirror.bazel.build/www.lua.org/ftp/lua-5.2.4.tar.gz", - "https://www.lua.org/ftp/lua-5.2.4.tar.gz", - ], -) - -http_archive( - name = "com_github_google_benchmark", - urls = ["https://github.com/google/benchmark/archive/0baacde3618ca617da95375e0af13ce1baadea47.zip"], - strip_prefix = "benchmark-0baacde3618ca617da95375e0af13ce1baadea47", - sha256 = "62e2f2e6d8a744d67e4bbc212fcfd06647080de4253c97ad5c6749e09faf2cb0", -) - -http_archive( - name = "com_google_googleapis", - urls = ["https://github.com/googleapis/googleapis/archive/refs/heads/master.zip"], - build_file = "//benchmarks:BUILD.googleapis", - strip_prefix = "googleapis-master", - patch_cmds = ["find google -type f -name BUILD.bazel -delete"], -) - -http_archive( - name = "com_google_absl", - sha256 = "e7fdfe0bed87702a22c5b73b6b5fe08bedd25f17d617e52df6061b0f47d480b0", - strip_prefix = "abseil-cpp-e6044634dd7caec2d79a13aecc9e765023768757", - urls = [ - "https://github.com/abseil/abseil-cpp/archive/e6044634dd7caec2d79a13aecc9e765023768757.tar.gz" - ], -) - -http_archive( - name = "com_google_googletest", - sha256 = "730215d76eace9dd49bf74ce044e8daa065d175f1ac891cc1d6bb184ef94e565", - strip_prefix = "googletest-f53219cdcb7b084ef57414efea92ee5b71989558", - urls = [ - "https://github.com/google/googletest/archive/f53219cdcb7b084ef57414efea92ee5b71989558.tar.gz" # 2023-03-16 - ], -) - -load("@com_google_googletest//:googletest_deps.bzl", "googletest_deps") - -googletest_deps() - -load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") - -rules_pkg_dependencies() - -load("//bazel:system_python.bzl", "system_python") -system_python( - name = "system_python", - minimum_python_version = "3.7", -) - -load("@system_python//:register.bzl", "register_system_python") -register_system_python() - -load("@system_python//:pip.bzl", "pip_parse") - -pip_parse( - name="pip_deps", - requirements = "//python:requirements.txt", - requirements_overrides = { - "3.11": "//python:requirements_311.txt", - }, -) - -load("@pip_deps//:requirements.bzl", "install_deps") -install_deps() diff --git a/upb/bazel/BUILD b/upb/bazel/BUILD index 06bb153300..005bb635b1 100644 --- a/upb/bazel/BUILD +++ b/upb/bazel/BUILD @@ -9,20 +9,20 @@ load("@rules_python//python:defs.bzl", "py_binary") load("@bazel_skylib//:bzl_library.bzl", "bzl_library") # begin:google_only -# package(default_applicable_licenses = ["//:license"]) +# package(default_applicable_licenses = ["//upb:license"]) # end:google_only licenses(["notice"]) exports_files( ["workspace_deps.bzl"], - visibility = ["//cmake:__pkg__"], + visibility = ["//upb/cmake:__pkg__"], ) py_binary( name = "amalgamate", srcs = ["amalgamate.py"], - visibility = ["//:__pkg__"], + visibility = ["//upb:__pkg__"], ) # py_proto_library() is private rule, only intended for internal use by upb. diff --git a/upb/bazel/amalgamation.bzl b/upb/bazel/amalgamation.bzl index dd8ddf6b66..206dcb576a 100644 --- a/upb/bazel/amalgamation.bzl +++ b/upb/bazel/amalgamation.bzl @@ -54,7 +54,7 @@ upb_amalgamation = rule( "_amalgamator": attr.label( executable = True, cfg = "exec", - default = "//bazel:amalgamate", + default = "//upb/bazel:amalgamate", ), "prefix": attr.string( default = "", diff --git a/upb/bazel/build_defs.bzl b/upb/bazel/build_defs.bzl index 66c255d7f3..64c877ec3e 100644 --- a/upb/bazel/build_defs.bzl +++ b/upb/bazel/build_defs.bzl @@ -29,13 +29,13 @@ _DEFAULT_COPTS.extend([ # end:github_only UPB_DEFAULT_CPPOPTS = select({ - "//:windows": [], + "//upb:windows": [], "//conditions:default": _DEFAULT_CPPOPTS, }) UPB_DEFAULT_COPTS = select({ - "//:windows": [], - "//:fasttable_enabled_setting": ["-std=gnu99", "-DUPB_ENABLE_FASTTABLE"], + "//upb:windows": [], + "//upb:fasttable_enabled_setting": ["-std=gnu99", "-DUPB_ENABLE_FASTTABLE"], "//conditions:default": _DEFAULT_COPTS, }) diff --git a/upb/bazel/py_proto_library.bzl b/upb/bazel/py_proto_library.bzl index b4a0f04739..08ff9a8f94 100644 --- a/upb/bazel/py_proto_library.bzl +++ b/upb/bazel/py_proto_library.bzl @@ -116,7 +116,7 @@ _py_proto_library_aspect = aspect( "_protoc": attr.label( executable = True, cfg = "exec", - default = "@com_google_protobuf//:protoc", + default = "//:protoc", ), }, implementation = _py_proto_library_aspect_impl, diff --git a/upb/bazel/upb_proto_library.bzl b/upb/bazel/upb_proto_library.bzl index f353fa8aa9..4542263782 100644 --- a/upb/bazel/upb_proto_library.bzl +++ b/upb/bazel/upb_proto_library.bzl @@ -413,25 +413,25 @@ def _get_upb_proto_library_aspect_provides(): upb_proto_library_aspect = aspect( attrs = { "_copts": attr.label( - default = "//:upb_proto_library_copts__for_generated_code_only_do_not_use", + default = "//upb:upb_proto_library_copts__for_generated_code_only_do_not_use", ), "_gen_upb": attr.label( executable = True, cfg = "exec", - default = "//upbc:protoc-gen-upb_stage1", + default = "//upb/upbc:protoc-gen-upb_stage1", ), "_protoc": attr.label( executable = True, cfg = "exec", - default = "@com_google_protobuf//:protoc", + default = "//:protoc", ), "_cc_toolchain": attr.label( default = "@bazel_tools//tools/cpp:current_cc_toolchain", ), "_upb": attr.label_list(default = [ - "//:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", + "//upb:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", ]), - "_fasttable_enabled": attr.label(default = "//:fasttable_enabled"), + "_fasttable_enabled": attr.label(default = "//upb:fasttable_enabled"), }, implementation = upb_proto_library_aspect_impl, provides = _get_upb_proto_library_aspect_provides(), @@ -462,24 +462,24 @@ upb_c_proto_library = upb_proto_library _upb_proto_reflection_library_aspect = aspect( attrs = { "_copts": attr.label( - default = "//:upb_proto_library_copts__for_generated_code_only_do_not_use", + default = "//upb:upb_proto_library_copts__for_generated_code_only_do_not_use", ), "_gen_upbdefs": attr.label( executable = True, cfg = "exec", - default = "//upbc:protoc-gen-upbdefs", + default = "//upb/upbc:protoc-gen-upbdefs", ), "_protoc": attr.label( executable = True, cfg = "exec", - default = "@com_google_protobuf//:protoc", + default = "//:protoc", ), "_cc_toolchain": attr.label( default = "@bazel_tools//tools/cpp:current_cc_toolchain", ), "_upbdefs": attr.label_list( default = [ - "//:generated_reflection_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", + "//upb:generated_reflection_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", ], ), }, diff --git a/upb/bazel/workspace_deps.bzl b/upb/bazel/workspace_deps.bzl index e80ad60c6f..2515a8a598 100644 --- a/upb/bazel/workspace_deps.bzl +++ b/upb/bazel/workspace_deps.bzl @@ -1,6 +1,6 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") -load("//bazel:python_downloads.bzl", "python_nuget_package", "python_source_archive") +load("//upb/bazel:python_downloads.bzl", "python_nuget_package", "python_source_archive") def _github_archive(repo, commit, **kwargs): repo_name = repo.split("/")[-1] diff --git a/upb/benchmarks/BUILD b/upb/benchmarks/BUILD index e074778a5b..8839584602 100644 --- a/upb/benchmarks/BUILD +++ b/upb/benchmarks/BUILD @@ -12,7 +12,7 @@ load("@rules_python//python:defs.bzl", "py_binary") # end:google_only load( - "//bazel:upb_proto_library.bzl", + "//upb/bazel:upb_proto_library.bzl", "upb_proto_library", "upb_proto_reflection_library", ) @@ -25,7 +25,7 @@ load( ) # begin:google_only -# package(default_applicable_licenses = ["//:license"]) +# package(default_applicable_licenses = ["//upb:license"]) # end:google_only licenses(["notice"]) @@ -75,14 +75,14 @@ cc_test( ":benchmark_descriptor_sv_cc_proto", ":benchmark_descriptor_upb_proto", ":benchmark_descriptor_upb_proto_reflection", - "//:base", - "//:base_internal", - "//:descriptor_upb_proto", - "//:mem", - "//:reflection", + "//:protobuf", + "//upb:base", + "//upb:base_internal", + "//upb:descriptor_upb_proto", + "//upb:mem", + "//upb:reflection", "@com_github_google_benchmark//:benchmark_main", "@com_google_absl//absl/container:flat_hash_set", - "@com_google_protobuf//:protobuf", ], ) diff --git a/upb/benchmarks/benchmark.cc b/upb/benchmarks/benchmark.cc index a2e2cc20ea..689ff1bdf4 100644 --- a/upb/benchmarks/benchmark.cc +++ b/upb/benchmarks/benchmark.cc @@ -38,15 +38,15 @@ #include "google/protobuf/descriptor.pb.h" #include "absl/container/flat_hash_set.h" #include "google/protobuf/dynamic_message.h" -#include "benchmarks/descriptor.pb.h" -#include "benchmarks/descriptor.upb.h" -#include "benchmarks/descriptor.upbdefs.h" -#include "benchmarks/descriptor_sv.pb.h" -#include "upb/base/internal/log2.h" -#include "upb/mem/arena.h" -#include "upb/reflection/def.hpp" +#include "upb/benchmarks/descriptor.pb.h" +#include "upb/benchmarks/descriptor.upb.h" +#include "upb/benchmarks/descriptor.upbdefs.h" +#include "upb/benchmarks/descriptor_sv.pb.h" +#include "upb/upb/base/internal/log2.h" +#include "upb/upb/mem/arena.h" +#include "upb/upb/reflection/def.hpp" -upb_StringView descriptor = benchmarks_descriptor_proto_upbdefinit.descriptor; +upb_StringView descriptor = upb_benchmarks_descriptor_proto_upbdefinit.descriptor; namespace protobuf = ::google::protobuf; // A buffer big enough to parse descriptor.proto without going to heap. diff --git a/upb/cmake/BUILD.bazel b/upb/cmake/BUILD.bazel index a18c79776a..9bc240130a 100644 --- a/upb/cmake/BUILD.bazel +++ b/upb/cmake/BUILD.bazel @@ -10,7 +10,7 @@ load( "staleness_test", ) load( - "//bazel:build_defs.bzl", + "//upb/bazel:build_defs.bzl", "make_shell_script", ) @@ -35,21 +35,17 @@ py_binary( genrule( name = "gen_cmakelists", srcs = [ - "//:BUILD", - "//:WORKSPACE", - "//bazel:workspace_deps.bzl", + "//upb:BUILD", ], outs = ["generated-in/CMakeLists.txt"], cmd = "$(location :make_cmakelists) " + - "$(location //bazel:workspace_deps.bzl) " + - "$(location //:WORKSPACE) " + - "$(location //:BUILD) $@", + "$(location //upb:BUILD) $@", tools = [":make_cmakelists"], ) genrule( name = "copy_protos", - srcs = ["//:descriptor_upb_proto"], + srcs = ["//upb:descriptor_upb_proto"], outs = [ "generated-in/google/protobuf/descriptor.upb.c", "generated-in/google/protobuf/descriptor.upb.h", @@ -85,18 +81,18 @@ sh_test( data = [ ":copy_protos", ":gen_cmakelists", - "//:source_files", - "//upb/base:source_files", - "//upb/collections:source_files", - "//upb/hash:source_files", - "//upb/lex:source_files", - "//upb/mem:source_files", - "//upb/message:source_files", - "//upb/mini_descriptor:source_files", - "//upb/mini_table:source_files", - "//upb/port:source_files", - "//upb/text:source_files", - "//upb/wire:source_files", + "//upb:source_files", + "//upb/upb/base:source_files", + "//upb/upb/collections:source_files", + "//upb/upb/hash:source_files", + "//upb/upb/lex:source_files", + "//upb/upb/mem:source_files", + "//upb/upb/message:source_files", + "//upb/upb/mini_descriptor:source_files", + "//upb/upb/mini_table:source_files", + "//upb/upb/port:source_files", + "//upb/upb/text:source_files", + "//upb/upb/wire:source_files", "@utf8_range//:utf8_range_srcs", ], target_compatible_with = select({ diff --git a/upb/cmake/build_defs.bzl b/upb/cmake/build_defs.bzl index 9db39b3b61..05e9f996bd 100644 --- a/upb/cmake/build_defs.bzl +++ b/upb/cmake/build_defs.bzl @@ -27,7 +27,7 @@ def staleness_test(name, outs, generated_pattern, target_files = None, tags = [] """ script_name = name + ".py" - script_src = Label("//cmake:staleness_test.py") + script_src = Label("//upb/cmake:staleness_test.py") # Filter out non-existing rules so Blaze doesn't error out before we even # run the test. @@ -52,7 +52,7 @@ def staleness_test(name, outs, generated_pattern, target_files = None, tags = [] data = existing_outs + [generated_pattern % file for file in outs], python_version = "PY3", deps = [ - Label("//cmake:staleness_test_lib"), + Label("//upb/cmake:staleness_test_lib"), ], tags = ["staleness_test"] + tags, **kwargs diff --git a/upb/cmake/make_cmakelists.py b/upb/cmake/make_cmakelists.py index 358f9cfc23..ddeded423e 100755 --- a/upb/cmake/make_cmakelists.py +++ b/upb/cmake/make_cmakelists.py @@ -30,7 +30,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -"""A tool to convert {WORKSPACE, BUILD} -> CMakeLists.txt. +"""A tool to convert BUILD -> CMakeLists.txt. This tool is very upb-specific at the moment, and should not be seen as a generic Bazel -> CMake converter. @@ -236,92 +236,14 @@ class BuildFileFunctions(object): pass -class WorkspaceFileFunctions(object): - def __init__(self, converter): - self.converter = converter - - def load(self, *args, **kwargs): - pass - - def workspace(self, **kwargs): - self.converter.prelude += "project(%s)\n" % (kwargs["name"]) - self.converter.prelude += "set(CMAKE_C_STANDARD 99)\n" - - def maybe(self, rule, **kwargs): - if kwargs["name"] == "utf8_range": - self.converter.utf8_range_commit = kwargs["commit"] - pass - - def http_archive(self, **kwargs): - pass - - def git_repository(self, **kwargs): - pass - - def new_git_repository(self, **kwargs): - pass - - def bazel_version_repository(self, **kwargs): - pass - - def protobuf_deps(self): - pass - - def utf8_range_deps(self): - pass - - def pip_parse(self, **kwargs): - pass - - def rules_fuzzing_dependencies(self): - pass - - def rules_fuzzing_init(self): - pass - - def rules_pkg_dependencies(self): - pass - - def system_python(self, **kwargs): - pass - - def register_system_python(self, **kwargs): - pass - - def register_toolchains(self, toolchain): - pass - - def python_source_archive(self, **kwargs): - pass - - def python_nuget_package(self, **kwargs): - pass - - def install_deps(self): - pass - - def fuzzing_py_install_deps(self): - pass - - def googletest_deps(self): - pass - - def local_repository(self, **kwargs): - pass - - class Converter(object): def __init__(self): - self.prelude = "" self.toplevel = "" self.if_lua = "" - self.utf8_range_commit = "" def convert(self): return self.template % { - "prelude": converter.prelude, "toplevel": converter.toplevel, - "utf8_range_commit": converter.utf8_range_commit, } template = textwrap.dedent("""\ @@ -329,7 +251,8 @@ class Converter(object): cmake_minimum_required(VERSION 3.10...3.24) - %(prelude)s + project(upb) + set(CMAKE_C_STANDARD 99) # Prevent CMake from setting -rdynamic on Linux (!!). SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") @@ -366,7 +289,7 @@ class Converter(object): endif() if(NOT TARGET utf8_range) - if(EXISTS ../external/utf8_range) + if(EXISTS ../../external/utf8_range) # utf8_range is already installed include_directories(../external/utf8_range) elseif(EXISTS ../../utf8_range) @@ -376,7 +299,7 @@ class Converter(object): FetchContent_Declare( utf8_range GIT_REPOSITORY "https://github.com/protocolbuffers/utf8_range.git" - GIT_TAG "%(utf8_range_commit)s" + GIT_TAG "d863bc33e15cba6d873c878dcca9e6fe52b2f8cb" ) FetchContent_GetProperties(utf8_range) if(NOT utf8_range_POPULATED) @@ -412,12 +335,9 @@ def GetDict(obj): globs = GetDict(converter) -workspace_dict = GetDict(WorkspaceFileFunctions(converter)) -# We take all file paths as command-line arguments to ensure that we can find -# each file regardless of how exactly Bazel was invoked. -exec(open(sys.argv[1]).read(), workspace_dict) # workspace_deps.bzl -exec(open(sys.argv[2]).read(), workspace_dict) # WORKSPACE -exec(open(sys.argv[3]).read(), GetDict(BuildFileFunctions(converter))) # BUILD +# We take the BUILD path as a command-line argument to ensure that we can find +# it regardless of how exactly Bazel was invoked. +exec(open(sys.argv[1]).read(), GetDict(BuildFileFunctions(converter))) # BUILD -with open(sys.argv[4], "w") as f: +with open(sys.argv[2], "w") as f: f.write(converter.convert()) diff --git a/upb/cmake/staleness_test.py b/upb/cmake/staleness_test.py index c2971c289d..f9fe04ed2c 100644 --- a/upb/cmake/staleness_test.py +++ b/upb/cmake/staleness_test.py @@ -36,7 +36,7 @@ with the actual list of files before we actually run the script. from __future__ import absolute_import -from cmake import staleness_test_lib +from upb.cmake import staleness_test_lib import unittest import sys diff --git a/upb/docs/wrapping-upb.md b/upb/docs/wrapping-upb.md index bc1bd63a97..cefced6611 100644 --- a/upb/docs/wrapping-upb.md +++ b/upb/docs/wrapping-upb.md @@ -173,8 +173,8 @@ class MyMessage(_message.Message): To use reflection-based access: -1. Load and access descriptor data using the interfaces in upb/reflection/def.h. -2. Access message data using the interfaces in upb/reflection/message.h. +1. Load and access descriptor data using the interfaces in upb/upb/reflection/def.h. +2. Access message data using the interfaces in upb/upb/reflection/message.h. ### MiniTables @@ -234,8 +234,8 @@ APIs to do this do not exist yet. To use MiniTable-based access: -1. Load and access MiniDescriptors data using the interfaces in upb/mini_descriptor/decode.h. -2. Access message data using the interfaces in upb/message/accessors.h. +1. Load and access MiniDescriptors data using the interfaces in upb/upb/mini_descriptor/decode.h. +2. Access message data using the interfaces in upb/upb/message/accessors.h. ## Memory Management diff --git a/upb/lua/BUILD.bazel b/upb/lua/BUILD.bazel index 8febcde8bf..ee90d9692d 100644 --- a/upb/lua/BUILD.bazel +++ b/upb/lua/BUILD.bazel @@ -6,12 +6,12 @@ # https://developers.google.com/open-source/licenses/bsd load( - "//bazel:build_defs.bzl", + "//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS", "UPB_DEFAULT_CPPOPTS", ) load( - "//lua:lua_proto_library.bzl", + "//upb/lua:lua_proto_library.bzl", "lua_proto_library", ) @@ -30,10 +30,10 @@ cc_library( copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], deps = [ - "//:json", - "//:message", - "//:reflection", - "//:text", + "//upb:json", + "//upb:message", + "//upb:reflection", + "//upb:text", "@lua//:liblua", ], ) @@ -44,8 +44,8 @@ cc_binary( copts = UPB_DEFAULT_CPPOPTS, visibility = ["//visibility:public"], deps = [ + "//src/google/protobuf/compiler:code_generator", "@com_google_absl//absl/strings", - "@com_google_protobuf//src/google/protobuf/compiler:code_generator", ], ) @@ -63,15 +63,15 @@ cc_test( ":test_messages_proto2_proto_lua", ":test_messages_proto3_proto_lua", ":test_proto_lua", - "//:third_party/lunit/console.lua", - "//:third_party/lunit/lunit.lua", - "//lua:upb.lua", - "@com_google_protobuf//:descriptor_proto", - "@com_google_protobuf//conformance:conformance_proto", + "//:descriptor_proto", + "//conformance:conformance_proto", + "//upb:third_party/lunit/console.lua", + "//upb:third_party/lunit/lunit.lua", + "//upb/lua:upb.lua", ], linkstatic = 1, deps = [ - "//lua:lupb", + "//upb/lua:lupb", "@lua//:liblua", ], ) @@ -80,7 +80,7 @@ proto_library( name = "test_proto", testonly = 1, srcs = ["test.proto"], - deps = ["@com_google_protobuf//:timestamp_proto"], + deps = ["//:timestamp_proto"], ) lua_proto_library( @@ -91,22 +91,22 @@ lua_proto_library( lua_proto_library( name = "descriptor_proto_lua", - deps = ["@com_google_protobuf//:descriptor_proto"], + deps = ["//:descriptor_proto"], ) lua_proto_library( name = "empty_proto_lua", - deps = ["@com_google_protobuf//:empty_proto"], + deps = ["//:empty_proto"], ) lua_proto_library( name = "test_messages_proto3_proto_lua", testonly = 1, - deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto3_proto"], + deps = ["//src/google/protobuf:test_messages_proto3_proto"], ) lua_proto_library( name = "test_messages_proto2_proto_lua", testonly = 1, - deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto2_proto"], + deps = ["//src/google/protobuf:test_messages_proto2_proto"], ) diff --git a/upb/lua/def.c b/upb/lua/def.c index 9affe52c12..22e0b9f579 100644 --- a/upb/lua/def.c +++ b/upb/lua/def.c @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/reflection/def.h" +#include "upb/upb/reflection/def.h" #include #include @@ -36,8 +36,8 @@ #include #include "lauxlib.h" -#include "lua/upb.h" -#include "upb/reflection/message.h" +#include "upb/lua/upb.h" +#include "upb/upb/reflection/message.h" #define LUPB_ENUMDEF "lupb.enumdef" #define LUPB_ENUMVALDEF "lupb.enumvaldef" diff --git a/upb/lua/lua_proto_library.bzl b/upb/lua/lua_proto_library.bzl index a78371a60f..d7a741c7e3 100644 --- a/upb/lua/lua_proto_library.bzl +++ b/upb/lua/lua_proto_library.bzl @@ -109,12 +109,12 @@ _lua_proto_library_aspect = aspect( "_upbc": attr.label( executable = True, cfg = "exec", - default = "//lua:protoc-gen-lua", + default = "//upb/lua:protoc-gen-lua", ), "_protoc": attr.label( executable = True, cfg = "exec", - default = "@com_google_protobuf//:protoc", + default = "//:protoc", ), }, implementation = _lua_proto_library_aspect_impl, diff --git a/upb/lua/main.c b/upb/lua/main.c index 6d2b56da9c..de9e07c2be 100644 --- a/upb/lua/main.c +++ b/upb/lua/main.c @@ -33,7 +33,7 @@ #include #include -#include "lua/upb.h" +#include "upb/lua/upb.h" lua_State* L; @@ -53,13 +53,13 @@ const char* init = "package.preload['lupb'] = ... " "package.path = '" "./?.lua;" - "./third_party/lunit/?.lua;" + "./upb/third_party/lunit/?.lua;" "external/com_google_protobuf/?.lua;" "external/com_google_protobuf/src/?.lua;" "bazel-bin/?.lua;" "bazel-bin/external/com_google_protobuf/src/?.lua;" "bazel-bin/external/com_google_protobuf/?.lua;" - "lua/?.lua;" + "upb/lua/?.lua;" // These additional paths handle the case where this test is invoked from // the protobuf repo's Bazel workspace. "external/upb/?.lua;" diff --git a/upb/lua/msg.c b/upb/lua/msg.c index bdec7a2d09..ab487394a4 100644 --- a/upb/lua/msg.c +++ b/upb/lua/msg.c @@ -39,14 +39,14 @@ #include #include "lauxlib.h" -#include "lua/upb.h" -#include "upb/collections/map.h" -#include "upb/json/decode.h" -#include "upb/json/encode.h" -#include "upb/message/message.h" -#include "upb/port/def.inc" -#include "upb/reflection/message.h" -#include "upb/text/encode.h" +#include "upb/lua/upb.h" +#include "upb/upb/collections/map.h" +#include "upb/upb/json/decode.h" +#include "upb/upb/json/encode.h" +#include "upb/upb/message/message.h" +#include "upb/upb/port/def.inc" +#include "upb/upb/reflection/message.h" +#include "upb/upb/text/encode.h" /* * Message/Map/Array objects. These objects form a directed graph: a message diff --git a/upb/lua/test_upb.lua b/upb/lua/test_upb.lua index f74d988895..24f0151d89 100644 --- a/upb/lua/test_upb.lua +++ b/upb/lua/test_upb.lua @@ -34,7 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. local upb = require "lupb" local lunit = require "lunit" -local upb_test = require "lua.test_pb" +local upb_test = require "upb.lua.test_pb" local test_messages_proto3 = require "google.protobuf.test_messages_proto3_pb" local test_messages_proto2 = require "google.protobuf.test_messages_proto2_pb" local descriptor = require "google.protobuf.descriptor_pb" diff --git a/upb/lua/upb.c b/upb/lua/upb.c index 4500fb4e75..07dc3f325d 100644 --- a/upb/lua/upb.c +++ b/upb/lua/upb.c @@ -50,7 +50,7 @@ * domain of [u]int64 values. */ -#include "lua/upb.h" +#include "upb/lua/upb.h" #include #include @@ -59,7 +59,7 @@ #include #include "lauxlib.h" -#include "upb/message/message.h" +#include "upb/upb/message/message.h" /* Lua compatibility code *****************************************************/ diff --git a/upb/lua/upb.h b/upb/lua/upb.h index 46ec9118c5..59a4ffeb0c 100644 --- a/upb/lua/upb.h +++ b/upb/lua/upb.h @@ -36,9 +36,9 @@ #define UPB_LUA_UPB_H_ #include "lauxlib.h" -#include "upb/message/message.h" -#include "upb/reflection/def.h" -#include "upb/reflection/message.h" +#include "upb/upb/message/message.h" +#include "upb/upb/reflection/def.h" +#include "upb/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. */ diff --git a/upb/protos/BUILD b/upb/protos/BUILD index 29fb20e495..88b7e317d4 100644 --- a/upb/protos/BUILD +++ b/upb/protos/BUILD @@ -6,16 +6,16 @@ # https://developers.google.com/open-source/licenses/bsd load( - "//bazel:build_defs.bzl", + "//upb/bazel:build_defs.bzl", "UPB_DEFAULT_CPPOPTS", ) load( - "//protos/bazel:upb_cc_proto_library.bzl", + "//upb/protos/bazel:upb_cc_proto_library.bzl", "upb_cc_proto_library_copts", ) # begin:google_only -# package(default_applicable_licenses = ["//:license"]) +# package(default_applicable_licenses = ["//upb:license"]) # end:google_only licenses(["notice"]) @@ -31,13 +31,13 @@ cc_library( deps = [ ":protos", ":protos_traits", - "//:base", - "//:collections", - "//:collections_internal", - "//:mem", - "//:message_copy", - "//:message_types", - "//:port", + "//upb:base", + "//upb:collections", + "//upb:collections_internal", + "//upb:mem", + "//upb:message_copy", + "//upb:message_types", + "//upb:port", "@com_google_absl//absl/base:core_headers", "@com_google_absl//absl/strings", ], @@ -55,16 +55,16 @@ cc_library( visibility = ["//visibility:public"], deps = [ ":protos_extension_lock", - "//:base", - "//:mem", - "//:message_accessors_internal", - "//:message_copy", - "//:message_internal", - "//:message_promote", - "//:message_types", - "//:mini_table", - "//:wire", - "//:wire_types", + "//upb:base", + "//upb:mem", + "//upb:message_accessors_internal", + "//upb:message_copy", + "//upb:message_internal", + "//upb:message_promote", + "//upb:message_types", + "//upb:mini_table", + "//upb:wire", + "//upb:wire_types", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", @@ -89,9 +89,9 @@ cc_library( visibility = ["//visibility:public"], deps = [ ":protos", - "//:mem", - "//:message", - "//:mini_table", + "//upb:mem", + "//upb:message", + "//upb:mini_table", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings:str_format", @@ -105,7 +105,7 @@ cc_library( copts = UPB_DEFAULT_CPPOPTS, visibility = ["//visibility:public"], deps = [ - "//:message", + "//upb:message", "@com_google_absl//absl/base:core_headers", "@com_google_absl//absl/synchronization", ], @@ -123,8 +123,8 @@ cc_library( ":protos", ":protos_internal", ":repeated_field", - "//:mem", - "//:message", + "//upb:mem", + "//upb:message", ], ) @@ -134,9 +134,9 @@ cc_test( copts = UPB_DEFAULT_CPPOPTS, deps = [ ":protos_internal", - "//:mem", - "//protos_generator/tests:test_model_upb_cc_proto", - "//protos_generator/tests:test_model_upb_proto", + "//upb:mem", + "//upb/protos_generator/tests:test_model_upb_cc_proto", + "//upb/protos_generator/tests:test_model_upb_proto", "@com_google_googletest//:gtest_main", ], ) @@ -160,10 +160,10 @@ cc_test( name = "protos_extension_lock_test", srcs = ["protos_extension_lock_test.cc"], deps = [ - "//:mem", - "//protos", - "//protos:protos_extension_lock", - "//protos_generator/tests:test_model_upb_cc_proto", + "//upb:mem", + "//upb/protos", + "//upb/protos:protos_extension_lock", + "//upb/protos_generator/tests:test_model_upb_cc_proto", "@com_google_absl//absl/hash", "@com_google_absl//absl/log:absl_check", "@com_google_googletest//:gtest_main", diff --git a/upb/protos/bazel/BUILD b/upb/protos/bazel/BUILD index b8c2665386..83e2840584 100644 --- a/upb/protos/bazel/BUILD +++ b/upb/protos/bazel/BUILD @@ -8,7 +8,7 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") # begin:google_only -# package(default_applicable_licenses = ["//:license"]) +# package(default_applicable_licenses = ["//upb:license"]) # end:google_only licenses(["notice"]) @@ -18,7 +18,7 @@ bzl_library( srcs = ["upb_cc_proto_library.bzl"], visibility = ["//visibility:public"], deps = [ - "//bazel:upb_proto_library_bzl", + "//upb/bazel:upb_proto_library_bzl", "@bazel_skylib//lib:paths", "@bazel_tools//tools/cpp:toolchain_utils.bzl", ], diff --git a/upb/protos/bazel/upb_cc_proto_library.bzl b/upb/protos/bazel/upb_cc_proto_library.bzl index ad74017092..859a0d8397 100644 --- a/upb/protos/bazel/upb_cc_proto_library.bzl +++ b/upb/protos/bazel/upb_cc_proto_library.bzl @@ -10,7 +10,7 @@ """ load("@bazel_skylib//lib:paths.bzl", "paths") -load("//bazel:upb_proto_library.bzl", "GeneratedSrcsInfo", "UpbWrappedCcInfo", "upb_proto_library_aspect") +load("//upb/bazel:upb_proto_library.bzl", "GeneratedSrcsInfo", "UpbWrappedCcInfo", "upb_proto_library_aspect") # begin:google_only # load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain", "use_cpp_toolchain") @@ -229,17 +229,17 @@ def _upb_cc_proto_library_aspect_impl(target, ctx): _upb_cc_proto_library_aspect = aspect( attrs = { "_ccopts": attr.label( - default = "//protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use", + default = "//upb/protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use", ), "_gen_upbprotos": attr.label( executable = True, cfg = "exec", - default = "//protos_generator:protoc-gen-upb-protos", + default = "//upb/protos_generator:protoc-gen-upb-protos", ), "_protoc": attr.label( executable = True, cfg = "exec", - default = "@com_google_protobuf//:protoc", + default = "//:protoc", ), "_cc_toolchain": attr.label( default = "@bazel_tools//tools/cpp:current_cc_toolchain", @@ -247,12 +247,12 @@ _upb_cc_proto_library_aspect = aspect( "_upbprotos": attr.label_list( default = [ # TODO: Add dependencies for cc runtime (absl/string etc..) - "//:generated_cpp_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", - "//protos:generated_protos_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", + "//upb:generated_cpp_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", + "//upb/protos:generated_protos_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", "@com_google_absl//absl/strings", "@com_google_absl//absl/status:statusor", - "//protos", - "//protos:repeated_field", + "//upb/protos", + "//upb/protos:repeated_field", ], ), }, @@ -283,7 +283,7 @@ upb_cc_proto_library = rule( providers = [ProtoInfo], ), "_ccopts": attr.label( - default = "//protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use", + default = "//upb/protos:upb_cc_proto_library_copts__for_generated_code_only_do_not_use", ), }, ) diff --git a/upb/protos/protos.cc b/upb/protos/protos.cc index 9e83d8c79c..b34f1811c2 100644 --- a/upb/protos/protos.cc +++ b/upb/protos/protos.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "protos/protos.h" +#include "upb/protos/protos.h" #include #include @@ -37,18 +37,18 @@ #include "absl/status/statusor.h" #include "absl/strings/str_format.h" #include "absl/strings/string_view.h" -#include "protos/protos_extension_lock.h" -#include "upb/mem/arena.h" -#include "upb/message/copy.h" -#include "upb/message/internal/extension.h" -#include "upb/message/promote.h" -#include "upb/message/types.h" -#include "upb/mini_table/extension.h" -#include "upb/mini_table/extension_registry.h" -#include "upb/mini_table/message.h" -#include "upb/wire/decode.h" -#include "upb/wire/encode.h" -#include "upb/wire/types.h" +#include "upb/protos/protos_extension_lock.h" +#include "upb/upb/mem/arena.h" +#include "upb/upb/message/copy.h" +#include "upb/upb/message/internal/extension.h" +#include "upb/upb/message/promote.h" +#include "upb/upb/message/types.h" +#include "upb/upb/mini_table/extension.h" +#include "upb/upb/mini_table/extension_registry.h" +#include "upb/upb/mini_table/message.h" +#include "upb/upb/wire/decode.h" +#include "upb/upb/wire/encode.h" +#include "upb/upb/wire/types.h" namespace protos { diff --git a/upb/protos/protos.h b/upb/protos/protos.h index 1c0faf28e2..d3692e33f1 100644 --- a/upb/protos/protos.h +++ b/upb/protos/protos.h @@ -36,13 +36,13 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" -#include "upb/base/status.hpp" -#include "upb/mem/arena.hpp" -#include "upb/message/copy.h" -#include "upb/message/internal/accessors.h" -#include "upb/message/internal/extension.h" -#include "upb/wire/decode.h" -#include "upb/wire/encode.h" +#include "upb/upb/base/status.hpp" +#include "upb/upb/mem/arena.hpp" +#include "upb/upb/message/copy.h" +#include "upb/upb/message/internal/accessors.h" +#include "upb/upb/message/internal/extension.h" +#include "upb/upb/wire/decode.h" +#include "upb/upb/wire/encode.h" namespace protos { diff --git a/upb/protos/protos_extension_lock.cc b/upb/protos/protos_extension_lock.cc index dbb2fc2ed2..bb0dc973f1 100644 --- a/upb/protos/protos_extension_lock.cc +++ b/upb/protos/protos_extension_lock.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "protos/protos_extension_lock.h" +#include "upb/protos/protos_extension_lock.h" #include diff --git a/upb/protos/protos_extension_lock_test.cc b/upb/protos/protos_extension_lock_test.cc index 326f2705e6..bdc76cccfd 100644 --- a/upb/protos/protos_extension_lock_test.cc +++ b/upb/protos/protos_extension_lock_test.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "protos/protos_extension_lock.h" +#include "upb/protos/protos_extension_lock.h" #include #include @@ -39,9 +39,9 @@ #include "gtest/gtest.h" #include "absl/hash/hash.h" #include "absl/log/absl_check.h" -#include "protos/protos.h" -#include "protos_generator/tests/test_model.upb.proto.h" -#include "upb/mem/arena.hpp" +#include "upb/protos/protos.h" +#include "upb/protos_generator/tests/test_model.upb.proto.h" +#include "upb/upb/mem/arena.hpp" #ifndef ASSERT_OK #define ASSERT_OK(x) ASSERT_TRUE(x.ok()) diff --git a/upb/protos/protos_internal.h b/upb/protos/protos_internal.h index 0a1f194d3a..c707ae5229 100644 --- a/upb/protos/protos_internal.h +++ b/upb/protos/protos_internal.h @@ -31,8 +31,8 @@ #ifndef UPB_PROTOS_PROTOS_INTERNAL_H_ #define UPB_PROTOS_PROTOS_INTERNAL_H_ -#include "upb/mem/arena.h" -#include "upb/message/message.h" +#include "upb/upb/mem/arena.h" +#include "upb/upb/message/message.h" namespace protos::internal { diff --git a/upb/protos/protos_internal_test.cc b/upb/protos/protos_internal_test.cc index e73954aaf3..a2f426b5d9 100644 --- a/upb/protos/protos_internal_test.cc +++ b/upb/protos/protos_internal_test.cc @@ -28,13 +28,13 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "protos/protos_internal.h" +#include "upb/protos/protos_internal.h" #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "protos_generator/tests/test_model.upb.h" -#include "protos_generator/tests/test_model.upb.proto.h" -#include "upb/mem/arena.h" +#include "upb/protos_generator/tests/test_model.upb.h" +#include "upb/protos_generator/tests/test_model.upb.proto.h" +#include "upb/upb/mem/arena.h" namespace protos::testing { namespace { diff --git a/upb/protos/repeated_field.h b/upb/protos/repeated_field.h index cc049ab2f1..2ff77fd9b7 100644 --- a/upb/protos/repeated_field.h +++ b/upb/protos/repeated_field.h @@ -37,17 +37,17 @@ #include "absl/base/attributes.h" #include "absl/strings/string_view.h" -#include "protos/protos.h" -#include "protos/protos_traits.h" -#include "protos/repeated_field_iterator.h" -#include "upb/base/string_view.h" -#include "upb/collections/array.h" -#include "upb/collections/internal/array.h" -#include "upb/mem/arena.h" -#include "upb/message/copy.h" +#include "upb/protos/protos.h" +#include "upb/protos/protos_traits.h" +#include "upb/protos/repeated_field_iterator.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/collections/array.h" +#include "upb/upb/collections/internal/array.h" +#include "upb/upb/mem/arena.h" +#include "upb/upb/message/copy.h" // Must be last: -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" namespace protos { @@ -321,6 +321,6 @@ class RepeatedField { } // namespace protos -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPB_PROTOS_REPEATED_FIELD_H_ diff --git a/upb/protos/repeated_field_iterator.h b/upb/protos/repeated_field_iterator.h index cb6ab56378..2129bc1482 100644 --- a/upb/protos/repeated_field_iterator.h +++ b/upb/protos/repeated_field_iterator.h @@ -36,15 +36,15 @@ #include #include "absl/strings/string_view.h" -#include "protos/protos.h" -#include "upb/base/string_view.h" -#include "upb/collections/array.h" -#include "upb/mem/arena.h" -#include "upb/message/copy.h" +#include "upb/protos/protos.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/collections/array.h" +#include "upb/upb/mem/arena.h" +#include "upb/upb/message/copy.h" // Must be last: -#include "upb/message/types.h" -#include "upb/port/def.inc" +#include "upb/upb/message/types.h" +#include "upb/upb/port/def.inc" namespace protos { namespace internal { diff --git a/upb/protos/repeated_field_iterator_test.cc b/upb/protos/repeated_field_iterator_test.cc index c8e0a60959..645efea75a 100644 --- a/upb/protos/repeated_field_iterator_test.cc +++ b/upb/protos/repeated_field_iterator_test.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "protos/repeated_field_iterator.h" +#include "upb/protos/repeated_field_iterator.h" #include #include diff --git a/upb/protos_generator/BUILD b/upb/protos_generator/BUILD index 4bf4a07ca0..3473450fc2 100644 --- a/upb/protos_generator/BUILD +++ b/upb/protos_generator/BUILD @@ -6,12 +6,12 @@ # https://developers.google.com/open-source/licenses/bsd load( - "//bazel:build_defs.bzl", + "//upb/bazel:build_defs.bzl", "UPB_DEFAULT_CPPOPTS", ) # begin:google_only -# package(default_applicable_licenses = ["//:license"]) +# package(default_applicable_licenses = ["//upb:license"]) # end:google_only licenses(["notice"]) @@ -28,9 +28,9 @@ cc_binary( ":generator", ":names", ":output", - "//upbc:file_layout", - "@com_google_protobuf//:protobuf", - "@com_google_protobuf//src/google/protobuf/compiler:code_generator", + "//:protobuf", + "//src/google/protobuf/compiler:code_generator", + "//upb/upbc:file_layout", ], ) @@ -55,13 +55,13 @@ cc_library( ":gen_utils", ":names", ":output", - "//upbc:common", - "//upbc:file_layout", - "//upbc:keywords", - "//upbc:names", + "//:protobuf", + "//upb/upbc:common", + "//upb/upbc:file_layout", + "//upb/upbc:keywords", + "//upb/upbc:names", "@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/strings", - "@com_google_protobuf//:protobuf", ], ) @@ -71,9 +71,9 @@ cc_library( hdrs = ["output.h"], visibility = ["//visibility:private"], deps = [ + "//:protobuf", "@com_google_absl//absl/log:absl_log", "@com_google_absl//absl/strings", - "@com_google_protobuf//:protobuf", ], ) @@ -83,9 +83,9 @@ cc_library( hdrs = ["gen_utils.h"], visibility = ["//visibility:public"], deps = [ + "//:protobuf", + "//src/google/protobuf/compiler:code_generator", "@com_google_absl//absl/strings", - "@com_google_protobuf//:protobuf", - "@com_google_protobuf//src/google/protobuf/compiler:code_generator", ], ) @@ -96,6 +96,6 @@ cc_library( visibility = ["//visibility:private"], deps = [ ":output", - "//upbc:keywords", + "//upb/upbc:keywords", ], ) diff --git a/upb/protos_generator/gen_accessors.cc b/upb/protos_generator/gen_accessors.cc index 9db49da278..f2bfeab436 100644 --- a/upb/protos_generator/gen_accessors.cc +++ b/upb/protos_generator/gen_accessors.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "protos_generator/gen_accessors.h" +#include "upb/protos_generator/gen_accessors.h" #include @@ -37,13 +37,13 @@ #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "google/protobuf/descriptor.h" -#include "protos_generator/gen_repeated_fields.h" -#include "protos_generator/gen_utils.h" -#include "protos_generator/names.h" -#include "protos_generator/output.h" -#include "upbc/common.h" -#include "upbc/keywords.h" -#include "upbc/names.h" +#include "upb/protos_generator/gen_repeated_fields.h" +#include "upb/protos_generator/gen_utils.h" +#include "upb/protos_generator/names.h" +#include "upb/protos_generator/output.h" +#include "upb/upbc/common.h" +#include "upb/upbc/keywords.h" +#include "upb/upbc/names.h" namespace protos_generator { diff --git a/upb/protos_generator/gen_accessors.h b/upb/protos_generator/gen_accessors.h index 8372fc3486..23e098f04b 100644 --- a/upb/protos_generator/gen_accessors.h +++ b/upb/protos_generator/gen_accessors.h @@ -32,8 +32,8 @@ #define UPB_PROTOS_GENERATOR_ACCESSORS_H_ #include "google/protobuf/descriptor.h" -#include "protos_generator/gen_utils.h" -#include "protos_generator/output.h" +#include "upb/protos_generator/gen_utils.h" +#include "upb/protos_generator/output.h" namespace protos_generator { diff --git a/upb/protos_generator/gen_enums.cc b/upb/protos_generator/gen_enums.cc index 7c535a7e3d..ceea05c7df 100644 --- a/upb/protos_generator/gen_enums.cc +++ b/upb/protos_generator/gen_enums.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "protos_generator/gen_enums.h" +#include "upb/protos_generator/gen_enums.h" #include #include @@ -37,8 +37,8 @@ #include "google/protobuf/descriptor.pb.h" #include "google/protobuf/descriptor.h" -#include "protos_generator/gen_utils.h" -#include "protos_generator/names.h" +#include "upb/protos_generator/gen_utils.h" +#include "upb/protos_generator/names.h" namespace protos_generator { diff --git a/upb/protos_generator/gen_enums.h b/upb/protos_generator/gen_enums.h index 607876225a..fa7cccd18f 100644 --- a/upb/protos_generator/gen_enums.h +++ b/upb/protos_generator/gen_enums.h @@ -32,7 +32,7 @@ #define UPB_PROTOS_GENERATOR_ENUMS_H_ #include "google/protobuf/descriptor.h" -#include "protos_generator/output.h" +#include "upb/protos_generator/output.h" namespace protos_generator { diff --git a/upb/protos_generator/gen_extensions.cc b/upb/protos_generator/gen_extensions.cc index be0cbc5210..ae4030c41f 100644 --- a/upb/protos_generator/gen_extensions.cc +++ b/upb/protos_generator/gen_extensions.cc @@ -28,11 +28,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "protos_generator/gen_extensions.h" +#include "upb/protos_generator/gen_extensions.h" #include "absl/strings/str_cat.h" -#include "protos_generator/gen_utils.h" -#include "protos_generator/names.h" +#include "upb/protos_generator/gen_utils.h" +#include "upb/protos_generator/names.h" namespace protos_generator { diff --git a/upb/protos_generator/gen_extensions.h b/upb/protos_generator/gen_extensions.h index 8ec740aadb..85d1a9a31e 100644 --- a/upb/protos_generator/gen_extensions.h +++ b/upb/protos_generator/gen_extensions.h @@ -32,7 +32,7 @@ #define UPB_PROTOS_GENERATOR_GEN_EXTENSIONS_H_ #include "google/protobuf/descriptor.h" -#include "protos_generator/output.h" +#include "upb/protos_generator/output.h" namespace protos_generator { diff --git a/upb/protos_generator/gen_messages.cc b/upb/protos_generator/gen_messages.cc index ca75ba70dd..716562c343 100644 --- a/upb/protos_generator/gen_messages.cc +++ b/upb/protos_generator/gen_messages.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "protos_generator/gen_messages.h" +#include "upb/protos_generator/gen_messages.h" #include #include @@ -36,14 +36,14 @@ #include "google/protobuf/descriptor.pb.h" #include "absl/strings/str_cat.h" #include "google/protobuf/descriptor.h" -#include "protos_generator/gen_accessors.h" -#include "protos_generator/gen_enums.h" -#include "protos_generator/gen_extensions.h" -#include "protos_generator/gen_utils.h" -#include "protos_generator/names.h" -#include "protos_generator/output.h" -#include "upbc/common.h" -#include "upbc/file_layout.h" +#include "upb/protos_generator/gen_accessors.h" +#include "upb/protos_generator/gen_enums.h" +#include "upb/protos_generator/gen_extensions.h" +#include "upb/protos_generator/gen_utils.h" +#include "upb/protos_generator/names.h" +#include "upb/protos_generator/output.h" +#include "upb/upbc/common.h" +#include "upb/upbc/file_layout.h" namespace protos_generator { diff --git a/upb/protos_generator/gen_messages.h b/upb/protos_generator/gen_messages.h index 323696449e..97813cf956 100644 --- a/upb/protos_generator/gen_messages.h +++ b/upb/protos_generator/gen_messages.h @@ -32,7 +32,7 @@ #define UPB_PROTOS_GENERATOR_GEN_MESSAGES_H_ #include "google/protobuf/descriptor.h" -#include "protos_generator/output.h" +#include "upb/protos_generator/output.h" namespace protos_generator { namespace protobuf = ::google::protobuf; diff --git a/upb/protos_generator/gen_repeated_fields.cc b/upb/protos_generator/gen_repeated_fields.cc index d5b4bab650..3c962ac46d 100644 --- a/upb/protos_generator/gen_repeated_fields.cc +++ b/upb/protos_generator/gen_repeated_fields.cc @@ -27,7 +27,7 @@ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "protos_generator/gen_repeated_fields.h" +#include "upb/protos_generator/gen_repeated_fields.h" #include #include @@ -35,15 +35,15 @@ #include "google/protobuf/descriptor.pb.h" #include "absl/strings/string_view.h" #include "google/protobuf/descriptor.h" -#include "protos_generator/gen_accessors.h" -#include "protos_generator/gen_enums.h" -#include "protos_generator/gen_extensions.h" -#include "protos_generator/gen_utils.h" -#include "protos_generator/names.h" -#include "protos_generator/output.h" -#include "upbc/common.h" -#include "upbc/file_layout.h" -#include "upbc/names.h" +#include "upb/protos_generator/gen_accessors.h" +#include "upb/protos_generator/gen_enums.h" +#include "upb/protos_generator/gen_extensions.h" +#include "upb/protos_generator/gen_utils.h" +#include "upb/protos_generator/names.h" +#include "upb/protos_generator/output.h" +#include "upb/upbc/common.h" +#include "upb/upbc/file_layout.h" +#include "upb/upbc/names.h" namespace protos_generator { namespace protobuf = ::google::protobuf; diff --git a/upb/protos_generator/gen_repeated_fields.h b/upb/protos_generator/gen_repeated_fields.h index 1650eb0c06..5902a5ded4 100644 --- a/upb/protos_generator/gen_repeated_fields.h +++ b/upb/protos_generator/gen_repeated_fields.h @@ -33,7 +33,7 @@ #include "absl/strings/string_view.h" #include "google/protobuf/descriptor.h" -#include "protos_generator/output.h" +#include "upb/protos_generator/output.h" namespace protos_generator { namespace protobuf = ::google::protobuf; diff --git a/upb/protos_generator/gen_utils.cc b/upb/protos_generator/gen_utils.cc index 79dd5a188d..7c59d7f3a7 100644 --- a/upb/protos_generator/gen_utils.cc +++ b/upb/protos_generator/gen_utils.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "protos_generator/gen_utils.h" +#include "upb/protos_generator/gen_utils.h" #include #include diff --git a/upb/protos_generator/names.cc b/upb/protos_generator/names.cc index eb3fbee431..c1c3d8e97a 100644 --- a/upb/protos_generator/names.cc +++ b/upb/protos_generator/names.cc @@ -28,11 +28,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "protos_generator/names.h" +#include "upb/protos_generator/names.h" #include -#include "upbc/keywords.h" +#include "upb/upbc/keywords.h" namespace protos_generator { diff --git a/upb/protos_generator/names.h b/upb/protos_generator/names.h index efa01ce067..4578703402 100644 --- a/upb/protos_generator/names.h +++ b/upb/protos_generator/names.h @@ -34,7 +34,7 @@ #include #include "google/protobuf/descriptor.pb.h" -#include "protos_generator/output.h" +#include "upb/protos_generator/output.h" namespace protos_generator { diff --git a/upb/protos_generator/output.cc b/upb/protos_generator/output.cc index 72cd4e56d8..67a33b3a21 100644 --- a/upb/protos_generator/output.cc +++ b/upb/protos_generator/output.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "protos_generator/output.h" +#include "upb/protos_generator/output.h" #include diff --git a/upb/protos_generator/protoc-gen-upb-protos.cc b/upb/protos_generator/protoc-gen-upb-protos.cc index 58c37121f8..7907ed5fff 100644 --- a/upb/protos_generator/protoc-gen-upb-protos.cc +++ b/upb/protos_generator/protoc-gen-upb-protos.cc @@ -34,13 +34,13 @@ #include "google/protobuf/compiler/code_generator.h" #include "google/protobuf/compiler/plugin.h" #include "google/protobuf/descriptor.h" -#include "protos_generator/gen_enums.h" -#include "protos_generator/gen_extensions.h" -#include "protos_generator/gen_messages.h" -#include "protos_generator/gen_utils.h" -#include "protos_generator/names.h" -#include "protos_generator/output.h" -#include "upbc/file_layout.h" +#include "upb/protos_generator/gen_enums.h" +#include "upb/protos_generator/gen_extensions.h" +#include "upb/protos_generator/gen_messages.h" +#include "upb/protos_generator/gen_utils.h" +#include "upb/protos_generator/names.h" +#include "upb/protos_generator/output.h" +#include "upb/upbc/file_layout.h" namespace protos_generator { namespace { @@ -138,9 +138,9 @@ void WriteHeader(const protobuf::FileDescriptor* file, Output& output) { #ifndef $0_UPB_PROTO_H_ #define $0_UPB_PROTO_H_ -#include "protos/protos.h" -#include "protos/protos_internal.h" -#include "protos/repeated_field.h" +#include "upb/protos/protos.h" +#include "upb/protos/protos_internal.h" +#include "upb/protos/repeated_field.h" #include "absl/strings/string_view.h" #include "absl/status/statusor.h" @@ -158,7 +158,7 @@ void WriteHeader(const protobuf::FileDescriptor* file, Output& output) { } } - output("#include \"upb/port/def.inc\"\n"); + output("#include \"upb/upb/port/def.inc\"\n"); const std::vector this_file_messages = SortedMessages(file); @@ -190,7 +190,7 @@ void WriteHeader(const protobuf::FileDescriptor* file, Output& output) { WriteEndNamespace(file, output); - output("\n#include \"upb/port/undef.inc\"\n\n"); + output("\n#include \"upb/upb/port/undef.inc\"\n\n"); // End of "C" section. output("#endif /* $0_UPB_PROTO_H_ */\n", ToPreproc(file->name())); @@ -205,7 +205,7 @@ void WriteSource(const protobuf::FileDescriptor* file, Output& output, R"cc( #include #include "absl/strings/string_view.h" -#include "protos/protos.h" +#include "upb/protos/protos.h" #include "$0" )cc", CppHeaderFilename(file)); @@ -213,7 +213,7 @@ void WriteSource(const protobuf::FileDescriptor* file, Output& output, for (int i = 0; i < file->dependency_count(); i++) { output("#include \"$0\"\n", CppHeaderFilename(file->dependency(i))); } - output("#include \"upb/port/def.inc\"\n"); + output("#include \"upb/upb/port/def.inc\"\n"); WriteStartNamespace(file, output); WriteMessageImplementations(file, output); @@ -222,7 +222,7 @@ void WriteSource(const protobuf::FileDescriptor* file, Output& output, WriteExtensionIdentifiers(this_file_exts, output); WriteEndNamespace(file, output); - output("#include \"upb/port/undef.inc\"\n\n"); + output("#include \"upb/upb/port/undef.inc\"\n\n"); } void WriteMessageImplementations(const protobuf::FileDescriptor* file, diff --git a/upb/protos_generator/tests/BUILD b/upb/protos_generator/tests/BUILD index 33f95be423..dfc80b41c5 100644 --- a/upb/protos_generator/tests/BUILD +++ b/upb/protos_generator/tests/BUILD @@ -6,15 +6,15 @@ # https://developers.google.com/open-source/licenses/bsd load( - "//bazel:build_defs.bzl", + "//upb/bazel:build_defs.bzl", "UPB_DEFAULT_CPPOPTS", ) load( - "//bazel:upb_proto_library.bzl", + "//upb/bazel:upb_proto_library.bzl", "upb_proto_library", ) load( - "//protos/bazel:upb_cc_proto_library.bzl", + "//upb/protos/bazel:upb_cc_proto_library.bzl", "upb_cc_proto_library", ) load( @@ -23,7 +23,7 @@ load( ) # begin:google_only -# package(default_applicable_licenses = ["//:license"]) +# package(default_applicable_licenses = ["//upb:license"]) # end:google_only licenses(["notice"]) @@ -63,14 +63,14 @@ proto_library( upb_proto_library( name = "test_model_upb_proto", visibility = [ - "//protos:__pkg__", + "//upb/protos:__pkg__", ], deps = [":test_model_proto"], ) upb_cc_proto_library( name = "test_model_upb_cc_proto", - visibility = ["//protos:__pkg__"], + visibility = ["//upb/protos:__pkg__"], deps = [":test_model_proto"], ) @@ -133,8 +133,8 @@ cc_test( "@com_google_googletest//:gtest_main", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", - "//protos", - "//:mem", - "//protos:repeated_field", + "//upb/protos", + "//upb:mem", + "//upb/protos:repeated_field", ], ) diff --git a/upb/protos_generator/tests/child_model.proto b/upb/protos_generator/tests/child_model.proto index c7af6f13e3..79589cc71e 100644 --- a/upb/protos_generator/tests/child_model.proto +++ b/upb/protos_generator/tests/child_model.proto @@ -32,7 +32,7 @@ syntax = "proto3"; package protos_generator.test; -import public "protos_generator/tests/test_enum.proto"; +import public "upb/protos_generator/tests/test_enum.proto"; message ChildModel1 { optional bool child_b1 = 44; diff --git a/upb/protos_generator/tests/no_package_enum_user.proto b/upb/protos_generator/tests/no_package_enum_user.proto index ebf8c67ad8..e34c7fe2db 100644 --- a/upb/protos_generator/tests/no_package_enum_user.proto +++ b/upb/protos_generator/tests/no_package_enum_user.proto @@ -32,7 +32,7 @@ syntax = "proto2"; package protos_generator.tests; -import "protos_generator/tests/no_package.proto"; +import "upb/protos_generator/tests/no_package.proto"; // option java_multiple_files = true; diff --git a/upb/protos_generator/tests/test_extension.proto b/upb/protos_generator/tests/test_extension.proto index 3a1a3c67b9..17f713125e 100644 --- a/upb/protos_generator/tests/test_extension.proto +++ b/upb/protos_generator/tests/test_extension.proto @@ -32,7 +32,7 @@ syntax = "proto2"; package protos_generator.test.someotherpackage; -import "protos_generator/tests/test_model.proto"; +import "upb/protos_generator/tests/test_model.proto"; // Define extension that is extending proto outside this package with a type // defined in different file. diff --git a/upb/protos_generator/tests/test_generated.cc b/upb/protos_generator/tests/test_generated.cc index 96345c6a0f..4bd3a7ac95 100644 --- a/upb/protos_generator/tests/test_generated.cc +++ b/upb/protos_generator/tests/test_generated.cc @@ -38,13 +38,13 @@ #include "gtest/gtest.h" #include "absl/status/statusor.h" #include "absl/strings/string_view.h" -#include "protos/protos.h" -#include "protos/repeated_field.h" -#include "protos/repeated_field_iterator.h" -#include "protos_generator/tests/child_model.upb.proto.h" -#include "protos_generator/tests/no_package.upb.proto.h" -#include "protos_generator/tests/test_model.upb.proto.h" -#include "upb/mem/arena.h" +#include "upb/protos/protos.h" +#include "upb/protos/repeated_field.h" +#include "upb/protos/repeated_field_iterator.h" +#include "upb/protos_generator/tests/child_model.upb.proto.h" +#include "upb/protos_generator/tests/no_package.upb.proto.h" +#include "upb/protos_generator/tests/test_model.upb.proto.h" +#include "upb/upb/mem/arena.h" namespace { diff --git a/upb/protos_generator/tests/test_model.proto b/upb/protos_generator/tests/test_model.proto index e133624215..89372f54f4 100644 --- a/upb/protos_generator/tests/test_model.proto +++ b/upb/protos_generator/tests/test_model.proto @@ -32,7 +32,7 @@ syntax = "proto2"; package protos_generator.test; -import "protos_generator/tests/child_model.proto"; +import "upb/protos_generator/tests/child_model.proto"; message TestModelContainer { repeated TestModel models = 1; diff --git a/upb/python/BUILD b/upb/python/BUILD index a050b6c64c..8987b0d290 100644 --- a/upb/python/BUILD +++ b/upb/python/BUILD @@ -5,10 +5,10 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//python:py_extension.bzl", "py_extension") +load("//upb/python:py_extension.bzl", "py_extension") load("@bazel_skylib//lib:selects.bzl", "selects") load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag") -load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") # begin:github_only load("@rules_pkg//:mappings.bzl", "pkg_files") @@ -18,9 +18,9 @@ licenses(["notice"]) package( # begin:google_only -# default_applicable_licenses = ["//:license"], +# default_applicable_licenses = ["//upb:license"], # end:google_only - default_visibility = ["//python/dist:__pkg__"], + default_visibility = ["//upb/python/dist:__pkg__"], ) LIMITED_API_FLAG_SELECT = { @@ -214,18 +214,18 @@ py_extension( ], target_compatible_with = select(_message_target_compatible_with), deps = [ - "//:collections", - "//:descriptor_upb_proto_reflection", - "//:eps_copy_input_stream", - "//:hash", - "//:message_copy", - "//:port", - "//:reflection", - "//:text", - "//:wire_reader", - "//:wire_types", - "//upb/util:compare", - "//upb/util:def_to_proto", - "//upb/util:required_fields", + "//upb:collections", + "//upb:descriptor_upb_proto_reflection", + "//upb:eps_copy_input_stream", + "//upb:hash", + "//upb:message_copy", + "//upb:port", + "//upb:reflection", + "//upb:text", + "//upb:wire_reader", + "//upb:wire_types", + "//upb/upb/util:compare", + "//upb/upb/util:def_to_proto", + "//upb/upb/util:required_fields", ], ) diff --git a/upb/python/convert.c b/upb/python/convert.c index 98d9b75dcf..f26324c71c 100644 --- a/upb/python/convert.c +++ b/upb/python/convert.c @@ -28,16 +28,16 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "python/convert.h" +#include "upb/python/convert.h" -#include "python/message.h" -#include "python/protobuf.h" -#include "upb/collections/map.h" -#include "upb/reflection/message.h" -#include "upb/util/compare.h" +#include "upb/python/message.h" +#include "upb/python/protobuf.h" +#include "upb/upb/collections/map.h" +#include "upb/upb/reflection/message.h" +#include "upb/upb/util/compare.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" PyObject* PyUpb_UpbToPy(upb_MessageValue val, const upb_FieldDef* f, PyObject* arena) { @@ -443,4 +443,4 @@ bool upb_Message_IsEqual(const upb_Message* msg1, const upb_Message* msg2, kUpb_UnknownCompareResult_Equal; } -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" diff --git a/upb/python/convert.h b/upb/python/convert.h index 1c594d3b4a..8233f7e561 100644 --- a/upb/python/convert.h +++ b/upb/python/convert.h @@ -32,8 +32,8 @@ #define PYUPB_CONVERT_H__ #include "protobuf.h" -#include "upb/reflection/def.h" -#include "upb/reflection/message.h" +#include "upb/upb/reflection/def.h" +#include "upb/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` diff --git a/upb/python/descriptor.c b/upb/python/descriptor.c index 6697199472..85cd777a98 100644 --- a/upb/python/descriptor.c +++ b/upb/python/descriptor.c @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "python/descriptor.h" +#include "upb/python/descriptor.h" -#include "python/convert.h" -#include "python/descriptor_containers.h" -#include "python/descriptor_pool.h" -#include "python/message.h" -#include "python/protobuf.h" -#include "upb/reflection/def.h" -#include "upb/util/def_to_proto.h" +#include "upb/python/convert.h" +#include "upb/python/descriptor_containers.h" +#include "upb/python/descriptor_pool.h" +#include "upb/python/message.h" +#include "upb/python/protobuf.h" +#include "upb/upb/reflection/def.h" +#include "upb/upb/util/def_to_proto.h" // ----------------------------------------------------------------------------- // DescriptorBase diff --git a/upb/python/descriptor.h b/upb/python/descriptor.h index 7fa0164f0b..14cdfadeaf 100644 --- a/upb/python/descriptor.h +++ b/upb/python/descriptor.h @@ -33,8 +33,8 @@ #include -#include "python/python_api.h" -#include "upb/reflection/def.h" +#include "upb/python/python_api.h" +#include "upb/upb/reflection/def.h" typedef enum { kPyUpb_Descriptor = 0, diff --git a/upb/python/descriptor_containers.c b/upb/python/descriptor_containers.c index e1eacb2a77..7aeafc56be 100644 --- a/upb/python/descriptor_containers.c +++ b/upb/python/descriptor_containers.c @@ -28,11 +28,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "python/descriptor_containers.h" +#include "upb/python/descriptor_containers.h" -#include "python/descriptor.h" -#include "python/protobuf.h" -#include "upb/reflection/def.h" +#include "upb/python/descriptor.h" +#include "upb/python/protobuf.h" +#include "upb/upb/reflection/def.h" // Implements __repr__ as str(dict(self)). static PyObject* PyUpb_DescriptorMap_Repr(PyObject* _self) { diff --git a/upb/python/descriptor_containers.h b/upb/python/descriptor_containers.h index 5b2b1facf6..004607b67e 100644 --- a/upb/python/descriptor_containers.h +++ b/upb/python/descriptor_containers.h @@ -46,7 +46,7 @@ #include #include "protobuf.h" -#include "upb/reflection/def.h" +#include "upb/upb/reflection/def.h" // ----------------------------------------------------------------------------- // PyUpb_GenericSequence diff --git a/upb/python/descriptor_pool.c b/upb/python/descriptor_pool.c index ee4167754c..db95259470 100644 --- a/upb/python/descriptor_pool.c +++ b/upb/python/descriptor_pool.c @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "python/descriptor_pool.h" +#include "upb/python/descriptor_pool.h" #include "google/protobuf/descriptor.upbdefs.h" -#include "python/convert.h" -#include "python/descriptor.h" -#include "python/message.h" -#include "python/protobuf.h" -#include "upb/reflection/def.h" -#include "upb/util/def_to_proto.h" +#include "upb/python/convert.h" +#include "upb/python/descriptor.h" +#include "upb/python/message.h" +#include "upb/python/protobuf.h" +#include "upb/upb/reflection/def.h" +#include "upb/upb/util/def_to_proto.h" // ----------------------------------------------------------------------------- // DescriptorPool diff --git a/upb/python/dist/BUILD.bazel b/upb/python/dist/BUILD.bazel index f946f3dded..512594e011 100644 --- a/upb/python/dist/BUILD.bazel +++ b/upb/python/dist/BUILD.bazel @@ -5,10 +5,10 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//bazel:py_proto_library.bzl", "py_proto_library") +load("//upb/bazel:py_proto_library.bzl", "py_proto_library") load(":dist.bzl", "py_dist", "py_dist_module") load("@bazel_skylib//lib:selects.bzl", "selects") -load("@com_google_protobuf//:protobuf_version.bzl", "PROTOBUF_PYTHON_VERSION") +load("//:protobuf_version.bzl", "PROTOBUF_PYTHON_VERSION") load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") load("@rules_pkg//:pkg.bzl", "pkg_tar") load("@rules_python//python:packaging.bzl", "py_wheel") @@ -18,36 +18,36 @@ licenses(["notice"]) py_dist_module( name = "message_mod", - extension = "//python:_message_binary", + extension = "//upb/python:_message_binary", module_name = "google._upb._message", ) py_proto_library( name = "well_known_proto_py_pb2", deps = [ - "@com_google_protobuf//:any_proto", - "@com_google_protobuf//:api_proto", - "@com_google_protobuf//:descriptor_proto", - "@com_google_protobuf//:duration_proto", - "@com_google_protobuf//:empty_proto", - "@com_google_protobuf//:field_mask_proto", - "@com_google_protobuf//:source_context_proto", - "@com_google_protobuf//:struct_proto", - "@com_google_protobuf//:timestamp_proto", - "@com_google_protobuf//:type_proto", - "@com_google_protobuf//:wrappers_proto", + "//:any_proto", + "//:api_proto", + "//:descriptor_proto", + "//:duration_proto", + "//:empty_proto", + "//:field_mask_proto", + "//:source_context_proto", + "//:struct_proto", + "//:timestamp_proto", + "//:type_proto", + "//:wrappers_proto", ], ) py_proto_library( name = "plugin_py_pb2", - deps = ["@com_google_protobuf//:compiler_plugin_proto"], + deps = ["//:compiler_plugin_proto"], ) config_setting( name = "linux_aarch64_release", flag_values = { - "@com_google_protobuf//toolchain:release": "True", + "//toolchain:release": "True", }, values = {"cpu": "linux-aarch_64"}, ) @@ -59,14 +59,14 @@ config_setting( "@platforms//cpu:aarch64", ], flag_values = { - "@com_google_protobuf//toolchain:release": "False", + "//toolchain:release": "False", }, ) config_setting( name = "linux_x86_64_release", flag_values = { - "@com_google_protobuf//toolchain:release": "True", + "//toolchain:release": "True", }, values = {"cpu": "linux-x86_64"}, ) @@ -78,14 +78,14 @@ config_setting( "@platforms//cpu:x86_64", ], flag_values = { - "@com_google_protobuf//toolchain:release": "False", + "//toolchain:release": "False", }, ) config_setting( name = "osx_x86_64_release", flag_values = { - "@com_google_protobuf//toolchain:release": "True", + "//toolchain:release": "True", }, values = {"cpu": "osx-x86_64"}, ) @@ -97,7 +97,7 @@ config_setting( "@platforms//cpu:x86_64", ], flag_values = { - "@com_google_protobuf//toolchain:release": "False", + "//toolchain:release": "False", }, ) @@ -112,7 +112,7 @@ selects.config_setting_group( config_setting( name = "osx_aarch64_release", flag_values = { - "@com_google_protobuf//toolchain:release": "True", + "//toolchain:release": "True", }, values = {"cpu": "osx-aarch_64"}, ) @@ -124,7 +124,7 @@ config_setting( "@platforms//cpu:aarch64", ], flag_values = { - "@com_google_protobuf//toolchain:release": "False", + "//toolchain:release": "False", }, ) @@ -144,7 +144,7 @@ config_setting( config_setting( name = "windows_x86_32_release", flag_values = { - "@com_google_protobuf//toolchain:release": "True", + "//toolchain:release": "True", }, values = {"cpu": "win32"}, ) @@ -156,7 +156,7 @@ config_setting( "@platforms//cpu:x86_32", ], flag_values = { - "@com_google_protobuf//toolchain:release": "False", + "//toolchain:release": "False", }, ) @@ -171,7 +171,7 @@ selects.config_setting_group( config_setting( name = "windows_x86_64_release", flag_values = { - "@com_google_protobuf//toolchain:release": "True", + "//toolchain:release": "True", }, values = {"cpu": "win64"}, ) @@ -183,7 +183,7 @@ config_setting( "@platforms//cpu:x86_64", ], flag_values = { - "@com_google_protobuf//toolchain:release": "False", + "//toolchain:release": "False", }, ) @@ -199,8 +199,8 @@ pkg_files( name = "generated_wkt", srcs = [ ":well_known_proto_py_pb2", - "//:descriptor_upb_proto", - "//:descriptor_upb_proto_reflection", + "//upb:descriptor_upb_proto", + "//upb:descriptor_upb_proto_reflection", ], prefix = "google/protobuf", ) @@ -233,21 +233,21 @@ pkg_files( pkg_files( name = "filegroup_source_files", srcs = [ - "//:LICENSE", - "//:source_files", - "//python:message_srcs", - "//upb/base:source_files", - "//upb/collections:source_files", - "//upb/hash:source_files", - "//upb/lex:source_files", - "//upb/mem:source_files", - "//upb/message:source_files", - "//upb/mini_descriptor:source_files", - "//upb/mini_table:source_files", - "//upb/port:source_files", - "//upb/text:source_files", - "//upb/util:source_files", - "//upb/wire:source_files", + "//upb:LICENSE", + "//upb:source_files", + "//upb/python:message_srcs", + "//upb/upb/base:source_files", + "//upb/upb/collections:source_files", + "//upb/upb/hash:source_files", + "//upb/upb/lex:source_files", + "//upb/upb/mem:source_files", + "//upb/upb/message:source_files", + "//upb/upb/mini_descriptor:source_files", + "//upb/upb/mini_table:source_files", + "//upb/upb/port:source_files", + "//upb/upb/text:source_files", + "//upb/upb/util:source_files", + "//upb/upb/wire:source_files", ], strip_prefix = strip_prefix.from_root(""), ) @@ -262,7 +262,7 @@ pkg_tar( ":generated_wkt", ":generated_wkt_compiler", ":utf8_range_source_files", - "@com_google_protobuf//python:python_source_files", + "//python:python_source_files", ], extension = "tar.gz", package_dir = "protobuf", @@ -295,9 +295,9 @@ genrule( py_wheel( name = "binary_wheel", abi = select({ - "//python:full_api_3.7": "cp37m", - "//python:full_api_3.8": "cp38", - "//python:full_api_3.9": "cp39", + "//upb/python:full_api_3.7": "cp37m", + "//upb/python:full_api_3.8": "cp38", + "//upb/python:full_api_3.9": "cp39", "//conditions:default": "abi3", }), author = "protobuf@googlegroups.com", @@ -312,7 +312,7 @@ py_wheel( ], distribution = "protobuf", extra_distinfo_files = { - "//:LICENSE": "LICENSE", + "//upb:LICENSE": "LICENSE", }, homepage = "https://developers.google.com/protocol-buffers/", license = "3-Clause BSD License", @@ -329,10 +329,10 @@ py_wheel( }), python_requires = ">=3.7", python_tag = selects.with_or({ - ("//python:limited_api_3.7", "//python:full_api_3.7"): "cp37", - "//python:full_api_3.8": "cp38", - "//python:full_api_3.9": "cp39", - "//python:limited_api_3.10": "cp310", + ("//upb/python:limited_api_3.7", "//upb/python:full_api_3.7"): "cp37", + "//upb/python:full_api_3.8": "cp38", + "//upb/python:full_api_3.9": "cp39", + "//upb/python:limited_api_3.10": "cp310", "//conditions:default": "cp" + SYSTEM_PYTHON_VERSION, }), strip_path_prefixes = [ @@ -349,7 +349,7 @@ py_wheel( ":message_mod", ":plugin_py_pb2", ":well_known_proto_py_pb2", - "@com_google_protobuf//:python_srcs", + "//:python_srcs", ], ) @@ -368,7 +368,7 @@ py_wheel( ], distribution = "protobuf", extra_distinfo_files = { - "//:LICENSE": "LICENSE", + "//upb:LICENSE": "LICENSE", }, homepage = "https://developers.google.com/protocol-buffers/", license = "3-Clause BSD License", @@ -387,7 +387,7 @@ py_wheel( deps = [ ":plugin_py_pb2", ":well_known_proto_py_pb2", - "@com_google_protobuf//:python_srcs", + "//:python_srcs", ], ) @@ -397,7 +397,7 @@ py_wheel( abi = "none", distribution = "protobuftests", extra_distinfo_files = { - "//:LICENSE": "LICENSE", + "//upb:LICENSE": "LICENSE", }, platform = "any", python_tag = "py3", @@ -411,11 +411,11 @@ py_wheel( }), version = PROTOBUF_PYTHON_VERSION, deps = [ - "//python/pb_unit_tests:test_files", - "@com_google_protobuf//:python_common_test_protos", - "@com_google_protobuf//:python_specific_test_protos", - "@com_google_protobuf//:python_test_srcs", - "@com_google_protobuf//src/google/protobuf:testdata", + "//:python_common_test_protos", + "//:python_specific_test_protos", + "//:python_test_srcs", + "//src/google/protobuf:testdata", + "//upb/python/pb_unit_tests:test_files", ], ) diff --git a/upb/python/dist/dist.bzl b/upb/python/dist/dist.bzl index 75c21c31c3..3545fa9f3a 100644 --- a/upb/python/dist/dist.bzl +++ b/upb/python/dist/dist.bzl @@ -121,8 +121,8 @@ py_dist_module = rule( mandatory = True, cfg = _py_multiarch_transition, ), - "_limited_api": attr.label(default = "//python:limited_api"), - "_python_version": attr.label(default = "//python:python_version"), + "_limited_api": attr.label(default = "//upb/python:limited_api"), + "_python_version": attr.label(default = "//upb/python:python_version"), "_allowlist_function_transition": attr.label( default = "@bazel_tools//tools/allowlists/function_transition_allowlist", ), @@ -142,16 +142,16 @@ def _py_dist_transition_impl(settings, attr): for cpu, version in attr.limited_api_wheels.items(): transitions.append({ "//command_line_option:cpu": cpu, - "//python:python_version": version, - "//python:limited_api": True, + "//upb/python:python_version": version, + "//upb/python:limited_api": True, }) for version in attr.full_api_versions: for cpu in attr.full_api_cpus: transitions.append({ "//command_line_option:cpu": cpu, - "//python:python_version": version, - "//python:limited_api": False, + "//upb/python:python_version": version, + "//upb/python:limited_api": False, }) return transitions @@ -161,8 +161,8 @@ _py_dist_transition = transition( inputs = [], outputs = [ "//command_line_option:cpu", - "//python:python_version", - "//python:limited_api", + "//upb/python:python_version", + "//upb/python:limited_api", ], ) diff --git a/upb/python/extension_dict.c b/upb/python/extension_dict.c index d4b4ddadac..914957a624 100644 --- a/upb/python/extension_dict.c +++ b/upb/python/extension_dict.c @@ -28,11 +28,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "python/extension_dict.h" +#include "upb/python/extension_dict.h" -#include "python/message.h" -#include "python/protobuf.h" -#include "upb/reflection/def.h" +#include "upb/python/message.h" +#include "upb/python/protobuf.h" +#include "upb/upb/reflection/def.h" // ----------------------------------------------------------------------------- // ExtensionDict diff --git a/upb/python/extension_dict.h b/upb/python/extension_dict.h index 99d2addf23..724054f9f1 100644 --- a/upb/python/extension_dict.h +++ b/upb/python/extension_dict.h @@ -33,7 +33,7 @@ #include -#include "python/python_api.h" +#include "upb/python/python_api.h" PyObject* PyUpb_ExtensionDict_New(PyObject* msg); diff --git a/upb/python/map.c b/upb/python/map.c index bd9022d847..ec0133c399 100644 --- a/upb/python/map.c +++ b/upb/python/map.c @@ -28,13 +28,13 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "python/map.h" +#include "upb/python/map.h" -#include "python/convert.h" -#include "python/message.h" -#include "python/protobuf.h" -#include "upb/collections/map.h" -#include "upb/reflection/def.h" +#include "upb/python/convert.h" +#include "upb/python/message.h" +#include "upb/python/protobuf.h" +#include "upb/upb/collections/map.h" +#include "upb/upb/reflection/def.h" // ----------------------------------------------------------------------------- // MapContainer diff --git a/upb/python/map.h b/upb/python/map.h index 6c2c47d4d4..6a240688d3 100644 --- a/upb/python/map.h +++ b/upb/python/map.h @@ -33,8 +33,8 @@ #include -#include "python/python_api.h" -#include "upb/reflection/def.h" +#include "upb/python/python_api.h" +#include "upb/upb/reflection/def.h" // Creates a new repeated field stub for field `f` of message object `parent`. // Precondition: `parent` must be a stub. diff --git a/upb/python/message.c b/upb/python/message.c index 5a96980578..7c4d1c66eb 100644 --- a/upb/python/message.c +++ b/upb/python/message.c @@ -28,18 +28,18 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "python/message.h" +#include "upb/python/message.h" -#include "python/convert.h" -#include "python/descriptor.h" -#include "python/extension_dict.h" -#include "python/map.h" -#include "python/repeated.h" -#include "upb/message/copy.h" -#include "upb/reflection/def.h" -#include "upb/reflection/message.h" -#include "upb/text/encode.h" -#include "upb/util/required_fields.h" +#include "upb/python/convert.h" +#include "upb/python/descriptor.h" +#include "upb/python/extension_dict.h" +#include "upb/python/map.h" +#include "upb/python/repeated.h" +#include "upb/upb/message/copy.h" +#include "upb/upb/reflection/def.h" +#include "upb/upb/reflection/message.h" +#include "upb/upb/text/encode.h" +#include "upb/upb/util/required_fields.h" static const upb_MessageDef* PyUpb_MessageMeta_GetMsgdef(PyObject* cls); static PyObject* PyUpb_MessageMeta_GetAttr(PyObject* self, PyObject* name); diff --git a/upb/python/message.h b/upb/python/message.h index 885b5df28a..5773d9d338 100644 --- a/upb/python/message.h +++ b/upb/python/message.h @@ -33,8 +33,8 @@ #include -#include "python/protobuf.h" -#include "upb/reflection/message.h" +#include "upb/python/protobuf.h" +#include "upb/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); diff --git a/upb/python/pb_unit_tests/BUILD b/upb/python/pb_unit_tests/BUILD index 4c92a6b4ae..8aecac9463 100644 --- a/upb/python/pb_unit_tests/BUILD +++ b/upb/python/pb_unit_tests/BUILD @@ -11,7 +11,7 @@ load("@pip_deps//:requirements.bzl", "requirement") # end:github_only # begin:google_only -# package(default_applicable_licenses = ["//:license"]) +# package(default_applicable_licenses = ["//upb:license"]) # end:google_only licenses(["notice"]) @@ -41,8 +41,8 @@ py_test( main = "numpy_test_wrapper.py", deps = [ requirement("numpy"), - "@com_google_protobuf//python/google/protobuf/internal/numpy:numpy_test", - "//python:_message", + "//python/google/protobuf/internal/numpy:numpy_test", + "//upb/python:_message", ], target_compatible_with = select({ "@system_python//:supported": [], @@ -79,6 +79,6 @@ filegroup( name = "test_files", srcs = glob(["*.py"]), visibility = [ - "//python/dist:__pkg__", # Scheuklappen: keep + "//upb/python/dist:__pkg__", # Scheuklappen: keep ], ) diff --git a/upb/python/pb_unit_tests/pyproto_test_wrapper.bzl b/upb/python/pb_unit_tests/pyproto_test_wrapper.bzl index d5df8fcfdb..a6a31b3222 100644 --- a/upb/python/pb_unit_tests/pyproto_test_wrapper.bzl +++ b/upb/python/pb_unit_tests/pyproto_test_wrapper.bzl @@ -7,13 +7,13 @@ def pyproto_test_wrapper(name, deps = []): srcs = [src], legacy_create_init = False, main = src, - data = ["@com_google_protobuf//src/google/protobuf:testdata"], + data = ["//src/google/protobuf:testdata"], deps = [ - "//python:_message", - "@com_google_protobuf//:python_common_test_protos", - "@com_google_protobuf//:python_specific_test_protos", - "@com_google_protobuf//:python_test_srcs", - "@com_google_protobuf//:python_srcs", + "//upb/python:_message", + "//:python_common_test_protos", + "//:python_specific_test_protos", + "//:python_test_srcs", + "//:python_srcs", ] + deps, target_compatible_with = select({ "@system_python//:supported": [], diff --git a/upb/python/protobuf.c b/upb/python/protobuf.c index 324b1edb3e..79b2e3f895 100644 --- a/upb/python/protobuf.c +++ b/upb/python/protobuf.c @@ -28,16 +28,16 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "python/protobuf.h" +#include "upb/python/protobuf.h" -#include "python/descriptor.h" -#include "python/descriptor_containers.h" -#include "python/descriptor_pool.h" -#include "python/extension_dict.h" -#include "python/map.h" -#include "python/message.h" -#include "python/repeated.h" -#include "python/unknown_fields.h" +#include "upb/python/descriptor.h" +#include "upb/python/descriptor_containers.h" +#include "upb/python/descriptor_pool.h" +#include "upb/python/extension_dict.h" +#include "upb/python/map.h" +#include "upb/python/message.h" +#include "upb/python/repeated.h" +#include "upb/python/unknown_fields.h" static upb_Arena* PyUpb_NewArena(void); diff --git a/upb/python/protobuf.h b/upb/python/protobuf.h index 49f08b17aa..90e1dbddce 100644 --- a/upb/python/protobuf.h +++ b/upb/python/protobuf.h @@ -33,9 +33,9 @@ #include -#include "python/descriptor.h" -#include "python/python_api.h" -#include "upb/hash/int_table.h" +#include "upb/python/descriptor.h" +#include "upb/python/python_api.h" +#include "upb/upb/hash/int_table.h" // begin:github_only #define PYUPB_PROTOBUF_PUBLIC_PACKAGE "google.protobuf" diff --git a/upb/python/py_extension.bzl b/upb/python/py_extension.bzl index 7b918bc78e..aafe846eef 100644 --- a/upb/python/py_extension.bzl +++ b/upb/python/py_extension.bzl @@ -18,24 +18,24 @@ def py_extension(name, srcs, copts, deps = [], **kwargs): copts = copts + ["-fvisibility=hidden"], linkopts = selects.with_or({ ( - "//python/dist:osx_x86_64", - "//python/dist:osx_aarch64", + "//upb/python/dist:osx_x86_64", + "//upb/python/dist:osx_aarch64", ): ["-undefined", "dynamic_lookup"], - "//python/dist:windows_x86_32": ["-static-libgcc"], + "//upb/python/dist:windows_x86_32": ["-static-libgcc"], "//conditions:default": [], }), linkshared = True, linkstatic = True, deps = deps + select({ - "//python:limited_api_3.7": ["@python-3.7.0//:python_headers"], - "//python:full_api_3.7_win32": ["@nuget_python_i686_3.7.0//:python_full_api"], - "//python:full_api_3.7_win64": ["@nuget_python_x86-64_3.7.0//:python_full_api"], - "//python:full_api_3.8_win32": ["@nuget_python_i686_3.8.0//:python_full_api"], - "//python:full_api_3.8_win64": ["@nuget_python_x86-64_3.8.0//:python_full_api"], - "//python:full_api_3.9_win32": ["@nuget_python_i686_3.9.0//:python_full_api"], - "//python:full_api_3.9_win64": ["@nuget_python_x86-64_3.9.0//:python_full_api"], - "//python:limited_api_3.10_win32": ["@nuget_python_i686_3.10.0//:python_limited_api"], - "//python:limited_api_3.10_win64": ["@nuget_python_x86-64_3.10.0//:python_limited_api"], + "//upb/python:limited_api_3.7": ["@python-3.7.0//:python_headers"], + "//upb/python:full_api_3.7_win32": ["@nuget_python_i686_3.7.0//:python_full_api"], + "//upb/python:full_api_3.7_win64": ["@nuget_python_x86-64_3.7.0//:python_full_api"], + "//upb/python:full_api_3.8_win32": ["@nuget_python_i686_3.8.0//:python_full_api"], + "//upb/python:full_api_3.8_win64": ["@nuget_python_x86-64_3.8.0//:python_full_api"], + "//upb/python:full_api_3.9_win32": ["@nuget_python_i686_3.9.0//:python_full_api"], + "//upb/python:full_api_3.9_win64": ["@nuget_python_x86-64_3.9.0//:python_full_api"], + "//upb/python:limited_api_3.10_win32": ["@nuget_python_i686_3.10.0//:python_limited_api"], + "//upb/python:limited_api_3.10_win64": ["@nuget_python_x86-64_3.10.0//:python_limited_api"], "//conditions:default": ["@system_python//:python_headers"], }), **kwargs @@ -49,12 +49,12 @@ def py_extension(name, srcs, copts, deps = [], **kwargs): srcs = [":" + name + "_binary"], outs = [output_file], cmd = "cp $< $@", - visibility = ["//python:__subpackages__"], + visibility = ["//upb/python:__subpackages__"], ) native.py_library( name = name, data = [output_file], imports = ["."], - visibility = ["//python:__subpackages__"], + visibility = ["//upb/python:__subpackages__"], ) diff --git a/upb/python/repeated.c b/upb/python/repeated.c index abb34e880a..656b42c102 100644 --- a/upb/python/repeated.c +++ b/upb/python/repeated.c @@ -28,11 +28,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "python/repeated.h" +#include "upb/python/repeated.h" -#include "python/convert.h" -#include "python/message.h" -#include "python/protobuf.h" +#include "upb/python/convert.h" +#include "upb/python/message.h" +#include "upb/python/protobuf.h" static PyObject* PyUpb_RepeatedCompositeContainer_Append(PyObject* _self, PyObject* value); diff --git a/upb/python/repeated.h b/upb/python/repeated.h index 54670e7e80..413e4f11f8 100644 --- a/upb/python/repeated.h +++ b/upb/python/repeated.h @@ -33,8 +33,8 @@ #include -#include "python/python_api.h" -#include "upb/reflection/def.h" +#include "upb/python/python_api.h" +#include "upb/upb/reflection/def.h" // Creates a new repeated field stub for field `f` of message object `parent`. // Precondition: `parent` must be a stub. diff --git a/upb/python/unknown_fields.c b/upb/python/unknown_fields.c index f228f237b7..65a1383b4e 100644 --- a/upb/python/unknown_fields.c +++ b/upb/python/unknown_fields.c @@ -28,13 +28,13 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "python/unknown_fields.h" +#include "upb/python/unknown_fields.h" -#include "python/message.h" -#include "python/protobuf.h" -#include "upb/wire/eps_copy_input_stream.h" -#include "upb/wire/reader.h" -#include "upb/wire/types.h" +#include "upb/python/message.h" +#include "upb/python/protobuf.h" +#include "upb/upb/wire/eps_copy_input_stream.h" +#include "upb/upb/wire/reader.h" +#include "upb/upb/wire/types.h" // ----------------------------------------------------------------------------- // UnknownFieldSet diff --git a/upb/python/unknown_fields.h b/upb/python/unknown_fields.h index 85ea40c995..72bf2e9759 100644 --- a/upb/python/unknown_fields.h +++ b/upb/python/unknown_fields.h @@ -33,7 +33,7 @@ #include -#include "python/python_api.h" +#include "upb/python/python_api.h" PyObject* PyUpb_UnknownFields_New(PyObject* msg); diff --git a/upb/upb/base/BUILD b/upb/upb/base/BUILD index e345547b40..c64f9ad12f 100644 --- a/upb/upb/base/BUILD +++ b/upb/upb/base/BUILD @@ -5,7 +5,7 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") cc_library( name = "base", @@ -21,7 +21,7 @@ cc_library( copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], deps = [ - "//:port", + "//upb:port", ], ) @@ -32,7 +32,7 @@ cc_library( ], copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], - deps = ["//:port"], + deps = ["//upb:port"], ) # begin:github_only @@ -46,8 +46,8 @@ filegroup( ], ), visibility = [ - "//cmake:__pkg__", - "//python/dist:__pkg__", + "//upb/cmake:__pkg__", + "//upb/python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/base/descriptor_constants.h b/upb/upb/base/descriptor_constants.h index ee68d67555..897bce5443 100644 --- a/upb/upb/base/descriptor_constants.h +++ b/upb/upb/base/descriptor_constants.h @@ -32,7 +32,7 @@ #define UPB_BASE_DESCRIPTOR_CONSTANTS_H_ // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" // The types a field can have. Note that this list is not identical to the // types defined in descriptor.proto, which gives INT32 and SINT32 separate @@ -102,6 +102,6 @@ UPB_INLINE bool upb_FieldType_IsPackable(upb_FieldType type) { } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_BASE_DESCRIPTOR_CONSTANTS_H_ */ diff --git a/upb/upb/base/internal/log2.h b/upb/upb/base/internal/log2.h index 2f3256ec65..8a441504ef 100644 --- a/upb/upb/base/internal/log2.h +++ b/upb/upb/base/internal/log2.h @@ -32,7 +32,7 @@ #define UPB_BASE_LOG2_H_ // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -55,6 +55,6 @@ UPB_INLINE int upb_Log2CeilingSize(int x) { return 1 << upb_Log2Ceiling(x); } } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_BASE_LOG2_H_ */ diff --git a/upb/upb/base/status.c b/upb/upb/base/status.c index 576c957de0..716574eb5b 100644 --- a/upb/upb/base/status.c +++ b/upb/upb/base/status.c @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/base/status.h" +#include "upb/upb/base/status.h" #include #include @@ -37,7 +37,7 @@ #include // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" void upb_Status_Clear(upb_Status* status) { if (!status) return; diff --git a/upb/upb/base/status.h b/upb/upb/base/status.h index 9f38f4c369..b0079a12cc 100644 --- a/upb/upb/base/status.h +++ b/upb/upb/base/status.h @@ -34,7 +34,7 @@ #include // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #define _kUpb_Status_MaxMessage 127 @@ -64,6 +64,6 @@ void upb_Status_VAppendErrorFormat(upb_Status* status, const char* fmt, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_BASE_STATUS_H_ */ diff --git a/upb/upb/base/status.hpp b/upb/upb/base/status.hpp index 2dc4c8a84d..74bc69dc49 100644 --- a/upb/upb/base/status.hpp +++ b/upb/upb/base/status.hpp @@ -31,7 +31,7 @@ #ifndef UPB_BASE_STATUS_HPP_ #define UPB_BASE_STATUS_HPP_ -#include "upb/base/status.h" +#include "upb/upb/base/status.h" namespace upb { diff --git a/upb/upb/base/string_view.h b/upb/upb/base/string_view.h index c9454b365b..b7c94276f2 100644 --- a/upb/upb/base/string_view.h +++ b/upb/upb/base/string_view.h @@ -34,7 +34,7 @@ #include // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #define UPB_STRINGVIEW_INIT(ptr, len) \ { ptr, len } @@ -76,6 +76,6 @@ UPB_INLINE bool upb_StringView_IsEqual(upb_StringView a, upb_StringView b) { } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_BASE_STRING_VIEW_H_ */ diff --git a/upb/upb/collections/BUILD b/upb/upb/collections/BUILD index 9647f1ea3d..71046ef330 100644 --- a/upb/upb/collections/BUILD +++ b/upb/upb/collections/BUILD @@ -5,7 +5,7 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") cc_library( name = "collections", @@ -17,9 +17,9 @@ cc_library( visibility = ["//visibility:public"], deps = [ ":internal", - "//:base", - "//:mem", - "//:port", + "//upb:base", + "//upb:mem", + "//upb:port", ], ) @@ -43,15 +43,15 @@ cc_library( copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], deps = [ - "//:base", - "//:base_internal", - "//:hash", - "//:mem", - "//:message_internal", - "//:message_internal_types", - "//:message_tagged_ptr", - "//:mini_table", - "//:port", + "//upb:base", + "//upb:base_internal", + "//upb:hash", + "//upb:mem", + "//upb:message_internal", + "//upb:message_internal_types", + "//upb:message_tagged_ptr", + "//upb:mini_table", + "//upb:port", ], ) @@ -64,7 +64,7 @@ cc_library( visibility = ["//visibility:public"], deps = [ ":collections", - "//:port", + "//upb:port", ], ) @@ -73,8 +73,8 @@ cc_test( srcs = ["array_test.cc"], deps = [ ":collections", - "//:base", - "//:mem", + "//upb:base", + "//upb:mem", "@com_google_googletest//:gtest_main", ], ) @@ -84,8 +84,8 @@ cc_test( srcs = ["map_test.cc"], deps = [ ":collections", - "//:base", - "//:mem", + "//upb:base", + "//upb:mem", "@com_google_googletest//:gtest_main", ], ) @@ -100,8 +100,8 @@ filegroup( ], ), visibility = [ - "//cmake:__pkg__", - "//python/dist:__pkg__", + "//upb/cmake:__pkg__", + "//upb/python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/collections/array.c b/upb/upb/collections/array.c index f46fc3e88f..b51c586937 100644 --- a/upb/upb/collections/array.c +++ b/upb/upb/collections/array.c @@ -28,12 +28,12 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/collections/internal/array.h" +#include "upb/upb/collections/internal/array.h" #include // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" const char _upb_Array_CTypeSizeLg2Table[] = { [kUpb_CType_Bool] = 0, diff --git a/upb/upb/collections/array.h b/upb/upb/collections/array.h index 7df2f0a085..ef8af6d512 100644 --- a/upb/upb/collections/array.h +++ b/upb/upb/collections/array.h @@ -31,12 +31,12 @@ #ifndef UPB_COLLECTIONS_ARRAY_H_ #define UPB_COLLECTIONS_ARRAY_H_ -#include "upb/base/descriptor_constants.h" -#include "upb/collections/message_value.h" -#include "upb/mem/arena.h" +#include "upb/upb/base/descriptor_constants.h" +#include "upb/upb/collections/message_value.h" +#include "upb/upb/mem/arena.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -89,6 +89,6 @@ UPB_API void* upb_Array_MutableDataPtr(upb_Array* arr); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_COLLECTIONS_ARRAY_H_ */ diff --git a/upb/upb/collections/array_split64.h b/upb/upb/collections/array_split64.h index 69ea57906b..9afd40eff6 100644 --- a/upb/upb/collections/array_split64.h +++ b/upb/upb/collections/array_split64.h @@ -31,10 +31,10 @@ #ifndef UPB_COLLECTIONS_ARRAY_SPLIT64_H_ #define UPB_COLLECTIONS_ARRAY_SPLIT64_H_ -#include "upb/collections/array.h" +#include "upb/upb/collections/array.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -88,6 +88,6 @@ UPB_API_INLINE bool upb_Array_AppendUInt64Split(upb_Array* array, uint32_t hi, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_COLLECTIONS_ARRAY_SPLIT64_H_ */ diff --git a/upb/upb/collections/array_test.cc b/upb/upb/collections/array_test.cc index b84464b4ed..87090b403d 100644 --- a/upb/upb/collections/array_test.cc +++ b/upb/upb/collections/array_test.cc @@ -28,11 +28,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/collections/array.h" +#include "upb/upb/collections/array.h" #include "gtest/gtest.h" -#include "upb/base/status.hpp" -#include "upb/mem/arena.hpp" +#include "upb/upb/base/status.hpp" +#include "upb/upb/mem/arena.hpp" TEST(ArrayTest, Resize) { upb::Arena arena; diff --git a/upb/upb/collections/internal/array.h b/upb/upb/collections/internal/array.h index 1c2f3f50d0..8d1d322356 100644 --- a/upb/upb/collections/internal/array.h +++ b/upb/upb/collections/internal/array.h @@ -33,10 +33,10 @@ #include -#include "upb/collections/array.h" +#include "upb/upb/collections/array.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -133,6 +133,6 @@ UPB_INLINE void _upb_array_detach(const void* msg, size_t ofs) { } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_COLLECTIONS_INTERNAL_ARRAY_H_ */ diff --git a/upb/upb/collections/internal/map.h b/upb/upb/collections/internal/map.h index 5900736920..ce97ef40fe 100644 --- a/upb/upb/collections/internal/map.h +++ b/upb/upb/collections/internal/map.h @@ -33,13 +33,13 @@ #ifndef UPB_COLLECTIONS_INTERNAL_MAP_H_ #define UPB_COLLECTIONS_INTERNAL_MAP_H_ -#include "upb/base/string_view.h" -#include "upb/collections/map.h" -#include "upb/hash/str_table.h" -#include "upb/mem/arena.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/collections/map.h" +#include "upb/upb/hash/str_table.h" +#include "upb/upb/mem/arena.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" struct upb_Map { // Size of key and val, based on the map type. @@ -168,6 +168,6 @@ upb_Map* _upb_Map_New(upb_Arena* a, size_t key_size, size_t value_size); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_COLLECTIONS_INTERNAL_MAP_H_ */ diff --git a/upb/upb/collections/internal/map_entry.h b/upb/upb/collections/internal/map_entry.h index 27185447cb..56bd44b4b1 100644 --- a/upb/upb/collections/internal/map_entry.h +++ b/upb/upb/collections/internal/map_entry.h @@ -31,9 +31,9 @@ #ifndef UPB_COLLECTIONS_INTERNAL_MAP_ENTRY_H_ #define UPB_COLLECTIONS_INTERNAL_MAP_ENTRY_H_ -#include "upb/base/string_view.h" -#include "upb/hash/common.h" -#include "upb/message/internal/types.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/hash/common.h" +#include "upb/upb/message/internal/types.h" // Map entries aren't actually stored for map fields, they are only used during // parsing. For parsing, it helps a lot if all map entry messages have the same diff --git a/upb/upb/collections/internal/map_sorter.h b/upb/upb/collections/internal/map_sorter.h index a464959b79..4e1ff51b5c 100644 --- a/upb/upb/collections/internal/map_sorter.h +++ b/upb/upb/collections/internal/map_sorter.h @@ -35,12 +35,12 @@ #include -#include "upb/collections/internal/map.h" -#include "upb/collections/internal/map_entry.h" -#include "upb/message/internal/extension.h" +#include "upb/upb/collections/internal/map.h" +#include "upb/upb/collections/internal/map_entry.h" +#include "upb/upb/message/internal/extension.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -107,6 +107,6 @@ bool _upb_mapsorter_pushexts(_upb_mapsorter* s, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_COLLECTIONS_INTERNAL_MAP_SORTER_H_ */ diff --git a/upb/upb/collections/map.c b/upb/upb/collections/map.c index a445e591c2..d6792ebbae 100644 --- a/upb/upb/collections/map.c +++ b/upb/upb/collections/map.c @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/collections/map.h" +#include "upb/upb/collections/map.h" #include -#include "upb/collections/internal/map.h" -#include "upb/mem/arena.h" +#include "upb/upb/collections/internal/map.h" +#include "upb/upb/mem/arena.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" // Strings/bytes are special-cased in maps. char _upb_Map_CTypeSizeTable[12] = { diff --git a/upb/upb/collections/map.h b/upb/upb/collections/map.h index 10b9c36e3e..13c937bf74 100644 --- a/upb/upb/collections/map.h +++ b/upb/upb/collections/map.h @@ -31,12 +31,12 @@ #ifndef UPB_COLLECTIONS_MAP_H_ #define UPB_COLLECTIONS_MAP_H_ -#include "upb/base/descriptor_constants.h" -#include "upb/collections/message_value.h" -#include "upb/mem/arena.h" +#include "upb/upb/base/descriptor_constants.h" +#include "upb/upb/collections/message_value.h" +#include "upb/upb/mem/arena.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -138,6 +138,6 @@ UPB_API upb_MessageValue upb_MapIterator_Value(const upb_Map* map, size_t iter); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_COLLECTIONS_MAP_H_ */ diff --git a/upb/upb/collections/map_gencode_util.h b/upb/upb/collections/map_gencode_util.h index c6df5451c1..135ec6233b 100644 --- a/upb/upb/collections/map_gencode_util.h +++ b/upb/upb/collections/map_gencode_util.h @@ -33,10 +33,10 @@ #ifndef UPB_COLLECTIONS_MAP_GENCODE_UTIL_H_ #define UPB_COLLECTIONS_MAP_GENCODE_UTIL_H_ -#include "upb/collections/internal/map.h" +#include "upb/upb/collections/internal/map.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -76,6 +76,6 @@ UPB_INLINE void _upb_msg_map_set_value(void* msg, const void* val, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_COLLECTIONS_MAP_GENCODE_UTIL_H_ */ diff --git a/upb/upb/collections/map_sorter.c b/upb/upb/collections/map_sorter.c index 9ad2a66087..8725cd661e 100644 --- a/upb/upb/collections/map_sorter.c +++ b/upb/upb/collections/map_sorter.c @@ -28,12 +28,12 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/collections/internal/map_sorter.h" +#include "upb/upb/collections/internal/map_sorter.h" -#include "upb/base/internal/log2.h" +#include "upb/upb/base/internal/log2.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" static void _upb_mapsorter_getkeys(const void* _a, const void* _b, void* a_key, void* b_key, size_t size) { diff --git a/upb/upb/collections/map_test.cc b/upb/upb/collections/map_test.cc index d5846871a9..440d89c2d0 100644 --- a/upb/upb/collections/map_test.cc +++ b/upb/upb/collections/map_test.cc @@ -28,11 +28,11 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/collections/map.h" +#include "upb/upb/collections/map.h" #include "gtest/gtest.h" -#include "upb/base/string_view.h" -#include "upb/mem/arena.hpp" +#include "upb/upb/base/string_view.h" +#include "upb/upb/mem/arena.hpp" TEST(MapTest, DeleteRegression) { upb::Arena arena; diff --git a/upb/upb/collections/message_value.h b/upb/upb/collections/message_value.h index f015024a0f..74058d08c2 100644 --- a/upb/upb/collections/message_value.h +++ b/upb/upb/collections/message_value.h @@ -29,17 +29,17 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Users should include array.h or map.h instead. -// IWYU pragma: private, include "upb/collections/array.h" +// IWYU pragma: private, include "upb/upb/collections/array.h" #ifndef UPB_MESSAGE_VALUE_H_ #define UPB_MESSAGE_VALUE_H_ -#include "upb/base/string_view.h" -#include "upb/message/tagged_ptr.h" -#include "upb/mini_table/message.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/message/tagged_ptr.h" +#include "upb/upb/mini_table/message.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" typedef struct upb_Array upb_Array; typedef struct upb_Map upb_Map; @@ -70,6 +70,6 @@ typedef union { upb_Message* msg; } upb_MutableMessageValue; -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MESSAGE_VALUE_H_ */ diff --git a/upb/upb/conformance/BUILD b/upb/upb/conformance/BUILD index 41bd40a467..a8b63ab110 100644 --- a/upb/upb/conformance/BUILD +++ b/upb/upb/conformance/BUILD @@ -6,18 +6,18 @@ # https://developers.google.com/open-source/licenses/bsd load( - "//bazel:build_defs.bzl", + "//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS", "make_shell_script", ) load( - "//bazel:upb_proto_library.bzl", + "//upb/bazel:upb_proto_library.bzl", "upb_proto_library", "upb_proto_reflection_library", ) # begin:google_only -# package(default_applicable_licenses = ["//:license"]) +# package(default_applicable_licenses = ["//upb:license"]) # end:google_only licenses(["notice"]) @@ -31,13 +31,13 @@ config_setting( upb_proto_library( name = "conformance_upb_proto", testonly = 1, - deps = ["@com_google_protobuf//conformance:conformance_proto"], + deps = ["//conformance:conformance_proto"], ) upb_proto_reflection_library( name = "conformance_upb_proto_reflection", testonly = 1, - deps = ["@com_google_protobuf//conformance:conformance_proto"], + deps = ["//conformance:conformance_proto"], ) upb_proto_reflection_library( @@ -46,7 +46,7 @@ upb_proto_reflection_library( visibility = [ "//visibility:private", # Only private by automation, not intent. Owner may accept CLs adding visibility. See go/scheuklappen#explicit-private. ], - deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto2_proto"], + deps = ["//src/google/protobuf:test_messages_proto2_proto"], ) upb_proto_reflection_library( @@ -55,7 +55,7 @@ upb_proto_reflection_library( visibility = [ "//visibility:private", # Only private by automation, not intent. Owner may accept CLs adding visibility. See go/scheuklappen#explicit-private. ], - deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto3_proto"], + deps = ["//src/google/protobuf:test_messages_proto3_proto"], ) cc_binary( @@ -73,11 +73,11 @@ cc_binary( ":conformance_upb_proto_reflection", ":test_messages_proto2_upbdefs", ":test_messages_proto3_upbdefs", - "//:json", - "//:port", - "//:reflection", - "//:text", - "//:wire", + "//upb:json", + "//upb:port", + "//upb:reflection", + "//upb:text", + "//upb:wire", ], ) @@ -91,14 +91,14 @@ sh_test( name = "test_conformance_upb", srcs = ["test_conformance_upb.sh"], args = [ - "$(location @com_google_protobuf//conformance:conformance_test_runner)", + "$(location //conformance:conformance_test_runner)", "$(location :conformance_upb_failures.txt)", "$(location :conformance_upb)", ], data = [ "conformance_upb_failures.txt", ":conformance_upb", - "@com_google_protobuf//conformance:conformance_test_runner", + "//conformance:conformance_test_runner", ], target_compatible_with = select({ "@platforms//os:windows": ["@platforms//:incompatible"], @@ -124,11 +124,11 @@ cc_binary( ":conformance_upb_proto_reflection", ":test_messages_proto2_upbdefs", ":test_messages_proto3_upbdefs", - "//:json", - "//:port", - "//:reflection", - "//:text", - "//:wire", + "//upb:json", + "//upb:port", + "//upb:reflection", + "//upb:text", + "//upb:wire", ], ) @@ -142,14 +142,14 @@ sh_test( name = "test_conformance_upb_dynamic_minitable", srcs = ["test_conformance_upb_dynamic_minitable.sh"], args = [ - "$(location @com_google_protobuf//conformance:conformance_test_runner)", + "$(location //conformance:conformance_test_runner)", "$(location :conformance_upb_failures.txt)", "$(location :conformance_upb_dynamic_minitable)", ], data = [ "conformance_upb_failures.txt", ":conformance_upb_dynamic_minitable", - "@com_google_protobuf//conformance:conformance_test_runner", + "//conformance:conformance_test_runner", ], deps = ["@bazel_tools//tools/bash/runfiles"], ) diff --git a/upb/upb/conformance/conformance_upb.c b/upb/upb/conformance/conformance_upb.c index 0a62201364..258e031c85 100644 --- a/upb/upb/conformance/conformance_upb.c +++ b/upb/upb/conformance/conformance_upb.c @@ -41,15 +41,15 @@ #include "conformance/conformance.upbdefs.h" #include "google/protobuf/test_messages_proto2.upbdefs.h" #include "google/protobuf/test_messages_proto3.upbdefs.h" -#include "upb/json/decode.h" -#include "upb/json/encode.h" -#include "upb/reflection/message.h" -#include "upb/text/encode.h" -#include "upb/wire/decode.h" -#include "upb/wire/encode.h" +#include "upb/upb/json/decode.h" +#include "upb/upb/json/encode.h" +#include "upb/upb/reflection/message.h" +#include "upb/upb/text/encode.h" +#include "upb/upb/wire/decode.h" +#include "upb/upb/wire/encode.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" int test_count = 0; bool verbose = false; /* Set to true to get req/resp printed on stderr. */ diff --git a/upb/upb/generated_code_support.h b/upb/upb/generated_code_support.h index d589640e3b..820bd66bea 100644 --- a/upb/upb/generated_code_support.h +++ b/upb/upb/generated_code_support.h @@ -32,26 +32,26 @@ #define UPB_GENERATED_CODE_SUPPORT_H_ // IWYU pragma: begin_exports -#include "upb/collections/array.h" -#include "upb/collections/internal/array.h" -#include "upb/collections/map_gencode_util.h" -#include "upb/collections/message_value.h" -#include "upb/message/accessors.h" -#include "upb/message/internal/accessors.h" -#include "upb/message/internal/extension.h" -#include "upb/message/internal/message.h" -#include "upb/message/message.h" -#include "upb/mini_descriptor/decode.h" -#include "upb/mini_table/enum.h" -#include "upb/mini_table/extension.h" -#include "upb/mini_table/extension_registry.h" -#include "upb/mini_table/field.h" -#include "upb/mini_table/file.h" -#include "upb/mini_table/message.h" -#include "upb/mini_table/sub.h" -#include "upb/wire/decode.h" -#include "upb/wire/decode_fast.h" -#include "upb/wire/encode.h" +#include "upb/upb/collections/array.h" +#include "upb/upb/collections/internal/array.h" +#include "upb/upb/collections/map_gencode_util.h" +#include "upb/upb/collections/message_value.h" +#include "upb/upb/message/accessors.h" +#include "upb/upb/message/internal/accessors.h" +#include "upb/upb/message/internal/extension.h" +#include "upb/upb/message/internal/message.h" +#include "upb/upb/message/message.h" +#include "upb/upb/mini_descriptor/decode.h" +#include "upb/upb/mini_table/enum.h" +#include "upb/upb/mini_table/extension.h" +#include "upb/upb/mini_table/extension_registry.h" +#include "upb/upb/mini_table/field.h" +#include "upb/upb/mini_table/file.h" +#include "upb/upb/mini_table/message.h" +#include "upb/upb/mini_table/sub.h" +#include "upb/upb/wire/decode.h" +#include "upb/upb/wire/decode_fast.h" +#include "upb/upb/wire/encode.h" // IWYU pragma: end_exports #endif // UPB_GENERATED_CODE_SUPPORT_H_ diff --git a/upb/upb/hash/BUILD b/upb/upb/hash/BUILD index afe696aa72..a83ee68f6a 100644 --- a/upb/upb/hash/BUILD +++ b/upb/upb/hash/BUILD @@ -5,7 +5,7 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") cc_library( name = "hash", @@ -20,10 +20,10 @@ cc_library( copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], deps = [ - "//:base", - "//:base_internal", - "//:mem", - "//:port", + "//upb:base", + "//upb:base_internal", + "//upb:mem", + "//upb:port", ], ) @@ -32,8 +32,8 @@ cc_test( srcs = ["test.cc"], deps = [ ":hash", - "//:mem", - "//:port", + "//upb:mem", + "//upb:port", "@com_google_absl//absl/container:flat_hash_map", "@com_google_googletest//:gtest_main", ], @@ -49,8 +49,8 @@ filegroup( ], ), visibility = [ - "//cmake:__pkg__", - "//python/dist:__pkg__", + "//upb/cmake:__pkg__", + "//upb/python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/hash/common.c b/upb/upb/hash/common.c index d8addce657..7eecaa0c75 100644 --- a/upb/upb/hash/common.c +++ b/upb/upb/hash/common.c @@ -36,12 +36,12 @@ #include -#include "upb/base/internal/log2.h" -#include "upb/hash/int_table.h" -#include "upb/hash/str_table.h" +#include "upb/upb/base/internal/log2.h" +#include "upb/upb/hash/int_table.h" +#include "upb/upb/hash/str_table.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #define UPB_MAXARRSIZE 16 // 2**16 = 64k. diff --git a/upb/upb/hash/common.h b/upb/upb/hash/common.h index 5280d34e85..44588b045b 100644 --- a/upb/upb/hash/common.h +++ b/upb/upb/hash/common.h @@ -52,11 +52,11 @@ #include -#include "upb/base/string_view.h" -#include "upb/mem/arena.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/mem/arena.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -198,6 +198,6 @@ uint32_t _upb_Hash(const void* p, size_t n, uint64_t seed); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_HASH_COMMON_H_ */ diff --git a/upb/upb/hash/int_table.h b/upb/upb/hash/int_table.h index 367f1ac89a..99641c2199 100644 --- a/upb/upb/hash/int_table.h +++ b/upb/upb/hash/int_table.h @@ -31,10 +31,10 @@ #ifndef UPB_HASH_INT_TABLE_H_ #define UPB_HASH_INT_TABLE_H_ -#include "upb/hash/common.h" +#include "upb/upb/hash/common.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" typedef struct { upb_table t; // For entries that don't fit in the array part. @@ -100,6 +100,6 @@ void upb_inttable_removeiter(upb_inttable* t, intptr_t* iter); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_HASH_INT_TABLE_H_ */ diff --git a/upb/upb/hash/str_table.h b/upb/upb/hash/str_table.h index 8522be9787..0fe8ae964b 100644 --- a/upb/upb/hash/str_table.h +++ b/upb/upb/hash/str_table.h @@ -31,10 +31,10 @@ #ifndef UPB_HASH_STR_TABLE_H_ #define UPB_HASH_STR_TABLE_H_ -#include "upb/hash/common.h" +#include "upb/upb/hash/common.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" typedef struct { upb_table t; @@ -160,6 +160,6 @@ bool upb_strtable_iter_isequal(const upb_strtable_iter* i1, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_HASH_STR_TABLE_H_ */ diff --git a/upb/upb/hash/test.cc b/upb/upb/hash/test.cc index c9a4b8c80e..5bb79f6b91 100644 --- a/upb/upb/hash/test.cc +++ b/upb/upb/hash/test.cc @@ -41,12 +41,12 @@ #include "gtest/gtest.h" #include "absl/container/flat_hash_map.h" -#include "upb/hash/int_table.h" -#include "upb/hash/str_table.h" -#include "upb/mem/arena.hpp" +#include "upb/upb/hash/int_table.h" +#include "upb/upb/hash/str_table.h" +#include "upb/upb/mem/arena.hpp" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" using std::vector; diff --git a/upb/upb/io/BUILD b/upb/upb/io/BUILD index 820150623d..9874948ed2 100644 --- a/upb/upb/io/BUILD +++ b/upb/upb/io/BUILD @@ -1,13 +1,13 @@ # begin:google_only -# package(default_applicable_licenses = ["//:license"]) +# package(default_applicable_licenses = ["//upb:license"]) # end:google_only cc_library( name = "string", hdrs = ["string.h"], deps = [ - "//:mem", - "//:port", + "//upb:mem", + "//upb:port", ], ) @@ -18,10 +18,10 @@ cc_library( deps = [ ":string", ":zero_copy_stream", - "//:base", - "//:lex", - "//:mem", - "//:port", + "//upb:base", + "//upb:lex", + "//upb:mem", + "//upb:port", ], ) @@ -32,9 +32,9 @@ cc_library( "zero_copy_output_stream.h", ], deps = [ - "//:base", - "//:mem", - "//:port", + "//upb:base", + "//upb:mem", + "//upb:port", ], ) @@ -53,8 +53,8 @@ cc_library( ], deps = [ ":zero_copy_stream", - "//:mem", - "//:port", + "//upb:mem", + "//upb:port", ], ) @@ -64,7 +64,7 @@ cc_test( srcs = ["string_test.cc"], deps = [ ":string", - "//:mem", + "//upb:mem", "@com_google_googletest//:gtest_main", ], ) @@ -78,9 +78,9 @@ cc_test( ":string", ":tokenizer", ":zero_copy_stream", - "//:lex", - "//:mem", - "//:port", + "//upb:lex", + "//upb:mem", + "//upb:port", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", "@com_google_googletest//:gtest_main", @@ -96,8 +96,8 @@ cc_test( deps = [ ":chunked_stream", ":zero_copy_stream", - "//:base", - "//:mem", + "//upb:base", + "//upb:mem", "@com_google_googletest//:gtest_main", ], ) diff --git a/upb/upb/io/chunked_input_stream.c b/upb/upb/io/chunked_input_stream.c index 58a1c95389..d44b74083f 100644 --- a/upb/upb/io/chunked_input_stream.c +++ b/upb/upb/io/chunked_input_stream.c @@ -28,10 +28,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/io/chunked_input_stream.h" +#include "upb/upb/io/chunked_input_stream.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" typedef struct { upb_ZeroCopyInputStream base; diff --git a/upb/upb/io/chunked_input_stream.h b/upb/upb/io/chunked_input_stream.h index 449726699c..117d89d6c5 100644 --- a/upb/upb/io/chunked_input_stream.h +++ b/upb/upb/io/chunked_input_stream.h @@ -31,11 +31,11 @@ #ifndef UPB_IO_CHUNKED_INPUT_STREAM_H_ #define UPB_IO_CHUNKED_INPUT_STREAM_H_ -#include "upb/io/zero_copy_input_stream.h" -#include "upb/mem/arena.h" +#include "upb/upb/io/zero_copy_input_stream.h" +#include "upb/upb/mem/arena.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -51,6 +51,6 @@ upb_ZeroCopyInputStream* upb_ChunkedInputStream_New(const void* data, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_IO_CHUNKED_INPUT_STREAM_H_ */ diff --git a/upb/upb/io/chunked_output_stream.c b/upb/upb/io/chunked_output_stream.c index 6546124b1a..b9cdc461ab 100644 --- a/upb/upb/io/chunked_output_stream.c +++ b/upb/upb/io/chunked_output_stream.c @@ -28,10 +28,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/io/chunked_output_stream.h" +#include "upb/upb/io/chunked_output_stream.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" typedef struct { upb_ZeroCopyOutputStream base; diff --git a/upb/upb/io/chunked_output_stream.h b/upb/upb/io/chunked_output_stream.h index f52b6abf35..5205ce6eca 100644 --- a/upb/upb/io/chunked_output_stream.h +++ b/upb/upb/io/chunked_output_stream.h @@ -31,11 +31,11 @@ #ifndef UPB_IO_CHUNKED_OUTPUT_STREAM_H_ #define UPB_IO_CHUNKED_OUTPUT_STREAM_H_ -#include "upb/io/zero_copy_output_stream.h" -#include "upb/mem/arena.h" +#include "upb/upb/io/zero_copy_output_stream.h" +#include "upb/upb/mem/arena.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -51,6 +51,6 @@ upb_ZeroCopyOutputStream* upb_ChunkedOutputStream_New(void* data, size_t size, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_IO_CHUNKED_OUTPUT_STREAM_H_ */ diff --git a/upb/upb/io/string.h b/upb/upb/io/string.h index 7aa8bdf543..007b15ad37 100644 --- a/upb/upb/io/string.h +++ b/upb/upb/io/string.h @@ -41,11 +41,11 @@ #include #include -#include "upb/mem/arena.h" -#include "upb/port/vsnprintf_compat.h" +#include "upb/upb/mem/arena.h" +#include "upb/upb/port/vsnprintf_compat.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -165,6 +165,6 @@ UPB_INLINE bool upb_String_PushBack(upb_String* s, char ch) { } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_IO_STRING_H_ */ diff --git a/upb/upb/io/string_test.cc b/upb/upb/io/string_test.cc index f6c2b38ac9..3d8067cf40 100644 --- a/upb/upb/io/string_test.cc +++ b/upb/upb/io/string_test.cc @@ -28,12 +28,12 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/io/string.h" +#include "upb/upb/io/string.h" #include #include "gtest/gtest.h" -#include "upb/mem/arena.hpp" +#include "upb/upb/mem/arena.hpp" TEST(StringTest, Append) { upb::Arena arena; diff --git a/upb/upb/io/tokenizer.c b/upb/upb/io/tokenizer.c index d82618a515..357a6512c2 100644 --- a/upb/upb/io/tokenizer.c +++ b/upb/upb/io/tokenizer.c @@ -28,14 +28,14 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/io/tokenizer.h" +#include "upb/upb/io/tokenizer.h" -#include "upb/io/string.h" -#include "upb/lex/strtod.h" -#include "upb/lex/unicode.h" +#include "upb/upb/io/string.h" +#include "upb/upb/lex/strtod.h" +#include "upb/upb/lex/unicode.h" // Must be included last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" typedef enum { // Started a line comment. diff --git a/upb/upb/io/tokenizer.h b/upb/upb/io/tokenizer.h index ca8675771f..cd8c334b1f 100644 --- a/upb/upb/io/tokenizer.h +++ b/upb/upb/io/tokenizer.h @@ -33,13 +33,13 @@ #ifndef UPB_IO_TOKENIZER_H_ #define UPB_IO_TOKENIZER_H_ -#include "upb/base/status.h" -#include "upb/base/string_view.h" -#include "upb/io/zero_copy_input_stream.h" -#include "upb/mem/arena.h" +#include "upb/upb/base/status.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/io/zero_copy_input_stream.h" +#include "upb/upb/mem/arena.h" // Must be included last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -151,6 +151,6 @@ upb_StringView upb_Parse_String(const char* text, upb_Arena* arena); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPB_IO_TOKENIZER_H_ diff --git a/upb/upb/io/tokenizer_test.cc b/upb/upb/io/tokenizer_test.cc index 59cff71e3f..86a0a6015e 100644 --- a/upb/upb/io/tokenizer_test.cc +++ b/upb/upb/io/tokenizer_test.cc @@ -28,18 +28,18 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/io/tokenizer.h" +#include "upb/upb/io/tokenizer.h" #include "gtest/gtest.h" #include "absl/strings/escaping.h" #include "absl/strings/str_format.h" -#include "upb/io/chunked_input_stream.h" -#include "upb/io/string.h" -#include "upb/lex/unicode.h" -#include "upb/mem/arena.hpp" +#include "upb/upb/io/chunked_input_stream.h" +#include "upb/upb/io/string.h" +#include "upb/upb/lex/unicode.h" +#include "upb/upb/mem/arena.hpp" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" namespace proto2 { namespace io { diff --git a/upb/upb/io/zero_copy_input_stream.h b/upb/upb/io/zero_copy_input_stream.h index b5eef3e71f..1a93ca8f44 100644 --- a/upb/upb/io/zero_copy_input_stream.h +++ b/upb/upb/io/zero_copy_input_stream.h @@ -31,10 +31,10 @@ #ifndef UPB_IO_ZERO_COPY_INPUT_STREAM_H_ #define UPB_IO_ZERO_COPY_INPUT_STREAM_H_ -#include "upb/base/status.h" +#include "upb/upb/base/status.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -127,6 +127,6 @@ upb_ZeroCopyInputStream_ByteCount(const upb_ZeroCopyInputStream* z) { } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_IO_ZERO_COPY_INPUT_STREAM_H_ */ diff --git a/upb/upb/io/zero_copy_output_stream.h b/upb/upb/io/zero_copy_output_stream.h index 485a94f5c5..bb2f0cd2e7 100644 --- a/upb/upb/io/zero_copy_output_stream.h +++ b/upb/upb/io/zero_copy_output_stream.h @@ -31,10 +31,10 @@ #ifndef UPB_IO_ZERO_COPY_OUTPUT_STREAM_H_ #define UPB_IO_ZERO_COPY_OUTPUT_STREAM_H_ -#include "upb/base/status.h" +#include "upb/upb/base/status.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -128,6 +128,6 @@ upb_ZeroCopyOutputStream_ByteCount(const upb_ZeroCopyOutputStream* z) { } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_IO_ZERO_COPY_OUTPUT_STREAM_H_ */ diff --git a/upb/upb/io/zero_copy_stream_test.cc b/upb/upb/io/zero_copy_stream_test.cc index 475af836b4..c6b3ed77ca 100644 --- a/upb/upb/io/zero_copy_stream_test.cc +++ b/upb/upb/io/zero_copy_stream_test.cc @@ -38,10 +38,10 @@ // the output. #include "gtest/gtest.h" -#include "upb/base/status.hpp" -#include "upb/io/chunked_input_stream.h" -#include "upb/io/chunked_output_stream.h" -#include "upb/mem/arena.hpp" +#include "upb/upb/base/status.hpp" +#include "upb/upb/io/chunked_input_stream.h" +#include "upb/upb/io/chunked_output_stream.h" +#include "upb/upb/mem/arena.hpp" namespace upb { namespace { diff --git a/upb/upb/json/BUILD b/upb/upb/json/BUILD index 538c2c8bf7..4575a740a8 100644 --- a/upb/upb/json/BUILD +++ b/upb/upb/json/BUILD @@ -1,8 +1,8 @@ # TODO(haberman): describe this package. -load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") load( - "//bazel:upb_proto_library.bzl", + "//upb/bazel:upb_proto_library.bzl", "upb_proto_library", "upb_proto_reflection_library", ) @@ -20,11 +20,11 @@ cc_library( copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], deps = [ - "//:collections", - "//:lex", - "//:port", - "//:reflection", - "//:wire", + "//upb:collections", + "//upb:lex", + "//upb:port", + "//upb:reflection", + "//upb:wire", ], ) @@ -36,8 +36,8 @@ cc_test( ":struct_upb_proto", ":test_upb_proto", ":test_upb_proto_reflection", - "//:mem", - "//:reflection", + "//upb:mem", + "//upb:reflection", "@com_google_googletest//:gtest_main", ], ) @@ -50,9 +50,9 @@ cc_test( ":struct_upb_proto", ":test_upb_proto", ":test_upb_proto_reflection", - "//:base", - "//:mem", - "//:reflection", + "//upb:base", + "//upb:mem", + "//upb:reflection", "@com_google_googletest//:gtest_main", ], ) @@ -61,7 +61,7 @@ proto_library( name = "test_proto", testonly = 1, srcs = ["test.proto"], - deps = ["@com_google_protobuf//:struct_proto"], + deps = ["//:struct_proto"], ) upb_proto_library( @@ -80,5 +80,5 @@ upb_proto_reflection_library( upb_proto_library( name = "struct_upb_proto", testonly = 1, - deps = ["@com_google_protobuf//:struct_proto"], + deps = ["//:struct_proto"], ) diff --git a/upb/upb/json/decode.c b/upb/upb/json/decode.c index dea0c83905..c99b7565b2 100644 --- a/upb/upb/json/decode.c +++ b/upb/upb/json/decode.c @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/json/decode.h" +#include "upb/upb/json/decode.h" #include #include @@ -38,14 +38,14 @@ #include #include -#include "upb/collections/map.h" -#include "upb/lex/atoi.h" -#include "upb/lex/unicode.h" -#include "upb/reflection/message.h" -#include "upb/wire/encode.h" +#include "upb/upb/collections/map.h" +#include "upb/upb/lex/atoi.h" +#include "upb/upb/lex/unicode.h" +#include "upb/upb/reflection/message.h" +#include "upb/upb/wire/encode.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" typedef struct { const char *ptr, *end; diff --git a/upb/upb/json/decode.h b/upb/upb/json/decode.h index 8f5879738a..52882a9bc1 100644 --- a/upb/upb/json/decode.h +++ b/upb/upb/json/decode.h @@ -31,10 +31,10 @@ #ifndef UPB_JSON_DECODE_H_ #define UPB_JSON_DECODE_H_ -#include "upb/reflection/def.h" +#include "upb/upb/reflection/def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -50,6 +50,6 @@ UPB_API bool upb_JsonDecode(const char* buf, size_t size, upb_Message* msg, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_JSONDECODE_H_ */ diff --git a/upb/upb/json/decode_test.cc b/upb/upb/json/decode_test.cc index b1e6c96a0f..481fed2d58 100644 --- a/upb/upb/json/decode_test.cc +++ b/upb/upb/json/decode_test.cc @@ -28,14 +28,14 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/json/decode.h" +#include "upb/upb/json/decode.h" #include "google/protobuf/struct.upb.h" #include "gtest/gtest.h" -#include "upb/json/test.upb.h" -#include "upb/json/test.upbdefs.h" -#include "upb/mem/arena.hpp" -#include "upb/reflection/def.hpp" +#include "upb/upb/json/test.upb.h" +#include "upb/upb/json/test.upbdefs.h" +#include "upb/upb/mem/arena.hpp" +#include "upb/upb/reflection/def.hpp" static upb_test_Box* JsonDecode(const char* json, upb_Arena* a) { upb::Status status; diff --git a/upb/upb/json/encode.c b/upb/upb/json/encode.c index 28440b3039..c95e95db3c 100644 --- a/upb/upb/json/encode.c +++ b/upb/upb/json/encode.c @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/json/encode.h" +#include "upb/upb/json/encode.h" #include #include @@ -37,14 +37,14 @@ #include #include -#include "upb/collections/map.h" -#include "upb/lex/round_trip.h" -#include "upb/port/vsnprintf_compat.h" -#include "upb/reflection/message.h" -#include "upb/wire/decode.h" +#include "upb/upb/collections/map.h" +#include "upb/upb/lex/round_trip.h" +#include "upb/upb/port/vsnprintf_compat.h" +#include "upb/upb/reflection/message.h" +#include "upb/upb/wire/decode.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" typedef struct { char *buf, *ptr, *end; diff --git a/upb/upb/json/encode.h b/upb/upb/json/encode.h index 9b7d419f18..06d9fe5589 100644 --- a/upb/upb/json/encode.h +++ b/upb/upb/json/encode.h @@ -31,10 +31,10 @@ #ifndef UPB_JSON_ENCODE_H_ #define UPB_JSON_ENCODE_H_ -#include "upb/reflection/def.h" +#include "upb/upb/reflection/def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -68,6 +68,6 @@ UPB_API size_t upb_JsonEncode(const upb_Message* msg, const upb_MessageDef* m, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_JSONENCODE_H_ */ diff --git a/upb/upb/json/encode_test.cc b/upb/upb/json/encode_test.cc index ab21400d19..744556018c 100644 --- a/upb/upb/json/encode_test.cc +++ b/upb/upb/json/encode_test.cc @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/json/encode.h" +#include "upb/upb/json/encode.h" #include "google/protobuf/struct.upb.h" #include "gtest/gtest.h" -#include "upb/base/status.hpp" -#include "upb/json/test.upb.h" -#include "upb/json/test.upbdefs.h" -#include "upb/mem/arena.hpp" -#include "upb/reflection/def.hpp" +#include "upb/upb/base/status.hpp" +#include "upb/upb/json/test.upb.h" +#include "upb/upb/json/test.upbdefs.h" +#include "upb/upb/mem/arena.hpp" +#include "upb/upb/reflection/def.hpp" static std::string JsonEncode(const upb_test_Box* msg, int options) { upb::Arena a; diff --git a/upb/upb/lex/BUILD b/upb/upb/lex/BUILD index c1f2718943..c40c362708 100644 --- a/upb/upb/lex/BUILD +++ b/upb/upb/lex/BUILD @@ -5,7 +5,7 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") cc_library( name = "lex", @@ -23,7 +23,7 @@ cc_library( ], copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], - deps = ["//:port"], + deps = ["//upb:port"], ) cc_test( @@ -46,8 +46,8 @@ filegroup( ], ), visibility = [ - "//cmake:__pkg__", - "//python/dist:__pkg__", + "//upb/cmake:__pkg__", + "//upb/python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/lex/atoi.c b/upb/upb/lex/atoi.c index aecb467449..4a9da51cd0 100644 --- a/upb/upb/lex/atoi.c +++ b/upb/upb/lex/atoi.c @@ -28,10 +28,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/lex/atoi.h" +#include "upb/upb/lex/atoi.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" const char* upb_BufToUint64(const char* ptr, const char* end, uint64_t* val) { uint64_t u64 = 0; diff --git a/upb/upb/lex/atoi.h b/upb/upb/lex/atoi.h index 808bca8a4a..730c60c020 100644 --- a/upb/upb/lex/atoi.h +++ b/upb/upb/lex/atoi.h @@ -34,7 +34,7 @@ #include // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -53,6 +53,6 @@ const char* upb_BufToInt64(const char* ptr, const char* end, int64_t* val, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_LEX_ATOI_H_ */ diff --git a/upb/upb/lex/atoi_test.cc b/upb/upb/lex/atoi_test.cc index ed35219ae3..810b5cbd0b 100644 --- a/upb/upb/lex/atoi_test.cc +++ b/upb/upb/lex/atoi_test.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/lex/atoi.h" +#include "upb/upb/lex/atoi.h" #include "gtest/gtest.h" #include "absl/strings/str_cat.h" diff --git a/upb/upb/lex/round_trip.c b/upb/upb/lex/round_trip.c index 6402dc6f14..d15046af3d 100644 --- a/upb/upb/lex/round_trip.c +++ b/upb/upb/lex/round_trip.c @@ -28,13 +28,13 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/lex/round_trip.h" +#include "upb/upb/lex/round_trip.h" #include #include // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" /* Miscellaneous utilities ****************************************************/ diff --git a/upb/upb/lex/round_trip.h b/upb/upb/lex/round_trip.h index d00a662416..66e9e45c52 100644 --- a/upb/upb/lex/round_trip.h +++ b/upb/upb/lex/round_trip.h @@ -32,7 +32,7 @@ #define UPB_LEX_ROUND_TRIP_H_ // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" // Encodes a float or double that is round-trippable, but as short as possible. // These routines are not fully optimal (not guaranteed to be shortest), but are @@ -53,6 +53,6 @@ void _upb_EncodeRoundTripFloat(float val, char* buf, size_t size); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_LEX_ROUND_TRIP_H_ */ diff --git a/upb/upb/lex/strtod.c b/upb/upb/lex/strtod.c index 50a7c89025..14b31a8013 100644 --- a/upb/upb/lex/strtod.c +++ b/upb/upb/lex/strtod.c @@ -28,13 +28,13 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/lex/strtod.h" +#include "upb/upb/lex/strtod.h" #include #include // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" // Determine the locale-specific radix character by calling sprintf() to print // the number 1.5, then stripping off the digits. As far as I can tell, this diff --git a/upb/upb/lex/strtod.h b/upb/upb/lex/strtod.h index c7b8777047..a99a7a15ff 100644 --- a/upb/upb/lex/strtod.h +++ b/upb/upb/lex/strtod.h @@ -32,7 +32,7 @@ #define UPB_LEX_STRTOD_H_ // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -44,6 +44,6 @@ double _upb_NoLocaleStrtod(const char *str, char **endptr); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_LEX_STRTOD_H_ */ diff --git a/upb/upb/lex/unicode.c b/upb/upb/lex/unicode.c index 885a061b9d..bc2f8ec05d 100644 --- a/upb/upb/lex/unicode.c +++ b/upb/upb/lex/unicode.c @@ -28,10 +28,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/lex/unicode.h" +#include "upb/upb/lex/unicode.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" int upb_Unicode_ToUTF8(uint32_t cp, char* out) { if (cp <= 0x7f) { diff --git a/upb/upb/lex/unicode.h b/upb/upb/lex/unicode.h index ed5615e1b6..68fee84c9e 100644 --- a/upb/upb/lex/unicode.h +++ b/upb/upb/lex/unicode.h @@ -34,7 +34,7 @@ #include // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -77,6 +77,6 @@ int upb_Unicode_ToUTF8(uint32_t cp, char* out); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_LEX_UNICODE_H_ */ diff --git a/upb/upb/mem/BUILD b/upb/upb/mem/BUILD index 770b369e7a..0584e6c8e5 100644 --- a/upb/upb/mem/BUILD +++ b/upb/upb/mem/BUILD @@ -5,7 +5,7 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") cc_library( name = "mem", @@ -18,7 +18,7 @@ cc_library( visibility = ["//visibility:public"], deps = [ ":internal", - "//:port", + "//upb:port", ], ) @@ -34,9 +34,9 @@ cc_library( "internal/arena.h", ], copts = UPB_DEFAULT_COPTS, - visibility = ["//:__pkg__"], + visibility = ["//upb:__pkg__"], deps = [ - "//:port", + "//upb:port", ], ) @@ -44,8 +44,8 @@ cc_test( name = "arena_test", srcs = ["arena_test.cc"], deps = [ - "//:mem", - "//:port", + "//upb:mem", + "//upb:port", "@com_google_absl//absl/random", "@com_google_absl//absl/random:distributions", "@com_google_absl//absl/synchronization", @@ -64,8 +64,8 @@ filegroup( ], ), visibility = [ - "//cmake:__pkg__", - "//python/dist:__pkg__", + "//upb/cmake:__pkg__", + "//upb/python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/mem/alloc.c b/upb/upb/mem/alloc.c index 1d10f10f15..c4185d7a7d 100644 --- a/upb/upb/mem/alloc.c +++ b/upb/upb/mem/alloc.c @@ -28,12 +28,12 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/mem/alloc.h" +#include "upb/upb/mem/alloc.h" #include // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" static void* upb_global_allocfunc(upb_alloc* alloc, void* ptr, size_t oldsize, size_t size) { diff --git a/upb/upb/mem/alloc.h b/upb/upb/mem/alloc.h index c278cbb898..5a9d1b0bf3 100644 --- a/upb/upb/mem/alloc.h +++ b/upb/upb/mem/alloc.h @@ -32,7 +32,7 @@ #define UPB_MEM_ALLOC_H_ // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -96,6 +96,6 @@ UPB_INLINE void upb_gfree(void* ptr) { upb_free(&upb_alloc_global, ptr); } } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MEM_ALLOC_H_ */ diff --git a/upb/upb/mem/arena.c b/upb/upb/mem/arena.c index 569986cf56..cee7ed7d85 100644 --- a/upb/upb/mem/arena.c +++ b/upb/upb/mem/arena.c @@ -28,12 +28,12 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/mem/internal/arena.h" +#include "upb/upb/mem/internal/arena.h" -#include "upb/port/atomic.h" +#include "upb/upb/port/atomic.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" struct _upb_MemBlock { // Atomic only for the benefit of SpaceAllocated(). diff --git a/upb/upb/mem/arena.h b/upb/upb/mem/arena.h index 72e8ddb7a4..2849ff1027 100644 --- a/upb/upb/mem/arena.h +++ b/upb/upb/mem/arena.h @@ -47,10 +47,10 @@ #include #include -#include "upb/mem/alloc.h" +#include "upb/upb/mem/alloc.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" typedef struct upb_Arena upb_Arena; @@ -147,6 +147,6 @@ UPB_API_INLINE upb_Arena* upb_Arena_New(void) { } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MEM_ARENA_H_ */ diff --git a/upb/upb/mem/arena.hpp b/upb/upb/mem/arena.hpp index cd86d0d71f..0fd1add396 100644 --- a/upb/upb/mem/arena.hpp +++ b/upb/upb/mem/arena.hpp @@ -33,7 +33,7 @@ #include -#include "upb/mem/arena.h" +#include "upb/upb/mem/arena.h" namespace upb { diff --git a/upb/upb/mem/arena_test.cc b/upb/upb/mem/arena_test.cc index 8bcf671bc6..9d1ba0770f 100644 --- a/upb/upb/mem/arena_test.cc +++ b/upb/upb/mem/arena_test.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/mem/arena.h" +#include "upb/upb/mem/arena.h" #include #include @@ -42,7 +42,7 @@ #include "absl/synchronization/notification.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" namespace { diff --git a/upb/upb/mem/internal/arena.h b/upb/upb/mem/internal/arena.h index 3fb434acaa..2bc06893f4 100644 --- a/upb/upb/mem/internal/arena.h +++ b/upb/upb/mem/internal/arena.h @@ -31,10 +31,10 @@ #ifndef UPB_MEM_INTERNAL_ARENA_H_ #define UPB_MEM_INTERNAL_ARENA_H_ -#include "upb/mem/arena.h" +#include "upb/upb/mem/arena.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" typedef struct _upb_MemBlock _upb_MemBlock; @@ -112,6 +112,6 @@ UPB_INLINE bool upb_Arena_HasInitialBlock(upb_Arena* arena) { return arena->block_alloc & 0x1; } -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MEM_INTERNAL_ARENA_H_ */ diff --git a/upb/upb/message/BUILD b/upb/upb/message/BUILD index 8e85d10e40..c123916775 100644 --- a/upb/upb/message/BUILD +++ b/upb/upb/message/BUILD @@ -5,9 +5,9 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") load( - "//bazel:upb_proto_library.bzl", + "//upb/bazel:upb_proto_library.bzl", "upb_proto_library", "upb_proto_reflection_library", ) @@ -26,15 +26,15 @@ cc_library( deps = [ ":internal", ":message", - "//:base", - "//:collections", - "//:collections_internal", - "//:eps_copy_input_stream", - "//:mini_table", - "//:mini_table_internal", - "//:port", - "//:wire", - "//:wire_reader", + "//upb:base", + "//upb:collections", + "//upb:collections_internal", + "//upb:eps_copy_input_stream", + "//upb:mini_table", + "//upb:mini_table_internal", + "//upb:port", + "//upb:wire", + "//upb:wire_reader", ], ) @@ -47,9 +47,9 @@ cc_library( visibility = ["//visibility:public"], deps = [ ":internal", - "//:collections_internal", - "//:mini_table_internal", - "//:port", + "//upb:collections_internal", + "//upb:mini_table_internal", + "//upb:port", ], ) @@ -68,12 +68,12 @@ cc_library( ":internal", ":message", ":types", - "//:base", - "//:collections_internal", - "//:mem", - "//:mini_table", - "//:mini_table_internal", - "//:port", + "//upb:base", + "//upb:collections_internal", + "//upb:mem", + "//upb:mini_table", + "//upb:mini_table_internal", + "//upb:port", ], ) @@ -92,12 +92,12 @@ cc_library( deps = [ ":internal_types", ":types", - "//:base", - "//:base_internal", - "//:hash", - "//:mem", - "//:mini_table", - "//:port", + "//upb:base", + "//upb:base_internal", + "//upb:hash", + "//upb:mem", + "//upb:mini_table", + "//upb:port", ], ) @@ -122,10 +122,10 @@ cc_library( deps = [ ":internal", ":types", - "//:base", - "//:mem", - "//:mini_table", - "//:port", + "//upb:base", + "//upb:mem", + "//upb:mini_table", + "//upb:port", ], ) @@ -144,16 +144,16 @@ cc_library( ":internal", ":message", ":types", - "//:base", - "//:collections", - "//:collections_internal", - "//:eps_copy_input_stream", - "//:hash", - "//:mem", - "//:mini_table", - "//:port", - "//:wire", - "//:wire_reader", + "//upb:base", + "//upb:collections", + "//upb:collections_internal", + "//upb:eps_copy_input_stream", + "//upb:hash", + "//upb:mem", + "//upb:mini_table", + "//upb:port", + "//upb:wire", + "//upb:wire_reader", ], ) @@ -166,7 +166,7 @@ cc_library( visibility = ["//visibility:public"], deps = [ ":accessors", - "//:port", + "//upb:port", ], ) @@ -177,7 +177,7 @@ cc_library( visibility = ["//visibility:public"], deps = [ ":types", - "//:port", + "//upb:port", ], ) @@ -197,7 +197,7 @@ proto_library( name = "message_test_proto", testonly = 1, srcs = ["test.proto"], - deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto3_proto"], + deps = ["//src/google/protobuf:test_messages_proto3_proto"], ) upb_proto_library( @@ -217,19 +217,19 @@ cc_test( srcs = ["accessors_test.cc"], deps = [ ":accessors", - "//:base", - "//:collections", - "//:mini_descriptor", - "//:mini_descriptor_internal", - "//:mini_table", - "//:port", - "//:wire", - "//upb/test:test_messages_proto2_upb_proto", - "//upb/test:test_messages_proto3_upb_proto", - "//upb/test:test_upb_proto", + "//:protobuf", + "//upb:base", + "//upb:collections", + "//upb:mini_descriptor", + "//upb:mini_descriptor_internal", + "//upb:mini_table", + "//upb:port", + "//upb:wire", + "//upb/upb/test:test_messages_proto2_upb_proto", + "//upb/upb/test:test_messages_proto3_upb_proto", + "//upb/upb/test:test_upb_proto", "@com_google_absl//absl/container:flat_hash_set", "@com_google_googletest//:gtest_main", - "@com_google_protobuf//:protobuf", ], ) @@ -241,17 +241,17 @@ cc_test( ":copy", ":internal", ":message", - "//:base", - "//:collections", - "//:mem", - "//:mini_table", - "//:wire", - "//upb/test:test_messages_proto2_upb_proto", - "//upb/test:test_messages_proto3_upb_proto", - "//upb/test:test_upb_proto", + "//:protobuf", + "//upb:base", + "//upb:collections", + "//upb:mem", + "//upb:mini_table", + "//upb:wire", + "//upb/upb/test:test_messages_proto2_upb_proto", + "//upb/upb/test:test_messages_proto3_upb_proto", + "//upb/upb/test:test_upb_proto", "@com_google_absl//absl/container:flat_hash_set", "@com_google_googletest//:gtest_main", - "@com_google_protobuf//:protobuf", ], ) @@ -262,19 +262,19 @@ cc_test( ":accessors", ":copy", ":promote", - "//:base", - "//:collections", - "//:mem", - "//:mini_descriptor_internal", - "//:mini_table", - "//:port", - "//:wire", - "//upb/test:test_messages_proto2_upb_proto", - "//upb/test:test_messages_proto3_upb_proto", - "//upb/test:test_upb_proto", + "//:protobuf", + "//upb:base", + "//upb:collections", + "//upb:mem", + "//upb:mini_descriptor_internal", + "//upb:mini_table", + "//upb:port", + "//upb:wire", + "//upb/upb/test:test_messages_proto2_upb_proto", + "//upb/upb/test:test_messages_proto3_upb_proto", + "//upb/upb/test:test_upb_proto", "@com_google_absl//absl/container:flat_hash_set", "@com_google_googletest//:gtest_main", - "@com_google_protobuf//:protobuf", ], ) @@ -286,13 +286,13 @@ cc_test( deps = [ ":message_test_upb_proto", ":message_test_upb_proto_reflection", - "//:base", - "//:json", - "//:mem", - "//:reflection", - "//:wire", - "//upb/test:fuzz_util", - "//upb/test:test_messages_proto3_upb_proto", + "//upb:base", + "//upb:json", + "//upb:mem", + "//upb:reflection", + "//upb:wire", + "//upb/upb/test:fuzz_util", + "//upb/upb/test:test_messages_proto3_upb_proto", "@com_google_googletest//:gtest_main", ], ) @@ -307,8 +307,8 @@ filegroup( ], ), visibility = [ - "//cmake:__pkg__", - "//python/dist:__pkg__", + "//upb/cmake:__pkg__", + "//upb/python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/message/accessors.c b/upb/upb/message/accessors.c index 687259f874..69b58e9d4c 100644 --- a/upb/upb/message/accessors.c +++ b/upb/upb/message/accessors.c @@ -28,20 +28,20 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/message/accessors.h" +#include "upb/upb/message/accessors.h" -#include "upb/collections/array.h" -#include "upb/collections/internal/array.h" -#include "upb/collections/map.h" -#include "upb/message/message.h" -#include "upb/mini_table/field.h" -#include "upb/wire/decode.h" -#include "upb/wire/encode.h" -#include "upb/wire/eps_copy_input_stream.h" -#include "upb/wire/reader.h" +#include "upb/upb/collections/array.h" +#include "upb/upb/collections/internal/array.h" +#include "upb/upb/collections/map.h" +#include "upb/upb/message/message.h" +#include "upb/upb/mini_table/field.h" +#include "upb/upb/wire/decode.h" +#include "upb/upb/wire/encode.h" +#include "upb/upb/wire/eps_copy_input_stream.h" +#include "upb/upb/wire/reader.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" upb_MapInsertStatus upb_Message_InsertMapEntry(upb_Map* map, const upb_MiniTable* mini_table, diff --git a/upb/upb/message/accessors.h b/upb/upb/message/accessors.h index 0305977fb5..2e00b0275e 100644 --- a/upb/upb/message/accessors.h +++ b/upb/upb/message/accessors.h @@ -31,18 +31,18 @@ #ifndef UPB_MESSAGE_ACCESSORS_H_ #define UPB_MESSAGE_ACCESSORS_H_ -#include "upb/base/descriptor_constants.h" -#include "upb/collections/array.h" -#include "upb/collections/internal/array.h" -#include "upb/collections/internal/map.h" -#include "upb/collections/map.h" -#include "upb/message/internal/accessors.h" -#include "upb/message/internal/message.h" -#include "upb/mini_table/enum.h" -#include "upb/mini_table/field.h" +#include "upb/upb/base/descriptor_constants.h" +#include "upb/upb/collections/array.h" +#include "upb/upb/collections/internal/array.h" +#include "upb/upb/collections/internal/map.h" +#include "upb/upb/collections/map.h" +#include "upb/upb/message/internal/accessors.h" +#include "upb/upb/message/internal/message.h" +#include "upb/upb/mini_table/enum.h" +#include "upb/upb/mini_table/field.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -398,6 +398,6 @@ bool upb_Message_IsExactlyEqual(const upb_Message* m1, const upb_Message* m2, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPB_MESSAGE_ACCESSORS_H_ diff --git a/upb/upb/message/accessors_split64.h b/upb/upb/message/accessors_split64.h index 4308c8cd53..548dbeeb32 100644 --- a/upb/upb/message/accessors_split64.h +++ b/upb/upb/message/accessors_split64.h @@ -31,10 +31,10 @@ #ifndef UPB_MESSAGE_ACCESSORS_SPLIT64_H_ #define UPB_MESSAGE_ACCESSORS_SPLIT64_H_ -#include "upb/message/accessors.h" +#include "upb/upb/message/accessors.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -84,6 +84,6 @@ UPB_API_INLINE bool upb_Message_SetUInt64Split(upb_Message* msg, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPB_MESSAGE_ACCESSORS_SPLIT64_H_ diff --git a/upb/upb/message/accessors_test.cc b/upb/upb/message/accessors_test.cc index 8ac54dd7e5..5791c9cb39 100644 --- a/upb/upb/message/accessors_test.cc +++ b/upb/upb/message/accessors_test.cc @@ -34,23 +34,23 @@ * accessed through reflective APIs exposed through mini table accessors. */ -#include "upb/message/accessors.h" +#include "upb/upb/message/accessors.h" #include #include "gtest/gtest.h" #include "google/protobuf/test_messages_proto2.upb.h" #include "google/protobuf/test_messages_proto3.upb.h" -#include "upb/base/string_view.h" -#include "upb/collections/array.h" -#include "upb/mini_descriptor/decode.h" -#include "upb/mini_descriptor/internal/encode.hpp" -#include "upb/mini_descriptor/internal/modifiers.h" -#include "upb/test/test.upb.h" -#include "upb/wire/decode.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/collections/array.h" +#include "upb/upb/mini_descriptor/decode.h" +#include "upb/upb/mini_descriptor/internal/encode.hpp" +#include "upb/upb/mini_descriptor/internal/modifiers.h" +#include "upb/upb/test/test.upb.h" +#include "upb/upb/wire/decode.h" // Must be last -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" namespace { diff --git a/upb/upb/message/copy.c b/upb/upb/message/copy.c index de528c5f7b..da546de068 100644 --- a/upb/upb/message/copy.c +++ b/upb/upb/message/copy.c @@ -28,22 +28,22 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/message/copy.h" +#include "upb/upb/message/copy.h" #include #include -#include "upb/base/descriptor_constants.h" -#include "upb/base/string_view.h" -#include "upb/mem/arena.h" -#include "upb/message/accessors.h" -#include "upb/message/internal/message.h" -#include "upb/message/message.h" -#include "upb/mini_table/field.h" -#include "upb/mini_table/internal/field.h" +#include "upb/upb/base/descriptor_constants.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/mem/arena.h" +#include "upb/upb/message/accessors.h" +#include "upb/upb/message/internal/message.h" +#include "upb/upb/message/message.h" +#include "upb/upb/mini_table/field.h" +#include "upb/upb/mini_table/internal/field.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" static bool upb_MessageField_IsMap(const upb_MiniTableField* field) { return upb_FieldMode_Get(field) == kUpb_FieldMode_Map; diff --git a/upb/upb/message/copy.h b/upb/upb/message/copy.h index dea292d60a..76ccf4052e 100644 --- a/upb/upb/message/copy.h +++ b/upb/upb/message/copy.h @@ -31,11 +31,11 @@ #ifndef UPB_MESSAGE_COPY_H_ #define UPB_MESSAGE_COPY_H_ -#include "upb/collections/message_value.h" -#include "upb/message/internal/message.h" +#include "upb/upb/collections/message_value.h" +#include "upb/upb/message/internal/message.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -64,6 +64,6 @@ bool upb_Message_DeepCopy(upb_Message* dst, const upb_Message* src, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPB_MESSAGE_COPY_H_ diff --git a/upb/upb/message/copy_test.cc b/upb/upb/message/copy_test.cc index ff3a6f0c7d..a5ae148efb 100644 --- a/upb/upb/message/copy_test.cc +++ b/upb/upb/message/copy_test.cc @@ -34,7 +34,7 @@ * accessed through reflective APIs exposed through mini table accessors. */ -#include "upb/message/copy.h" +#include "upb/upb/message/copy.h" #include #include @@ -44,14 +44,14 @@ #include "gtest/gtest.h" #include "google/protobuf/test_messages_proto2.upb.h" -#include "upb/base/string_view.h" -#include "upb/collections/map.h" -#include "upb/mem/arena.h" -#include "upb/message/accessors.h" -#include "upb/message/internal/message.h" -#include "upb/message/message.h" -#include "upb/mini_table/message.h" -#include "upb/wire/encode.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/collections/map.h" +#include "upb/upb/mem/arena.h" +#include "upb/upb/message/accessors.h" +#include "upb/upb/message/internal/message.h" +#include "upb/upb/message/message.h" +#include "upb/upb/mini_table/message.h" +#include "upb/upb/wire/encode.h" namespace { diff --git a/upb/upb/message/internal/accessors.h b/upb/upb/message/internal/accessors.h index 713e40e179..42a1328462 100644 --- a/upb/upb/message/internal/accessors.h +++ b/upb/upb/message/internal/accessors.h @@ -31,13 +31,13 @@ #ifndef UPB_MESSAGE_INTERNAL_ACCESSORS_H_ #define UPB_MESSAGE_INTERNAL_ACCESSORS_H_ -#include "upb/collections/internal/map.h" -#include "upb/message/internal/extension.h" -#include "upb/message/internal/message.h" -#include "upb/mini_table/internal/field.h" +#include "upb/upb/collections/internal/map.h" +#include "upb/upb/message/internal/extension.h" +#include "upb/upb/message/internal/message.h" +#include "upb/upb/mini_table/internal/field.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #if defined(__GNUC__) && !defined(__clang__) // GCC raises incorrect warnings in these functions. It thinks that we are @@ -385,6 +385,6 @@ UPB_INLINE upb_Map* _upb_Message_GetOrCreateMutableMap( #pragma GCC diagnostic pop #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPB_MESSAGE_INTERNAL_ACCESSORS_H_ diff --git a/upb/upb/message/internal/extension.h b/upb/upb/message/internal/extension.h index 01329c1a7f..a028290111 100644 --- a/upb/upb/message/internal/extension.h +++ b/upb/upb/message/internal/extension.h @@ -31,14 +31,14 @@ #ifndef UPB_MESSAGE_INTERNAL_EXTENSION_H_ #define UPB_MESSAGE_INTERNAL_EXTENSION_H_ -#include "upb/base/descriptor_constants.h" -#include "upb/base/string_view.h" -#include "upb/mem/arena.h" -#include "upb/message/message.h" -#include "upb/mini_table/extension.h" +#include "upb/upb/base/descriptor_constants.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/mem/arena.h" +#include "upb/upb/message/message.h" +#include "upb/upb/mini_table/extension.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" // The internal representation of an extension is self-describing: it contains // enough information that we can serialize it to binary format without needing @@ -81,6 +81,6 @@ const upb_Message_Extension* _upb_Message_Getext( } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MESSAGE_INTERNAL_EXTENSION_H_ */ diff --git a/upb/upb/message/internal/message.h b/upb/upb/message/internal/message.h index dd891dedc6..e6e7633407 100644 --- a/upb/upb/message/internal/message.h +++ b/upb/upb/message/internal/message.h @@ -41,16 +41,16 @@ #include #include -#include "upb/hash/common.h" -#include "upb/message/internal/extension.h" -#include "upb/message/internal/types.h" -#include "upb/message/message.h" -#include "upb/mini_table/extension.h" -#include "upb/mini_table/extension_registry.h" -#include "upb/mini_table/message.h" +#include "upb/upb/hash/common.h" +#include "upb/upb/message/internal/extension.h" +#include "upb/upb/message/internal/types.h" +#include "upb/upb/message/message.h" +#include "upb/upb/mini_table/extension.h" +#include "upb/upb/mini_table/extension_registry.h" +#include "upb/upb/mini_table/message.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -125,6 +125,6 @@ bool _upb_Message_AddUnknown(upb_Message* msg, const char* data, size_t len, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MESSAGE_INTERNAL_H_ */ diff --git a/upb/upb/message/message.c b/upb/upb/message/message.c index 30a16dcfd2..ade0172373 100644 --- a/upb/upb/message/message.c +++ b/upb/upb/message/message.c @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/message/message.h" +#include "upb/upb/message/message.h" #include -#include "upb/base/internal/log2.h" -#include "upb/message/internal/message.h" +#include "upb/upb/base/internal/log2.h" +#include "upb/upb/message/internal/message.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" const float kUpb_FltInfinity = INFINITY; const double kUpb_Infinity = INFINITY; diff --git a/upb/upb/message/message.h b/upb/upb/message/message.h index 5d656450b1..e69980918f 100644 --- a/upb/upb/message/message.h +++ b/upb/upb/message/message.h @@ -37,12 +37,12 @@ #include -#include "upb/mem/arena.h" -#include "upb/message/types.h" // IWYU pragma: export -#include "upb/mini_table/message.h" +#include "upb/upb/mem/arena.h" +#include "upb/upb/message/types.h" // IWYU pragma: export +#include "upb/upb/mini_table/message.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -70,6 +70,6 @@ size_t upb_Message_ExtensionCount(const upb_Message* msg); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MESSAGE_MESSAGE_H_ */ diff --git a/upb/upb/message/promote.c b/upb/upb/message/promote.c index 99ec10147d..b63fd8d00f 100644 --- a/upb/upb/message/promote.c +++ b/upb/upb/message/promote.c @@ -28,21 +28,21 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/message/promote.h" +#include "upb/upb/message/promote.h" -#include "upb/collections/array.h" -#include "upb/collections/internal/array.h" -#include "upb/collections/map.h" -#include "upb/message/accessors.h" -#include "upb/message/message.h" -#include "upb/mini_table/field.h" -#include "upb/wire/decode.h" -#include "upb/wire/encode.h" -#include "upb/wire/eps_copy_input_stream.h" -#include "upb/wire/reader.h" +#include "upb/upb/collections/array.h" +#include "upb/upb/collections/internal/array.h" +#include "upb/upb/collections/map.h" +#include "upb/upb/message/accessors.h" +#include "upb/upb/message/message.h" +#include "upb/upb/mini_table/field.h" +#include "upb/upb/wire/decode.h" +#include "upb/upb/wire/encode.h" +#include "upb/upb/wire/eps_copy_input_stream.h" +#include "upb/upb/wire/reader.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" // Parses unknown data by merging into existing base_message or creating a // new message usingg mini_table. diff --git a/upb/upb/message/promote.h b/upb/upb/message/promote.h index 48737eeaf7..6eb65cf9dd 100644 --- a/upb/upb/message/promote.h +++ b/upb/upb/message/promote.h @@ -31,12 +31,12 @@ #ifndef UPB_MESSAGE_PROMOTE_H_ #define UPB_MESSAGE_PROMOTE_H_ -#include "upb/collections/array.h" -#include "upb/message/internal/extension.h" -#include "upb/wire/decode.h" +#include "upb/upb/collections/array.h" +#include "upb/upb/message/internal/extension.h" +#include "upb/upb/wire/decode.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -177,6 +177,6 @@ upb_UnknownToMessage_Status upb_MiniTable_PromoteUnknownToMap( } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPB_MESSAGE_PROMOTE_H_ diff --git a/upb/upb/message/promote_test.cc b/upb/upb/message/promote_test.cc index 225e1ce749..0d53a8ffb5 100644 --- a/upb/upb/message/promote_test.cc +++ b/upb/upb/message/promote_test.cc @@ -34,25 +34,25 @@ * accessed through reflective APIs exposed through mini table accessors. */ -#include "upb/message/promote.h" +#include "upb/upb/message/promote.h" #include #include "gtest/gtest.h" #include "google/protobuf/test_messages_proto2.upb.h" #include "google/protobuf/test_messages_proto3.upb.h" -#include "upb/base/string_view.h" -#include "upb/collections/array.h" -#include "upb/mem/arena.hpp" -#include "upb/message/accessors.h" -#include "upb/message/copy.h" -#include "upb/mini_descriptor/internal/encode.hpp" -#include "upb/mini_descriptor/internal/modifiers.h" -#include "upb/test/test.upb.h" -#include "upb/wire/decode.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/collections/array.h" +#include "upb/upb/mem/arena.hpp" +#include "upb/upb/message/accessors.h" +#include "upb/upb/message/copy.h" +#include "upb/upb/mini_descriptor/internal/encode.hpp" +#include "upb/upb/mini_descriptor/internal/modifiers.h" +#include "upb/upb/test/test.upb.h" +#include "upb/upb/wire/decode.h" // Must be last -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" namespace { diff --git a/upb/upb/message/tagged_ptr.h b/upb/upb/message/tagged_ptr.h index ede7fee2bd..5e05fc321a 100644 --- a/upb/upb/message/tagged_ptr.h +++ b/upb/upb/message/tagged_ptr.h @@ -33,10 +33,10 @@ #include -#include "upb/message/types.h" // IWYU pragma: export +#include "upb/upb/message/types.h" // IWYU pragma: export // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -87,6 +87,6 @@ UPB_INLINE upb_Message* _upb_TaggedMessagePtr_GetEmptyMessage( } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MINI_TABLE_TYPES_H_ */ diff --git a/upb/upb/message/test.cc b/upb/upb/message/test.cc index c016b24e0f..b247105ba7 100644 --- a/upb/upb/message/test.cc +++ b/upb/upb/message/test.cc @@ -34,15 +34,15 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" #include "google/protobuf/test_messages_proto3.upb.h" -#include "upb/base/status.hpp" -#include "upb/json/decode.h" -#include "upb/json/encode.h" -#include "upb/mem/arena.hpp" -#include "upb/message/test.upb.h" -#include "upb/message/test.upbdefs.h" -#include "upb/reflection/def.hpp" -#include "upb/test/fuzz_util.h" -#include "upb/wire/decode.h" +#include "upb/upb/base/status.hpp" +#include "upb/upb/json/decode.h" +#include "upb/upb/json/encode.h" +#include "upb/upb/mem/arena.hpp" +#include "upb/upb/message/test.upb.h" +#include "upb/upb/message/test.upbdefs.h" +#include "upb/upb/reflection/def.hpp" +#include "upb/upb/test/fuzz_util.h" +#include "upb/upb/wire/decode.h" // begin:google_only // #include "testing/fuzzing/fuzztest.h" diff --git a/upb/upb/mini_descriptor/BUILD b/upb/upb/mini_descriptor/BUILD index db70056594..5bdade774c 100644 --- a/upb/upb/mini_descriptor/BUILD +++ b/upb/upb/mini_descriptor/BUILD @@ -1,5 +1,5 @@ load( - "//bazel:build_defs.bzl", + "//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS", "UPB_DEFAULT_CPPOPTS", ) @@ -20,11 +20,11 @@ cc_library( visibility = ["//visibility:public"], deps = [ ":internal", - "//:base", - "//:mem", - "//:mini_table", - "//:mini_table_internal", - "//:port", + "//upb:base", + "//upb:mem", + "//upb:mini_table", + "//upb:mini_table_internal", + "//upb:port", ], ) @@ -45,9 +45,9 @@ cc_library( copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], deps = [ - "//:base", - "//:base_internal", - "//:port", + "//upb:base", + "//upb:base_internal", + "//upb:port", ], ) @@ -58,14 +58,14 @@ cc_test( deps = [ ":internal", ":mini_descriptor", - "//:base", - "//:mem", - "//:message_accessors_internal", - "//:mini_table", - "//:wire", + "//:protobuf", + "//upb:base", + "//upb:mem", + "//upb:message_accessors_internal", + "//upb:mini_table", + "//upb:wire", "@com_google_absl//absl/container:flat_hash_set", "@com_google_googletest//:gtest_main", - "@com_google_protobuf//:protobuf", ], ) @@ -79,8 +79,8 @@ filegroup( ], ), visibility = [ - "//cmake:__pkg__", - "//python/dist:__pkg__", + "//upb/cmake:__pkg__", + "//upb/python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/mini_descriptor/build_enum.c b/upb/upb/mini_descriptor/build_enum.c index 152a7ce522..4bff47bc03 100644 --- a/upb/upb/mini_descriptor/build_enum.c +++ b/upb/upb/mini_descriptor/build_enum.c @@ -28,14 +28,14 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/mini_descriptor/build_enum.h" +#include "upb/upb/mini_descriptor/build_enum.h" -#include "upb/mini_descriptor/internal/decoder.h" -#include "upb/mini_descriptor/internal/wire_constants.h" -#include "upb/mini_table/internal/enum.h" +#include "upb/upb/mini_descriptor/internal/decoder.h" +#include "upb/upb/mini_descriptor/internal/wire_constants.h" +#include "upb/upb/mini_table/internal/enum.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" typedef struct { upb_MdDecoder base; diff --git a/upb/upb/mini_descriptor/build_enum.h b/upb/upb/mini_descriptor/build_enum.h index 8b6e567a6d..d49e75e1dc 100644 --- a/upb/upb/mini_descriptor/build_enum.h +++ b/upb/upb/mini_descriptor/build_enum.h @@ -31,12 +31,12 @@ #ifndef UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_ #define UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_ -#include "upb/base/status.h" -#include "upb/mem/arena.h" -#include "upb/mini_table/enum.h" +#include "upb/upb/base/status.h" +#include "upb/upb/mem/arena.h" +#include "upb/upb/mini_table/enum.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -61,6 +61,6 @@ UPB_API_INLINE upb_MiniTableEnum* upb_MiniTableEnum_Build(const char* data, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPB_MINI_DESCRIPTOR_BUILD_ENUM_H_ diff --git a/upb/upb/mini_descriptor/decode.c b/upb/upb/mini_descriptor/decode.c index 52019febf2..d2bf5495d5 100644 --- a/upb/upb/mini_descriptor/decode.c +++ b/upb/upb/mini_descriptor/decode.c @@ -28,20 +28,20 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/mini_descriptor/decode.h" +#include "upb/upb/mini_descriptor/decode.h" #include #include -#include "upb/base/string_view.h" -#include "upb/mem/arena.h" -#include "upb/mini_descriptor/internal/base92.h" -#include "upb/mini_descriptor/internal/decoder.h" -#include "upb/mini_descriptor/internal/modifiers.h" -#include "upb/mini_descriptor/internal/wire_constants.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/mem/arena.h" +#include "upb/upb/mini_descriptor/internal/base92.h" +#include "upb/upb/mini_descriptor/internal/decoder.h" +#include "upb/upb/mini_descriptor/internal/modifiers.h" +#include "upb/upb/mini_descriptor/internal/wire_constants.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" // Note: we sort by this number when calculating layout order. typedef enum { diff --git a/upb/upb/mini_descriptor/decode.h b/upb/upb/mini_descriptor/decode.h index 81e3a7178e..4ae8fa8e6b 100644 --- a/upb/upb/mini_descriptor/decode.h +++ b/upb/upb/mini_descriptor/decode.h @@ -31,22 +31,22 @@ #ifndef UPB_MINI_TABLE_DECODE_H_ #define UPB_MINI_TABLE_DECODE_H_ -#include "upb/base/status.h" -#include "upb/mem/arena.h" -#include "upb/mini_table/extension.h" -#include "upb/mini_table/field.h" -#include "upb/mini_table/message.h" -#include "upb/mini_table/sub.h" +#include "upb/upb/base/status.h" +#include "upb/upb/mem/arena.h" +#include "upb/upb/mini_table/extension.h" +#include "upb/upb/mini_table/field.h" +#include "upb/upb/mini_table/message.h" +#include "upb/upb/mini_table/sub.h" // Export the newer headers, for legacy users. New users should include the // more specific headers directly. // IWYU pragma: begin_exports -#include "upb/mini_descriptor/build_enum.h" -#include "upb/mini_descriptor/link.h" +#include "upb/upb/mini_descriptor/build_enum.h" +#include "upb/upb/mini_descriptor/link.h" // IWYU pragma: end_exports // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" typedef enum { kUpb_MiniTablePlatform_32Bit, @@ -138,6 +138,6 @@ upb_MiniTable* upb_MiniTable_BuildWithBuf(const char* data, size_t len, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MINI_TABLE_DECODE_H_ */ diff --git a/upb/upb/mini_descriptor/internal/base92.c b/upb/upb/mini_descriptor/internal/base92.c index 6890e506e4..b99b7b48a6 100644 --- a/upb/upb/mini_descriptor/internal/base92.c +++ b/upb/upb/mini_descriptor/internal/base92.c @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/mini_descriptor/internal/base92.h" +#include "upb/upb/mini_descriptor/internal/base92.h" const char _kUpb_ToBase92[] = { ' ', '!', '#', '$', '%', '&', '(', ')', '*', '+', ',', '-', '.', '/', diff --git a/upb/upb/mini_descriptor/internal/base92.h b/upb/upb/mini_descriptor/internal/base92.h index ff515e97c8..7d439bafe5 100644 --- a/upb/upb/mini_descriptor/internal/base92.h +++ b/upb/upb/mini_descriptor/internal/base92.h @@ -33,10 +33,10 @@ #include -#include "upb/base/internal/log2.h" +#include "upb/upb/base/internal/log2.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -81,6 +81,6 @@ UPB_INLINE const char* _upb_Base92_DecodeVarint(const char* ptr, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPB_MINI_DESCRIPTOR_INTERNAL_BASE92_H_ diff --git a/upb/upb/mini_descriptor/internal/decoder.h b/upb/upb/mini_descriptor/internal/decoder.h index cde5d1dada..c783674a99 100644 --- a/upb/upb/mini_descriptor/internal/decoder.h +++ b/upb/upb/mini_descriptor/internal/decoder.h @@ -31,11 +31,11 @@ #ifndef UPB_MINI_DESCRIPTOR_INTERNAL_DECODER_H_ #define UPB_MINI_DESCRIPTOR_INTERNAL_DECODER_H_ -#include "upb/base/status.h" -#include "upb/mini_descriptor/internal/base92.h" +#include "upb/upb/base/status.h" +#include "upb/upb/mini_descriptor/internal/base92.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" // upb_MdDecoder: used internally for decoding MiniDescriptors for messages, // extensions, and enums. @@ -71,6 +71,6 @@ UPB_INLINE const char* upb_MdDecoder_DecodeBase92Varint( return ptr; } -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPB_MINI_DESCRIPTOR_INTERNAL_DECODER_H_ diff --git a/upb/upb/mini_descriptor/internal/encode.c b/upb/upb/mini_descriptor/internal/encode.c index 2570b16f24..57838c6a70 100644 --- a/upb/upb/mini_descriptor/internal/encode.c +++ b/upb/upb/mini_descriptor/internal/encode.c @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/mini_descriptor/internal/encode.h" +#include "upb/upb/mini_descriptor/internal/encode.h" -#include "upb/base/internal/log2.h" -#include "upb/mini_descriptor/internal/base92.h" -#include "upb/mini_descriptor/internal/modifiers.h" -#include "upb/mini_descriptor/internal/wire_constants.h" +#include "upb/upb/base/internal/log2.h" +#include "upb/upb/mini_descriptor/internal/base92.h" +#include "upb/upb/mini_descriptor/internal/modifiers.h" +#include "upb/upb/mini_descriptor/internal/wire_constants.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" typedef struct { uint64_t present_values_mask; diff --git a/upb/upb/mini_descriptor/internal/encode.h b/upb/upb/mini_descriptor/internal/encode.h index 104ae311a1..44fbf106e0 100644 --- a/upb/upb/mini_descriptor/internal/encode.h +++ b/upb/upb/mini_descriptor/internal/encode.h @@ -33,10 +33,10 @@ #include -#include "upb/base/descriptor_constants.h" +#include "upb/upb/base/descriptor_constants.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" // If the input buffer has at least this many bytes available, the encoder call // is guaranteed to succeed (as long as field number order is maintained). @@ -110,6 +110,6 @@ char* upb_MtDataEncoder_EncodeMessageSet(upb_MtDataEncoder* e, char* ptr); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MINI_DESCRIPTOR_INTERNAL_ENCODE_H_ */ diff --git a/upb/upb/mini_descriptor/internal/encode.hpp b/upb/upb/mini_descriptor/internal/encode.hpp index d8b3113d0a..4b6657b313 100644 --- a/upb/upb/mini_descriptor/internal/encode.hpp +++ b/upb/upb/mini_descriptor/internal/encode.hpp @@ -33,8 +33,8 @@ #include -#include "upb/base/internal/log2.h" -#include "upb/mini_descriptor/internal/encode.h" +#include "upb/upb/base/internal/log2.h" +#include "upb/upb/mini_descriptor/internal/encode.h" namespace upb { diff --git a/upb/upb/mini_descriptor/internal/encode_test.cc b/upb/upb/mini_descriptor/internal/encode_test.cc index d40401d4ed..127fa9036b 100644 --- a/upb/upb/mini_descriptor/internal/encode_test.cc +++ b/upb/upb/mini_descriptor/internal/encode_test.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/mini_descriptor/internal/encode.hpp" +#include "upb/upb/mini_descriptor/internal/encode.hpp" #include #include @@ -37,14 +37,14 @@ #include "gtest/gtest.h" #include "absl/container/flat_hash_set.h" #include "google/protobuf/descriptor.h" -#include "upb/base/status.hpp" -#include "upb/mem/arena.hpp" -#include "upb/message/internal/accessors.h" -#include "upb/mini_descriptor/decode.h" -#include "upb/mini_descriptor/internal/base92.h" -#include "upb/mini_descriptor/internal/modifiers.h" -#include "upb/mini_table/enum.h" -#include "upb/wire/decode.h" +#include "upb/upb/base/status.hpp" +#include "upb/upb/mem/arena.hpp" +#include "upb/upb/message/internal/accessors.h" +#include "upb/upb/mini_descriptor/decode.h" +#include "upb/upb/mini_descriptor/internal/base92.h" +#include "upb/upb/mini_descriptor/internal/modifiers.h" +#include "upb/upb/mini_table/enum.h" +#include "upb/upb/wire/decode.h" // begin:google_only // #include "testing/fuzzing/fuzztest.h" diff --git a/upb/upb/mini_descriptor/internal/modifiers.h b/upb/upb/mini_descriptor/internal/modifiers.h index bd4ee211cc..314297c98d 100644 --- a/upb/upb/mini_descriptor/internal/modifiers.h +++ b/upb/upb/mini_descriptor/internal/modifiers.h @@ -32,7 +32,7 @@ #define UPB_MINI_DESCRIPTOR_INTERNAL_MODIFIERS_H_ // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" typedef enum { kUpb_FieldModifier_IsRepeated = 1 << 0, @@ -48,6 +48,6 @@ typedef enum { kUpb_MessageModifier_IsExtendable = 1 << 2, } kUpb_MessageModifier; -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPB_MINI_DESCRIPTOR_INTERNAL_MODIFIERS_H_ diff --git a/upb/upb/mini_descriptor/internal/wire_constants.h b/upb/upb/mini_descriptor/internal/wire_constants.h index f24306a5b1..d947878d6a 100644 --- a/upb/upb/mini_descriptor/internal/wire_constants.h +++ b/upb/upb/mini_descriptor/internal/wire_constants.h @@ -31,10 +31,10 @@ #ifndef UPB_MINI_DESCRIPTOR_INTERNAL_WIRE_CONSTANTS_H_ #define UPB_MINI_DESCRIPTOR_INTERNAL_WIRE_CONSTANTS_H_ -#include "upb/base/descriptor_constants.h" +#include "upb/upb/base/descriptor_constants.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" typedef enum { kUpb_EncodedType_Double = 0, @@ -89,6 +89,6 @@ enum { kUpb_EncodedVersion_MessageSetV1 = '&', }; -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPB_MINI_DESCRIPTOR_INTERNAL_WIRE_CONSTANTS_H_ diff --git a/upb/upb/mini_descriptor/link.c b/upb/upb/mini_descriptor/link.c index 82b008476d..fbf3ef9393 100644 --- a/upb/upb/mini_descriptor/link.c +++ b/upb/upb/mini_descriptor/link.c @@ -28,10 +28,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/mini_descriptor/link.h" +#include "upb/upb/mini_descriptor/link.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" bool upb_MiniTable_SetSubMessage(upb_MiniTable* table, upb_MiniTableField* field, diff --git a/upb/upb/mini_descriptor/link.h b/upb/upb/mini_descriptor/link.h index 65e728e399..b9d62fafd2 100644 --- a/upb/upb/mini_descriptor/link.h +++ b/upb/upb/mini_descriptor/link.h @@ -39,15 +39,15 @@ #ifndef UPB_MINI_DESCRIPTOR_LINK_H_ #define UPB_MINI_DESCRIPTOR_LINK_H_ -#include "upb/base/status.h" -#include "upb/mem/arena.h" -#include "upb/mini_table/extension.h" -#include "upb/mini_table/field.h" -#include "upb/mini_table/message.h" -#include "upb/mini_table/sub.h" +#include "upb/upb/base/status.h" +#include "upb/upb/mem/arena.h" +#include "upb/upb/mini_table/extension.h" +#include "upb/upb/mini_table/field.h" +#include "upb/upb/mini_table/message.h" +#include "upb/upb/mini_table/sub.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -102,6 +102,6 @@ UPB_API bool upb_MiniTable_Link(upb_MiniTable* mt, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPB_MINI_DESCRIPTOR_LINK_H_ diff --git a/upb/upb/mini_table/BUILD b/upb/upb/mini_table/BUILD index 264643eda5..315b9d9587 100644 --- a/upb/upb/mini_table/BUILD +++ b/upb/upb/mini_table/BUILD @@ -6,7 +6,7 @@ # https://developers.google.com/open-source/licenses/bsd load( - "//bazel:build_defs.bzl", + "//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS", ) @@ -21,11 +21,11 @@ load( # ], # compatible_with = ["//buildenv/target:non_prod"], # copts = UPB_DEFAULT_COPTS, -# visibility = ["//:__pkg__"], +# visibility = ["//upb:__pkg__"], # deps = [ # ":mini_table", -# "//:base", -# "//:port", +# "//upb:base", +# "//upb:port", # ], # ) # end:google_only @@ -49,11 +49,11 @@ cc_library( visibility = ["//visibility:public"], deps = [ ":internal", - "//:base", - "//:hash", - "//:mem", - "//:message_types", - "//:port", + "//upb:base", + "//upb:hash", + "//upb:mem", + "//upb:message_types", + "//upb:port", ], ) @@ -72,9 +72,9 @@ cc_library( ], visibility = ["//visibility:public"], deps = [ - "//:base", - "//:message_types", - "//:port", + "//upb:base", + "//upb:message_types", + "//upb:port", ], ) @@ -88,8 +88,8 @@ filegroup( ], ), visibility = [ - "//cmake:__pkg__", - "//python/dist:__pkg__", + "//upb/cmake:__pkg__", + "//upb/python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/mini_table/compat.c b/upb/upb/mini_table/compat.c index 26c69dddcb..89036bc6ca 100644 --- a/upb/upb/mini_table/compat.c +++ b/upb/upb/mini_table/compat.c @@ -28,14 +28,14 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/mini_table/compat.h" +#include "upb/upb/mini_table/compat.h" -#include "upb/base/descriptor_constants.h" -#include "upb/mini_table/field.h" -#include "upb/mini_table/message.h" +#include "upb/upb/base/descriptor_constants.h" +#include "upb/upb/mini_table/field.h" +#include "upb/upb/mini_table/message.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" static bool upb_deep_check(const upb_MiniTable* src, const upb_MiniTable* dst, bool eq) { diff --git a/upb/upb/mini_table/compat.h b/upb/upb/mini_table/compat.h index d79f99a844..042d529a7b 100644 --- a/upb/upb/mini_table/compat.h +++ b/upb/upb/mini_table/compat.h @@ -31,10 +31,10 @@ #ifndef UPB_MINI_TABLE_COMPAT_H_ #define UPB_MINI_TABLE_COMPAT_H_ -#include "upb/mini_table/message.h" +#include "upb/upb/mini_table/message.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" // upb does not support mixing minitables from different sources but these // functions are still used by some existing users so for now we make them @@ -56,6 +56,6 @@ bool upb_MiniTable_Equals(const upb_MiniTable* src, const upb_MiniTable* dst); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MINI_TABLE_COMPAT_H_ */ diff --git a/upb/upb/mini_table/enum.h b/upb/upb/mini_table/enum.h index 3a439fa5f7..99636737d8 100644 --- a/upb/upb/mini_table/enum.h +++ b/upb/upb/mini_table/enum.h @@ -31,10 +31,10 @@ #ifndef UPB_MINI_TABLE_ENUM_H_ #define UPB_MINI_TABLE_ENUM_H_ -#include "upb/mini_table/internal/enum.h" +#include "upb/upb/mini_table/internal/enum.h" // Must be last -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" typedef struct upb_MiniTableEnum upb_MiniTableEnum; @@ -48,6 +48,6 @@ UPB_INLINE bool upb_MiniTableEnum_CheckValue(const struct upb_MiniTableEnum* e, return status == _kUpb_FastEnumCheck_ValueIsInEnum ? true : false; } -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MINI_TABLE_ENUM_H_ */ diff --git a/upb/upb/mini_table/extension.h b/upb/upb/mini_table/extension.h index 9589aa4607..a40019453d 100644 --- a/upb/upb/mini_table/extension.h +++ b/upb/upb/mini_table/extension.h @@ -31,13 +31,13 @@ #ifndef UPB_MINI_TABLE_EXTENSION_H_ #define UPB_MINI_TABLE_EXTENSION_H_ -#include "upb/mini_table/internal/extension.h" +#include "upb/upb/mini_table/internal/extension.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" typedef struct upb_MiniTableExtension upb_MiniTableExtension; -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MINI_TABLE_EXTENSION_H_ */ diff --git a/upb/upb/mini_table/extension_registry.c b/upb/upb/mini_table/extension_registry.c index 1483955cc9..9fb18875e4 100644 --- a/upb/upb/mini_table/extension_registry.c +++ b/upb/upb/mini_table/extension_registry.c @@ -28,13 +28,13 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/mini_table/extension_registry.h" +#include "upb/upb/mini_table/extension_registry.h" -#include "upb/hash/str_table.h" -#include "upb/mini_table/extension.h" +#include "upb/upb/hash/str_table.h" +#include "upb/upb/mini_table/extension.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #define EXTREG_KEY_SIZE (sizeof(upb_MiniTable*) + sizeof(uint32_t)) diff --git a/upb/upb/mini_table/extension_registry.h b/upb/upb/mini_table/extension_registry.h index 973123af65..8b0f28eafb 100644 --- a/upb/upb/mini_table/extension_registry.h +++ b/upb/upb/mini_table/extension_registry.h @@ -31,12 +31,12 @@ #ifndef UPB_MINI_TABLE_EXTENSION_REGISTRY_H_ #define UPB_MINI_TABLE_EXTENSION_REGISTRY_H_ -#include "upb/mem/arena.h" -#include "upb/mini_table/extension.h" -#include "upb/mini_table/message.h" +#include "upb/upb/mem/arena.h" +#include "upb/upb/mini_table/extension.h" +#include "upb/upb/mini_table/message.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -103,6 +103,6 @@ UPB_API const upb_MiniTableExtension* upb_ExtensionRegistry_Lookup( } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MINI_TABLE_EXTENSION_REGISTRY_H_ */ diff --git a/upb/upb/mini_table/field.h b/upb/upb/mini_table/field.h index 17ea33b72c..329cecb065 100644 --- a/upb/upb/mini_table/field.h +++ b/upb/upb/mini_table/field.h @@ -31,12 +31,12 @@ #ifndef UPB_MINI_TABLE_FIELD_H_ #define UPB_MINI_TABLE_FIELD_H_ -#include "upb/mini_table/internal/field.h" -#include "upb/mini_table/internal/message.h" -#include "upb/mini_table/internal/sub.h" +#include "upb/upb/mini_table/internal/field.h" +#include "upb/upb/mini_table/internal/message.h" +#include "upb/upb/mini_table/internal/sub.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -116,6 +116,6 @@ UPB_API_INLINE bool upb_MiniTableField_HasPresence( } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MINI_TABLE_FIELD_H_ */ diff --git a/upb/upb/mini_table/file.h b/upb/upb/mini_table/file.h index 27f50b480a..623c8e6628 100644 --- a/upb/upb/mini_table/file.h +++ b/upb/upb/mini_table/file.h @@ -31,7 +31,7 @@ #ifndef UPB_MINI_TABLE_FILE_H_ #define UPB_MINI_TABLE_FILE_H_ -#include "upb/mini_table/internal/file.h" +#include "upb/upb/mini_table/internal/file.h" typedef struct upb_MiniTableFile upb_MiniTableFile; diff --git a/upb/upb/mini_table/internal/enum.h b/upb/upb/mini_table/internal/enum.h index 470326c6f7..c9bc555389 100644 --- a/upb/upb/mini_table/internal/enum.h +++ b/upb/upb/mini_table/internal/enum.h @@ -34,7 +34,7 @@ #include // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" struct upb_MiniTableEnum { uint32_t mask_limit; // Limit enum value that can be tested with mask. @@ -76,6 +76,6 @@ UPB_INLINE bool _upb_MiniTable_CheckEnumValueSlow( } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MINI_TABLE_INTERNAL_ENUM_H_ */ diff --git a/upb/upb/mini_table/internal/extension.h b/upb/upb/mini_table/internal/extension.h index 3202caa803..5fc148a802 100644 --- a/upb/upb/mini_table/internal/extension.h +++ b/upb/upb/mini_table/internal/extension.h @@ -31,11 +31,11 @@ #ifndef UPB_MINI_TABLE_INTERNAL_EXTENSION_H_ #define UPB_MINI_TABLE_INTERNAL_EXTENSION_H_ -#include "upb/mini_table/internal/field.h" -#include "upb/mini_table/internal/sub.h" +#include "upb/upb/mini_table/internal/field.h" +#include "upb/upb/mini_table/internal/sub.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" struct upb_MiniTableExtension { // Do not move this field. We need to be able to alias pointers. @@ -45,6 +45,6 @@ struct upb_MiniTableExtension { union upb_MiniTableSub sub; // NULL unless submessage or proto2 enum }; -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MINI_TABLE_INTERNAL_EXTENSION_H_ */ diff --git a/upb/upb/mini_table/internal/field.h b/upb/upb/mini_table/internal/field.h index 7a0ff51ae4..e446a44cf0 100644 --- a/upb/upb/mini_table/internal/field.h +++ b/upb/upb/mini_table/internal/field.h @@ -33,10 +33,10 @@ #include -#include "upb/base/descriptor_constants.h" +#include "upb/upb/base/descriptor_constants.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" struct upb_MiniTableField { uint32_t number; @@ -132,6 +132,6 @@ UPB_INLINE bool upb_IsSubMessage(const struct upb_MiniTableField* field) { } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MINI_TABLE_INTERNAL_FIELD_H_ */ diff --git a/upb/upb/mini_table/internal/file.h b/upb/upb/mini_table/internal/file.h index 9b8aa996c8..5935a16d3a 100644 --- a/upb/upb/mini_table/internal/file.h +++ b/upb/upb/mini_table/internal/file.h @@ -31,12 +31,12 @@ #ifndef UPB_MINI_TABLE_INTERNAL_FILE_H_ #define UPB_MINI_TABLE_INTERNAL_FILE_H_ -#include "upb/mini_table/internal/enum.h" -#include "upb/mini_table/internal/extension.h" -#include "upb/mini_table/internal/message.h" +#include "upb/upb/mini_table/internal/enum.h" +#include "upb/upb/mini_table/internal/extension.h" +#include "upb/upb/mini_table/internal/message.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" struct upb_MiniTableFile { const struct upb_MiniTable** msgs; @@ -47,6 +47,6 @@ struct upb_MiniTableFile { int ext_count; }; -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MINI_TABLE_INTERNAL_FILE_H_ */ diff --git a/upb/upb/mini_table/internal/message.c b/upb/upb/mini_table/internal/message.c index 3704baee5a..3a2cfbfb8a 100644 --- a/upb/upb/mini_table/internal/message.c +++ b/upb/upb/mini_table/internal/message.c @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/mini_table/internal/message.h" +#include "upb/upb/mini_table/internal/message.h" const struct upb_MiniTable _kUpb_MiniTable_Empty = { .subs = NULL, diff --git a/upb/upb/mini_table/internal/message.h b/upb/upb/mini_table/internal/message.h index fc672034d9..00d67eea0a 100644 --- a/upb/upb/mini_table/internal/message.h +++ b/upb/upb/mini_table/internal/message.h @@ -31,11 +31,11 @@ #ifndef UPB_MINI_TABLE_INTERNAL_MESSAGE_H_ #define UPB_MINI_TABLE_INTERNAL_MESSAGE_H_ -#include "upb/message/types.h" -#include "upb/mini_table/internal/field.h" +#include "upb/upb/message/types.h" +#include "upb/upb/mini_table/internal/field.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" struct upb_Decoder; typedef const char* _upb_FieldParser(struct upb_Decoder* d, const char* ptr, @@ -106,6 +106,6 @@ UPB_INLINE uint64_t upb_MiniTable_requiredmask(const struct upb_MiniTable* l) { } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MINI_TABLE_INTERNAL_MESSAGE_H_ */ diff --git a/upb/upb/mini_table/internal/sub.h b/upb/upb/mini_table/internal/sub.h index b73639db43..f0598f17fa 100644 --- a/upb/upb/mini_table/internal/sub.h +++ b/upb/upb/mini_table/internal/sub.h @@ -31,8 +31,8 @@ #ifndef UPB_MINI_TABLE_INTERNAL_SUB_H_ #define UPB_MINI_TABLE_INTERNAL_SUB_H_ -#include "upb/mini_table/internal/enum.h" -#include "upb/mini_table/internal/message.h" +#include "upb/upb/mini_table/internal/enum.h" +#include "upb/upb/mini_table/internal/message.h" union upb_MiniTableSub { const struct upb_MiniTable* submsg; diff --git a/upb/upb/mini_table/message.c b/upb/upb/mini_table/message.c index f10934f0e1..c568ae8753 100644 --- a/upb/upb/mini_table/message.c +++ b/upb/upb/mini_table/message.c @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/mini_table/message.h" +#include "upb/upb/mini_table/message.h" #include -#include "upb/mem/arena.h" -#include "upb/mini_table/internal/message.h" +#include "upb/upb/mem/arena.h" +#include "upb/upb/mini_table/internal/message.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" const upb_MiniTableField* upb_MiniTable_FindFieldByNumber( const upb_MiniTable* t, uint32_t number) { diff --git a/upb/upb/mini_table/message.h b/upb/upb/mini_table/message.h index cc5409fd2d..19716b1ab7 100644 --- a/upb/upb/mini_table/message.h +++ b/upb/upb/mini_table/message.h @@ -31,12 +31,12 @@ #ifndef UPB_MINI_TABLE_MESSAGE_H_ #define UPB_MINI_TABLE_MESSAGE_H_ -#include "upb/mini_table/enum.h" -#include "upb/mini_table/field.h" -#include "upb/mini_table/internal/message.h" +#include "upb/upb/mini_table/enum.h" +#include "upb/upb/mini_table/field.h" +#include "upb/upb/mini_table/internal/message.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -103,6 +103,6 @@ bool upb_MiniTable_NextOneofField(const upb_MiniTable* m, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_MINI_TABLE_MESSAGE_H_ */ diff --git a/upb/upb/mini_table/sub.h b/upb/upb/mini_table/sub.h index 7f5d237db1..19890f2592 100644 --- a/upb/upb/mini_table/sub.h +++ b/upb/upb/mini_table/sub.h @@ -31,7 +31,7 @@ #ifndef UPB_MINI_TABLE_SUB_H_ #define UPB_MINI_TABLE_SUB_H_ -#include "upb/mini_table/internal/sub.h" +#include "upb/upb/mini_table/internal/sub.h" typedef union upb_MiniTableSub upb_MiniTableSub; diff --git a/upb/upb/port/BUILD b/upb/upb/port/BUILD index b47c48ea20..2157ff0751 100644 --- a/upb/upb/port/BUILD +++ b/upb/upb/port/BUILD @@ -5,7 +5,7 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") cc_library( name = "port", @@ -37,8 +37,8 @@ filegroup( ], ), visibility = [ - "//cmake:__pkg__", - "//python/dist:__pkg__", + "//upb/cmake:__pkg__", + "//upb/python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/port/atomic.h b/upb/upb/port/atomic.h index 8c792bcc96..8c0d3b4b9a 100644 --- a/upb/upb/port/atomic.h +++ b/upb/upb/port/atomic.h @@ -31,7 +31,7 @@ #ifndef UPB_PORT_ATOMIC_H_ #define UPB_PORT_ATOMIC_H_ -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef UPB_USE_C11_ATOMICS @@ -99,6 +99,6 @@ UPB_INLINE bool _upb_NonAtomic_CompareExchangeStrongP(void* addr, #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPB_PORT_ATOMIC_H_ diff --git a/upb/upb/port/def.inc b/upb/upb/port/def.inc index b9798bf2ce..c590edf580 100644 --- a/upb/upb/port/def.inc +++ b/upb/upb/port/def.inc @@ -35,17 +35,17 @@ * * The correct usage is: * - * #include "upb/foobar.h" - * #include "upb/baz.h" + * #include "upb/upb/foobar.h" + * #include "upb/upb/baz.h" * * // MUST be last included header. - * #include "upb/port/def.inc" + * #include "upb/upb/port/def.inc" * * // Code for this file. * // <...> * * // Can be omitted for .c files, required for .h. - * #include "upb/port/undef.inc" + * #include "upb/upb/port/undef.inc" * * This file is private and must not be included by users! */ diff --git a/upb/upb/port/vsnprintf_compat.h b/upb/upb/port/vsnprintf_compat.h index 35c9697fd2..3cea66a216 100644 --- a/upb/upb/port/vsnprintf_compat.h +++ b/upb/upb/port/vsnprintf_compat.h @@ -32,7 +32,7 @@ #define UPB_PORT_VSNPRINTF_COMPAT_H_ // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" UPB_INLINE int _upb_vsnprintf(char* buf, size_t size, const char* fmt, va_list ap) { @@ -48,6 +48,6 @@ UPB_INLINE int _upb_vsnprintf(char* buf, size_t size, const char* fmt, #endif } -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPB_PORT_VSNPRINTF_COMPAT_H_ diff --git a/upb/upb/reflection/common.h b/upb/upb/reflection/common.h index 0d60eeda99..d104df04c1 100644 --- a/upb/upb/reflection/common.h +++ b/upb/upb/reflection/common.h @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// IWYU pragma: private, include "upb/reflection/def.h" +// IWYU pragma: private, include "upb/upb/reflection/def.h" // Declarations common to all public def types. diff --git a/upb/upb/reflection/def.h b/upb/upb/reflection/def.h index 265fba9a5e..dc5a958da2 100644 --- a/upb/upb/reflection/def.h +++ b/upb/upb/reflection/def.h @@ -32,16 +32,16 @@ #define UPB_REFLECTION_DEF_H_ // IWYU pragma: begin_exports -#include "upb/reflection/def_pool.h" -#include "upb/reflection/enum_def.h" -#include "upb/reflection/enum_value_def.h" -#include "upb/reflection/extension_range.h" -#include "upb/reflection/field_def.h" -#include "upb/reflection/file_def.h" -#include "upb/reflection/message_def.h" -#include "upb/reflection/method_def.h" -#include "upb/reflection/oneof_def.h" -#include "upb/reflection/service_def.h" +#include "upb/upb/reflection/def_pool.h" +#include "upb/upb/reflection/enum_def.h" +#include "upb/upb/reflection/enum_value_def.h" +#include "upb/upb/reflection/extension_range.h" +#include "upb/upb/reflection/field_def.h" +#include "upb/upb/reflection/file_def.h" +#include "upb/upb/reflection/message_def.h" +#include "upb/upb/reflection/method_def.h" +#include "upb/upb/reflection/oneof_def.h" +#include "upb/upb/reflection/service_def.h" // IWYU pragma: end_exports #endif /* UPB_REFLECTION_DEF_H_ */ diff --git a/upb/upb/reflection/def.hpp b/upb/upb/reflection/def.hpp index 32264ae3ff..c423c8eb34 100644 --- a/upb/upb/reflection/def.hpp +++ b/upb/upb/reflection/def.hpp @@ -36,15 +36,15 @@ #include #include -#include "upb/base/status.hpp" -#include "upb/mem/arena.hpp" -#include "upb/reflection/def.h" -#include "upb/reflection/internal/def_pool.h" -#include "upb/reflection/internal/enum_def.h" -#include "upb/reflection/message.h" +#include "upb/upb/base/status.hpp" +#include "upb/upb/mem/arena.hpp" +#include "upb/upb/reflection/def.h" +#include "upb/upb/reflection/internal/def_pool.h" +#include "upb/upb/reflection/internal/enum_def.h" +#include "upb/upb/reflection/message.h" // Must be last -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" namespace upb { @@ -623,6 +623,6 @@ inline EnumDefPtr FieldDefPtr::enum_subdef() const { } // namespace upb -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPB_REFLECTION_DEF_HPP_ diff --git a/upb/upb/reflection/def_builder.c b/upb/upb/reflection/def_builder.c index 93c4eb5e24..da502f356f 100644 --- a/upb/upb/reflection/def_builder.c +++ b/upb/upb/reflection/def_builder.c @@ -28,16 +28,16 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/reflection/internal/def_builder.h" +#include "upb/upb/reflection/internal/def_builder.h" #include -#include "upb/reflection/def_pool.h" -#include "upb/reflection/def_type.h" -#include "upb/reflection/field_def.h" +#include "upb/upb/reflection/def_pool.h" +#include "upb/upb/reflection/def_type.h" +#include "upb/upb/reflection/field_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" /* The upb core does not generally have a concept of default instances. However * for descriptor options we make an exception since the max size is known and diff --git a/upb/upb/reflection/def_builder_test.cc b/upb/upb/reflection/def_builder_test.cc index 35d63a4126..6e36584c19 100644 --- a/upb/upb/reflection/def_builder_test.cc +++ b/upb/upb/reflection/def_builder_test.cc @@ -28,14 +28,14 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/reflection/internal/def_builder.h" +#include "upb/upb/reflection/internal/def_builder.h" #include "gtest/gtest.h" #include "absl/strings/string_view.h" -#include "upb/mem/arena.hpp" +#include "upb/upb/mem/arena.hpp" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" struct IdentTestData { absl::string_view text; diff --git a/upb/upb/reflection/def_pool.c b/upb/upb/reflection/def_pool.c index 76733ff34e..fb7f074ecd 100644 --- a/upb/upb/reflection/def_pool.c +++ b/upb/upb/reflection/def_pool.c @@ -28,21 +28,21 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/reflection/internal/def_pool.h" +#include "upb/upb/reflection/internal/def_pool.h" -#include "upb/hash/int_table.h" -#include "upb/hash/str_table.h" -#include "upb/reflection/def_type.h" -#include "upb/reflection/internal/def_builder.h" -#include "upb/reflection/internal/enum_def.h" -#include "upb/reflection/internal/enum_value_def.h" -#include "upb/reflection/internal/field_def.h" -#include "upb/reflection/internal/file_def.h" -#include "upb/reflection/internal/message_def.h" -#include "upb/reflection/internal/service_def.h" +#include "upb/upb/hash/int_table.h" +#include "upb/upb/hash/str_table.h" +#include "upb/upb/reflection/def_type.h" +#include "upb/upb/reflection/internal/def_builder.h" +#include "upb/upb/reflection/internal/enum_def.h" +#include "upb/upb/reflection/internal/enum_value_def.h" +#include "upb/upb/reflection/internal/field_def.h" +#include "upb/upb/reflection/internal/file_def.h" +#include "upb/upb/reflection/internal/message_def.h" +#include "upb/upb/reflection/internal/service_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" struct upb_DefPool { upb_Arena* arena; diff --git a/upb/upb/reflection/def_pool.h b/upb/upb/reflection/def_pool.h index 7ca3619aa2..bd86199155 100644 --- a/upb/upb/reflection/def_pool.h +++ b/upb/upb/reflection/def_pool.h @@ -28,18 +28,18 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// IWYU pragma: private, include "upb/reflection/def.h" +// IWYU pragma: private, include "upb/upb/reflection/def.h" #ifndef UPB_REFLECTION_DEF_POOL_H_ #define UPB_REFLECTION_DEF_POOL_H_ -#include "upb/base/status.h" -#include "upb/base/string_view.h" -#include "upb/reflection/common.h" -#include "upb/reflection/def_type.h" +#include "upb/upb/base/status.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/reflection/common.h" +#include "upb/upb/reflection/def_type.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -105,6 +105,6 @@ const upb_FieldDef** upb_DefPool_GetAllExtensions(const upb_DefPool* s, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_DEF_POOL_H_ */ diff --git a/upb/upb/reflection/def_type.c b/upb/upb/reflection/def_type.c index dee6b2c5b3..fc7f7e9a1e 100644 --- a/upb/upb/reflection/def_type.c +++ b/upb/upb/reflection/def_type.c @@ -28,10 +28,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/reflection/def_type.h" +#include "upb/upb/reflection/def_type.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" upb_deftype_t _upb_DefType_Type(upb_value v) { const uintptr_t num = (uintptr_t)upb_value_getconstptr(v); diff --git a/upb/upb/reflection/def_type.h b/upb/upb/reflection/def_type.h index 6e1b4311c4..84c33d57ec 100644 --- a/upb/upb/reflection/def_type.h +++ b/upb/upb/reflection/def_type.h @@ -31,10 +31,10 @@ #ifndef UPB_REFLECTION_DEF_TYPE_H_ #define UPB_REFLECTION_DEF_TYPE_H_ -#include "upb/hash/common.h" +#include "upb/upb/hash/common.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" // Inside a symtab we store tagged pointers to specific def types. typedef enum { @@ -79,6 +79,6 @@ const void* _upb_DefType_Unpack(upb_value v, upb_deftype_t type); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_DEF_TYPE_H_ */ diff --git a/upb/upb/reflection/desc_state.c b/upb/upb/reflection/desc_state.c index 7868308b39..e110fba79e 100644 --- a/upb/upb/reflection/desc_state.c +++ b/upb/upb/reflection/desc_state.c @@ -28,10 +28,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/reflection/internal/desc_state.h" +#include "upb/upb/reflection/internal/desc_state.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" bool _upb_DescState_Grow(upb_DescState* d, upb_Arena* a) { const size_t oldbufsize = d->bufsize; diff --git a/upb/upb/reflection/enum_def.c b/upb/upb/reflection/enum_def.c index df384baa0c..5adf9842bd 100644 --- a/upb/upb/reflection/enum_def.c +++ b/upb/upb/reflection/enum_def.c @@ -28,21 +28,21 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/reflection/internal/enum_def.h" +#include "upb/upb/reflection/internal/enum_def.h" -#include "upb/hash/int_table.h" -#include "upb/hash/str_table.h" -#include "upb/mini_descriptor/decode.h" -#include "upb/reflection/def_type.h" -#include "upb/reflection/internal/def_builder.h" -#include "upb/reflection/internal/desc_state.h" -#include "upb/reflection/internal/enum_reserved_range.h" -#include "upb/reflection/internal/enum_value_def.h" -#include "upb/reflection/internal/file_def.h" -#include "upb/reflection/internal/message_def.h" +#include "upb/upb/hash/int_table.h" +#include "upb/upb/hash/str_table.h" +#include "upb/upb/mini_descriptor/decode.h" +#include "upb/upb/reflection/def_type.h" +#include "upb/upb/reflection/internal/def_builder.h" +#include "upb/upb/reflection/internal/desc_state.h" +#include "upb/upb/reflection/internal/enum_reserved_range.h" +#include "upb/upb/reflection/internal/enum_value_def.h" +#include "upb/upb/reflection/internal/file_def.h" +#include "upb/upb/reflection/internal/message_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" struct upb_EnumDef { const UPB_DESC(EnumOptions) * opts; diff --git a/upb/upb/reflection/enum_def.h b/upb/upb/reflection/enum_def.h index 7ff0737641..8953632311 100644 --- a/upb/upb/reflection/enum_def.h +++ b/upb/upb/reflection/enum_def.h @@ -28,16 +28,16 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// IWYU pragma: private, include "upb/reflection/def.h" +// IWYU pragma: private, include "upb/upb/reflection/def.h" #ifndef UPB_REFLECTION_ENUM_DEF_H_ #define UPB_REFLECTION_ENUM_DEF_H_ -#include "upb/base/string_view.h" -#include "upb/reflection/common.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/reflection/common.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -78,6 +78,6 @@ UPB_API int upb_EnumDef_ValueCount(const upb_EnumDef* e); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_ENUM_DEF_H_ */ diff --git a/upb/upb/reflection/enum_reserved_range.c b/upb/upb/reflection/enum_reserved_range.c index 906261c03a..da24d8e386 100644 --- a/upb/upb/reflection/enum_reserved_range.c +++ b/upb/upb/reflection/enum_reserved_range.c @@ -28,14 +28,14 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/reflection/internal/enum_reserved_range.h" +#include "upb/upb/reflection/internal/enum_reserved_range.h" -#include "upb/reflection/enum_def.h" -#include "upb/reflection/field_def.h" -#include "upb/reflection/internal/def_builder.h" +#include "upb/upb/reflection/enum_def.h" +#include "upb/upb/reflection/field_def.h" +#include "upb/upb/reflection/internal/def_builder.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" struct upb_EnumReservedRange { int32_t start; diff --git a/upb/upb/reflection/enum_reserved_range.h b/upb/upb/reflection/enum_reserved_range.h index e1bf5ab584..cb84ae53b7 100644 --- a/upb/upb/reflection/enum_reserved_range.h +++ b/upb/upb/reflection/enum_reserved_range.h @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// IWYU pragma: private, include "upb/reflection/def.h" +// IWYU pragma: private, include "upb/upb/reflection/def.h" #ifndef UPB_REFLECTION_ENUM_RESERVED_RANGE_H_ #define UPB_REFLECTION_ENUM_RESERVED_RANGE_H_ -#include "upb/reflection/common.h" +#include "upb/upb/reflection/common.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -49,6 +49,6 @@ int32_t upb_EnumReservedRange_End(const upb_EnumReservedRange* r); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_ENUM_RESERVED_RANGE_H_ */ diff --git a/upb/upb/reflection/enum_value_def.c b/upb/upb/reflection/enum_value_def.c index 000697b2b1..d12b55058d 100644 --- a/upb/upb/reflection/enum_value_def.c +++ b/upb/upb/reflection/enum_value_def.c @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/reflection/internal/enum_value_def.h" +#include "upb/upb/reflection/internal/enum_value_def.h" -#include "upb/reflection/def_type.h" -#include "upb/reflection/internal/def_builder.h" -#include "upb/reflection/internal/enum_def.h" -#include "upb/reflection/internal/file_def.h" +#include "upb/upb/reflection/def_type.h" +#include "upb/upb/reflection/internal/def_builder.h" +#include "upb/upb/reflection/internal/enum_def.h" +#include "upb/upb/reflection/internal/file_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" struct upb_EnumValueDef { const UPB_DESC(EnumValueOptions) * opts; diff --git a/upb/upb/reflection/enum_value_def.h b/upb/upb/reflection/enum_value_def.h index 6023103001..efe011436a 100644 --- a/upb/upb/reflection/enum_value_def.h +++ b/upb/upb/reflection/enum_value_def.h @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// IWYU pragma: private, include "upb/reflection/def.h" +// IWYU pragma: private, include "upb/upb/reflection/def.h" #ifndef UPB_REFLECTION_ENUM_VALUE_DEF_H_ #define UPB_REFLECTION_ENUM_VALUE_DEF_H_ -#include "upb/reflection/common.h" +#include "upb/upb/reflection/common.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -55,6 +55,6 @@ const UPB_DESC(EnumValueOptions) * } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_ENUM_VALUE_DEF_H_ */ diff --git a/upb/upb/reflection/extension_range.c b/upb/upb/reflection/extension_range.c index 43e723acd3..21c7dbb524 100644 --- a/upb/upb/reflection/extension_range.c +++ b/upb/upb/reflection/extension_range.c @@ -28,14 +28,14 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/reflection/internal/extension_range.h" +#include "upb/upb/reflection/internal/extension_range.h" -#include "upb/reflection/field_def.h" -#include "upb/reflection/internal/def_builder.h" -#include "upb/reflection/message_def.h" +#include "upb/upb/reflection/field_def.h" +#include "upb/upb/reflection/internal/def_builder.h" +#include "upb/upb/reflection/message_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" struct upb_ExtensionRange { const UPB_DESC(ExtensionRangeOptions) * opts; diff --git a/upb/upb/reflection/extension_range.h b/upb/upb/reflection/extension_range.h index 9d87721330..71f1e3d32c 100644 --- a/upb/upb/reflection/extension_range.h +++ b/upb/upb/reflection/extension_range.h @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// IWYU pragma: private, include "upb/reflection/def.h" +// IWYU pragma: private, include "upb/upb/reflection/def.h" #ifndef UPB_REFLECTION_EXTENSION_RANGE_H_ #define UPB_REFLECTION_EXTENSION_RANGE_H_ -#include "upb/reflection/common.h" +#include "upb/upb/reflection/common.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -53,6 +53,6 @@ const UPB_DESC(ExtensionRangeOptions) * } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_EXTENSION_RANGE_H_ */ diff --git a/upb/upb/reflection/field_def.c b/upb/upb/reflection/field_def.c index 5789048e23..dc6ab1f3c8 100644 --- a/upb/upb/reflection/field_def.c +++ b/upb/upb/reflection/field_def.c @@ -28,26 +28,26 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/reflection/internal/field_def.h" +#include "upb/upb/reflection/internal/field_def.h" #include #include -#include "upb/mini_descriptor/decode.h" -#include "upb/mini_descriptor/internal/modifiers.h" -#include "upb/reflection/def.h" -#include "upb/reflection/def_pool.h" -#include "upb/reflection/def_type.h" -#include "upb/reflection/internal/def_builder.h" -#include "upb/reflection/internal/desc_state.h" -#include "upb/reflection/internal/enum_def.h" -#include "upb/reflection/internal/enum_value_def.h" -#include "upb/reflection/internal/file_def.h" -#include "upb/reflection/internal/message_def.h" -#include "upb/reflection/internal/oneof_def.h" +#include "upb/upb/mini_descriptor/decode.h" +#include "upb/upb/mini_descriptor/internal/modifiers.h" +#include "upb/upb/reflection/def.h" +#include "upb/upb/reflection/def_pool.h" +#include "upb/upb/reflection/def_type.h" +#include "upb/upb/reflection/internal/def_builder.h" +#include "upb/upb/reflection/internal/desc_state.h" +#include "upb/upb/reflection/internal/enum_def.h" +#include "upb/upb/reflection/internal/enum_value_def.h" +#include "upb/upb/reflection/internal/file_def.h" +#include "upb/upb/reflection/internal/message_def.h" +#include "upb/upb/reflection/internal/oneof_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #define UPB_FIELD_TYPE_UNSPECIFIED 0 diff --git a/upb/upb/reflection/field_def.h b/upb/upb/reflection/field_def.h index fb8b317f58..2e837bc8a5 100644 --- a/upb/upb/reflection/field_def.h +++ b/upb/upb/reflection/field_def.h @@ -28,16 +28,16 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// IWYU pragma: private, include "upb/reflection/def.h" +// IWYU pragma: private, include "upb/upb/reflection/def.h" #ifndef UPB_REFLECTION_FIELD_DEF_H_ #define UPB_REFLECTION_FIELD_DEF_H_ -#include "upb/base/string_view.h" -#include "upb/reflection/common.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/reflection/common.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" // Maximum field number allowed for FieldDefs. // This is an inherent limit of the protobuf wire format. @@ -91,6 +91,6 @@ UPB_API upb_FieldType upb_FieldDef_Type(const upb_FieldDef* f); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_FIELD_DEF_H_ */ diff --git a/upb/upb/reflection/file_def.c b/upb/upb/reflection/file_def.c index 70109a7bae..5a4fab37ed 100644 --- a/upb/upb/reflection/file_def.c +++ b/upb/upb/reflection/file_def.c @@ -28,17 +28,17 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/reflection/internal/file_def.h" +#include "upb/upb/reflection/internal/file_def.h" -#include "upb/reflection/def_pool.h" -#include "upb/reflection/internal/def_builder.h" -#include "upb/reflection/internal/enum_def.h" -#include "upb/reflection/internal/field_def.h" -#include "upb/reflection/internal/message_def.h" -#include "upb/reflection/internal/service_def.h" +#include "upb/upb/reflection/def_pool.h" +#include "upb/upb/reflection/internal/def_builder.h" +#include "upb/upb/reflection/internal/enum_def.h" +#include "upb/upb/reflection/internal/field_def.h" +#include "upb/upb/reflection/internal/message_def.h" +#include "upb/upb/reflection/internal/service_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" struct upb_FileDef { const UPB_DESC(FileOptions) * opts; diff --git a/upb/upb/reflection/file_def.h b/upb/upb/reflection/file_def.h index 0860aae53d..9d8d64b28c 100644 --- a/upb/upb/reflection/file_def.h +++ b/upb/upb/reflection/file_def.h @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// IWYU pragma: private, include "upb/reflection/def.h" +// IWYU pragma: private, include "upb/upb/reflection/def.h" #ifndef UPB_REFLECTION_FILE_DEF_H_ #define UPB_REFLECTION_FILE_DEF_H_ -#include "upb/reflection/common.h" +#include "upb/upb/reflection/common.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -75,6 +75,6 @@ int upb_FileDef_WeakDependencyCount(const upb_FileDef* f); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_FILE_DEF_H_ */ diff --git a/upb/upb/reflection/internal/def_builder.h b/upb/upb/reflection/internal/def_builder.h index f32d98f193..e19c0c2bd1 100644 --- a/upb/upb/reflection/internal/def_builder.h +++ b/upb/upb/reflection/internal/def_builder.h @@ -31,12 +31,12 @@ #ifndef UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_ #define UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_ -#include "upb/reflection/common.h" -#include "upb/reflection/def_type.h" -#include "upb/reflection/internal/def_pool.h" +#include "upb/upb/reflection/common.h" +#include "upb/upb/reflection/def_type.h" +#include "upb/upb/reflection/internal/def_pool.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" // We want to copy the options verbatim into the destination options proto. // We use serialize+parse as our deep copy. @@ -155,6 +155,6 @@ UPB_INLINE void _upb_DefBuilder_CheckIdentFull(upb_DefBuilder* ctx, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_DEF_BUILDER_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/def_pool.h b/upb/upb/reflection/internal/def_pool.h index ce8f623868..69bdf6fd41 100644 --- a/upb/upb/reflection/internal/def_pool.h +++ b/upb/upb/reflection/internal/def_pool.h @@ -31,11 +31,11 @@ #ifndef UPB_REFLECTION_DEF_POOL_INTERNAL_H_ #define UPB_REFLECTION_DEF_POOL_INTERNAL_H_ -#include "upb/mini_descriptor/decode.h" -#include "upb/reflection/def_pool.h" +#include "upb/upb/mini_descriptor/decode.h" +#include "upb/upb/reflection/def_pool.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -75,6 +75,6 @@ bool _upb_DefPool_LoadDefInitEx(upb_DefPool* s, const _upb_DefPool_Init* init, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_DEF_POOL_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/desc_state.h b/upb/upb/reflection/internal/desc_state.h index eca7127e0e..5356c2e577 100644 --- a/upb/upb/reflection/internal/desc_state.h +++ b/upb/upb/reflection/internal/desc_state.h @@ -31,11 +31,11 @@ #ifndef UPB_REFLECTION_DESC_STATE_INTERNAL_H_ #define UPB_REFLECTION_DESC_STATE_INTERNAL_H_ -#include "upb/mem/arena.h" -#include "upb/mini_descriptor/internal/encode.h" +#include "upb/upb/mem/arena.h" +#include "upb/upb/mini_descriptor/internal/encode.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" // Manages the storage for mini descriptor strings as they are being encoded. // TODO(b/234740652): Move some of this state directly into the encoder, maybe. @@ -62,6 +62,6 @@ bool _upb_DescState_Grow(upb_DescState* d, upb_Arena* a); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_DESC_STATE_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/enum_def.h b/upb/upb/reflection/internal/enum_def.h index 3e69280e6b..9bfe5f98e6 100644 --- a/upb/upb/reflection/internal/enum_def.h +++ b/upb/upb/reflection/internal/enum_def.h @@ -31,10 +31,10 @@ #ifndef UPB_REFLECTION_ENUM_DEF_INTERNAL_H_ #define UPB_REFLECTION_ENUM_DEF_INTERNAL_H_ -#include "upb/reflection/enum_def.h" +#include "upb/upb/reflection/enum_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -54,6 +54,6 @@ upb_EnumDef* _upb_EnumDefs_New( } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_ENUM_DEF_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/enum_reserved_range.h b/upb/upb/reflection/internal/enum_reserved_range.h index 8c78399810..6327714526 100644 --- a/upb/upb/reflection/internal/enum_reserved_range.h +++ b/upb/upb/reflection/internal/enum_reserved_range.h @@ -31,10 +31,10 @@ #ifndef UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_ #define UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_ -#include "upb/reflection/enum_reserved_range.h" +#include "upb/upb/reflection/enum_reserved_range.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -53,6 +53,6 @@ upb_EnumReservedRange* _upb_EnumReservedRanges_New( } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_ENUM_RESERVED_RANGE_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/enum_value_def.h b/upb/upb/reflection/internal/enum_value_def.h index 164a09289f..93da4250d0 100644 --- a/upb/upb/reflection/internal/enum_value_def.h +++ b/upb/upb/reflection/internal/enum_value_def.h @@ -31,10 +31,10 @@ #ifndef UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_ #define UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_ -#include "upb/reflection/enum_value_def.h" +#include "upb/upb/reflection/enum_value_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -55,6 +55,6 @@ const upb_EnumValueDef** _upb_EnumValueDefs_Sorted(const upb_EnumValueDef* v, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_ENUM_VALUE_DEF_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/extension_range.h b/upb/upb/reflection/internal/extension_range.h index 972ffe5c0c..b552d75415 100644 --- a/upb/upb/reflection/internal/extension_range.h +++ b/upb/upb/reflection/internal/extension_range.h @@ -31,10 +31,10 @@ #ifndef UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_ #define UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_ -#include "upb/reflection/extension_range.h" +#include "upb/upb/reflection/extension_range.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -52,6 +52,6 @@ upb_ExtensionRange* _upb_ExtensionRanges_New( } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_EXTENSION_RANGE_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/field_def.h b/upb/upb/reflection/internal/field_def.h index 38f074d37a..47711755cc 100644 --- a/upb/upb/reflection/internal/field_def.h +++ b/upb/upb/reflection/internal/field_def.h @@ -31,10 +31,10 @@ #ifndef UPB_REFLECTION_FIELD_DEF_INTERNAL_H_ #define UPB_REFLECTION_FIELD_DEF_INTERNAL_H_ -#include "upb/reflection/field_def.h" +#include "upb/upb/reflection/field_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -74,6 +74,6 @@ const upb_FieldDef** _upb_FieldDefs_Sorted(const upb_FieldDef* f, int n, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_FIELD_DEF_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/file_def.h b/upb/upb/reflection/internal/file_def.h index 05a2f90e08..c6602e32b8 100644 --- a/upb/upb/reflection/internal/file_def.h +++ b/upb/upb/reflection/internal/file_def.h @@ -31,10 +31,10 @@ #ifndef UPB_REFLECTION_FILE_DEF_INTERNAL_H_ #define UPB_REFLECTION_FILE_DEF_INTERNAL_H_ -#include "upb/reflection/file_def.h" +#include "upb/upb/reflection/file_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -55,6 +55,6 @@ void _upb_FileDef_Create(upb_DefBuilder* ctx, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_FILE_DEF_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/message_def.h b/upb/upb/reflection/internal/message_def.h index 711ff27046..894791b6fa 100644 --- a/upb/upb/reflection/internal/message_def.h +++ b/upb/upb/reflection/internal/message_def.h @@ -31,10 +31,10 @@ #ifndef UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_ #define UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_ -#include "upb/reflection/message_def.h" +#include "upb/upb/reflection/message_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -61,6 +61,6 @@ upb_MessageDef* _upb_MessageDefs_New( } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_MESSAGE_DEF_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/message_reserved_range.h b/upb/upb/reflection/internal/message_reserved_range.h index fa0ed4a3f9..5663f78a47 100644 --- a/upb/upb/reflection/internal/message_reserved_range.h +++ b/upb/upb/reflection/internal/message_reserved_range.h @@ -31,10 +31,10 @@ #ifndef UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_ #define UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_ -#include "upb/reflection/message_reserved_range.h" +#include "upb/upb/reflection/message_reserved_range.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -53,6 +53,6 @@ upb_MessageReservedRange* _upb_MessageReservedRanges_New( } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_MESSAGE_RESERVED_RANGE_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/method_def.h b/upb/upb/reflection/internal/method_def.h index b29b5fc30f..c7698fa69f 100644 --- a/upb/upb/reflection/internal/method_def.h +++ b/upb/upb/reflection/internal/method_def.h @@ -31,10 +31,10 @@ #ifndef UPB_REFLECTION_METHOD_DEF_INTERNAL_H_ #define UPB_REFLECTION_METHOD_DEF_INTERNAL_H_ -#include "upb/reflection/method_def.h" +#include "upb/upb/reflection/method_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -51,6 +51,6 @@ upb_MethodDef* _upb_MethodDefs_New( } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_METHOD_DEF_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/oneof_def.h b/upb/upb/reflection/internal/oneof_def.h index e4678aec56..92b97b316a 100644 --- a/upb/upb/reflection/internal/oneof_def.h +++ b/upb/upb/reflection/internal/oneof_def.h @@ -31,10 +31,10 @@ #ifndef UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_ #define UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_ -#include "upb/reflection/oneof_def.h" +#include "upb/upb/reflection/oneof_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -55,6 +55,6 @@ size_t _upb_OneofDefs_Finalize(upb_DefBuilder* ctx, upb_MessageDef* m); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_ONEOF_DEF_INTERNAL_H_ */ diff --git a/upb/upb/reflection/internal/service_def.h b/upb/upb/reflection/internal/service_def.h index 8cab160847..d68953eaea 100644 --- a/upb/upb/reflection/internal/service_def.h +++ b/upb/upb/reflection/internal/service_def.h @@ -31,10 +31,10 @@ #ifndef UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_ #define UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_ -#include "upb/reflection/service_def.h" +#include "upb/upb/reflection/service_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -51,6 +51,6 @@ upb_ServiceDef* _upb_ServiceDefs_New( } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_SERVICE_DEF_INTERNAL_H_ */ diff --git a/upb/upb/reflection/message.c b/upb/upb/reflection/message.c index 19944d8cfd..7e73b3095a 100644 --- a/upb/upb/reflection/message.c +++ b/upb/upb/reflection/message.c @@ -28,24 +28,24 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/reflection/message.h" +#include "upb/upb/reflection/message.h" #include -#include "upb/collections/map.h" -#include "upb/hash/common.h" -#include "upb/message/accessors.h" -#include "upb/message/message.h" -#include "upb/mini_table/field.h" -#include "upb/reflection/def.h" -#include "upb/reflection/def_pool.h" -#include "upb/reflection/def_type.h" -#include "upb/reflection/internal/field_def.h" -#include "upb/reflection/message_def.h" -#include "upb/reflection/oneof_def.h" +#include "upb/upb/collections/map.h" +#include "upb/upb/hash/common.h" +#include "upb/upb/message/accessors.h" +#include "upb/upb/message/message.h" +#include "upb/upb/mini_table/field.h" +#include "upb/upb/reflection/def.h" +#include "upb/upb/reflection/def_pool.h" +#include "upb/upb/reflection/def_type.h" +#include "upb/upb/reflection/internal/field_def.h" +#include "upb/upb/reflection/message_def.h" +#include "upb/upb/reflection/oneof_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" bool upb_Message_HasFieldByDef(const upb_Message* msg, const upb_FieldDef* f) { UPB_ASSERT(upb_FieldDef_HasPresence(f)); diff --git a/upb/upb/reflection/message.h b/upb/upb/reflection/message.h index 42abc345c6..f8ed7f71cd 100644 --- a/upb/upb/reflection/message.h +++ b/upb/upb/reflection/message.h @@ -31,11 +31,11 @@ #ifndef UPB_REFLECTION_MESSAGE_H_ #define UPB_REFLECTION_MESSAGE_H_ -#include "upb/collections/map.h" -#include "upb/reflection/common.h" +#include "upb/upb/collections/map.h" +#include "upb/upb/reflection/common.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -102,6 +102,6 @@ UPB_API bool upb_Message_DiscardUnknown(upb_Message* msg, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_MESSAGE_H_ */ diff --git a/upb/upb/reflection/message.hpp b/upb/upb/reflection/message.hpp index e5ab2a8bf0..106b806d25 100644 --- a/upb/upb/reflection/message.hpp +++ b/upb/upb/reflection/message.hpp @@ -31,7 +31,7 @@ #ifndef UPB_REFLECTION_MESSAGE_HPP_ #define UPB_REFLECTION_MESSAGE_HPP_ -#include "upb/reflection/message.h" +#include "upb/upb/reflection/message.h" namespace upb { diff --git a/upb/upb/reflection/message_def.c b/upb/upb/reflection/message_def.c index 211e597be3..0cde9a3121 100644 --- a/upb/upb/reflection/message_def.c +++ b/upb/upb/reflection/message_def.c @@ -28,25 +28,25 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/reflection/internal/message_def.h" +#include "upb/upb/reflection/internal/message_def.h" -#include "upb/hash/int_table.h" -#include "upb/hash/str_table.h" -#include "upb/mini_descriptor/decode.h" -#include "upb/mini_descriptor/internal/modifiers.h" -#include "upb/reflection/def.h" -#include "upb/reflection/def_type.h" -#include "upb/reflection/internal/def_builder.h" -#include "upb/reflection/internal/desc_state.h" -#include "upb/reflection/internal/enum_def.h" -#include "upb/reflection/internal/extension_range.h" -#include "upb/reflection/internal/field_def.h" -#include "upb/reflection/internal/file_def.h" -#include "upb/reflection/internal/message_reserved_range.h" -#include "upb/reflection/internal/oneof_def.h" +#include "upb/upb/hash/int_table.h" +#include "upb/upb/hash/str_table.h" +#include "upb/upb/mini_descriptor/decode.h" +#include "upb/upb/mini_descriptor/internal/modifiers.h" +#include "upb/upb/reflection/def.h" +#include "upb/upb/reflection/def_type.h" +#include "upb/upb/reflection/internal/def_builder.h" +#include "upb/upb/reflection/internal/desc_state.h" +#include "upb/upb/reflection/internal/enum_def.h" +#include "upb/upb/reflection/internal/extension_range.h" +#include "upb/upb/reflection/internal/field_def.h" +#include "upb/upb/reflection/internal/file_def.h" +#include "upb/upb/reflection/internal/message_reserved_range.h" +#include "upb/upb/reflection/internal/oneof_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" struct upb_MessageDef { const UPB_DESC(MessageOptions) * opts; diff --git a/upb/upb/reflection/message_def.h b/upb/upb/reflection/message_def.h index deb6d87f3e..1556df4755 100644 --- a/upb/upb/reflection/message_def.h +++ b/upb/upb/reflection/message_def.h @@ -28,16 +28,16 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// IWYU pragma: private, include "upb/reflection/def.h" +// IWYU pragma: private, include "upb/upb/reflection/def.h" #ifndef UPB_REFLECTION_MESSAGE_DEF_H_ #define UPB_REFLECTION_MESSAGE_DEF_H_ -#include "upb/base/string_view.h" -#include "upb/reflection/common.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/reflection/common.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" // Well-known field tag numbers for map-entry messages. #define kUpb_MapEntry_KeyFieldNumber 1 @@ -174,6 +174,6 @@ UPB_API upb_WellKnown upb_MessageDef_WellKnownType(const upb_MessageDef* m); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_MESSAGE_DEF_H_ */ diff --git a/upb/upb/reflection/message_reserved_range.c b/upb/upb/reflection/message_reserved_range.c index c39d8b997c..ec50be8e37 100644 --- a/upb/upb/reflection/message_reserved_range.c +++ b/upb/upb/reflection/message_reserved_range.c @@ -28,14 +28,14 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/reflection/enum_def.h" -#include "upb/reflection/field_def.h" -#include "upb/reflection/internal/def_builder.h" -#include "upb/reflection/internal/extension_range.h" -#include "upb/reflection/message_def.h" +#include "upb/upb/reflection/enum_def.h" +#include "upb/upb/reflection/field_def.h" +#include "upb/upb/reflection/internal/def_builder.h" +#include "upb/upb/reflection/internal/extension_range.h" +#include "upb/upb/reflection/message_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" struct upb_MessageReservedRange { int32_t start; diff --git a/upb/upb/reflection/message_reserved_range.h b/upb/upb/reflection/message_reserved_range.h index 6fa82d25f5..603dbd729a 100644 --- a/upb/upb/reflection/message_reserved_range.h +++ b/upb/upb/reflection/message_reserved_range.h @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// IWYU pragma: private, include "upb/reflection/def.h" +// IWYU pragma: private, include "upb/upb/reflection/def.h" #ifndef UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_ #define UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_ -#include "upb/reflection/common.h" +#include "upb/upb/reflection/common.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -49,6 +49,6 @@ int32_t upb_MessageReservedRange_End(const upb_MessageReservedRange* r); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_MESSAGE_RESERVED_RANGE_H_ */ diff --git a/upb/upb/reflection/method_def.c b/upb/upb/reflection/method_def.c index 9429c4b675..c74498df63 100644 --- a/upb/upb/reflection/method_def.c +++ b/upb/upb/reflection/method_def.c @@ -28,14 +28,14 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/reflection/internal/method_def.h" +#include "upb/upb/reflection/internal/method_def.h" -#include "upb/reflection/def_type.h" -#include "upb/reflection/internal/def_builder.h" -#include "upb/reflection/service_def.h" +#include "upb/upb/reflection/def_type.h" +#include "upb/upb/reflection/internal/def_builder.h" +#include "upb/upb/reflection/service_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" struct upb_MethodDef { const UPB_DESC(MethodOptions) * opts; diff --git a/upb/upb/reflection/method_def.h b/upb/upb/reflection/method_def.h index 34c5cffcd7..785cac1bf2 100644 --- a/upb/upb/reflection/method_def.h +++ b/upb/upb/reflection/method_def.h @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// IWYU pragma: private, include "upb/reflection/def.h" +// IWYU pragma: private, include "upb/upb/reflection/def.h" #ifndef UPB_REFLECTION_METHOD_DEF_H_ #define UPB_REFLECTION_METHOD_DEF_H_ -#include "upb/reflection/common.h" +#include "upb/upb/reflection/common.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -57,6 +57,6 @@ const upb_ServiceDef* upb_MethodDef_Service(const upb_MethodDef* m); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_METHOD_DEF_H_ */ diff --git a/upb/upb/reflection/oneof_def.c b/upb/upb/reflection/oneof_def.c index 0468fa9b29..7cfa07e705 100644 --- a/upb/upb/reflection/oneof_def.c +++ b/upb/upb/reflection/oneof_def.c @@ -28,21 +28,21 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/reflection/internal/oneof_def.h" +#include "upb/upb/reflection/internal/oneof_def.h" #include #include #include -#include "upb/hash/int_table.h" -#include "upb/hash/str_table.h" -#include "upb/reflection/def_type.h" -#include "upb/reflection/internal/def_builder.h" -#include "upb/reflection/internal/field_def.h" -#include "upb/reflection/internal/message_def.h" +#include "upb/upb/hash/int_table.h" +#include "upb/upb/hash/str_table.h" +#include "upb/upb/reflection/def_type.h" +#include "upb/upb/reflection/internal/def_builder.h" +#include "upb/upb/reflection/internal/field_def.h" +#include "upb/upb/reflection/internal/message_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" struct upb_OneofDef { const UPB_DESC(OneofOptions) * opts; diff --git a/upb/upb/reflection/oneof_def.h b/upb/upb/reflection/oneof_def.h index 9b570d3136..25d161f53f 100644 --- a/upb/upb/reflection/oneof_def.h +++ b/upb/upb/reflection/oneof_def.h @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// IWYU pragma: private, include "upb/reflection/def.h" +// IWYU pragma: private, include "upb/upb/reflection/def.h" #ifndef UPB_REFLECTION_ONEOF_DEF_H_ #define UPB_REFLECTION_ONEOF_DEF_H_ -#include "upb/reflection/common.h" +#include "upb/upb/reflection/common.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -65,6 +65,6 @@ const UPB_DESC(OneofOptions) * upb_OneofDef_Options(const upb_OneofDef* o); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_ONEOF_DEF_H_ */ diff --git a/upb/upb/reflection/service_def.c b/upb/upb/reflection/service_def.c index 658cf028d5..5307fb357b 100644 --- a/upb/upb/reflection/service_def.c +++ b/upb/upb/reflection/service_def.c @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/reflection/internal/service_def.h" +#include "upb/upb/reflection/internal/service_def.h" -#include "upb/reflection/def_type.h" -#include "upb/reflection/internal/def_builder.h" -#include "upb/reflection/internal/file_def.h" -#include "upb/reflection/internal/method_def.h" +#include "upb/upb/reflection/def_type.h" +#include "upb/upb/reflection/internal/def_builder.h" +#include "upb/upb/reflection/internal/file_def.h" +#include "upb/upb/reflection/internal/method_def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" struct upb_ServiceDef { const UPB_DESC(ServiceOptions) * opts; diff --git a/upb/upb/reflection/service_def.h b/upb/upb/reflection/service_def.h index 66749942bd..18e0daf391 100644 --- a/upb/upb/reflection/service_def.h +++ b/upb/upb/reflection/service_def.h @@ -28,15 +28,15 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// IWYU pragma: private, include "upb/reflection/def.h" +// IWYU pragma: private, include "upb/upb/reflection/def.h" #ifndef UPB_REFLECTION_SERVICE_DEF_H_ #define UPB_REFLECTION_SERVICE_DEF_H_ -#include "upb/reflection/common.h" +#include "upb/upb/reflection/common.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -58,6 +58,6 @@ const UPB_DESC(ServiceOptions) * } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_REFLECTION_SERVICE_DEF_H_ */ diff --git a/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.c b/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.c index 69b75f238c..3380070733 100644 --- a/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.c +++ b/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.c @@ -1,5 +1,5 @@ #include -#include "upb/generated_code_support.h" +#include "upb/upb/generated_code_support.h" #include "google/protobuf/descriptor.upb.h" static upb_Arena* upb_BootstrapArena() { diff --git a/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.h b/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.h index 510f54bc20..b593280c82 100644 --- a/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.h +++ b/upb/upb/reflection/stage0/google/protobuf/descriptor.upb.h @@ -9,9 +9,9 @@ #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ #define GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ -#include "upb/generated_code_support.h" +#include "upb/upb/generated_code_support.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -6508,6 +6508,6 @@ extern const upb_MiniTableFile google_protobuf_descriptor_proto_upb_file_layout; } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* GOOGLE_PROTOBUF_DESCRIPTOR_PROTO_UPB_H_ */ diff --git a/upb/upb/test/BUILD b/upb/upb/test/BUILD index bb95ba0983..59afb4e0a7 100644 --- a/upb/upb/test/BUILD +++ b/upb/upb/test/BUILD @@ -6,27 +6,27 @@ # https://developers.google.com/open-source/licenses/bsd load( - "//bazel:build_defs.bzl", + "//upb/bazel:build_defs.bzl", "UPB_DEFAULT_CPPOPTS", ) load( - "//bazel:upb_proto_library.bzl", + "//upb/bazel:upb_proto_library.bzl", "upb_proto_library", "upb_proto_reflection_library", ) # begin:google_only -# package(default_applicable_licenses = ["//:license"]) +# package(default_applicable_licenses = ["//upb:license"]) # end:google_only cc_library( name = "parse_text_proto", testonly = 1, hdrs = ["parse_text_proto.h"], - visibility = ["//:__subpackages__"], + visibility = ["//upb:__subpackages__"], deps = [ + "//:protobuf", "@com_google_googletest//:gtest", - "@com_google_protobuf//:protobuf", ], ) @@ -45,7 +45,7 @@ proto_library( name = "proto3_test_proto", testonly = 1, srcs = ["proto3_test.proto"], - deps = ["@com_google_protobuf//:descriptor_proto"], + deps = ["//:descriptor_proto"], ) upb_proto_library( @@ -69,14 +69,14 @@ proto_library( upb_proto_library( name = "test_upb_proto", testonly = 1, - visibility = ["//:__subpackages__"], + visibility = ["//upb:__subpackages__"], deps = [":test_proto"], ) proto_library( name = "test_cpp_proto", srcs = ["test_cpp.proto"], - deps = ["@com_google_protobuf//:timestamp_proto"], + deps = ["//:timestamp_proto"], ) upb_proto_library( @@ -92,25 +92,25 @@ upb_proto_reflection_library( upb_proto_library( name = "test_messages_proto2_upb_proto", testonly = 1, - visibility = ["//:__subpackages__"], - deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto2_proto"], + visibility = ["//upb:__subpackages__"], + deps = ["//src/google/protobuf:test_messages_proto2_proto"], ) upb_proto_library( name = "test_messages_proto3_upb_proto", testonly = 1, - visibility = ["//:__subpackages__"], - deps = ["@com_google_protobuf//src/google/protobuf:test_messages_proto3_proto"], + visibility = ["//upb:__subpackages__"], + deps = ["//src/google/protobuf:test_messages_proto3_proto"], ) upb_proto_library( name = "timestamp_upb_proto", - deps = ["@com_google_protobuf//:timestamp_proto"], + deps = ["//:timestamp_proto"], ) upb_proto_reflection_library( name = "timestamp_upb_proto_reflection", - deps = ["@com_google_protobuf//:timestamp_proto"], + deps = ["//:timestamp_proto"], ) cc_library( @@ -118,14 +118,14 @@ cc_library( testonly = 1, srcs = ["fuzz_util.cc"], hdrs = ["fuzz_util.h"], - visibility = ["//:__subpackages__"], + visibility = ["//upb:__subpackages__"], deps = [ - "//:base", - "//:message", - "//:mini_descriptor", - "//:mini_table", - "//:mini_table_internal", - "//:port", + "//upb:base", + "//upb:message", + "//upb:mini_descriptor", + "//upb:mini_table", + "//upb:mini_table_internal", + "//upb:port", ], ) @@ -136,7 +136,7 @@ cc_test( deps = [ ":proto3_test_upb_proto", ":proto3_test_upb_proto_reflection", - "//:reflection", + "//upb:reflection", "@com_google_googletest//:gtest_main", ], ) @@ -150,9 +150,9 @@ cc_test( ":test_cpp_upb_proto_reflection", ":timestamp_upb_proto", ":timestamp_upb_proto_reflection", - "//:json", - "//:port", - "//:reflection", + "//upb:json", + "//upb:port", + "//upb:reflection", "@com_google_googletest//:gtest_main", ], ) @@ -167,10 +167,10 @@ cc_test( ":test_messages_proto2_upb_proto", ":test_messages_proto3_upb_proto", ":test_upb_proto", - "//:base", - "//:collections", - "//:mem", - "//:port", + "//upb:base", + "//upb:collections", + "//upb:mem", + "//upb:port", "@com_google_googletest//:gtest_main", ], ) @@ -185,9 +185,9 @@ cc_test( ":test_messages_proto2_upb_proto", ":test_messages_proto3_upb_proto", ":test_upb_proto", - "//:mini_table", - "//:mini_table_internal", - "//:port", + "//upb:mini_table", + "//upb:mini_table_internal", + "//upb:port", "@com_google_googletest//:gtest_main", ], ) diff --git a/upb/upb/test/fuzz_util.cc b/upb/upb/test/fuzz_util.cc index f29aa7f6ae..fa3e083331 100644 --- a/upb/upb/test/fuzz_util.cc +++ b/upb/upb/test/fuzz_util.cc @@ -28,16 +28,16 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/test/fuzz_util.h" +#include "upb/upb/test/fuzz_util.h" -#include "upb/base/status.hpp" -#include "upb/message/message.h" -#include "upb/mini_descriptor/decode.h" -#include "upb/mini_table/extension.h" -#include "upb/mini_table/extension_registry.h" +#include "upb/upb/base/status.hpp" +#include "upb/upb/message/message.h" +#include "upb/upb/mini_descriptor/decode.h" +#include "upb/upb/mini_table/extension.h" +#include "upb/upb/mini_table/extension_registry.h" // Must be last -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" namespace upb { namespace fuzz { diff --git a/upb/upb/test/fuzz_util.h b/upb/upb/test/fuzz_util.h index c03d3761e3..8c8b32ac17 100644 --- a/upb/upb/test/fuzz_util.h +++ b/upb/upb/test/fuzz_util.h @@ -34,8 +34,8 @@ #include #include -#include "upb/mini_table/extension_registry.h" -// #include "upb/mini_table/types.h" +#include "upb/upb/mini_table/extension_registry.h" +// #include "upb/upb/mini_table/types.h" namespace upb { namespace fuzz { diff --git a/upb/upb/test/proto3_test.cc b/upb/upb/test/proto3_test.cc index 663da70ab0..4f84229f46 100644 --- a/upb/upb/test/proto3_test.cc +++ b/upb/upb/test/proto3_test.cc @@ -29,9 +29,9 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "gtest/gtest.h" -#include "upb/reflection/def.hpp" -#include "upb/test/proto3_test.upb.h" -#include "upb/test/proto3_test.upbdefs.h" +#include "upb/upb/reflection/def.hpp" +#include "upb/upb/test/proto3_test.upb.h" +#include "upb/upb/test/proto3_test.upbdefs.h" TEST(Proto3Test, SyntheticOneofExtension) { upb::DefPool defpool; diff --git a/upb/upb/test/test_cpp.cc b/upb/upb/test/test_cpp.cc index 2b7d939548..498e41808a 100644 --- a/upb/upb/test/test_cpp.cc +++ b/upb/upb/test/test_cpp.cc @@ -40,15 +40,15 @@ #include "google/protobuf/timestamp.upb.h" #include "google/protobuf/timestamp.upbdefs.h" #include "gtest/gtest.h" -#include "upb/json/decode.h" -#include "upb/json/encode.h" -#include "upb/reflection/def.h" -#include "upb/reflection/def.hpp" -#include "upb/test/test_cpp.upb.h" -#include "upb/test/test_cpp.upbdefs.h" +#include "upb/upb/json/decode.h" +#include "upb/upb/json/encode.h" +#include "upb/upb/reflection/def.h" +#include "upb/upb/reflection/def.hpp" +#include "upb/upb/test/test_cpp.upb.h" +#include "upb/upb/test/test_cpp.upbdefs.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" TEST(Cpp, Iteration) { upb::DefPool defpool; diff --git a/upb/upb/test/test_generated_code.cc b/upb/upb/test/test_generated_code.cc index 98c18253f1..5c6bc2f01d 100644 --- a/upb/upb/test/test_generated_code.cc +++ b/upb/upb/test/test_generated_code.cc @@ -39,14 +39,14 @@ #include "gtest/gtest.h" #include "google/protobuf/test_messages_proto2.upb.h" #include "google/protobuf/test_messages_proto3.upb.h" -#include "upb/base/status.h" -#include "upb/base/string_view.h" -#include "upb/collections/array.h" -#include "upb/mem/arena.hpp" -#include "upb/test/test.upb.h" +#include "upb/upb/base/status.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/collections/array.h" +#include "upb/upb/mem/arena.hpp" +#include "upb/upb/test/test.upb.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #if !defined(MIN) #define MIN(x, y) ((x) < (y) ? (x) : (y)) diff --git a/upb/upb/test/test_import_empty_srcs.cc b/upb/upb/test/test_import_empty_srcs.cc index 941e8d0c5b..d4a2a2abe5 100644 --- a/upb/upb/test/test_import_empty_srcs.cc +++ b/upb/upb/test/test_import_empty_srcs.cc @@ -29,7 +29,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "gtest/gtest.h" -#include "upb/test/test_import_empty_srcs.upb.h" +#include "upb/upb/test/test_import_empty_srcs.upb.h" TEST(Test, Reexport) { // This test really just ensures that compilation succeeds. diff --git a/upb/upb/test/test_import_empty_srcs.proto b/upb/upb/test/test_import_empty_srcs.proto index 78794e9308..40cd82ed68 100644 --- a/upb/upb/test/test_import_empty_srcs.proto +++ b/upb/upb/test/test_import_empty_srcs.proto @@ -32,8 +32,8 @@ syntax = "proto2"; package upb_test; -import "upb/test/test.proto"; -import "upb/test/test_cpp.proto"; +import "upb/upb/test/test.proto"; +import "upb/upb/test/test_cpp.proto"; message ContainsImported { optional MessageName message_name = 1; diff --git a/upb/upb/test/test_mini_table_oneof.cc b/upb/upb/test/test_mini_table_oneof.cc index f741d62db0..cb0be609ae 100644 --- a/upb/upb/test/test_mini_table_oneof.cc +++ b/upb/upb/test/test_mini_table_oneof.cc @@ -31,12 +31,12 @@ #include "gtest/gtest.h" #include "google/protobuf/test_messages_proto2.upb.h" #include "google/protobuf/test_messages_proto3.upb.h" -#include "upb/mini_table/field.h" -#include "upb/mini_table/message.h" -#include "upb/test/test.upb.h" +#include "upb/upb/mini_table/field.h" +#include "upb/upb/mini_table/message.h" +#include "upb/upb/test/test.upb.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" TEST(MiniTableOneofTest, OneOfIteratorProto2) { constexpr int oneof_first_field_number = 111; diff --git a/upb/upb/text/BUILD b/upb/upb/text/BUILD index 50539ea7c6..81ce07850c 100644 --- a/upb/upb/text/BUILD +++ b/upb/upb/text/BUILD @@ -5,7 +5,7 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") cc_library( name = "text", @@ -18,15 +18,15 @@ cc_library( copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], deps = [ - "//:collections", - "//:collections_internal", - "//:eps_copy_input_stream", - "//:lex", - "//:port", - "//:reflection", - "//:wire", - "//:wire_reader", - "//:wire_types", + "//upb:collections", + "//upb:collections_internal", + "//upb:eps_copy_input_stream", + "//upb:lex", + "//upb:port", + "//upb:reflection", + "//upb:wire", + "//upb:wire_reader", + "//upb:wire_types", ], ) @@ -40,8 +40,8 @@ filegroup( ], ), visibility = [ - "//cmake:__pkg__", - "//python/dist:__pkg__", + "//upb/cmake:__pkg__", + "//upb/python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/text/encode.c b/upb/upb/text/encode.c index 0e9fee786f..cbdb94e8bc 100644 --- a/upb/upb/text/encode.c +++ b/upb/upb/text/encode.c @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/text/encode.h" +#include "upb/upb/text/encode.h" #include #include @@ -36,17 +36,17 @@ #include #include -#include "upb/collections/internal/map_sorter.h" -#include "upb/collections/map.h" -#include "upb/lex/round_trip.h" -#include "upb/port/vsnprintf_compat.h" -#include "upb/reflection/message.h" -#include "upb/wire/eps_copy_input_stream.h" -#include "upb/wire/reader.h" -#include "upb/wire/types.h" +#include "upb/upb/collections/internal/map_sorter.h" +#include "upb/upb/collections/map.h" +#include "upb/upb/lex/round_trip.h" +#include "upb/upb/port/vsnprintf_compat.h" +#include "upb/upb/reflection/message.h" +#include "upb/upb/wire/eps_copy_input_stream.h" +#include "upb/upb/wire/reader.h" +#include "upb/upb/wire/types.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" typedef struct { char *buf, *ptr, *end; diff --git a/upb/upb/text/encode.h b/upb/upb/text/encode.h index 2c0bcd700e..b18d80386d 100644 --- a/upb/upb/text/encode.h +++ b/upb/upb/text/encode.h @@ -31,10 +31,10 @@ #ifndef UPB_TEXT_ENCODE_H_ #define UPB_TEXT_ENCODE_H_ -#include "upb/reflection/def.h" +#include "upb/upb/reflection/def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -67,6 +67,6 @@ size_t upb_TextEncode(const upb_Message* msg, const upb_MessageDef* m, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_TEXT_ENCODE_H_ */ diff --git a/upb/upb/upb.hpp b/upb/upb/upb.hpp index 3ee4b637a5..0f3ea9ae1f 100644 --- a/upb/upb/upb.hpp +++ b/upb/upb/upb.hpp @@ -34,8 +34,8 @@ #define UPB_HPP_ // IWYU pragma: begin_exports -#include "upb/base/status.hpp" -#include "upb/mem/arena.hpp" +#include "upb/upb/base/status.hpp" +#include "upb/upb/mem/arena.hpp" // IWYU pragma: end_exports #endif // UPB_HPP_ diff --git a/upb/upb/upb_so.c b/upb/upb/upb_so.c index fd7fb87359..a751ba73d0 100644 --- a/upb/upb/upb_so.c +++ b/upb/upb/upb_so.c @@ -30,8 +30,8 @@ // These headers form a spanning tree for the upb defs needed by FFI layers. -#include "upb/collections/array_split64.h" -#include "upb/collections/map.h" -#include "upb/message/accessors_split64.h" -#include "upb/message/message.h" -#include "upb/mini_descriptor/decode.h" +#include "upb/upb/collections/array_split64.h" +#include "upb/upb/collections/map.h" +#include "upb/upb/message/accessors_split64.h" +#include "upb/upb/message/message.h" +#include "upb/upb/mini_descriptor/decode.h" diff --git a/upb/upb/util/BUILD b/upb/upb/util/BUILD index 201a035edc..dc9f4eca2f 100644 --- a/upb/upb/util/BUILD +++ b/upb/upb/util/BUILD @@ -1,11 +1,11 @@ load( - "//bazel:upb_proto_library.bzl", + "//upb/bazel:upb_proto_library.bzl", "upb_proto_library", "upb_proto_reflection_library", ) # begin:google_only -# package(default_applicable_licenses = ["//:license"]) +# package(default_applicable_licenses = ["//upb:license"]) # end:google_only licenses(["notice"]) @@ -18,9 +18,9 @@ cc_library( hdrs = ["def_to_proto.h"], visibility = ["//visibility:public"], deps = [ - "//:port", - "//:reflection", - "//:reflection_internal", + "//upb:port", + "//upb:reflection", + "//upb:reflection_internal", ], ) @@ -49,12 +49,12 @@ cc_library( hdrs = ["def_to_proto_test.h"], deps = [ ":def_to_proto", - "//:base", - "//:descriptor_upb_proto", - "//:mem", - "//:reflection_internal", + "//:protobuf", + "//upb:base", + "//upb:descriptor_upb_proto", + "//upb:mem", + "//upb:reflection_internal", "@com_google_googletest//:gtest", - "@com_google_protobuf//:protobuf", ], ) @@ -66,13 +66,13 @@ cc_test( ":def_to_proto_test_lib", ":def_to_proto_test_upb_proto", ":def_to_proto_test_upb_proto_reflection", - "//:descriptor_upb_proto_reflection", - "//:mem", - "//:reflection", - "//upb/test:parse_text_proto", + "//:protobuf", + "//upb:descriptor_upb_proto_reflection", + "//upb:mem", + "//upb:reflection", + "//upb/upb/test:parse_text_proto", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", - "@com_google_protobuf//:protobuf", ], ) @@ -97,9 +97,9 @@ cc_library( hdrs = ["required_fields.h"], visibility = ["//visibility:public"], deps = [ - "//:collections", - "//:port", - "//:reflection", + "//upb:collections", + "//upb:port", + "//upb:reflection", ], ) @@ -125,10 +125,10 @@ cc_test( ":required_fields", ":required_fields_test_upb_proto", ":required_fields_test_upb_proto_reflection", - "//:base", - "//:json", - "//:mem", - "//:reflection", + "//upb:base", + "//upb:json", + "//upb:mem", + "//upb:reflection", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", ], @@ -142,11 +142,11 @@ cc_library( hdrs = ["compare.h"], visibility = ["//visibility:public"], deps = [ - "//:base", - "//:eps_copy_input_stream", - "//:port", - "//:wire_reader", - "//:wire_types", + "//upb:base", + "//upb:eps_copy_input_stream", + "//upb:port", + "//upb:wire_reader", + "//upb:wire_types", ], ) @@ -155,8 +155,8 @@ cc_test( srcs = ["compare_test.cc"], deps = [ ":compare", - "//:wire_internal", - "//:wire_types", + "//upb:wire_internal", + "//upb:wire_types", "@com_google_absl//absl/strings", "@com_google_googletest//:gtest_main", ], @@ -173,6 +173,6 @@ filegroup( "required_fields.c", "required_fields.h", ], - visibility = ["//python/dist:__pkg__"], + visibility = ["//upb/python/dist:__pkg__"], ) # end:github_only diff --git a/upb/upb/util/compare.c b/upb/upb/util/compare.c index b96b94d532..b11874d388 100644 --- a/upb/upb/util/compare.c +++ b/upb/upb/util/compare.c @@ -28,16 +28,16 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/util/compare.h" +#include "upb/upb/util/compare.h" #include -#include "upb/base/string_view.h" -#include "upb/wire/eps_copy_input_stream.h" -#include "upb/wire/reader.h" -#include "upb/wire/types.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/wire/eps_copy_input_stream.h" +#include "upb/upb/wire/reader.h" +#include "upb/upb/wire/types.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" struct upb_UnknownFields; typedef struct upb_UnknownFields upb_UnknownFields; diff --git a/upb/upb/util/compare_test.cc b/upb/upb/util/compare_test.cc index 4a37412781..57ed02ccb6 100644 --- a/upb/upb/util/compare_test.cc +++ b/upb/upb/util/compare_test.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/util/compare.h" +#include "upb/upb/util/compare.h" #include @@ -38,8 +38,8 @@ #include #include "gtest/gtest.h" -#include "upb/wire/internal/swap.h" -#include "upb/wire/types.h" +#include "upb/upb/wire/internal/swap.h" +#include "upb/upb/wire/types.h" struct UnknownField; diff --git a/upb/upb/util/def_to_proto.c b/upb/upb/util/def_to_proto.c index d564325a51..842a9c8017 100644 --- a/upb/upb/util/def_to_proto.c +++ b/upb/upb/util/def_to_proto.c @@ -28,21 +28,21 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/util/def_to_proto.h" +#include "upb/upb/util/def_to_proto.h" #include #include -#include "upb/port/vsnprintf_compat.h" -#include "upb/reflection/enum_reserved_range.h" -#include "upb/reflection/extension_range.h" -#include "upb/reflection/internal/field_def.h" -#include "upb/reflection/internal/file_def.h" -#include "upb/reflection/message.h" -#include "upb/reflection/message_reserved_range.h" +#include "upb/upb/port/vsnprintf_compat.h" +#include "upb/upb/reflection/enum_reserved_range.h" +#include "upb/upb/reflection/extension_range.h" +#include "upb/upb/reflection/internal/field_def.h" +#include "upb/upb/reflection/internal/file_def.h" +#include "upb/upb/reflection/message.h" +#include "upb/upb/reflection/message_reserved_range.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" typedef struct { upb_Arena* arena; diff --git a/upb/upb/util/def_to_proto.h b/upb/upb/util/def_to_proto.h index ba41db56c0..c5a54ca1d2 100644 --- a/upb/upb/util/def_to_proto.h +++ b/upb/upb/util/def_to_proto.h @@ -31,7 +31,7 @@ #ifndef UPB_UTIL_DEF_TO_PROTO_H_ #define UPB_UTIL_DEF_TO_PROTO_H_ -#include "upb/reflection/def.h" +#include "upb/upb/reflection/def.h" #ifdef __cplusplus extern "C" { diff --git a/upb/upb/util/def_to_proto_fuzz_test.cc b/upb/upb/util/def_to_proto_fuzz_test.cc index 833bcc6d83..0c5c9ed51d 100644 --- a/upb/upb/util/def_to_proto_fuzz_test.cc +++ b/upb/upb/util/def_to_proto_fuzz_test.cc @@ -33,7 +33,7 @@ #include "google/protobuf/descriptor.proto.h" #include "gtest/gtest.h" #include "testing/fuzzing/fuzztest.h" -#include "upb/util/def_to_proto_test.h" +#include "upb/upb/util/def_to_proto_test.h" namespace upb_test { diff --git a/upb/upb/util/def_to_proto_test.cc b/upb/upb/util/def_to_proto_test.cc index 57287ce921..ee2df3a2e1 100644 --- a/upb/upb/util/def_to_proto_test.cc +++ b/upb/upb/util/def_to_proto_test.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/util/def_to_proto.h" +#include "upb/upb/util/def_to_proto.h" #include #include @@ -39,11 +39,11 @@ #include "gtest/gtest.h" #include "google/protobuf/dynamic_message.h" #include "google/protobuf/util/message_differencer.h" -#include "upb/mem/arena.hpp" -#include "upb/reflection/def.hpp" -#include "upb/test/parse_text_proto.h" -#include "upb/util/def_to_proto_test.h" -#include "upb/util/def_to_proto_test.upbdefs.h" +#include "upb/upb/mem/arena.hpp" +#include "upb/upb/reflection/def.hpp" +#include "upb/upb/test/parse_text_proto.h" +#include "upb/upb/util/def_to_proto_test.h" +#include "upb/upb/util/def_to_proto_test.upbdefs.h" namespace upb_test { @@ -129,7 +129,7 @@ TEST(DefToProto, Test) { upb::Arena arena; upb::DefPool defpool; upb_StringView test_file_desc = - upb_util_def_to_proto_test_proto_upbdefinit.descriptor; + upb_upb_util_def_to_proto_test_proto_upbdefinit.descriptor; const auto* file_desc = google_protobuf_FileDescriptorProto_parse( test_file_desc.data, test_file_desc.size, arena.ptr()); @@ -143,15 +143,15 @@ TEST(DefToProto, TestRuntimeReflection) { upb::Arena arena; upb::DefPool defpool; upb_StringView test_file_desc = - upb_util_def_to_proto_test_proto_upbdefinit.descriptor; + upb_upb_util_def_to_proto_test_proto_upbdefinit.descriptor; const auto* file_desc = google_protobuf_FileDescriptorProto_parse( test_file_desc.data, test_file_desc.size, arena.ptr()); _upb_DefPool_LoadDefInitEx( defpool.ptr(), - &upb_util_def_to_proto_test_proto_upbdefinit, true); + &upb_upb_util_def_to_proto_test_proto_upbdefinit, true); upb::FileDefPtr file = defpool.FindFileByName( - upb_util_def_to_proto_test_proto_upbdefinit.filename); + upb_upb_util_def_to_proto_test_proto_upbdefinit.filename); CheckFile(file, file_desc); } diff --git a/upb/upb/util/def_to_proto_test.h b/upb/upb/util/def_to_proto_test.h index b006336a4f..f1f90e8374 100644 --- a/upb/upb/util/def_to_proto_test.h +++ b/upb/upb/util/def_to_proto_test.h @@ -40,10 +40,10 @@ #include "google/protobuf/descriptor.h" #include "google/protobuf/dynamic_message.h" #include "google/protobuf/util/field_comparator.h" -#include "upb/base/status.hpp" -#include "upb/mem/arena.hpp" -#include "upb/reflection/def.hpp" -#include "upb/util/def_to_proto.h" +#include "upb/upb/base/status.hpp" +#include "upb/upb/mem/arena.hpp" +#include "upb/upb/reflection/def.hpp" +#include "upb/upb/util/def_to_proto.h" namespace upb_test { diff --git a/upb/upb/util/def_to_proto_test.proto b/upb/upb/util/def_to_proto_test.proto index 65a76b0b9c..bbecafa002 100644 --- a/upb/upb/util/def_to_proto_test.proto +++ b/upb/upb/util/def_to_proto_test.proto @@ -32,9 +32,9 @@ syntax = "proto2"; package pkg; -import public "upb/util/def_to_proto_public_import_test.proto"; +import public "upb/upb/util/def_to_proto_public_import_test.proto"; -import "upb/util/def_to_proto_regular_import_test.proto"; +import "upb/upb/util/def_to_proto_regular_import_test.proto"; option optimize_for = CODE_SIZE; option go_package = "foo_go_package"; diff --git a/upb/upb/util/required_fields.c b/upb/upb/util/required_fields.c index 3a6e037a2e..15815e16f7 100644 --- a/upb/upb/util/required_fields.c +++ b/upb/upb/util/required_fields.c @@ -28,17 +28,17 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/util/required_fields.h" +#include "upb/upb/util/required_fields.h" #include #include -#include "upb/collections/map.h" -#include "upb/port/vsnprintf_compat.h" -#include "upb/reflection/message.h" +#include "upb/upb/collections/map.h" +#include "upb/upb/port/vsnprintf_compat.h" +#include "upb/upb/reflection/message.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" //////////////////////////////////////////////////////////////////////////////// // upb_FieldPath_ToText() diff --git a/upb/upb/util/required_fields.h b/upb/upb/util/required_fields.h index 68e4fcb18d..c7aa5d537c 100644 --- a/upb/upb/util/required_fields.h +++ b/upb/upb/util/required_fields.h @@ -31,11 +31,11 @@ #ifndef UPB_UTIL_REQUIRED_FIELDS_H_ #define UPB_UTIL_REQUIRED_FIELDS_H_ -#include "upb/reflection/def.h" -#include "upb/reflection/message.h" +#include "upb/upb/reflection/def.h" +#include "upb/upb/reflection/message.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -92,6 +92,6 @@ bool upb_util_HasUnsetRequired(const upb_Message* msg, const upb_MessageDef* m, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_UTIL_REQUIRED_FIELDS_H_ */ diff --git a/upb/upb/util/required_fields_test.cc b/upb/upb/util/required_fields_test.cc index 6bdd094f89..39555bd93b 100644 --- a/upb/upb/util/required_fields_test.cc +++ b/upb/upb/util/required_fields_test.cc @@ -28,19 +28,19 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/util/required_fields.h" +#include "upb/upb/util/required_fields.h" #include #include "gmock/gmock.h" #include "gtest/gtest.h" #include "absl/strings/string_view.h" -#include "upb/base/status.hpp" -#include "upb/json/decode.h" -#include "upb/mem/arena.hpp" -#include "upb/reflection/def.hpp" -#include "upb/util/required_fields_test.upb.h" -#include "upb/util/required_fields_test.upbdefs.h" +#include "upb/upb/base/status.hpp" +#include "upb/upb/json/decode.h" +#include "upb/upb/mem/arena.hpp" +#include "upb/upb/reflection/def.hpp" +#include "upb/upb/util/required_fields_test.upb.h" +#include "upb/upb/util/required_fields_test.upbdefs.h" std::vector PathsToText(upb_FieldPathEntry* entry) { std::vector ret; diff --git a/upb/upb/wire/BUILD b/upb/upb/wire/BUILD index 3e88ba0b6a..cfa1fd61f9 100644 --- a/upb/upb/wire/BUILD +++ b/upb/upb/wire/BUILD @@ -5,7 +5,7 @@ # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd -load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") +load("//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") cc_library( name = "wire", @@ -20,10 +20,10 @@ cc_library( deps = [ ":internal", ":types", - "//:mem", - "//:message", - "//:mini_table", - "//:port", + "//upb:mem", + "//upb:message", + "//upb:mini_table", + "//upb:port", ], ) @@ -48,16 +48,16 @@ cc_library( ":eps_copy_input_stream", ":reader", ":types", - "//:base", - "//:collections_internal", - "//:mem", - "//:mem_internal", - "//:message", - "//:message_accessors_internal", - "//:message_internal", - "//:message_internal_types", - "//:mini_table", - "//:port", + "//upb:base", + "//upb:collections_internal", + "//upb:mem", + "//upb:mem_internal", + "//upb:message", + "//upb:message_accessors_internal", + "//upb:message_internal", + "//upb:message_internal_types", + "//upb:mini_table", + "//upb:port", "@utf8_range", ], ) @@ -73,7 +73,7 @@ cc_library( deps = [ ":eps_copy_input_stream", ":types", - "//:port", + "//upb:port", ], ) @@ -89,8 +89,8 @@ cc_library( hdrs = ["eps_copy_input_stream.h"], visibility = ["//visibility:public"], deps = [ - "//:mem", - "//:port", + "//upb:mem", + "//upb:port", ], ) @@ -99,7 +99,7 @@ cc_test( srcs = ["eps_copy_input_stream_test.cc"], deps = [ ":eps_copy_input_stream", - "//:mem", + "//upb:mem", "@com_google_googletest//:gtest_main", ], ) @@ -114,8 +114,8 @@ filegroup( ], ), visibility = [ - "//cmake:__pkg__", - "//python/dist:__pkg__", + "//upb/cmake:__pkg__", + "//upb/python/dist:__pkg__", ] ) # end:github_only diff --git a/upb/upb/wire/decode.c b/upb/upb/wire/decode.c index 91a0ff9965..9ff0ed4fe2 100644 --- a/upb/upb/wire/decode.c +++ b/upb/upb/wire/decode.c @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/wire/decode.h" +#include "upb/upb/wire/decode.h" #include #include @@ -36,23 +36,23 @@ #include #include -#include "upb/base/descriptor_constants.h" -#include "upb/collections/internal/array.h" -#include "upb/collections/internal/map.h" -#include "upb/collections/internal/map_entry.h" -#include "upb/mem/internal/arena.h" -#include "upb/message/internal/accessors.h" -#include "upb/mini_table/sub.h" -#include "upb/port/atomic.h" -#include "upb/wire/encode.h" -#include "upb/wire/eps_copy_input_stream.h" -#include "upb/wire/internal/common.h" -#include "upb/wire/internal/decode.h" -#include "upb/wire/internal/swap.h" -#include "upb/wire/reader.h" +#include "upb/upb/base/descriptor_constants.h" +#include "upb/upb/collections/internal/array.h" +#include "upb/upb/collections/internal/map.h" +#include "upb/upb/collections/internal/map_entry.h" +#include "upb/upb/mem/internal/arena.h" +#include "upb/upb/message/internal/accessors.h" +#include "upb/upb/mini_table/sub.h" +#include "upb/upb/port/atomic.h" +#include "upb/upb/wire/encode.h" +#include "upb/upb/wire/eps_copy_input_stream.h" +#include "upb/upb/wire/internal/common.h" +#include "upb/upb/wire/internal/decode.h" +#include "upb/upb/wire/internal/swap.h" +#include "upb/upb/wire/reader.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" // A few fake field types for our tables. enum { diff --git a/upb/upb/wire/decode.h b/upb/upb/wire/decode.h index 4bd6eb872e..e261ab57e7 100644 --- a/upb/upb/wire/decode.h +++ b/upb/upb/wire/decode.h @@ -33,13 +33,13 @@ #ifndef UPB_WIRE_DECODE_H_ #define UPB_WIRE_DECODE_H_ -#include "upb/mem/arena.h" -#include "upb/message/message.h" -#include "upb/mini_table/extension_registry.h" -#include "upb/wire/types.h" +#include "upb/upb/mem/arena.h" +#include "upb/upb/message/message.h" +#include "upb/upb/mini_table/extension_registry.h" +#include "upb/upb/wire/types.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -147,6 +147,6 @@ UPB_API upb_DecodeStatus upb_Decode(const char* buf, size_t size, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_WIRE_DECODE_H_ */ diff --git a/upb/upb/wire/decode_fast.c b/upb/upb/wire/decode_fast.c index 663b053d3e..0889aec703 100644 --- a/upb/upb/wire/decode_fast.c +++ b/upb/upb/wire/decode_fast.c @@ -38,14 +38,14 @@ // field type (eg. oneof boolean field with a 1 byte tag) and then dispatch // to the specialized function as quickly as possible. -#include "upb/wire/decode_fast.h" +#include "upb/upb/wire/decode_fast.h" -#include "upb/collections/internal/array.h" -#include "upb/message/internal/types.h" -#include "upb/wire/internal/decode.h" +#include "upb/upb/collections/internal/array.h" +#include "upb/upb/message/internal/types.h" +#include "upb/upb/wire/internal/decode.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #if UPB_FASTTABLE diff --git a/upb/upb/wire/decode_fast.h b/upb/upb/wire/decode_fast.h index cc494d4234..aef839a40b 100644 --- a/upb/upb/wire/decode_fast.h +++ b/upb/upb/wire/decode_fast.h @@ -65,10 +65,10 @@ #ifndef UPB_WIRE_DECODE_FAST_H_ #define UPB_WIRE_DECODE_FAST_H_ -#include "upb/message/message.h" +#include "upb/upb/message/message.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -165,6 +165,6 @@ TAGBYTES(r) } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_WIRE_DECODE_FAST_H_ */ diff --git a/upb/upb/wire/encode.c b/upb/upb/wire/encode.c index 82429ddd19..982a549300 100644 --- a/upb/upb/wire/encode.c +++ b/upb/upb/wire/encode.c @@ -30,20 +30,20 @@ // We encode backwards, to avoid pre-computing lengths (one-pass encode). -#include "upb/wire/encode.h" +#include "upb/upb/wire/encode.h" #include -#include "upb/collections/internal/array.h" -#include "upb/collections/internal/map_sorter.h" -#include "upb/message/internal/accessors.h" -#include "upb/message/internal/extension.h" -#include "upb/mini_table/sub.h" -#include "upb/wire/internal/common.h" -#include "upb/wire/internal/swap.h" +#include "upb/upb/collections/internal/array.h" +#include "upb/upb/collections/internal/map_sorter.h" +#include "upb/upb/message/internal/accessors.h" +#include "upb/upb/message/internal/extension.h" +#include "upb/upb/mini_table/sub.h" +#include "upb/upb/wire/internal/common.h" +#include "upb/upb/wire/internal/swap.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #define UPB_PB_VARINT_MAX_LEN 10 diff --git a/upb/upb/wire/encode.h b/upb/upb/wire/encode.h index 8212b8760a..41a2617ac4 100644 --- a/upb/upb/wire/encode.h +++ b/upb/upb/wire/encode.h @@ -33,11 +33,11 @@ #ifndef UPB_WIRE_ENCODE_H_ #define UPB_WIRE_ENCODE_H_ -#include "upb/message/message.h" -#include "upb/wire/types.h" +#include "upb/upb/message/message.h" +#include "upb/upb/wire/types.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -91,6 +91,6 @@ UPB_API upb_EncodeStatus upb_Encode(const void* msg, const upb_MiniTable* l, } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_WIRE_ENCODE_H_ */ diff --git a/upb/upb/wire/eps_copy_input_stream.c b/upb/upb/wire/eps_copy_input_stream.c index b46a50d4ef..053c663157 100644 --- a/upb/upb/wire/eps_copy_input_stream.c +++ b/upb/upb/wire/eps_copy_input_stream.c @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/wire/eps_copy_input_stream.h" +#include "upb/upb/wire/eps_copy_input_stream.h" static const char* _upb_EpsCopyInputStream_NoOpCallback( upb_EpsCopyInputStream* e, const char* old_end, const char* new_start) { diff --git a/upb/upb/wire/eps_copy_input_stream.h b/upb/upb/wire/eps_copy_input_stream.h index 515b9bb6a2..b42c10143c 100644 --- a/upb/upb/wire/eps_copy_input_stream.h +++ b/upb/upb/wire/eps_copy_input_stream.h @@ -33,10 +33,10 @@ #include -#include "upb/mem/arena.h" +#include "upb/upb/mem/arena.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -423,6 +423,6 @@ static UPB_FORCEINLINE bool upb_EpsCopyInputStream_TryParseDelimitedFast( } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPB_WIRE_EPS_COPY_INPUT_STREAM_H_ diff --git a/upb/upb/wire/eps_copy_input_stream_test.cc b/upb/upb/wire/eps_copy_input_stream_test.cc index 688e0762be..9ca757c210 100644 --- a/upb/upb/wire/eps_copy_input_stream_test.cc +++ b/upb/upb/wire/eps_copy_input_stream_test.cc @@ -28,14 +28,14 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/wire/eps_copy_input_stream.h" +#include "upb/upb/wire/eps_copy_input_stream.h" #include #include #include "gtest/gtest.h" -#include "upb/mem/arena.hpp" +#include "upb/upb/mem/arena.hpp" // begin:google_only // #include "testing/fuzzing/fuzztest.h" // end:google_only diff --git a/upb/upb/wire/internal/common.h b/upb/upb/wire/internal/common.h index bb9cf4283e..5deb0fe7c7 100644 --- a/upb/upb/wire/internal/common.h +++ b/upb/upb/wire/internal/common.h @@ -32,7 +32,7 @@ #define UPB_WIRE_INTERNAL_COMMON_H_ // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" // MessageSet wire format is: // message MessageSet { @@ -48,6 +48,6 @@ enum { kUpb_MsgSet_Message = 3, }; -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_WIRE_INTERNAL_COMMON_H_ */ diff --git a/upb/upb/wire/internal/decode.h b/upb/upb/wire/internal/decode.h index aa3d1b3304..bf842f075a 100644 --- a/upb/upb/wire/internal/decode.h +++ b/upb/upb/wire/internal/decode.h @@ -36,14 +36,14 @@ #ifndef UPB_WIRE_INTERNAL_DECODE_H_ #define UPB_WIRE_INTERNAL_DECODE_H_ -#include "upb/mem/internal/arena.h" -#include "upb/message/internal/message.h" -#include "upb/wire/decode.h" -#include "upb/wire/eps_copy_input_stream.h" +#include "upb/upb/mem/internal/arena.h" +#include "upb/upb/message/internal/message.h" +#include "upb/upb/wire/decode.h" +#include "upb/upb/wire/eps_copy_input_stream.h" #include "utf8_range.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #define DECODE_NOGROUP (uint32_t) - 1 @@ -161,6 +161,6 @@ UPB_INLINE uint32_t _upb_FastDecoder_LoadTag(const char* ptr) { return tag; } -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_WIRE_INTERNAL_DECODE_H_ */ diff --git a/upb/upb/wire/internal/swap.h b/upb/upb/wire/internal/swap.h index 9d9e780c37..d25eed5279 100644 --- a/upb/upb/wire/internal/swap.h +++ b/upb/upb/wire/internal/swap.h @@ -34,7 +34,7 @@ #include // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -63,6 +63,6 @@ UPB_INLINE uint64_t _upb_BigEndian_Swap64(uint64_t val) { } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPB_WIRE_INTERNAL_SWAP_H_ */ diff --git a/upb/upb/wire/reader.c b/upb/upb/wire/reader.c index 92a7b5b1ce..e2f1402a30 100644 --- a/upb/upb/wire/reader.c +++ b/upb/upb/wire/reader.c @@ -28,13 +28,13 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upb/wire/reader.h" +#include "upb/upb/wire/reader.h" -#include "upb/wire/eps_copy_input_stream.h" -#include "upb/wire/types.h" +#include "upb/upb/wire/eps_copy_input_stream.h" +#include "upb/upb/wire/types.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" UPB_NOINLINE _upb_WireReader_ReadLongVarintRet _upb_WireReader_ReadLongVarint(const char* ptr, uint64_t val) { diff --git a/upb/upb/wire/reader.h b/upb/upb/wire/reader.h index e5663db32c..862fed2fd7 100644 --- a/upb/upb/wire/reader.h +++ b/upb/upb/wire/reader.h @@ -31,12 +31,12 @@ #ifndef UPB_WIRE_READER_H_ #define UPB_WIRE_READER_H_ -#include "upb/wire/eps_copy_input_stream.h" -#include "upb/wire/internal/swap.h" -#include "upb/wire/types.h" +#include "upb/upb/wire/eps_copy_input_stream.h" +#include "upb/upb/wire/internal/swap.h" +#include "upb/upb/wire/types.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -225,6 +225,6 @@ UPB_INLINE const char* upb_WireReader_SkipValue( } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPB_WIRE_READER_H_ diff --git a/upb/upbc/BUILD b/upb/upbc/BUILD index ea9d9c0f18..da2e4df7b7 100644 --- a/upb/upbc/BUILD +++ b/upb/upbc/BUILD @@ -6,24 +6,24 @@ # https://developers.google.com/open-source/licenses/bsd load( - "//bazel:build_defs.bzl", + "//upb/bazel:build_defs.bzl", "UPB_DEFAULT_COPTS", "UPB_DEFAULT_CPPOPTS", ) load( - "//bazel:upb_proto_library.bzl", + "//upb/bazel:upb_proto_library.bzl", "upb_proto_library", "upb_proto_reflection_library", ) load( - "//upbc:bootstrap_compiler.bzl", + "//upb/upbc:bootstrap_compiler.bzl", "bootstrap_cc_binary", "bootstrap_cc_library", "bootstrap_upb_proto_library", ) # begin:google_only -# package(default_applicable_licenses = ["//:license"]) +# package(default_applicable_licenses = ["//upb:license"]) # end:google_only licenses(["notice"]) @@ -31,19 +31,19 @@ licenses(["notice"]) proto_library( name = "code_generator_request", srcs = ["code_generator_request.proto"], - visibility = ["//:friends"], - deps = ["@com_google_protobuf//:compiler_plugin_proto"], + visibility = ["//upb:friends"], + deps = ["//:compiler_plugin_proto"], ) upb_proto_library( name = "code_generator_request_upb_proto", - visibility = ["//:friends"], + visibility = ["//upb:friends"], deps = [":code_generator_request"], ) upb_proto_reflection_library( name = "code_generator_request_upb_proto_reflection", - visibility = ["//:friends"], + visibility = ["//upb:friends"], deps = [":code_generator_request"], ) @@ -63,19 +63,19 @@ bootstrap_upb_proto_library( ], oss_src_files = ["google/protobuf/compiler/plugin.proto"], oss_src_rules = [ - "@com_google_protobuf//:descriptor_proto_srcs", - "@com_google_protobuf//src/google/protobuf/compiler:plugin_proto_src", + "//:descriptor_proto_srcs", + "//src/google/protobuf/compiler:plugin_proto_src", ], oss_strip_prefix = "third_party/protobuf/github/bootstrap/src", - proto_lib_deps = ["@com_google_protobuf//:compiler_plugin_proto"], - visibility = ["//:friends"], - deps = ["//:descriptor_upb_proto"], + proto_lib_deps = ["//:compiler_plugin_proto"], + visibility = ["//upb:friends"], + deps = ["//upb:descriptor_upb_proto"], ) upb_proto_reflection_library( name = "plugin_upb_proto_reflection", - visibility = ["//:friends"], - deps = ["@com_google_protobuf//:compiler_plugin_proto"], + visibility = ["//upb:friends"], + deps = ["//:compiler_plugin_proto"], ) bootstrap_cc_library( @@ -87,10 +87,10 @@ bootstrap_cc_library( "common.h", ], bootstrap_deps = [ - "//:reflection", + "//upb:reflection", ], copts = UPB_DEFAULT_CPPOPTS, - visibility = ["//protos_generator:__pkg__"], + visibility = ["//upb/protos_generator:__pkg__"], deps = [ "@com_google_absl//absl/strings", ], @@ -106,17 +106,17 @@ bootstrap_cc_library( ], bootstrap_deps = [ ":common", - "//:reflection", - "//:descriptor_upb_proto", + "//upb:reflection", + "//upb:descriptor_upb_proto", ], copts = UPB_DEFAULT_CPPOPTS, - visibility = ["//protos_generator:__pkg__"], + visibility = ["//upb/protos_generator:__pkg__"], deps = [ - "//:base", - "//:mini_descriptor", - "//:mini_table", - "//:mini_table_internal", - "//:port", + "//upb:base", + "//upb:mini_descriptor", + "//upb:mini_table", + "//upb:mini_table_internal", + "//upb:port", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/strings", ], @@ -131,7 +131,7 @@ cc_library( "keywords.h", ], copts = UPB_DEFAULT_CPPOPTS, - visibility = ["//protos_generator:__pkg__"], + visibility = ["//upb/protos_generator:__pkg__"], ) bootstrap_cc_library( @@ -141,13 +141,13 @@ bootstrap_cc_library( ], bootstrap_deps = [ ":plugin_upb_proto", - "//:descriptor_upb_proto", - "//:reflection", + "//upb:descriptor_upb_proto", + "//upb:reflection", ], copts = UPB_DEFAULT_CPPOPTS, - visibility = ["//protos_generator:__pkg__"], + visibility = ["//upb/protos_generator:__pkg__"], deps = [ - "//:port", + "//upb:port", "@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/log:absl_check", "@com_google_absl//absl/log:absl_log", @@ -164,16 +164,16 @@ bootstrap_cc_library( "names.h", ], bootstrap_deps = [ - "//:reflection", + "//upb:reflection", ], copts = UPB_DEFAULT_CPPOPTS, - visibility = ["//protos_generator:__pkg__"], + visibility = ["//upb/protos_generator:__pkg__"], deps = [ + "//:protobuf", + "//src/google/protobuf/compiler:code_generator", "@com_google_absl//absl/base:core_headers", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/strings", - "@com_google_protobuf//:protobuf", - "@com_google_protobuf//src/google/protobuf/compiler:code_generator", ], ) @@ -186,7 +186,7 @@ cc_binary( visibility = ["//visibility:public"], deps = [ ":upbdev", - "//:port", + "//upb:port", ], ) @@ -209,16 +209,16 @@ cc_library( ":code_generator_request_upb_proto_reflection", ":plugin_upb_proto", ":plugin_upb_proto_reflection", - "//:base", - "//:descriptor_upb_proto", - "//:json", - "//:mem", - "//:mini_descriptor", - "//:mini_table", - "//:port", - "//:reflection", - "//:reflection_internal", - "//:wire", + "//upb:base", + "//upb:descriptor_upb_proto", + "//upb:json", + "//upb:mem", + "//upb:mini_descriptor", + "//upb:mini_table", + "//upb:port", + "//upb:reflection", + "//upb:reflection_internal", + "//upb:wire", ], ) @@ -231,17 +231,17 @@ bootstrap_cc_binary( ":names", ":plugin", ":plugin_upb_proto", - "//:descriptor_upb_proto", - "//:reflection", + "//upb:descriptor_upb_proto", + "//upb:reflection", ], copts = UPB_DEFAULT_CPPOPTS, visibility = ["//visibility:public"], deps = [ - "//:base", - "//:mem", - "//:mini_table_internal", - "//:port", - "//:wire_types", + "//upb:base", + "//upb:mem", + "//upb:mini_table_internal", + "//upb:port", + "//upb:wire_types", "@com_google_absl//absl/container:flat_hash_map", "@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/log:absl_check", @@ -266,9 +266,9 @@ cc_binary( ":common", ":file_layout", ":plugin", - "//:descriptor_upb_proto", - "//:reflection", - "//upb/util:def_to_proto", + "//upb:descriptor_upb_proto", + "//upb:reflection", + "//upb/upb/util:def_to_proto", ], ) @@ -288,7 +288,7 @@ cc_binary( deps = [ ":plugin_upb_proto", ":upbdev", - "//:port", + "//upb:port", "@com_google_absl//absl/log:absl_log", "@com_google_absl//absl/strings", ], diff --git a/upb/upbc/bootstrap_compiler.bzl b/upb/upbc/bootstrap_compiler.bzl index e2bb7d7d39..639757b475 100644 --- a/upb/upbc/bootstrap_compiler.bzl +++ b/upb/upbc/bootstrap_compiler.bzl @@ -1,17 +1,17 @@ """Macros that implement bootstrapping for the upb code generator.""" load( - "//bazel:upb_proto_library.bzl", + "//upb/bazel:upb_proto_library.bzl", "upb_proto_library", ) load( - "//cmake:build_defs.bzl", + "//upb/cmake:build_defs.bzl", "staleness_test", ) _stages = ["_stage0", "_stage1", ""] -_protoc = "@com_google_protobuf//:protoc" -_upbc_base = "//upbc:protoc-gen-upb" +_protoc = "//:protoc" +_upbc_base = "//upb/upbc:protoc-gen-upb" # begin:google_only # _is_google3 = True @@ -28,7 +28,7 @@ def _upbc(stage): def bootstrap_cc_library(name, visibility, deps, bootstrap_deps, **kwargs): for stage in _stages: - stage_visibility = visibility if stage == "" else ["//upbc:__pkg__"] + stage_visibility = visibility if stage == "" else ["//upb/upbc:__pkg__"] native.cc_library( name = name + stage, deps = deps + [dep + stage for dep in bootstrap_deps], @@ -115,12 +115,12 @@ def bootstrap_upb_proto_library( srcs = _generated_srcs_for_suffix(base_dir + "stage0", oss_src_files, ".upb.c"), hdrs = _generated_srcs_for_suffix(base_dir + "stage0", oss_src_files, ".upb.h"), includes = [base_dir + "stage0"], - visibility = ["//upbc:__pkg__"], + visibility = ["//upb/upbc:__pkg__"], # This macro signals to the runtime that it must use OSS APIs for descriptor.proto/plugin.proto. defines = ["UPB_BOOTSTRAP_STAGE0"], deps = [ - "//:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", - "//:mini_table", + "//upb:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", + "//upb:mini_table", ] + [dep + "_stage0" for dep in deps], **kwargs ) @@ -137,7 +137,7 @@ def bootstrap_upb_proto_library( "--plugin=protoc-gen-upb=$(location " + _upbc(0) + ") " + _extra_proto_path + "--upb_out=$(@D)/" + base_dir + "stage1 " + " ".join(src_files), - visibility = ["//upbc:__pkg__"], + visibility = ["//upb/upbc:__pkg__"], tools = [ _protoc, _upbc(0), @@ -150,9 +150,9 @@ def bootstrap_upb_proto_library( srcs = _generated_srcs_for_suffix(base_dir + "stage1", src_files, ".upb.c"), hdrs = _generated_srcs_for_suffix(base_dir + "stage1", src_files, ".upb.h"), includes = [base_dir + "stage1"], - visibility = ["//upbc:__pkg__"], + visibility = ["//upb/upbc:__pkg__"], deps = [ - "//:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", + "//upb:generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me", ] + [dep + "_stage1" for dep in deps], **kwargs ) diff --git a/upb/upbc/code_generator_request.c b/upb/upbc/code_generator_request.c index 4ab5fcc0a0..f302c0aef8 100644 --- a/upb/upbc/code_generator_request.c +++ b/upb/upbc/code_generator_request.c @@ -28,16 +28,16 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upbc/code_generator_request.h" +#include "upb/upbc/code_generator_request.h" #include #include "google/protobuf/compiler/plugin.upb.h" -#include "upb/mini_descriptor/decode.h" -#include "upb/reflection/def.h" +#include "upb/upb/mini_descriptor/decode.h" +#include "upb/upb/reflection/def.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" /******************************************************************************/ diff --git a/upb/upbc/code_generator_request.h b/upb/upbc/code_generator_request.h index 3218c08bed..ba1038f365 100644 --- a/upb/upbc/code_generator_request.h +++ b/upb/upbc/code_generator_request.h @@ -31,12 +31,12 @@ #ifndef UPBC_CODE_GENERATOR_REQUEST_H_ #define UPBC_CODE_GENERATOR_REQUEST_H_ -#include "upb/mem/arena.h" -#include "upb/reflection/def.h" -#include "upbc/code_generator_request.upb.h" +#include "upb/upb/mem/arena.h" +#include "upb/upb/reflection/def.h" +#include "upb/upbc/code_generator_request.upb.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -50,6 +50,6 @@ upbc_CodeGeneratorRequest* upbc_MakeCodeGeneratorRequest( } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* UPBC_CODE_GENERATOR_REQUEST_H_ */ diff --git a/upb/upbc/common.cc b/upb/upbc/common.cc index cfca0fc012..230d2641fb 100644 --- a/upb/upbc/common.cc +++ b/upb/upbc/common.cc @@ -28,10 +28,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upbc/common.h" +#include "upb/upbc/common.h" #include "absl/strings/str_replace.h" -#include "upb/reflection/def.hpp" +#include "upb/upb/reflection/def.hpp" namespace upbc { diff --git a/upb/upbc/common.h b/upb/upbc/common.h index 1c70088396..de05c47415 100644 --- a/upb/upbc/common.h +++ b/upb/upbc/common.h @@ -35,7 +35,7 @@ #include "absl/strings/str_replace.h" #include "absl/strings/substitute.h" -#include "upb/reflection/def.hpp" +#include "upb/upb/reflection/def.hpp" namespace upbc { diff --git a/upb/upbc/file_layout.cc b/upb/upbc/file_layout.cc index fab61202d0..4c21996cd1 100644 --- a/upb/upbc/file_layout.cc +++ b/upb/upbc/file_layout.cc @@ -28,13 +28,13 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upbc/file_layout.h" +#include "upb/upbc/file_layout.h" #include #include -#include "upb/mini_table/internal/extension.h" -#include "upbc/common.h" +#include "upb/upb/mini_table/internal/extension.h" +#include "upb/upbc/common.h" namespace upbc { diff --git a/upb/upbc/file_layout.h b/upb/upbc/file_layout.h index 9df43aaaea..92e078a38c 100644 --- a/upb/upbc/file_layout.h +++ b/upb/upbc/file_layout.h @@ -46,13 +46,13 @@ // end:github_only #include "absl/container/flat_hash_map.h" -#include "upb/base/status.hpp" -#include "upb/mini_descriptor/decode.h" -#include "upb/reflection/def.h" -#include "upb/reflection/def.hpp" +#include "upb/upb/base/status.hpp" +#include "upb/upb/mini_descriptor/decode.h" +#include "upb/upb/reflection/def.h" +#include "upb/upb/reflection/def.hpp" // Must be last -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" namespace upbc { @@ -124,6 +124,6 @@ class DefPoolPair { } // namespace upbc -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPBC_FILE_LAYOUT_H diff --git a/upb/upbc/get_used_fields.c b/upb/upbc/get_used_fields.c index 796e50133c..f07ccc1e74 100644 --- a/upb/upbc/get_used_fields.c +++ b/upb/upbc/get_used_fields.c @@ -28,18 +28,18 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upbc/get_used_fields.h" +#include "upb/upbc/get_used_fields.h" #include "google/protobuf/descriptor.upb.h" #include "google/protobuf/compiler/plugin.upb.h" -#include "upb/reflection/def_pool.h" -#include "upb/reflection/field_def.h" -#include "upb/reflection/message.h" -#include "upb/reflection/message_def.h" -#include "upb/wire/decode.h" +#include "upb/upb/reflection/def_pool.h" +#include "upb/upb/reflection/field_def.h" +#include "upb/upb/reflection/message.h" +#include "upb/upb/reflection/message_def.h" +#include "upb/upb/wire/decode.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #define upbdev_Err(...) \ { \ diff --git a/upb/upbc/get_used_fields.h b/upb/upbc/get_used_fields.h index ccf3208e85..6bbbfd3736 100644 --- a/upb/upbc/get_used_fields.h +++ b/upb/upbc/get_used_fields.h @@ -31,12 +31,12 @@ #ifndef UPBC_GET_USED_FIELDS #define UPBC_GET_USED_FIELDS -#include "upb/base/status.h" -#include "upb/base/string_view.h" -#include "upb/mem/arena.h" +#include "upb/upb/base/status.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/mem/arena.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -52,6 +52,6 @@ UPB_API upb_StringView upbdev_GetUsedFields( } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPBC_GET_USED_FIELDS diff --git a/upb/upbc/keywords.cc b/upb/upbc/keywords.cc index 3f51705739..95abec31f7 100644 --- a/upb/upbc/keywords.cc +++ b/upb/upbc/keywords.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upbc/keywords.h" +#include "upb/upbc/keywords.h" #include #include diff --git a/upb/upbc/names.cc b/upb/upbc/names.cc index 63521b8f12..0f9d4b619b 100644 --- a/upb/upbc/names.cc +++ b/upb/upbc/names.cc @@ -28,14 +28,14 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upbc/names.h" +#include "upb/upbc/names.h" #include #include "absl/strings/match.h" #include "absl/strings/string_view.h" #include "google/protobuf/descriptor.h" -#include "upb/reflection/def.hpp" +#include "upb/upb/reflection/def.hpp" namespace upbc { diff --git a/upb/upbc/names.h b/upb/upbc/names.h index 87b0a15541..f8f7b9433c 100644 --- a/upb/upbc/names.h +++ b/upb/upbc/names.h @@ -37,7 +37,7 @@ #include "absl/container/flat_hash_map.h" #include "absl/strings/string_view.h" #include "google/protobuf/descriptor.h" -#include "upb/reflection/def.hpp" +#include "upb/upb/reflection/def.hpp" namespace upbc { diff --git a/upb/upbc/plugin.h b/upb/upbc/plugin.h index 465bda0183..bb4b1b08ca 100644 --- a/upb/upbc/plugin.h +++ b/upb/upbc/plugin.h @@ -59,10 +59,10 @@ #include "absl/log/absl_log.h" #include "absl/strings/str_split.h" #include "absl/strings/string_view.h" -#include "upb/reflection/def.hpp" +#include "upb/upb/reflection/def.hpp" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" namespace upbc { @@ -207,6 +207,6 @@ class Plugin { } // namespace upbc -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPB_UPBC_PLUGIN_H_ diff --git a/upb/upbc/protoc-gen-upb.cc b/upb/upbc/protoc-gen-upb.cc index 56b431faf0..0a3e18f084 100644 --- a/upb/upbc/protoc-gen-upb.cc +++ b/upb/upbc/protoc-gen-upb.cc @@ -49,17 +49,17 @@ #include "absl/strings/str_replace.h" #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" -#include "upb/base/descriptor_constants.h" -#include "upb/base/string_view.h" -#include "upb/reflection/def.hpp" -#include "upb/wire/types.h" -#include "upbc/common.h" -#include "upbc/file_layout.h" -#include "upbc/names.h" -#include "upbc/plugin.h" +#include "upb/upb/base/descriptor_constants.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/reflection/def.hpp" +#include "upb/upb/wire/types.h" +#include "upb/upbc/common.h" +#include "upb/upbc/file_layout.h" +#include "upb/upbc/names.h" +#include "upb/upbc/plugin.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" namespace upbc { namespace { @@ -852,7 +852,7 @@ void WriteHeader(const DefPoolPair& pools, upb::FileDefPtr file, output( "#ifndef $0_UPB_H_\n" "#define $0_UPB_H_\n\n" - "#include \"upb/generated_code_support.h\"\n", + "#include \"upb/upb/generated_code_support.h\"\n", ToPreproc(file.name())); for (int i = 0; i < file.public_dependency_count(); i++) { @@ -867,7 +867,7 @@ void WriteHeader(const DefPoolPair& pools, upb::FileDefPtr file, output( "// Must be last. \n" - "#include \"upb/port/def.inc\"\n" + "#include \"upb/upb/port/def.inc\"\n" "\n" "#ifdef __cplusplus\n" "extern \"C\" {\n" @@ -985,7 +985,7 @@ void WriteHeader(const DefPoolPair& pools, upb::FileDefPtr file, "} /* extern \"C\" */\n" "#endif\n" "\n" - "#include \"upb/port/undef.inc\"\n" + "#include \"upb/upb/port/undef.inc\"\n" "\n" "#endif /* $0_UPB_H_ */\n", ToPreproc(file.name())); @@ -1548,7 +1548,7 @@ void WriteMiniTableSource(const DefPoolPair& pools, upb::FileDefPtr file, output( "#include \n" - "#include \"upb/generated_code_support.h\"\n" + "#include \"upb/upb/generated_code_support.h\"\n" "#include \"$0\"\n", HeaderFilename(file)); @@ -1559,7 +1559,7 @@ void WriteMiniTableSource(const DefPoolPair& pools, upb::FileDefPtr file, output( "\n" "// Must be last.\n" - "#include \"upb/port/def.inc\"\n" + "#include \"upb/upb/port/def.inc\"\n" "\n"); int msg_count = WriteMessages(pools, file, options, output); @@ -1575,7 +1575,7 @@ void WriteMiniTableSource(const DefPoolPair& pools, upb::FileDefPtr file, output(" $0,\n", ext_count); output("};\n\n"); - output("#include \"upb/port/undef.inc\"\n"); + output("#include \"upb/upb/port/undef.inc\"\n"); output("\n"); } @@ -1640,7 +1640,7 @@ void WriteMiniDescriptorSource(const DefPoolPair& pools, upb::FileDefPtr file, const Options& options, Output& output) { output( "#include \n" - "#include \"upb/generated_code_support.h\"\n" + "#include \"upb/upb/generated_code_support.h\"\n" "#include \"$0\"\n\n", HeaderFilename(file)); diff --git a/upb/upbc/protoc-gen-upbdefs.cc b/upb/upbc/protoc-gen-upbdefs.cc index b3455307ff..d3b30ab591 100644 --- a/upb/upbc/protoc-gen-upbdefs.cc +++ b/upb/upbc/protoc-gen-upbdefs.cc @@ -31,11 +31,11 @@ #include #include "google/protobuf/descriptor.upb.h" -#include "upb/reflection/def.hpp" -#include "upb/util/def_to_proto.h" -#include "upbc/common.h" -#include "upbc/file_layout.h" -#include "upbc/plugin.h" +#include "upb/upb/reflection/def.hpp" +#include "upb/upb/util/def_to_proto.h" +#include "upb/upbc/common.h" +#include "upb/upbc/file_layout.h" +#include "upb/upbc/plugin.h" namespace upbc { namespace { @@ -67,17 +67,17 @@ void WriteDefHeader(upb::FileDefPtr file, Output& output) { output( "#ifndef $0_UPBDEFS_H_\n" "#define $0_UPBDEFS_H_\n\n" - "#include \"upb/reflection/def.h\"\n" - "#include \"upb/reflection/internal/def_pool.h\"\n" - "#include \"upb/port/def.inc\"\n" + "#include \"upb/upb/reflection/def.h\"\n" + "#include \"upb/upb/reflection/internal/def_pool.h\"\n" + "#include \"upb/upb/port/def.inc\"\n" "#ifdef __cplusplus\n" "extern \"C\" {\n" "#endif\n\n", ToPreproc(file.name())); - output("#include \"upb/reflection/def.h\"\n"); + output("#include \"upb/upb/reflection/def.h\"\n"); output("\n"); - output("#include \"upb/port/def.inc\"\n"); + output("#include \"upb/upb/port/def.inc\"\n"); output("\n"); output("extern _upb_DefPool_Init $0;\n", DefInitSymbol(file)); @@ -92,7 +92,7 @@ void WriteDefHeader(upb::FileDefPtr file, Output& output) { "} /* extern \"C\" */\n" "#endif\n" "\n" - "#include \"upb/port/undef.inc\"\n" + "#include \"upb/upb/port/undef.inc\"\n" "\n" "#endif /* $0_UPBDEFS_H_ */\n", ToPreproc(file.name())); @@ -101,7 +101,7 @@ void WriteDefHeader(upb::FileDefPtr file, Output& output) { void WriteDefSource(upb::FileDefPtr file, Output& output) { EmitFileWarning(file.name(), output); - output("#include \"upb/reflection/def.h\"\n"); + output("#include \"upb/upb/reflection/def.h\"\n"); output("#include \"$0\"\n", DefHeaderFilename(file)); output("#include \"$0\"\n", HeaderFilename(file)); output("\n"); diff --git a/upb/upbc/protoc-gen-upbdev.cc b/upb/upbc/protoc-gen-upbdev.cc index 3093169630..6b209f0c5b 100644 --- a/upb/upbc/protoc-gen-upbdev.cc +++ b/upb/upbc/protoc-gen-upbdev.cc @@ -32,8 +32,8 @@ #include #include "google/protobuf/compiler/plugin.upb.h" -#include "upbc/subprocess.h" -#include "upbc/upbdev.h" +#include "upb/upbc/subprocess.h" +#include "upb/upbc/upbdev.h" static constexpr char kDefaultPlugin[] = "protoc_dart_plugin"; diff --git a/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.c b/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.c index 3a677152a6..26e71c8515 100644 --- a/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.c +++ b/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.c @@ -1,5 +1,5 @@ #include -#include "upb/generated_code_support.h" +#include "upb/upb/generated_code_support.h" #include "google/protobuf/compiler/plugin.upb.h" #include "google/protobuf/descriptor.upb.h" diff --git a/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.h b/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.h index 18fb72cbca..99717061f7 100644 --- a/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.h +++ b/upb/upbc/stage0/google/protobuf/compiler/plugin.upb.h @@ -9,9 +9,9 @@ #ifndef GOOGLE_PROTOBUF_COMPILER_PLUGIN_PROTO_UPB_H_ #define GOOGLE_PROTOBUF_COMPILER_PLUGIN_PROTO_UPB_H_ -#include "upb/generated_code_support.h" +#include "upb/upb/generated_code_support.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -687,6 +687,6 @@ extern const upb_MiniTableFile google_protobuf_compiler_plugin_proto_upb_file_la } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif /* GOOGLE_PROTOBUF_COMPILER_PLUGIN_PROTO_UPB_H_ */ diff --git a/upb/upbc/subprocess.cc b/upb/upbc/subprocess.cc index e0c2604230..7a509059fe 100644 --- a/upb/upbc/subprocess.cc +++ b/upb/upbc/subprocess.cc @@ -31,7 +31,7 @@ // Shamelessly copied from the protobuf compiler's subprocess.cc // except this version passes strings instead of Messages. -#include "upbc/subprocess.h" +#include "upb/upbc/subprocess.h" #include #include @@ -48,7 +48,7 @@ #include "absl/strings/substitute.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" namespace upbc { diff --git a/upb/upbc/upbc_so.c b/upb/upbc/upbc_so.c index 1cfc04b2ab..b70f399c0f 100644 --- a/upb/upbc/upbc_so.c +++ b/upb/upbc/upbc_so.c @@ -30,5 +30,5 @@ // These headers form a spanning tree for the upbc defs needed by FFI layers. -#include "upbc/get_used_fields.h" -#include "upbc/upbdev.h" +#include "upb/upbc/get_used_fields.h" +#include "upb/upbc/upbdev.h" diff --git a/upb/upbc/upbdev.c b/upb/upbc/upbdev.c index ffccd07104..b77c94e256 100644 --- a/upb/upbc/upbdev.c +++ b/upb/upbc/upbdev.c @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "upbc/upbdev.h" +#include "upb/upbc/upbdev.h" #ifdef _WIN32 #ifndef WIN32_LEAN_AND_MEAN @@ -41,13 +41,13 @@ #include "google/protobuf/compiler/plugin.upb.h" #include "google/protobuf/compiler/plugin.upbdefs.h" -#include "upb/base/status.h" -#include "upb/json/decode.h" -#include "upb/json/encode.h" -#include "upb/mem/arena.h" -#include "upbc/code_generator_request.h" -#include "upbc/code_generator_request.upb.h" -#include "upbc/code_generator_request.upbdefs.h" +#include "upb/upb/base/status.h" +#include "upb/upb/json/decode.h" +#include "upb/upb/json/encode.h" +#include "upb/upb/mem/arena.h" +#include "upb/upbc/code_generator_request.h" +#include "upb/upbc/code_generator_request.upb.h" +#include "upb/upbc/code_generator_request.upbdefs.h" static google_protobuf_compiler_CodeGeneratorResponse* upbc_JsonDecode( const char* data, size_t size, upb_Arena* arena, upb_Status* status) { diff --git a/upb/upbc/upbdev.h b/upb/upbc/upbdev.h index 047a1be3e8..b6dca92916 100644 --- a/upb/upbc/upbdev.h +++ b/upb/upbc/upbdev.h @@ -31,12 +31,12 @@ #ifndef UPBC_UPBDEV_H_ #define UPBC_UPBDEV_H_ -#include "upb/base/status.h" -#include "upb/base/string_view.h" -#include "upb/mem/arena.h" +#include "upb/upb/base/status.h" +#include "upb/upb/base/string_view.h" +#include "upb/upb/mem/arena.h" // Must be last. -#include "upb/port/def.inc" +#include "upb/upb/port/def.inc" #ifdef __cplusplus extern "C" { @@ -66,6 +66,6 @@ UPB_API void upbdev_Status_Clear(upb_Status* status); } /* extern "C" */ #endif -#include "upb/port/undef.inc" +#include "upb/upb/port/undef.inc" #endif // UPBC_UPBDEV_H_