create reflection_internal library

internal declarations are now physically removed from the public headers

PiperOrigin-RevId: 478921131
diff --git a/BUILD b/BUILD
index d307d23..197cb8b 100644
--- a/BUILD
+++ b/BUILD
@@ -346,12 +346,14 @@
         "upb/port_def.inc",
         "upb/port_undef.inc",
         "upb/reflection/def.h",
+        "upb/reflection/def_pool_internal.h",
     ],
     copts = UPB_DEFAULT_COPTS,
     visibility = ["//visibility:public"],
     deps = [
         ":descriptor_upb_proto",
         ":reflection",
+        ":reflection_internal",
         ":table_internal",
     ],
 )
@@ -397,32 +399,42 @@
     srcs = [
         "upb/reflection/common.h",
         "upb/reflection/def_builder.c",
-        "upb/reflection/def_builder.h",
+        "upb/reflection/def_builder_internal.h",
         "upb/reflection/def_pool.c",
         "upb/reflection/def_pool.h",
+        "upb/reflection/def_pool_internal.h",
         "upb/reflection/def_type.c",
         "upb/reflection/def_type.h",
         "upb/reflection/desc_state.c",
-        "upb/reflection/desc_state.h",
+        "upb/reflection/desc_state_internal.h",
         "upb/reflection/enum_def.c",
         "upb/reflection/enum_def.h",
+        "upb/reflection/enum_def_internal.h",
         "upb/reflection/enum_value_def.c",
         "upb/reflection/enum_value_def.h",
+        "upb/reflection/enum_value_def_internal.h",
         "upb/reflection/extension_range.c",
         "upb/reflection/extension_range.h",
+        "upb/reflection/extension_range_internal.h",
         "upb/reflection/field_def.c",
         "upb/reflection/field_def.h",
+        "upb/reflection/field_def_internal.h",
         "upb/reflection/file_def.c",
         "upb/reflection/file_def.h",
+        "upb/reflection/file_def_internal.h",
         "upb/reflection/message.c",
         "upb/reflection/message_def.c",
         "upb/reflection/message_def.h",
+        "upb/reflection/message_def_internal.h",
         "upb/reflection/method_def.c",
         "upb/reflection/method_def.h",
+        "upb/reflection/method_def_internal.h",
         "upb/reflection/oneof_def.c",
         "upb/reflection/oneof_def.h",
+        "upb/reflection/oneof_def_internal.h",
         "upb/reflection/service_def.c",
         "upb/reflection/service_def.h",
+        "upb/reflection/service_def_internal.h",
     ],
     hdrs = [
         "upb/def.h",
@@ -448,6 +460,51 @@
 )
 
 cc_library(
+    name = "reflection_internal",
+    srcs = [
+        "upb/reflection/common.h",
+        "upb/reflection/def_builder_internal.h",
+        "upb/reflection/def_pool.h",
+        "upb/reflection/def_type.h",
+        "upb/reflection/desc_state_internal.h",
+        "upb/reflection/enum_def.h",
+        "upb/reflection/enum_value_def.h",
+        "upb/reflection/extension_range.h",
+        "upb/reflection/field_def.h",
+        "upb/reflection/file_def.h",
+        "upb/reflection/message.h",
+        "upb/reflection/message_def.h",
+        "upb/reflection/method_def.h",
+        "upb/reflection/oneof_def.h",
+        "upb/reflection/service_def.h",
+    ],
+    hdrs = [
+        "upb/reflection/def_pool_internal.h",
+        "upb/reflection/enum_def_internal.h",
+        "upb/reflection/enum_value_def_internal.h",
+        "upb/reflection/extension_range_internal.h",
+        "upb/reflection/field_def_internal.h",
+        "upb/reflection/file_def_internal.h",
+        "upb/reflection/message_def_internal.h",
+        "upb/reflection/method_def_internal.h",
+        "upb/reflection/oneof_def_internal.h",
+        "upb/reflection/service_def_internal.h",
+    ],
+    copts = UPB_DEFAULT_COPTS,
+    visibility = ["//visibility:public"],
+    deps = [
+        ":collections",
+        ":descriptor_upb_proto",
+        ":mini_table",
+        ":mini_table_internal",
+        ":port",
+        ":reflection",
+        ":table_internal",
+        ":upb",
+    ],
+)
+
+cc_library(
     name = "textformat",
     srcs = [
         "upb/text_encode.c",
@@ -498,15 +555,15 @@
     name = "def_builder_test",
     srcs = [
         "upb/reflection/common.h",
-        "upb/reflection/def_builder.h",
+        "upb/reflection/def_builder_internal.h",
         "upb/reflection/def_builder_test.cc",
-        "upb/reflection/def_pool.h",
         "upb/reflection/def_type.h",
     ],
     deps = [
         ":descriptor_upb_proto",
         ":port",
         ":reflection",
+        ":reflection_internal",
         ":table_internal",
         ":upb",
         "@com_google_googletest//:gtest_main",
@@ -985,6 +1042,7 @@
         ":mini_table",
         ":port",
         ":reflection",
+        ":reflection_internal",
         ":upb",
     ],
     strip_import_prefix = ["src"],
@@ -1019,6 +1077,7 @@
         ":mini_table",
         ":port",
         ":reflection",
+        ":reflection_internal",
         ":table_internal",
         ":unicode_internal",
         ":upb",
@@ -1056,6 +1115,7 @@
         ":mini_table",
         ":port",
         ":reflection",
+        ":reflection_internal",
         ":table_internal",
         ":unicode_internal",
         ":upb",