Skip to content

Commit

Permalink
IWYU: Fix missing includes
Browse files Browse the repository at this point in the history
Addressing the top missing includes:
  * xls/ir/value.h
  * xls/ir/bits.h
  * xls/ir/node.h
  * xls/ir/source_location.h
  * absl/types/span.h

Should fix at least around 1600 misc-include-cleaner warnings.

PiperOrigin-RevId: 629910777
  • Loading branch information
hzeller authored and copybara-github committed May 2, 2024
1 parent 96797c7 commit f4e0f59
Show file tree
Hide file tree
Showing 201 changed files with 385 additions and 5 deletions.
16 changes: 16 additions & 0 deletions xls/codegen/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,15 @@ cc_library(
":vast",
"//xls/common:casts",
"//xls/common/status:status_macros",
"//xls/ir:bits",
"//xls/ir:source_location",
"@com_google_absl//absl/algorithm:container",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:span",
],
)

Expand All @@ -163,6 +165,7 @@ cc_test(
":vast",
"//xls/common:xls_gunit_main",
"//xls/common/status:matchers",
"//xls/ir:bits",
"//xls/ir:number_parser",
"//xls/ir:source_location",
"@com_google_absl//absl/status",
Expand All @@ -180,6 +183,7 @@ cc_test(
":vast",
"//xls/common:xls_gunit_main",
"//xls/common/status:matchers",
"//xls/ir:source_location",
"//xls/simulation:verilog_test_base",
"@com_google_absl//absl/log",
"@com_google_absl//absl/status",
Expand Down Expand Up @@ -276,6 +280,7 @@ cc_library(
"//xls/ir",
"//xls/ir:bits",
"//xls/ir:bits_ops",
"//xls/ir:source_location",
"//xls/ir:type",
"//xls/ir:value",
"//xls/ir:xls_type_cc_proto",
Expand Down Expand Up @@ -416,8 +421,10 @@ cc_library(
":op_override",
":ram_configuration",
"//xls/common:proto_adaptor_utils",
"//xls/ir:bits",
"//xls/ir:op",
"//xls/ir:register",
"//xls/ir:value",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/types:span",
],
Expand Down Expand Up @@ -828,8 +835,11 @@ cc_test(
":flattening",
"//xls/common:xls_gunit_main",
"//xls/common/status:matchers",
"//xls/ir:bits",
"//xls/ir:ir_test_base",
"//xls/ir:source_location",
"//xls/ir:type",
"//xls/ir:value",
"@com_google_googletest//:gtest",
],
)
Expand All @@ -847,10 +857,12 @@ cc_test(
"//xls/ir",
"//xls/ir:bits",
"//xls/ir:function_builder",
"//xls/ir:source_location",
"//xls/ir:type",
"//xls/ir:value",
"//xls/simulation:verilog_test_base",
"@com_google_absl//absl/status",
"@com_google_absl//absl/types:span",
"@com_google_googletest//:gtest",
],
)
Expand Down Expand Up @@ -1112,8 +1124,11 @@ cc_test(
"//xls/common/status:matchers",
"//xls/delay_model:delay_estimators",
"//xls/ir",
"//xls/ir:bits",
"//xls/ir:function_builder",
"//xls/ir:source_location",
"//xls/ir:type",
"//xls/ir:value",
"//xls/scheduling:pipeline_schedule",
"//xls/scheduling:run_pipeline_schedule",
"//xls/scheduling:scheduling_options",
Expand Down Expand Up @@ -1147,6 +1162,7 @@ cc_test(
"//xls/ir:bits",
"//xls/ir:function_builder",
"//xls/ir:ir_test_base",
"//xls/ir:value",
"@com_google_googletest//:gtest",
],
)
Expand Down
1 change: 1 addition & 0 deletions xls/codegen/bdd_io_analysis_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "xls/ir/function_builder.h"
#include "xls/ir/ir_test_base.h"
#include "xls/ir/package.h"
#include "xls/ir/value.h"

namespace xls {
namespace {
Expand Down
1 change: 1 addition & 0 deletions xls/codegen/block_metrics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "xls/codegen/xls_metrics.pb.h"
#include "xls/common/status/status_macros.h"
#include "xls/ir/block.h"
#include "xls/ir/node.h"
#include "xls/ir/topo_sort.h"

namespace xls::verilog {
Expand Down
3 changes: 3 additions & 0 deletions xls/codegen/block_metrics_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@
#include "xls/codegen/xls_metrics.pb.h"
#include "xls/common/status/matchers.h"
#include "xls/delay_model/delay_estimators.h"
#include "xls/ir/bits.h"
#include "xls/ir/block.h"
#include "xls/ir/function_builder.h"
#include "xls/ir/package.h"
#include "xls/ir/source_location.h"
#include "xls/ir/type.h"
#include "xls/ir/value.h"
#include "xls/scheduling/pipeline_schedule.h"
#include "xls/scheduling/run_pipeline_schedule.h"
#include "xls/scheduling/scheduling_options.h"
Expand Down
3 changes: 3 additions & 0 deletions xls/codegen/codegen_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
#include <string_view>
#include <utility>

#include "absl/types/span.h"
#include "xls/common/proto_adaptor_utils.h"
#include "xls/ir/bits.h"
#include "xls/ir/value.h"

namespace xls::verilog {

Expand Down
2 changes: 2 additions & 0 deletions xls/codegen/finite_state_machine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
#include "absl/types/span.h"
#include "xls/codegen/vast.h"
#include "xls/common/status/status_macros.h"
#include "xls/ir/bits.h"
#include "xls/ir/source_location.h"

namespace xls {
Expand Down
1 change: 1 addition & 0 deletions xls/codegen/finite_state_machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "absl/status/statusor.h"
#include "xls/codegen/vast.h"
#include "xls/common/casts.h"
#include "xls/ir/source_location.h"

namespace xls {
namespace verilog {
Expand Down
1 change: 1 addition & 0 deletions xls/codegen/finite_state_machine_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "absl/status/status.h"
#include "xls/codegen/vast.h"
#include "xls/common/status/matchers.h"
#include "xls/ir/source_location.h"
#include "xls/simulation/verilog_test_base.h"

namespace xls {
Expand Down
3 changes: 3 additions & 0 deletions xls/codegen/flattening.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/types/span.h"
#include "xls/common/status/ret_check.h"
#include "xls/common/status/status_macros.h"
#include "xls/ir/bits_ops.h"
#include "xls/ir/package.h"
#include "xls/ir/source_location.h"
#include "xls/ir/value.h"

namespace xls {

Expand Down
1 change: 1 addition & 0 deletions xls/codegen/flattening.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "absl/types/span.h"
#include "xls/codegen/vast.h"
#include "xls/ir/bits.h"
#include "xls/ir/source_location.h"
#include "xls/ir/type.h"
#include "xls/ir/value.h"
#include "xls/ir/xls_type.pb.h"
Expand Down
3 changes: 3 additions & 0 deletions xls/codegen/flattening_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "xls/common/status/matchers.h"
#include "xls/ir/bits.h"
#include "xls/ir/ir_test_base.h"
#include "xls/ir/source_location.h"
#include "xls/ir/type.h"
#include "xls/ir/value.h"

namespace xls {
namespace {
Expand Down
2 changes: 2 additions & 0 deletions xls/codegen/module_builder_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "absl/status/status.h"
#include "absl/types/span.h"
#include "xls/codegen/vast.h"
#include "xls/common/status/matchers.h"
#include "xls/ir/bits.h"
#include "xls/ir/function_builder.h"
#include "xls/ir/package.h"
#include "xls/ir/source_location.h"
#include "xls/ir/type.h"
#include "xls/ir/value.h"
#include "xls/simulation/verilog_test_base.h"
Expand Down
2 changes: 2 additions & 0 deletions xls/codegen/op_override_impls.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@

#include "absl/log/check.h"
#include "absl/strings/str_replace.h"
#include "absl/types/span.h"
#include "xls/codegen/vast.h"
#include "xls/common/status/status_macros.h"
#include "xls/ir/node.h"
#include "re2/re2.h"

namespace xls::verilog {
Expand Down
1 change: 1 addition & 0 deletions xls/codegen/vast_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "xls/common/status/matchers.h"
#include "xls/ir/bits.h"
#include "xls/ir/number_parser.h"
#include "xls/ir/source_location.h"

Expand Down
2 changes: 2 additions & 0 deletions xls/common/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ cc_library(
hdrs = ["bits_util.h"],
deps = [
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/types:span",
],
)

Expand Down Expand Up @@ -423,6 +424,7 @@ cc_test(
":comparison_utils",
":xls_gunit_main",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:span",
"@com_google_googletest//:gtest",
],
)
Expand Down
1 change: 1 addition & 0 deletions xls/common/bits_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <cstdint>

#include "absl/log/check.h"
#include "absl/types/span.h"

namespace xls {

Expand Down
1 change: 1 addition & 0 deletions xls/common/comparison_utils_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "absl/strings/str_cat.h"
#include "absl/types/span.h"

namespace xls {
namespace {
Expand Down
2 changes: 2 additions & 0 deletions xls/common/math_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include <functional>
#include <vector>

#include "absl/types/span.h"

namespace xls {
namespace {

Expand Down
9 changes: 9 additions & 0 deletions xls/contrib/ice40/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ cc_library(
"//xls/common:math_util",
"//xls/common/status:ret_check",
"//xls/common/status:status_macros",
"//xls/ir:bits",
"//xls/ir:source_location",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/types:span",
],
)

Expand Down Expand Up @@ -68,6 +70,7 @@ cc_library(
"//xls/common/file:filesystem",
"//xls/common/file:get_runfile_path",
"//xls/common/status:status_macros",
"//xls/ir:source_location",
"//xls/tools:verilog_include",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
Expand All @@ -86,6 +89,7 @@ cc_binary(
"//xls/common:exit_status",
"//xls/common:init_xls",
"//xls/common/file:filesystem",
"//xls/ir:source_location",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/status",
Expand Down Expand Up @@ -115,6 +119,7 @@ cc_binary(
"//xls/common:init_xls",
"//xls/ir:format_preference",
"//xls/ir:ir_parser",
"//xls/ir:value",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
Expand All @@ -133,11 +138,14 @@ cc_library(
"//xls/common/file:filesystem",
"//xls/common/status:ret_check",
"//xls/common/status:status_macros",
"//xls/ir:bits",
"//xls/ir:value",
"@com_google_absl//absl/log",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
"@com_google_absl//absl/types:span",
],
)

Expand All @@ -159,6 +167,7 @@ cc_library(
deps = [
":io_strategy",
"//xls/codegen:vast",
"//xls/ir:source_location",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
],
Expand Down
1 change: 1 addition & 0 deletions xls/contrib/ice40/drpc_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "xls/contrib/ice40/device_rpc_strategy_factory.h"
#include "xls/ir/format_preference.h"
#include "xls/ir/ir_parser.h"
#include "xls/ir/value.h"

ABSL_FLAG(std::string, target_device, "",
"Target (category of) device for DRPC targeting; e.g. ice40.");
Expand Down
3 changes: 3 additions & 0 deletions xls/contrib/ice40/ice40_device_rpc_strategy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"
#include "absl/types/span.h"
#include "xls/common/file/filesystem.h"
#include "xls/common/math_util.h"
#include "xls/common/status/ret_check.h"
#include "xls/common/status/status_macros.h"
#include "xls/common/strerror.h"
#include "xls/ir/bits.h"
#include "xls/ir/value.h"

namespace xls {
namespace {
Expand Down
2 changes: 2 additions & 0 deletions xls/contrib/ice40/ice40_device_rpc_strategy.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@

#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/types/span.h"
#include "xls/contrib/ice40/device_rpc_strategy.h"
#include "xls/ir/value.h"

namespace xls {

Expand Down
1 change: 1 addition & 0 deletions xls/contrib/ice40/ice40_io_strategy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "xls/common/file/filesystem.h"
#include "xls/common/file/get_runfile_path.h"
#include "xls/common/status/status_macros.h"
#include "xls/ir/source_location.h"

namespace xls {
namespace verilog {
Expand Down
1 change: 1 addition & 0 deletions xls/contrib/ice40/null_io_strategy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "xls/contrib/ice40/null_io_strategy.h"

#include "absl/status/status.h"
#include "xls/ir/source_location.h"

namespace xls {
namespace verilog {
Expand Down
2 changes: 2 additions & 0 deletions xls/contrib/ice40/wrap_io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@

#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/types/span.h"
#include "xls/codegen/finite_state_machine.h"
#include "xls/codegen/vast.h"
#include "xls/common/math_util.h"
#include "xls/common/status/ret_check.h"
#include "xls/common/status/status_macros.h"
#include "xls/ir/bits.h"
#include "xls/ir/source_location.h"

namespace xls {
Expand Down
Loading

0 comments on commit f4e0f59

Please sign in to comment.