Skip to content

Commit

Permalink
Fix some missing includes.
Browse files Browse the repository at this point in the history
While in the process to figure out compilation DB choices
after #1893 , I am getting
different set of language server issues with possible alternatives.

This change helps reduce the warning noise and highlighting the
differences by fixing known include issues.

#xls-build-gardener

PiperOrigin-RevId: 720724552
  • Loading branch information
hzeller authored and copybara-github committed Jan 28, 2025
1 parent d59fe2e commit 811db8c
Show file tree
Hide file tree
Showing 83 changed files with 96 additions and 53 deletions.
2 changes: 2 additions & 0 deletions xls/codegen/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ cc_library(
"//xls/ir",
"//xls/ir:op",
"//xls/ir:state_element",
"//xls/ir:xls_ir_interface_cc_proto",
"//xls/scheduling:pipeline_schedule",
"@com_google_absl//absl/algorithm:container",
"@com_google_absl//absl/container:flat_hash_map",
Expand Down Expand Up @@ -1888,6 +1889,7 @@ cc_test(
"//xls/ir:ir_test_base",
"//xls/ir:value",
"@com_google_absl//absl/status:status_matchers",
"@com_google_absl//absl/status:statusor",
"@com_google_googletest//:gtest",
],
)
Expand Down
1 change: 0 additions & 1 deletion xls/codegen/clone_nodes_into_block_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
Expand Down
1 change: 1 addition & 0 deletions xls/codegen/convert_ir_to_blocks_passes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "xls/ir/proc.h"
#include "xls/ir/state_element.h"
#include "xls/ir/topo_sort.h"
#include "xls/ir/xls_ir_interface.pb.h"
#include "xls/scheduling/pipeline_schedule.h"

// -- Implementations of
Expand Down
1 change: 1 addition & 0 deletions xls/codegen/mark_channel_fifos_pass_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "gtest/gtest.h"
#include "xls/common/fuzzing/fuzztest.h"
#include "absl/status/status_matchers.h"
#include "absl/status/statusor.h"
#include "xls/codegen/codegen_options.h"
#include "xls/codegen/codegen_pass.h"
#include "xls/common/status/matchers.h"
Expand Down
3 changes: 0 additions & 3 deletions xls/codegen/proc_block_conversion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#include <algorithm>
#include <cstdint>
#include <initializer_list>
#include <iterator>
#include <optional>
#include <string>
Expand All @@ -40,7 +39,6 @@
#include "xls/codegen/codegen_options.h"
#include "xls/codegen/codegen_pass.h"
#include "xls/codegen/conversion_utils.h"
#include "xls/codegen/mark_channel_fifos_pass.h"
#include "xls/common/casts.h"
#include "xls/common/logging/log_lines.h"
#include "xls/common/status/ret_check.h"
Expand All @@ -61,7 +59,6 @@
#include "xls/ir/type.h"
#include "xls/ir/value.h"
#include "xls/ir/value_utils.h"
#include "xls/ir/xls_ir_interface.pb.h"
#include "xls/scheduling/pipeline_schedule.h"

