diff --git a/xls/tools/BUILD b/xls/tools/BUILD index 3a14359adc..d810fe001f 100644 --- a/xls/tools/BUILD +++ b/xls/tools/BUILD @@ -984,7 +984,6 @@ cc_library( deps = [ ":scheduling_options_flags_cc_proto", "//xls/common/file:filesystem", - "//xls/common/status:ret_check", "//xls/common/status:status_macros", "//xls/delay_model:delay_estimator", "//xls/delay_model:delay_estimators", @@ -996,7 +995,6 @@ cc_library( "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", - "@com_google_protobuf//:protobuf", ], ) @@ -1025,13 +1023,11 @@ cc_library( deps = [ ":codegen_flags_cc_proto", "//xls/common/file:filesystem", - "//xls/common/status:ret_check", "//xls/common/status:status_macros", "@com_google_absl//absl/flags:flag", "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings:str_format", - "@com_google_protobuf//:protobuf", ], ) diff --git a/xls/tools/codegen_flags.cc b/xls/tools/codegen_flags.cc index 228a510fc4..c13c94b889 100644 --- a/xls/tools/codegen_flags.cc +++ b/xls/tools/codegen_flags.cc @@ -24,9 +24,7 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" #include "absl/strings/str_format.h" -#include "google/protobuf/text_format.h" #include "xls/common/file/filesystem.h" -#include "xls/common/status/ret_check.h" #include "xls/common/status/status_macros.h" #include "xls/tools/codegen_flags.pb.h" @@ -276,10 +274,8 @@ absl::StatusOr GetCodegenFlags() { absl::GetFlag(FLAGS_codegen_options_proto), &proto)); } if (absl::GetFlag(FLAGS_codegen_options_used_textproto_file)) { - std::string out; - XLS_RET_CHECK(google::protobuf::TextFormat::PrintToString(proto, &out)); - XLS_RETURN_IF_ERROR(SetFileContents( - *absl::GetFlag(FLAGS_codegen_options_used_textproto_file), out)); + XLS_RETURN_IF_ERROR(SetTextProtoFile( + *absl::GetFlag(FLAGS_codegen_options_used_textproto_file), proto)); } return proto; } diff --git a/xls/tools/scheduling_options_flags.cc b/xls/tools/scheduling_options_flags.cc index 4f87aea93f..d9b70cce35 100644 --- a/xls/tools/scheduling_options_flags.cc +++ b/xls/tools/scheduling_options_flags.cc @@ -28,9 +28,7 @@ #include "absl/strings/numbers.h" #include "absl/strings/str_format.h" #include "absl/strings/str_split.h" -#include "google/protobuf/text_format.h" #include "xls/common/file/filesystem.h" -#include "xls/common/status/ret_check.h" #include "xls/common/status/status_macros.h" #include "xls/delay_model/delay_estimator.h" #include "xls/delay_model/delay_estimators.h" @@ -257,10 +255,8 @@ absl::StatusOr GetSchedulingOptionsFlagsProto() { absl::GetFlag(FLAGS_scheduling_options_proto), &proto)); } if (absl::GetFlag(FLAGS_scheduling_options_used_textproto_file)) { - std::string out; - XLS_RET_CHECK(google::protobuf::TextFormat::PrintToString(proto, &out)); - XLS_RETURN_IF_ERROR(SetFileContents( - *absl::GetFlag(FLAGS_scheduling_options_used_textproto_file), out)); + XLS_RETURN_IF_ERROR(SetTextProtoFile( + *absl::GetFlag(FLAGS_scheduling_options_used_textproto_file), proto)); } return proto; }