/proc/self/cwd/external/com_google_protobuf/src/google/protobuf/descriptor.cc
Line | Count | Source (jump to first uncovered line) |
1 | | // Protocol Buffers - Google's data interchange format |
2 | | // Copyright 2008 Google Inc. All rights reserved. |
3 | | // https://developers.google.com/protocol-buffers/ |
4 | | // |
5 | | // Redistribution and use in source and binary forms, with or without |
6 | | // modification, are permitted provided that the following conditions are |
7 | | // met: |
8 | | // |
9 | | // * Redistributions of source code must retain the above copyright |
10 | | // notice, this list of conditions and the following disclaimer. |
11 | | // * Redistributions in binary form must reproduce the above |
12 | | // copyright notice, this list of conditions and the following disclaimer |
13 | | // in the documentation and/or other materials provided with the |
14 | | // distribution. |
15 | | // * Neither the name of Google Inc. nor the names of its |
16 | | // contributors may be used to endorse or promote products derived from |
17 | | // this software without specific prior written permission. |
18 | | // |
19 | | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
20 | | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
21 | | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
22 | | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
23 | | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
24 | | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
25 | | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
26 | | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
27 | | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 | | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 | | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 | | |
31 | | // Author: kenton@google.com (Kenton Varda) |
32 | | // Based on original Protocol Buffers design by |
33 | | // Sanjay Ghemawat, Jeff Dean, and others. |
34 | | |
35 | | #include "google/protobuf/descriptor.h" |
36 | | |
37 | | #include <algorithm> |
38 | | #include <array> |
39 | | #include <cstdlib> |
40 | | #include <functional> |
41 | | #include <iterator> |
42 | | #include <limits> |
43 | | #include <memory> |
44 | | #include <sstream> |
45 | | #include <string> |
46 | | #include <type_traits> |
47 | | #include <vector> |
48 | | |
49 | | #include "google/protobuf/stubs/common.h" |
50 | | #include "absl/base/call_once.h" |
51 | | #include "absl/base/casts.h" |
52 | | #include "absl/base/dynamic_annotations.h" |
53 | | #include "absl/container/btree_map.h" |
54 | | #include "absl/container/flat_hash_map.h" |
55 | | #include "absl/container/flat_hash_set.h" |
56 | | #include "absl/functional/function_ref.h" |
57 | | #include "absl/hash/hash.h" |
58 | | #include "absl/log/absl_check.h" |
59 | | #include "absl/log/absl_log.h" |
60 | | #include "absl/status/statusor.h" |
61 | | #include "absl/strings/ascii.h" |
62 | | #include "absl/strings/escaping.h" |
63 | | #include "absl/strings/match.h" |
64 | | #include "absl/strings/str_cat.h" |
65 | | #include "absl/strings/str_format.h" |
66 | | #include "absl/strings/str_join.h" |
67 | | #include "absl/strings/str_split.h" |
68 | | #include "absl/strings/string_view.h" |
69 | | #include "absl/strings/strip.h" |
70 | | #include "absl/strings/substitute.h" |
71 | | #include "absl/synchronization/mutex.h" |
72 | | #include "absl/types/optional.h" |
73 | | #include "google/protobuf/any.h" |
74 | | #include "google/protobuf/descriptor.pb.h" |
75 | | #include "google/protobuf/descriptor_database.h" |
76 | | #include "google/protobuf/descriptor_legacy.h" |
77 | | #include "google/protobuf/descriptor_visitor.h" |
78 | | #include "google/protobuf/dynamic_message.h" |
79 | | #include "google/protobuf/generated_message_util.h" |
80 | | #include "google/protobuf/io/strtod.h" |
81 | | #include "google/protobuf/io/tokenizer.h" |
82 | | #include "google/protobuf/port.h" |
83 | | #include "google/protobuf/repeated_ptr_field.h" |
84 | | #include "google/protobuf/text_format.h" |
85 | | #include "google/protobuf/unknown_field_set.h" |
86 | | |
87 | | |
88 | | // Must be included last. |
89 | | #include "google/protobuf/port_def.inc" |
90 | | |
91 | | namespace google { |
92 | | namespace protobuf { |
93 | | namespace { |
94 | | using ::google::protobuf::internal::DownCast; |
95 | | |
96 | | const int kPackageLimit = 100; |
97 | | |
98 | | |
99 | 0 | std::string ToCamelCase(const std::string& input, bool lower_first) { |
100 | 0 | bool capitalize_next = !lower_first; |
101 | 0 | std::string result; |
102 | 0 | result.reserve(input.size()); |
103 | |
|
104 | 0 | for (char character : input) { |
105 | 0 | if (character == '_') { |
106 | 0 | capitalize_next = true; |
107 | 0 | } else if (capitalize_next) { |
108 | 0 | result.push_back(absl::ascii_toupper(character)); |
109 | 0 | capitalize_next = false; |
110 | 0 | } else { |
111 | 0 | result.push_back(character); |
112 | 0 | } |
113 | 0 | } |
114 | | |
115 | | // Lower-case the first letter. |
116 | 0 | if (lower_first && !result.empty()) { |
117 | 0 | result[0] = absl::ascii_tolower(result[0]); |
118 | 0 | } |
119 | |
|
120 | 0 | return result; |
121 | 0 | } |
122 | | |
123 | 0 | std::string ToJsonName(const std::string& input) { |
124 | 0 | bool capitalize_next = false; |
125 | 0 | std::string result; |
126 | 0 | result.reserve(input.size()); |
127 | |
|
128 | 0 | for (char character : input) { |
129 | 0 | if (character == '_') { |
130 | 0 | capitalize_next = true; |
131 | 0 | } else if (capitalize_next) { |
132 | 0 | result.push_back(absl::ascii_toupper(character)); |
133 | 0 | capitalize_next = false; |
134 | 0 | } else { |
135 | 0 | result.push_back(character); |
136 | 0 | } |
137 | 0 | } |
138 | |
|
139 | 0 | return result; |
140 | 0 | } |
141 | | |
142 | | template <typename OptionsT> |
143 | 0 | bool IsLegacyJsonFieldConflictEnabled(const OptionsT& options) { |
144 | 0 | #ifdef __GNUC__ |
145 | 0 | #pragma GCC diagnostic push |
146 | 0 | #pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
147 | 0 | #endif |
148 | 0 | return options.deprecated_legacy_json_field_conflicts(); |
149 | 0 | #ifdef __GNUC__ |
150 | 0 | #pragma GCC diagnostic pop |
151 | 0 | #endif |
152 | 0 | } Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::IsLegacyJsonFieldConflictEnabled<google::protobuf::MessageOptions>(google::protobuf::MessageOptions const&) Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::IsLegacyJsonFieldConflictEnabled<google::protobuf::EnumOptions>(google::protobuf::EnumOptions const&) |
153 | | |
154 | | // Backport of fold expressions for the comma operator to C++11. |
155 | | // Usage: Fold({expr...}); |
156 | | // Guaranteed to evaluate left-to-right |
157 | | struct ExpressionEater { |
158 | | template <typename T> |
159 | 0 | ExpressionEater(T&&) {} // NOLINT Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::ExpressionEater::ExpressionEater<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::ExpressionEater::ExpressionEater<bool>(bool&&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::ExpressionEater::ExpressionEater<int&>(int&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::ExpressionEater::ExpressionEater<char*&>(char*&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::ExpressionEater::ExpressionEater<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::ExpressionEater::ExpressionEater<google::protobuf::SourceCodeInfo*&>(google::protobuf::SourceCodeInfo*&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::ExpressionEater::ExpressionEater<google::protobuf::FileDescriptorTables*&>(google::protobuf::FileDescriptorTables*&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::ExpressionEater::ExpressionEater<google::protobuf::MessageOptions*&>(google::protobuf::MessageOptions*&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::ExpressionEater::ExpressionEater<google::protobuf::FieldOptions*&>(google::protobuf::FieldOptions*&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::ExpressionEater::ExpressionEater<google::protobuf::EnumOptions*&>(google::protobuf::EnumOptions*&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::ExpressionEater::ExpressionEater<google::protobuf::EnumValueOptions*&>(google::protobuf::EnumValueOptions*&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::ExpressionEater::ExpressionEater<google::protobuf::ExtensionRangeOptions*&>(google::protobuf::ExtensionRangeOptions*&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::ExpressionEater::ExpressionEater<google::protobuf::OneofOptions*&>(google::protobuf::OneofOptions*&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::ExpressionEater::ExpressionEater<google::protobuf::ServiceOptions*&>(google::protobuf::ServiceOptions*&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::ExpressionEater::ExpressionEater<google::protobuf::MethodOptions*&>(google::protobuf::MethodOptions*&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::ExpressionEater::ExpressionEater<google::protobuf::FileOptions*&>(google::protobuf::FileOptions*&) |
160 | | }; |
161 | 0 | void Fold(std::initializer_list<ExpressionEater>) {} |
162 | | |
163 | | template <int R> |
164 | 0 | constexpr size_t RoundUpTo(size_t n) { |
165 | 0 | static_assert((R & (R - 1)) == 0, "Must be power of two"); |
166 | 0 | return (n + (R - 1)) & ~(R - 1); |
167 | 0 | } |
168 | | |
169 | 0 | constexpr size_t Max(size_t a, size_t b) { return a > b ? a : b; } |
170 | | template <typename T, typename... Ts> |
171 | 0 | constexpr size_t Max(T a, Ts... b) { |
172 | 0 | return Max(a, Max(b...)); |
173 | 0 | } Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::Max<unsigned long, unsigned long, unsigned long>(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::Max<unsigned long, unsigned long, unsigned long, unsigned long>(unsigned long, unsigned long, unsigned long, unsigned long) Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::Max<unsigned long, unsigned long, unsigned long, unsigned long, unsigned long>(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::Max<unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long>(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::Max<unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long>(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::Max<unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long>(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::Max<unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long>(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::Max<unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long>(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::Max<unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long>(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::Max<unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long>(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::Max<unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long>(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long) |
174 | | |
175 | | template <typename T> |
176 | 0 | constexpr size_t EffectiveAlignof() { |
177 | 0 | // `char` is special in that it gets aligned to 8. It is where we drop the |
178 | 0 | // trivial structs. |
179 | 0 | return std::is_same<T, char>::value ? 8 : alignof(T); |
180 | 0 | } Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::EffectiveAlignof<char>() Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::EffectiveAlignof<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >() Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::EffectiveAlignof<google::protobuf::SourceCodeInfo>() Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::EffectiveAlignof<google::protobuf::FileDescriptorTables>() Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::EffectiveAlignof<google::protobuf::MessageOptions>() Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::EffectiveAlignof<google::protobuf::FieldOptions>() Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::EffectiveAlignof<google::protobuf::EnumOptions>() Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::EffectiveAlignof<google::protobuf::EnumValueOptions>() Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::EffectiveAlignof<google::protobuf::ExtensionRangeOptions>() Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::EffectiveAlignof<google::protobuf::OneofOptions>() Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::EffectiveAlignof<google::protobuf::ServiceOptions>() Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::EffectiveAlignof<google::protobuf::MethodOptions>() Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::EffectiveAlignof<google::protobuf::FileOptions>() |
181 | | |
182 | | template <int align, typename U, typename... T> |
183 | | using AppendIfAlign = |
184 | | typename std::conditional<EffectiveAlignof<U>() == align, void (*)(T..., U), |
185 | | void (*)(T...)>::type; |
186 | | |
187 | | // Metafunction to sort types in descending order of alignment. |
188 | | // Useful for the flat allocator to ensure proper alignment of all elements |
189 | | // without having to add padding. |
190 | | // Instead of implementing a proper sort metafunction we just do a |
191 | | // filter+merge, which is much simpler to write as a metafunction. |
192 | | // We have a fixed set of alignments we can filter on. |
193 | | // For simplicity we use a function pointer as a type list. |
194 | | template <typename In, typename T16, typename T8, typename T4, typename T2, |
195 | | typename T1> |
196 | | struct TypeListSortImpl; |
197 | | |
198 | | template <typename... T16, typename... T8, typename... T4, typename... T2, |
199 | | typename... T1> |
200 | | struct TypeListSortImpl<void (*)(), void (*)(T16...), void (*)(T8...), |
201 | | void (*)(T4...), void (*)(T2...), void (*)(T1...)> { |
202 | | using type = void (*)(T16..., T8..., T4..., T2..., T1...); |
203 | | }; |
204 | | |
205 | | template <typename First, typename... Rest, typename... T16, typename... T8, |
206 | | typename... T4, typename... T2, typename... T1> |
207 | | struct TypeListSortImpl<void (*)(First, Rest...), void (*)(T16...), |
208 | | void (*)(T8...), void (*)(T4...), void (*)(T2...), |
209 | | void (*)(T1...)> { |
210 | | using type = typename TypeListSortImpl< |
211 | | void (*)(Rest...), AppendIfAlign<16, First, T16...>, |
212 | | AppendIfAlign<8, First, T8...>, AppendIfAlign<4, First, T4...>, |
213 | | AppendIfAlign<2, First, T2...>, AppendIfAlign<1, First, T1...>>::type; |
214 | | }; |
215 | | |
216 | | template <typename... T> |
217 | | using SortByAlignment = |
218 | | typename TypeListSortImpl<void (*)(T...), void (*)(), void (*)(), |
219 | | void (*)(), void (*)(), void (*)()>::type; |
220 | | |
221 | | template <template <typename...> class C, typename... T> |
222 | | auto ApplyTypeList(void (*)(T...)) -> C<T...>; |
223 | | |
224 | | template <typename T> |
225 | 0 | constexpr int FindTypeIndex() { |
226 | 0 | return -1; |
227 | 0 | } Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<char>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::SourceCodeInfo>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileDescriptorTables>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MessageOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FieldOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumValueOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ExtensionRangeOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::OneofOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ServiceOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MethodOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileOptions>() |
228 | | |
229 | | template <typename T, typename T1, typename... Ts> |
230 | 0 | constexpr int FindTypeIndex() { |
231 | 0 | return std::is_same<T, T1>::value ? 0 : FindTypeIndex<T, Ts...>() + 1; |
232 | 0 | } Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<char, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<char, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<char, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<char, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<char, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<char, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<char, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<char, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<char, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<char, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<char, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<char, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::SourceCodeInfo, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::SourceCodeInfo, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::SourceCodeInfo, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::SourceCodeInfo, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::SourceCodeInfo, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::SourceCodeInfo, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::SourceCodeInfo, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::SourceCodeInfo, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::SourceCodeInfo, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::SourceCodeInfo, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::SourceCodeInfo, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::SourceCodeInfo, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileDescriptorTables, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileDescriptorTables, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileDescriptorTables, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileDescriptorTables, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileDescriptorTables, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileDescriptorTables, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileDescriptorTables, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileDescriptorTables, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileDescriptorTables, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileDescriptorTables, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileDescriptorTables, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileDescriptorTables, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MessageOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MessageOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MessageOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MessageOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MessageOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MessageOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MessageOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MessageOptions, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MessageOptions, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MessageOptions, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MessageOptions, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MessageOptions, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FieldOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FieldOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FieldOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FieldOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FieldOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FieldOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FieldOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FieldOptions, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FieldOptions, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FieldOptions, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FieldOptions, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FieldOptions, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumOptions, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumOptions, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumOptions, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumOptions, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumOptions, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumValueOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumValueOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumValueOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumValueOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumValueOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumValueOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumValueOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumValueOptions, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumValueOptions, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumValueOptions, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumValueOptions, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::EnumValueOptions, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ExtensionRangeOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ExtensionRangeOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ExtensionRangeOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ExtensionRangeOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ExtensionRangeOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ExtensionRangeOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ExtensionRangeOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ExtensionRangeOptions, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ExtensionRangeOptions, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ExtensionRangeOptions, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ExtensionRangeOptions, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ExtensionRangeOptions, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::OneofOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::OneofOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::OneofOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::OneofOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::OneofOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::OneofOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::OneofOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::OneofOptions, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::OneofOptions, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::OneofOptions, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::OneofOptions, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::OneofOptions, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ServiceOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ServiceOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ServiceOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ServiceOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ServiceOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ServiceOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ServiceOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ServiceOptions, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ServiceOptions, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ServiceOptions, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ServiceOptions, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::ServiceOptions, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MethodOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MethodOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MethodOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MethodOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MethodOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MethodOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MethodOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MethodOptions, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MethodOptions, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MethodOptions, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MethodOptions, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::MethodOptions, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileOptions, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileOptions, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileOptions, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileOptions, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FindTypeIndex<google::protobuf::FileOptions, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>() |
233 | | |
234 | | // A type to value map, where the possible keys as specified in `Keys...`. |
235 | | // The values for key `K` is `ValueT<K>` |
236 | | template <template <typename> class ValueT, typename... Keys> |
237 | | class TypeMap { |
238 | | public: |
239 | | template <typename K> |
240 | 0 | ValueT<K>& Get() { |
241 | 0 | return static_cast<Base<K>&>(payload_).value; |
242 | 0 | } Unexecuted instantiation: descriptor.cc:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::PointerT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >() Unexecuted instantiation: descriptor.cc:int& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >() Unexecuted instantiation: descriptor.cc:int& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::FileDescriptorTables>() Unexecuted instantiation: descriptor.cc:int& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::FileOptions>() Unexecuted instantiation: descriptor.cc:int& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::SourceCodeInfo>() Unexecuted instantiation: descriptor.cc:int& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<char>() Unexecuted instantiation: descriptor.cc:int& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::ServiceOptions>() Unexecuted instantiation: descriptor.cc:int& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::MethodOptions>() Unexecuted instantiation: descriptor.cc:int& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::MessageOptions>() Unexecuted instantiation: descriptor.cc:int& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::ExtensionRangeOptions>() Unexecuted instantiation: descriptor.cc:int& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::OneofOptions>() Unexecuted instantiation: descriptor.cc:int& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::EnumOptions>() Unexecuted instantiation: descriptor.cc:int& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::EnumValueOptions>() Unexecuted instantiation: descriptor.cc:int& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::FieldOptions>() Unexecuted instantiation: descriptor.cc:char*& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::PointerT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<char>() Unexecuted instantiation: descriptor.cc:google::protobuf::SourceCodeInfo*& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::PointerT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::SourceCodeInfo>() Unexecuted instantiation: descriptor.cc:google::protobuf::FileDescriptorTables*& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::PointerT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::FileDescriptorTables>() Unexecuted instantiation: descriptor.cc:google::protobuf::MessageOptions*& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::PointerT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::MessageOptions>() Unexecuted instantiation: descriptor.cc:google::protobuf::FieldOptions*& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::PointerT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::FieldOptions>() Unexecuted instantiation: descriptor.cc:google::protobuf::EnumOptions*& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::PointerT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::EnumOptions>() Unexecuted instantiation: descriptor.cc:google::protobuf::EnumValueOptions*& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::PointerT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::EnumValueOptions>() Unexecuted instantiation: descriptor.cc:google::protobuf::ExtensionRangeOptions*& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::PointerT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::ExtensionRangeOptions>() Unexecuted instantiation: descriptor.cc:google::protobuf::OneofOptions*& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::PointerT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::OneofOptions>() Unexecuted instantiation: descriptor.cc:google::protobuf::ServiceOptions*& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::PointerT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::ServiceOptions>() Unexecuted instantiation: descriptor.cc:google::protobuf::MethodOptions*& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::PointerT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::MethodOptions>() Unexecuted instantiation: descriptor.cc:google::protobuf::FileOptions*& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::PointerT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::FileOptions>() |
243 | | |
244 | | template <typename K> |
245 | 0 | const ValueT<K>& Get() const { |
246 | 0 | return static_cast<const Base<K>&>(payload_).value; |
247 | 0 | } Unexecuted instantiation: descriptor.cc:char* const& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::PointerT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<char>() const Unexecuted instantiation: descriptor.cc:int const& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<char>() const Unexecuted instantiation: descriptor.cc:int const& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >() const Unexecuted instantiation: descriptor.cc:int const& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::SourceCodeInfo>() const Unexecuted instantiation: descriptor.cc:int const& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::FileDescriptorTables>() const Unexecuted instantiation: descriptor.cc:int const& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::MessageOptions>() const Unexecuted instantiation: descriptor.cc:int const& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::FieldOptions>() const Unexecuted instantiation: descriptor.cc:int const& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::EnumOptions>() const Unexecuted instantiation: descriptor.cc:int const& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::EnumValueOptions>() const Unexecuted instantiation: descriptor.cc:int const& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::ExtensionRangeOptions>() const Unexecuted instantiation: descriptor.cc:int const& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::OneofOptions>() const Unexecuted instantiation: descriptor.cc:int const& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::ServiceOptions>() const Unexecuted instantiation: descriptor.cc:int const& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::MethodOptions>() const Unexecuted instantiation: descriptor.cc:int const& google::protobuf::(anonymous namespace)::TypeMap<google::protobuf::(anonymous namespace)::IntT, char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Get<google::protobuf::FileOptions>() const |
248 | | |
249 | | private: |
250 | | template <typename K> |
251 | | struct Base { |
252 | | ValueT<K> value{}; |
253 | | }; |
254 | | struct Payload : Base<Keys>... {}; |
255 | | Payload payload_; |
256 | | }; |
257 | | |
258 | | template <typename T> |
259 | | using IntT = int; |
260 | | template <typename T> |
261 | | using PointerT = T*; |
262 | | |
263 | | // Manages an allocation of sequential arrays of type `T...`. |
264 | | // It is more space efficient than storing N (ptr, size) pairs, by storing only |
265 | | // the pointer to the head and the boundaries between the arrays. |
266 | | template <typename... T> |
267 | | class FlatAllocation { |
268 | | public: |
269 | | static constexpr size_t kMaxAlign = Max(alignof(T)...); |
270 | | |
271 | 0 | FlatAllocation(const TypeMap<IntT, T...>& ends) : ends_(ends) { |
272 | | // The arrays start just after FlatAllocation, so adjust the ends. |
273 | 0 | Fold({(ends_.template Get<T>() += |
274 | 0 | RoundUpTo<kMaxAlign>(sizeof(FlatAllocation)))...}); |
275 | 0 | Fold({Init<T>()...}); |
276 | 0 | } |
277 | | |
278 | 0 | void Destroy() { |
279 | 0 | Fold({Destroy<T>()...}); |
280 | 0 | internal::SizedDelete(this, total_bytes()); |
281 | 0 | } |
282 | | |
283 | | template <int I> |
284 | | using type = typename std::tuple_element<I, std::tuple<T...>>::type; |
285 | | |
286 | | // Gets a tuple of the head pointers for the arrays |
287 | 0 | TypeMap<PointerT, T...> Pointers() const { |
288 | 0 | TypeMap<PointerT, T...> out; |
289 | 0 | Fold({(out.template Get<T>() = Begin<T>())...}); |
290 | 0 | return out; |
291 | 0 | } |
292 | | |
293 | | |
294 | | private: |
295 | | // Total number of bytes used by all arrays. |
296 | 0 | int total_bytes() const { |
297 | | // Get the last end. |
298 | 0 | return ends_.template Get<typename std::tuple_element< |
299 | 0 | sizeof...(T) - 1, std::tuple<T...>>::type>(); |
300 | 0 | } |
301 | | |
302 | | |
303 | | template <typename U> |
304 | 0 | int BeginOffset() const { |
305 | 0 | constexpr int type_index = FindTypeIndex<U, T...>(); |
306 | | // Avoid a negative value here to keep it compiling when type_index == 0 |
307 | 0 | constexpr int prev_type_index = type_index == 0 ? 0 : type_index - 1; |
308 | 0 | using PrevType = |
309 | 0 | typename std::tuple_element<prev_type_index, std::tuple<T...>>::type; |
310 | | // Ensure the types are properly aligned. |
311 | 0 | static_assert(EffectiveAlignof<PrevType>() >= EffectiveAlignof<U>(), ""); |
312 | 0 | return type_index == 0 ? RoundUpTo<kMaxAlign>(sizeof(FlatAllocation)) |
313 | 0 | : ends_.template Get<PrevType>(); |
314 | 0 | } Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::BeginOffset<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::BeginOffset<google::protobuf::SourceCodeInfo>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::BeginOffset<google::protobuf::FileDescriptorTables>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::BeginOffset<google::protobuf::MessageOptions>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::BeginOffset<google::protobuf::FieldOptions>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::BeginOffset<google::protobuf::EnumOptions>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::BeginOffset<google::protobuf::EnumValueOptions>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::BeginOffset<google::protobuf::ExtensionRangeOptions>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::BeginOffset<google::protobuf::OneofOptions>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::BeginOffset<google::protobuf::ServiceOptions>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::BeginOffset<google::protobuf::MethodOptions>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::BeginOffset<google::protobuf::FileOptions>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::BeginOffset<char>() const |
315 | | |
316 | | template <typename U> |
317 | 0 | int EndOffset() const { |
318 | 0 | return ends_.template Get<U>(); |
319 | 0 | } Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::EndOffset<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::EndOffset<google::protobuf::SourceCodeInfo>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::EndOffset<google::protobuf::FileDescriptorTables>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::EndOffset<google::protobuf::MessageOptions>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::EndOffset<google::protobuf::FieldOptions>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::EndOffset<google::protobuf::EnumOptions>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::EndOffset<google::protobuf::EnumValueOptions>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::EndOffset<google::protobuf::ExtensionRangeOptions>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::EndOffset<google::protobuf::OneofOptions>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::EndOffset<google::protobuf::ServiceOptions>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::EndOffset<google::protobuf::MethodOptions>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::EndOffset<google::protobuf::FileOptions>() const Unexecuted instantiation: descriptor.cc:int google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::EndOffset<char>() const |
320 | | |
321 | | // Avoid the reinterpret_cast if the array is empty. |
322 | | // Clang's Control Flow Integrity does not like the cast pointing to memory |
323 | | // that is not yet initialized to be of that type. |
324 | | // (from -fsanitize=cfi-unrelated-cast) |
325 | | template <typename U> |
326 | 0 | U* Begin() const { |
327 | 0 | int begin = BeginOffset<U>(), end = EndOffset<U>(); |
328 | 0 | if (begin == end) return nullptr; |
329 | 0 | return reinterpret_cast<U*>(data() + begin); |
330 | 0 | } Unexecuted instantiation: descriptor.cc:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Begin<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >() const Unexecuted instantiation: descriptor.cc:google::protobuf::SourceCodeInfo* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Begin<google::protobuf::SourceCodeInfo>() const Unexecuted instantiation: descriptor.cc:google::protobuf::FileDescriptorTables* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Begin<google::protobuf::FileDescriptorTables>() const Unexecuted instantiation: descriptor.cc:google::protobuf::MessageOptions* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Begin<google::protobuf::MessageOptions>() const Unexecuted instantiation: descriptor.cc:google::protobuf::FieldOptions* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Begin<google::protobuf::FieldOptions>() const Unexecuted instantiation: descriptor.cc:google::protobuf::EnumOptions* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Begin<google::protobuf::EnumOptions>() const Unexecuted instantiation: descriptor.cc:google::protobuf::EnumValueOptions* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Begin<google::protobuf::EnumValueOptions>() const Unexecuted instantiation: descriptor.cc:google::protobuf::ExtensionRangeOptions* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Begin<google::protobuf::ExtensionRangeOptions>() const Unexecuted instantiation: descriptor.cc:google::protobuf::OneofOptions* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Begin<google::protobuf::OneofOptions>() const Unexecuted instantiation: descriptor.cc:google::protobuf::ServiceOptions* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Begin<google::protobuf::ServiceOptions>() const Unexecuted instantiation: descriptor.cc:google::protobuf::MethodOptions* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Begin<google::protobuf::MethodOptions>() const Unexecuted instantiation: descriptor.cc:google::protobuf::FileOptions* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Begin<google::protobuf::FileOptions>() const Unexecuted instantiation: descriptor.cc:char* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Begin<char>() const |
331 | | |
332 | | template <typename U> |
333 | 0 | U* End() const { |
334 | 0 | int begin = BeginOffset<U>(), end = EndOffset<U>(); |
335 | 0 | if (begin == end) return nullptr; |
336 | 0 | return reinterpret_cast<U*>(data() + end); |
337 | 0 | } Unexecuted instantiation: descriptor.cc:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::End<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >() const Unexecuted instantiation: descriptor.cc:google::protobuf::SourceCodeInfo* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::End<google::protobuf::SourceCodeInfo>() const Unexecuted instantiation: descriptor.cc:google::protobuf::FileDescriptorTables* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::End<google::protobuf::FileDescriptorTables>() const Unexecuted instantiation: descriptor.cc:google::protobuf::MessageOptions* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::End<google::protobuf::MessageOptions>() const Unexecuted instantiation: descriptor.cc:google::protobuf::FieldOptions* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::End<google::protobuf::FieldOptions>() const Unexecuted instantiation: descriptor.cc:google::protobuf::EnumOptions* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::End<google::protobuf::EnumOptions>() const Unexecuted instantiation: descriptor.cc:google::protobuf::EnumValueOptions* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::End<google::protobuf::EnumValueOptions>() const Unexecuted instantiation: descriptor.cc:google::protobuf::ExtensionRangeOptions* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::End<google::protobuf::ExtensionRangeOptions>() const Unexecuted instantiation: descriptor.cc:google::protobuf::OneofOptions* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::End<google::protobuf::OneofOptions>() const Unexecuted instantiation: descriptor.cc:google::protobuf::ServiceOptions* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::End<google::protobuf::ServiceOptions>() const Unexecuted instantiation: descriptor.cc:google::protobuf::MethodOptions* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::End<google::protobuf::MethodOptions>() const Unexecuted instantiation: descriptor.cc:google::protobuf::FileOptions* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::End<google::protobuf::FileOptions>() const Unexecuted instantiation: descriptor.cc:char* google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::End<char>() const |
338 | | |
339 | | template <typename U> |
340 | 0 | bool Init() { |
341 | | // Skip for the `char` block. No need to zero initialize it. |
342 | 0 | if (std::is_same<U, char>::value) return true; |
343 | 0 | for (char *p = data() + BeginOffset<U>(), *end = data() + EndOffset<U>(); |
344 | 0 | p != end; p += sizeof(U)) { |
345 | 0 | ::new (p) U{}; |
346 | 0 | } |
347 | 0 | return true; |
348 | 0 | } Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Init<char>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Init<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Init<google::protobuf::SourceCodeInfo>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Init<google::protobuf::FileDescriptorTables>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Init<google::protobuf::MessageOptions>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Init<google::protobuf::FieldOptions>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Init<google::protobuf::EnumOptions>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Init<google::protobuf::EnumValueOptions>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Init<google::protobuf::ExtensionRangeOptions>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Init<google::protobuf::OneofOptions>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Init<google::protobuf::ServiceOptions>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Init<google::protobuf::MethodOptions>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Init<google::protobuf::FileOptions>() |
349 | | |
350 | | template <typename U> |
351 | 0 | bool Destroy() { |
352 | 0 | if (std::is_trivially_destructible<U>::value) return true; |
353 | 0 | for (U* it = Begin<U>(), *end = End<U>(); it != end; ++it) { |
354 | 0 | it->~U(); |
355 | 0 | } |
356 | 0 | return true; |
357 | 0 | } Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Destroy<char>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Destroy<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Destroy<google::protobuf::SourceCodeInfo>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Destroy<google::protobuf::FileDescriptorTables>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Destroy<google::protobuf::MessageOptions>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Destroy<google::protobuf::FieldOptions>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Destroy<google::protobuf::EnumOptions>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Destroy<google::protobuf::EnumValueOptions>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Destroy<google::protobuf::ExtensionRangeOptions>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Destroy<google::protobuf::OneofOptions>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Destroy<google::protobuf::ServiceOptions>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Destroy<google::protobuf::MethodOptions>() Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocation<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::Destroy<google::protobuf::FileOptions>() |
358 | | |
359 | 0 | char* data() const { |
360 | 0 | return const_cast<char*>(reinterpret_cast<const char*>(this)); |
361 | 0 | } |
362 | | |
363 | | TypeMap<IntT, T...> ends_; |
364 | | }; |
365 | | |
366 | | template <typename... T> |
367 | 0 | TypeMap<IntT, T...> CalculateEnds(const TypeMap<IntT, T...>& sizes) { |
368 | 0 | int total = 0; |
369 | 0 | TypeMap<IntT, T...> out; |
370 | 0 | Fold({(out.template Get<T>() = total += |
371 | 0 | sizeof(T) * sizes.template Get<T>())...}); |
372 | 0 | return out; |
373 | 0 | } |
374 | | |
375 | | // The implementation for FlatAllocator below. |
376 | | // This separate class template makes it easier to have methods that fold on |
377 | | // `T...`. |
378 | | template <typename... T> |
379 | | class FlatAllocatorImpl { |
380 | | public: |
381 | | using Allocation = FlatAllocation<T...>; |
382 | | |
383 | | template <typename U> |
384 | 0 | void PlanArray(int array_size) { |
385 | | // We can't call PlanArray after FinalizePlanning has been called. |
386 | 0 | ABSL_CHECK(!has_allocated()); |
387 | 0 | if (std::is_trivially_destructible<U>::value) { |
388 | | // Trivial types are aligned to 8 bytes. |
389 | 0 | static_assert(alignof(U) <= 8, ""); |
390 | 0 | total_.template Get<char>() += RoundUpTo<8>(array_size * sizeof(U)); |
391 | 0 | } else { |
392 | | // Since we can't use `if constexpr`, just make the expression compile |
393 | | // when this path is not taken. |
394 | 0 | using TypeToUse = |
395 | 0 | typename std::conditional<std::is_trivially_destructible<U>::value, |
396 | 0 | char, U>::type; |
397 | 0 | total_.template Get<TypeToUse>() += array_size; |
398 | 0 | } |
399 | 0 | } Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::FileDescriptorTables>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::FileOptions>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::SourceCodeInfo>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::ServiceDescriptor>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::ServiceOptions>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::MethodDescriptor>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::MethodOptions>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::MessageOptions>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::ExtensionRangeOptions>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::Descriptor::ReservedRange>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::OneofDescriptor>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::OneofOptions>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::EnumOptions>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::EnumValueOptions>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::EnumDescriptor::ReservedRange>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::FieldDescriptor>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::FieldOptions>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<int>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::FileDescriptor const*>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::EnumValueDescriptor>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::FileDescriptor>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::EnumDescriptor>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::Descriptor>(int) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::PlanArray<google::protobuf::Descriptor::ExtensionRange>(int) |
400 | | |
401 | | template <typename U> |
402 | 0 | U* AllocateArray(int array_size) { |
403 | 0 | constexpr bool trivial = std::is_trivially_destructible<U>::value; |
404 | 0 | using TypeToUse = typename std::conditional<trivial, char, U>::type; |
405 | | |
406 | | // We can only allocate after FinalizePlanning has been called. |
407 | 0 | ABSL_CHECK(has_allocated()); |
408 | |
|
409 | 0 | TypeToUse*& data = pointers_.template Get<TypeToUse>(); |
410 | 0 | int& used = used_.template Get<TypeToUse>(); |
411 | 0 | U* res = reinterpret_cast<U*>(data + used); |
412 | 0 | used += trivial ? RoundUpTo<8>(array_size * sizeof(U)) : array_size; |
413 | 0 | ABSL_CHECK_LE(used, total_.template Get<TypeToUse>()); |
414 | 0 | return res; |
415 | 0 | } Unexecuted instantiation: descriptor.cc:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(int) Unexecuted instantiation: descriptor.cc:google::protobuf::EnumValueDescriptor* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::EnumValueDescriptor>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::EnumDescriptor* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::EnumDescriptor>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::Descriptor* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::Descriptor>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::Descriptor::ExtensionRange* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::Descriptor::ExtensionRange>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::FileDescriptor* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::FileDescriptor>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::FileOptions* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::FileOptions>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::SourceCodeInfo* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::SourceCodeInfo>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::FileDescriptorTables* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::FileDescriptorTables>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::FileDescriptor const** google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::FileDescriptor const*>(int) Unexecuted instantiation: descriptor.cc:int* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<int>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::ServiceDescriptor* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::ServiceDescriptor>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::FieldDescriptor* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::FieldDescriptor>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::OneofDescriptor* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::OneofDescriptor>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::Descriptor::ReservedRange* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::Descriptor::ReservedRange>(int) Unexecuted instantiation: descriptor.cc:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const** google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const*>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::MessageOptions* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::MessageOptions>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::FieldOptions* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::FieldOptions>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::ExtensionRangeOptions* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::ExtensionRangeOptions>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::OneofOptions* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::OneofOptions>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::EnumDescriptor::ReservedRange* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::EnumDescriptor::ReservedRange>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::EnumOptions* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::EnumOptions>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::EnumValueOptions* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::EnumValueOptions>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::MethodDescriptor* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::MethodDescriptor>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::ServiceOptions* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::ServiceOptions>(int) Unexecuted instantiation: descriptor.cc:google::protobuf::MethodOptions* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateArray<google::protobuf::MethodOptions>(int) |
416 | | |
417 | | template <typename... In> |
418 | 0 | const std::string* AllocateStrings(In&&... in) { |
419 | 0 | std::string* strings = AllocateArray<std::string>(sizeof...(in)); |
420 | 0 | std::string* res = strings; |
421 | 0 | Fold({(*strings++ = std::string(std::forward<In>(in)))...}); |
422 | 0 | return res; |
423 | 0 | } Unexecuted instantiation: descriptor.cc:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateStrings<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&) Unexecuted instantiation: descriptor.cc:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateStrings<absl::lts_20230125::string_view>(absl::lts_20230125::string_view&&) Unexecuted instantiation: descriptor.cc:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateStrings<char const (&) [1]>(char const (&) [1]) Unexecuted instantiation: descriptor.cc:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateStrings<absl::lts_20230125::string_view&, absl::lts_20230125::string_view&>(absl::lts_20230125::string_view&, absl::lts_20230125::string_view&) Unexecuted instantiation: descriptor.cc:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateStrings<char const (&) [18], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(char const (&) [18], std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&) Unexecuted instantiation: descriptor.cc:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateStrings<absl::lts_20230125::string_view&>(absl::lts_20230125::string_view&) Unexecuted instantiation: descriptor.cc:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateStrings<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: descriptor.cc:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateStrings<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) Unexecuted instantiation: descriptor.cc:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateStrings<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&) Unexecuted instantiation: descriptor.cc:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateStrings<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&) Unexecuted instantiation: descriptor.cc:std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const* google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::AllocateStrings<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) |
424 | | |
425 | | // Allocate all 5 names of the field: |
426 | | // name, full name, lowercase, camelcase and json. |
427 | | // It will dedup the strings when possible. |
428 | | // The resulting array contains `name` at index 0, `full_name` at index 1 |
429 | | // and the other 3 indices are specified in the result. |
430 | | void PlanFieldNames(const std::string& name, |
431 | 0 | const std::string* opt_json_name) { |
432 | 0 | ABSL_CHECK(!has_allocated()); |
433 | | |
434 | | // Fast path for snake_case names, which follow the style guide. |
435 | 0 | if (opt_json_name == nullptr) { |
436 | 0 | switch (GetFieldNameCase(name)) { |
437 | 0 | case FieldNameCase::kAllLower: |
438 | | // Case 1: they are all the same. |
439 | 0 | return PlanArray<std::string>(2); |
440 | 0 | case FieldNameCase::kSnakeCase: |
441 | | // Case 2: name==lower, camel==json |
442 | 0 | return PlanArray<std::string>(3); |
443 | 0 | default: |
444 | 0 | break; |
445 | 0 | } |
446 | 0 | } |
447 | | |
448 | 0 | std::string lowercase_name = name; |
449 | 0 | absl::AsciiStrToLower(&lowercase_name); |
450 | |
|
451 | 0 | std::string camelcase_name = ToCamelCase(name, /* lower_first = */ true); |
452 | 0 | std::string json_name = |
453 | 0 | opt_json_name != nullptr ? *opt_json_name : ToJsonName(name); |
454 | |
|
455 | 0 | absl::string_view all_names[] = {name, lowercase_name, camelcase_name, |
456 | 0 | json_name}; |
457 | 0 | std::sort(all_names, all_names + 4); |
458 | 0 | int unique = |
459 | 0 | static_cast<int>(std::unique(all_names, all_names + 4) - all_names); |
460 | |
|
461 | 0 | PlanArray<std::string>(unique + 1); |
462 | 0 | } |
463 | | |
464 | | struct FieldNamesResult { |
465 | | const std::string* array; |
466 | | int lowercase_index; |
467 | | int camelcase_index; |
468 | | int json_index; |
469 | | }; |
470 | | FieldNamesResult AllocateFieldNames(const std::string& name, |
471 | | const std::string& scope, |
472 | 0 | const std::string* opt_json_name) { |
473 | 0 | ABSL_CHECK(has_allocated()); |
474 | |
|
475 | 0 | std::string full_name = |
476 | 0 | scope.empty() ? name : absl::StrCat(scope, ".", name); |
477 | | |
478 | | // Fast path for snake_case names, which follow the style guide. |
479 | 0 | if (opt_json_name == nullptr) { |
480 | 0 | switch (GetFieldNameCase(name)) { |
481 | 0 | case FieldNameCase::kAllLower: |
482 | | // Case 1: they are all the same. |
483 | 0 | return {AllocateStrings(name, std::move(full_name)), 0, 0, 0}; |
484 | 0 | case FieldNameCase::kSnakeCase: |
485 | | // Case 2: name==lower, camel==json |
486 | 0 | return {AllocateStrings(name, std::move(full_name), |
487 | 0 | ToCamelCase(name, /* lower_first = */ true)), |
488 | 0 | 0, 2, 2}; |
489 | 0 | default: |
490 | 0 | break; |
491 | 0 | } |
492 | 0 | } |
493 | | |
494 | 0 | std::vector<std::string> names; |
495 | 0 | names.push_back(name); |
496 | 0 | names.push_back(std::move(full_name)); |
497 | |
|
498 | 0 | const auto push_name = [&](std::string new_name) { |
499 | 0 | for (size_t i = 0; i < names.size(); ++i) { |
500 | | // Do not compare the full_name. It is unlikely to match, except in |
501 | | // custom json_name. We are not taking this into account in |
502 | | // PlanFieldNames so better to not try it. |
503 | 0 | if (i == 1) continue; |
504 | 0 | if (names[i] == new_name) return i; |
505 | 0 | } |
506 | 0 | names.push_back(std::move(new_name)); |
507 | 0 | return names.size() - 1; |
508 | 0 | }; |
509 | |
|
510 | 0 | FieldNamesResult result{nullptr, 0, 0, 0}; |
511 | |
|
512 | 0 | std::string lowercase_name = name; |
513 | 0 | absl::AsciiStrToLower(&lowercase_name); |
514 | 0 | result.lowercase_index = push_name(std::move(lowercase_name)); |
515 | 0 | result.camelcase_index = |
516 | 0 | push_name(ToCamelCase(name, /* lower_first = */ true)); |
517 | 0 | result.json_index = |
518 | 0 | push_name(opt_json_name != nullptr ? *opt_json_name : ToJsonName(name)); |
519 | |
|
520 | 0 | std::string* all_names = AllocateArray<std::string>(names.size()); |
521 | 0 | result.array = all_names; |
522 | 0 | std::move(names.begin(), names.end(), all_names); |
523 | |
|
524 | 0 | return result; |
525 | 0 | } |
526 | | |
527 | | template <typename Alloc> |
528 | 0 | void FinalizePlanning(Alloc& alloc) { |
529 | 0 | ABSL_CHECK(!has_allocated()); |
530 | |
|
531 | 0 | pointers_ = alloc->CreateFlatAlloc(total_)->Pointers(); |
532 | |
|
533 | 0 | ABSL_CHECK(has_allocated()); |
534 | 0 | } Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::FinalizePlanning<google::protobuf::DescriptorPool::Tables*>(google::protobuf::DescriptorPool::Tables*&) Unexecuted instantiation: descriptor.cc:void google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::FinalizePlanning<std::__1::unique_ptr<google::protobuf::DescriptorPool::Tables, std::__1::default_delete<google::protobuf::DescriptorPool::Tables> > const>(std::__1::unique_ptr<google::protobuf::DescriptorPool::Tables, std::__1::default_delete<google::protobuf::DescriptorPool::Tables> > const&) |
535 | | |
536 | 0 | void ExpectConsumed() const { |
537 | | // We verify that we consumed all the memory requested if there was no |
538 | | // error in processing. |
539 | 0 | Fold({ExpectConsumed<T>()...}); |
540 | 0 | } |
541 | | |
542 | | private: |
543 | 0 | bool has_allocated() const { |
544 | 0 | return pointers_.template Get<char>() != nullptr; |
545 | 0 | } |
546 | | |
547 | 0 | static bool IsLower(char c) { return 'a' <= c && c <= 'z'; } |
548 | 0 | static bool IsDigit(char c) { return '0' <= c && c <= '9'; } |
549 | 0 | static bool IsLowerOrDigit(char c) { return IsLower(c) || IsDigit(c); } |
550 | | |
551 | | enum class FieldNameCase { kAllLower, kSnakeCase, kOther }; |
552 | 0 | FieldNameCase GetFieldNameCase(const std::string& name) { |
553 | 0 | if (!IsLower(name[0])) return FieldNameCase::kOther; |
554 | 0 | FieldNameCase best = FieldNameCase::kAllLower; |
555 | 0 | for (char c : name) { |
556 | 0 | if (IsLowerOrDigit(c)) { |
557 | | // nothing to do |
558 | 0 | } else if (c == '_') { |
559 | 0 | best = FieldNameCase::kSnakeCase; |
560 | 0 | } else { |
561 | 0 | return FieldNameCase::kOther; |
562 | 0 | } |
563 | 0 | } |
564 | 0 | return best; |
565 | 0 | } |
566 | | |
567 | | template <typename U> |
568 | 0 | bool ExpectConsumed() const { |
569 | 0 | ABSL_CHECK_EQ(total_.template Get<U>(), used_.template Get<U>()); |
570 | 0 | return true; |
571 | 0 | } Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::ExpectConsumed<char>() const Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::ExpectConsumed<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >() const Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::ExpectConsumed<google::protobuf::SourceCodeInfo>() const Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::ExpectConsumed<google::protobuf::FileDescriptorTables>() const Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::ExpectConsumed<google::protobuf::MessageOptions>() const Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::ExpectConsumed<google::protobuf::FieldOptions>() const Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::ExpectConsumed<google::protobuf::EnumOptions>() const Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::ExpectConsumed<google::protobuf::EnumValueOptions>() const Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::ExpectConsumed<google::protobuf::ExtensionRangeOptions>() const Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::ExpectConsumed<google::protobuf::OneofOptions>() const Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::ExpectConsumed<google::protobuf::ServiceOptions>() const Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::ExpectConsumed<google::protobuf::MethodOptions>() const Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::FlatAllocatorImpl<char, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, google::protobuf::SourceCodeInfo, google::protobuf::FileDescriptorTables, google::protobuf::MessageOptions, google::protobuf::FieldOptions, google::protobuf::EnumOptions, google::protobuf::EnumValueOptions, google::protobuf::ExtensionRangeOptions, google::protobuf::OneofOptions, google::protobuf::ServiceOptions, google::protobuf::MethodOptions, google::protobuf::FileOptions>::ExpectConsumed<google::protobuf::FileOptions>() const |
572 | | |
573 | | TypeMap<PointerT, T...> pointers_; |
574 | | TypeMap<IntT, T...> total_; |
575 | | TypeMap<IntT, T...> used_; |
576 | | }; |
577 | | |
578 | | } // namespace |
579 | | |
580 | | class Symbol { |
581 | | public: |
582 | | enum Type { |
583 | | NULL_SYMBOL, |
584 | | MESSAGE, |
585 | | FIELD, |
586 | | ONEOF, |
587 | | ENUM, |
588 | | ENUM_VALUE, |
589 | | ENUM_VALUE_OTHER_PARENT, |
590 | | SERVICE, |
591 | | METHOD, |
592 | | FULL_PACKAGE, |
593 | | SUB_PACKAGE, |
594 | | }; |
595 | | |
596 | 0 | Symbol() { |
597 | 0 | static constexpr internal::SymbolBase null_symbol{}; |
598 | 0 | static_assert(null_symbol.symbol_type_ == NULL_SYMBOL, ""); |
599 | | // Initialize with a sentinel to make sure `ptr_` is never null. |
600 | 0 | ptr_ = &null_symbol; |
601 | 0 | } |
602 | | |
603 | | // Every object we store derives from internal::SymbolBase, where we store the |
604 | | // symbol type enum. |
605 | | // Storing in the object can be done without using more space in most cases, |
606 | | // while storing it in the Symbol type would require 8 bytes. |
607 | | #define DEFINE_MEMBERS(TYPE, TYPE_CONSTANT, FIELD) \ |
608 | 0 | explicit Symbol(TYPE* value) : ptr_(value) { \ |
609 | 0 | value->symbol_type_ = TYPE_CONSTANT; \ |
610 | 0 | } \ Unexecuted instantiation: google::protobuf::Symbol::Symbol(google::protobuf::EnumDescriptor*) Unexecuted instantiation: google::protobuf::Symbol::Symbol(google::protobuf::Descriptor*) Unexecuted instantiation: google::protobuf::Symbol::Symbol(google::protobuf::FileDescriptor*) Unexecuted instantiation: google::protobuf::Symbol::Symbol(google::protobuf::Symbol::Subpackage*) Unexecuted instantiation: google::protobuf::Symbol::Symbol(google::protobuf::FieldDescriptor*) Unexecuted instantiation: google::protobuf::Symbol::Symbol(google::protobuf::OneofDescriptor*) Unexecuted instantiation: google::protobuf::Symbol::Symbol(google::protobuf::ServiceDescriptor*) Unexecuted instantiation: google::protobuf::Symbol::Symbol(google::protobuf::MethodDescriptor*) |
611 | 0 | const TYPE* FIELD() const { \ |
612 | 0 | return type() == TYPE_CONSTANT ? static_cast<const TYPE*>(ptr_) : nullptr; \ |
613 | 0 | } Unexecuted instantiation: google::protobuf::Symbol::file_descriptor() const Unexecuted instantiation: google::protobuf::Symbol::sub_package_file_descriptor() const Unexecuted instantiation: google::protobuf::Symbol::field_descriptor() const Unexecuted instantiation: google::protobuf::Symbol::descriptor() const Unexecuted instantiation: google::protobuf::Symbol::oneof_descriptor() const Unexecuted instantiation: google::protobuf::Symbol::enum_descriptor() const Unexecuted instantiation: google::protobuf::Symbol::service_descriptor() const Unexecuted instantiation: google::protobuf::Symbol::method_descriptor() const |
614 | | |
615 | | DEFINE_MEMBERS(Descriptor, MESSAGE, descriptor) |
616 | | DEFINE_MEMBERS(FieldDescriptor, FIELD, field_descriptor) |
617 | | DEFINE_MEMBERS(OneofDescriptor, ONEOF, oneof_descriptor) |
618 | | DEFINE_MEMBERS(EnumDescriptor, ENUM, enum_descriptor) |
619 | | DEFINE_MEMBERS(ServiceDescriptor, SERVICE, service_descriptor) |
620 | | DEFINE_MEMBERS(MethodDescriptor, METHOD, method_descriptor) |
621 | | DEFINE_MEMBERS(FileDescriptor, FULL_PACKAGE, file_descriptor) |
622 | | |
623 | | // We use a special node for subpackage FileDescriptor. |
624 | | // It is potentially added to the table with multiple different names, so we |
625 | | // need a separate place to put the name. |
626 | | struct Subpackage : internal::SymbolBase { |
627 | | int name_size; |
628 | | const FileDescriptor* file; |
629 | | }; |
630 | | DEFINE_MEMBERS(Subpackage, SUB_PACKAGE, sub_package_file_descriptor) |
631 | | |
632 | | // Enum values have two different parents. |
633 | | // We use two different identitied for the same object to determine the two |
634 | | // different insertions in the map. |
635 | 0 | static Symbol EnumValue(EnumValueDescriptor* value, int n) { |
636 | 0 | Symbol s; |
637 | 0 | internal::SymbolBase* ptr; |
638 | 0 | if (n == 0) { |
639 | 0 | ptr = static_cast<internal::SymbolBaseN<0>*>(value); |
640 | 0 | ptr->symbol_type_ = ENUM_VALUE; |
641 | 0 | } else { |
642 | 0 | ptr = static_cast<internal::SymbolBaseN<1>*>(value); |
643 | 0 | ptr->symbol_type_ = ENUM_VALUE_OTHER_PARENT; |
644 | 0 | } |
645 | 0 | s.ptr_ = ptr; |
646 | 0 | return s; |
647 | 0 | } |
648 | | |
649 | 0 | const EnumValueDescriptor* enum_value_descriptor() const { |
650 | 0 | return type() == ENUM_VALUE |
651 | 0 | ? static_cast<const EnumValueDescriptor*>( |
652 | 0 | static_cast<const internal::SymbolBaseN<0>*>(ptr_)) |
653 | 0 | : type() == ENUM_VALUE_OTHER_PARENT |
654 | 0 | ? static_cast<const EnumValueDescriptor*>( |
655 | 0 | static_cast<const internal::SymbolBaseN<1>*>(ptr_)) |
656 | 0 | : nullptr; |
657 | 0 | } |
658 | | |
659 | | #undef DEFINE_MEMBERS |
660 | | |
661 | 0 | Type type() const { return static_cast<Type>(ptr_->symbol_type_); } |
662 | 0 | bool IsNull() const { return type() == NULL_SYMBOL; } |
663 | 0 | bool IsType() const { return type() == MESSAGE || type() == ENUM; } |
664 | 0 | bool IsAggregate() const { |
665 | 0 | return IsType() || IsPackage() || type() == SERVICE; |
666 | 0 | } |
667 | 0 | bool IsPackage() const { |
668 | 0 | return type() == FULL_PACKAGE || type() == SUB_PACKAGE; |
669 | 0 | } |
670 | | |
671 | 0 | const FileDescriptor* GetFile() const { |
672 | 0 | switch (type()) { |
673 | 0 | case MESSAGE: |
674 | 0 | return descriptor()->file(); |
675 | 0 | case FIELD: |
676 | 0 | return field_descriptor()->file(); |
677 | 0 | case ONEOF: |
678 | 0 | return oneof_descriptor()->containing_type()->file(); |
679 | 0 | case ENUM: |
680 | 0 | return enum_descriptor()->file(); |
681 | 0 | case ENUM_VALUE: |
682 | 0 | return enum_value_descriptor()->type()->file(); |
683 | 0 | case SERVICE: |
684 | 0 | return service_descriptor()->file(); |
685 | 0 | case METHOD: |
686 | 0 | return method_descriptor()->service()->file(); |
687 | 0 | case FULL_PACKAGE: |
688 | 0 | return file_descriptor(); |
689 | 0 | case SUB_PACKAGE: |
690 | 0 | return sub_package_file_descriptor()->file; |
691 | 0 | default: |
692 | 0 | return nullptr; |
693 | 0 | } |
694 | 0 | } |
695 | | |
696 | 0 | absl::string_view full_name() const { |
697 | 0 | switch (type()) { |
698 | 0 | case MESSAGE: |
699 | 0 | return descriptor()->full_name(); |
700 | 0 | case FIELD: |
701 | 0 | return field_descriptor()->full_name(); |
702 | 0 | case ONEOF: |
703 | 0 | return oneof_descriptor()->full_name(); |
704 | 0 | case ENUM: |
705 | 0 | return enum_descriptor()->full_name(); |
706 | 0 | case ENUM_VALUE: |
707 | 0 | return enum_value_descriptor()->full_name(); |
708 | 0 | case SERVICE: |
709 | 0 | return service_descriptor()->full_name(); |
710 | 0 | case METHOD: |
711 | 0 | return method_descriptor()->full_name(); |
712 | 0 | case FULL_PACKAGE: |
713 | 0 | return file_descriptor()->package(); |
714 | 0 | case SUB_PACKAGE: |
715 | 0 | return absl::string_view(sub_package_file_descriptor()->file->package()) |
716 | 0 | .substr(0, sub_package_file_descriptor()->name_size); |
717 | 0 | default: |
718 | 0 | ABSL_CHECK(false); |
719 | 0 | } |
720 | 0 | return ""; |
721 | 0 | } |
722 | | |
723 | 0 | std::pair<const void*, absl::string_view> parent_name_key() const { |
724 | 0 | const auto or_file = [&](const void* p) { return p ? p : GetFile(); }; |
725 | 0 | switch (type()) { |
726 | 0 | case MESSAGE: |
727 | 0 | return {or_file(descriptor()->containing_type()), descriptor()->name()}; |
728 | 0 | case FIELD: { |
729 | 0 | auto* field = field_descriptor(); |
730 | 0 | return {or_file(field->is_extension() ? field->extension_scope() |
731 | 0 | : field->containing_type()), |
732 | 0 | field->name()}; |
733 | 0 | } |
734 | 0 | case ONEOF: |
735 | 0 | return {oneof_descriptor()->containing_type(), |
736 | 0 | oneof_descriptor()->name()}; |
737 | 0 | case ENUM: |
738 | 0 | return {or_file(enum_descriptor()->containing_type()), |
739 | 0 | enum_descriptor()->name()}; |
740 | 0 | case ENUM_VALUE: |
741 | 0 | return {or_file(enum_value_descriptor()->type()->containing_type()), |
742 | 0 | enum_value_descriptor()->name()}; |
743 | 0 | case ENUM_VALUE_OTHER_PARENT: |
744 | 0 | return {enum_value_descriptor()->type(), |
745 | 0 | enum_value_descriptor()->name()}; |
746 | 0 | case SERVICE: |
747 | 0 | return {GetFile(), service_descriptor()->name()}; |
748 | 0 | case METHOD: |
749 | 0 | return {method_descriptor()->service(), method_descriptor()->name()}; |
750 | 0 | default: |
751 | 0 | ABSL_CHECK(false); |
752 | 0 | } |
753 | 0 | return {}; |
754 | 0 | } |
755 | | |
756 | | private: |
757 | | const internal::SymbolBase* ptr_; |
758 | | }; |
759 | | |
760 | | const FieldDescriptor::CppType |
761 | | FieldDescriptor::kTypeToCppTypeMap[MAX_TYPE + 1] = { |
762 | | static_cast<CppType>(0), // 0 is reserved for errors |
763 | | |
764 | | CPPTYPE_DOUBLE, // TYPE_DOUBLE |
765 | | CPPTYPE_FLOAT, // TYPE_FLOAT |
766 | | CPPTYPE_INT64, // TYPE_INT64 |
767 | | CPPTYPE_UINT64, // TYPE_UINT64 |
768 | | CPPTYPE_INT32, // TYPE_INT32 |
769 | | CPPTYPE_UINT64, // TYPE_FIXED64 |
770 | | CPPTYPE_UINT32, // TYPE_FIXED32 |
771 | | CPPTYPE_BOOL, // TYPE_BOOL |
772 | | CPPTYPE_STRING, // TYPE_STRING |
773 | | CPPTYPE_MESSAGE, // TYPE_GROUP |
774 | | CPPTYPE_MESSAGE, // TYPE_MESSAGE |
775 | | CPPTYPE_STRING, // TYPE_BYTES |
776 | | CPPTYPE_UINT32, // TYPE_UINT32 |
777 | | CPPTYPE_ENUM, // TYPE_ENUM |
778 | | CPPTYPE_INT32, // TYPE_SFIXED32 |
779 | | CPPTYPE_INT64, // TYPE_SFIXED64 |
780 | | CPPTYPE_INT32, // TYPE_SINT32 |
781 | | CPPTYPE_INT64, // TYPE_SINT64 |
782 | | }; |
783 | | |
784 | | const char* const FieldDescriptor::kTypeToName[MAX_TYPE + 1] = { |
785 | | "ERROR", // 0 is reserved for errors |
786 | | |
787 | | "double", // TYPE_DOUBLE |
788 | | "float", // TYPE_FLOAT |
789 | | "int64", // TYPE_INT64 |
790 | | "uint64", // TYPE_UINT64 |
791 | | "int32", // TYPE_INT32 |
792 | | "fixed64", // TYPE_FIXED64 |
793 | | "fixed32", // TYPE_FIXED32 |
794 | | "bool", // TYPE_BOOL |
795 | | "string", // TYPE_STRING |
796 | | "group", // TYPE_GROUP |
797 | | "message", // TYPE_MESSAGE |
798 | | "bytes", // TYPE_BYTES |
799 | | "uint32", // TYPE_UINT32 |
800 | | "enum", // TYPE_ENUM |
801 | | "sfixed32", // TYPE_SFIXED32 |
802 | | "sfixed64", // TYPE_SFIXED64 |
803 | | "sint32", // TYPE_SINT32 |
804 | | "sint64", // TYPE_SINT64 |
805 | | }; |
806 | | |
807 | | const char* const FieldDescriptor::kCppTypeToName[MAX_CPPTYPE + 1] = { |
808 | | "ERROR", // 0 is reserved for errors |
809 | | |
810 | | "int32", // CPPTYPE_INT32 |
811 | | "int64", // CPPTYPE_INT64 |
812 | | "uint32", // CPPTYPE_UINT32 |
813 | | "uint64", // CPPTYPE_UINT64 |
814 | | "double", // CPPTYPE_DOUBLE |
815 | | "float", // CPPTYPE_FLOAT |
816 | | "bool", // CPPTYPE_BOOL |
817 | | "enum", // CPPTYPE_ENUM |
818 | | "string", // CPPTYPE_STRING |
819 | | "message", // CPPTYPE_MESSAGE |
820 | | }; |
821 | | |
822 | | const char* const FieldDescriptor::kLabelToName[MAX_LABEL + 1] = { |
823 | | "ERROR", // 0 is reserved for errors |
824 | | |
825 | | "optional", // LABEL_OPTIONAL |
826 | | "required", // LABEL_REQUIRED |
827 | | "repeated", // LABEL_REPEATED |
828 | | }; |
829 | | |
830 | | PROTOBUF_IGNORE_DEPRECATION_START |
831 | 0 | const char* FileDescriptor::SyntaxName(FileDescriptor::Syntax syntax) { |
832 | 0 | switch (syntax) { |
833 | 0 | case SYNTAX_PROTO2: |
834 | 0 | return "proto2"; |
835 | 0 | case SYNTAX_PROTO3: |
836 | 0 | return "proto3"; |
837 | 0 | case SYNTAX_UNKNOWN: |
838 | 0 | return "unknown"; |
839 | 0 | } |
840 | 0 | ABSL_LOG(FATAL) << "can't reach here."; |
841 | 0 | return nullptr; |
842 | 0 | } |
843 | | PROTOBUF_IGNORE_DEPRECATION_STOP |
844 | | |
845 | | static const char* const kNonLinkedWeakMessageReplacementName = "google.protobuf.Empty"; |
846 | | |
847 | | #if !defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912) |
848 | | const int FieldDescriptor::kMaxNumber; |
849 | | const int FieldDescriptor::kFirstReservedNumber; |
850 | | const int FieldDescriptor::kLastReservedNumber; |
851 | | #endif |
852 | | |
853 | | namespace { |
854 | | |
855 | 0 | std::string EnumValueToPascalCase(const std::string& input) { |
856 | 0 | bool next_upper = true; |
857 | 0 | std::string result; |
858 | 0 | result.reserve(input.size()); |
859 | |
|
860 | 0 | for (char character : input) { |
861 | 0 | if (character == '_') { |
862 | 0 | next_upper = true; |
863 | 0 | } else { |
864 | 0 | if (next_upper) { |
865 | 0 | result.push_back(absl::ascii_toupper(character)); |
866 | 0 | } else { |
867 | 0 | result.push_back(absl::ascii_tolower(character)); |
868 | 0 | } |
869 | 0 | next_upper = false; |
870 | 0 | } |
871 | 0 | } |
872 | |
|
873 | 0 | return result; |
874 | 0 | } |
875 | | |
876 | | // Class to remove an enum prefix from enum values. |
877 | | class PrefixRemover { |
878 | | public: |
879 | 0 | PrefixRemover(absl::string_view prefix) { |
880 | | // Strip underscores and lower-case the prefix. |
881 | 0 | for (char character : prefix) { |
882 | 0 | if (character != '_') { |
883 | 0 | prefix_ += absl::ascii_tolower(character); |
884 | 0 | } |
885 | 0 | } |
886 | 0 | } |
887 | | |
888 | | // Tries to remove the enum prefix from this enum value. |
889 | | // If this is not possible, returns the input verbatim. |
890 | 0 | std::string MaybeRemove(absl::string_view str) { |
891 | | // We can't just lowercase and strip str and look for a prefix. |
892 | | // We need to properly recognize the difference between: |
893 | | // |
894 | | // enum Foo { |
895 | | // FOO_BAR_BAZ = 0; |
896 | | // FOO_BARBAZ = 1; |
897 | | // } |
898 | | // |
899 | | // This is acceptable (though perhaps not advisable) because even when |
900 | | // we PascalCase, these two will still be distinct (BarBaz vs. Barbaz). |
901 | 0 | size_t i, j; |
902 | | |
903 | | // Skip past prefix_ in str if we can. |
904 | 0 | for (i = 0, j = 0; i < str.size() && j < prefix_.size(); i++) { |
905 | 0 | if (str[i] == '_') { |
906 | 0 | continue; |
907 | 0 | } |
908 | | |
909 | 0 | if (absl::ascii_tolower(str[i]) != prefix_[j++]) { |
910 | 0 | return std::string(str); |
911 | 0 | } |
912 | 0 | } |
913 | | |
914 | | // If we didn't make it through the prefix, we've failed to strip the |
915 | | // prefix. |
916 | 0 | if (j < prefix_.size()) { |
917 | 0 | return std::string(str); |
918 | 0 | } |
919 | | |
920 | | // Skip underscores between prefix and further characters. |
921 | 0 | while (i < str.size() && str[i] == '_') { |
922 | 0 | i++; |
923 | 0 | } |
924 | | |
925 | | // Enum label can't be the empty string. |
926 | 0 | if (i == str.size()) { |
927 | 0 | return std::string(str); |
928 | 0 | } |
929 | | |
930 | | // We successfully stripped the prefix. |
931 | 0 | str.remove_prefix(i); |
932 | 0 | return std::string(str); |
933 | 0 | } |
934 | | |
935 | | private: |
936 | | std::string prefix_; |
937 | | }; |
938 | | |
939 | | // A DescriptorPool contains a bunch of hash-maps to implement the |
940 | | // various Find*By*() methods. Since hashtable lookups are O(1), it's |
941 | | // most efficient to construct a fixed set of large hash-maps used by |
942 | | // all objects in the pool rather than construct one or more small |
943 | | // hash-maps for each object. |
944 | | // |
945 | | // The keys to these hash-maps are (parent, name) or (parent, number) pairs. |
946 | | struct FullNameQuery { |
947 | | absl::string_view query; |
948 | 0 | absl::string_view full_name() const { return query; } |
949 | | }; |
950 | | struct SymbolByFullNameHash { |
951 | | using is_transparent = void; |
952 | | |
953 | | template <typename T> |
954 | 0 | size_t operator()(const T& s) const { |
955 | 0 | return absl::HashOf(s.full_name()); |
956 | 0 | } Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::SymbolByFullNameHash::operator()<google::protobuf::(anonymous namespace)::FullNameQuery>(google::protobuf::(anonymous namespace)::FullNameQuery const&) const Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::SymbolByFullNameHash::operator()<google::protobuf::Symbol>(google::protobuf::Symbol const&) const |
957 | | }; |
958 | | struct SymbolByFullNameEq { |
959 | | using is_transparent = void; |
960 | | |
961 | | template <typename T, typename U> |
962 | 0 | bool operator()(const T& a, const U& b) const { |
963 | 0 | return a.full_name() == b.full_name(); |
964 | 0 | } Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::SymbolByFullNameEq::operator()<google::protobuf::Symbol, google::protobuf::(anonymous namespace)::FullNameQuery>(google::protobuf::Symbol const&, google::protobuf::(anonymous namespace)::FullNameQuery const&) const Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::SymbolByFullNameEq::operator()<google::protobuf::Symbol, google::protobuf::Symbol>(google::protobuf::Symbol const&, google::protobuf::Symbol const&) const |
965 | | }; |
966 | | using SymbolsByNameSet = |
967 | | absl::flat_hash_set<Symbol, SymbolByFullNameHash, SymbolByFullNameEq>; |
968 | | |
969 | | struct ParentNameQuery { |
970 | | std::pair<const void*, absl::string_view> query; |
971 | 0 | std::pair<const void*, absl::string_view> parent_name_key() const { |
972 | 0 | return query; |
973 | 0 | } |
974 | | }; |
975 | | struct SymbolByParentHash { |
976 | | using is_transparent = void; |
977 | | |
978 | | template <typename T> |
979 | 0 | size_t operator()(const T& s) const { |
980 | 0 | return absl::HashOf(s.parent_name_key()); |
981 | 0 | } Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::SymbolByParentHash::operator()<google::protobuf::(anonymous namespace)::ParentNameQuery>(google::protobuf::(anonymous namespace)::ParentNameQuery const&) const Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::SymbolByParentHash::operator()<google::protobuf::Symbol>(google::protobuf::Symbol const&) const |
982 | | }; |
983 | | struct SymbolByParentEq { |
984 | | using is_transparent = void; |
985 | | |
986 | | template <typename T, typename U> |
987 | 0 | bool operator()(const T& a, const U& b) const { |
988 | 0 | return a.parent_name_key() == b.parent_name_key(); |
989 | 0 | } Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::SymbolByParentEq::operator()<google::protobuf::Symbol, google::protobuf::(anonymous namespace)::ParentNameQuery>(google::protobuf::Symbol const&, google::protobuf::(anonymous namespace)::ParentNameQuery const&) const Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::SymbolByParentEq::operator()<google::protobuf::Symbol, google::protobuf::Symbol>(google::protobuf::Symbol const&, google::protobuf::Symbol const&) const |
990 | | }; |
991 | | using SymbolsByParentSet = |
992 | | absl::flat_hash_set<Symbol, SymbolByParentHash, SymbolByParentEq>; |
993 | | |
994 | | template <typename DescriptorT> |
995 | | struct DescriptorsByNameHash { |
996 | | using is_transparent = void; |
997 | | |
998 | 0 | size_t operator()(absl::string_view name) const { return absl::HashOf(name); } Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::DescriptorsByNameHash<google::protobuf::FileDescriptor>::operator()(absl::lts_20230125::string_view) const Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::DescriptorsByNameHash<google::protobuf::Descriptor>::operator()(absl::lts_20230125::string_view) const |
999 | | |
1000 | 0 | size_t operator()(const DescriptorT* file) const { |
1001 | 0 | return absl::HashOf(file->name()); |
1002 | 0 | } Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::DescriptorsByNameHash<google::protobuf::FileDescriptor>::operator()(google::protobuf::FileDescriptor const*) const Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::DescriptorsByNameHash<google::protobuf::Descriptor>::operator()(google::protobuf::Descriptor const*) const |
1003 | | }; |
1004 | | |
1005 | | template <typename DescriptorT> |
1006 | | struct DescriptorsByNameEq { |
1007 | | using is_transparent = void; |
1008 | | |
1009 | | bool operator()(absl::string_view lhs, absl::string_view rhs) const { |
1010 | | return lhs == rhs; |
1011 | | } |
1012 | | bool operator()(absl::string_view lhs, const DescriptorT* rhs) const { |
1013 | | return lhs == rhs->name(); |
1014 | | } |
1015 | 0 | bool operator()(const DescriptorT* lhs, absl::string_view rhs) const { |
1016 | 0 | return lhs->name() == rhs; |
1017 | 0 | } Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::DescriptorsByNameEq<google::protobuf::FileDescriptor>::operator()(google::protobuf::FileDescriptor const*, absl::lts_20230125::string_view) const Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::DescriptorsByNameEq<google::protobuf::Descriptor>::operator()(google::protobuf::Descriptor const*, absl::lts_20230125::string_view) const |
1018 | 0 | bool operator()(const DescriptorT* lhs, const DescriptorT* rhs) const { |
1019 | 0 | return lhs == rhs || lhs->name() == rhs->name(); |
1020 | 0 | } Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::DescriptorsByNameEq<google::protobuf::FileDescriptor>::operator()(google::protobuf::FileDescriptor const*, google::protobuf::FileDescriptor const*) const Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::DescriptorsByNameEq<google::protobuf::Descriptor>::operator()(google::protobuf::Descriptor const*, google::protobuf::Descriptor const*) const |
1021 | | }; |
1022 | | |
1023 | | template <typename DescriptorT> |
1024 | | using DescriptorsByNameSet = |
1025 | | absl::flat_hash_set<const DescriptorT*, DescriptorsByNameHash<DescriptorT>, |
1026 | | DescriptorsByNameEq<DescriptorT>>; |
1027 | | |
1028 | | using FieldsByNameMap = |
1029 | | absl::flat_hash_map<std::pair<const void*, absl::string_view>, |
1030 | | const FieldDescriptor*>; |
1031 | | |
1032 | | struct ParentNumberQuery { |
1033 | | std::pair<const void*, int> query; |
1034 | | }; |
1035 | 0 | std::pair<const void*, int> ObjectToParentNumber(const FieldDescriptor* field) { |
1036 | 0 | return {field->containing_type(), field->number()}; |
1037 | 0 | } |
1038 | | std::pair<const void*, int> ObjectToParentNumber( |
1039 | 0 | const EnumValueDescriptor* enum_value) { |
1040 | 0 | return {enum_value->type(), enum_value->number()}; |
1041 | 0 | } |
1042 | 0 | std::pair<const void*, int> ObjectToParentNumber(ParentNumberQuery query) { |
1043 | 0 | return query.query; |
1044 | 0 | } |
1045 | | struct ParentNumberHash { |
1046 | | using is_transparent = void; |
1047 | | |
1048 | | template <typename T> |
1049 | 0 | size_t operator()(const T& t) const { |
1050 | 0 | return absl::HashOf(ObjectToParentNumber(t)); |
1051 | 0 | } Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::ParentNumberHash::operator()<google::protobuf::(anonymous namespace)::ParentNumberQuery>(google::protobuf::(anonymous namespace)::ParentNumberQuery const&) const Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::ParentNumberHash::operator()<google::protobuf::EnumValueDescriptor*>(google::protobuf::EnumValueDescriptor* const&) const Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::ParentNumberHash::operator()<google::protobuf::EnumValueDescriptor const*>(google::protobuf::EnumValueDescriptor const* const&) const Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::ParentNumberHash::operator()<google::protobuf::FieldDescriptor*>(google::protobuf::FieldDescriptor* const&) const Unexecuted instantiation: descriptor.cc:unsigned long google::protobuf::(anonymous namespace)::ParentNumberHash::operator()<google::protobuf::FieldDescriptor const*>(google::protobuf::FieldDescriptor const* const&) const |
1052 | | }; |
1053 | | struct ParentNumberEq { |
1054 | | using is_transparent = void; |
1055 | | |
1056 | | template <typename T, typename U> |
1057 | 0 | bool operator()(const T& a, const U& b) const { |
1058 | 0 | return ObjectToParentNumber(a) == ObjectToParentNumber(b); |
1059 | 0 | } Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::ParentNumberEq::operator()<google::protobuf::FieldDescriptor const*, google::protobuf::(anonymous namespace)::ParentNumberQuery>(google::protobuf::FieldDescriptor const* const&, google::protobuf::(anonymous namespace)::ParentNumberQuery const&) const Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::ParentNumberEq::operator()<google::protobuf::EnumValueDescriptor const*, google::protobuf::(anonymous namespace)::ParentNumberQuery>(google::protobuf::EnumValueDescriptor const* const&, google::protobuf::(anonymous namespace)::ParentNumberQuery const&) const Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::ParentNumberEq::operator()<google::protobuf::EnumValueDescriptor const*, google::protobuf::EnumValueDescriptor*>(google::protobuf::EnumValueDescriptor const* const&, google::protobuf::EnumValueDescriptor* const&) const Unexecuted instantiation: descriptor.cc:bool google::protobuf::(anonymous namespace)::ParentNumberEq::operator()<google::protobuf::FieldDescriptor const*, google::protobuf::FieldDescriptor*>(google::protobuf::FieldDescriptor const* const&, google::protobuf::FieldDescriptor* const&) const |
1060 | | }; |
1061 | | using FieldsByNumberSet = absl::flat_hash_set<const FieldDescriptor*, |
1062 | | ParentNumberHash, ParentNumberEq>; |
1063 | | using EnumValuesByNumberSet = |
1064 | | absl::flat_hash_set<const EnumValueDescriptor*, ParentNumberHash, |
1065 | | ParentNumberEq>; |
1066 | | |
1067 | | // This is a map rather than a hash-map, since we use it to iterate |
1068 | | // through all the extensions that extend a given Descriptor, and an |
1069 | | // ordered data structure that implements lower_bound is convenient |
1070 | | // for that. |
1071 | | using ExtensionsGroupedByDescriptorMap = |
1072 | | absl::btree_map<std::pair<const Descriptor*, int>, const FieldDescriptor*>; |
1073 | | using LocationsByPathMap = |
1074 | | absl::flat_hash_map<std::string, const SourceCodeInfo_Location*>; |
1075 | | |
1076 | 0 | absl::flat_hash_set<std::string>* NewAllowedProto3Extendee() { |
1077 | 0 | const char* kOptionNames[] = { |
1078 | 0 | "FileOptions", "MessageOptions", "FieldOptions", |
1079 | 0 | "EnumOptions", "EnumValueOptions", "ServiceOptions", |
1080 | 0 | "MethodOptions", "OneofOptions", "ExtensionRangeOptions"}; |
1081 | 0 | auto allowed_proto3_extendees = new absl::flat_hash_set<std::string>(); |
1082 | 0 | allowed_proto3_extendees->reserve(sizeof(kOptionNames) / |
1083 | 0 | sizeof(kOptionNames[0])); |
1084 | |
|
1085 | 0 | for (const char* option_name : kOptionNames) { |
1086 | | // descriptor.proto has a different package name in opensource. We allow |
1087 | | // both so the opensource protocol compiler can also compile internal |
1088 | | // proto3 files with custom options. See: b/27567912 |
1089 | 0 | allowed_proto3_extendees->insert(std::string("google.protobuf.") + |
1090 | 0 | option_name); |
1091 | | // Split the word to trick the opensource processing scripts so they |
1092 | | // will keep the original package name. |
1093 | 0 | allowed_proto3_extendees->insert(std::string("proto2.") + option_name); |
1094 | 0 | } |
1095 | 0 | return allowed_proto3_extendees; |
1096 | 0 | } |
1097 | | |
1098 | | // Checks whether the extendee type is allowed in proto3. |
1099 | | // Only extensions to descriptor options are allowed. We use name comparison |
1100 | | // instead of comparing the descriptor directly because the extensions may be |
1101 | | // defined in a different pool. |
1102 | 0 | bool AllowedExtendeeInProto3(const std::string& name) { |
1103 | 0 | static auto allowed_proto3_extendees = |
1104 | 0 | internal::OnShutdownDelete(NewAllowedProto3Extendee()); |
1105 | 0 | return allowed_proto3_extendees->find(name) != |
1106 | 0 | allowed_proto3_extendees->end(); |
1107 | 0 | } |
1108 | | |
1109 | | } // anonymous namespace |
1110 | | |
1111 | | // Contains tables specific to a particular file. These tables are not |
1112 | | // modified once the file has been constructed, so they need not be |
1113 | | // protected by a mutex. This makes operations that depend only on the |
1114 | | // contents of a single file -- e.g. Descriptor::FindFieldByName() -- |
1115 | | // lock-free. |
1116 | | // |
1117 | | // For historical reasons, the definitions of the methods of |
1118 | | // FileDescriptorTables and DescriptorPool::Tables are interleaved below. |
1119 | | // These used to be a single class. |
1120 | | class FileDescriptorTables { |
1121 | | public: |
1122 | | FileDescriptorTables(); |
1123 | | ~FileDescriptorTables(); |
1124 | | |
1125 | | // Empty table, used with placeholder files. |
1126 | | inline static const FileDescriptorTables& GetEmptyInstance(); |
1127 | | |
1128 | | // ----------------------------------------------------------------- |
1129 | | // Finding items. |
1130 | | |
1131 | | // Returns a null Symbol (symbol.IsNull() is true) if not found. |
1132 | | // TODO(sbenza): All callers to this function know the type they are looking |
1133 | | // for. If we propagate that information statically we can make the query |
1134 | | // faster. |
1135 | | inline Symbol FindNestedSymbol(const void* parent, |
1136 | | absl::string_view name) const; |
1137 | | |
1138 | | // These return nullptr if not found. |
1139 | | inline const FieldDescriptor* FindFieldByNumber(const Descriptor* parent, |
1140 | | int number) const; |
1141 | | inline const FieldDescriptor* FindFieldByLowercaseName( |
1142 | | const void* parent, absl::string_view lowercase_name) const; |
1143 | | inline const FieldDescriptor* FindFieldByCamelcaseName( |
1144 | | const void* parent, absl::string_view camelcase_name) const; |
1145 | | inline const EnumValueDescriptor* FindEnumValueByNumber( |
1146 | | const EnumDescriptor* parent, int number) const; |
1147 | | // This creates a new EnumValueDescriptor if not found, in a thread-safe way. |
1148 | | inline const EnumValueDescriptor* FindEnumValueByNumberCreatingIfUnknown( |
1149 | | const EnumDescriptor* parent, int number) const; |
1150 | | |
1151 | | // ----------------------------------------------------------------- |
1152 | | // Adding items. |
1153 | | |
1154 | | // These add items to the corresponding tables. They return false if |
1155 | | // the key already exists in the table. |
1156 | | bool AddAliasUnderParent(const void* parent, absl::string_view name, |
1157 | | Symbol symbol); |
1158 | | bool AddFieldByNumber(FieldDescriptor* field); |
1159 | | bool AddEnumValueByNumber(EnumValueDescriptor* value); |
1160 | | |
1161 | | // Populates p->first->locations_by_path_ from p->second. |
1162 | | // Unusual signature dictated by absl::call_once. |
1163 | | static void BuildLocationsByPath( |
1164 | | std::pair<const FileDescriptorTables*, const SourceCodeInfo*>* p); |
1165 | | |
1166 | | // Returns the location denoted by the specified path through info, |
1167 | | // or nullptr if not found. |
1168 | | // The value of info must be that of the corresponding FileDescriptor. |
1169 | | // (Conceptually a pure function, but stateful as an optimisation.) |
1170 | | const SourceCodeInfo_Location* GetSourceLocation( |
1171 | | const std::vector<int>& path, const SourceCodeInfo* info) const; |
1172 | | |
1173 | | // Must be called after BuildFileImpl(), even if the build failed and |
1174 | | // we are going to roll back to the last checkpoint. |
1175 | | void FinalizeTables(); |
1176 | | |
1177 | | private: |
1178 | | const void* FindParentForFieldsByMap(const FieldDescriptor* field) const; |
1179 | | static void FieldsByLowercaseNamesLazyInitStatic( |
1180 | | const FileDescriptorTables* tables); |
1181 | | void FieldsByLowercaseNamesLazyInitInternal() const; |
1182 | | static void FieldsByCamelcaseNamesLazyInitStatic( |
1183 | | const FileDescriptorTables* tables); |
1184 | | void FieldsByCamelcaseNamesLazyInitInternal() const; |
1185 | | |
1186 | | SymbolsByParentSet symbols_by_parent_; |
1187 | | mutable absl::once_flag fields_by_lowercase_name_once_; |
1188 | | mutable absl::once_flag fields_by_camelcase_name_once_; |
1189 | | // Make these fields atomic to avoid race conditions with |
1190 | | // GetEstimatedOwnedMemoryBytesSize. Once the pointer is set the map won't |
1191 | | // change anymore. |
1192 | | mutable std::atomic<const FieldsByNameMap*> fields_by_lowercase_name_{}; |
1193 | | mutable std::atomic<const FieldsByNameMap*> fields_by_camelcase_name_{}; |
1194 | | FieldsByNumberSet fields_by_number_; // Not including extensions. |
1195 | | EnumValuesByNumberSet enum_values_by_number_; |
1196 | | mutable EnumValuesByNumberSet unknown_enum_values_by_number_ |
1197 | | PROTOBUF_GUARDED_BY(unknown_enum_values_mu_); |
1198 | | |
1199 | | // Populated on first request to save space, hence constness games. |
1200 | | mutable absl::once_flag locations_by_path_once_; |
1201 | | mutable LocationsByPathMap locations_by_path_; |
1202 | | |
1203 | | // Mutex to protect the unknown-enum-value map due to dynamic |
1204 | | // EnumValueDescriptor creation on unknown values. |
1205 | | mutable absl::Mutex unknown_enum_values_mu_; |
1206 | | }; |
1207 | | |
1208 | | namespace internal { |
1209 | | |
1210 | | // Small sequential allocator to be used within a single file. |
1211 | | // Most of the memory for a single FileDescriptor and everything under it is |
1212 | | // allocated in a single block of memory, with the FlatAllocator giving it out |
1213 | | // in parts later. |
1214 | | // The code first plans the total number of bytes needed by calling PlanArray |
1215 | | // with all the allocations that will happen afterwards, then calls |
1216 | | // FinalizePlanning passing the underlying allocator (the DescriptorPool::Tables |
1217 | | // instance), and then proceeds to get the memory via |
1218 | | // `AllocateArray`/`AllocateString` calls. The calls to PlanArray and |
1219 | | // The calls have to match between planning and allocating, though not |
1220 | | // necessarily in the same order. |
1221 | | class FlatAllocator |
1222 | | : public decltype(ApplyTypeList<FlatAllocatorImpl>( |
1223 | | SortByAlignment<char, std::string, SourceCodeInfo, |
1224 | | FileDescriptorTables, |
1225 | | // Option types |
1226 | | MessageOptions, FieldOptions, EnumOptions, |
1227 | | EnumValueOptions, ExtensionRangeOptions, OneofOptions, |
1228 | | ServiceOptions, MethodOptions, FileOptions>())) { |
1229 | | }; |
1230 | | |
1231 | | } // namespace internal |
1232 | | |
1233 | | // =================================================================== |
1234 | | // DescriptorPool::Tables |
1235 | | |
1236 | | class DescriptorPool::Tables { |
1237 | | public: |
1238 | | Tables(); |
1239 | | ~Tables(); |
1240 | | |
1241 | | // Record the current state of the tables to the stack of checkpoints. |
1242 | | // Each call to AddCheckpoint() must be paired with exactly one call to either |
1243 | | // ClearLastCheckpoint() or RollbackToLastCheckpoint(). |
1244 | | // |
1245 | | // This is used when building files, since some kinds of validation errors |
1246 | | // cannot be detected until the file's descriptors have already been added to |
1247 | | // the tables. |
1248 | | // |
1249 | | // This supports recursive checkpoints, since building a file may trigger |
1250 | | // recursive building of other files. Note that recursive checkpoints are not |
1251 | | // normally necessary; explicit dependencies are built prior to checkpointing. |
1252 | | // So although we recursively build transitive imports, there is at most one |
1253 | | // checkpoint in the stack during dependency building. |
1254 | | // |
1255 | | // Recursive checkpoints only arise during cross-linking of the descriptors. |
1256 | | // Symbol references must be resolved, via DescriptorBuilder::FindSymbol and |
1257 | | // friends. If the pending file references an unknown symbol |
1258 | | // (e.g., it is not defined in the pending file's explicit dependencies), and |
1259 | | // the pool is using a fallback database, and that database contains a file |
1260 | | // defining that symbol, and that file has not yet been built by the pool, |
1261 | | // the pool builds the file during cross-linking, leading to another |
1262 | | // checkpoint. |
1263 | | void AddCheckpoint(); |
1264 | | |
1265 | | // Mark the last checkpoint as having cleared successfully, removing it from |
1266 | | // the stack. If the stack is empty, all pending symbols will be committed. |
1267 | | // |
1268 | | // Note that this does not guarantee that the symbols added since the last |
1269 | | // checkpoint won't be rolled back: if a checkpoint gets rolled back, |
1270 | | // everything past that point gets rolled back, including symbols added after |
1271 | | // checkpoints that were pushed onto the stack after it and marked as cleared. |
1272 | | void ClearLastCheckpoint(); |
1273 | | |
1274 | | // Roll back the Tables to the state of the checkpoint at the top of the |
1275 | | // stack, removing everything that was added after that point. |
1276 | | void RollbackToLastCheckpoint(); |
1277 | | |
1278 | | // The stack of files which are currently being built. Used to detect |
1279 | | // cyclic dependencies when loading files from a DescriptorDatabase. Not |
1280 | | // used when fallback_database_ == nullptr. |
1281 | | std::vector<std::string> pending_files_; |
1282 | | |
1283 | | // A set of files which we have tried to load from the fallback database |
1284 | | // and encountered errors. We will not attempt to load them again during |
1285 | | // execution of the current public API call, but for compatibility with |
1286 | | // legacy clients, this is cleared at the beginning of each public API call. |
1287 | | // Not used when fallback_database_ == nullptr. |
1288 | | absl::flat_hash_set<std::string> known_bad_files_; |
1289 | | |
1290 | | // A set of symbols which we have tried to load from the fallback database |
1291 | | // and encountered errors. We will not attempt to load them again during |
1292 | | // execution of the current public API call, but for compatibility with |
1293 | | // legacy clients, this is cleared at the beginning of each public API call. |
1294 | | absl::flat_hash_set<std::string> known_bad_symbols_; |
1295 | | |
1296 | | // The set of descriptors for which we've already loaded the full |
1297 | | // set of extensions numbers from fallback_database_. |
1298 | | absl::flat_hash_set<const Descriptor*> extensions_loaded_from_db_; |
1299 | | |
1300 | | // Maps type name to Descriptor::WellKnownType. This is logically global |
1301 | | // and const, but we make it a member here to simplify its construction and |
1302 | | // destruction. This only has 20-ish entries and is one per DescriptorPool, |
1303 | | // so the overhead is small. |
1304 | | absl::flat_hash_map<std::string, Descriptor::WellKnownType> well_known_types_; |
1305 | | |
1306 | | // ----------------------------------------------------------------- |
1307 | | // Finding items. |
1308 | | |
1309 | | // Find symbols. This returns a null Symbol (symbol.IsNull() is true) |
1310 | | // if not found. |
1311 | | inline Symbol FindSymbol(absl::string_view key) const; |
1312 | | |
1313 | | // This implements the body of DescriptorPool::Find*ByName(). It should |
1314 | | // really be a private method of DescriptorPool, but that would require |
1315 | | // declaring Symbol in descriptor.h, which would drag all kinds of other |
1316 | | // stuff into the header. Yay C++. |
1317 | | Symbol FindByNameHelper(const DescriptorPool* pool, absl::string_view name); |
1318 | | |
1319 | | // These return nullptr if not found. |
1320 | | inline const FileDescriptor* FindFile(absl::string_view key) const; |
1321 | | inline const FieldDescriptor* FindExtension(const Descriptor* extendee, |
1322 | | int number) const; |
1323 | | inline void FindAllExtensions(const Descriptor* extendee, |
1324 | | std::vector<const FieldDescriptor*>* out) const; |
1325 | | |
1326 | | // ----------------------------------------------------------------- |
1327 | | // Adding items. |
1328 | | |
1329 | | // These add items to the corresponding tables. They return false if |
1330 | | // the key already exists in the table. For AddSymbol(), the string passed |
1331 | | // in must be one that was constructed using AllocateString(), as it will |
1332 | | // be used as a key in the symbols_by_name_ map without copying. |
1333 | | bool AddSymbol(absl::string_view full_name, Symbol symbol); |
1334 | | bool AddFile(const FileDescriptor* file); |
1335 | | bool AddExtension(const FieldDescriptor* field); |
1336 | | |
1337 | | // ----------------------------------------------------------------- |
1338 | | // Allocating memory. |
1339 | | |
1340 | | // Allocate an object which will be reclaimed when the pool is |
1341 | | // destroyed. Note that the object's destructor will never be called, |
1342 | | // so its fields must be plain old data (primitive data types and |
1343 | | // pointers). All of the descriptor types are such objects. |
1344 | | template <typename Type> |
1345 | | Type* Allocate(); |
1346 | | |
1347 | | // Allocate some bytes which will be reclaimed when the pool is |
1348 | | // destroyed. Memory is aligned to 8 bytes. |
1349 | | void* AllocateBytes(int size); |
1350 | | |
1351 | | // Create a FlatAllocation for the corresponding sizes. |
1352 | | // All objects within it will be default constructed. |
1353 | | // The whole allocation, including the non-trivial objects within, will be |
1354 | | // destroyed with the pool. |
1355 | | template <typename... T> |
1356 | | internal::FlatAllocator::Allocation* CreateFlatAlloc( |
1357 | | const TypeMap<IntT, T...>& sizes); |
1358 | | |
1359 | | |
1360 | | private: |
1361 | | // All memory allocated in the pool. Must be first as other objects can |
1362 | | // point into these. |
1363 | | struct MiscDeleter { |
1364 | 0 | void operator()(int* p) const { internal::SizedDelete(p, *p + 8); } |
1365 | | }; |
1366 | | // Miscellaneous allocations are length prefixed. The paylaod is 8 bytes after |
1367 | | // the `int` that contains the size. This keeps the payload aligned. |
1368 | | std::vector<std::unique_ptr<int, MiscDeleter>> misc_allocs_; |
1369 | | struct FlatAllocDeleter { |
1370 | 0 | void operator()(internal::FlatAllocator::Allocation* p) const { |
1371 | 0 | p->Destroy(); |
1372 | 0 | } |
1373 | | }; |
1374 | | std::vector< |
1375 | | std::unique_ptr<internal::FlatAllocator::Allocation, FlatAllocDeleter>> |
1376 | | flat_allocs_; |
1377 | | |
1378 | | SymbolsByNameSet symbols_by_name_; |
1379 | | DescriptorsByNameSet<FileDescriptor> files_by_name_; |
1380 | | ExtensionsGroupedByDescriptorMap extensions_; |
1381 | | |
1382 | | struct CheckPoint { |
1383 | | explicit CheckPoint(const Tables* tables) |
1384 | | : flat_allocations_before_checkpoint( |
1385 | | static_cast<int>(tables->flat_allocs_.size())), |
1386 | | misc_allocations_before_checkpoint( |
1387 | | static_cast<int>(tables->misc_allocs_.size())), |
1388 | | pending_symbols_before_checkpoint( |
1389 | | tables->symbols_after_checkpoint_.size()), |
1390 | | pending_files_before_checkpoint( |
1391 | | tables->files_after_checkpoint_.size()), |
1392 | | pending_extensions_before_checkpoint( |
1393 | 0 | tables->extensions_after_checkpoint_.size()) {} |
1394 | | int flat_allocations_before_checkpoint; |
1395 | | int misc_allocations_before_checkpoint; |
1396 | | int pending_symbols_before_checkpoint; |
1397 | | int pending_files_before_checkpoint; |
1398 | | int pending_extensions_before_checkpoint; |
1399 | | }; |
1400 | | std::vector<CheckPoint> checkpoints_; |
1401 | | std::vector<Symbol> symbols_after_checkpoint_; |
1402 | | std::vector<const FileDescriptor*> files_after_checkpoint_; |
1403 | | std::vector<std::pair<const Descriptor*, int>> extensions_after_checkpoint_; |
1404 | | }; |
1405 | | |
1406 | 0 | DescriptorPool::Tables::Tables() { |
1407 | 0 | well_known_types_.insert({ |
1408 | 0 | {"google.protobuf.DoubleValue", Descriptor::WELLKNOWNTYPE_DOUBLEVALUE}, |
1409 | 0 | {"google.protobuf.FloatValue", Descriptor::WELLKNOWNTYPE_FLOATVALUE}, |
1410 | 0 | {"google.protobuf.Int64Value", Descriptor::WELLKNOWNTYPE_INT64VALUE}, |
1411 | 0 | {"google.protobuf.UInt64Value", Descriptor::WELLKNOWNTYPE_UINT64VALUE}, |
1412 | 0 | {"google.protobuf.Int32Value", Descriptor::WELLKNOWNTYPE_INT32VALUE}, |
1413 | 0 | {"google.protobuf.UInt32Value", Descriptor::WELLKNOWNTYPE_UINT32VALUE}, |
1414 | 0 | {"google.protobuf.StringValue", Descriptor::WELLKNOWNTYPE_STRINGVALUE}, |
1415 | 0 | {"google.protobuf.BytesValue", Descriptor::WELLKNOWNTYPE_BYTESVALUE}, |
1416 | 0 | {"google.protobuf.BoolValue", Descriptor::WELLKNOWNTYPE_BOOLVALUE}, |
1417 | 0 | {"google.protobuf.Any", Descriptor::WELLKNOWNTYPE_ANY}, |
1418 | 0 | {"google.protobuf.FieldMask", Descriptor::WELLKNOWNTYPE_FIELDMASK}, |
1419 | 0 | {"google.protobuf.Duration", Descriptor::WELLKNOWNTYPE_DURATION}, |
1420 | 0 | {"google.protobuf.Timestamp", Descriptor::WELLKNOWNTYPE_TIMESTAMP}, |
1421 | 0 | {"google.protobuf.Value", Descriptor::WELLKNOWNTYPE_VALUE}, |
1422 | 0 | {"google.protobuf.ListValue", Descriptor::WELLKNOWNTYPE_LISTVALUE}, |
1423 | 0 | {"google.protobuf.Struct", Descriptor::WELLKNOWNTYPE_STRUCT}, |
1424 | 0 | }); |
1425 | 0 | } |
1426 | | |
1427 | 0 | DescriptorPool::Tables::~Tables() { ABSL_DCHECK(checkpoints_.empty()); } |
1428 | | |
1429 | 0 | FileDescriptorTables::FileDescriptorTables() {} |
1430 | | |
1431 | 0 | FileDescriptorTables::~FileDescriptorTables() { |
1432 | 0 | delete fields_by_lowercase_name_.load(std::memory_order_acquire); |
1433 | 0 | delete fields_by_camelcase_name_.load(std::memory_order_acquire); |
1434 | 0 | } |
1435 | | |
1436 | 0 | inline const FileDescriptorTables& FileDescriptorTables::GetEmptyInstance() { |
1437 | 0 | static auto file_descriptor_tables = |
1438 | 0 | internal::OnShutdownDelete(new FileDescriptorTables()); |
1439 | 0 | return *file_descriptor_tables; |
1440 | 0 | } |
1441 | | |
1442 | 0 | void DescriptorPool::Tables::AddCheckpoint() { |
1443 | 0 | checkpoints_.emplace_back(this); |
1444 | 0 | } |
1445 | | |
1446 | 0 | void DescriptorPool::Tables::ClearLastCheckpoint() { |
1447 | 0 | ABSL_DCHECK(!checkpoints_.empty()); |
1448 | 0 | checkpoints_.pop_back(); |
1449 | 0 | if (checkpoints_.empty()) { |
1450 | | // All checkpoints have been cleared: we can now commit all of the pending |
1451 | | // data. |
1452 | 0 | symbols_after_checkpoint_.clear(); |
1453 | 0 | files_after_checkpoint_.clear(); |
1454 | 0 | extensions_after_checkpoint_.clear(); |
1455 | 0 | } |
1456 | 0 | } |
1457 | | |
1458 | 0 | void DescriptorPool::Tables::RollbackToLastCheckpoint() { |
1459 | 0 | ABSL_DCHECK(!checkpoints_.empty()); |
1460 | 0 | const CheckPoint& checkpoint = checkpoints_.back(); |
1461 | |
|
1462 | 0 | for (size_t i = checkpoint.pending_symbols_before_checkpoint; |
1463 | 0 | i < symbols_after_checkpoint_.size(); i++) { |
1464 | 0 | symbols_by_name_.erase(symbols_after_checkpoint_[i]); |
1465 | 0 | } |
1466 | 0 | for (size_t i = checkpoint.pending_files_before_checkpoint; |
1467 | 0 | i < files_after_checkpoint_.size(); i++) { |
1468 | 0 | files_by_name_.erase(files_after_checkpoint_[i]); |
1469 | 0 | } |
1470 | 0 | for (size_t i = checkpoint.pending_extensions_before_checkpoint; |
1471 | 0 | i < extensions_after_checkpoint_.size(); i++) { |
1472 | 0 | extensions_.erase(extensions_after_checkpoint_[i]); |
1473 | 0 | } |
1474 | |
|
1475 | 0 | symbols_after_checkpoint_.resize( |
1476 | 0 | checkpoint.pending_symbols_before_checkpoint); |
1477 | 0 | files_after_checkpoint_.resize(checkpoint.pending_files_before_checkpoint); |
1478 | 0 | extensions_after_checkpoint_.resize( |
1479 | 0 | checkpoint.pending_extensions_before_checkpoint); |
1480 | |
|
1481 | 0 | flat_allocs_.resize(checkpoint.flat_allocations_before_checkpoint); |
1482 | 0 | misc_allocs_.resize(checkpoint.misc_allocations_before_checkpoint); |
1483 | 0 | checkpoints_.pop_back(); |
1484 | 0 | } |
1485 | | |
1486 | | // ------------------------------------------------------------------- |
1487 | | |
1488 | 0 | inline Symbol DescriptorPool::Tables::FindSymbol(absl::string_view key) const { |
1489 | 0 | auto it = symbols_by_name_.find(FullNameQuery{key}); |
1490 | 0 | return it == symbols_by_name_.end() ? Symbol() : *it; |
1491 | 0 | } |
1492 | | |
1493 | | inline Symbol FileDescriptorTables::FindNestedSymbol( |
1494 | 0 | const void* parent, absl::string_view name) const { |
1495 | 0 | auto it = symbols_by_parent_.find(ParentNameQuery{{parent, name}}); |
1496 | 0 | return it == symbols_by_parent_.end() ? Symbol() : *it; |
1497 | 0 | } |
1498 | | |
1499 | | Symbol DescriptorPool::Tables::FindByNameHelper(const DescriptorPool* pool, |
1500 | 0 | absl::string_view name) { |
1501 | 0 | if (pool->mutex_ != nullptr) { |
1502 | | // Fast path: the Symbol is already cached. This is just a hash lookup. |
1503 | 0 | absl::ReaderMutexLock lock(pool->mutex_); |
1504 | 0 | if (known_bad_symbols_.empty() && known_bad_files_.empty()) { |
1505 | 0 | Symbol result = FindSymbol(name); |
1506 | 0 | if (!result.IsNull()) return result; |
1507 | 0 | } |
1508 | 0 | } |
1509 | 0 | absl::MutexLockMaybe lock(pool->mutex_); |
1510 | 0 | if (pool->fallback_database_ != nullptr) { |
1511 | 0 | known_bad_symbols_.clear(); |
1512 | 0 | known_bad_files_.clear(); |
1513 | 0 | } |
1514 | 0 | Symbol result = FindSymbol(name); |
1515 | |
|
1516 | 0 | if (result.IsNull() && pool->underlay_ != nullptr) { |
1517 | | // Symbol not found; check the underlay. |
1518 | 0 | result = pool->underlay_->tables_->FindByNameHelper(pool->underlay_, name); |
1519 | 0 | } |
1520 | |
|
1521 | 0 | if (result.IsNull()) { |
1522 | | // Symbol still not found, so check fallback database. |
1523 | 0 | if (pool->TryFindSymbolInFallbackDatabase(name)) { |
1524 | 0 | result = FindSymbol(name); |
1525 | 0 | } |
1526 | 0 | } |
1527 | |
|
1528 | 0 | return result; |
1529 | 0 | } |
1530 | | |
1531 | | inline const FileDescriptor* DescriptorPool::Tables::FindFile( |
1532 | 0 | absl::string_view key) const { |
1533 | 0 | auto it = files_by_name_.find(key); |
1534 | 0 | if (it == files_by_name_.end()) return nullptr; |
1535 | 0 | return *it; |
1536 | 0 | } |
1537 | | |
1538 | | inline const FieldDescriptor* FileDescriptorTables::FindFieldByNumber( |
1539 | 0 | const Descriptor* parent, int number) const { |
1540 | | // If `number` is within the sequential range, just index into the parent |
1541 | | // without doing a table lookup. |
1542 | 0 | if (parent != nullptr && // |
1543 | 0 | 1 <= number && number <= parent->sequential_field_limit_) { |
1544 | 0 | return parent->field(number - 1); |
1545 | 0 | } |
1546 | | |
1547 | 0 | auto it = fields_by_number_.find(ParentNumberQuery{{parent, number}}); |
1548 | 0 | return it == fields_by_number_.end() ? nullptr : *it; |
1549 | 0 | } |
1550 | | |
1551 | | const void* FileDescriptorTables::FindParentForFieldsByMap( |
1552 | 0 | const FieldDescriptor* field) const { |
1553 | 0 | if (field->is_extension()) { |
1554 | 0 | if (field->extension_scope() == nullptr) { |
1555 | 0 | return field->file(); |
1556 | 0 | } else { |
1557 | 0 | return field->extension_scope(); |
1558 | 0 | } |
1559 | 0 | } else { |
1560 | 0 | return field->containing_type(); |
1561 | 0 | } |
1562 | 0 | } |
1563 | | |
1564 | | void FileDescriptorTables::FieldsByLowercaseNamesLazyInitStatic( |
1565 | 0 | const FileDescriptorTables* tables) { |
1566 | 0 | tables->FieldsByLowercaseNamesLazyInitInternal(); |
1567 | 0 | } |
1568 | | |
1569 | 0 | void FileDescriptorTables::FieldsByLowercaseNamesLazyInitInternal() const { |
1570 | 0 | auto* map = new FieldsByNameMap; |
1571 | 0 | for (Symbol symbol : symbols_by_parent_) { |
1572 | 0 | const FieldDescriptor* field = symbol.field_descriptor(); |
1573 | 0 | if (!field) continue; |
1574 | 0 | (*map)[{FindParentForFieldsByMap(field), field->lowercase_name().c_str()}] = |
1575 | 0 | field; |
1576 | 0 | } |
1577 | 0 | fields_by_lowercase_name_.store(map, std::memory_order_release); |
1578 | 0 | } |
1579 | | |
1580 | | inline const FieldDescriptor* FileDescriptorTables::FindFieldByLowercaseName( |
1581 | 0 | const void* parent, absl::string_view lowercase_name) const { |
1582 | 0 | absl::call_once(fields_by_lowercase_name_once_, |
1583 | 0 | &FileDescriptorTables::FieldsByLowercaseNamesLazyInitStatic, |
1584 | 0 | this); |
1585 | 0 | const auto* fields = |
1586 | 0 | fields_by_lowercase_name_.load(std::memory_order_acquire); |
1587 | 0 | auto it = fields->find({parent, lowercase_name}); |
1588 | 0 | if (it == fields->end()) return nullptr; |
1589 | 0 | return it->second; |
1590 | 0 | } |
1591 | | |
1592 | | void FileDescriptorTables::FieldsByCamelcaseNamesLazyInitStatic( |
1593 | 0 | const FileDescriptorTables* tables) { |
1594 | 0 | tables->FieldsByCamelcaseNamesLazyInitInternal(); |
1595 | 0 | } |
1596 | | |
1597 | 0 | void FileDescriptorTables::FieldsByCamelcaseNamesLazyInitInternal() const { |
1598 | 0 | auto* map = new FieldsByNameMap; |
1599 | 0 | for (Symbol symbol : symbols_by_parent_) { |
1600 | 0 | const FieldDescriptor* field = symbol.field_descriptor(); |
1601 | 0 | if (!field) continue; |
1602 | 0 | (*map)[{FindParentForFieldsByMap(field), field->camelcase_name().c_str()}] = |
1603 | 0 | field; |
1604 | 0 | } |
1605 | 0 | fields_by_camelcase_name_.store(map, std::memory_order_release); |
1606 | 0 | } |
1607 | | |
1608 | | inline const FieldDescriptor* FileDescriptorTables::FindFieldByCamelcaseName( |
1609 | 0 | const void* parent, absl::string_view camelcase_name) const { |
1610 | 0 | absl::call_once(fields_by_camelcase_name_once_, |
1611 | 0 | FileDescriptorTables::FieldsByCamelcaseNamesLazyInitStatic, |
1612 | 0 | this); |
1613 | 0 | auto* fields = fields_by_camelcase_name_.load(std::memory_order_acquire); |
1614 | 0 | auto it = fields->find({parent, camelcase_name}); |
1615 | 0 | if (it == fields->end()) return nullptr; |
1616 | 0 | return it->second; |
1617 | 0 | } |
1618 | | |
1619 | | inline const EnumValueDescriptor* FileDescriptorTables::FindEnumValueByNumber( |
1620 | 0 | const EnumDescriptor* parent, int number) const { |
1621 | | // If `number` is within the sequential range, just index into the parent |
1622 | | // without doing a table lookup. |
1623 | 0 | const int base = parent->value(0)->number(); |
1624 | 0 | if (base <= number && |
1625 | 0 | number <= static_cast<int64_t>(base) + parent->sequential_value_limit_) { |
1626 | 0 | return parent->value(number - base); |
1627 | 0 | } |
1628 | | |
1629 | 0 | auto it = enum_values_by_number_.find(ParentNumberQuery{{parent, number}}); |
1630 | 0 | return it == enum_values_by_number_.end() ? nullptr : *it; |
1631 | 0 | } |
1632 | | |
1633 | | inline const EnumValueDescriptor* |
1634 | | FileDescriptorTables::FindEnumValueByNumberCreatingIfUnknown( |
1635 | 0 | const EnumDescriptor* parent, int number) const { |
1636 | | // First try, with map of compiled-in values. |
1637 | 0 | { |
1638 | 0 | const auto* value = FindEnumValueByNumber(parent, number); |
1639 | 0 | if (value != nullptr) { |
1640 | 0 | return value; |
1641 | 0 | } |
1642 | 0 | } |
1643 | | |
1644 | 0 | const ParentNumberQuery query{{parent, number}}; |
1645 | | |
1646 | | // Second try, with reader lock held on unknown enum values: common case. |
1647 | 0 | { |
1648 | 0 | absl::ReaderMutexLock l(&unknown_enum_values_mu_); |
1649 | 0 | auto it = unknown_enum_values_by_number_.find(query); |
1650 | 0 | if (it != unknown_enum_values_by_number_.end()) { |
1651 | 0 | return *it; |
1652 | 0 | } |
1653 | 0 | } |
1654 | | // If not found, try again with writer lock held, and create new descriptor if |
1655 | | // necessary. |
1656 | 0 | { |
1657 | 0 | absl::WriterMutexLock l(&unknown_enum_values_mu_); |
1658 | 0 | auto it = unknown_enum_values_by_number_.find(query); |
1659 | 0 | if (it != unknown_enum_values_by_number_.end()) { |
1660 | 0 | return *it; |
1661 | 0 | } |
1662 | | |
1663 | | // Create an EnumValueDescriptor dynamically. We don't insert it into the |
1664 | | // EnumDescriptor (it's not a part of the enum as originally defined), but |
1665 | | // we do insert it into the table so that we can return the same pointer |
1666 | | // later. |
1667 | 0 | std::string enum_value_name = absl::StrFormat( |
1668 | 0 | "UNKNOWN_ENUM_VALUE_%s_%d", parent->name().c_str(), number); |
1669 | 0 | auto* pool = DescriptorPool::generated_pool(); |
1670 | 0 | auto* tables = const_cast<DescriptorPool::Tables*>(pool->tables_.get()); |
1671 | 0 | internal::FlatAllocator alloc; |
1672 | 0 | alloc.PlanArray<EnumValueDescriptor>(1); |
1673 | 0 | alloc.PlanArray<std::string>(2); |
1674 | |
|
1675 | 0 | { |
1676 | | // Must lock the pool because we will do allocations in the shared arena. |
1677 | 0 | absl::MutexLockMaybe l2(pool->mutex_); |
1678 | 0 | alloc.FinalizePlanning(tables); |
1679 | 0 | } |
1680 | 0 | EnumValueDescriptor* result = alloc.AllocateArray<EnumValueDescriptor>(1); |
1681 | 0 | result->all_names_ = alloc.AllocateStrings( |
1682 | 0 | enum_value_name, |
1683 | 0 | absl::StrCat(parent->full_name(), ".", enum_value_name)); |
1684 | 0 | result->number_ = number; |
1685 | 0 | result->type_ = parent; |
1686 | 0 | result->options_ = &EnumValueOptions::default_instance(); |
1687 | 0 | unknown_enum_values_by_number_.insert(result); |
1688 | 0 | return result; |
1689 | 0 | } |
1690 | 0 | } |
1691 | | |
1692 | | inline const FieldDescriptor* DescriptorPool::Tables::FindExtension( |
1693 | 0 | const Descriptor* extendee, int number) const { |
1694 | 0 | auto it = extensions_.find({extendee, number}); |
1695 | 0 | if (it == extensions_.end()) return nullptr; |
1696 | 0 | return it->second; |
1697 | 0 | } |
1698 | | |
1699 | | inline void DescriptorPool::Tables::FindAllExtensions( |
1700 | | const Descriptor* extendee, |
1701 | 0 | std::vector<const FieldDescriptor*>* out) const { |
1702 | 0 | ExtensionsGroupedByDescriptorMap::const_iterator it = |
1703 | 0 | extensions_.lower_bound(std::make_pair(extendee, 0)); |
1704 | 0 | for (; it != extensions_.end() && it->first.first == extendee; ++it) { |
1705 | 0 | out->push_back(it->second); |
1706 | 0 | } |
1707 | 0 | } |
1708 | | |
1709 | | // ------------------------------------------------------------------- |
1710 | | |
1711 | | bool DescriptorPool::Tables::AddSymbol(absl::string_view full_name, |
1712 | 0 | Symbol symbol) { |
1713 | 0 | ABSL_DCHECK_EQ(full_name, symbol.full_name()); |
1714 | 0 | if (symbols_by_name_.insert(symbol).second) { |
1715 | 0 | symbols_after_checkpoint_.push_back(symbol); |
1716 | 0 | return true; |
1717 | 0 | } else { |
1718 | 0 | return false; |
1719 | 0 | } |
1720 | 0 | } |
1721 | | |
1722 | | bool FileDescriptorTables::AddAliasUnderParent(const void* parent, |
1723 | | absl::string_view name, |
1724 | 0 | Symbol symbol) { |
1725 | 0 | ABSL_DCHECK_EQ(name, symbol.parent_name_key().second); |
1726 | 0 | ABSL_DCHECK_EQ(parent, symbol.parent_name_key().first); |
1727 | 0 | return symbols_by_parent_.insert(symbol).second; |
1728 | 0 | } |
1729 | | |
1730 | 0 | bool DescriptorPool::Tables::AddFile(const FileDescriptor* file) { |
1731 | 0 | if (files_by_name_.insert(file).second) { |
1732 | 0 | files_after_checkpoint_.push_back(file); |
1733 | 0 | return true; |
1734 | 0 | } else { |
1735 | 0 | return false; |
1736 | 0 | } |
1737 | 0 | } |
1738 | | |
1739 | 0 | void FileDescriptorTables::FinalizeTables() {} |
1740 | | |
1741 | 0 | bool FileDescriptorTables::AddFieldByNumber(FieldDescriptor* field) { |
1742 | | // Skip fields that are at the start of the sequence. |
1743 | 0 | if (field->containing_type() != nullptr && field->number() >= 1 && |
1744 | 0 | field->number() <= field->containing_type()->sequential_field_limit_) { |
1745 | 0 | if (field->is_extension()) { |
1746 | | // Conflicts with the field that already exists in the sequential range. |
1747 | 0 | return false; |
1748 | 0 | } |
1749 | | // Only return true if the field at that index matches. Otherwise it |
1750 | | // conflicts with the existing field in the sequential range. |
1751 | 0 | return field->containing_type()->field(field->number() - 1) == field; |
1752 | 0 | } |
1753 | | |
1754 | 0 | return fields_by_number_.insert(field).second; |
1755 | 0 | } |
1756 | | |
1757 | 0 | bool FileDescriptorTables::AddEnumValueByNumber(EnumValueDescriptor* value) { |
1758 | | // Skip values that are at the start of the sequence. |
1759 | 0 | const int base = value->type()->value(0)->number(); |
1760 | 0 | if (base <= value->number() && |
1761 | 0 | value->number() <= |
1762 | 0 | static_cast<int64_t>(base) + value->type()->sequential_value_limit_) |
1763 | 0 | return true; |
1764 | 0 | return enum_values_by_number_.insert(value).second; |
1765 | 0 | } |
1766 | | |
1767 | 0 | bool DescriptorPool::Tables::AddExtension(const FieldDescriptor* field) { |
1768 | 0 | auto it_inserted = |
1769 | 0 | extensions_.insert({{field->containing_type(), field->number()}, field}); |
1770 | 0 | if (it_inserted.second) { |
1771 | 0 | extensions_after_checkpoint_.push_back(it_inserted.first->first); |
1772 | 0 | return true; |
1773 | 0 | } else { |
1774 | 0 | return false; |
1775 | 0 | } |
1776 | 0 | } |
1777 | | |
1778 | | // ------------------------------------------------------------------- |
1779 | | |
1780 | | template <typename Type> |
1781 | 0 | Type* DescriptorPool::Tables::Allocate() { |
1782 | 0 | static_assert(std::is_trivially_destructible<Type>::value, ""); |
1783 | 0 | static_assert(alignof(Type) <= 8, ""); |
1784 | 0 | return ::new (AllocateBytes(sizeof(Type))) Type{}; |
1785 | 0 | } |
1786 | | |
1787 | 0 | void* DescriptorPool::Tables::AllocateBytes(int size) { |
1788 | 0 | if (size == 0) return nullptr; |
1789 | 0 | void* p = ::operator new(size + RoundUpTo<8>(sizeof(int))); |
1790 | 0 | int* sizep = static_cast<int*>(p); |
1791 | 0 | misc_allocs_.emplace_back(sizep); |
1792 | 0 | *sizep = size; |
1793 | 0 | return static_cast<char*>(p) + RoundUpTo<8>(sizeof(int)); |
1794 | 0 | } |
1795 | | |
1796 | | template <typename... T> |
1797 | | internal::FlatAllocator::Allocation* DescriptorPool::Tables::CreateFlatAlloc( |
1798 | 0 | const TypeMap<IntT, T...>& sizes) { |
1799 | 0 | auto ends = CalculateEnds(sizes); |
1800 | 0 | using FlatAlloc = internal::FlatAllocator::Allocation; |
1801 | |
|
1802 | 0 | int last_end = ends.template Get< |
1803 | 0 | typename std::tuple_element<sizeof...(T) - 1, std::tuple<T...>>::type>(); |
1804 | 0 | size_t total_size = |
1805 | 0 | last_end + RoundUpTo<FlatAlloc::kMaxAlign>(sizeof(FlatAlloc)); |
1806 | 0 | char* data = static_cast<char*>(::operator new(total_size)); |
1807 | 0 | auto* res = ::new (data) FlatAlloc(ends); |
1808 | 0 | flat_allocs_.emplace_back(res); |
1809 | |
|
1810 | 0 | return res; |
1811 | 0 | } |
1812 | | |
1813 | | void FileDescriptorTables::BuildLocationsByPath( |
1814 | 0 | std::pair<const FileDescriptorTables*, const SourceCodeInfo*>* p) { |
1815 | 0 | for (int i = 0, len = p->second->location_size(); i < len; ++i) { |
1816 | 0 | const SourceCodeInfo_Location* loc = &p->second->location().Get(i); |
1817 | 0 | p->first->locations_by_path_[absl::StrJoin(loc->path(), ",")] = loc; |
1818 | 0 | } |
1819 | 0 | } |
1820 | | |
1821 | | const SourceCodeInfo_Location* FileDescriptorTables::GetSourceLocation( |
1822 | 0 | const std::vector<int>& path, const SourceCodeInfo* info) const { |
1823 | 0 | std::pair<const FileDescriptorTables*, const SourceCodeInfo*> p( |
1824 | 0 | std::make_pair(this, info)); |
1825 | 0 | absl::call_once(locations_by_path_once_, |
1826 | 0 | FileDescriptorTables::BuildLocationsByPath, &p); |
1827 | 0 | auto it = locations_by_path_.find(absl::StrJoin(path, ",")); |
1828 | 0 | if (it == locations_by_path_.end()) return nullptr; |
1829 | 0 | return it->second; |
1830 | 0 | } |
1831 | | |
1832 | | // =================================================================== |
1833 | | // DescriptorPool |
1834 | | |
1835 | | |
1836 | 0 | DescriptorPool::ErrorCollector::~ErrorCollector() {} |
1837 | | |
1838 | | absl::string_view DescriptorPool::ErrorCollector::ErrorLocationName( |
1839 | 0 | ErrorLocation location) { |
1840 | 0 | switch (location) { |
1841 | 0 | case NAME: |
1842 | 0 | return "NAME"; |
1843 | 0 | case NUMBER: |
1844 | 0 | return "NUMBER"; |
1845 | 0 | case TYPE: |
1846 | 0 | return "TYPE"; |
1847 | 0 | case EXTENDEE: |
1848 | 0 | return "EXTENDEE"; |
1849 | 0 | case DEFAULT_VALUE: |
1850 | 0 | return "DEFAULT_VALUE"; |
1851 | 0 | case OPTION_NAME: |
1852 | 0 | return "OPTION_NAME"; |
1853 | 0 | case OPTION_VALUE: |
1854 | 0 | return "OPTION_VALUE"; |
1855 | 0 | case INPUT_TYPE: |
1856 | 0 | return "INPUT_TYPE"; |
1857 | 0 | case OUTPUT_TYPE: |
1858 | 0 | return "OUTPUT_TYPE"; |
1859 | 0 | case IMPORT: |
1860 | 0 | return "IMPORT"; |
1861 | 0 | case OTHER: |
1862 | 0 | return "OTHER"; |
1863 | 0 | } |
1864 | 0 | return "UNKNOWN"; |
1865 | 0 | } |
1866 | | |
1867 | | DescriptorPool::DescriptorPool() |
1868 | | : mutex_(nullptr), |
1869 | | fallback_database_(nullptr), |
1870 | | default_error_collector_(nullptr), |
1871 | | underlay_(nullptr), |
1872 | | tables_(new Tables), |
1873 | | enforce_dependencies_(true), |
1874 | | lazily_build_dependencies_(false), |
1875 | | allow_unknown_(false), |
1876 | | enforce_weak_(false), |
1877 | | enforce_extension_declarations_(false), |
1878 | | disallow_enforce_utf8_(false), |
1879 | 0 | deprecated_legacy_json_field_conflicts_(false) {} |
1880 | | |
1881 | | DescriptorPool::DescriptorPool(DescriptorDatabase* fallback_database, |
1882 | | ErrorCollector* error_collector) |
1883 | | : mutex_(new absl::Mutex), |
1884 | | fallback_database_(fallback_database), |
1885 | | default_error_collector_(error_collector), |
1886 | | underlay_(nullptr), |
1887 | | tables_(new Tables), |
1888 | | enforce_dependencies_(true), |
1889 | | lazily_build_dependencies_(false), |
1890 | | allow_unknown_(false), |
1891 | | enforce_weak_(false), |
1892 | | enforce_extension_declarations_(false), |
1893 | | disallow_enforce_utf8_(false), |
1894 | 0 | deprecated_legacy_json_field_conflicts_(false) {} |
1895 | | |
1896 | | DescriptorPool::DescriptorPool(const DescriptorPool* underlay) |
1897 | | : mutex_(nullptr), |
1898 | | fallback_database_(nullptr), |
1899 | | default_error_collector_(nullptr), |
1900 | | underlay_(underlay), |
1901 | | tables_(new Tables), |
1902 | | enforce_dependencies_(true), |
1903 | | lazily_build_dependencies_(false), |
1904 | | allow_unknown_(false), |
1905 | | enforce_weak_(false), |
1906 | | enforce_extension_declarations_(false), |
1907 | | disallow_enforce_utf8_(false), |
1908 | 0 | deprecated_legacy_json_field_conflicts_(false) {} |
1909 | | |
1910 | 0 | DescriptorPool::~DescriptorPool() { |
1911 | 0 | if (mutex_ != nullptr) delete mutex_; |
1912 | 0 | } |
1913 | | |
1914 | | // DescriptorPool::BuildFile() defined later. |
1915 | | // DescriptorPool::BuildFileCollectingErrors() defined later. |
1916 | | |
1917 | 0 | void DescriptorPool::InternalDontEnforceDependencies() { |
1918 | 0 | enforce_dependencies_ = false; |
1919 | 0 | } |
1920 | | |
1921 | | void DescriptorPool::AddUnusedImportTrackFile(absl::string_view file_name, |
1922 | 0 | bool is_error) { |
1923 | 0 | unused_import_track_files_[file_name] = is_error; |
1924 | 0 | } |
1925 | | |
1926 | | |
1927 | 0 | void DescriptorPool::ClearUnusedImportTrackFiles() { |
1928 | 0 | unused_import_track_files_.clear(); |
1929 | 0 | } |
1930 | | |
1931 | 0 | bool DescriptorPool::InternalIsFileLoaded(absl::string_view filename) const { |
1932 | 0 | absl::MutexLockMaybe lock(mutex_); |
1933 | 0 | return tables_->FindFile(filename) != nullptr; |
1934 | 0 | } |
1935 | | |
1936 | | // generated_pool ==================================================== |
1937 | | |
1938 | | namespace { |
1939 | | |
1940 | | |
1941 | 12 | EncodedDescriptorDatabase* GeneratedDatabase() { |
1942 | 12 | static auto generated_database = |
1943 | 12 | internal::OnShutdownDelete(new EncodedDescriptorDatabase()); |
1944 | 12 | return generated_database; |
1945 | 12 | } |
1946 | | |
1947 | 0 | DescriptorPool* NewGeneratedPool() { |
1948 | 0 | auto generated_pool = new DescriptorPool(GeneratedDatabase()); |
1949 | 0 | generated_pool->InternalSetLazilyBuildDependencies(); |
1950 | 0 | return generated_pool; |
1951 | 0 | } |
1952 | | |
1953 | | } // anonymous namespace |
1954 | | |
1955 | 0 | DescriptorDatabase* DescriptorPool::internal_generated_database() { |
1956 | 0 | return GeneratedDatabase(); |
1957 | 0 | } |
1958 | | |
1959 | 0 | DescriptorPool* DescriptorPool::internal_generated_pool() { |
1960 | 0 | static DescriptorPool* generated_pool = |
1961 | 0 | internal::OnShutdownDelete(NewGeneratedPool()); |
1962 | 0 | return generated_pool; |
1963 | 0 | } |
1964 | | |
1965 | 0 | const DescriptorPool* DescriptorPool::generated_pool() { |
1966 | 0 | const DescriptorPool* pool = internal_generated_pool(); |
1967 | | // Ensure that descriptor.proto gets registered in the generated pool. It is a |
1968 | | // special case because it is included in the full runtime. We have to avoid |
1969 | | // registering it pre-main, because we need to ensure that the linker |
1970 | | // --gc-sections step can strip out the full runtime if it is unused. |
1971 | 0 | DescriptorProto::descriptor(); |
1972 | 0 | return pool; |
1973 | 0 | } |
1974 | | |
1975 | | |
1976 | | void DescriptorPool::InternalAddGeneratedFile( |
1977 | 12 | const void* encoded_file_descriptor, int size) { |
1978 | | // So, this function is called in the process of initializing the |
1979 | | // descriptors for generated proto classes. Each generated .pb.cc file |
1980 | | // has an internal procedure called AddDescriptors() which is called at |
1981 | | // process startup, and that function calls this one in order to register |
1982 | | // the raw bytes of the FileDescriptorProto representing the file. |
1983 | | // |
1984 | | // We do not actually construct the descriptor objects right away. We just |
1985 | | // hang on to the bytes until they are actually needed. We actually construct |
1986 | | // the descriptor the first time one of the following things happens: |
1987 | | // * Someone calls a method like descriptor(), GetDescriptor(), or |
1988 | | // GetReflection() on the generated types, which requires returning the |
1989 | | // descriptor or an object based on it. |
1990 | | // * Someone looks up the descriptor in DescriptorPool::generated_pool(). |
1991 | | // |
1992 | | // Once one of these happens, the DescriptorPool actually parses the |
1993 | | // FileDescriptorProto and generates a FileDescriptor (and all its children) |
1994 | | // based on it. |
1995 | | // |
1996 | | // Note that FileDescriptorProto is itself a generated protocol message. |
1997 | | // Therefore, when we parse one, we have to be very careful to avoid using |
1998 | | // any descriptor-based operations, since this might cause infinite recursion |
1999 | | // or deadlock. |
2000 | 12 | ABSL_CHECK(GeneratedDatabase()->Add(encoded_file_descriptor, size)); |
2001 | 12 | } |
2002 | | |
2003 | | |
2004 | | // Find*By* methods ================================================== |
2005 | | |
2006 | | // TODO(kenton): There's a lot of repeated code here, but I'm not sure if |
2007 | | // there's any good way to factor it out. Think about this some time when |
2008 | | // there's nothing more important to do (read: never). |
2009 | | |
2010 | | const FileDescriptor* DescriptorPool::FindFileByName( |
2011 | 0 | absl::string_view name) const { |
2012 | 0 | absl::MutexLockMaybe lock(mutex_); |
2013 | 0 | if (fallback_database_ != nullptr) { |
2014 | 0 | tables_->known_bad_symbols_.clear(); |
2015 | 0 | tables_->known_bad_files_.clear(); |
2016 | 0 | } |
2017 | 0 | const FileDescriptor* result = tables_->FindFile(name); |
2018 | 0 | if (result != nullptr) return result; |
2019 | 0 | if (underlay_ != nullptr) { |
2020 | 0 | result = underlay_->FindFileByName(name); |
2021 | 0 | if (result != nullptr) return result; |
2022 | 0 | } |
2023 | 0 | if (TryFindFileInFallbackDatabase(name)) { |
2024 | 0 | result = tables_->FindFile(name); |
2025 | 0 | if (result != nullptr) return result; |
2026 | 0 | } |
2027 | 0 | return nullptr; |
2028 | 0 | } |
2029 | | |
2030 | | const FileDescriptor* DescriptorPool::FindFileContainingSymbol( |
2031 | 0 | absl::string_view symbol_name) const { |
2032 | 0 | absl::MutexLockMaybe lock(mutex_); |
2033 | 0 | if (fallback_database_ != nullptr) { |
2034 | 0 | tables_->known_bad_symbols_.clear(); |
2035 | 0 | tables_->known_bad_files_.clear(); |
2036 | 0 | } |
2037 | 0 | Symbol result = tables_->FindSymbol(symbol_name); |
2038 | 0 | if (!result.IsNull()) return result.GetFile(); |
2039 | 0 | if (underlay_ != nullptr) { |
2040 | 0 | const FileDescriptor* file_result = |
2041 | 0 | underlay_->FindFileContainingSymbol(symbol_name); |
2042 | 0 | if (file_result != nullptr) return file_result; |
2043 | 0 | } |
2044 | 0 | if (TryFindSymbolInFallbackDatabase(symbol_name)) { |
2045 | 0 | result = tables_->FindSymbol(symbol_name); |
2046 | 0 | if (!result.IsNull()) return result.GetFile(); |
2047 | 0 | } |
2048 | 0 | return nullptr; |
2049 | 0 | } |
2050 | | |
2051 | | const Descriptor* DescriptorPool::FindMessageTypeByName( |
2052 | 0 | absl::string_view name) const { |
2053 | 0 | return tables_->FindByNameHelper(this, name).descriptor(); |
2054 | 0 | } |
2055 | | |
2056 | | const FieldDescriptor* DescriptorPool::FindFieldByName( |
2057 | 0 | absl::string_view name) const { |
2058 | 0 | if (const FieldDescriptor* field = |
2059 | 0 | tables_->FindByNameHelper(this, name).field_descriptor()) { |
2060 | 0 | if (!field->is_extension()) { |
2061 | 0 | return field; |
2062 | 0 | } |
2063 | 0 | } |
2064 | 0 | return nullptr; |
2065 | 0 | } |
2066 | | |
2067 | | const FieldDescriptor* DescriptorPool::FindExtensionByName( |
2068 | 0 | absl::string_view name) const { |
2069 | 0 | if (const FieldDescriptor* field = |
2070 | 0 | tables_->FindByNameHelper(this, name).field_descriptor()) { |
2071 | 0 | if (field->is_extension()) { |
2072 | 0 | return field; |
2073 | 0 | } |
2074 | 0 | } |
2075 | 0 | return nullptr; |
2076 | 0 | } |
2077 | | |
2078 | | const OneofDescriptor* DescriptorPool::FindOneofByName( |
2079 | 0 | absl::string_view name) const { |
2080 | 0 | return tables_->FindByNameHelper(this, name).oneof_descriptor(); |
2081 | 0 | } |
2082 | | |
2083 | | const EnumDescriptor* DescriptorPool::FindEnumTypeByName( |
2084 | 0 | absl::string_view name) const { |
2085 | 0 | return tables_->FindByNameHelper(this, name).enum_descriptor(); |
2086 | 0 | } |
2087 | | |
2088 | | const EnumValueDescriptor* DescriptorPool::FindEnumValueByName( |
2089 | 0 | absl::string_view name) const { |
2090 | 0 | return tables_->FindByNameHelper(this, name).enum_value_descriptor(); |
2091 | 0 | } |
2092 | | |
2093 | | const ServiceDescriptor* DescriptorPool::FindServiceByName( |
2094 | 0 | absl::string_view name) const { |
2095 | 0 | return tables_->FindByNameHelper(this, name).service_descriptor(); |
2096 | 0 | } |
2097 | | |
2098 | | const MethodDescriptor* DescriptorPool::FindMethodByName( |
2099 | 0 | absl::string_view name) const { |
2100 | 0 | return tables_->FindByNameHelper(this, name).method_descriptor(); |
2101 | 0 | } |
2102 | | |
2103 | | const FieldDescriptor* DescriptorPool::FindExtensionByNumber( |
2104 | 0 | const Descriptor* extendee, int number) const { |
2105 | 0 | if (extendee->extension_range_count() == 0) return nullptr; |
2106 | | // A faster path to reduce lock contention in finding extensions, assuming |
2107 | | // most extensions will be cache hit. |
2108 | 0 | if (mutex_ != nullptr) { |
2109 | 0 | absl::ReaderMutexLock lock(mutex_); |
2110 | 0 | const FieldDescriptor* result = tables_->FindExtension(extendee, number); |
2111 | 0 | if (result != nullptr) { |
2112 | 0 | return result; |
2113 | 0 | } |
2114 | 0 | } |
2115 | 0 | absl::MutexLockMaybe lock(mutex_); |
2116 | 0 | if (fallback_database_ != nullptr) { |
2117 | 0 | tables_->known_bad_symbols_.clear(); |
2118 | 0 | tables_->known_bad_files_.clear(); |
2119 | 0 | } |
2120 | 0 | const FieldDescriptor* result = tables_->FindExtension(extendee, number); |
2121 | 0 | if (result != nullptr) { |
2122 | 0 | return result; |
2123 | 0 | } |
2124 | 0 | if (underlay_ != nullptr) { |
2125 | 0 | result = underlay_->FindExtensionByNumber(extendee, number); |
2126 | 0 | if (result != nullptr) return result; |
2127 | 0 | } |
2128 | 0 | if (TryFindExtensionInFallbackDatabase(extendee, number)) { |
2129 | 0 | result = tables_->FindExtension(extendee, number); |
2130 | 0 | if (result != nullptr) { |
2131 | 0 | return result; |
2132 | 0 | } |
2133 | 0 | } |
2134 | 0 | return nullptr; |
2135 | 0 | } |
2136 | | |
2137 | | const FieldDescriptor* DescriptorPool::InternalFindExtensionByNumberNoLock( |
2138 | 0 | const Descriptor* extendee, int number) const { |
2139 | 0 | if (extendee->extension_range_count() == 0) return nullptr; |
2140 | | |
2141 | 0 | const FieldDescriptor* result = tables_->FindExtension(extendee, number); |
2142 | 0 | if (result != nullptr) { |
2143 | 0 | return result; |
2144 | 0 | } |
2145 | | |
2146 | 0 | if (underlay_ != nullptr) { |
2147 | 0 | result = underlay_->InternalFindExtensionByNumberNoLock(extendee, number); |
2148 | 0 | if (result != nullptr) return result; |
2149 | 0 | } |
2150 | | |
2151 | 0 | return nullptr; |
2152 | 0 | } |
2153 | | |
2154 | | const FieldDescriptor* DescriptorPool::FindExtensionByPrintableName( |
2155 | 0 | const Descriptor* extendee, absl::string_view printable_name) const { |
2156 | 0 | if (extendee->extension_range_count() == 0) return nullptr; |
2157 | 0 | const FieldDescriptor* result = FindExtensionByName(printable_name); |
2158 | 0 | if (result != nullptr && result->containing_type() == extendee) { |
2159 | 0 | return result; |
2160 | 0 | } |
2161 | 0 | if (extendee->options().message_set_wire_format()) { |
2162 | | // MessageSet extensions may be identified by type name. |
2163 | 0 | const Descriptor* type = FindMessageTypeByName(printable_name); |
2164 | 0 | if (type != nullptr) { |
2165 | | // Look for a matching extension in the foreign type's scope. |
2166 | 0 | const int type_extension_count = type->extension_count(); |
2167 | 0 | for (int i = 0; i < type_extension_count; i++) { |
2168 | 0 | const FieldDescriptor* extension = type->extension(i); |
2169 | 0 | if (extension->containing_type() == extendee && |
2170 | 0 | extension->type() == FieldDescriptor::TYPE_MESSAGE && |
2171 | 0 | extension->is_optional() && extension->message_type() == type) { |
2172 | | // Found it. |
2173 | 0 | return extension; |
2174 | 0 | } |
2175 | 0 | } |
2176 | 0 | } |
2177 | 0 | } |
2178 | 0 | return nullptr; |
2179 | 0 | } |
2180 | | |
2181 | | void DescriptorPool::FindAllExtensions( |
2182 | | const Descriptor* extendee, |
2183 | 0 | std::vector<const FieldDescriptor*>* out) const { |
2184 | 0 | absl::MutexLockMaybe lock(mutex_); |
2185 | 0 | if (fallback_database_ != nullptr) { |
2186 | 0 | tables_->known_bad_symbols_.clear(); |
2187 | 0 | tables_->known_bad_files_.clear(); |
2188 | 0 | } |
2189 | | |
2190 | | // Initialize tables_->extensions_ from the fallback database first |
2191 | | // (but do this only once per descriptor). |
2192 | 0 | if (fallback_database_ != nullptr && |
2193 | 0 | tables_->extensions_loaded_from_db_.count(extendee) == 0) { |
2194 | 0 | std::vector<int> numbers; |
2195 | 0 | if (fallback_database_->FindAllExtensionNumbers(extendee->full_name(), |
2196 | 0 | &numbers)) { |
2197 | 0 | for (int number : numbers) { |
2198 | 0 | if (tables_->FindExtension(extendee, number) == nullptr) { |
2199 | 0 | TryFindExtensionInFallbackDatabase(extendee, number); |
2200 | 0 | } |
2201 | 0 | } |
2202 | 0 | tables_->extensions_loaded_from_db_.insert(extendee); |
2203 | 0 | } |
2204 | 0 | } |
2205 | |
|
2206 | 0 | tables_->FindAllExtensions(extendee, out); |
2207 | 0 | if (underlay_ != nullptr) { |
2208 | 0 | underlay_->FindAllExtensions(extendee, out); |
2209 | 0 | } |
2210 | 0 | } |
2211 | | |
2212 | | |
2213 | | // ------------------------------------------------------------------- |
2214 | | |
2215 | 0 | const FieldDescriptor* Descriptor::FindFieldByNumber(int key) const { |
2216 | 0 | const FieldDescriptor* result = file()->tables_->FindFieldByNumber(this, key); |
2217 | 0 | if (result == nullptr || result->is_extension()) { |
2218 | 0 | return nullptr; |
2219 | 0 | } else { |
2220 | 0 | return result; |
2221 | 0 | } |
2222 | 0 | } |
2223 | | |
2224 | | const FieldDescriptor* Descriptor::FindFieldByLowercaseName( |
2225 | 0 | absl::string_view key) const { |
2226 | 0 | const FieldDescriptor* result = |
2227 | 0 | file()->tables_->FindFieldByLowercaseName(this, key); |
2228 | 0 | if (result == nullptr || result->is_extension()) { |
2229 | 0 | return nullptr; |
2230 | 0 | } else { |
2231 | 0 | return result; |
2232 | 0 | } |
2233 | 0 | } |
2234 | | |
2235 | | const FieldDescriptor* Descriptor::FindFieldByCamelcaseName( |
2236 | 0 | absl::string_view key) const { |
2237 | 0 | const FieldDescriptor* result = |
2238 | 0 | file()->tables_->FindFieldByCamelcaseName(this, key); |
2239 | 0 | if (result == nullptr || result->is_extension()) { |
2240 | 0 | return nullptr; |
2241 | 0 | } else { |
2242 | 0 | return result; |
2243 | 0 | } |
2244 | 0 | } |
2245 | | |
2246 | | const FieldDescriptor* Descriptor::FindFieldByName( |
2247 | 0 | absl::string_view key) const { |
2248 | 0 | const FieldDescriptor* field = |
2249 | 0 | file()->tables_->FindNestedSymbol(this, key).field_descriptor(); |
2250 | 0 | return field != nullptr && !field->is_extension() ? field : nullptr; |
2251 | 0 | } |
2252 | | |
2253 | | const OneofDescriptor* Descriptor::FindOneofByName( |
2254 | 0 | absl::string_view key) const { |
2255 | 0 | return file()->tables_->FindNestedSymbol(this, key).oneof_descriptor(); |
2256 | 0 | } |
2257 | | |
2258 | | const FieldDescriptor* Descriptor::FindExtensionByName( |
2259 | 0 | absl::string_view key) const { |
2260 | 0 | const FieldDescriptor* field = |
2261 | 0 | file()->tables_->FindNestedSymbol(this, key).field_descriptor(); |
2262 | 0 | return field != nullptr && field->is_extension() ? field : nullptr; |
2263 | 0 | } |
2264 | | |
2265 | | const FieldDescriptor* Descriptor::FindExtensionByLowercaseName( |
2266 | 0 | absl::string_view key) const { |
2267 | 0 | const FieldDescriptor* result = |
2268 | 0 | file()->tables_->FindFieldByLowercaseName(this, key); |
2269 | 0 | if (result == nullptr || !result->is_extension()) { |
2270 | 0 | return nullptr; |
2271 | 0 | } else { |
2272 | 0 | return result; |
2273 | 0 | } |
2274 | 0 | } |
2275 | | |
2276 | | const FieldDescriptor* Descriptor::FindExtensionByCamelcaseName( |
2277 | 0 | absl::string_view key) const { |
2278 | 0 | const FieldDescriptor* result = |
2279 | 0 | file()->tables_->FindFieldByCamelcaseName(this, key); |
2280 | 0 | if (result == nullptr || !result->is_extension()) { |
2281 | 0 | return nullptr; |
2282 | 0 | } else { |
2283 | 0 | return result; |
2284 | 0 | } |
2285 | 0 | } |
2286 | | |
2287 | | const Descriptor* Descriptor::FindNestedTypeByName( |
2288 | 0 | absl::string_view key) const { |
2289 | 0 | return file()->tables_->FindNestedSymbol(this, key).descriptor(); |
2290 | 0 | } |
2291 | | |
2292 | | const EnumDescriptor* Descriptor::FindEnumTypeByName( |
2293 | 0 | absl::string_view key) const { |
2294 | 0 | return file()->tables_->FindNestedSymbol(this, key).enum_descriptor(); |
2295 | 0 | } |
2296 | | |
2297 | | const EnumValueDescriptor* Descriptor::FindEnumValueByName( |
2298 | 0 | absl::string_view key) const { |
2299 | 0 | return file()->tables_->FindNestedSymbol(this, key).enum_value_descriptor(); |
2300 | 0 | } |
2301 | | |
2302 | 0 | const FieldDescriptor* Descriptor::map_key() const { |
2303 | 0 | if (!options().map_entry()) return nullptr; |
2304 | 0 | ABSL_DCHECK_EQ(field_count(), 2); |
2305 | 0 | return field(0); |
2306 | 0 | } |
2307 | | |
2308 | 0 | const FieldDescriptor* Descriptor::map_value() const { |
2309 | 0 | if (!options().map_entry()) return nullptr; |
2310 | 0 | ABSL_DCHECK_EQ(field_count(), 2); |
2311 | 0 | return field(1); |
2312 | 0 | } |
2313 | | |
2314 | | const EnumValueDescriptor* EnumDescriptor::FindValueByName( |
2315 | 0 | absl::string_view key) const { |
2316 | 0 | return file()->tables_->FindNestedSymbol(this, key).enum_value_descriptor(); |
2317 | 0 | } |
2318 | | |
2319 | 0 | const EnumValueDescriptor* EnumDescriptor::FindValueByNumber(int key) const { |
2320 | 0 | return file()->tables_->FindEnumValueByNumber(this, key); |
2321 | 0 | } |
2322 | | |
2323 | | const EnumValueDescriptor* EnumDescriptor::FindValueByNumberCreatingIfUnknown( |
2324 | 0 | int key) const { |
2325 | 0 | return file()->tables_->FindEnumValueByNumberCreatingIfUnknown(this, key); |
2326 | 0 | } |
2327 | | |
2328 | | const MethodDescriptor* ServiceDescriptor::FindMethodByName( |
2329 | 0 | absl::string_view key) const { |
2330 | 0 | return file()->tables_->FindNestedSymbol(this, key).method_descriptor(); |
2331 | 0 | } |
2332 | | |
2333 | | const Descriptor* FileDescriptor::FindMessageTypeByName( |
2334 | 0 | absl::string_view key) const { |
2335 | 0 | return tables_->FindNestedSymbol(this, key).descriptor(); |
2336 | 0 | } |
2337 | | |
2338 | | const EnumDescriptor* FileDescriptor::FindEnumTypeByName( |
2339 | 0 | absl::string_view key) const { |
2340 | 0 | return tables_->FindNestedSymbol(this, key).enum_descriptor(); |
2341 | 0 | } |
2342 | | |
2343 | | const EnumValueDescriptor* FileDescriptor::FindEnumValueByName( |
2344 | 0 | absl::string_view key) const { |
2345 | 0 | return tables_->FindNestedSymbol(this, key).enum_value_descriptor(); |
2346 | 0 | } |
2347 | | |
2348 | | const ServiceDescriptor* FileDescriptor::FindServiceByName( |
2349 | 0 | absl::string_view key) const { |
2350 | 0 | return tables_->FindNestedSymbol(this, key).service_descriptor(); |
2351 | 0 | } |
2352 | | |
2353 | | const FieldDescriptor* FileDescriptor::FindExtensionByName( |
2354 | 0 | absl::string_view key) const { |
2355 | 0 | const FieldDescriptor* field = |
2356 | 0 | tables_->FindNestedSymbol(this, key).field_descriptor(); |
2357 | 0 | return field != nullptr && field->is_extension() ? field : nullptr; |
2358 | 0 | } |
2359 | | |
2360 | | const FieldDescriptor* FileDescriptor::FindExtensionByLowercaseName( |
2361 | 0 | absl::string_view key) const { |
2362 | 0 | const FieldDescriptor* result = tables_->FindFieldByLowercaseName(this, key); |
2363 | 0 | if (result == nullptr || !result->is_extension()) { |
2364 | 0 | return nullptr; |
2365 | 0 | } else { |
2366 | 0 | return result; |
2367 | 0 | } |
2368 | 0 | } |
2369 | | |
2370 | | const FieldDescriptor* FileDescriptor::FindExtensionByCamelcaseName( |
2371 | 0 | absl::string_view key) const { |
2372 | 0 | const FieldDescriptor* result = tables_->FindFieldByCamelcaseName(this, key); |
2373 | 0 | if (result == nullptr || !result->is_extension()) { |
2374 | 0 | return nullptr; |
2375 | 0 | } else { |
2376 | 0 | return result; |
2377 | 0 | } |
2378 | 0 | } |
2379 | | |
2380 | | void Descriptor::ExtensionRange::CopyTo( |
2381 | 0 | DescriptorProto_ExtensionRange* proto) const { |
2382 | 0 | proto->set_start(start_); |
2383 | 0 | proto->set_end(end_); |
2384 | 0 | if (options_ != &ExtensionRangeOptions::default_instance()) { |
2385 | 0 | *proto->mutable_options() = *options_; |
2386 | 0 | } |
2387 | 0 | } |
2388 | | |
2389 | | const Descriptor::ExtensionRange* |
2390 | 0 | Descriptor::FindExtensionRangeContainingNumber(int number) const { |
2391 | | // Linear search should be fine because we don't expect a message to have |
2392 | | // more than a couple extension ranges. |
2393 | 0 | for (int i = 0; i < extension_range_count(); i++) { |
2394 | 0 | if (number >= extension_range(i)->start_number() && |
2395 | 0 | number < extension_range(i)->end_number()) { |
2396 | 0 | return extension_range(i); |
2397 | 0 | } |
2398 | 0 | } |
2399 | 0 | return nullptr; |
2400 | 0 | } |
2401 | | |
2402 | | const Descriptor::ReservedRange* Descriptor::FindReservedRangeContainingNumber( |
2403 | 0 | int number) const { |
2404 | | // TODO(chrisn): Consider a non-linear search. |
2405 | 0 | for (int i = 0; i < reserved_range_count(); i++) { |
2406 | 0 | if (number >= reserved_range(i)->start && number < reserved_range(i)->end) { |
2407 | 0 | return reserved_range(i); |
2408 | 0 | } |
2409 | 0 | } |
2410 | 0 | return nullptr; |
2411 | 0 | } |
2412 | | |
2413 | | const EnumDescriptor::ReservedRange* |
2414 | 0 | EnumDescriptor::FindReservedRangeContainingNumber(int number) const { |
2415 | | // TODO(chrisn): Consider a non-linear search. |
2416 | 0 | for (int i = 0; i < reserved_range_count(); i++) { |
2417 | 0 | if (number >= reserved_range(i)->start && |
2418 | 0 | number <= reserved_range(i)->end) { |
2419 | 0 | return reserved_range(i); |
2420 | 0 | } |
2421 | 0 | } |
2422 | 0 | return nullptr; |
2423 | 0 | } |
2424 | | |
2425 | | // ------------------------------------------------------------------- |
2426 | | |
2427 | | bool DescriptorPool::TryFindFileInFallbackDatabase( |
2428 | 0 | absl::string_view name) const { |
2429 | 0 | if (fallback_database_ == nullptr) return false; |
2430 | | |
2431 | 0 | if (tables_->known_bad_files_.contains(name)) return false; |
2432 | | |
2433 | | // NOINLINE to reduce the stack cost of the operation in the caller. |
2434 | 0 | const auto find_file = [](DescriptorDatabase& database, |
2435 | 0 | absl::string_view filename, |
2436 | 0 | FileDescriptorProto& output) PROTOBUF_NOINLINE { |
2437 | 0 | return database.FindFileByName(std::string(filename), &output); |
2438 | 0 | }; |
2439 | |
|
2440 | 0 | auto file_proto = absl::make_unique<FileDescriptorProto>(); |
2441 | 0 | if (!find_file(*fallback_database_, name, *file_proto) || |
2442 | 0 | BuildFileFromDatabase(*file_proto) == nullptr) { |
2443 | 0 | tables_->known_bad_files_.emplace(name); |
2444 | 0 | return false; |
2445 | 0 | } |
2446 | 0 | return true; |
2447 | 0 | } |
2448 | | |
2449 | 0 | bool DescriptorPool::IsSubSymbolOfBuiltType(absl::string_view name) const { |
2450 | 0 | for (size_t pos = name.find('.'); pos != name.npos; |
2451 | 0 | pos = name.find('.', pos + 1)) { |
2452 | 0 | auto prefix = name.substr(0, pos); |
2453 | 0 | Symbol symbol = tables_->FindSymbol(prefix); |
2454 | 0 | if (symbol.IsNull()) { |
2455 | 0 | break; |
2456 | 0 | } |
2457 | 0 | if (!symbol.IsPackage()) { |
2458 | | // If the symbol type is anything other than PACKAGE, then its complete |
2459 | | // definition is already known. |
2460 | 0 | return true; |
2461 | 0 | } |
2462 | 0 | } |
2463 | 0 | if (underlay_ != nullptr) { |
2464 | | // Check to see if any prefix of this symbol exists in the underlay. |
2465 | 0 | return underlay_->IsSubSymbolOfBuiltType(name); |
2466 | 0 | } |
2467 | 0 | return false; |
2468 | 0 | } |
2469 | | |
2470 | | bool DescriptorPool::TryFindSymbolInFallbackDatabase( |
2471 | 0 | absl::string_view name) const { |
2472 | 0 | if (fallback_database_ == nullptr) return false; |
2473 | | |
2474 | 0 | if (tables_->known_bad_symbols_.contains(name)) return false; |
2475 | | |
2476 | 0 | std::string name_string(name); |
2477 | 0 | auto file_proto = absl::make_unique<FileDescriptorProto>(); |
2478 | 0 | if ( // We skip looking in the fallback database if the name is a sub-symbol |
2479 | | // of any descriptor that already exists in the descriptor pool (except |
2480 | | // for package descriptors). This is valid because all symbols except |
2481 | | // for packages are defined in a single file, so if the symbol exists |
2482 | | // then we should already have its definition. |
2483 | | // |
2484 | | // The other reason to do this is to support "overriding" type |
2485 | | // definitions by merging two databases that define the same type. (Yes, |
2486 | | // people do this.) The main difficulty with making this work is that |
2487 | | // FindFileContainingSymbol() is allowed to return both false positives |
2488 | | // (e.g., SimpleDescriptorDatabase, UpgradedDescriptorDatabase) and |
2489 | | // false negatives (e.g. ProtoFileParser, SourceTreeDescriptorDatabase). |
2490 | | // When two such databases are merged, looking up a non-existent |
2491 | | // sub-symbol of a type that already exists in the descriptor pool can |
2492 | | // result in an attempt to load multiple definitions of the same type. |
2493 | | // The check below avoids this. |
2494 | 0 | IsSubSymbolOfBuiltType(name) |
2495 | | |
2496 | | // Look up file containing this symbol in fallback database. |
2497 | 0 | || !fallback_database_->FindFileContainingSymbol(name_string, |
2498 | 0 | file_proto.get()) |
2499 | | |
2500 | | // Check if we've already built this file. If so, it apparently doesn't |
2501 | | // contain the symbol we're looking for. Some DescriptorDatabases |
2502 | | // return false positives. |
2503 | 0 | || tables_->FindFile(file_proto->name()) != nullptr |
2504 | | |
2505 | | // Build the file. |
2506 | 0 | || BuildFileFromDatabase(*file_proto) == nullptr) { |
2507 | 0 | tables_->known_bad_symbols_.insert(std::move(name_string)); |
2508 | 0 | return false; |
2509 | 0 | } |
2510 | | |
2511 | 0 | return true; |
2512 | 0 | } |
2513 | | |
2514 | | bool DescriptorPool::TryFindExtensionInFallbackDatabase( |
2515 | 0 | const Descriptor* containing_type, int field_number) const { |
2516 | 0 | if (fallback_database_ == nullptr) return false; |
2517 | | |
2518 | 0 | auto file_proto = absl::make_unique<FileDescriptorProto>(); |
2519 | 0 | if (!fallback_database_->FindFileContainingExtension( |
2520 | 0 | containing_type->full_name(), field_number, file_proto.get())) { |
2521 | 0 | return false; |
2522 | 0 | } |
2523 | | |
2524 | 0 | if (tables_->FindFile(file_proto->name()) != nullptr) { |
2525 | | // We've already loaded this file, and it apparently doesn't contain the |
2526 | | // extension we're looking for. Some DescriptorDatabases return false |
2527 | | // positives. |
2528 | 0 | return false; |
2529 | 0 | } |
2530 | | |
2531 | 0 | if (BuildFileFromDatabase(*file_proto) == nullptr) { |
2532 | 0 | return false; |
2533 | 0 | } |
2534 | | |
2535 | 0 | return true; |
2536 | 0 | } |
2537 | | |
2538 | | // =================================================================== |
2539 | | |
2540 | 0 | bool FieldDescriptor::is_map_message_type() const { |
2541 | 0 | return type_descriptor_.message_type->options().map_entry(); |
2542 | 0 | } |
2543 | | |
2544 | | std::string FieldDescriptor::DefaultValueAsString( |
2545 | 0 | bool quote_string_type) const { |
2546 | 0 | ABSL_CHECK(has_default_value()) << "No default value"; |
2547 | 0 | switch (cpp_type()) { |
2548 | 0 | case CPPTYPE_INT32: |
2549 | 0 | return absl::StrCat(default_value_int32_t()); |
2550 | 0 | case CPPTYPE_INT64: |
2551 | 0 | return absl::StrCat(default_value_int64_t()); |
2552 | 0 | case CPPTYPE_UINT32: |
2553 | 0 | return absl::StrCat(default_value_uint32_t()); |
2554 | 0 | case CPPTYPE_UINT64: |
2555 | 0 | return absl::StrCat(default_value_uint64_t()); |
2556 | 0 | case CPPTYPE_FLOAT: |
2557 | 0 | return io::SimpleFtoa(default_value_float()); |
2558 | 0 | case CPPTYPE_DOUBLE: |
2559 | 0 | return io::SimpleDtoa(default_value_double()); |
2560 | 0 | case CPPTYPE_BOOL: |
2561 | 0 | return default_value_bool() ? "true" : "false"; |
2562 | 0 | case CPPTYPE_STRING: |
2563 | 0 | if (quote_string_type) { |
2564 | 0 | return absl::StrCat("\"", absl::CEscape(default_value_string()), "\""); |
2565 | 0 | } else { |
2566 | 0 | if (type() == TYPE_BYTES) { |
2567 | 0 | return absl::CEscape(default_value_string()); |
2568 | 0 | } else { |
2569 | 0 | return default_value_string(); |
2570 | 0 | } |
2571 | 0 | } |
2572 | 0 | case CPPTYPE_ENUM: |
2573 | 0 | return default_value_enum()->name(); |
2574 | 0 | case CPPTYPE_MESSAGE: |
2575 | 0 | ABSL_DLOG(FATAL) << "Messages can't have default values!"; |
2576 | 0 | break; |
2577 | 0 | } |
2578 | 0 | ABSL_LOG(FATAL) << "Can't get here: failed to get default value as string"; |
2579 | 0 | return ""; |
2580 | 0 | } |
2581 | | |
2582 | | // Out-of-line constructor definitions ============================== |
2583 | | // When using constructor type homing in Clang, debug info for a type |
2584 | | // is only emitted when a constructor definition is emitted, as an |
2585 | | // optimization. These constructors are never called, so we define them |
2586 | | // out of line to make sure the debug info is emitted somewhere. |
2587 | | |
2588 | 0 | Descriptor::Descriptor() {} |
2589 | 0 | FieldDescriptor::FieldDescriptor() {} |
2590 | 0 | OneofDescriptor::OneofDescriptor() {} |
2591 | 0 | EnumDescriptor::EnumDescriptor() {} |
2592 | 0 | EnumValueDescriptor::EnumValueDescriptor() {} |
2593 | 0 | ServiceDescriptor::ServiceDescriptor() {} |
2594 | 0 | MethodDescriptor::MethodDescriptor() {} |
2595 | 0 | FileDescriptor::FileDescriptor() {} |
2596 | | |
2597 | | // CopyTo methods ==================================================== |
2598 | | |
2599 | 0 | void FileDescriptor::CopyTo(FileDescriptorProto* proto) const { |
2600 | 0 | CopyHeadingTo(proto); |
2601 | |
|
2602 | 0 | for (int i = 0; i < dependency_count(); i++) { |
2603 | 0 | proto->add_dependency(dependency(i)->name()); |
2604 | 0 | } |
2605 | |
|
2606 | 0 | for (int i = 0; i < public_dependency_count(); i++) { |
2607 | 0 | proto->add_public_dependency(public_dependencies_[i]); |
2608 | 0 | } |
2609 | |
|
2610 | 0 | for (int i = 0; i < weak_dependency_count(); i++) { |
2611 | 0 | proto->add_weak_dependency(weak_dependencies_[i]); |
2612 | 0 | } |
2613 | |
|
2614 | 0 | for (int i = 0; i < message_type_count(); i++) { |
2615 | 0 | message_type(i)->CopyTo(proto->add_message_type()); |
2616 | 0 | } |
2617 | 0 | for (int i = 0; i < enum_type_count(); i++) { |
2618 | 0 | enum_type(i)->CopyTo(proto->add_enum_type()); |
2619 | 0 | } |
2620 | 0 | for (int i = 0; i < service_count(); i++) { |
2621 | 0 | service(i)->CopyTo(proto->add_service()); |
2622 | 0 | } |
2623 | 0 | for (int i = 0; i < extension_count(); i++) { |
2624 | 0 | extension(i)->CopyTo(proto->add_extension()); |
2625 | 0 | } |
2626 | 0 | } |
2627 | | |
2628 | 0 | void FileDescriptor::CopyHeadingTo(FileDescriptorProto* proto) const { |
2629 | 0 | proto->set_name(name()); |
2630 | 0 | if (!package().empty()) { |
2631 | 0 | proto->set_package(package()); |
2632 | 0 | } |
2633 | | |
2634 | | // TODO(liujisi): Also populate when syntax="proto2". |
2635 | 0 | FileDescriptorLegacy::Syntax syntax = FileDescriptorLegacy(this).syntax(); |
2636 | 0 | if (syntax == FileDescriptorLegacy::Syntax::SYNTAX_PROTO3 |
2637 | 0 | ) { |
2638 | 0 | proto->set_syntax(FileDescriptorLegacy::SyntaxName(syntax)); |
2639 | 0 | } |
2640 | |
|
2641 | 0 | if (&options() != &FileOptions::default_instance()) { |
2642 | 0 | *proto->mutable_options() = options(); |
2643 | 0 | } |
2644 | 0 | } |
2645 | | |
2646 | 0 | void FileDescriptor::CopyJsonNameTo(FileDescriptorProto* proto) const { |
2647 | 0 | if (message_type_count() != proto->message_type_size() || |
2648 | 0 | extension_count() != proto->extension_size()) { |
2649 | 0 | ABSL_LOG(ERROR) << "Cannot copy json_name to a proto of a different size."; |
2650 | 0 | return; |
2651 | 0 | } |
2652 | 0 | for (int i = 0; i < message_type_count(); i++) { |
2653 | 0 | message_type(i)->CopyJsonNameTo(proto->mutable_message_type(i)); |
2654 | 0 | } |
2655 | 0 | for (int i = 0; i < extension_count(); i++) { |
2656 | 0 | extension(i)->CopyJsonNameTo(proto->mutable_extension(i)); |
2657 | 0 | } |
2658 | 0 | } |
2659 | | |
2660 | 0 | void FileDescriptor::CopySourceCodeInfoTo(FileDescriptorProto* proto) const { |
2661 | 0 | if (source_code_info_ && |
2662 | 0 | source_code_info_ != &SourceCodeInfo::default_instance()) { |
2663 | 0 | proto->mutable_source_code_info()->CopyFrom(*source_code_info_); |
2664 | 0 | } |
2665 | 0 | } |
2666 | | |
2667 | 0 | void Descriptor::CopyTo(DescriptorProto* proto) const { |
2668 | 0 | proto->set_name(name()); |
2669 | |
|
2670 | 0 | for (int i = 0; i < field_count(); i++) { |
2671 | 0 | field(i)->CopyTo(proto->add_field()); |
2672 | 0 | } |
2673 | 0 | for (int i = 0; i < oneof_decl_count(); i++) { |
2674 | 0 | oneof_decl(i)->CopyTo(proto->add_oneof_decl()); |
2675 | 0 | } |
2676 | 0 | for (int i = 0; i < nested_type_count(); i++) { |
2677 | 0 | nested_type(i)->CopyTo(proto->add_nested_type()); |
2678 | 0 | } |
2679 | 0 | for (int i = 0; i < enum_type_count(); i++) { |
2680 | 0 | enum_type(i)->CopyTo(proto->add_enum_type()); |
2681 | 0 | } |
2682 | 0 | for (int i = 0; i < extension_range_count(); i++) { |
2683 | 0 | extension_range(i)->CopyTo(proto->add_extension_range()); |
2684 | 0 | } |
2685 | 0 | for (int i = 0; i < extension_count(); i++) { |
2686 | 0 | extension(i)->CopyTo(proto->add_extension()); |
2687 | 0 | } |
2688 | 0 | for (int i = 0; i < reserved_range_count(); i++) { |
2689 | 0 | DescriptorProto::ReservedRange* range = proto->add_reserved_range(); |
2690 | 0 | range->set_start(reserved_range(i)->start); |
2691 | 0 | range->set_end(reserved_range(i)->end); |
2692 | 0 | } |
2693 | 0 | for (int i = 0; i < reserved_name_count(); i++) { |
2694 | 0 | proto->add_reserved_name(reserved_name(i)); |
2695 | 0 | } |
2696 | |
|
2697 | 0 | if (&options() != &MessageOptions::default_instance()) { |
2698 | 0 | proto->mutable_options()->CopyFrom(options()); |
2699 | 0 | } |
2700 | |
|
2701 | 0 | } |
2702 | | |
2703 | 0 | void Descriptor::CopyJsonNameTo(DescriptorProto* proto) const { |
2704 | 0 | if (field_count() != proto->field_size() || |
2705 | 0 | nested_type_count() != proto->nested_type_size() || |
2706 | 0 | extension_count() != proto->extension_size()) { |
2707 | 0 | ABSL_LOG(ERROR) << "Cannot copy json_name to a proto of a different size."; |
2708 | 0 | return; |
2709 | 0 | } |
2710 | 0 | for (int i = 0; i < field_count(); i++) { |
2711 | 0 | field(i)->CopyJsonNameTo(proto->mutable_field(i)); |
2712 | 0 | } |
2713 | 0 | for (int i = 0; i < nested_type_count(); i++) { |
2714 | 0 | nested_type(i)->CopyJsonNameTo(proto->mutable_nested_type(i)); |
2715 | 0 | } |
2716 | 0 | for (int i = 0; i < extension_count(); i++) { |
2717 | 0 | extension(i)->CopyJsonNameTo(proto->mutable_extension(i)); |
2718 | 0 | } |
2719 | 0 | } |
2720 | | |
2721 | 0 | void FieldDescriptor::CopyTo(FieldDescriptorProto* proto) const { |
2722 | 0 | proto->set_name(name()); |
2723 | 0 | proto->set_number(number()); |
2724 | 0 | if (has_json_name_) { |
2725 | 0 | proto->set_json_name(json_name()); |
2726 | 0 | } |
2727 | 0 | if (proto3_optional_) { |
2728 | 0 | proto->set_proto3_optional(true); |
2729 | 0 | } |
2730 | | // Some compilers do not allow static_cast directly between two enum types, |
2731 | | // so we must cast to int first. |
2732 | 0 | proto->set_label(static_cast<FieldDescriptorProto::Label>( |
2733 | 0 | absl::implicit_cast<int>(label()))); |
2734 | 0 | proto->set_type(static_cast<FieldDescriptorProto::Type>( |
2735 | 0 | absl::implicit_cast<int>(type()))); |
2736 | |
|
2737 | 0 | if (is_extension()) { |
2738 | 0 | if (!containing_type()->is_unqualified_placeholder_) { |
2739 | 0 | proto->set_extendee("."); |
2740 | 0 | } |
2741 | 0 | proto->mutable_extendee()->append(containing_type()->full_name()); |
2742 | 0 | } |
2743 | |
|
2744 | 0 | if (cpp_type() == CPPTYPE_MESSAGE) { |
2745 | 0 | if (message_type()->is_placeholder_) { |
2746 | | // We don't actually know if the type is a message type. It could be |
2747 | | // an enum. |
2748 | 0 | proto->clear_type(); |
2749 | 0 | } |
2750 | |
|
2751 | 0 | if (!message_type()->is_unqualified_placeholder_) { |
2752 | 0 | proto->set_type_name("."); |
2753 | 0 | } |
2754 | 0 | proto->mutable_type_name()->append(message_type()->full_name()); |
2755 | 0 | } else if (cpp_type() == CPPTYPE_ENUM) { |
2756 | 0 | if (!enum_type()->is_unqualified_placeholder_) { |
2757 | 0 | proto->set_type_name("."); |
2758 | 0 | } |
2759 | 0 | proto->mutable_type_name()->append(enum_type()->full_name()); |
2760 | 0 | } |
2761 | |
|
2762 | 0 | if (has_default_value()) { |
2763 | 0 | proto->set_default_value(DefaultValueAsString(false)); |
2764 | 0 | } |
2765 | |
|
2766 | 0 | if (containing_oneof() != nullptr && !is_extension()) { |
2767 | 0 | proto->set_oneof_index(containing_oneof()->index()); |
2768 | 0 | } |
2769 | |
|
2770 | 0 | if (&options() != &FieldOptions::default_instance()) { |
2771 | 0 | proto->mutable_options()->CopyFrom(options()); |
2772 | 0 | } |
2773 | |
|
2774 | 0 | } |
2775 | | |
2776 | 0 | void FieldDescriptor::CopyJsonNameTo(FieldDescriptorProto* proto) const { |
2777 | 0 | proto->set_json_name(json_name()); |
2778 | 0 | } |
2779 | | |
2780 | 0 | void OneofDescriptor::CopyTo(OneofDescriptorProto* proto) const { |
2781 | 0 | proto->set_name(name()); |
2782 | 0 | if (&options() != &OneofOptions::default_instance()) { |
2783 | 0 | proto->mutable_options()->CopyFrom(options()); |
2784 | 0 | } |
2785 | 0 | } |
2786 | | |
2787 | 0 | void EnumDescriptor::CopyTo(EnumDescriptorProto* proto) const { |
2788 | 0 | proto->set_name(name()); |
2789 | |
|
2790 | 0 | for (int i = 0; i < value_count(); i++) { |
2791 | 0 | value(i)->CopyTo(proto->add_value()); |
2792 | 0 | } |
2793 | 0 | for (int i = 0; i < reserved_range_count(); i++) { |
2794 | 0 | EnumDescriptorProto::EnumReservedRange* range = proto->add_reserved_range(); |
2795 | 0 | range->set_start(reserved_range(i)->start); |
2796 | 0 | range->set_end(reserved_range(i)->end); |
2797 | 0 | } |
2798 | 0 | for (int i = 0; i < reserved_name_count(); i++) { |
2799 | 0 | proto->add_reserved_name(reserved_name(i)); |
2800 | 0 | } |
2801 | |
|
2802 | 0 | if (&options() != &EnumOptions::default_instance()) { |
2803 | 0 | proto->mutable_options()->CopyFrom(options()); |
2804 | 0 | } |
2805 | 0 | } |
2806 | | |
2807 | 0 | void EnumValueDescriptor::CopyTo(EnumValueDescriptorProto* proto) const { |
2808 | 0 | proto->set_name(name()); |
2809 | 0 | proto->set_number(number()); |
2810 | |
|
2811 | 0 | if (&options() != &EnumValueOptions::default_instance()) { |
2812 | 0 | proto->mutable_options()->CopyFrom(options()); |
2813 | 0 | } |
2814 | 0 | } |
2815 | | |
2816 | 0 | void ServiceDescriptor::CopyTo(ServiceDescriptorProto* proto) const { |
2817 | 0 | proto->set_name(name()); |
2818 | |
|
2819 | 0 | for (int i = 0; i < method_count(); i++) { |
2820 | 0 | method(i)->CopyTo(proto->add_method()); |
2821 | 0 | } |
2822 | |
|
2823 | 0 | if (&options() != &ServiceOptions::default_instance()) { |
2824 | 0 | proto->mutable_options()->CopyFrom(options()); |
2825 | 0 | } |
2826 | 0 | } |
2827 | | |
2828 | 0 | void MethodDescriptor::CopyTo(MethodDescriptorProto* proto) const { |
2829 | 0 | proto->set_name(name()); |
2830 | |
|
2831 | 0 | if (!input_type()->is_unqualified_placeholder_) { |
2832 | 0 | proto->set_input_type("."); |
2833 | 0 | } |
2834 | 0 | proto->mutable_input_type()->append(input_type()->full_name()); |
2835 | |
|
2836 | 0 | if (!output_type()->is_unqualified_placeholder_) { |
2837 | 0 | proto->set_output_type("."); |
2838 | 0 | } |
2839 | 0 | proto->mutable_output_type()->append(output_type()->full_name()); |
2840 | |
|
2841 | 0 | if (&options() != &MethodOptions::default_instance()) { |
2842 | 0 | proto->mutable_options()->CopyFrom(options()); |
2843 | 0 | } |
2844 | |
|
2845 | 0 | if (client_streaming_) { |
2846 | 0 | proto->set_client_streaming(true); |
2847 | 0 | } |
2848 | 0 | if (server_streaming_) { |
2849 | 0 | proto->set_server_streaming(true); |
2850 | 0 | } |
2851 | 0 | } |
2852 | | |
2853 | | // DebugString methods =============================================== |
2854 | | |
2855 | | namespace { |
2856 | | |
2857 | | bool RetrieveOptionsAssumingRightPool( |
2858 | | int depth, const Message& options, |
2859 | 0 | std::vector<std::string>* option_entries) { |
2860 | 0 | option_entries->clear(); |
2861 | 0 | const Reflection* reflection = options.GetReflection(); |
2862 | 0 | std::vector<const FieldDescriptor*> fields; |
2863 | 0 | reflection->ListFields(options, &fields); |
2864 | 0 | for (const FieldDescriptor* field : fields) { |
2865 | 0 | int count = 1; |
2866 | 0 | bool repeated = false; |
2867 | 0 | if (field->is_repeated()) { |
2868 | 0 | count = reflection->FieldSize(options, field); |
2869 | 0 | repeated = true; |
2870 | 0 | } |
2871 | 0 | for (int j = 0; j < count; j++) { |
2872 | 0 | std::string fieldval; |
2873 | 0 | if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { |
2874 | 0 | std::string tmp; |
2875 | 0 | TextFormat::Printer printer; |
2876 | 0 | printer.SetExpandAny(true); |
2877 | 0 | printer.SetInitialIndentLevel(depth + 1); |
2878 | 0 | printer.PrintFieldValueToString(options, field, repeated ? j : -1, |
2879 | 0 | &tmp); |
2880 | 0 | fieldval.append("{\n"); |
2881 | 0 | fieldval.append(tmp); |
2882 | 0 | fieldval.append(depth * 2, ' '); |
2883 | 0 | fieldval.append("}"); |
2884 | 0 | } else { |
2885 | 0 | TextFormat::PrintFieldValueToString(options, field, repeated ? j : -1, |
2886 | 0 | &fieldval); |
2887 | 0 | } |
2888 | 0 | std::string name; |
2889 | 0 | if (field->is_extension()) { |
2890 | 0 | name = absl::StrCat("(.", field->full_name(), ")"); |
2891 | 0 | } else { |
2892 | 0 | name = field->name(); |
2893 | 0 | } |
2894 | 0 | option_entries->push_back(absl::StrCat(name, " = ", fieldval)); |
2895 | 0 | } |
2896 | 0 | } |
2897 | 0 | return !option_entries->empty(); |
2898 | 0 | } |
2899 | | |
2900 | | // Used by each of the option formatters. |
2901 | | bool RetrieveOptions(int depth, const Message& options, |
2902 | | const DescriptorPool* pool, |
2903 | 0 | std::vector<std::string>* option_entries) { |
2904 | | // When printing custom options for a descriptor, we must use an options |
2905 | | // message built on top of the same DescriptorPool where the descriptor |
2906 | | // is coming from. This is to ensure we are interpreting custom options |
2907 | | // against the right pool. |
2908 | 0 | if (options.GetDescriptor()->file()->pool() == pool) { |
2909 | 0 | return RetrieveOptionsAssumingRightPool(depth, options, option_entries); |
2910 | 0 | } else { |
2911 | 0 | const Descriptor* option_descriptor = |
2912 | 0 | pool->FindMessageTypeByName(options.GetDescriptor()->full_name()); |
2913 | 0 | if (option_descriptor == nullptr) { |
2914 | | // descriptor.proto is not in the pool. This means no custom options are |
2915 | | // used so we are safe to proceed with the compiled options message type. |
2916 | 0 | return RetrieveOptionsAssumingRightPool(depth, options, option_entries); |
2917 | 0 | } |
2918 | 0 | DynamicMessageFactory factory; |
2919 | 0 | std::unique_ptr<Message> dynamic_options( |
2920 | 0 | factory.GetPrototype(option_descriptor)->New()); |
2921 | 0 | std::string serialized = options.SerializeAsString(); |
2922 | 0 | io::CodedInputStream input( |
2923 | 0 | reinterpret_cast<const uint8_t*>(serialized.c_str()), |
2924 | 0 | serialized.size()); |
2925 | 0 | input.SetExtensionRegistry(pool, &factory); |
2926 | 0 | if (dynamic_options->ParseFromCodedStream(&input)) { |
2927 | 0 | return RetrieveOptionsAssumingRightPool(depth, *dynamic_options, |
2928 | 0 | option_entries); |
2929 | 0 | } else { |
2930 | 0 | ABSL_LOG(ERROR) << "Found invalid proto option data for: " |
2931 | 0 | << options.GetDescriptor()->full_name(); |
2932 | 0 | return RetrieveOptionsAssumingRightPool(depth, options, option_entries); |
2933 | 0 | } |
2934 | 0 | } |
2935 | 0 | } |
2936 | | |
2937 | | // Formats options that all appear together in brackets. Does not include |
2938 | | // brackets. |
2939 | | bool FormatBracketedOptions(int depth, const Message& options, |
2940 | 0 | const DescriptorPool* pool, std::string* output) { |
2941 | 0 | std::vector<std::string> all_options; |
2942 | 0 | if (RetrieveOptions(depth, options, pool, &all_options)) { |
2943 | 0 | output->append(absl::StrJoin(all_options, ", ")); |
2944 | 0 | } |
2945 | 0 | return !all_options.empty(); |
2946 | 0 | } |
2947 | | |
2948 | | // Formats options one per line |
2949 | | bool FormatLineOptions(int depth, const Message& options, |
2950 | 0 | const DescriptorPool* pool, std::string* output) { |
2951 | 0 | std::string prefix(depth * 2, ' '); |
2952 | 0 | std::vector<std::string> all_options; |
2953 | 0 | if (RetrieveOptions(depth, options, pool, &all_options)) { |
2954 | 0 | for (const std::string& option : all_options) { |
2955 | 0 | absl::SubstituteAndAppend(output, "$0option $1;\n", prefix, option); |
2956 | 0 | } |
2957 | 0 | } |
2958 | 0 | return !all_options.empty(); |
2959 | 0 | } |
2960 | | |
2961 | | class SourceLocationCommentPrinter { |
2962 | | public: |
2963 | | template <typename DescType> |
2964 | | SourceLocationCommentPrinter(const DescType* desc, const std::string& prefix, |
2965 | | const DebugStringOptions& options) |
2966 | 0 | : options_(options), prefix_(prefix) { |
2967 | | // Perform the SourceLocation lookup only if we're including user comments, |
2968 | | // because the lookup is fairly expensive. |
2969 | 0 | have_source_loc_ = |
2970 | 0 | options.include_comments && desc->GetSourceLocation(&source_loc_); |
2971 | 0 | } Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::SourceLocationCommentPrinter::SourceLocationCommentPrinter<google::protobuf::FileDescriptor>(google::protobuf::FileDescriptor const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, google::protobuf::DebugStringOptions const&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::SourceLocationCommentPrinter::SourceLocationCommentPrinter<google::protobuf::Descriptor>(google::protobuf::Descriptor const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, google::protobuf::DebugStringOptions const&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::SourceLocationCommentPrinter::SourceLocationCommentPrinter<google::protobuf::FieldDescriptor>(google::protobuf::FieldDescriptor const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, google::protobuf::DebugStringOptions const&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::SourceLocationCommentPrinter::SourceLocationCommentPrinter<google::protobuf::OneofDescriptor>(google::protobuf::OneofDescriptor const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, google::protobuf::DebugStringOptions const&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::SourceLocationCommentPrinter::SourceLocationCommentPrinter<google::protobuf::EnumDescriptor>(google::protobuf::EnumDescriptor const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, google::protobuf::DebugStringOptions const&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::SourceLocationCommentPrinter::SourceLocationCommentPrinter<google::protobuf::EnumValueDescriptor>(google::protobuf::EnumValueDescriptor const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, google::protobuf::DebugStringOptions const&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::SourceLocationCommentPrinter::SourceLocationCommentPrinter<google::protobuf::ServiceDescriptor>(google::protobuf::ServiceDescriptor const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, google::protobuf::DebugStringOptions const&) Unexecuted instantiation: descriptor.cc:google::protobuf::(anonymous namespace)::SourceLocationCommentPrinter::SourceLocationCommentPrinter<google::protobuf::MethodDescriptor>(google::protobuf::MethodDescriptor const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, google::protobuf::DebugStringOptions const&) |
2972 | | SourceLocationCommentPrinter(const FileDescriptor* file, |
2973 | | const std::vector<int>& path, |
2974 | | const std::string& prefix, |
2975 | | const DebugStringOptions& options) |
2976 | 0 | : options_(options), prefix_(prefix) { |
2977 | | // Perform the SourceLocation lookup only if we're including user comments, |
2978 | | // because the lookup is fairly expensive. |
2979 | 0 | have_source_loc_ = |
2980 | 0 | options.include_comments && file->GetSourceLocation(path, &source_loc_); |
2981 | 0 | } |
2982 | 0 | void AddPreComment(std::string* output) { |
2983 | 0 | if (have_source_loc_) { |
2984 | | // Detached leading comments. |
2985 | 0 | for (const std::string& leading_detached_comment : |
2986 | 0 | source_loc_.leading_detached_comments) { |
2987 | 0 | absl::StrAppend(output, FormatComment(leading_detached_comment), "\n"); |
2988 | 0 | } |
2989 | | // Attached leading comments. |
2990 | 0 | if (!source_loc_.leading_comments.empty()) { |
2991 | 0 | absl::StrAppend(output, FormatComment(source_loc_.leading_comments)); |
2992 | 0 | } |
2993 | 0 | } |
2994 | 0 | } |
2995 | 0 | void AddPostComment(std::string* output) { |
2996 | 0 | if (have_source_loc_ && source_loc_.trailing_comments.size() > 0) { |
2997 | 0 | absl::StrAppend(output, FormatComment(source_loc_.trailing_comments)); |
2998 | 0 | } |
2999 | 0 | } |
3000 | | |
3001 | | // Format comment such that each line becomes a full-line C++-style comment in |
3002 | | // the DebugString() output. |
3003 | 0 | std::string FormatComment(const std::string& comment_text) { |
3004 | 0 | std::string stripped_comment = comment_text; |
3005 | 0 | absl::StripAsciiWhitespace(&stripped_comment); |
3006 | 0 | std::string output; |
3007 | 0 | for (absl::string_view line : absl::StrSplit(stripped_comment, '\n')) { |
3008 | 0 | absl::SubstituteAndAppend(&output, "$0// $1\n", prefix_, line); |
3009 | 0 | } |
3010 | 0 | return output; |
3011 | 0 | } |
3012 | | |
3013 | | private: |
3014 | | |
3015 | | bool have_source_loc_; |
3016 | | SourceLocation source_loc_; |
3017 | | DebugStringOptions options_; |
3018 | | std::string prefix_; |
3019 | | }; |
3020 | | |
3021 | | } // anonymous namespace |
3022 | | |
3023 | 0 | std::string FileDescriptor::DebugString() const { |
3024 | 0 | DebugStringOptions options; // default options |
3025 | 0 | return DebugStringWithOptions(options); |
3026 | 0 | } |
3027 | | |
3028 | | std::string FileDescriptor::DebugStringWithOptions( |
3029 | 0 | const DebugStringOptions& debug_string_options) const { |
3030 | 0 | std::string contents; |
3031 | 0 | { |
3032 | 0 | std::vector<int> path; |
3033 | 0 | path.push_back(FileDescriptorProto::kSyntaxFieldNumber); |
3034 | 0 | SourceLocationCommentPrinter syntax_comment(this, path, "", |
3035 | 0 | debug_string_options); |
3036 | 0 | syntax_comment.AddPreComment(&contents); |
3037 | 0 | absl::SubstituteAndAppend( |
3038 | 0 | &contents, "syntax = \"$0\";\n\n", |
3039 | 0 | FileDescriptorLegacy::SyntaxName(FileDescriptorLegacy(this).syntax())); |
3040 | 0 | syntax_comment.AddPostComment(&contents); |
3041 | 0 | } |
3042 | |
|
3043 | 0 | SourceLocationCommentPrinter comment_printer(this, "", debug_string_options); |
3044 | 0 | comment_printer.AddPreComment(&contents); |
3045 | |
|
3046 | 0 | absl::flat_hash_set<int> public_dependencies( |
3047 | 0 | public_dependencies_, public_dependencies_ + public_dependency_count_); |
3048 | 0 | absl::flat_hash_set<int> weak_dependencies( |
3049 | 0 | weak_dependencies_, weak_dependencies_ + weak_dependency_count_); |
3050 | |
|
3051 | 0 | for (int i = 0; i < dependency_count(); i++) { |
3052 | 0 | if (public_dependencies.contains(i)) { |
3053 | 0 | absl::SubstituteAndAppend(&contents, "import public \"$0\";\n", |
3054 | 0 | dependency(i)->name()); |
3055 | 0 | } else if (weak_dependencies.contains(i)) { |
3056 | 0 | absl::SubstituteAndAppend(&contents, "import weak \"$0\";\n", |
3057 | 0 | dependency(i)->name()); |
3058 | 0 | } else { |
3059 | 0 | absl::SubstituteAndAppend(&contents, "import \"$0\";\n", |
3060 | 0 | dependency(i)->name()); |
3061 | 0 | } |
3062 | 0 | } |
3063 | |
|
3064 | 0 | if (!package().empty()) { |
3065 | 0 | std::vector<int> path; |
3066 | 0 | path.push_back(FileDescriptorProto::kPackageFieldNumber); |
3067 | 0 | SourceLocationCommentPrinter package_comment(this, path, "", |
3068 | 0 | debug_string_options); |
3069 | 0 | package_comment.AddPreComment(&contents); |
3070 | 0 | absl::SubstituteAndAppend(&contents, "package $0;\n\n", package()); |
3071 | 0 | package_comment.AddPostComment(&contents); |
3072 | 0 | } |
3073 | |
|
3074 | 0 | if (FormatLineOptions(0, options(), pool(), &contents)) { |
3075 | 0 | contents.append("\n"); // add some space if we had options |
3076 | 0 | } |
3077 | |
|
3078 | 0 | for (int i = 0; i < enum_type_count(); i++) { |
3079 | 0 | enum_type(i)->DebugString(0, &contents, debug_string_options); |
3080 | 0 | contents.append("\n"); |
3081 | 0 | } |
3082 | | |
3083 | | // Find all the 'group' type extensions; we will not output their nested |
3084 | | // definitions (those will be done with their group field descriptor). |
3085 | 0 | absl::flat_hash_set<const Descriptor*> groups; |
3086 | 0 | for (int i = 0; i < extension_count(); i++) { |
3087 | 0 | if (extension(i)->type() == FieldDescriptor::TYPE_GROUP) { |
3088 | 0 | groups.insert(extension(i)->message_type()); |
3089 | 0 | } |
3090 | 0 | } |
3091 | |
|
3092 | 0 | for (int i = 0; i < message_type_count(); i++) { |
3093 | 0 | if (!groups.contains(message_type(i))) { |
3094 | 0 | message_type(i)->DebugString(0, &contents, debug_string_options, |
3095 | 0 | /* include_opening_clause */ true); |
3096 | 0 | contents.append("\n"); |
3097 | 0 | } |
3098 | 0 | } |
3099 | |
|
3100 | 0 | for (int i = 0; i < service_count(); i++) { |
3101 | 0 | service(i)->DebugString(&contents, debug_string_options); |
3102 | 0 | contents.append("\n"); |
3103 | 0 | } |
3104 | |
|
3105 | 0 | const Descriptor* containing_type = nullptr; |
3106 | 0 | for (int i = 0; i < extension_count(); i++) { |
3107 | 0 | if (extension(i)->containing_type() != containing_type) { |
3108 | 0 | if (i > 0) contents.append("}\n\n"); |
3109 | 0 | containing_type = extension(i)->containing_type(); |
3110 | 0 | absl::SubstituteAndAppend(&contents, "extend .$0 {\n", |
3111 | 0 | containing_type->full_name()); |
3112 | 0 | } |
3113 | 0 | extension(i)->DebugString(1, &contents, debug_string_options); |
3114 | 0 | } |
3115 | 0 | if (extension_count() > 0) contents.append("}\n\n"); |
3116 | |
|
3117 | 0 | comment_printer.AddPostComment(&contents); |
3118 | |
|
3119 | 0 | return contents; |
3120 | 0 | } |
3121 | | |
3122 | 0 | std::string Descriptor::DebugString() const { |
3123 | 0 | DebugStringOptions options; // default options |
3124 | 0 | return DebugStringWithOptions(options); |
3125 | 0 | } |
3126 | | |
3127 | | std::string Descriptor::DebugStringWithOptions( |
3128 | 0 | const DebugStringOptions& options) const { |
3129 | 0 | std::string contents; |
3130 | 0 | DebugString(0, &contents, options, /* include_opening_clause */ true); |
3131 | 0 | return contents; |
3132 | 0 | } |
3133 | | |
3134 | | void Descriptor::DebugString(int depth, std::string* contents, |
3135 | | const DebugStringOptions& debug_string_options, |
3136 | 0 | bool include_opening_clause) const { |
3137 | 0 | if (options().map_entry()) { |
3138 | | // Do not generate debug string for auto-generated map-entry type. |
3139 | 0 | return; |
3140 | 0 | } |
3141 | 0 | std::string prefix(depth * 2, ' '); |
3142 | 0 | ++depth; |
3143 | |
|
3144 | 0 | SourceLocationCommentPrinter comment_printer(this, prefix, |
3145 | 0 | debug_string_options); |
3146 | 0 | comment_printer.AddPreComment(contents); |
3147 | |
|
3148 | 0 | if (include_opening_clause) { |
3149 | 0 | absl::SubstituteAndAppend(contents, "$0message $1", prefix, name()); |
3150 | 0 | } |
3151 | 0 | contents->append(" {\n"); |
3152 | |
|
3153 | 0 | FormatLineOptions(depth, options(), file()->pool(), contents); |
3154 | | |
3155 | | // Find all the 'group' types for fields and extensions; we will not output |
3156 | | // their nested definitions (those will be done with their group field |
3157 | | // descriptor). |
3158 | 0 | absl::flat_hash_set<const Descriptor*> groups; |
3159 | 0 | for (int i = 0; i < field_count(); i++) { |
3160 | 0 | if (field(i)->type() == FieldDescriptor::TYPE_GROUP) { |
3161 | 0 | groups.insert(field(i)->message_type()); |
3162 | 0 | } |
3163 | 0 | } |
3164 | 0 | for (int i = 0; i < extension_count(); i++) { |
3165 | 0 | if (extension(i)->type() == FieldDescriptor::TYPE_GROUP) { |
3166 | 0 | groups.insert(extension(i)->message_type()); |
3167 | 0 | } |
3168 | 0 | } |
3169 | |
|
3170 | 0 | for (int i = 0; i < nested_type_count(); i++) { |
3171 | 0 | if (!groups.contains(nested_type(i))) { |
3172 | 0 | nested_type(i)->DebugString(depth, contents, debug_string_options, |
3173 | 0 | /* include_opening_clause */ true); |
3174 | 0 | } |
3175 | 0 | } |
3176 | 0 | for (int i = 0; i < enum_type_count(); i++) { |
3177 | 0 | enum_type(i)->DebugString(depth, contents, debug_string_options); |
3178 | 0 | } |
3179 | 0 | for (int i = 0; i < field_count(); i++) { |
3180 | 0 | if (field(i)->real_containing_oneof() == nullptr) { |
3181 | 0 | field(i)->DebugString(depth, contents, debug_string_options); |
3182 | 0 | } else if (field(i)->containing_oneof()->field(0) == field(i)) { |
3183 | | // This is the first field in this oneof, so print the whole oneof. |
3184 | 0 | field(i)->containing_oneof()->DebugString(depth, contents, |
3185 | 0 | debug_string_options); |
3186 | 0 | } |
3187 | 0 | } |
3188 | |
|
3189 | 0 | for (int i = 0; i < extension_range_count(); i++) { |
3190 | 0 | absl::SubstituteAndAppend(contents, "$0 extensions $1", prefix, |
3191 | 0 | extension_range(i)->start_number()); |
3192 | 0 | if (extension_range(i)->end_number() > |
3193 | 0 | extension_range(i)->start_number() + 1) { |
3194 | 0 | absl::SubstituteAndAppend(contents, " to $0", |
3195 | 0 | extension_range(i)->end_number() - 1); |
3196 | 0 | } |
3197 | 0 | if (extension_range(i)->options().declaration_size() > 0) { |
3198 | 0 | absl::StrAppend(contents, " ["); |
3199 | 0 | for (int j = 0; j < extension_range(i)->options().declaration_size(); |
3200 | 0 | ++j) { |
3201 | 0 | if (j > 0) { |
3202 | 0 | absl::StrAppend(contents, ","); |
3203 | 0 | } |
3204 | 0 | absl::SubstituteAndAppend( |
3205 | 0 | contents, " declaration = { $0 }", |
3206 | 0 | extension_range(i)->options().declaration(j).ShortDebugString()); |
3207 | 0 | } |
3208 | 0 | absl::StrAppend(contents, " ] "); |
3209 | 0 | } |
3210 | 0 | absl::StrAppend(contents, ";\n"); |
3211 | 0 | } |
3212 | | |
3213 | | // Group extensions by what they extend, so they can be printed out together. |
3214 | 0 | const Descriptor* containing_type = nullptr; |
3215 | 0 | for (int i = 0; i < extension_count(); i++) { |
3216 | 0 | if (extension(i)->containing_type() != containing_type) { |
3217 | 0 | if (i > 0) absl::SubstituteAndAppend(contents, "$0 }\n", prefix); |
3218 | 0 | containing_type = extension(i)->containing_type(); |
3219 | 0 | absl::SubstituteAndAppend(contents, "$0 extend .$1 {\n", prefix, |
3220 | 0 | containing_type->full_name()); |
3221 | 0 | } |
3222 | 0 | extension(i)->DebugString(depth + 1, contents, debug_string_options); |
3223 | 0 | } |
3224 | 0 | if (extension_count() > 0) |
3225 | 0 | absl::SubstituteAndAppend(contents, "$0 }\n", prefix); |
3226 | |
|
3227 | 0 | if (reserved_range_count() > 0) { |
3228 | 0 | absl::SubstituteAndAppend(contents, "$0 reserved ", prefix); |
3229 | 0 | for (int i = 0; i < reserved_range_count(); i++) { |
3230 | 0 | const Descriptor::ReservedRange* range = reserved_range(i); |
3231 | 0 | if (range->end == range->start + 1) { |
3232 | 0 | absl::SubstituteAndAppend(contents, "$0, ", range->start); |
3233 | 0 | } else if (range->end > FieldDescriptor::kMaxNumber) { |
3234 | 0 | absl::SubstituteAndAppend(contents, "$0 to max, ", range->start); |
3235 | 0 | } else { |
3236 | 0 | absl::SubstituteAndAppend(contents, "$0 to $1, ", range->start, |
3237 | 0 | range->end - 1); |
3238 | 0 | } |
3239 | 0 | } |
3240 | 0 | contents->replace(contents->size() - 2, 2, ";\n"); |
3241 | 0 | } |
3242 | |
|
3243 | 0 | if (reserved_name_count() > 0) { |
3244 | 0 | absl::SubstituteAndAppend(contents, "$0 reserved ", prefix); |
3245 | 0 | for (int i = 0; i < reserved_name_count(); i++) { |
3246 | 0 | absl::SubstituteAndAppend(contents, "\"$0\", ", |
3247 | 0 | absl::CEscape(reserved_name(i))); |
3248 | 0 | } |
3249 | 0 | contents->replace(contents->size() - 2, 2, ";\n"); |
3250 | 0 | } |
3251 | |
|
3252 | 0 | absl::SubstituteAndAppend(contents, "$0}\n", prefix); |
3253 | 0 | comment_printer.AddPostComment(contents); |
3254 | 0 | } |
3255 | | |
3256 | 0 | std::string FieldDescriptor::DebugString() const { |
3257 | 0 | DebugStringOptions options; // default options |
3258 | 0 | return DebugStringWithOptions(options); |
3259 | 0 | } |
3260 | | |
3261 | | std::string FieldDescriptor::DebugStringWithOptions( |
3262 | 0 | const DebugStringOptions& debug_string_options) const { |
3263 | 0 | std::string contents; |
3264 | 0 | int depth = 0; |
3265 | 0 | if (is_extension()) { |
3266 | 0 | absl::SubstituteAndAppend(&contents, "extend .$0 {\n", |
3267 | 0 | containing_type()->full_name()); |
3268 | 0 | depth = 1; |
3269 | 0 | } |
3270 | 0 | DebugString(depth, &contents, debug_string_options); |
3271 | 0 | if (is_extension()) { |
3272 | 0 | contents.append("}\n"); |
3273 | 0 | } |
3274 | 0 | return contents; |
3275 | 0 | } |
3276 | | |
3277 | | // The field type string used in FieldDescriptor::DebugString() |
3278 | 0 | std::string FieldDescriptor::FieldTypeNameDebugString() const { |
3279 | 0 | switch (type()) { |
3280 | 0 | case TYPE_MESSAGE: |
3281 | 0 | return absl::StrCat(".", message_type()->full_name()); |
3282 | 0 | case TYPE_ENUM: |
3283 | 0 | return absl::StrCat(".", enum_type()->full_name()); |
3284 | 0 | default: |
3285 | 0 | return kTypeToName[type()]; |
3286 | 0 | } |
3287 | 0 | } |
3288 | | |
3289 | | void FieldDescriptor::DebugString( |
3290 | | int depth, std::string* contents, |
3291 | 0 | const DebugStringOptions& debug_string_options) const { |
3292 | 0 | std::string prefix(depth * 2, ' '); |
3293 | 0 | std::string field_type; |
3294 | | |
3295 | | // Special case map fields. |
3296 | 0 | if (is_map()) { |
3297 | 0 | absl::SubstituteAndAppend( |
3298 | 0 | &field_type, "map<$0, $1>", |
3299 | 0 | message_type()->field(0)->FieldTypeNameDebugString(), |
3300 | 0 | message_type()->field(1)->FieldTypeNameDebugString()); |
3301 | 0 | } else { |
3302 | 0 | field_type = FieldTypeNameDebugString(); |
3303 | 0 | } |
3304 | |
|
3305 | 0 | std::string label = absl::StrCat(kLabelToName[this->label()], " "); |
3306 | | |
3307 | | // Label is omitted for maps, oneof, and plain proto3 fields. |
3308 | 0 | if (is_map() || real_containing_oneof() || |
3309 | 0 | (is_optional() && !FieldDescriptorLegacy(this).has_optional_keyword())) { |
3310 | 0 | label.clear(); |
3311 | 0 | } |
3312 | |
|
3313 | 0 | SourceLocationCommentPrinter comment_printer(this, prefix, |
3314 | 0 | debug_string_options); |
3315 | 0 | comment_printer.AddPreComment(contents); |
3316 | |
|
3317 | 0 | absl::SubstituteAndAppend( |
3318 | 0 | contents, "$0$1$2 $3 = $4", prefix, label, field_type, |
3319 | 0 | type() == TYPE_GROUP ? message_type()->name() : name(), number()); |
3320 | |
|
3321 | 0 | bool bracketed = false; |
3322 | 0 | if (has_default_value()) { |
3323 | 0 | bracketed = true; |
3324 | 0 | absl::SubstituteAndAppend(contents, " [default = $0", |
3325 | 0 | DefaultValueAsString(true)); |
3326 | 0 | } |
3327 | 0 | if (has_json_name_) { |
3328 | 0 | if (!bracketed) { |
3329 | 0 | bracketed = true; |
3330 | 0 | contents->append(" ["); |
3331 | 0 | } else { |
3332 | 0 | contents->append(", "); |
3333 | 0 | } |
3334 | 0 | contents->append("json_name = \""); |
3335 | 0 | contents->append(absl::CEscape(json_name())); |
3336 | 0 | contents->append("\""); |
3337 | 0 | } |
3338 | |
|
3339 | 0 | std::string formatted_options; |
3340 | 0 | if (FormatBracketedOptions(depth, options(), file()->pool(), |
3341 | 0 | &formatted_options)) { |
3342 | 0 | contents->append(bracketed ? ", " : " ["); |
3343 | 0 | bracketed = true; |
3344 | 0 | contents->append(formatted_options); |
3345 | 0 | } |
3346 | |
|
3347 | 0 | if (bracketed) { |
3348 | 0 | contents->append("]"); |
3349 | 0 | } |
3350 | |
|
3351 | 0 | if (type() == TYPE_GROUP) { |
3352 | 0 | if (debug_string_options.elide_group_body) { |
3353 | 0 | contents->append(" { ... };\n"); |
3354 | 0 | } else { |
3355 | 0 | message_type()->DebugString(depth, contents, debug_string_options, |
3356 | 0 | /* include_opening_clause */ false); |
3357 | 0 | } |
3358 | 0 | } else { |
3359 | 0 | contents->append(";\n"); |
3360 | 0 | } |
3361 | |
|
3362 | 0 | comment_printer.AddPostComment(contents); |
3363 | 0 | } |
3364 | | |
3365 | 0 | std::string OneofDescriptor::DebugString() const { |
3366 | 0 | DebugStringOptions options; // default values |
3367 | 0 | return DebugStringWithOptions(options); |
3368 | 0 | } |
3369 | | |
3370 | | std::string OneofDescriptor::DebugStringWithOptions( |
3371 | 0 | const DebugStringOptions& options) const { |
3372 | 0 | std::string contents; |
3373 | 0 | DebugString(0, &contents, options); |
3374 | 0 | return contents; |
3375 | 0 | } |
3376 | | |
3377 | | void OneofDescriptor::DebugString( |
3378 | | int depth, std::string* contents, |
3379 | 0 | const DebugStringOptions& debug_string_options) const { |
3380 | 0 | std::string prefix(depth * 2, ' '); |
3381 | 0 | ++depth; |
3382 | 0 | SourceLocationCommentPrinter comment_printer(this, prefix, |
3383 | 0 | debug_string_options); |
3384 | 0 | comment_printer.AddPreComment(contents); |
3385 | 0 | absl::SubstituteAndAppend(contents, "$0oneof $1 {", prefix, name()); |
3386 | |
|
3387 | 0 | FormatLineOptions(depth, options(), containing_type()->file()->pool(), |
3388 | 0 | contents); |
3389 | |
|
3390 | 0 | if (debug_string_options.elide_oneof_body) { |
3391 | 0 | contents->append(" ... }\n"); |
3392 | 0 | } else { |
3393 | 0 | contents->append("\n"); |
3394 | 0 | for (int i = 0; i < field_count(); i++) { |
3395 | 0 | field(i)->DebugString(depth, contents, debug_string_options); |
3396 | 0 | } |
3397 | 0 | absl::SubstituteAndAppend(contents, "$0}\n", prefix); |
3398 | 0 | } |
3399 | 0 | comment_printer.AddPostComment(contents); |
3400 | 0 | } |
3401 | | |
3402 | 0 | std::string EnumDescriptor::DebugString() const { |
3403 | 0 | DebugStringOptions options; // default values |
3404 | 0 | return DebugStringWithOptions(options); |
3405 | 0 | } |
3406 | | |
3407 | | std::string EnumDescriptor::DebugStringWithOptions( |
3408 | 0 | const DebugStringOptions& options) const { |
3409 | 0 | std::string contents; |
3410 | 0 | DebugString(0, &contents, options); |
3411 | 0 | return contents; |
3412 | 0 | } |
3413 | | |
3414 | | void EnumDescriptor::DebugString( |
3415 | | int depth, std::string* contents, |
3416 | 0 | const DebugStringOptions& debug_string_options) const { |
3417 | 0 | std::string prefix(depth * 2, ' '); |
3418 | 0 | ++depth; |
3419 | |
|
3420 | 0 | SourceLocationCommentPrinter comment_printer(this, prefix, |
3421 | 0 | debug_string_options); |
3422 | 0 | comment_printer.AddPreComment(contents); |
3423 | |
|
3424 | 0 | absl::SubstituteAndAppend(contents, "$0enum $1 {\n", prefix, name()); |
3425 | |
|
3426 | 0 | FormatLineOptions(depth, options(), file()->pool(), contents); |
3427 | |
|
3428 | 0 | for (int i = 0; i < value_count(); i++) { |
3429 | 0 | value(i)->DebugString(depth, contents, debug_string_options); |
3430 | 0 | } |
3431 | |
|
3432 | 0 | if (reserved_range_count() > 0) { |
3433 | 0 | absl::SubstituteAndAppend(contents, "$0 reserved ", prefix); |
3434 | 0 | for (int i = 0; i < reserved_range_count(); i++) { |
3435 | 0 | const EnumDescriptor::ReservedRange* range = reserved_range(i); |
3436 | 0 | if (range->end == range->start) { |
3437 | 0 | absl::SubstituteAndAppend(contents, "$0, ", range->start); |
3438 | 0 | } else if (range->end == INT_MAX) { |
3439 | 0 | absl::SubstituteAndAppend(contents, "$0 to max, ", range->start); |
3440 | 0 | } else { |
3441 | 0 | absl::SubstituteAndAppend(contents, "$0 to $1, ", range->start, |
3442 | 0 | range->end); |
3443 | 0 | } |
3444 | 0 | } |
3445 | 0 | contents->replace(contents->size() - 2, 2, ";\n"); |
3446 | 0 | } |
3447 | |
|
3448 | 0 | if (reserved_name_count() > 0) { |
3449 | 0 | absl::SubstituteAndAppend(contents, "$0 reserved ", prefix); |
3450 | 0 | for (int i = 0; i < reserved_name_count(); i++) { |
3451 | 0 | absl::SubstituteAndAppend(contents, "\"$0\", ", |
3452 | 0 | absl::CEscape(reserved_name(i))); |
3453 | 0 | } |
3454 | 0 | contents->replace(contents->size() - 2, 2, ";\n"); |
3455 | 0 | } |
3456 | |
|
3457 | 0 | absl::SubstituteAndAppend(contents, "$0}\n", prefix); |
3458 | |
|
3459 | 0 | comment_printer.AddPostComment(contents); |
3460 | 0 | } |
3461 | | |
3462 | 0 | std::string EnumValueDescriptor::DebugString() const { |
3463 | 0 | DebugStringOptions options; // default values |
3464 | 0 | return DebugStringWithOptions(options); |
3465 | 0 | } |
3466 | | |
3467 | | std::string EnumValueDescriptor::DebugStringWithOptions( |
3468 | 0 | const DebugStringOptions& options) const { |
3469 | 0 | std::string contents; |
3470 | 0 | DebugString(0, &contents, options); |
3471 | 0 | return contents; |
3472 | 0 | } |
3473 | | |
3474 | | void EnumValueDescriptor::DebugString( |
3475 | | int depth, std::string* contents, |
3476 | 0 | const DebugStringOptions& debug_string_options) const { |
3477 | 0 | std::string prefix(depth * 2, ' '); |
3478 | |
|
3479 | 0 | SourceLocationCommentPrinter comment_printer(this, prefix, |
3480 | 0 | debug_string_options); |
3481 | 0 | comment_printer.AddPreComment(contents); |
3482 | |
|
3483 | 0 | absl::SubstituteAndAppend(contents, "$0$1 = $2", prefix, name(), number()); |
3484 | |
|
3485 | 0 | std::string formatted_options; |
3486 | 0 | if (FormatBracketedOptions(depth, options(), type()->file()->pool(), |
3487 | 0 | &formatted_options)) { |
3488 | 0 | absl::SubstituteAndAppend(contents, " [$0]", formatted_options); |
3489 | 0 | } |
3490 | 0 | contents->append(";\n"); |
3491 | |
|
3492 | 0 | comment_printer.AddPostComment(contents); |
3493 | 0 | } |
3494 | | |
3495 | 0 | std::string ServiceDescriptor::DebugString() const { |
3496 | 0 | DebugStringOptions options; // default values |
3497 | 0 | return DebugStringWithOptions(options); |
3498 | 0 | } |
3499 | | |
3500 | | std::string ServiceDescriptor::DebugStringWithOptions( |
3501 | 0 | const DebugStringOptions& options) const { |
3502 | 0 | std::string contents; |
3503 | 0 | DebugString(&contents, options); |
3504 | 0 | return contents; |
3505 | 0 | } |
3506 | | |
3507 | | void ServiceDescriptor::DebugString( |
3508 | | std::string* contents, |
3509 | 0 | const DebugStringOptions& debug_string_options) const { |
3510 | 0 | SourceLocationCommentPrinter comment_printer(this, /* prefix */ "", |
3511 | 0 | debug_string_options); |
3512 | 0 | comment_printer.AddPreComment(contents); |
3513 | |
|
3514 | 0 | absl::SubstituteAndAppend(contents, "service $0 {\n", name()); |
3515 | |
|
3516 | 0 | FormatLineOptions(1, options(), file()->pool(), contents); |
3517 | |
|
3518 | 0 | for (int i = 0; i < method_count(); i++) { |
3519 | 0 | method(i)->DebugString(1, contents, debug_string_options); |
3520 | 0 | } |
3521 | |
|
3522 | 0 | contents->append("}\n"); |
3523 | |
|
3524 | 0 | comment_printer.AddPostComment(contents); |
3525 | 0 | } |
3526 | | |
3527 | 0 | std::string MethodDescriptor::DebugString() const { |
3528 | 0 | DebugStringOptions options; // default values |
3529 | 0 | return DebugStringWithOptions(options); |
3530 | 0 | } |
3531 | | |
3532 | | std::string MethodDescriptor::DebugStringWithOptions( |
3533 | 0 | const DebugStringOptions& options) const { |
3534 | 0 | std::string contents; |
3535 | 0 | DebugString(0, &contents, options); |
3536 | 0 | return contents; |
3537 | 0 | } |
|