Discovered by clang-tidy.
@@ -4,6 +4,9 @@
#include "common/check_internal.h"
+#include <cstdlib>
+#include <string>
+
#include "common/ostream.h"
#include "llvm/Support/Signals.h"
@@ -4,7 +4,11 @@
#include "common/command_line.h"
+#include <array>
#include <memory>
+#include <optional>
+#include <utility>
#include "common/raw_string_ostream.h"
#include "llvm/ADT/DenseMap.h"
#include "common/exe_path.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Program.h"
@@ -6,6 +6,9 @@
#include <gtest/gtest.h>
+#include <system_error>
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Path.h"
@@ -4,6 +4,8 @@
#include "common/hashing.h"
+#include <cstddef>
namespace Carbon {
auto Hasher::HashSizedBytesLarge(llvm::ArrayRef<std::byte> bytes) -> void {
@@ -5,6 +5,7 @@
#include <benchmark/benchmark.h>
#include <algorithm>
#include <cstddef>
#include <numbers>
@@ -8,7 +8,10 @@
#include <concepts>
+#include <tuple>
#include <type_traits>
#include "llvm/ADT/Sequence.h"
#include "common/raw_hashtable.h"
namespace Carbon::RawHashtable {
volatile std::byte global_addr_seed{1};
@@ -4,8 +4,11 @@
#include "common/raw_hashtable_benchmark_helpers.h"
#include <forward_list>
+#include <vector>
@@ -5,6 +5,8 @@
+#include <numeric>
#include "absl/random/random.h"
#include "common/raw_hashtable_metadata_group.h"
+#include <type_traits>
#include "absl/container/flat_hash_set.h"
#include "common/set.h"
@@ -6,6 +6,7 @@
#include <optional>
#include "common/check.h"
#include "llvm/ADT/StringExtras.h"
@@ -7,6 +7,7 @@
#include <gmock/gmock.h>
#include <string>
using ::testing::Eq;
@@ -7,6 +7,8 @@
namespace Carbon::Testing {
@@ -8,6 +8,7 @@
#include <fstream>
#include <sstream>
@@ -9,6 +9,7 @@
#include <cstdlib>
#include <system_error>
@@ -4,6 +4,7 @@
#include "testing/base/global_exe_path.h"
#include "testing/base/source_gen.h"
+#include <algorithm>
#include <numeric>
#include "llvm/ADT/ArrayRef.h"
@@ -2,6 +2,9 @@
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include "common/bazel_working_dir.h"
#include "common/init_llvm.h"
#include "toolchain/driver/driver.h"
#include "testing/file_test/autoupdate.h"
#include "absl/strings/str_replace.h"
#include "absl/strings/string_view.h"
@@ -21,9 +21,16 @@
#include "testing/file_test/file_test_base.h"
+#include <atomic>
#include <filesystem>
+#include <functional>
+#include <memory>
+#include <mutex>
+#include <string_view>
#include <utility>
#include "absl/flags/flag.h"
@@ -7,6 +7,11 @@
#include "llvm/ADT/StringSwitch.h"
#include "testing/file_test/manifest.h"
// The test manifest, produced by `manifest_as_cpp`.
// NOLINTNEXTLINE(readability-identifier-naming): Constant in practice.
extern const char* CarbonFileTestManifest[];
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
@@ -5,6 +5,9 @@
#include "testing/file_test/test_file.h"
#include "common/error.h"
#include "toolchain/base/int.h"
auto IntStore::CanonicalBitWidth(int significant_bits) -> int {
#include <limits>
#include "toolchain/base/value_ids.h"
#include "toolchain/check/call.h"
#include "toolchain/base/kind_switch.h"
#include "toolchain/check/context.h"
#include "toolchain/check/control_flow.h"
#include "toolchain/check/check.h"
#include "common/map.h"
#include "toolchain/check/check_unit.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
namespace Carbon::Check {
+#include <initializer_list>
#include "toolchain/check/inst.h"
#include "toolchain/check/convert.h"
#include "toolchain/check/decl_name_stack.h"
#include "toolchain/check/diagnostic_helpers.h"
#include "toolchain/check/deferred_definition_worklist.h"
#include "common/variant_helpers.h"
#include "common/vlog.h"
#include "toolchain/check/handle.h"
#include "toolchain/check/diagnostic_emitter.h"
#include "toolchain/sem_ir/absolute_node_id.h"
#include "toolchain/sem_ir/stringify.h"
@@ -15,6 +15,8 @@
#include "toolchain/lex/dump.h"
@@ -4,6 +4,11 @@
#include "toolchain/check/eval.h"
#include "toolchain/check/action.h"
#include "toolchain/check/class.h"
@@ -2,6 +2,8 @@
#include "toolchain/check/facet_type.h"
+#include <cmath>
#include "toolchain/check/impl_lookup.h"
#include <variant>
#include "toolchain/check/import.h"
#include "clang/Frontend/TextDiagnostic.h"
#include "clang/Sema/Lookup.h"
#include "toolchain/check/import_ref.h"
#include "toolchain/check/interface.h"
#include "toolchain/check/generic.h"
#include "toolchain/check/modifiers.h"
#include "toolchain/check/decl_introducer_state.h"
#include "toolchain/check/name_lookup.h"
#include "toolchain/check/import_cpp.h"
@@ -4,6 +4,10 @@
#include "toolchain/check/node_id_traversal.h"
+#include <variant>
#include "toolchain/check/pattern_match.h"
#include <functional>
#include <vector>
#include "llvm/ADT/STLExtras.h"
#include "toolchain/check/scope_stack.h"
#include "toolchain/sem_ir/ids.h"
#include "toolchain/codegen/codegen.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/MC/TargetRegistry.h"
#include "toolchain/diagnostics/mocks.h"
+#include <ostream>
namespace Carbon::Diagnostics {
auto PrintTo(const Diagnostic& diagnostic, std::ostream* os) -> void {
@@ -8,6 +8,8 @@
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticOptions.h"
#include "toolchain/driver/clang_subcommand.h"
#include "llvm/TargetParser/Host.h"
#include "toolchain/driver/clang_runner.h"
@@ -4,6 +4,13 @@
#include "toolchain/driver/compile_subcommand.h"
@@ -9,6 +9,8 @@
#include "toolchain/driver/lld_subcommand.h"
#include "llvm/TargetParser/Triple.h"
#include "toolchain/driver/lld_runner.h"
#include "lld/Common/Driver.h"
@@ -4,7 +4,9 @@
#include "toolchain/driver/tool_runner_base.h"
#include <unistd.h>
#include "toolchain/install/install_paths.h"
@@ -7,6 +7,9 @@
#include "toolchain/install/install_paths_test_helpers.h"
#include "toolchain/language_server/context.h"
@@ -3,6 +3,9 @@
#include "toolchain/language_server/handle.h"
namespace Carbon::LanguageServer {
@@ -2,6 +2,10 @@
#include "toolchain/language_server/incoming_messages.h"
#include "toolchain/language_server/language_server.h"
#include "clang-tools-extra/clangd/LSPBinder.h"
#include "clang-tools-extra/clangd/Transport.h"
#include "clang-tools-extra/clangd/support/Logger.h"
@@ -6,6 +6,8 @@
namespace Carbon::Lex {
#include <array>
@@ -4,7 +4,10 @@
#include "toolchain/lex/numeric_literal.h"
#include <bitset>
+#include <iterator>
#include "toolchain/diagnostics/diagnostic_emitter.h"
#include "toolchain/lex/test_helpers.h"
#include "toolchain/lex/string_literal.h"
#include "toolchain/diagnostics/null_diagnostics.h"
@@ -7,6 +7,10 @@
#include <cmath>
#include "common/string_helpers.h"
@@ -7,9 +7,11 @@
#include <iterator>
#include "toolchain/lower/file_context.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "toolchain/lower/function_context.h"
#include "toolchain/lower/lower.h"
namespace Carbon::Lower {
#include "toolchain/lower/mangler.h"
#include "toolchain/sem_ir/entry_point.h"
#include "toolchain/parse/context.h"
#include "toolchain/parse/dump.h"
#include <tuple>
#include <typeinfo>
#include "toolchain/lex/token_kind.h"
#include "toolchain/parse/handle.h"