From 0124aae0410d3e81b65ab8a133dcf7d89877b454 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 28 Apr 2026 17:28:00 -0700 Subject: [PATCH] Import non-const rvalue references as var parameters. (#7125) When importing a C++ function with an rvalue reference parameter, we previously produced a Carbon value parameter. This would lead to the toolchain believing it could pass the address of a non-expiring object to the function, which would lead to a use-after-move. Instead, we now map non-const rvalue reference parameters to Carbon `var` parameters. This forces the object passed into C++ to be unique and owned by the call. While that's not an exact match for C++ rvalue reference parameters, given that it provides "always move" not "conditionally move", it's the closest match we have at the moment. --- toolchain/check/cpp/export.cpp | 3 +- toolchain/check/cpp/import.cpp | 69 ++--- toolchain/check/cpp/operators.cpp | 2 + toolchain/check/custom_witness.cpp | 5 +- toolchain/check/function.cpp | 8 +- toolchain/check/function.h | 9 +- toolchain/check/handle_loop_statement.cpp | 10 +- toolchain/check/pattern.cpp | 57 ++-- toolchain/check/pattern.h | 23 +- toolchain/check/pattern_match.cpp | 2 +- .../interop/cpp/basics/import/indirect.carbon | 11 - .../interop/cpp/class/import/access.carbon | 46 +--- .../interop/cpp/class/import/class.carbon | 7 +- .../interop/cpp/class/import/method.carbon | 253 +++++++++++++----- .../interop/cpp/enum/anonymous.carbon | 5 - .../cpp/function/import/default_arg.carbon | 18 +- .../cpp/function/import/reference.carbon | 13 +- .../testdata/interop/cpp/impls/as.carbon | 65 +---- .../interop/cpp/impls/implicit_as.carbon | 75 ++---- .../interop/cpp/operators/deref.carbon | 6 +- .../interop/cpp/operators/operators.carbon | 91 ++----- .../cpp/primitive_types/arithmetic.carbon | 5 - .../testdata/interop/cpp/reference.carbon | 40 +-- 23 files changed, 412 insertions(+), 411 deletions(-) diff --git a/toolchain/check/cpp/export.cpp b/toolchain/check/cpp/export.cpp index 97190aee2f94..580aa3f08940 100644 --- a/toolchain/check/cpp/export.cpp +++ b/toolchain/check/cpp/export.cpp @@ -9,6 +9,7 @@ #include "toolchain/check/cpp/location.h" #include "toolchain/check/cpp/type_mapping.h" #include "toolchain/check/function.h" +#include "toolchain/check/pattern.h" #include "toolchain/check/thunk.h" #include "toolchain/check/type.h" #include "toolchain/sem_ir/mangler.h" @@ -543,7 +544,7 @@ static auto BuildCarbonToCarbonThunk(Context& context, SemIR::LocId loc_id, .name_id = thunk_name_id, .self_type_id = target.self_type_id, .param_type_ids = thunk_param_type_ids, - .params_are_refs = true}) + .param_kind = ParamPatternKind::Ref}) .second; BuildThunkDefinitionForExport( diff --git a/toolchain/check/cpp/import.cpp b/toolchain/check/cpp/import.cpp index 0cb490715f0b..a27285970341 100644 --- a/toolchain/check/cpp/import.cpp +++ b/toolchain/check/cpp/import.cpp @@ -1265,8 +1265,7 @@ namespace { struct ParameterTypeInfo { // The type to use for the Carbon parameter. TypeExpr type; - // Whether to build a `ref` pattern. - bool want_ref_pattern; + ParamPatternKind kind; }; } // namespace @@ -1278,29 +1277,33 @@ struct ParameterTypeInfo { // as the C++ type. static auto MapParameterType(Context& context, SemIR::LocId loc_id, clang::QualType param_type) -> ParameterTypeInfo { - ParameterTypeInfo info = {.type = TypeExpr::None, .want_ref_pattern = false}; + ParameterTypeInfo info = {.type = TypeExpr::None, + .kind = ParamPatternKind::Value}; // Perform some custom mapping for parameters of reference type: // // * `T& x` -> `ref x: T`. + // * `T&& x` -> `var x: T`. // * `const T& x` -> `x: T`. - // * `T&& x` -> `x: T`. - // - // TODO: For the `&&` mapping, we allow an rvalue reference to bind to a - // durable reference expression. This should not be allowed. + // * `const T&& x` -> `x: T`. if (param_type->isReferenceType()) { clang::QualType pointee_type = param_type->getPointeeType(); - if (param_type->isLValueReferenceType()) { - if (pointee_type.isConstQualified()) { - // TODO: Consider only doing this if `const` is the only qualifier. For - // now, any other qualifier will fail when mapping the type. - auto split_type = pointee_type.getSplitUnqualifiedType(); - split_type.Quals.removeConst(); - pointee_type = context.ast_context().getQualifiedType(split_type); - } else { - // The reference will map to a `ref` pattern. - info.want_ref_pattern = true; - } + if (pointee_type.isConstQualified()) { + // TODO: Consider only doing this if `const` is the only qualifier. For + // now, any other qualifier will fail when mapping the type. + auto split_type = pointee_type.getSplitUnqualifiedType(); + split_type.Quals.removeConst(); + pointee_type = context.ast_context().getQualifiedType(split_type); + } else if (param_type->isLValueReferenceType()) { + // Lvalue references map to a `ref` pattern. + info.kind = ParamPatternKind::Ref; + } else { + // Rvalue references map to a `var` pattern. When given a value expression + // as an argument, this will result in a copy. However, if the argument is + // of class type, we will map its type to `const T`, which means overload + // resolution won't allow the call anyway, so this only permits passing + // value expressions of non-class type to a `T&&` parameter. + info.kind = ParamPatternKind::Var; } param_type = pointee_type; } @@ -1315,6 +1318,7 @@ static auto MapParameterType(Context& context, SemIR::LocId loc_id, // returns None. static auto MakeImplicitParamPatternsBlockId( Context& context, SemIR::LocId loc_id, + SemIR::ImportIRInstId import_ir_inst_id, const clang::FunctionDecl& clang_decl) -> SemIR::InstBlockId { const auto* method_decl = dyn_cast(&clang_decl); if (!method_decl || method_decl->isStatic() || @@ -1341,10 +1345,11 @@ static auto MakeImplicitParamPatternsBlockId( return SemIR::InstBlockId::None; } - // TODO: Fill in a location once available. - auto pattern_id = AddParamPattern(context, loc_id, SemIR::NameId::SelfValue, - type_expr_region_id, type_id, - param_info.want_ref_pattern); + // TODO: Use a location associated with the object parameter instead of the + // location of the function as a whole. + auto pattern_id = + AddParamPattern(context, import_ir_inst_id, SemIR::NameId::SelfValue, + type_expr_region_id, type_id, param_info.kind); return context.inst_blocks().Add({pattern_id}); } @@ -1357,6 +1362,7 @@ static auto MakeImplicitParamPatternsBlockId( // TODO: Consider refactoring to extract and reuse more logic from // `HandleAnyBindingPattern()`. static auto MakeParamPatternsBlockId(Context& context, SemIR::LocId loc_id, + SemIR::ImportIRInstId import_ir_inst_id, const clang::FunctionDecl& clang_decl, SemIR::ClangDeclKey::Signature signature) -> SemIR::InstBlockId { @@ -1413,7 +1419,7 @@ static auto MakeParamPatternsBlockId(Context& context, SemIR::LocId loc_id, // TODO: Add template support. SemIR::InstId pattern_id = AddParamPattern(context, param_loc_id, name_id, type_expr_region_id, - type_id, param_info.want_ref_pattern); + type_id, param_info.kind); param_ids.push_back(pattern_id); param_type_ids.push_back(type_inst_id); } @@ -1432,7 +1438,7 @@ static auto MakeParamPatternsBlockId(Context& context, SemIR::LocId loc_id, GetPatternType(context, GetTupleType(context, param_type_ids)); SemIR::InstId pattern_id = AddInst( context, SemIR::LocIdAndInst::RuntimeVerified( - context.sem_ir(), loc_id, + context.sem_ir(), import_ir_inst_id, SemIR::TuplePattern{.type_id = tuple_pattern_type_id, .elements_id = param_block_id})); param_ids = {pattern_id}; @@ -1586,19 +1592,20 @@ struct FunctionSignatureInsts { // parameter type. `signature` specifies how to convert the C++ function // signature to the Carbon function signature. static auto CreateFunctionSignatureInsts( - Context& context, SemIR::LocId loc_id, clang::FunctionDecl* clang_decl, + Context& context, SemIR::LocId loc_id, + SemIR::ImportIRInstId import_ir_inst_id, clang::FunctionDecl* clang_decl, SemIR::ClangDeclKey::Signature signature) -> std::optional { context.full_pattern_stack().StartImplicitParamList(); - auto implicit_param_patterns_id = - MakeImplicitParamPatternsBlockId(context, loc_id, *clang_decl); + auto implicit_param_patterns_id = MakeImplicitParamPatternsBlockId( + context, loc_id, import_ir_inst_id, *clang_decl); if (!implicit_param_patterns_id.has_value()) { return std::nullopt; } context.full_pattern_stack().EndImplicitParamList(); context.full_pattern_stack().StartExplicitParamList(); - auto param_patterns_id = - MakeParamPatternsBlockId(context, loc_id, *clang_decl, signature); + auto param_patterns_id = MakeParamPatternsBlockId( + context, loc_id, import_ir_inst_id, *clang_decl, signature); if (!param_patterns_id.has_value()) { return std::nullopt; } @@ -1667,8 +1674,8 @@ static auto ImportFunction(Context& context, SemIR::LocId loc_id, -> std::optional { StartFunctionSignature(context); - auto function_params_insts = - CreateFunctionSignatureInsts(context, loc_id, clang_decl, signature); + auto function_params_insts = CreateFunctionSignatureInsts( + context, loc_id, import_ir_inst_id, clang_decl, signature); auto [pattern_block_id, decl_block_id] = FinishFunctionSignature(context, /*check_unused=*/false); diff --git a/toolchain/check/cpp/operators.cpp b/toolchain/check/cpp/operators.cpp index a9697205acbd..b3b87ba1ed37 100644 --- a/toolchain/check/cpp/operators.cpp +++ b/toolchain/check/cpp/operators.cpp @@ -15,6 +15,7 @@ #include "toolchain/check/cpp/type_mapping.h" #include "toolchain/check/function.h" #include "toolchain/check/inst.h" +#include "toolchain/check/pattern.h" #include "toolchain/check/type.h" #include "toolchain/check/type_completion.h" #include "toolchain/sem_ir/builtin_function_kind.h" @@ -266,6 +267,7 @@ static auto MakeCppStdInitializerListMake(Context& context, SemIR::LocId loc_id, {.parent_scope_id = init_list_class.scope_id, .name_id = init_list_class.name_id, .param_type_ids = {array_type_id}, + .param_kind = ParamPatternKind::Value, .return_type_id = init_list_type_id}); auto& function = context.functions().Get(function_id); diff --git a/toolchain/check/custom_witness.cpp b/toolchain/check/custom_witness.cpp index aeeee30d46d9..6e338d5da104 100644 --- a/toolchain/check/custom_witness.cpp +++ b/toolchain/check/custom_witness.cpp @@ -54,7 +54,7 @@ static auto MakeCopyOpFunction(Context& context, SemIR::LocId loc_id, {.parent_scope_id = parent_scope_id, .name_id = name_id, .self_type_id = self_type_id, - .self_is_ref = false, + .self_kind = ParamPatternKind::Value, .return_type_id = self_type_id}); auto& function = context.functions().Get(function_id); @@ -341,7 +341,8 @@ static auto MakeDestroyOpFunction(Context& context, SemIR::LocId loc_id, MakeGeneratedFunctionDecl(context, loc_id, {.parent_scope_id = parent_scope_id, .name_id = name_id, - .self_type_id = self_type_id}); + .self_type_id = self_type_id, + .self_kind = ParamPatternKind::Ref}); auto& function = context.functions().Get(function_id); diff --git a/toolchain/check/function.cpp b/toolchain/check/function.cpp index 442d2545fd0b..94695c32b83f 100644 --- a/toolchain/check/function.cpp +++ b/toolchain/check/function.cpp @@ -140,9 +140,9 @@ static auto MakeFunctionSignature(Context& context, SemIR::LocId loc_id, context, context.types().GetTypeInstId(args.self_type_id)); EndEmptySubpattern(context); - insts.self_param_id = AddParamPattern( - context, loc_id, SemIR::NameId::SelfValue, self_type_region_id, - args.self_type_id, args.self_is_ref); + insts.self_param_id = + AddParamPattern(context, loc_id, SemIR::NameId::SelfValue, + self_type_region_id, args.self_type_id, args.self_kind); insts.implicit_param_patterns_id = context.inst_blocks().Add({insts.self_param_id}); @@ -164,7 +164,7 @@ static auto MakeFunctionSignature(Context& context, SemIR::LocId loc_id, context.inst_block_stack().AddInstId(AddParamPattern( context, loc_id, SemIR::NameId::Underscore, param_type_region_id, - param_type_id, /*is_ref=*/args.params_are_refs)); + param_type_id, args.param_kind)); } insts.param_patterns_id = context.inst_block_stack().Pop(); } diff --git a/toolchain/check/function.h b/toolchain/check/function.h index e359d7f1531f..db986099a575 100644 --- a/toolchain/check/function.h +++ b/toolchain/check/function.h @@ -8,6 +8,7 @@ #include "toolchain/check/context.h" #include "toolchain/check/custom_witness.h" #include "toolchain/check/decl_name_stack.h" +#include "toolchain/check/pattern.h" #include "toolchain/check/subst.h" #include "toolchain/sem_ir/function.h" #include "toolchain/sem_ir/ids.h" @@ -37,12 +38,12 @@ struct FunctionDeclArgs { // The type of the implicit `[self: Self]` parameter, or `None` if there is // none. SemIR::TypeId self_type_id = SemIR::TypeId::None; - // Whether `self` is a ref parameter. - bool self_is_ref = true; + // The kind of the `self` parameter. + ParamPatternKind self_kind = ParamPatternKind::Ref; // The types of the explicit parameters. llvm::ArrayRef param_type_ids = {}; - // Whether the parameters described by `param_type_ids` are references. - bool params_are_refs = false; + // The kind of the parameters described by `param_type_ids`. + ParamPatternKind param_kind = ParamPatternKind::Value; // The return type, or `None` if the function doesn't declare a return type. SemIR::TypeId return_type_id = SemIR::TypeId::None; }; diff --git a/toolchain/check/handle_loop_statement.cpp b/toolchain/check/handle_loop_statement.cpp index 76eb5e74a849..aa69418772f3 100644 --- a/toolchain/check/handle_loop_statement.cpp +++ b/toolchain/check/handle_loop_statement.cpp @@ -174,11 +174,11 @@ auto HandleParseNode(Context& context, Parse::ForHeaderId node_id) -> bool { auto cursor_var_id = cursor_var_block.AddInstWithCleanup( node_id, {.type_id = cursor_type_id, .pattern_id = SemIR::AbsoluteInstId::None}); - // Disable broken lint that suggests a "fix" that doesn't compile. - auto init_result = Initialize(context, node_id, - // NOLINTNEXTLINE(performance-move-const-arg) - std::move(cursor_var_id), - std::move(cursor_var_block), cursor_id); + auto init_result = Initialize( + context, node_id, + // Disable broken lint that suggests a "fix" that doesn't compile. + // NOLINTNEXTLINE(performance-move-const-arg) + std::move(cursor_var_id), std::move(cursor_var_block), cursor_id); AddInst( context, node_id, {.lhs_id = init_result.storage_id, .rhs_id = init_result.init_id}); diff --git a/toolchain/check/pattern.cpp b/toolchain/check/pattern.cpp index ab407511f95b..cff8b90d590c 100644 --- a/toolchain/check/pattern.cpp +++ b/toolchain/check/pattern.cpp @@ -9,6 +9,7 @@ #include "toolchain/check/inst.h" #include "toolchain/check/return.h" #include "toolchain/check/type.h" +#include "toolchain/sem_ir/inst.h" namespace Carbon::Check { @@ -202,27 +203,51 @@ auto AddPatternVarStorage(Context& context, SemIR::InstBlockId pattern_block_id, auto AddParamPattern(Context& context, SemIR::LocId loc_id, SemIR::NameId name_id, SemIR::ExprRegionId type_expr_region_id, - SemIR::TypeId type_id, bool is_ref) -> SemIR::InstId { - auto pattern_type_id = GetPatternType(context, type_id); - const auto& param_pattern_kind = - is_ref ? SemIR::RefParamPattern::Kind : SemIR::ValueParamPattern::Kind; - auto pattern_id = AddInst( - context, SemIR::LocIdAndInst::RuntimeVerified( - context.sem_ir(), loc_id, - SemIR::AnyLeafParamPattern{.kind = param_pattern_kind, - .type_id = pattern_type_id, - .pretty_name_id = name_id})); + SemIR::TypeId type_id, ParamPatternKind kind) + -> SemIR::InstId { + auto param_pattern_kind = [kind]() -> SemIR::InstKind { + switch (kind) { + case ParamPatternKind::Value: + return SemIR::ValueParamPattern::Kind; + case ParamPatternKind::Ref: + return SemIR::RefParamPattern::Kind; + case ParamPatternKind::Var: + return SemIR::VarParamPattern::Kind; + } + }(); auto entity_name_id = AddBindingEntityName(context, name_id, /*form_id=*/SemIR::InstId::None, /*is_unused=*/false, /*phase=*/BindingPhase::Runtime); - return AddBindingPattern(context, loc_id, type_expr_region_id, - {.kind = SemIR::WrapperBindingPattern::Kind, - .type_id = GetPatternType(context, type_id), - .entity_name_id = entity_name_id, - .subpattern_id = pattern_id}) - .pattern_id; + + auto pattern_type_id = GetPatternType(context, type_id); + if (kind == ParamPatternKind::Var) { + auto pattern_id = AddBindingPattern(context, loc_id, type_expr_region_id, + {.kind = SemIR::RefBindingPattern::Kind, + .type_id = pattern_type_id, + .entity_name_id = entity_name_id, + .subpattern_id = SemIR::InstId::None}); + return AddInst(context, SemIR::LocIdAndInst::RuntimeVerified( + context.sem_ir(), loc_id, + SemIR::VarParamPattern{ + .type_id = pattern_type_id, + .subpattern_id = pattern_id.pattern_id})); + } else { + auto pattern_id = AddInst( + context, SemIR::LocIdAndInst::RuntimeVerified( + context.sem_ir(), loc_id, + SemIR::AnyLeafParamPattern{.kind = param_pattern_kind, + .type_id = pattern_type_id, + .pretty_name_id = name_id})); + + return AddBindingPattern(context, loc_id, type_expr_region_id, + {.kind = SemIR::WrapperBindingPattern::Kind, + .type_id = GetPatternType(context, type_id), + .entity_name_id = entity_name_id, + .subpattern_id = pattern_id}) + .pattern_id; + } } } // namespace Carbon::Check diff --git a/toolchain/check/pattern.h b/toolchain/check/pattern.h index 3bba72304097..c3ff406dd264 100644 --- a/toolchain/check/pattern.h +++ b/toolchain/check/pattern.h @@ -64,16 +64,27 @@ auto AddBindingPattern(Context& context, SemIR::LocId name_loc, auto AddPatternVarStorage(Context& context, SemIR::InstBlockId pattern_block_id, bool is_returned_var) -> void; +// Kinds of parameters that can be added by `AddParamPattern`. +enum class ParamPatternKind { + // A value parameter, `x: T`. + Value, + // A reference parameter, `ref x: T`. + Ref, + // A variable parameter, `var x: T`. + Var, +}; + // Adds a parameter pattern with the specified name and type information. The -// pattern emulates `x: T` or `ref x: T` depending on the value of -// `is_ref` (`var x: T` is not supported). This only sets up the parameter -// pattern, binding pattern and type; callers are expected to add the returned -// parameter pattern instruction to appropriate blocks. This is used when -// generating functions, rather than processing a user-authored declaration. +// pattern emulates `x: T`, `ref x: T`, or `var x: T` depending on the value of +// `kind`. This only sets up the parameter pattern, binding pattern and type; +// callers are expected to add the returned parameter pattern instruction to +// appropriate blocks. This is used when generating functions, rather than +// processing a user-authored declaration. auto AddParamPattern(Context& context, SemIR::LocId loc_id, SemIR::NameId name_id, SemIR::ExprRegionId type_expr_region_id, - SemIR::TypeId type_id, bool is_ref) -> SemIR::InstId; + SemIR::TypeId type_id, ParamPatternKind kind) + -> SemIR::InstId; } // namespace Carbon::Check diff --git a/toolchain/check/pattern_match.cpp b/toolchain/check/pattern_match.cpp index bf575813517a..a49259117d6f 100644 --- a/toolchain/check/pattern_match.cpp +++ b/toolchain/check/pattern_match.cpp @@ -681,9 +681,9 @@ auto MatchContext::DoVarPreWorkImpl(State state, SemIR::TypeId pattern_type_id, auto storage_id = storage_block.AddInstWithCleanup( SemIR::LocId(entry.pattern_id), {.type_id = pattern_type_id, .pattern_id = entry.pattern_id}); - // Disable broken lint that suggests a "fix" that doesn't compile. auto init_result = Initialize( context_, SemIR::LocId(entry.pattern_id), + // Disable broken lint that suggests a "fix" that doesn't compile. // NOLINTNEXTLINE(performance-move-const-arg) std::move(storage_id), std::move(storage_block), scrutinee_id); // TODO: Consider instead creating something like a `Temporary` diff --git a/toolchain/check/testdata/interop/cpp/basics/import/indirect.carbon b/toolchain/check/testdata/interop/cpp/basics/import/indirect.carbon index dcdfb5a80df5..43d529702024 100644 --- a/toolchain/check/testdata/interop/cpp/basics/import/indirect.carbon +++ b/toolchain/check/testdata/interop/cpp/basics/import/indirect.carbon @@ -143,7 +143,6 @@ fn UseZ() -> Cpp.A.Z { // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %X: type = class_type @X [concrete] -// CHECK:STDOUT: %pattern_type.f80: type = pattern_type %X [concrete] // CHECK:STDOUT: %X.elem: type = unbound_element_type %X, %i32 [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.824: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] @@ -169,14 +168,9 @@ fn UseZ() -> Cpp.A.Z { // CHECK:STDOUT: %Copy.impl_witness_table.e76 = impl_witness_table (%Core.import_ref.18d), @Int.as.Copy.impl [concrete] // CHECK:STDOUT: %X.g.cpp_overload_set.value: %X.g.cpp_overload_set.type = cpp_overload_set_value @X.g.cpp_overload_set [concrete = constants.%X.g.cpp_overload_set.value] // CHECK:STDOUT: %X.g.decl: %X.g.type = fn_decl @X.g [concrete = constants.%X.g] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.f80 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.f80 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: // CHECK:STDOUT: } { // CHECK:STDOUT: -// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 -// CHECK:STDOUT: %self: ref %X = ref_binding self, %self.param -// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -271,14 +265,9 @@ fn UseZ() -> Cpp.A.Z { // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete] // CHECK:STDOUT: %X.g.cpp_overload_set.value: %X.g.cpp_overload_set.type = cpp_overload_set_value @X.g.cpp_overload_set [concrete = constants.%X.g.cpp_overload_set.value] // CHECK:STDOUT: %X.g.decl: %X.g.type = fn_decl @X.g [concrete = constants.%X.g] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.f80 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.f80 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: // CHECK:STDOUT: } { // CHECK:STDOUT: -// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 -// CHECK:STDOUT: %self: ref %X = ref_binding self, %self.param -// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import_ref.18d: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.824) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.9b9)] // CHECK:STDOUT: %Copy.impl_witness_table.e76 = impl_witness_table (%Core.import_ref.18d), @Int.as.Copy.impl [concrete] diff --git a/toolchain/check/testdata/interop/cpp/class/import/access.carbon b/toolchain/check/testdata/interop/cpp/class/import/access.carbon index 26635dec2f16..f9e9afd3bb11 100644 --- a/toolchain/check/testdata/interop/cpp/class/import/access.carbon +++ b/toolchain/check/testdata/interop/cpp/class/import/access.carbon @@ -1791,7 +1791,6 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete] // CHECK:STDOUT: %S.instance_fn.cpp_overload_set.type: type = cpp_overload_set_type @S.instance_fn.cpp_overload_set [concrete] // CHECK:STDOUT: %S.instance_fn.cpp_overload_set.value: %S.instance_fn.cpp_overload_set.type = cpp_overload_set_value @S.instance_fn.cpp_overload_set [concrete] -// CHECK:STDOUT: %pattern_type.7da: type = pattern_type %S [concrete] // CHECK:STDOUT: %S.instance_fn.type: type = fn_type @S.instance_fn [concrete] // CHECK:STDOUT: %S.instance_fn: %S.instance_fn.type = struct_value () [concrete] // CHECK:STDOUT: %S.static_fn.cpp_overload_set.type: type = cpp_overload_set_type @S.static_fn.cpp_overload_set [concrete] @@ -1808,11 +1807,9 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {} // CHECK:STDOUT: %S.instance_fn.cpp_overload_set.value: %S.instance_fn.cpp_overload_set.type = cpp_overload_set_value @S.instance_fn.cpp_overload_set [concrete = constants.%S.instance_fn.cpp_overload_set.value] // CHECK:STDOUT: %S.instance_fn.decl: %S.instance_fn.type = fn_decl @S.instance_fn [concrete = constants.%S.instance_fn] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.7da = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.7da = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %S = ref_param call_param0 -// CHECK:STDOUT: %self: ref %S = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %S.static_fn.cpp_overload_set.value: %S.static_fn.cpp_overload_set.type = cpp_overload_set_value @S.static_fn.cpp_overload_set [concrete = constants.%S.static_fn.cpp_overload_set.value] // CHECK:STDOUT: %S.static_fn.decl: %S.static_fn.type = fn_decl @S.static_fn [concrete = constants.%S.static_fn] {} {} @@ -2516,7 +2513,6 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %Base.ProtectedStatic: %Base.ProtectedStatic.type = struct_value () [concrete] // CHECK:STDOUT: %Public.PublicInstance.cpp_overload_set.type: type = cpp_overload_set_type @Public.PublicInstance.cpp_overload_set [concrete] // CHECK:STDOUT: %Public.PublicInstance.cpp_overload_set.value: %Public.PublicInstance.cpp_overload_set.type = cpp_overload_set_value @Public.PublicInstance.cpp_overload_set [concrete] -// CHECK:STDOUT: %pattern_type.a3a: type = pattern_type %Base [concrete] // CHECK:STDOUT: %Base.PublicInstance.type: type = fn_type @Base.PublicInstance [concrete] // CHECK:STDOUT: %Base.PublicInstance: %Base.PublicInstance.type = struct_value () [concrete] // CHECK:STDOUT: %Public.ProtectedInstance.cpp_overload_set.type: type = cpp_overload_set_type @Public.ProtectedInstance.cpp_overload_set [concrete] @@ -2537,19 +2533,15 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %Base.ProtectedStatic.decl: %Base.ProtectedStatic.type = fn_decl @Base.ProtectedStatic [concrete = constants.%Base.ProtectedStatic] {} {} // CHECK:STDOUT: %Public.PublicInstance.cpp_overload_set.value: %Public.PublicInstance.cpp_overload_set.type = cpp_overload_set_value @Public.PublicInstance.cpp_overload_set [concrete = constants.%Public.PublicInstance.cpp_overload_set.value] // CHECK:STDOUT: %Base.PublicInstance.decl: %Base.PublicInstance.type = fn_decl @Base.PublicInstance [concrete = constants.%Base.PublicInstance] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.a3a = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.a3a = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %Base = ref_param call_param0 -// CHECK:STDOUT: %self: ref %Base = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Public.ProtectedInstance.cpp_overload_set.value: %Public.ProtectedInstance.cpp_overload_set.type = cpp_overload_set_value @Public.ProtectedInstance.cpp_overload_set [concrete = constants.%Public.ProtectedInstance.cpp_overload_set.value] // CHECK:STDOUT: %Base.ProtectedInstance.decl: %Base.ProtectedInstance.type = fn_decl @Base.ProtectedInstance [concrete = constants.%Base.ProtectedInstance] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.a3a = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.a3a = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %Base = ref_param call_param0 -// CHECK:STDOUT: %self: ref %Base = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2672,7 +2664,6 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %Base.ProtectedStatic: %Base.ProtectedStatic.type = struct_value () [concrete] // CHECK:STDOUT: %Protected.PublicInstance.cpp_overload_set.type: type = cpp_overload_set_type @Protected.PublicInstance.cpp_overload_set [concrete] // CHECK:STDOUT: %Protected.PublicInstance.cpp_overload_set.value: %Protected.PublicInstance.cpp_overload_set.type = cpp_overload_set_value @Protected.PublicInstance.cpp_overload_set [concrete] -// CHECK:STDOUT: %pattern_type.a3a: type = pattern_type %Base [concrete] // CHECK:STDOUT: %Base.PublicInstance.type: type = fn_type @Base.PublicInstance [concrete] // CHECK:STDOUT: %Base.PublicInstance: %Base.PublicInstance.type = struct_value () [concrete] // CHECK:STDOUT: %Protected.ProtectedInstance.cpp_overload_set.type: type = cpp_overload_set_type @Protected.ProtectedInstance.cpp_overload_set [concrete] @@ -2693,19 +2684,15 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %Base.ProtectedStatic.decl: %Base.ProtectedStatic.type = fn_decl @Base.ProtectedStatic [concrete = constants.%Base.ProtectedStatic] {} {} // CHECK:STDOUT: %Protected.PublicInstance.cpp_overload_set.value: %Protected.PublicInstance.cpp_overload_set.type = cpp_overload_set_value @Protected.PublicInstance.cpp_overload_set [concrete = constants.%Protected.PublicInstance.cpp_overload_set.value] // CHECK:STDOUT: %Base.PublicInstance.decl: %Base.PublicInstance.type = fn_decl @Base.PublicInstance [concrete = constants.%Base.PublicInstance] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.a3a = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.a3a = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %Base = ref_param call_param0 -// CHECK:STDOUT: %self: ref %Base = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Protected.ProtectedInstance.cpp_overload_set.value: %Protected.ProtectedInstance.cpp_overload_set.type = cpp_overload_set_value @Protected.ProtectedInstance.cpp_overload_set [concrete = constants.%Protected.ProtectedInstance.cpp_overload_set.value] // CHECK:STDOUT: %Base.ProtectedInstance.decl: %Base.ProtectedInstance.type = fn_decl @Base.ProtectedInstance [concrete = constants.%Base.ProtectedInstance] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.a3a = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.a3a = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %Base = ref_param call_param0 -// CHECK:STDOUT: %self: ref %Base = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2777,7 +2764,6 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %Base.ProtectedStatic: %Base.ProtectedStatic.type = struct_value () [concrete] // CHECK:STDOUT: %PublicProtected.PublicInstance.cpp_overload_set.type: type = cpp_overload_set_type @PublicProtected.PublicInstance.cpp_overload_set [concrete] // CHECK:STDOUT: %PublicProtected.PublicInstance.cpp_overload_set.value: %PublicProtected.PublicInstance.cpp_overload_set.type = cpp_overload_set_value @PublicProtected.PublicInstance.cpp_overload_set [concrete] -// CHECK:STDOUT: %pattern_type.a3a: type = pattern_type %Base [concrete] // CHECK:STDOUT: %Base.PublicInstance.type: type = fn_type @Base.PublicInstance [concrete] // CHECK:STDOUT: %Base.PublicInstance: %Base.PublicInstance.type = struct_value () [concrete] // CHECK:STDOUT: %PublicProtected.ProtectedInstance.cpp_overload_set.type: type = cpp_overload_set_type @PublicProtected.ProtectedInstance.cpp_overload_set [concrete] @@ -2798,19 +2784,15 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %Base.ProtectedStatic.decl: %Base.ProtectedStatic.type = fn_decl @Base.ProtectedStatic [concrete = constants.%Base.ProtectedStatic] {} {} // CHECK:STDOUT: %PublicProtected.PublicInstance.cpp_overload_set.value: %PublicProtected.PublicInstance.cpp_overload_set.type = cpp_overload_set_value @PublicProtected.PublicInstance.cpp_overload_set [concrete = constants.%PublicProtected.PublicInstance.cpp_overload_set.value] // CHECK:STDOUT: %Base.PublicInstance.decl: %Base.PublicInstance.type = fn_decl @Base.PublicInstance [concrete = constants.%Base.PublicInstance] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.a3a = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.a3a = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %Base = ref_param call_param0 -// CHECK:STDOUT: %self: ref %Base = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %PublicProtected.ProtectedInstance.cpp_overload_set.value: %PublicProtected.ProtectedInstance.cpp_overload_set.type = cpp_overload_set_value @PublicProtected.ProtectedInstance.cpp_overload_set [concrete = constants.%PublicProtected.ProtectedInstance.cpp_overload_set.value] // CHECK:STDOUT: %Base.ProtectedInstance.decl: %Base.ProtectedInstance.type = fn_decl @Base.ProtectedInstance [concrete = constants.%Base.ProtectedInstance] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.a3a = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.a3a = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %Base = ref_param call_param0 -// CHECK:STDOUT: %self: ref %Base = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/class/import/class.carbon b/toolchain/check/testdata/interop/cpp/class/import/class.carbon index 70d4b5ca136c..5f6dcd8a5b4a 100644 --- a/toolchain/check/testdata/interop/cpp/class/import/class.carbon +++ b/toolchain/check/testdata/interop/cpp/class/import/class.carbon @@ -488,7 +488,6 @@ fn GenericUse(p2: Generic(Cpp.Class1)) { // CHECK:STDOUT: %MyF: %MyF.type = struct_value () [concrete] // CHECK:STDOUT: %Bar.f.cpp_overload_set.type: type = cpp_overload_set_type @Bar.f.cpp_overload_set [concrete] // CHECK:STDOUT: %Bar.f.cpp_overload_set.value: %Bar.f.cpp_overload_set.type = cpp_overload_set_value @Bar.f.cpp_overload_set [concrete] -// CHECK:STDOUT: %pattern_type.07b: type = pattern_type %Bar [concrete] // CHECK:STDOUT: %Bar.f.type: type = fn_type @Bar.f [concrete] // CHECK:STDOUT: %Bar.f: %Bar.f.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -501,11 +500,9 @@ fn GenericUse(p2: Generic(Cpp.Class1)) { // CHECK:STDOUT: %Bar.decl: type = class_decl @Bar [concrete = constants.%Bar] {} {} // CHECK:STDOUT: %Bar.f.cpp_overload_set.value: %Bar.f.cpp_overload_set.type = cpp_overload_set_value @Bar.f.cpp_overload_set [concrete = constants.%Bar.f.cpp_overload_set.value] // CHECK:STDOUT: %Bar.f.decl: %Bar.f.type = fn_decl @Bar.f [concrete = constants.%Bar.f] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.07b = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.07b = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %Bar = ref_param call_param0 -// CHECK:STDOUT: %self: ref %Bar = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/class/import/method.carbon b/toolchain/check/testdata/interop/cpp/class/import/method.carbon index f1b740d34e0a..23d00b9a5f73 100644 --- a/toolchain/check/testdata/interop/cpp/class/import/method.carbon +++ b/toolchain/check/testdata/interop/cpp/class/import/method.carbon @@ -31,6 +31,8 @@ library "[[@TEST_NAME]]"; import Cpp library "object_param_qualifiers.h"; +fn Make() -> Cpp.HasQualifiers; + fn F(v: Cpp.HasQualifiers, p: Cpp.HasQualifiers*) { //@dump-sem-ir-begin v.const_this(); @@ -41,6 +43,12 @@ fn F(v: Cpp.HasQualifiers, p: Cpp.HasQualifiers*) { p->ref_this(); p->const_this(); p->const_ref_this(); + + Make().plain(); + Make().const_this(); + Make().const_ref_this(); + Make().ref_ref_this(); + Make().const_ref_ref_this(); //@dump-sem-ir-end } @@ -136,6 +144,26 @@ fn Ref(p: Cpp.HasQualifiers*) { p->const_ref_ref_this(); } +// --- fail_bad_object_param_qualifiers_for_temporary.carbon + +library "[[@TEST_NAME]]"; + +import Cpp library "object_param_qualifiers.h"; + +fn Make() -> Cpp.HasQualifiers; + +fn F() { + // CHECK:STDERR: fail_bad_object_param_qualifiers_for_temporary.carbon:[[@LINE+8]]:19: error: no matching function for call to 'ref_this' [CppInteropParseError] + // CHECK:STDERR: 17 | Make().ref_this(); + // CHECK:STDERR: | ^ + // CHECK:STDERR: fail_bad_object_param_qualifiers_for_temporary.carbon:[[@LINE-8]]:10: in file included here [InCppInclude] + // CHECK:STDERR: ./object_param_qualifiers.h:7:8: note: candidate function not viable: expects an lvalue for object argument [CppInteropParseNote] + // CHECK:STDERR: 7 | void ref_this() &; + // CHECK:STDERR: | ^ + // CHECK:STDERR: + Make().ref_this(); +} + // --- object_param_qualifiers_overloaded.h struct NoRefQualifier { @@ -243,7 +271,8 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %HasQualifiers: type = class_type @HasQualifiers [concrete] -// CHECK:STDOUT: %pattern_type.e15: type = pattern_type %HasQualifiers [concrete] +// CHECK:STDOUT: %Make.type: type = fn_type @Make [concrete] +// CHECK:STDOUT: %Make: %Make.type = struct_value () [concrete] // CHECK:STDOUT: %ptr.ec3: type = ptr_type %HasQualifiers [concrete] // CHECK:STDOUT: %HasQualifiers.const_this.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.const_this.cpp_overload_set [concrete] // CHECK:STDOUT: %HasQualifiers.const_this.cpp_overload_set.value: %HasQualifiers.const_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.const_this.cpp_overload_set [concrete] @@ -255,7 +284,6 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: %const_ref_this__carbon_thunk: %const_ref_this__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %HasQualifiers.const_ref_ref_this.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.const_ref_ref_this.cpp_overload_set [concrete] // CHECK:STDOUT: %HasQualifiers.const_ref_ref_this.cpp_overload_set.value: %HasQualifiers.const_ref_ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.const_ref_ref_this.cpp_overload_set [concrete] -// CHECK:STDOUT: %const: type = const_type %HasQualifiers [concrete] // CHECK:STDOUT: %const_ref_ref_this__carbon_thunk.type: type = fn_type @const_ref_ref_this__carbon_thunk [concrete] // CHECK:STDOUT: %const_ref_ref_this__carbon_thunk: %const_ref_ref_this__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %HasQualifiers.plain.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.plain.cpp_overload_set [concrete] @@ -266,6 +294,27 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: %HasQualifiers.ref_this.cpp_overload_set.value: %HasQualifiers.ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.ref_this.cpp_overload_set [concrete] // CHECK:STDOUT: %HasQualifiers.ref_this.type: type = fn_type @HasQualifiers.ref_this [concrete] // CHECK:STDOUT: %HasQualifiers.ref_this: %HasQualifiers.ref_this.type = struct_value () [concrete] +// CHECK:STDOUT: %HasQualifiers.ref_ref_this.cpp_overload_set.type: type = cpp_overload_set_type @HasQualifiers.ref_ref_this.cpp_overload_set [concrete] +// CHECK:STDOUT: %HasQualifiers.ref_ref_this.cpp_overload_set.value: %HasQualifiers.ref_ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.ref_ref_this.cpp_overload_set [concrete] +// CHECK:STDOUT: %ref_ref_this__carbon_thunk.type: type = fn_type @ref_ref_this__carbon_thunk [concrete] +// CHECK:STDOUT: %ref_ref_this__carbon_thunk: %ref_ref_this__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] +// CHECK:STDOUT: %HasQualifiers.HasQualifiers.type: type = fn_type @HasQualifiers.HasQualifiers [concrete] +// CHECK:STDOUT: %HasQualifiers.HasQualifiers: %HasQualifiers.HasQualifiers.type = struct_value () [concrete] +// CHECK:STDOUT: %const.2b5: type = const_type %HasQualifiers [concrete] +// CHECK:STDOUT: %ptr.2cb: type = ptr_type %const.2b5 [concrete] +// CHECK:STDOUT: %HasQualifiers__carbon_thunk.type: type = fn_type @HasQualifiers__carbon_thunk [concrete] +// CHECK:STDOUT: %HasQualifiers__carbon_thunk: %HasQualifiers__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %HasQualifiers.Op.type.ec4d87.1: type = fn_type @HasQualifiers.Op.1 [concrete] +// CHECK:STDOUT: %HasQualifiers.Op.567da9.1: %HasQualifiers.Op.type.ec4d87.1 = struct_value () [concrete] +// CHECK:STDOUT: %custom_witness.dbb: = custom_witness (%HasQualifiers.Op.567da9.1), @Copy [concrete] +// CHECK:STDOUT: %Copy.facet.717: %Copy.type = facet_value %HasQualifiers, (%custom_witness.dbb) [concrete] +// CHECK:STDOUT: %Copy.WithSelf.Op.type.4bc: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet.717) [concrete] +// CHECK:STDOUT: %.f42: type = fn_type_with_self_type %Copy.WithSelf.Op.type.4bc, %Copy.facet.717 [concrete] +// CHECK:STDOUT: %HasQualifiers.cpp_destructor.type: type = fn_type @HasQualifiers.cpp_destructor [concrete] +// CHECK:STDOUT: %HasQualifiers.cpp_destructor: %HasQualifiers.cpp_destructor.type = struct_value () [concrete] +// CHECK:STDOUT: %HasQualifiers.Op.type.ec4d87.2: type = fn_type @HasQualifiers.Op.2 [concrete] +// CHECK:STDOUT: %HasQualifiers.Op.567da9.2: %HasQualifiers.Op.type.ec4d87.2 = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -289,60 +338,150 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: } // CHECK:STDOUT: %HasQualifiers.plain.cpp_overload_set.value: %HasQualifiers.plain.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.plain.cpp_overload_set [concrete = constants.%HasQualifiers.plain.cpp_overload_set.value] // CHECK:STDOUT: %HasQualifiers.plain.decl: %HasQualifiers.plain.type = fn_decl @HasQualifiers.plain [concrete = constants.%HasQualifiers.plain] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.e15 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.e15 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %HasQualifiers = ref_param call_param0 -// CHECK:STDOUT: %self: ref %HasQualifiers = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %HasQualifiers.ref_this.cpp_overload_set.value: %HasQualifiers.ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.ref_this.cpp_overload_set [concrete = constants.%HasQualifiers.ref_this.cpp_overload_set.value] // CHECK:STDOUT: %HasQualifiers.ref_this.decl: %HasQualifiers.ref_this.type = fn_decl @HasQualifiers.ref_this [concrete = constants.%HasQualifiers.ref_this] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.e15 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.e15 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %HasQualifiers = ref_param call_param0 -// CHECK:STDOUT: %self: ref %HasQualifiers = ref_binding self, %self.param +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %HasQualifiers.ref_ref_this.cpp_overload_set.value: %HasQualifiers.ref_ref_this.cpp_overload_set.type = cpp_overload_set_value @HasQualifiers.ref_ref_this.cpp_overload_set [concrete = constants.%HasQualifiers.ref_ref_this.cpp_overload_set.value] +// CHECK:STDOUT: %ref_ref_this__carbon_thunk.decl: %ref_ref_this__carbon_thunk.type = fn_decl @ref_ref_this__carbon_thunk [concrete = constants.%ref_ref_this__carbon_thunk] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %HasQualifiers.HasQualifiers.decl: %HasQualifiers.HasQualifiers.type = fn_decl @HasQualifiers.HasQualifiers [concrete = constants.%HasQualifiers.HasQualifiers] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %HasQualifiers__carbon_thunk.decl: %HasQualifiers__carbon_thunk.type = fn_decl @HasQualifiers__carbon_thunk [concrete = constants.%HasQualifiers__carbon_thunk] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: %HasQualifiers.cpp_destructor.decl: %HasQualifiers.cpp_destructor.type = fn_decl @HasQualifiers.cpp_destructor [concrete = constants.%HasQualifiers.cpp_destructor] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @F(%v.param: %HasQualifiers, %p.param: %ptr.ec3) { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %v.ref.loc8: %HasQualifiers = name_ref v, %v -// CHECK:STDOUT: %const_this.ref.loc8: %HasQualifiers.const_this.cpp_overload_set.type = name_ref const_this, imports.%HasQualifiers.const_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_this.cpp_overload_set.value] -// CHECK:STDOUT: %bound_method.loc8: = bound_method %v.ref.loc8, %const_this.ref.loc8 -// CHECK:STDOUT: %const_this__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%const_this__carbon_thunk.decl(%v.ref.loc8) -// CHECK:STDOUT: %v.ref.loc9: %HasQualifiers = name_ref v, %v -// CHECK:STDOUT: %const_ref_this.ref.loc9: %HasQualifiers.const_ref_this.cpp_overload_set.type = name_ref const_ref_this, imports.%HasQualifiers.const_ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_ref_this.cpp_overload_set.value] -// CHECK:STDOUT: %bound_method.loc9: = bound_method %v.ref.loc9, %const_ref_this.ref.loc9 -// CHECK:STDOUT: %const_ref_this__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%const_ref_this__carbon_thunk.decl(%v.ref.loc9) // CHECK:STDOUT: %v.ref.loc10: %HasQualifiers = name_ref v, %v -// CHECK:STDOUT: %const_ref_ref_this.ref: %HasQualifiers.const_ref_ref_this.cpp_overload_set.type = name_ref const_ref_ref_this, imports.%HasQualifiers.const_ref_ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_ref_ref_this.cpp_overload_set.value] -// CHECK:STDOUT: %bound_method.loc10: = bound_method %v.ref.loc10, %const_ref_ref_this.ref -// CHECK:STDOUT: %.loc10_3.1: %const = as_compatible %v.ref.loc10 -// CHECK:STDOUT: %.loc10_3.2: %const = converted %v.ref.loc10, %.loc10_3.1 -// CHECK:STDOUT: %const_ref_ref_this__carbon_thunk.call: init %empty_tuple.type = call imports.%const_ref_ref_this__carbon_thunk.decl(%.loc10_3.2) -// CHECK:STDOUT: %p.ref.loc12: %ptr.ec3 = name_ref p, %p -// CHECK:STDOUT: %.loc12: ref %HasQualifiers = deref %p.ref.loc12 -// CHECK:STDOUT: %plain.ref: %HasQualifiers.plain.cpp_overload_set.type = name_ref plain, imports.%HasQualifiers.plain.cpp_overload_set.value [concrete = constants.%HasQualifiers.plain.cpp_overload_set.value] -// CHECK:STDOUT: %bound_method.loc12: = bound_method %.loc12, %plain.ref -// CHECK:STDOUT: %HasQualifiers.plain.call: init %empty_tuple.type = call imports.%HasQualifiers.plain.decl(%.loc12) -// CHECK:STDOUT: %p.ref.loc13: %ptr.ec3 = name_ref p, %p -// CHECK:STDOUT: %.loc13: ref %HasQualifiers = deref %p.ref.loc13 -// CHECK:STDOUT: %ref_this.ref: %HasQualifiers.ref_this.cpp_overload_set.type = name_ref ref_this, imports.%HasQualifiers.ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.ref_this.cpp_overload_set.value] -// CHECK:STDOUT: %bound_method.loc13: = bound_method %.loc13, %ref_this.ref -// CHECK:STDOUT: %HasQualifiers.ref_this.call: init %empty_tuple.type = call imports.%HasQualifiers.ref_this.decl(%.loc13) +// CHECK:STDOUT: %const_this.ref.loc10: %HasQualifiers.const_this.cpp_overload_set.type = name_ref const_this, imports.%HasQualifiers.const_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_this.cpp_overload_set.value] +// CHECK:STDOUT: %bound_method.loc10: = bound_method %v.ref.loc10, %const_this.ref.loc10 +// CHECK:STDOUT: %const_this__carbon_thunk.call.loc10: init %empty_tuple.type = call imports.%const_this__carbon_thunk.decl(%v.ref.loc10) +// CHECK:STDOUT: %v.ref.loc11: %HasQualifiers = name_ref v, %v +// CHECK:STDOUT: %const_ref_this.ref.loc11: %HasQualifiers.const_ref_this.cpp_overload_set.type = name_ref const_ref_this, imports.%HasQualifiers.const_ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_ref_this.cpp_overload_set.value] +// CHECK:STDOUT: %bound_method.loc11: = bound_method %v.ref.loc11, %const_ref_this.ref.loc11 +// CHECK:STDOUT: %const_ref_this__carbon_thunk.call.loc11: init %empty_tuple.type = call imports.%const_ref_this__carbon_thunk.decl(%v.ref.loc11) +// CHECK:STDOUT: %v.ref.loc12: %HasQualifiers = name_ref v, %v +// CHECK:STDOUT: %const_ref_ref_this.ref.loc12: %HasQualifiers.const_ref_ref_this.cpp_overload_set.type = name_ref const_ref_ref_this, imports.%HasQualifiers.const_ref_ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_ref_ref_this.cpp_overload_set.value] +// CHECK:STDOUT: %bound_method.loc12: = bound_method %v.ref.loc12, %const_ref_ref_this.ref.loc12 +// CHECK:STDOUT: %const_ref_ref_this__carbon_thunk.call.loc12: init %empty_tuple.type = call imports.%const_ref_ref_this__carbon_thunk.decl(%v.ref.loc12) // CHECK:STDOUT: %p.ref.loc14: %ptr.ec3 = name_ref p, %p -// CHECK:STDOUT: %.loc14_4.1: ref %HasQualifiers = deref %p.ref.loc14 -// CHECK:STDOUT: %const_this.ref.loc14: %HasQualifiers.const_this.cpp_overload_set.type = name_ref const_this, imports.%HasQualifiers.const_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_this.cpp_overload_set.value] -// CHECK:STDOUT: %bound_method.loc14: = bound_method %.loc14_4.1, %const_this.ref.loc14 -// CHECK:STDOUT: %.loc14_4.2: %HasQualifiers = acquire_value %.loc14_4.1 -// CHECK:STDOUT: %const_this__carbon_thunk.call.loc14: init %empty_tuple.type = call imports.%const_this__carbon_thunk.decl(%.loc14_4.2) +// CHECK:STDOUT: %.loc14: ref %HasQualifiers = deref %p.ref.loc14 +// CHECK:STDOUT: %plain.ref.loc14: %HasQualifiers.plain.cpp_overload_set.type = name_ref plain, imports.%HasQualifiers.plain.cpp_overload_set.value [concrete = constants.%HasQualifiers.plain.cpp_overload_set.value] +// CHECK:STDOUT: %bound_method.loc14: = bound_method %.loc14, %plain.ref.loc14 +// CHECK:STDOUT: %HasQualifiers.plain.call.loc14: init %empty_tuple.type = call imports.%HasQualifiers.plain.decl(%.loc14) // CHECK:STDOUT: %p.ref.loc15: %ptr.ec3 = name_ref p, %p -// CHECK:STDOUT: %.loc15_4.1: ref %HasQualifiers = deref %p.ref.loc15 -// CHECK:STDOUT: %const_ref_this.ref.loc15: %HasQualifiers.const_ref_this.cpp_overload_set.type = name_ref const_ref_this, imports.%HasQualifiers.const_ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_ref_this.cpp_overload_set.value] -// CHECK:STDOUT: %bound_method.loc15: = bound_method %.loc15_4.1, %const_ref_this.ref.loc15 -// CHECK:STDOUT: %.loc15_4.2: %HasQualifiers = acquire_value %.loc15_4.1 -// CHECK:STDOUT: %const_ref_this__carbon_thunk.call.loc15: init %empty_tuple.type = call imports.%const_ref_this__carbon_thunk.decl(%.loc15_4.2) +// CHECK:STDOUT: %.loc15: ref %HasQualifiers = deref %p.ref.loc15 +// CHECK:STDOUT: %ref_this.ref: %HasQualifiers.ref_this.cpp_overload_set.type = name_ref ref_this, imports.%HasQualifiers.ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.ref_this.cpp_overload_set.value] +// CHECK:STDOUT: %bound_method.loc15: = bound_method %.loc15, %ref_this.ref +// CHECK:STDOUT: %HasQualifiers.ref_this.call: init %empty_tuple.type = call imports.%HasQualifiers.ref_this.decl(%.loc15) +// CHECK:STDOUT: %p.ref.loc16: %ptr.ec3 = name_ref p, %p +// CHECK:STDOUT: %.loc16_4.1: ref %HasQualifiers = deref %p.ref.loc16 +// CHECK:STDOUT: %const_this.ref.loc16: %HasQualifiers.const_this.cpp_overload_set.type = name_ref const_this, imports.%HasQualifiers.const_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_this.cpp_overload_set.value] +// CHECK:STDOUT: %bound_method.loc16: = bound_method %.loc16_4.1, %const_this.ref.loc16 +// CHECK:STDOUT: %.loc16_4.2: %HasQualifiers = acquire_value %.loc16_4.1 +// CHECK:STDOUT: %const_this__carbon_thunk.call.loc16: init %empty_tuple.type = call imports.%const_this__carbon_thunk.decl(%.loc16_4.2) +// CHECK:STDOUT: %p.ref.loc17: %ptr.ec3 = name_ref p, %p +// CHECK:STDOUT: %.loc17_4.1: ref %HasQualifiers = deref %p.ref.loc17 +// CHECK:STDOUT: %const_ref_this.ref.loc17: %HasQualifiers.const_ref_this.cpp_overload_set.type = name_ref const_ref_this, imports.%HasQualifiers.const_ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_ref_this.cpp_overload_set.value] +// CHECK:STDOUT: %bound_method.loc17: = bound_method %.loc17_4.1, %const_ref_this.ref.loc17 +// CHECK:STDOUT: %.loc17_4.2: %HasQualifiers = acquire_value %.loc17_4.1 +// CHECK:STDOUT: %const_ref_this__carbon_thunk.call.loc17: init %empty_tuple.type = call imports.%const_ref_this__carbon_thunk.decl(%.loc17_4.2) +// CHECK:STDOUT: %Make.ref.loc19: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] +// CHECK:STDOUT: %.loc19_8.1: ref %HasQualifiers = temporary_storage +// CHECK:STDOUT: %Make.call.loc19: init %HasQualifiers to %.loc19_8.1 = call %Make.ref.loc19() +// CHECK:STDOUT: %.loc19_8.2: ref %HasQualifiers = temporary %.loc19_8.1, %Make.call.loc19 +// CHECK:STDOUT: %plain.ref.loc19: %HasQualifiers.plain.cpp_overload_set.type = name_ref plain, imports.%HasQualifiers.plain.cpp_overload_set.value [concrete = constants.%HasQualifiers.plain.cpp_overload_set.value] +// CHECK:STDOUT: %bound_method.loc19: = bound_method %.loc19_8.2, %plain.ref.loc19 +// CHECK:STDOUT: %HasQualifiers.plain.call.loc19: init %empty_tuple.type = call imports.%HasQualifiers.plain.decl(%.loc19_8.2) +// CHECK:STDOUT: %Make.ref.loc20: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] +// CHECK:STDOUT: %.loc20_8.1: ref %HasQualifiers = temporary_storage +// CHECK:STDOUT: %Make.call.loc20: init %HasQualifiers to %.loc20_8.1 = call %Make.ref.loc20() +// CHECK:STDOUT: %.loc20_8.2: ref %HasQualifiers = temporary %.loc20_8.1, %Make.call.loc20 +// CHECK:STDOUT: %const_this.ref.loc20: %HasQualifiers.const_this.cpp_overload_set.type = name_ref const_this, imports.%HasQualifiers.const_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_this.cpp_overload_set.value] +// CHECK:STDOUT: %bound_method.loc20: = bound_method %.loc20_8.2, %const_this.ref.loc20 +// CHECK:STDOUT: %.loc20_8.3: %HasQualifiers = acquire_value %.loc20_8.2 +// CHECK:STDOUT: %const_this__carbon_thunk.call.loc20: init %empty_tuple.type = call imports.%const_this__carbon_thunk.decl(%.loc20_8.3) +// CHECK:STDOUT: %Make.ref.loc21: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] +// CHECK:STDOUT: %.loc21_8.1: ref %HasQualifiers = temporary_storage +// CHECK:STDOUT: %Make.call.loc21: init %HasQualifiers to %.loc21_8.1 = call %Make.ref.loc21() +// CHECK:STDOUT: %.loc21_8.2: ref %HasQualifiers = temporary %.loc21_8.1, %Make.call.loc21 +// CHECK:STDOUT: %const_ref_this.ref.loc21: %HasQualifiers.const_ref_this.cpp_overload_set.type = name_ref const_ref_this, imports.%HasQualifiers.const_ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_ref_this.cpp_overload_set.value] +// CHECK:STDOUT: %bound_method.loc21: = bound_method %.loc21_8.2, %const_ref_this.ref.loc21 +// CHECK:STDOUT: %.loc21_8.3: %HasQualifiers = acquire_value %.loc21_8.2 +// CHECK:STDOUT: %const_ref_this__carbon_thunk.call.loc21: init %empty_tuple.type = call imports.%const_ref_this__carbon_thunk.decl(%.loc21_8.3) +// CHECK:STDOUT: %Make.ref.loc22: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] +// CHECK:STDOUT: %.loc22_8.1: ref %HasQualifiers = temporary_storage +// CHECK:STDOUT: %Make.call.loc22: init %HasQualifiers to %.loc22_8.1 = call %Make.ref.loc22() +// CHECK:STDOUT: %.loc22_8.2: ref %HasQualifiers = temporary %.loc22_8.1, %Make.call.loc22 +// CHECK:STDOUT: %ref_ref_this.ref: %HasQualifiers.ref_ref_this.cpp_overload_set.type = name_ref ref_ref_this, imports.%HasQualifiers.ref_ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.ref_ref_this.cpp_overload_set.value] +// CHECK:STDOUT: %bound_method.loc22_9: = bound_method %.loc22_8.2, %ref_ref_this.ref +// CHECK:STDOUT: %.loc22_8.3: %HasQualifiers = acquire_value %.loc22_8.2 +// CHECK:STDOUT: +// CHECK:STDOUT: %impl.elem0.loc22: %.f42 = impl_witness_access constants.%custom_witness.dbb, element0 [concrete = constants.%HasQualifiers.Op.567da9.1] +// CHECK:STDOUT: %bound_method.loc22_8: = bound_method %.loc22_8.3, %impl.elem0.loc22 +// CHECK:STDOUT: %.loc22_8.4: ref %HasQualifiers = temporary_storage +// CHECK:STDOUT: %Op.ref.loc22_8.1: %HasQualifiers.HasQualifiers.type = name_ref Op, imports.%HasQualifiers.HasQualifiers.decl [concrete = constants.%HasQualifiers.HasQualifiers] +// CHECK:STDOUT: +// CHECK:STDOUT: %.loc22_8.5: ref %HasQualifiers = value_as_ref %.loc22_8.3 +// CHECK:STDOUT: %addr.loc22_8.1: %ptr.ec3 = addr_of %.loc22_8.5 +// CHECK:STDOUT: %.loc22_8.6: %ptr.2cb = as_compatible %addr.loc22_8.1 +// CHECK:STDOUT: %.loc22_8.7: %ptr.2cb = converted %addr.loc22_8.1, %.loc22_8.6 +// CHECK:STDOUT: %addr.loc22_8.2: %ptr.ec3 = addr_of %self.var +// CHECK:STDOUT: %HasQualifiers__carbon_thunk.call: init %empty_tuple.type = call imports.%HasQualifiers__carbon_thunk.decl(%.loc22_8.7, %addr.loc22_8.2) +// CHECK:STDOUT: %.loc22_8.8: init %HasQualifiers to %self.var = mark_in_place_init %HasQualifiers__carbon_thunk.call +// CHECK:STDOUT: +// CHECK:STDOUT: %ref_ref_this__carbon_thunk.call: init %empty_tuple.type = call imports.%ref_ref_this__carbon_thunk.decl(%self.var) +// CHECK:STDOUT: %Make.ref.loc23: %Make.type = name_ref Make, file.%Make.decl [concrete = constants.%Make] +// CHECK:STDOUT: %.loc23_8.1: ref %HasQualifiers = temporary_storage +// CHECK:STDOUT: %Make.call.loc23: init %HasQualifiers to %.loc23_8.1 = call %Make.ref.loc23() +// CHECK:STDOUT: %.loc23_8.2: ref %HasQualifiers = temporary %.loc23_8.1, %Make.call.loc23 +// CHECK:STDOUT: %const_ref_ref_this.ref.loc23: %HasQualifiers.const_ref_ref_this.cpp_overload_set.type = name_ref const_ref_ref_this, imports.%HasQualifiers.const_ref_ref_this.cpp_overload_set.value [concrete = constants.%HasQualifiers.const_ref_ref_this.cpp_overload_set.value] +// CHECK:STDOUT: %bound_method.loc23: = bound_method %.loc23_8.2, %const_ref_ref_this.ref.loc23 +// CHECK:STDOUT: %.loc23_8.3: %HasQualifiers = acquire_value %.loc23_8.2 +// CHECK:STDOUT: %const_ref_ref_this__carbon_thunk.call.loc23: init %empty_tuple.type = call imports.%const_ref_ref_this__carbon_thunk.decl(%.loc23_8.3) +// CHECK:STDOUT: +// CHECK:STDOUT: %HasQualifiers.Op.bound.loc23: = bound_method %.loc23_8.2, constants.%HasQualifiers.Op.567da9.2 +// CHECK:STDOUT: %Op.ref.loc23: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor] +// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc23: = bound_method %.loc23_8.2, %Op.ref.loc23 +// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc23: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc23(%.loc23_8.2) +// CHECK:STDOUT: +// CHECK:STDOUT: %HasQualifiers.Op.bound.loc22: = bound_method %.loc22_8.2, constants.%HasQualifiers.Op.567da9.2 +// CHECK:STDOUT: %Op.ref.loc22_8.2: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor] +// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc22: = bound_method %.loc22_8.2, %Op.ref.loc22_8.2 +// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc22: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc22(%.loc22_8.2) +// CHECK:STDOUT: %HasQualifiers.Op.bound.loc21: = bound_method %.loc21_8.2, constants.%HasQualifiers.Op.567da9.2 +// CHECK:STDOUT: %Op.ref.loc21: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor] +// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc21: = bound_method %.loc21_8.2, %Op.ref.loc21 +// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc21: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc21(%.loc21_8.2) +// CHECK:STDOUT: %HasQualifiers.Op.bound.loc20: = bound_method %.loc20_8.2, constants.%HasQualifiers.Op.567da9.2 +// CHECK:STDOUT: %Op.ref.loc20: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor] +// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc20: = bound_method %.loc20_8.2, %Op.ref.loc20 +// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc20: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc20(%.loc20_8.2) +// CHECK:STDOUT: %HasQualifiers.Op.bound.loc19: = bound_method %.loc19_8.2, constants.%HasQualifiers.Op.567da9.2 +// CHECK:STDOUT: %Op.ref.loc19: %HasQualifiers.cpp_destructor.type = name_ref Op, imports.%HasQualifiers.cpp_destructor.decl [concrete = constants.%HasQualifiers.cpp_destructor] +// CHECK:STDOUT: %HasQualifiers.cpp_destructor.bound.loc19: = bound_method %.loc19_8.2, %Op.ref.loc19 +// CHECK:STDOUT: %HasQualifiers.cpp_destructor.call.loc19: init %empty_tuple.type = call %HasQualifiers.cpp_destructor.bound.loc19(%.loc19_8.2) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: @@ -351,7 +490,6 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %NoRefQualifier: type = class_type @NoRefQualifier [concrete] -// CHECK:STDOUT: %pattern_type.a91: type = pattern_type %NoRefQualifier [concrete] // CHECK:STDOUT: %ptr.2a2: type = ptr_type %NoRefQualifier [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] @@ -370,7 +508,6 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: %Destroy.Op.type.bae255.3: type = fn_type @Destroy.Op.loc8_3.2 [concrete] // CHECK:STDOUT: %Destroy.Op.651ba6.3: %Destroy.Op.type.bae255.3 = struct_value () [concrete] // CHECK:STDOUT: %WithRefQualifier: type = class_type @WithRefQualifier [concrete] -// CHECK:STDOUT: %pattern_type.4ed: type = pattern_type %WithRefQualifier [concrete] // CHECK:STDOUT: %ptr.c86: type = ptr_type %WithRefQualifier [concrete] // CHECK:STDOUT: %WithRefQualifier.F.cpp_overload_set.type: type = cpp_overload_set_type @WithRefQualifier.F.cpp_overload_set [concrete] // CHECK:STDOUT: %WithRefQualifier.F.cpp_overload_set.value: %WithRefQualifier.F.cpp_overload_set.type = cpp_overload_set_value @WithRefQualifier.F.cpp_overload_set [concrete] @@ -388,14 +525,9 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %NoRefQualifier.F.decl.3dba03.2: %NoRefQualifier.F.type.b65611.2 = fn_decl @NoRefQualifier.F.2 [concrete = constants.%NoRefQualifier.F.d50a5a.2] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.a91 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.a91 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: // CHECK:STDOUT: } { // CHECK:STDOUT: -// CHECK:STDOUT: %self.param: ref %NoRefQualifier = ref_param call_param0 -// CHECK:STDOUT: %self: ref %NoRefQualifier = ref_binding self, %self.param -// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %WithRefQualifier.F.cpp_overload_set.value: %WithRefQualifier.F.cpp_overload_set.type = cpp_overload_set_value @WithRefQualifier.F.cpp_overload_set [concrete = constants.%WithRefQualifier.F.cpp_overload_set.value] // CHECK:STDOUT: %F__carbon_thunk.decl.e1b8ec.2: %F__carbon_thunk.type.eda1ac.2 = fn_decl @F__carbon_thunk.2 [concrete = constants.%F__carbon_thunk.0cd6a8.2] { @@ -404,14 +536,9 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %WithRefQualifier.F.decl.e3f32b.2: %WithRefQualifier.F.type.7c19e2.2 = fn_decl @WithRefQualifier.F.2 [concrete = constants.%WithRefQualifier.F.d90b51.2] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.4ed = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.4ed = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: // CHECK:STDOUT: } { // CHECK:STDOUT: -// CHECK:STDOUT: %self.param: ref %WithRefQualifier = ref_param call_param0 -// CHECK:STDOUT: %self: ref %WithRefQualifier = ref_binding self, %self.param -// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -505,7 +632,6 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: %ExplicitObjectParam: type = class_type @ExplicitObjectParam [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] -// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Another: type = class_type @Another [concrete] // CHECK:STDOUT: %ExplicitObjectParam.F.cpp_overload_set.type: type = cpp_overload_set_type @ExplicitObjectParam.F.cpp_overload_set [concrete] // CHECK:STDOUT: %ExplicitObjectParam.F.cpp_overload_set.value: %ExplicitObjectParam.F.cpp_overload_set.type = cpp_overload_set_value @ExplicitObjectParam.F.cpp_overload_set [concrete] @@ -539,12 +665,9 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: } // CHECK:STDOUT: %ExplicitObjectParam.G.cpp_overload_set.value: %ExplicitObjectParam.G.cpp_overload_set.type = cpp_overload_set_value @ExplicitObjectParam.G.cpp_overload_set [concrete = constants.%ExplicitObjectParam.G.cpp_overload_set.value] // CHECK:STDOUT: %ExplicitObjectParam.G.decl: %ExplicitObjectParam.G.type = fn_decl @ExplicitObjectParam.G [concrete = constants.%ExplicitObjectParam.G] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.7ce = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.7ce = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %i32 = value_param call_param0 // CHECK:STDOUT: -// CHECK:STDOUT: %self: %i32 = value_binding self, %self.param +// CHECK:STDOUT: } { +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %ExplicitObjectParam.H.cpp_overload_set.value: %ExplicitObjectParam.H.cpp_overload_set.type = cpp_overload_set_value @ExplicitObjectParam.H.cpp_overload_set [concrete = constants.%ExplicitObjectParam.H.cpp_overload_set.value] // CHECK:STDOUT: %H__carbon_thunk.decl: %H__carbon_thunk.type = fn_decl @H__carbon_thunk [concrete = constants.%H__carbon_thunk] { @@ -586,7 +709,6 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: %ExplicitObjectParam: type = class_type @ExplicitObjectParam [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] -// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] // CHECK:STDOUT: %Another: type = class_type @Another [concrete] // CHECK:STDOUT: %ExplicitObjectParam.F.cpp_overload_set.type: type = cpp_overload_set_type @ExplicitObjectParam.F.cpp_overload_set [concrete] // CHECK:STDOUT: %ExplicitObjectParam.F.cpp_overload_set.value: %ExplicitObjectParam.F.cpp_overload_set.type = cpp_overload_set_value @ExplicitObjectParam.F.cpp_overload_set [concrete] @@ -615,12 +737,9 @@ fn Call(e: Cpp.ExplicitObjectParam, n: i32, a: Cpp.Another) { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %ExplicitObjectParam.F.decl.28f5af.2: %ExplicitObjectParam.F.type.5d25a8.2 = fn_decl @ExplicitObjectParam.F.2 [concrete = constants.%ExplicitObjectParam.F.28cf2e.2] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.7ce = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.7ce = at_binding_pattern self, %self.param_patt [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %i32 = value_param call_param0 // CHECK:STDOUT: -// CHECK:STDOUT: %self: %i32 = value_binding self, %self.param +// CHECK:STDOUT: } { +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %F__carbon_thunk.decl.e1b8ec.2: %F__carbon_thunk.type.eda1ac.2 = fn_decl @F__carbon_thunk.2 [concrete = constants.%F__carbon_thunk.0cd6a8.2] { // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/enum/anonymous.carbon b/toolchain/check/testdata/interop/cpp/enum/anonymous.carbon index f230d2b42ea8..7dd859fccf47 100644 --- a/toolchain/check/testdata/interop/cpp/enum/anonymous.carbon +++ b/toolchain/check/testdata/interop/cpp/enum/anonymous.carbon @@ -52,7 +52,6 @@ fn G() { // CHECK:STDOUT: %C: type = class_type @C [concrete] // CHECK:STDOUT: %C.C.cpp_overload_set.type: type = cpp_overload_set_type @C.C.cpp_overload_set [concrete] // CHECK:STDOUT: %C.C.cpp_overload_set.value: %C.C.cpp_overload_set.type = cpp_overload_set_value @C.C.cpp_overload_set [concrete] -// CHECK:STDOUT: %pattern_type.217: type = pattern_type %C [concrete] // CHECK:STDOUT: %ptr.d9e: type = ptr_type %C [concrete] // CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete] // CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete] @@ -90,12 +89,8 @@ fn G() { // CHECK:STDOUT: %C.F.cpp_overload_set.value: %C.F.cpp_overload_set.type = cpp_overload_set_value @C.F.cpp_overload_set [concrete = constants.%C.F.cpp_overload_set.value] // CHECK:STDOUT: %int_1.1d6: %.bb7 = int_value 1 [concrete = constants.%int_1.1d6] // CHECK:STDOUT: %C.F.decl: %C.F.type = fn_decl @C.F [concrete = constants.%C.F] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.217 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.217 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 -// CHECK:STDOUT: %self: ref %C = ref_binding self, %self.param // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/function/import/default_arg.carbon b/toolchain/check/testdata/interop/cpp/function/import/default_arg.carbon index 4c6b6c928f3a..e15ce81a3640 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/default_arg.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/default_arg.carbon @@ -185,7 +185,6 @@ fn Call() { // CHECK:STDOUT: %X.B.cpp_overload_set.type: type = cpp_overload_set_type @X.B.cpp_overload_set [concrete] // CHECK:STDOUT: %X.B.cpp_overload_set.value: %X.B.cpp_overload_set.type = cpp_overload_set_value @X.B.cpp_overload_set [concrete] // CHECK:STDOUT: %bound_method.a5d: = bound_method %.3af, %X.B.cpp_overload_set.value [concrete] -// CHECK:STDOUT: %pattern_type.46b: type = pattern_type %X [concrete] // CHECK:STDOUT: %X.B.type: type = fn_type @X.B [concrete] // CHECK:STDOUT: %X.B: %X.B.type = struct_value () [concrete] // CHECK:STDOUT: %X.C.cpp_overload_set.type: type = cpp_overload_set_type @X.C.cpp_overload_set [concrete] @@ -226,12 +225,8 @@ fn Call() { // CHECK:STDOUT: %X.decl: type = class_decl @X [concrete = constants.%X] {} {} // CHECK:STDOUT: %X.B.cpp_overload_set.value: %X.B.cpp_overload_set.type = cpp_overload_set_value @X.B.cpp_overload_set [concrete = constants.%X.B.cpp_overload_set.value] // CHECK:STDOUT: %X.B.decl: %X.B.type = fn_decl @X.B [concrete = constants.%X.B] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.46b = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.46b = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 -// CHECK:STDOUT: %self: ref %X = ref_binding self, %self.param // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %X.C.cpp_overload_set.value: %X.C.cpp_overload_set.type = cpp_overload_set_value @X.C.cpp_overload_set [concrete = constants.%X.C.cpp_overload_set.value] @@ -247,11 +242,9 @@ fn Call() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %X.cpp_destructor.decl: %X.cpp_destructor.type = fn_decl @X.cpp_destructor [concrete = constants.%X.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.46b = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.46b = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 -// CHECK:STDOUT: %self: ref %X = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -865,7 +858,6 @@ fn Call() { // CHECK:STDOUT: %X.D.cpp_overload_set.type: type = cpp_overload_set_type @X.D.cpp_overload_set [concrete] // CHECK:STDOUT: %X.D.cpp_overload_set.value: %X.D.cpp_overload_set.type = cpp_overload_set_value @X.D.cpp_overload_set [concrete] // CHECK:STDOUT: %bound_method.d5c: = bound_method %.3af, %X.D.cpp_overload_set.value [concrete] -// CHECK:STDOUT: %pattern_type.46b: type = pattern_type %X [concrete] // CHECK:STDOUT: %X.cpp_destructor.type: type = fn_type @X.cpp_destructor [concrete] // CHECK:STDOUT: %X.cpp_destructor: %X.cpp_destructor.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -884,11 +876,9 @@ fn Call() { // CHECK:STDOUT: %X.C.cpp_overload_set.value: %X.C.cpp_overload_set.type = cpp_overload_set_value @X.C.cpp_overload_set [concrete = constants.%X.C.cpp_overload_set.value] // CHECK:STDOUT: %X.D.cpp_overload_set.value: %X.D.cpp_overload_set.type = cpp_overload_set_value @X.D.cpp_overload_set [concrete = constants.%X.D.cpp_overload_set.value] // CHECK:STDOUT: %X.cpp_destructor.decl: %X.cpp_destructor.type = fn_decl @X.cpp_destructor [concrete = constants.%X.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.46b = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.46b = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %X = ref_param call_param0 -// CHECK:STDOUT: %self: ref %X = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/import/reference.carbon b/toolchain/check/testdata/interop/cpp/function/import/reference.carbon index 2680cda96d8f..5f8cb5439cc6 100644 --- a/toolchain/check/testdata/interop/cpp/function/import/reference.carbon +++ b/toolchain/check/testdata/interop/cpp/function/import/reference.carbon @@ -532,7 +532,6 @@ fn F() { // CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete] // CHECK:STDOUT: %TakesRValue__carbon_thunk.type: type = fn_type @TakesRValue__carbon_thunk [concrete] // CHECK:STDOUT: %TakesRValue__carbon_thunk: %TakesRValue__carbon_thunk.type = struct_value () [concrete] -// CHECK:STDOUT: %.6ef: ref %S = temporary invalid, %S.val [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -557,13 +556,11 @@ fn F() { // CHECK:STDOUT: %.loc8_20.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %Cpp.ref.loc8_25: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S] -// CHECK:STDOUT: %.loc8_20.2: ref %S = temporary_storage -// CHECK:STDOUT: %.loc8_20.3: init %S to %.loc8_20.2 = class_init () [concrete = constants.%S.val] -// CHECK:STDOUT: %.loc8_22.1: init %S = converted %.loc8_20.1, %.loc8_20.3 [concrete = constants.%S.val] -// CHECK:STDOUT: %.loc8_22.2: ref %S = temporary %.loc8_20.2, %.loc8_22.1 [concrete = constants.%.6ef] -// CHECK:STDOUT: %.loc8_22.3: %S = acquire_value %.loc8_22.2 [concrete = constants.%S.val] -// CHECK:STDOUT: %.loc8_22.4: ref %S = value_as_ref %.loc8_22.3 -// CHECK:STDOUT: %addr: %ptr.5c7 = addr_of %.loc8_22.4 +// CHECK:STDOUT: +// CHECK:STDOUT: %.loc8_20.2: init %S to %_.var = class_init () [concrete = constants.%S.val] +// CHECK:STDOUT: %.loc8_22: init %S = converted %.loc8_20.1, %.loc8_20.2 [concrete = constants.%S.val] +// CHECK:STDOUT: +// CHECK:STDOUT: %addr: %ptr.5c7 = addr_of %_.var // CHECK:STDOUT: %TakesRValue__carbon_thunk.call: init %empty_tuple.type = call imports.%TakesRValue__carbon_thunk.decl(%addr) // CHECK:STDOUT: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/impls/as.carbon b/toolchain/check/testdata/interop/cpp/impls/as.carbon index ca1a534e41c2..fe0147cc4b00 100644 --- a/toolchain/check/testdata/interop/cpp/impls/as.carbon +++ b/toolchain/check/testdata/interop/cpp/impls/as.carbon @@ -134,9 +134,7 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Source: type = class_type @Source [concrete] -// CHECK:STDOUT: %pattern_type.78c: type = pattern_type %Source [concrete] // CHECK:STDOUT: %Dest: type = class_type @Dest [concrete] -// CHECK:STDOUT: %pattern_type.69a: type = pattern_type %Dest [concrete] // CHECK:STDOUT: %Source.cpp_operator.type: type = fn_type @Source.cpp_operator [concrete] // CHECK:STDOUT: %Source.cpp_operator: %Source.cpp_operator.type = struct_value () [concrete] // CHECK:STDOUT: %ptr.551: type = ptr_type %Dest [concrete] @@ -148,7 +146,6 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %Dest.Op: %Dest.Op.type = struct_value () [concrete] // CHECK:STDOUT: %Source2: type = class_type @Source2 [concrete] // CHECK:STDOUT: %Dest2: type = class_type @Dest2 [concrete] -// CHECK:STDOUT: %pattern_type.39d: type = pattern_type %Dest2 [concrete] // CHECK:STDOUT: %ptr.472: type = ptr_type %Source2 [concrete] // CHECK:STDOUT: %ptr.9ae: type = ptr_type %Dest2 [concrete] // CHECK:STDOUT: %Dest2__carbon_thunk.type: type = fn_type @Dest2__carbon_thunk [concrete] @@ -158,7 +155,6 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %Dest2.Op.type: type = fn_type @Dest2.Op [concrete] // CHECK:STDOUT: %Dest2.Op: %Dest2.Op.type = struct_value () [concrete] // CHECK:STDOUT: %ExplicitConstructor: type = class_type @ExplicitConstructor [concrete] -// CHECK:STDOUT: %pattern_type.1eb: type = pattern_type %ExplicitConstructor [concrete] // CHECK:STDOUT: %ptr.1fc: type = ptr_type %Source [concrete] // CHECK:STDOUT: %ptr.5b5: type = ptr_type %ExplicitConstructor [concrete] // CHECK:STDOUT: %ExplicitConstructor__carbon_thunk.type: type = fn_type @ExplicitConstructor__carbon_thunk [concrete] @@ -168,7 +164,6 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %ExplicitConstructor.Op.type: type = fn_type @ExplicitConstructor.Op [concrete] // CHECK:STDOUT: %ExplicitConstructor.Op: %ExplicitConstructor.Op.type = struct_value () [concrete] // CHECK:STDOUT: %ExplicitConversion: type = class_type @ExplicitConversion [concrete] -// CHECK:STDOUT: %pattern_type.a70: type = pattern_type %ExplicitConversion [concrete] // CHECK:STDOUT: %ExplicitConversion.cpp_operator.type: type = fn_type @ExplicitConversion.cpp_operator [concrete] // CHECK:STDOUT: %ExplicitConversion.cpp_operator: %ExplicitConversion.cpp_operator.type = struct_value () [concrete] // CHECK:STDOUT: %Dest__carbon_thunk.type.2ffc9e.2: type = fn_type @Dest__carbon_thunk.2 [concrete] @@ -188,12 +183,8 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %Source.decl: type = class_decl @Source [concrete = constants.%Source] {} {} // CHECK:STDOUT: %Dest.decl: type = class_decl @Dest [concrete = constants.%Dest] {} {} // CHECK:STDOUT: %Source.cpp_operator.decl: %Source.cpp_operator.type = fn_decl @Source.cpp_operator [concrete = constants.%Source.cpp_operator] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.78c = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.78c = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %Source = value_param call_param0 -// CHECK:STDOUT: %self: %Source = value_binding self, %self.param // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Dest__carbon_thunk.decl.b58ecd.1: %Dest__carbon_thunk.type.2ffc9e.1 = fn_decl @Dest__carbon_thunk.1 [concrete = constants.%Dest__carbon_thunk.f8fa06.1] { @@ -202,11 +193,9 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Dest.cpp_destructor.decl: %Dest.cpp_destructor.type = fn_decl @Dest.cpp_destructor [concrete = constants.%Dest.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.69a = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.69a = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %Dest = ref_param call_param0 -// CHECK:STDOUT: %self: ref %Dest = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Source2.decl: type = class_decl @Source2 [concrete = constants.%Source2] {} {} // CHECK:STDOUT: %Dest2.decl: type = class_decl @Dest2 [concrete = constants.%Dest2] {} {} @@ -216,11 +205,9 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Dest2.cpp_destructor.decl: %Dest2.cpp_destructor.type = fn_decl @Dest2.cpp_destructor [concrete = constants.%Dest2.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.39d = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.39d = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %Dest2 = ref_param call_param0 -// CHECK:STDOUT: %self: ref %Dest2 = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %ExplicitConstructor.decl: type = class_decl @ExplicitConstructor [concrete = constants.%ExplicitConstructor] {} {} // CHECK:STDOUT: %ExplicitConstructor__carbon_thunk.decl: %ExplicitConstructor__carbon_thunk.type = fn_decl @ExplicitConstructor__carbon_thunk [concrete = constants.%ExplicitConstructor__carbon_thunk] { @@ -229,20 +216,14 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %ExplicitConstructor.cpp_destructor.decl: %ExplicitConstructor.cpp_destructor.type = fn_decl @ExplicitConstructor.cpp_destructor [concrete = constants.%ExplicitConstructor.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.1eb = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.1eb = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %ExplicitConstructor = ref_param call_param0 -// CHECK:STDOUT: %self: ref %ExplicitConstructor = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %ExplicitConversion.decl: type = class_decl @ExplicitConversion [concrete = constants.%ExplicitConversion] {} {} // CHECK:STDOUT: %ExplicitConversion.cpp_operator.decl: %ExplicitConversion.cpp_operator.type = fn_decl @ExplicitConversion.cpp_operator [concrete = constants.%ExplicitConversion.cpp_operator] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.a70 = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.a70 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %ExplicitConversion = value_param call_param0 -// CHECK:STDOUT: %self: %ExplicitConversion = value_binding self, %self.param // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Dest__carbon_thunk.decl.b58ecd.2: %Dest__carbon_thunk.type.2ffc9e.2 = fn_decl @Dest__carbon_thunk.2 [concrete = constants.%Dest__carbon_thunk.f8fa06.2] { @@ -349,7 +330,6 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %ConditionallyExplicit.Op.type.6a678d.1: type = fn_type @ConditionallyExplicit.Op.1 [concrete] // CHECK:STDOUT: %ConditionallyExplicit.Op.c4e51d.1: %ConditionallyExplicit.Op.type.6a678d.1 = struct_value () [concrete] // CHECK:STDOUT: %ConditionallyExplicit.c52b91.2: type = class_type @ConditionallyExplicit.2 [concrete] -// CHECK:STDOUT: %pattern_type.285f84.2: type = pattern_type %ConditionallyExplicit.c52b91.2 [concrete] // CHECK:STDOUT: %ptr.ca4178.2: type = ptr_type %ConditionallyExplicit.c52b91.2 [concrete] // CHECK:STDOUT: %ConditionallyExplicit__carbon_thunk.type.805b57.2: type = fn_type @ConditionallyExplicit__carbon_thunk.2 [concrete] // CHECK:STDOUT: %ConditionallyExplicit__carbon_thunk.b68c64.2: %ConditionallyExplicit__carbon_thunk.type.805b57.2 = struct_value () [concrete] @@ -386,11 +366,9 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %ConditionallyExplicit.cpp_destructor.decl.a8c6bd.1: %ConditionallyExplicit.cpp_destructor.type.a865b6.1 = fn_decl @ConditionallyExplicit.cpp_destructor.1 [concrete = constants.%ConditionallyExplicit.cpp_destructor.1ba031.1] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.285f84.1 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.285f84.1 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %ConditionallyExplicit.c52b91.1 = ref_param call_param0 -// CHECK:STDOUT: %self: ref %ConditionallyExplicit.c52b91.1 = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %ConditionallyExplicit.decl.7acffe.2: type = class_decl @ConditionallyExplicit.2 [concrete = constants.%ConditionallyExplicit.c52b91.2] {} {} // CHECK:STDOUT: %ConditionallyExplicit__carbon_thunk.decl.22daaa.2: %ConditionallyExplicit__carbon_thunk.type.805b57.2 = fn_decl @ConditionallyExplicit__carbon_thunk.2 [concrete = constants.%ConditionallyExplicit__carbon_thunk.b68c64.2] { @@ -399,20 +377,14 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %ConditionallyExplicit.cpp_destructor.decl.a8c6bd.2: %ConditionallyExplicit.cpp_destructor.type.a865b6.2 = fn_decl @ConditionallyExplicit.cpp_destructor.2 [concrete = constants.%ConditionallyExplicit.cpp_destructor.1ba031.2] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.285f84.2 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.285f84.2 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %ConditionallyExplicit.c52b91.2 = ref_param call_param0 -// CHECK:STDOUT: %self: ref %ConditionallyExplicit.c52b91.2 = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Dest.decl: type = class_decl @Dest [concrete = constants.%Dest] {} {} // CHECK:STDOUT: %ConditionallyExplicit.cpp_operator.decl: %ConditionallyExplicit.cpp_operator.type = fn_decl @ConditionallyExplicit.cpp_operator [concrete = constants.%ConditionallyExplicit.cpp_operator] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.285f84.1 = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.285f84.1 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %ConditionallyExplicit.c52b91.1 = value_param call_param0 -// CHECK:STDOUT: %self: %ConditionallyExplicit.c52b91.1 = value_binding self, %self.param // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Dest__carbon_thunk.decl: %Dest__carbon_thunk.type = fn_decl @Dest__carbon_thunk [concrete = constants.%Dest__carbon_thunk] { @@ -421,11 +393,9 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Dest.cpp_destructor.decl: %Dest.cpp_destructor.type = fn_decl @Dest.cpp_destructor [concrete = constants.%Dest.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.69a = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.69a = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %Dest = ref_param call_param0 -// CHECK:STDOUT: %self: ref %Dest = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -561,7 +531,6 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %ConditionallyExplicit.c52b91.1: type = class_type @ConditionallyExplicit.1 [concrete] // CHECK:STDOUT: %pattern_type.285f84.1: type = pattern_type %ConditionallyExplicit.c52b91.1 [concrete] // CHECK:STDOUT: %ConditionallyExplicit.c52b91.2: type = class_type @ConditionallyExplicit.2 [concrete] -// CHECK:STDOUT: %pattern_type.285f84.2: type = pattern_type %ConditionallyExplicit.c52b91.2 [concrete] // CHECK:STDOUT: %Dest.5e7: type = class_type @Dest [concrete] // CHECK:STDOUT: %pattern_type.69a: type = pattern_type %Dest.5e7 [concrete] // CHECK:STDOUT: %ConditionallyExplicit.cpp_operator.type: type = fn_type @ConditionallyExplicit.cpp_operator [concrete] @@ -588,12 +557,8 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %ConditionallyExplicit.decl.7acffe.2: type = class_decl @ConditionallyExplicit.2 [concrete = constants.%ConditionallyExplicit.c52b91.2] {} {} // CHECK:STDOUT: %Dest.decl: type = class_decl @Dest [concrete = constants.%Dest.5e7] {} {} // CHECK:STDOUT: %ConditionallyExplicit.cpp_operator.decl: %ConditionallyExplicit.cpp_operator.type = fn_decl @ConditionallyExplicit.cpp_operator [concrete = constants.%ConditionallyExplicit.cpp_operator] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.285f84.2 = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.285f84.2 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %ConditionallyExplicit.c52b91.2 = value_param call_param0 -// CHECK:STDOUT: %self: %ConditionallyExplicit.c52b91.2 = value_binding self, %self.param // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Dest__carbon_thunk.decl: %Dest__carbon_thunk.type = fn_decl @Dest__carbon_thunk [concrete = constants.%Dest__carbon_thunk] { @@ -602,11 +567,9 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Dest.cpp_destructor.decl: %Dest.cpp_destructor.type = fn_decl @Dest.cpp_destructor [concrete = constants.%Dest.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.69a = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.69a = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %Dest.5e7 = ref_param call_param0 -// CHECK:STDOUT: %self: ref %Dest.5e7 = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/impls/implicit_as.carbon b/toolchain/check/testdata/interop/cpp/impls/implicit_as.carbon index 99a449bf8d05..a9168891a96a 100644 --- a/toolchain/check/testdata/interop/cpp/impls/implicit_as.carbon +++ b/toolchain/check/testdata/interop/cpp/impls/implicit_as.carbon @@ -416,7 +416,6 @@ fn InitFromStruct() { // CHECK:STDOUT: constants { // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Source: type = class_type @Source [concrete] -// CHECK:STDOUT: %pattern_type.78c: type = pattern_type %Source [concrete] // CHECK:STDOUT: %Dest: type = class_type @Dest [concrete] // CHECK:STDOUT: %pattern_type.69a: type = pattern_type %Dest [concrete] // CHECK:STDOUT: %Source.cpp_operator.type: type = fn_type @Source.cpp_operator [concrete] @@ -429,7 +428,6 @@ fn InitFromStruct() { // CHECK:STDOUT: %Dest.Op.type: type = fn_type @Dest.Op [concrete] // CHECK:STDOUT: %Dest.Op: %Dest.Op.type = struct_value () [concrete] // CHECK:STDOUT: %NonConstConversion.480: type = class_type @NonConstConversion.1 [concrete] -// CHECK:STDOUT: %pattern_type.b08: type = pattern_type %NonConstConversion.480 [concrete] // CHECK:STDOUT: %NonConstConversion.cpp_operator.type: type = fn_type @NonConstConversion.cpp_operator [concrete] // CHECK:STDOUT: %NonConstConversion.cpp_operator: %NonConstConversion.cpp_operator.type = struct_value () [concrete] // CHECK:STDOUT: %Dest__carbon_thunk.type.2ffc9e.2: type = fn_type @Dest__carbon_thunk.2 [concrete] @@ -459,12 +457,8 @@ fn InitFromStruct() { // CHECK:STDOUT: %Source.decl: type = class_decl @Source [concrete = constants.%Source] {} {} // CHECK:STDOUT: %Dest.decl: type = class_decl @Dest [concrete = constants.%Dest] {} {} // CHECK:STDOUT: %Source.cpp_operator.decl: %Source.cpp_operator.type = fn_decl @Source.cpp_operator [concrete = constants.%Source.cpp_operator] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.78c = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.78c = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %Source = value_param call_param0 -// CHECK:STDOUT: %self: %Source = value_binding self, %self.param // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Dest__carbon_thunk.decl.b58ecd.1: %Dest__carbon_thunk.type.2ffc9e.1 = fn_decl @Dest__carbon_thunk.1 [concrete = constants.%Dest__carbon_thunk.f8fa06.1] { @@ -473,20 +467,14 @@ fn InitFromStruct() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Dest.cpp_destructor.decl: %Dest.cpp_destructor.type = fn_decl @Dest.cpp_destructor [concrete = constants.%Dest.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.69a = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.69a = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %Dest = ref_param call_param0 -// CHECK:STDOUT: %self: ref %Dest = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %NonConstConversion.decl: type = class_decl @NonConstConversion.1 [concrete = constants.%NonConstConversion.480] {} {} // CHECK:STDOUT: %NonConstConversion.cpp_operator.decl: %NonConstConversion.cpp_operator.type = fn_decl @NonConstConversion.cpp_operator [concrete = constants.%NonConstConversion.cpp_operator] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.b08 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.b08 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %NonConstConversion.480 = ref_param call_param0 -// CHECK:STDOUT: %self: ref %NonConstConversion.480 = ref_binding self, %self.param // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Dest__carbon_thunk.decl.b58ecd.2: %Dest__carbon_thunk.type.2ffc9e.2 = fn_decl @Dest__carbon_thunk.2 [concrete = constants.%Dest__carbon_thunk.f8fa06.2] { @@ -502,11 +490,9 @@ fn InitFromStruct() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Dest2.cpp_destructor.decl: %Dest2.cpp_destructor.type = fn_decl @Dest2.cpp_destructor [concrete = constants.%Dest2.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.39d = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.39d = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %Dest2 = ref_param call_param0 -// CHECK:STDOUT: %self: ref %Dest2 = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -640,7 +626,6 @@ fn InitFromStruct() { // CHECK:STDOUT: %InaccessibleConstructor.Op.type: type = fn_type @InaccessibleConstructor.Op [concrete] // CHECK:STDOUT: %InaccessibleConstructor.Op: %InaccessibleConstructor.Op.type = struct_value () [concrete] // CHECK:STDOUT: %InaccessibleConversion: type = class_type @InaccessibleConversion [concrete] -// CHECK:STDOUT: %pattern_type.510: type = pattern_type %InaccessibleConversion [concrete] // CHECK:STDOUT: %Dest: type = class_type @Dest [concrete] // CHECK:STDOUT: %pattern_type.69a: type = pattern_type %Dest [concrete] // CHECK:STDOUT: %InaccessibleConversion.cpp_operator.type: type = fn_type @InaccessibleConversion.cpp_operator [concrete] @@ -670,21 +655,15 @@ fn InitFromStruct() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %InaccessibleConstructor.cpp_destructor.decl: %InaccessibleConstructor.cpp_destructor.type = fn_decl @InaccessibleConstructor.cpp_destructor [concrete = constants.%InaccessibleConstructor.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.b73 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.b73 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %InaccessibleConstructor = ref_param call_param0 -// CHECK:STDOUT: %self: ref %InaccessibleConstructor = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %InaccessibleConversion.decl: type = class_decl @InaccessibleConversion [concrete = constants.%InaccessibleConversion] {} {} // CHECK:STDOUT: %Dest.decl: type = class_decl @Dest [concrete = constants.%Dest] {} {} // CHECK:STDOUT: %InaccessibleConversion.cpp_operator.decl: %InaccessibleConversion.cpp_operator.type = fn_decl @InaccessibleConversion.cpp_operator [concrete = constants.%InaccessibleConversion.cpp_operator] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.510 = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.510 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: %InaccessibleConversion = value_param call_param0 -// CHECK:STDOUT: %self: %InaccessibleConversion = value_binding self, %self.param // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Dest__carbon_thunk.decl: %Dest__carbon_thunk.type = fn_decl @Dest__carbon_thunk [concrete = constants.%Dest__carbon_thunk] { @@ -693,11 +672,9 @@ fn InitFromStruct() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Dest.cpp_destructor.decl: %Dest.cpp_destructor.type = fn_decl @Dest.cpp_destructor [concrete = constants.%Dest.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.69a = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.69a = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %Dest = ref_param call_param0 -// CHECK:STDOUT: %self: ref %Dest = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -895,11 +872,9 @@ fn InitFromStruct() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %IntConstructor.cpp_destructor.decl: %IntConstructor.cpp_destructor.type = fn_decl @IntConstructor.cpp_destructor [concrete = constants.%IntConstructor.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.3c3 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.3c3 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %IntConstructor.f49 = ref_param call_param0 -// CHECK:STDOUT: %self: ref %IntConstructor.f49 = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -959,11 +934,9 @@ fn InitFromStruct() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %IntConstructor.cpp_destructor.decl: %IntConstructor.cpp_destructor.type = fn_decl @IntConstructor.cpp_destructor [concrete = constants.%IntConstructor.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.3c3 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.3c3 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %IntConstructor = ref_param call_param0 -// CHECK:STDOUT: %self: ref %IntConstructor = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1022,11 +995,9 @@ fn InitFromStruct() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %DefaultConstructor.cpp_destructor.decl: %DefaultConstructor.cpp_destructor.type = fn_decl @DefaultConstructor.cpp_destructor [concrete = constants.%DefaultConstructor.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.b66 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.b66 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %DefaultConstructor = ref_param call_param0 -// CHECK:STDOUT: %self: ref %DefaultConstructor = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1137,18 +1108,14 @@ fn InitFromStruct() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %ThreeWithDefault.cpp_destructor.decl: %ThreeWithDefault.cpp_destructor.type = fn_decl @ThreeWithDefault.cpp_destructor [concrete = constants.%ThreeWithDefault.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.ca7 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.ca7 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %ThreeWithDefault = ref_param call_param0 -// CHECK:STDOUT: %self: ref %ThreeWithDefault = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %Two.cpp_destructor.decl: %Two.cpp_destructor.type = fn_decl @Two.cpp_destructor [concrete = constants.%Two.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.4c2 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.4c2 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %Two = ref_param call_param0 -// CHECK:STDOUT: %self: ref %Two = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1466,11 +1433,9 @@ fn InitFromStruct() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %NonAggregate.cpp_destructor.decl: %NonAggregate.cpp_destructor.type = fn_decl @NonAggregate.cpp_destructor [concrete = constants.%NonAggregate.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.eac = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.eac = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %NonAggregate = ref_param call_param0 -// CHECK:STDOUT: %self: ref %NonAggregate = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/operators/deref.carbon b/toolchain/check/testdata/interop/cpp/operators/deref.carbon index 87dbd3087763..ee279a58e9da 100644 --- a/toolchain/check/testdata/interop/cpp/operators/deref.carbon +++ b/toolchain/check/testdata/interop/cpp/operators/deref.carbon @@ -118,7 +118,6 @@ fn TestDerefFail(not_ptr: Cpp.NotAPtr) { // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %ConstDeref: type = class_type @ConstDeref [concrete] -// CHECK:STDOUT: %pattern_type.3fb: type = pattern_type %ConstDeref [concrete] // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] @@ -153,12 +152,9 @@ fn TestDerefFail(not_ptr: Cpp.NotAPtr) { // CHECK:STDOUT: %Core.import_ref.83d: %CppUnsafeDeref.assoc_type = import_ref Core//prelude/operators/deref, loc{{\d+_\d+}}, loaded [concrete = constants.%assoc1] // CHECK:STDOUT: %Core.import_ref.ad7: @CppUnsafeDeref.WithSelf.%CppUnsafeDeref.WithSelf.Op.type (%CppUnsafeDeref.WithSelf.Op.type.792) = import_ref Core//prelude/operators/deref, loc{{\d+_\d+}}, loaded [symbolic = @CppUnsafeDeref.WithSelf.%CppUnsafeDeref.WithSelf.Op (constants.%CppUnsafeDeref.WithSelf.Op.a80)] // CHECK:STDOUT: %ConstDeref.cpp_operator.decl: %ConstDeref.cpp_operator.type = fn_decl @ConstDeref.cpp_operator [concrete = constants.%ConstDeref.cpp_operator] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.3fb = value_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.3fb = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { // CHECK:STDOUT: -// CHECK:STDOUT: %self.param: %ConstDeref = value_param call_param0 -// CHECK:STDOUT: %self: %ConstDeref = value_binding self, %self.param // CHECK:STDOUT: } // CHECK:STDOUT: %operator_Star__carbon_thunk.decl: %operator_Star__carbon_thunk.type = fn_decl @operator_Star__carbon_thunk [concrete = constants.%operator_Star__carbon_thunk] { // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/operators/operators.carbon b/toolchain/check/testdata/interop/cpp/operators/operators.carbon index d82797cd0ba5..dfbb8db746d3 100644 --- a/toolchain/check/testdata/interop/cpp/operators/operators.carbon +++ b/toolchain/check/testdata/interop/cpp/operators/operators.carbon @@ -1077,11 +1077,9 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %C.cpp_destructor.decl: %C.cpp_destructor.type = fn_decl @C.cpp_destructor [concrete = constants.%C.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.217 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.217 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 -// CHECK:STDOUT: %self: ref %C = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1407,21 +1405,14 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %C.cpp_operator.decl: %C.cpp_operator.type = fn_decl @C.cpp_operator [concrete = constants.%C.cpp_operator] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.217 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.217 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: // CHECK:STDOUT: } { // CHECK:STDOUT: -// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 -// CHECK:STDOUT: %self: ref %C = ref_binding self, %self.param -// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %C.cpp_destructor.decl: %C.cpp_destructor.type = fn_decl @C.cpp_destructor [concrete = constants.%C.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.217 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.217 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 -// CHECK:STDOUT: %self: ref %C = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1994,11 +1985,9 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %C.cpp_destructor.decl: %C.cpp_destructor.type = fn_decl @C.cpp_destructor [concrete = constants.%C.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.217 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.217 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 -// CHECK:STDOUT: %self: ref %C = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2170,11 +2159,9 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %C.cpp_destructor.decl: %C.cpp_destructor.type = fn_decl @C.cpp_destructor [concrete = constants.%C.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.217 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.217 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 -// CHECK:STDOUT: %self: ref %C = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2327,11 +2314,9 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %C.cpp_destructor.decl: %C.cpp_destructor.type = fn_decl @C.cpp_destructor [concrete = constants.%C.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.217 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.217 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 -// CHECK:STDOUT: %self: ref %C = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2456,11 +2441,9 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %C.cpp_destructor.decl: %C.cpp_destructor.type = fn_decl @C.cpp_destructor [concrete = constants.%C.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.69f = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.69f = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 -// CHECK:STDOUT: %self: ref %C = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2612,18 +2595,14 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %C2.cpp_destructor.decl: %C2.cpp_destructor.type = fn_decl @C2.cpp_destructor [concrete = constants.%C2.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.846 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.846 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %C2 = ref_param call_param0 -// CHECK:STDOUT: %self: ref %C2 = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %C1.cpp_destructor.decl: %C1.cpp_destructor.type = fn_decl @C1.cpp_destructor [concrete = constants.%C1.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.20f = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.20f = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %C1 = ref_param call_param0 -// CHECK:STDOUT: %self: ref %C1 = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2764,11 +2743,9 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %C.cpp_destructor.decl: %C.cpp_destructor.type = fn_decl @C.cpp_destructor [concrete = constants.%C.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.69f = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.69f = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 -// CHECK:STDOUT: %self: ref %C = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2874,11 +2851,9 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %C.cpp_destructor.decl: %C.cpp_destructor.type = fn_decl @C.cpp_destructor [concrete = constants.%C.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.b28 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.b28 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 -// CHECK:STDOUT: %self: ref %C = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3002,11 +2977,9 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %C.cpp_destructor.decl: %C.cpp_destructor.type = fn_decl @C.cpp_destructor [concrete = constants.%C.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.84b = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.84b = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 -// CHECK:STDOUT: %self: ref %C = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3130,12 +3103,8 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %C.cpp_operator.decl.828f43.1: %C.cpp_operator.type.dab96a.1 = fn_decl @C.cpp_operator.1 [concrete = constants.%C.cpp_operator.d21c75.1] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.217 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.217 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 -// CHECK:STDOUT: %self: ref %C = ref_binding self, %self.param // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %operator_Minus__carbon_thunk.decl: %operator_Minus__carbon_thunk.type = fn_decl @operator_Minus__carbon_thunk [concrete = constants.%operator_Minus__carbon_thunk] { @@ -3144,12 +3113,8 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %C.cpp_operator.decl.828f43.2: %C.cpp_operator.type.dab96a.2 = fn_decl @C.cpp_operator.2 [concrete = constants.%C.cpp_operator.d21c75.2] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.217 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.217 = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 -// CHECK:STDOUT: %self: ref %C = ref_binding self, %self.param // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %operator_Plus__carbon_thunk.decl: %operator_Plus__carbon_thunk.type = fn_decl @operator_Plus__carbon_thunk [concrete = constants.%operator_Plus__carbon_thunk] { @@ -3158,11 +3123,9 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %C.cpp_destructor.decl: %C.cpp_destructor.type = fn_decl @C.cpp_destructor [concrete = constants.%C.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.217 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.217 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 -// CHECK:STDOUT: %self: ref %C = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: @@ -3298,11 +3261,9 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: %C.cpp_destructor.decl: %C.cpp_destructor.type = fn_decl @C.cpp_destructor [concrete = constants.%C.cpp_destructor] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.217 = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.217 = at_binding_pattern self, %self.param_patt [concrete] +// CHECK:STDOUT: // CHECK:STDOUT: } { -// CHECK:STDOUT: %self.param: ref %C = ref_param call_param0 -// CHECK:STDOUT: %self: ref %C = ref_binding self, %self.param +// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/primitive_types/arithmetic.carbon b/toolchain/check/testdata/interop/cpp/primitive_types/arithmetic.carbon index ca8fc9546a4f..e34f50aa0f8d 100644 --- a/toolchain/check/testdata/interop/cpp/primitive_types/arithmetic.carbon +++ b/toolchain/check/testdata/interop/cpp/primitive_types/arithmetic.carbon @@ -542,14 +542,9 @@ fn F() { // CHECK:STDOUT: %DefaultOrUnformed.impl_witness_table.16f = impl_witness_table (%Core.import_ref.627), @T.as_type.as.DefaultOrUnformed.impl [concrete] // CHECK:STDOUT: %unsigned_int.foo.cpp_overload_set.value: %unsigned_int.foo.cpp_overload_set.type = cpp_overload_set_value @unsigned_int.foo.cpp_overload_set [concrete = constants.%unsigned_int.foo.cpp_overload_set.value] // CHECK:STDOUT: %unsigned_int.foo.decl: %unsigned_int.foo.type = fn_decl @unsigned_int.foo [concrete = constants.%unsigned_int.foo] { -// CHECK:STDOUT: %self.param_patt: %pattern_type.5ec = ref_param_pattern [concrete] -// CHECK:STDOUT: %self.patt: %pattern_type.5ec = at_binding_pattern self, %self.param_patt [concrete] // CHECK:STDOUT: // CHECK:STDOUT: } { // CHECK:STDOUT: -// CHECK:STDOUT: %self.param: ref %unsigned_int = ref_param call_param0 -// CHECK:STDOUT: %self: ref %unsigned_int = ref_binding self, %self.param -// CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/lower/testdata/interop/cpp/reference.carbon b/toolchain/lower/testdata/interop/cpp/reference.carbon index 56a1a183fb27..95c9a6b9eee0 100644 --- a/toolchain/lower/testdata/interop/cpp/reference.carbon +++ b/toolchain/lower/testdata/interop/cpp/reference.carbon @@ -133,35 +133,35 @@ fn GetRefs() { // CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" // CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu" // CHECK:STDOUT: -// CHECK:STDOUT: @C.val = internal constant {} zeroinitializer -// CHECK:STDOUT: @int_42.c68 = internal constant i32 42 -// CHECK:STDOUT: @C.val.loc19_20.3 = internal constant {} zeroinitializer +// CHECK:STDOUT: @C.val.loc19_20 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind // CHECK:STDOUT: define void @_CPassRefs.Main() #0 !dbg !11 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %c.var = alloca {}, align 8, !dbg !14 -// CHECK:STDOUT: %.loc19_18.2.temp = alloca {}, align 8, !dbg !15 +// CHECK:STDOUT: %_.var.1 = alloca {}, align 8, !dbg !15 // CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !16 -// CHECK:STDOUT: %.loc24_22.3.temp = alloca i32, align 4, !dbg !17 +// CHECK:STDOUT: %_.var.2 = alloca i32, align 4, !dbg !17 // CHECK:STDOUT: %.loc25_23.2.temp = alloca i32, align 4, !dbg !18 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !14 // CHECK:STDOUT: call void @"_COp.d288d62be0e5d791:DefaultOrUnformed.Core.93349b0fe912a29b"(ptr %c.var), !dbg !14 // CHECK:STDOUT: call void @_Z8TakeCRefR1C(ptr %c.var), !dbg !19 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_18.2.temp), !dbg !15 -// CHECK:STDOUT: call void @_Z9TakeCRRefO1C.carbon_thunk(ptr @C.val.loc19_20.3), !dbg !20 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.1), !dbg !15 +// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %_.var.1, ptr align 1 @C.val.loc19_20, i64 0, i1 false), !dbg !15 +// CHECK:STDOUT: call void @_Z9TakeCRRefO1C.carbon_thunk(ptr %_.var.1), !dbg !20 // CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C.carbon_thunk(ptr %c.var), !dbg !21 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !16 // CHECK:STDOUT: store i32 poison, ptr %n.var, align 4, !dbg !16 // CHECK:STDOUT: call void @_Z10TakeIntRefRi(ptr %n.var), !dbg !22 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_22.3.temp), !dbg !17 -// CHECK:STDOUT: call void @_Z11TakeIntRRefOi.carbon_thunk(ptr @int_42.c68), !dbg !23 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var.2), !dbg !17 +// CHECK:STDOUT: store i32 42, ptr %_.var.2, align 4, !dbg !17 +// CHECK:STDOUT: call void @_Z11TakeIntRRefOi.carbon_thunk(ptr %_.var.2), !dbg !23 // CHECK:STDOUT: %.loc25_23.1 = load i32, ptr %n.var, align 4, !dbg !18 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_23.2.temp), !dbg !18 // CHECK:STDOUT: store i32 %.loc25_23.1, ptr %.loc25_23.2.temp, align 4, !dbg !18 // CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi.carbon_thunk(ptr %.loc25_23.2.temp), !dbg !24 // CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %.loc25_23.2.temp), !dbg !18 -// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr @int_42.c68), !dbg !17 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %_.var.2), !dbg !17 // CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !16 // CHECK:STDOUT: ret void, !dbg !25 // CHECK:STDOUT: } @@ -241,6 +241,9 @@ fn GetRefs() { // CHECK:STDOUT: ret void, !dbg !46 // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) +// CHECK:STDOUT: declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #6 +// CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z9TakeCRRefO1C(ptr noundef nonnull align 1 dereferenceable(1)) #3 // CHECK:STDOUT: // CHECK:STDOUT: declare void @_Z13TakeConstCRefRK1C(ptr noundef nonnull align 1 dereferenceable(1)) #3 @@ -259,6 +262,7 @@ fn GetRefs() { // CHECK:STDOUT: attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: attributes #4 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } // CHECK:STDOUT: attributes #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +// CHECK:STDOUT: attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } // CHECK:STDOUT: // CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4} // CHECK:STDOUT: !llvm.dbg.cu = !{!5} @@ -279,9 +283,9 @@ fn GetRefs() { // CHECK:STDOUT: !12 = !DISubroutineType(types: !13) // CHECK:STDOUT: !13 = !{null} // CHECK:STDOUT: !14 = !DILocation(line: 17, column: 3, scope: !11) -// CHECK:STDOUT: !15 = !DILocation(line: 19, column: 17, scope: !11) +// CHECK:STDOUT: !15 = !DILocation(line: 8, column: 19, scope: !11) // CHECK:STDOUT: !16 = !DILocation(line: 22, column: 3, scope: !11) -// CHECK:STDOUT: !17 = !DILocation(line: 24, column: 19, scope: !11) +// CHECK:STDOUT: !17 = !DILocation(line: 12, column: 23, scope: !11) // CHECK:STDOUT: !18 = !DILocation(line: 25, column: 23, scope: !11) // CHECK:STDOUT: !19 = !DILocation(line: 18, column: 3, scope: !11) // CHECK:STDOUT: !20 = !DILocation(line: 19, column: 3, scope: !11) @@ -319,7 +323,6 @@ fn GetRefs() { // CHECK:STDOUT: %class.ForceThunk = type { i8 } // CHECK:STDOUT: // CHECK:STDOUT: @C.val = internal constant {} zeroinitializer -// CHECK:STDOUT: @int_42.c68 = internal constant i32 42 // CHECK:STDOUT: @C.val.loc20_20.3 = internal constant {} zeroinitializer // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind @@ -328,7 +331,7 @@ fn GetRefs() { // CHECK:STDOUT: %c.var = alloca {}, align 8, !dbg !14 // CHECK:STDOUT: %.loc20_18.2.temp = alloca {}, align 8, !dbg !15 // CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !16 -// CHECK:STDOUT: %.loc25_22.3.temp = alloca i32, align 4, !dbg !17 +// CHECK:STDOUT: %_.var = alloca i32, align 4, !dbg !17 // CHECK:STDOUT: %.loc26_23.2.temp = alloca i32, align 4, !dbg !18 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !14 // CHECK:STDOUT: call void @"_COp.d288d62be0e5d791:DefaultOrUnformed.Core.93349b0fe912a29b"(ptr %c.var), !dbg !14 @@ -339,14 +342,15 @@ fn GetRefs() { // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !16 // CHECK:STDOUT: store i32 poison, ptr %n.var, align 4, !dbg !16 // CHECK:STDOUT: call void @_Z10TakeIntRefRi10ForceThunk.carbon_thunk1(ptr %n.var), !dbg !22 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_22.3.temp), !dbg !17 -// CHECK:STDOUT: call void @_Z11TakeIntRRefOi10ForceThunk.carbon_thunk1(ptr @int_42.c68), !dbg !23 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %_.var), !dbg !17 +// CHECK:STDOUT: store i32 42, ptr %_.var, align 4, !dbg !17 +// CHECK:STDOUT: call void @_Z11TakeIntRRefOi10ForceThunk.carbon_thunk1(ptr %_.var), !dbg !23 // CHECK:STDOUT: %.loc26_23.1 = load i32, ptr %n.var, align 4, !dbg !18 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc26_23.2.temp), !dbg !18 // CHECK:STDOUT: store i32 %.loc26_23.1, ptr %.loc26_23.2.temp, align 4, !dbg !18 // CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi10ForceThunk.carbon_thunk1(ptr %.loc26_23.2.temp), !dbg !24 // CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %.loc26_23.2.temp), !dbg !18 -// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr @int_42.c68), !dbg !17 +// CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %_.var), !dbg !17 // CHECK:STDOUT: call void @"_COp.7e389eab4a7e5487:core.Destroy.Core"(ptr %n.var), !dbg !16 // CHECK:STDOUT: ret void, !dbg !25 // CHECK:STDOUT: } @@ -492,7 +496,7 @@ fn GetRefs() { // CHECK:STDOUT: !14 = !DILocation(line: 18, column: 3, scope: !11) // CHECK:STDOUT: !15 = !DILocation(line: 20, column: 17, scope: !11) // CHECK:STDOUT: !16 = !DILocation(line: 23, column: 3, scope: !11) -// CHECK:STDOUT: !17 = !DILocation(line: 25, column: 19, scope: !11) +// CHECK:STDOUT: !17 = !DILocation(line: 13, column: 23, scope: !11) // CHECK:STDOUT: !18 = !DILocation(line: 26, column: 23, scope: !11) // CHECK:STDOUT: !19 = !DILocation(line: 19, column: 3, scope: !11) // CHECK:STDOUT: !20 = !DILocation(line: 20, column: 3, scope: !11)