From f29515fe4e732546a5b0b29ed1fb47c78bd4a631 Mon Sep 17 00:00:00 2001 From: Boaz Brickner Date: Wed, 17 Sep 2025 11:31:36 +0200 Subject: [PATCH] Move C++ interop related `check` code files to a `cpp` dir (#6065) Context: https://github.com/carbon-language/carbon-lang/pull/5891#pullrequestreview-3178216893 --- toolchain/check/BUILD | 20 +++++++++---------- toolchain/check/call.cpp | 4 ++-- toolchain/check/check.cpp | 2 +- toolchain/check/check_unit.cpp | 2 +- .../custom_type_mapping.cpp} | 2 +- .../custom_type_mapping.h} | 0 .../check/{cpp_import.cpp => cpp/import.cpp} | 6 +++--- .../check/{cpp_import.h => cpp/import.h} | 0 .../overload_resolution.cpp} | 6 +++--- .../overload_resolution.h} | 0 .../check/{cpp_thunk.cpp => cpp/thunk.cpp} | 2 +- toolchain/check/{cpp_thunk.h => cpp/thunk.h} | 0 .../type_mapping.cpp} | 2 +- .../type_mapping.h} | 0 toolchain/check/name_lookup.cpp | 2 +- toolchain/check/operator.cpp | 2 +- toolchain/check/type_completion.cpp | 2 +- 17 files changed, 26 insertions(+), 26 deletions(-) rename toolchain/check/{cpp_custom_type_mapping.cpp => cpp/custom_type_mapping.cpp} (98%) rename toolchain/check/{cpp_custom_type_mapping.h => cpp/custom_type_mapping.h} (100%) rename toolchain/check/{cpp_import.cpp => cpp/import.cpp} (99%) rename toolchain/check/{cpp_import.h => cpp/import.h} (100%) rename toolchain/check/{cpp_overload_resolution.cpp => cpp/overload_resolution.cpp} (98%) rename toolchain/check/{cpp_overload_resolution.h => cpp/overload_resolution.h} (100%) rename toolchain/check/{cpp_thunk.cpp => cpp/thunk.cpp} (99%) rename toolchain/check/{cpp_thunk.h => cpp/thunk.h} (100%) rename toolchain/check/{cpp_type_mapping.cpp => cpp/type_mapping.cpp} (99%) rename toolchain/check/{cpp_type_mapping.h => cpp/type_mapping.h} (100%) diff --git a/toolchain/check/BUILD b/toolchain/check/BUILD index 0044348452a2..58932a2be1d2 100644 --- a/toolchain/check/BUILD +++ b/toolchain/check/BUILD @@ -21,11 +21,11 @@ cc_library( "context.cpp", "control_flow.cpp", "convert.cpp", - "cpp_custom_type_mapping.cpp", - "cpp_import.cpp", - "cpp_overload_resolution.cpp", - "cpp_thunk.cpp", - "cpp_type_mapping.cpp", + "cpp/custom_type_mapping.cpp", + "cpp/import.cpp", + "cpp/overload_resolution.cpp", + "cpp/thunk.cpp", + "cpp/type_mapping.cpp", "decl_name_stack.cpp", "deduce.cpp", "deferred_definition_worklist.cpp", @@ -70,11 +70,11 @@ cc_library( "context.h", "control_flow.h", "convert.h", - "cpp_custom_type_mapping.h", - "cpp_import.h", - "cpp_overload_resolution.h", - "cpp_thunk.h", - "cpp_type_mapping.h", + "cpp/custom_type_mapping.h", + "cpp/import.h", + "cpp/overload_resolution.h", + "cpp/thunk.h", + "cpp/type_mapping.h", "decl_introducer_state.h", "decl_name_stack.h", "deduce.h", diff --git a/toolchain/check/call.cpp b/toolchain/check/call.cpp index 559b9088df2a..ce23b1077dca 100644 --- a/toolchain/check/call.cpp +++ b/toolchain/check/call.cpp @@ -10,8 +10,8 @@ #include "toolchain/check/context.h" #include "toolchain/check/control_flow.h" #include "toolchain/check/convert.h" -#include "toolchain/check/cpp_overload_resolution.h" -#include "toolchain/check/cpp_thunk.h" +#include "toolchain/check/cpp/overload_resolution.h" +#include "toolchain/check/cpp/thunk.h" #include "toolchain/check/deduce.h" #include "toolchain/check/facet_type.h" #include "toolchain/check/function.h" diff --git a/toolchain/check/check.cpp b/toolchain/check/check.cpp index d7b2cf393b85..2b1060b6261c 100644 --- a/toolchain/check/check.cpp +++ b/toolchain/check/check.cpp @@ -11,7 +11,7 @@ #include "common/map.h" #include "toolchain/check/check_unit.h" #include "toolchain/check/context.h" -#include "toolchain/check/cpp_import.h" +#include "toolchain/check/cpp/import.h" #include "toolchain/check/diagnostic_emitter.h" #include "toolchain/check/diagnostic_helpers.h" #include "toolchain/diagnostics/diagnostic.h" diff --git a/toolchain/check/check_unit.cpp b/toolchain/check/check_unit.cpp index e93922f9ad39..5bc8ea18e0f0 100644 --- a/toolchain/check/check_unit.cpp +++ b/toolchain/check/check_unit.cpp @@ -17,7 +17,7 @@ #include "llvm/Support/VirtualFileSystem.h" #include "toolchain/base/fixed_size_value_store.h" #include "toolchain/base/kind_switch.h" -#include "toolchain/check/cpp_import.h" +#include "toolchain/check/cpp/import.h" #include "toolchain/check/diagnostic_helpers.h" #include "toolchain/check/generic.h" #include "toolchain/check/handle.h" diff --git a/toolchain/check/cpp_custom_type_mapping.cpp b/toolchain/check/cpp/custom_type_mapping.cpp similarity index 98% rename from toolchain/check/cpp_custom_type_mapping.cpp rename to toolchain/check/cpp/custom_type_mapping.cpp index 832b7ad4710d..5c43237c3fe3 100644 --- a/toolchain/check/cpp_custom_type_mapping.cpp +++ b/toolchain/check/cpp/custom_type_mapping.cpp @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "toolchain/check/cpp_custom_type_mapping.h" +#include "toolchain/check/cpp/custom_type_mapping.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclTemplate.h" diff --git a/toolchain/check/cpp_custom_type_mapping.h b/toolchain/check/cpp/custom_type_mapping.h similarity index 100% rename from toolchain/check/cpp_custom_type_mapping.h rename to toolchain/check/cpp/custom_type_mapping.h diff --git a/toolchain/check/cpp_import.cpp b/toolchain/check/cpp/import.cpp similarity index 99% rename from toolchain/check/cpp_import.cpp rename to toolchain/check/cpp/import.cpp index 59ccac4dcb68..7add37683a30 100644 --- a/toolchain/check/cpp_import.cpp +++ b/toolchain/check/cpp/import.cpp @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "toolchain/check/cpp_import.h" +#include "toolchain/check/cpp/import.h" #include #include @@ -31,8 +31,8 @@ #include "toolchain/check/context.h" #include "toolchain/check/control_flow.h" #include "toolchain/check/convert.h" -#include "toolchain/check/cpp_custom_type_mapping.h" -#include "toolchain/check/cpp_thunk.h" +#include "toolchain/check/cpp/custom_type_mapping.h" +#include "toolchain/check/cpp/thunk.h" #include "toolchain/check/diagnostic_helpers.h" #include "toolchain/check/eval.h" #include "toolchain/check/function.h" diff --git a/toolchain/check/cpp_import.h b/toolchain/check/cpp/import.h similarity index 100% rename from toolchain/check/cpp_import.h rename to toolchain/check/cpp/import.h diff --git a/toolchain/check/cpp_overload_resolution.cpp b/toolchain/check/cpp/overload_resolution.cpp similarity index 98% rename from toolchain/check/cpp_overload_resolution.cpp rename to toolchain/check/cpp/overload_resolution.cpp index 040c439db809..a8defbcdc2f0 100644 --- a/toolchain/check/cpp_overload_resolution.cpp +++ b/toolchain/check/cpp/overload_resolution.cpp @@ -2,12 +2,12 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "toolchain/check/cpp_overload_resolution.h" +#include "toolchain/check/cpp/overload_resolution.h" #include "clang/Sema/Overload.h" #include "clang/Sema/Sema.h" -#include "toolchain/check/cpp_import.h" -#include "toolchain/check/cpp_type_mapping.h" +#include "toolchain/check/cpp/import.h" +#include "toolchain/check/cpp/type_mapping.h" #include "toolchain/sem_ir/expr_info.h" #include "toolchain/sem_ir/typed_insts.h" diff --git a/toolchain/check/cpp_overload_resolution.h b/toolchain/check/cpp/overload_resolution.h similarity index 100% rename from toolchain/check/cpp_overload_resolution.h rename to toolchain/check/cpp/overload_resolution.h diff --git a/toolchain/check/cpp_thunk.cpp b/toolchain/check/cpp/thunk.cpp similarity index 99% rename from toolchain/check/cpp_thunk.cpp rename to toolchain/check/cpp/thunk.cpp index 77e57482d88b..d4ca36ee8417 100644 --- a/toolchain/check/cpp_thunk.cpp +++ b/toolchain/check/cpp/thunk.cpp @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "toolchain/check/cpp_thunk.h" +#include "toolchain/check/cpp/thunk.h" #include "clang/AST/GlobalDecl.h" #include "clang/AST/Mangle.h" diff --git a/toolchain/check/cpp_thunk.h b/toolchain/check/cpp/thunk.h similarity index 100% rename from toolchain/check/cpp_thunk.h rename to toolchain/check/cpp/thunk.h diff --git a/toolchain/check/cpp_type_mapping.cpp b/toolchain/check/cpp/type_mapping.cpp similarity index 99% rename from toolchain/check/cpp_type_mapping.cpp rename to toolchain/check/cpp/type_mapping.cpp index 7c5669003dd0..1cad8e2f49b3 100644 --- a/toolchain/check/cpp_type_mapping.cpp +++ b/toolchain/check/cpp/type_mapping.cpp @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include "toolchain/check/cpp_type_mapping.h" +#include "toolchain/check/cpp/type_mapping.h" #include #include diff --git a/toolchain/check/cpp_type_mapping.h b/toolchain/check/cpp/type_mapping.h similarity index 100% rename from toolchain/check/cpp_type_mapping.h rename to toolchain/check/cpp/type_mapping.h diff --git a/toolchain/check/name_lookup.cpp b/toolchain/check/name_lookup.cpp index c12bcf57b910..7095a562e434 100644 --- a/toolchain/check/name_lookup.cpp +++ b/toolchain/check/name_lookup.cpp @@ -6,7 +6,7 @@ #include -#include "toolchain/check/cpp_import.h" +#include "toolchain/check/cpp/import.h" #include "toolchain/check/generic.h" #include "toolchain/check/import.h" #include "toolchain/check/import_ref.h" diff --git a/toolchain/check/operator.cpp b/toolchain/check/operator.cpp index b2594e81af30..ae2986d5a3c0 100644 --- a/toolchain/check/operator.cpp +++ b/toolchain/check/operator.cpp @@ -8,7 +8,7 @@ #include "toolchain/check/call.h" #include "toolchain/check/context.h" -#include "toolchain/check/cpp_import.h" +#include "toolchain/check/cpp/import.h" #include "toolchain/check/generic.h" #include "toolchain/check/member_access.h" #include "toolchain/check/name_lookup.h" diff --git a/toolchain/check/type_completion.cpp b/toolchain/check/type_completion.cpp index 361234eb4a74..98de1241fde3 100644 --- a/toolchain/check/type_completion.cpp +++ b/toolchain/check/type_completion.cpp @@ -6,7 +6,7 @@ #include "llvm/ADT/SmallVector.h" #include "toolchain/base/kind_switch.h" -#include "toolchain/check/cpp_import.h" +#include "toolchain/check/cpp/import.h" #include "toolchain/check/generic.h" #include "toolchain/check/inst.h" #include "toolchain/check/type.h"