namespace xls::verilog {
Expand Down
1 change: 1 addition & 0 deletions xls/codegen/vast/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ cc_library(
"//xls/ir:code_template",
"//xls/ir:format_preference",
"//xls/ir:source_location",
"@com_google_absl//absl/base:nullability",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
Expand Down
1 change: 1 addition & 0 deletions xls/codegen/vast/vast.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <variant>
#include <vector>

#include "absl/base/nullability.h"
#include "absl/container/flat_hash_map.h"
#include "absl/log/check.h"
#include "absl/log/die_if_null.h"
Expand Down
2 changes: 2 additions & 0 deletions xls/contrib/mlir/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ cc_library(
"//xls/ir:foreign_function",
"//xls/ir:foreign_function_data_cc_proto",
"//xls/ir:source_location",
"//xls/ir:value",
"//xls/public:function_builder",
"//xls/public:ir",
"//xls/public:ir_parser",
Expand Down Expand Up @@ -577,6 +578,7 @@ cc_binary(
deps = [
":xls_dialect_registration",
":xls_translate_lib",
"//xls/codegen:xls_metrics_cc_proto",
"//xls/public:c_api",
"@llvm-project//llvm:Support",
"@llvm-project//mlir:ArithDialect",
Expand Down
3 changes: 3 additions & 0 deletions xls/contrib/mlir/tools/xls_translate/xls_translate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "mlir/include/mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/include/mlir/IR/BuiltinAttributes.h"
#include "mlir/include/mlir/IR/BuiltinOps.h"
#include "mlir/include/mlir/IR/BuiltinTypeInterfaces.h"
#include "mlir/include/mlir/IR/BuiltinTypes.h"
#include "mlir/include/mlir/IR/Diagnostics.h"
#include "mlir/include/mlir/IR/Location.h"
Expand All @@ -60,6 +61,7 @@
#include "mlir/include/mlir/Transforms/Passes.h"
#include "xls/codegen/module_signature.h"
#include "xls/codegen/vast/vast.h"
#include "xls/codegen/xls_metrics.pb.h"
#include "xls/common/file/filesystem.h"
#include "xls/common/file/get_runfile_path.h"
#include "xls/contrib/mlir/IR/xls_ops.h"
Expand All @@ -68,6 +70,7 @@
#include "xls/ir/foreign_function_data.pb.h"
#include "xls/ir/nodes.h"
#include "xls/ir/source_location.h"
#include "xls/ir/value.h"
#include "xls/public/function_builder.h"
#include "xls/public/ir.h"
#include "xls/public/ir_parser.h"
Expand Down
1 change: 1 addition & 0 deletions xls/contrib/mlir/tools/xls_translate/xls_translate_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "mlir/include/mlir/Support/LogicalResult.h"
#include "mlir/include/mlir/Tools/mlir-translate/MlirTranslateMain.h"
#include "mlir/include/mlir/Tools/mlir-translate/Translation.h"
#include "xls/codegen/xls_metrics.pb.h"
#include "xls/contrib/mlir/IR/register.h"
#include "xls/contrib/mlir/tools/xls_translate/xls_stitch.h"
#include "xls/contrib/mlir/tools/xls_translate/xls_translate.h"
Expand Down
1 change: 0 additions & 1 deletion xls/contrib/xlscc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ cc_library(
"@com_google_absl//absl/container:btree",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/status",
Expand Down
2 changes: 0 additions & 2 deletions xls/contrib/xlscc/translate_loops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "absl/container/btree_map.h"
#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
#include "absl/flags/flag.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
Expand All @@ -38,7 +37,6 @@
#include "clang/include/clang/AST/Stmt.h"
#include "clang/include/clang/Basic/LLVM.h"
#include "clang/include/clang/Basic/SourceLocation.h"
#include "llvm/include/llvm/Support/Casting.h"
#include "xls/common/status/status_macros.h"
#include "xls/common/stopwatch.h"
#include "xls/contrib/xlscc/translator.h"
Expand Down
1 change: 1 addition & 0 deletions xls/contrib/xlscc/translator.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <optional>
#include <set>
Expand Down
2 changes: 2 additions & 0 deletions xls/contrib/xlscc/unit_tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ cc_library(
srcs = ["unit_test.cc"],
hdrs = ["unit_test.h"],
deps = [
"//xls/codegen:module_signature_cc_proto",
"//xls/common:source_location",
"//xls/common/file:get_runfile_path",
"//xls/common/file:temp_file",
Expand Down Expand Up @@ -59,6 +60,7 @@ cc_library(
"//xls/tools:codegen",
"//xls/tools:codegen_flags_cc_proto",
"//xls/tools:opt",
"//xls/tools:scheduling_options_flags_cc_proto",
"@com_google_absl//absl/base:log_severity",
"@com_google_absl//absl/container:btree",
"@com_google_absl//absl/container:flat_hash_map",
Expand Down
2 changes: 2 additions & 0 deletions xls/contrib/xlscc/unit_tests/unit_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include "absl/strings/str_join.h"
#include "absl/types/span.h"
#include "clang/include/clang/AST/Decl.h"
#include "xls/codegen/module_signature.pb.h"
#include "xls/common/file/get_runfile_path.h"
#include "xls/common/file/temp_file.h"
#include "xls/common/source_location.h"
Expand Down Expand Up @@ -78,6 +79,7 @@
#include "xls/tools/codegen.h"
#include "xls/tools/codegen_flags.pb.h"
#include "xls/tools/opt.h"
#include "xls/tools/scheduling_options_flags.pb.h"

using ::testing::Optional;

Expand Down
1 change: 1 addition & 0 deletions xls/data_structures/inline_bitmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <algorithm>
#include <cstdint>
#include <cstring>
#include <optional>
#include <utility>

#include "absl/base/casts.h"
Expand Down
1 change: 0 additions & 1 deletion xls/data_structures/leaf_type_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#ifndef XLS_DATA_STRUCTURES_LEAF_TYPE_TREE_H_
#define XLS_DATA_STRUCTURES_LEAF_TYPE_TREE_H_

#include <concepts>
#include <cstdint>
#include <functional>
#include <iterator>
Expand Down
2 changes: 0 additions & 2 deletions xls/dslx/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ cc_library(
deps = [
"//xls/common/file:filesystem",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/log",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings:str_format",
Expand Down Expand Up @@ -71,7 +70,6 @@ cc_library(
"//xls/dslx/frontend:pos",
"//xls/dslx/type_system:deduce_utils",
"//xls/dslx/type_system:parametric_env",
"//xls/dslx/type_system:parametric_expression",
"//xls/dslx/type_system:type",
"//xls/dslx/type_system:type_info",
"//xls/dslx/type_system:type_zero_value",
Expand Down
4 changes: 0 additions & 4 deletions xls/dslx/bytecode/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,7 @@ cc_test(
"//xls/dslx:virtualizable_file_system",
"//xls/dslx/frontend:ast",
"//xls/dslx/frontend:pos",
"//xls/dslx/run_routines",
"//xls/dslx/type_system:parametric_env",
"//xls/dslx/type_system:type_info",
"//xls/ir:bits",
"//xls/ir:format_preference",
"//xls/ir:format_strings",
Expand Down Expand Up @@ -354,7 +352,6 @@ cc_library(
"//xls/dslx/type_system:parametric_env",
"//xls/dslx/type_system:type",
"//xls/dslx/type_system:type_info",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
Expand Down Expand Up @@ -386,7 +383,6 @@ cc_test(
"//xls/dslx/run_routines",
"//xls/dslx/type_system:type_info",
"//xls/ir:format_preference",
"@com_google_absl//absl/log",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_googletest//:gtest",
Expand Down
1 change: 1 addition & 0 deletions xls/dslx/bytecode/bytecode_emitter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include "xls/dslx/frontend/ast.h"
#include "xls/dslx/frontend/ast_utils.h"
#include "xls/dslx/frontend/module.h"
#include "xls/dslx/frontend/pos.h"
#include "xls/dslx/import_data.h"
#include "xls/dslx/interp_value.h"
#include "xls/dslx/interp_value_utils.h"
Expand Down
2 changes: 0 additions & 2 deletions xls/dslx/bytecode/bytecode_interpreter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@
#include "xls/dslx/import_data.h"
#include "xls/dslx/interp_value.h"
#include "xls/dslx/parse_and_typecheck.h"
#include "xls/dslx/run_routines/run_routines.h"
#include "xls/dslx/type_system/parametric_env.h"
#include "xls/dslx/type_system/type_info.h"
#include "xls/dslx/virtualizable_file_system.h"
#include "xls/ir/bits.h"
#include "xls/ir/format_preference.h"
Expand Down
1 change: 0 additions & 1 deletion xls/dslx/bytecode/proc_hierarchy_interpreter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <vector>

#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_format.h"
Expand Down
1 change: 0 additions & 1 deletion xls/dslx/bytecode/proc_hierarchy_interpreter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "xls/common/file/temp_file.h"
Expand Down
1 change: 0 additions & 1 deletion xls/dslx/constexpr_evaluator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
#include "xls/dslx/interp_value_utils.h"
#include "xls/dslx/type_system/deduce_utils.h"
#include "xls/dslx/type_system/parametric_env.h"
#include "xls/dslx/type_system/parametric_expression.h"
#include "xls/dslx/type_system/type.h"
#include "xls/dslx/type_system/type_info.h"
#include "xls/dslx/type_system/type_zero_value.h"
Expand Down
1 change: 1 addition & 0 deletions xls/dslx/constexpr_evaluator.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <utility>

#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "xls/dslx/frontend/ast.h"
Expand Down
10 changes: 8 additions & 2 deletions xls/dslx/diagnostics/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ cc_library(
"//xls/dslx/type_system:type",
"//xls/dslx/type_system:type_mismatch_error_data",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings:str_format",
],
Expand All @@ -66,14 +67,19 @@ cc_test(
":maybe_explain_error",
"//xls/common:xls_gunit_main",
"//xls/common/status:matchers",
"//xls/common/status:status_macros",
"//xls/dslx:create_import_data",
"//xls/dslx:import_data",
"//xls/dslx:parse_and_typecheck",
"//xls/dslx:warning_collector",
"//xls/dslx:warning_kind",
"//xls/dslx/frontend:module",
"//xls/dslx/frontend:pos",
"//xls/dslx/type_system:deduce",
"//xls/dslx/type_system:deduce_ctx",
"//xls/dslx/type_system:type_info",
"//xls/dslx/type_system:type_mismatch_error_data",
"//xls/dslx/type_system:typecheck_module",
"@com_google_absl//absl/log",
"@com_google_absl//absl/status",
"@com_google_googletest//:gtest",
],
)
Expand Down
1 change: 1 addition & 0 deletions xls/dslx/diagnostics/maybe_explain_error.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <string_view>
#include <variant>

#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/strings/str_format.h"
Expand Down
13 changes: 11 additions & 2 deletions xls/dslx/diagnostics/maybe_explain_error_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,26 @@

#include "xls/dslx/diagnostics/maybe_explain_error.h"

#include <memory>
#include <optional>
#include <string_view>

#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "xls/common/status/matchers.h"
#include "xls/common/status/status_macros.h"
#include "xls/dslx/create_import_data.h"
#include "xls/dslx/frontend/module.h"
#include "xls/dslx/frontend/pos.h"
#include "xls/dslx/import_data.h"
#include "xls/dslx/parse_and_typecheck.h"
#include "xls/dslx/type_system/deduce.h"
#include "xls/dslx/type_system/deduce_ctx.h"
#include "xls/dslx/type_system/type_info.h"
#include "xls/dslx/type_system/type_mismatch_error_data.h"
#include "xls/dslx/type_system/typecheck_module.h"
#include "xls/dslx/warning_collector.h"
#include "xls/dslx/warning_kind.h"

namespace xls::dslx {
namespace {
Expand Down
2 changes: 2 additions & 0 deletions xls/dslx/frontend/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ cc_library(
"//xls/ir:foreign_function_data_cc_proto",
"//xls/ir:format_strings",
"//xls/ir:name_uniquer",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/base:nullability",
"@com_google_absl//absl/cleanup",
"@com_google_absl//absl/container:flat_hash_map",
Expand Down Expand Up @@ -179,6 +180,7 @@ cc_library(
"//xls/common/status:ret_check",
"//xls/common/status:status_macros",
"//xls/dslx:interp_value",
"//xls/ir:bits",
"//xls/ir:number_parser",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
Expand Down
1 change: 1 addition & 0 deletions xls/dslx/frontend/ast_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "xls/dslx/frontend/pos.h"
#include "xls/dslx/frontend/token_utils.h"
#include "xls/dslx/interp_value.h"
#include "xls/ir/bits.h"
#include "xls/ir/number_parser.h"

namespace xls::dslx {
Expand Down
1 change: 1 addition & 0 deletions xls/dslx/frontend/ast_utils_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <optional>
#include <string>
#include <string_view>
#include <variant>
#include <vector>

#include "gtest/gtest.h"
Expand Down
Loading

0 comments on commit 811db8c

Please sign in to comment.