@@ -94,12 +94,12 @@ cc_library(
9494 "reference_annotations.h" ,
9595 ],
9696 deps = [
97+ ":annotation_parser" ,
9798 ":built_ins" ,
9899 ":ir_cc_proto" ,
99100 "//gutil/gutil:collections" ,
100101 "//gutil/gutil:status" ,
101102 "//p4_infra/p4_pdpi/internal:ordered_map" ,
102- "//p4_infra/p4_pdpi/utils:annotation_parser" ,
103103 "@com_github_p4lang_p4runtime//:p4info_cc_proto" ,
104104 "@com_google_absl//absl/container:btree" ,
105105 "@com_google_absl//absl/container:flat_hash_map" ,
@@ -204,13 +204,13 @@ cc_library(
204204 deps = [
205205 ":ir" ,
206206 ":ir_cc_proto" ,
207+ ":ir_utils" ,
207208 ":translation_options" ,
208209 "//gutil/gutil:collections" ,
209210 "//gutil/gutil:proto" ,
210211 "//gutil/gutil:status" ,
211212 "//p4_infra/p4_pdpi/internal:ordered_map" ,
212213 "//p4_infra/string_encodings:hex_string" ,
213- "//p4_infra/p4_pdpi/utils:ir" ,
214214 "@com_github_grpc_grpc//:grpc++" ,
215215 "@com_github_p4lang_p4runtime//:p4info_cc_proto" ,
216216 "@com_github_p4lang_p4runtime//:p4runtime_cc_proto" ,
@@ -323,12 +323,12 @@ cc_library(
323323 deps = [
324324 ":built_ins" ,
325325 ":ir_cc_proto" ,
326+ ":ir_utils" ,
326327 ":reference_annotations" ,
327328 ":translation_options" ,
328329 "//gutil/gutil:collections" ,
329330 "//gutil/gutil:proto" ,
330331 "//gutil/gutil:status" ,
331- "//p4_infra/p4_pdpi/utils:ir" ,
332332 "@com_github_grpc_grpc//:grpc++" ,
333333 "@com_github_p4lang_p4runtime//:p4info_cc_proto" ,
334334 "@com_github_p4lang_p4runtime//:p4runtime_cc_proto" ,
@@ -371,6 +371,55 @@ proto_library(
371371 ],
372372)
373373
374+ cc_library (
375+ name = "ir_utils" ,
376+ srcs = [
377+ "ir_utils.cc" ,
378+ ],
379+ hdrs = [
380+ "ir_utils.h" ,
381+ ],
382+ deps = [
383+ ":ir_cc_proto" ,
384+ ":translation_options" ,
385+ "//gutil/gutil:proto" ,
386+ "//gutil/gutil:status" ,
387+ "//p4_infra/netaddr:ipv4_address" ,
388+ "//p4_infra/netaddr:ipv6_address" ,
389+ "//p4_infra/netaddr:mac_address" ,
390+ "//p4_infra/string_encodings:byte_string" ,
391+ "@com_github_p4lang_p4runtime//:p4info_cc_proto" ,
392+ "@com_github_p4lang_p4runtime//:p4runtime_cc_proto" ,
393+ "@com_github_p4lang_p4runtime//:p4types_cc_proto" ,
394+ "@com_google_absl//absl/algorithm:container" ,
395+ "@com_google_absl//absl/container:btree" ,
396+ "@com_google_absl//absl/status" ,
397+ "@com_google_absl//absl/status:statusor" ,
398+ "@com_google_absl//absl/strings" ,
399+ "@com_google_googleapis//google/rpc:code_cc_proto" ,
400+ "@com_google_protobuf//:protobuf" ,
401+ "@com_google_protobuf//third_party/utf8_range:utf8_validity" ,
402+ ],
403+ )
404+
405+ cc_test (
406+ name = "ir_utils_test" ,
407+ srcs = ["ir_utils_test.cc" ],
408+ deps = [
409+ ":ir_cc_proto" ,
410+ ":ir_utils" ,
411+ "//gutil/gutil:proto" ,
412+ "//gutil/gutil:proto_matchers" ,
413+ "//gutil/gutil:status_matchers" ,
414+ "//p4_infra/netaddr:ipv6_address" ,
415+ "@com_google_absl//absl/status" ,
416+ "@com_google_absl//absl/status:statusor" ,
417+ "@com_google_absl//absl/strings" ,
418+ "@com_google_googletest//:gtest_main" ,
419+ "@com_google_protobuf//:protobuf" ,
420+ ],
421+ )
422+
374423proto_library (
375424 name = "p4_runtime_session_extras_proto" ,
376425 srcs = ["p4_runtime_session_extras.proto" ],
@@ -439,7 +488,7 @@ cc_library(
439488 ":ir_cc_proto" ,
440489 "//gutil/gutil:collections" ,
441490 "//gutil/gutil:status" ,
442- "//p4_infra/p4_pdpi/utils:ir " ,
491+ ":ir_utils " ,
443492 "@com_github_google_glog//:glog" ,
444493 "@com_github_p4lang_p4runtime//:p4info_cc_proto" ,
445494 "@com_github_p4lang_p4runtime//:p4runtime_cc_proto" ,
@@ -568,6 +617,34 @@ cc_library(
568617 deps = ["@com_google_absl//absl/strings:str_format" ],
569618)
570619
620+ cc_library (
621+ name = "annotation_parser" ,
622+ srcs = [
623+ "annotation_parser.cc" ,
624+ ],
625+ hdrs = [
626+ "annotation_parser.h" ,
627+ ],
628+ deps = [
629+ "//gutil/gutil:status" ,
630+ "@com_google_absl//absl/status:statusor" ,
631+ "@com_google_absl//absl/strings" ,
632+ ],
633+ )
634+
635+ cc_test (
636+ name = "annotation_parser_test" ,
637+ srcs = ["annotation_parser_test.cc" ],
638+ deps = [
639+ ":annotation_parser" ,
640+ "//gutil/gutil:status_matchers" ,
641+ "@com_google_absl//absl/status" ,
642+ "@com_google_absl//absl/status:statusor" ,
643+ "@com_google_absl//absl/strings" ,
644+ "@com_google_googletest//:gtest_main" ,
645+ ],
646+ )
647+
571648cc_library (
572649 name = "entity_keys" ,
573650 srcs = ["entity_keys.cc" ],
0 commit comments