MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / FindDeps

Function FindDeps

tools/descriptor_pool_builder.cc:34–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32namespace {
33
34absl::Status FindDeps(
35 std::vector<const google::protobuf::FileDescriptor*>& to_resolve,
36 absl::flat_hash_set<const google::protobuf::FileDescriptor*>& resolved,
37 DescriptorPoolBuilder& builder) {
38 while (!to_resolve.empty()) {
39 const auto* file = to_resolve.back();
40 to_resolve.pop_back();
41 if (resolved.contains(file)) {
42 continue;
43 }
44 google::protobuf::FileDescriptorProto file_proto;
45 file->CopyTo(&file_proto);
46 // Note: order doesn't matter here as long as all the cross references are
47 // correct in the final database.
48 CEL_RETURN_IF_ERROR(builder.AddFileDescriptor(file_proto));
49 resolved.insert(file);
50 for (int i = 0; i < file->dependency_count(); ++i) {
51 to_resolve.push_back(file->dependency(i));
52 }
53 }
54 return absl::OkStatus();
55}
56
57} // namespace
58

Callers 1

Calls 2

AddFileDescriptorMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected