diff --git a/toolchain/check/convert.cpp b/toolchain/check/convert.cpp index 24ee8e4711ce..435f9422f1d8 100644 --- a/toolchain/check/convert.cpp +++ b/toolchain/check/convert.cpp @@ -42,84 +42,91 @@ namespace Carbon::Check { -// Marks the initializer `init_id` as initializing `target.storage_id`. -static auto MarkInitializerFor(SemIR::File& sem_ir, SemIR::InstId init_id, - ConversionTarget& target) -> void { - if (!target.storage_id.has_value()) { - return; - } +// Overwrites the contents of the storage arg of the initializing expression +// `init_id` with the inst at `target.storage_id`, and returns the ID that +// should now be used to refer to `init_id`'s storage. Has no effect and returns +// `target.storage_id` unchanged if `target.storage_id` is None or `init_id` +// doesn't have a storage arg. +static auto OverwriteStorageArg(SemIR::File& sem_ir, SemIR::InstId init_id, + const ConversionTarget& target) + -> SemIR::InstId { CARBON_CHECK(target.is_initializer()); - auto return_slot_arg_id = FindReturnSlotArgForInitializer(sem_ir, init_id); - if (return_slot_arg_id.has_value()) { - // Replace the temporary in the return slot with a reference to our target. - CARBON_CHECK(sem_ir.insts().Get(return_slot_arg_id).kind() == - SemIR::TemporaryStorage::Kind, - "Return slot for initializer does not contain a temporary; " - "initialized multiple times? Have {0}", - sem_ir.insts().Get(return_slot_arg_id)); - target.storage_id = target.storage_access_block->MergeReplacing( - return_slot_arg_id, target.storage_id); + if (!target.storage_id.has_value()) { + return SemIR::InstId::None; } + auto storage_arg_id = FindStorageArgForInitializer(sem_ir, init_id); + if (!storage_arg_id.has_value()) { + return target.storage_id; + } + // Replace the temporary in the return slot with a reference to our target. + CARBON_CHECK(sem_ir.insts().Get(storage_arg_id).kind() == + SemIR::TemporaryStorage::Kind, + "Return slot for initializer does not contain a temporary; " + "initialized multiple times? Have {0}", + sem_ir.insts().Get(storage_arg_id)); + return target.storage_access_block->MergeReplacing(storage_arg_id, + target.storage_id); } -// For a value or initializing expression using a copy value representation, -// copy the value into a temporary object. -static auto CopyValueToTemporary(Context& context, SemIR::InstId init_id) +// Materializes and returns a temporary initialized from the initializer +// `init_id`. If `init_id` has a storage arg, it must be a `TemporaryStorage`; +// if not, this function allocates one for it. +static auto MaterializeTemporary(Context& context, SemIR::InstId init_id) -> SemIR::InstId { - // TODO: Consider using `None` to mean that we immediately materialize and - // initialize a temporary, rather than two separate instructions. - auto init = context.insts().Get(init_id); - auto temporary_id = AddInst( - context, SemIR::LocId(init_id), {.type_id = init.type_id()}); + auto& sem_ir = context.sem_ir(); + auto category = SemIR::GetExprCategory(sem_ir, init_id); + CARBON_CHECK(SemIR::IsInitializerCategory(category)); + auto init = sem_ir.insts().Get(init_id); + auto storage_id = FindStorageArgForInitializer(sem_ir, init_id); + if (!storage_id.has_value()) { + CARBON_CHECK(category == SemIR::ExprCategory::ReprInitializing); + // The initializer has no storage arg, but we want to produce an ephemeral + // reference, so we need to allocate temporary storage. + storage_id = AddInst( + context, SemIR::LocId(init_id), {.type_id = init.type_id()}); + } + + CARBON_CHECK( + sem_ir.insts().Get(storage_id).kind() == SemIR::TemporaryStorage::Kind, + "Storage arg for initializer does not contain a temporary; " + "initialized multiple times? Have {0}", + sem_ir.insts().Get(storage_id)); return AddInstWithCleanup(context, SemIR::LocId(init_id), {.type_id = init.type_id(), - .storage_id = temporary_id, + .storage_id = storage_id, .init_id = init_id}); } -// Commits to using a temporary to store the result of the initializing -// expression described by `init_id`, and returns the location of the -// temporary. If `discarded` is `true`, the result is discarded, and no -// temporary will be created if possible; if no temporary is created, the -// return value will be `SemIR::InstId::None`. -static auto FinalizeTemporary(Context& context, SemIR::InstId init_id, - bool discarded) -> SemIR::InstId { +// Discards the initializer `init_id`. If `init_id` intrinsically writes to +// memory, this materializes a temporary for it and starts its lifetime. +// +// TODO: We should probably start its lifetime unconditionally, because +// types with by-copy representations can still have nontrivial destructors. +static auto DiscardInitializer(Context& context, SemIR::InstId init_id) + -> void { auto& sem_ir = context.sem_ir(); - auto return_slot_arg_id = FindReturnSlotArgForInitializer(sem_ir, init_id); - if (return_slot_arg_id.has_value()) { - // The return slot should already have a materialized temporary in it. - CARBON_CHECK(sem_ir.insts().Get(return_slot_arg_id).kind() == - SemIR::TemporaryStorage::Kind, - "Return slot for initializer does not contain a temporary; " - "initialized multiple times? Have {0}", - sem_ir.insts().Get(return_slot_arg_id)); - auto init = sem_ir.insts().Get(init_id); - return AddInstWithCleanup( - context, SemIR::LocId(init_id), - {.type_id = init.type_id(), - .storage_id = return_slot_arg_id, - .init_id = init_id}); + auto storage_id = FindStorageArgForInitializer(sem_ir, init_id); + if (!storage_id.has_value()) { + CARBON_CHECK(SemIR::GetExprCategory(sem_ir, init_id) == + SemIR::ExprCategory::ReprInitializing); + return; } - if (discarded) { - // Don't invent a temporary that we're going to discard. - return SemIR::InstId::None; - } - - // The initializer has no return slot, but we want to produce a temporary - // object. Materialize one now. - return CopyValueToTemporary(context, init_id); + // init_id writes to temporary storage, so we need to materialize a temporary + // for it. + MaterializeTemporary(context, init_id); } -// Materialize a temporary to hold the result of the given expression if it is -// an initializing expression. -static auto MaterializeIfInitializing(Context& context, SemIR::InstId expr_id) +// If `expr_id` is an initializer, materializes it and returns the resulting +// ephemeral reference expression. Otherwise, returns `expr_id`. +static auto MaterializeIfInitializer(Context& context, SemIR::InstId expr_id) -> SemIR::InstId { - if (GetExprCategory(context.sem_ir(), expr_id) == - SemIR::ExprCategory::Initializing) { - return FinalizeTemporary(context, expr_id, /*discarded=*/false); + if (SemIR::IsInitializerCategory( + SemIR::GetExprCategory(context.sem_ir(), expr_id))) { + return MaterializeTemporary(context, expr_id); + } else { + return expr_id; } - return expr_id; } // Helper to allow `MakeElementAccessInst` to call `AddInst` with either a @@ -169,9 +176,9 @@ static auto GetAggregateElementConversionTargetKind(SemIR::File& sem_ir, CARBON_CHECK(init_repr.kind != SemIR::InitRepr::Dependent, "Aggregate should not have dependent init kind"); if (init_repr.kind == SemIR::InitRepr::InPlace) { - return ConversionTarget::FullInitializer; + return ConversionTarget::InPlaceInitializing; } - return ConversionTarget::Initializer; + return ConversionTarget::Initializing; } // Otherwise, we want a value representation for each element. @@ -250,7 +257,7 @@ static auto ConvertTupleToArray(Context& context, SemIR::TupleType tuple_type, if (auto tuple_literal = value.TryAs()) { literal_elems = sem_ir.inst_blocks().Get(tuple_literal->elements_id); } else { - value_id = MaterializeIfInitializing(context, value_id); + value_id = MaterializeIfInitializer(context, value_id); } // Check that the tuple is the right size. @@ -312,7 +319,7 @@ static auto ConvertTupleToArray(Context& context, SemIR::TupleType tuple_type, auto init_id = ConvertAggregateElement( context, value_loc_id, value_id, src_type_inst_id, literal_elems, - ConversionTarget::FullInitializer, return_slot_arg_id, + ConversionTarget::InPlaceInitializing, return_slot_arg_id, array_type.element_type_inst_id, target_block, i, i); if (init_id == SemIR::ErrorInst::InstId) { return SemIR::ErrorInst::InstId; @@ -352,7 +359,7 @@ static auto ConvertTupleToTuple(Context& context, SemIR::TupleType src_type, literal_elems_id = tuple_literal->elements_id; literal_elems = sem_ir.inst_blocks().Get(literal_elems_id); } else { - value_id = MaterializeIfInitializing(context, value_id); + value_id = MaterializeIfInitializer(context, value_id); } // Check that the tuples are the same size. @@ -496,7 +503,7 @@ static auto ConvertStructToStructOrClass( literal_elems_id = struct_literal->elements_id; literal_elems = sem_ir.inst_blocks().Get(literal_elems_id); } else { - value_id = MaterializeIfInitializing(context, value_id); + value_id = MaterializeIfInitializer(context, value_id); } // Check that the structs are the same size. @@ -563,10 +570,10 @@ static auto ConvertStructToStructOrClass( .GetAs(canonical_vtable_decl_id) .vtable_id, .specific_id = vtable_class_type->specific_id}); - auto init_id = AddInst(context, value_loc_id, - {.type_id = vptr_type_id, - .src_id = vtable_ptr_id, - .dest_id = dest_id}); + auto init_id = AddInst(context, value_loc_id, + {.type_id = vptr_type_id, + .src_id = vtable_ptr_id, + .dest_id = dest_id}); new_block.Set(i, init_id); continue; } @@ -677,7 +684,7 @@ static auto ConvertStructToClass(Context& context, SemIR::StructType src_type, // point to. bool need_temporary = !target.is_initializer(); if (need_temporary) { - target.kind = ConversionTarget::Initializer; + target.kind = ConversionTarget::Initializing; target.storage_access_block = &target_block; target.storage_id = target_block.AddInst( SemIR::LocId(value_id), {.type_id = target.type_id}); @@ -801,12 +808,12 @@ static auto IsValidExprCategoryForConversionTarget( return category == SemIR::ExprCategory::Value || category == SemIR::ExprCategory::DurableRef || category == SemIR::ExprCategory::EphemeralRef || - category == SemIR::ExprCategory::Initializing; + category == SemIR::ExprCategory::ReprInitializing || + category == SemIR::ExprCategory::InPlaceInitializing; case ConversionTarget::RefParam: case ConversionTarget::UnmarkedRefParam: return category == SemIR::ExprCategory::DurableRef || - category == SemIR::ExprCategory::EphemeralRef || - category == SemIR::ExprCategory::Initializing; + category == SemIR::ExprCategory::EphemeralRef; case ConversionTarget::DurableRef: return category == SemIR::ExprCategory::DurableRef; case ConversionTarget::CppThunkRef: @@ -814,9 +821,10 @@ static auto IsValidExprCategoryForConversionTarget( case ConversionTarget::ExplicitAs: case ConversionTarget::ExplicitUnsafeAs: return true; - case ConversionTarget::Initializer: - case ConversionTarget::FullInitializer: - return category == SemIR::ExprCategory::Initializing; + case ConversionTarget::InPlaceInitializing: + return category == SemIR::ExprCategory::InPlaceInitializing; + case ConversionTarget::Initializing: + return category == SemIR::ExprCategory::ReprInitializing; } } @@ -885,7 +893,7 @@ static auto CanRemoveQualifiers(SemIR::TypeQualifiers quals, } if (quals.HasAnyOf(SemIR::TypeQualifiers::Partial) && - (!allow_unsafe || cat == SemIR::ExprCategory::Initializing)) { + (!allow_unsafe || SemIR::IsInitializerCategory(cat))) { // TODO: Allow removing `partial` for initializing expressions as a safe // conversion. `PerformBuiltinConversion` will need to initialize the vptr // as part of the conversion. @@ -893,7 +901,7 @@ static auto CanRemoveQualifiers(SemIR::TypeQualifiers quals, } if (quals.HasAnyOf(SemIR::TypeQualifiers::MaybeUnformed) && - (!allow_unsafe || cat == SemIR::ExprCategory::Initializing)) { + (!allow_unsafe || SemIR::IsInitializerCategory(cat))) { // As an unsafe conversion, `MaybeUnformed` can be removed from a value or // reference expression. return false; @@ -976,18 +984,24 @@ static auto PerformBuiltinConversion( // If the source is an initializing expression, we may be able to pull a // value right out of it. - if (value_cat == SemIR::ExprCategory::Initializing && + if (value_cat == SemIR::ExprCategory::ReprInitializing && CanUseValueOfInitializer(sem_ir, value_type_id, target.kind)) { return AddInst( context, loc_id, {.type_id = value_type_id, .init_id = value_id}); } // Materialization is handled as part of the enclosing conversion. - if (value_cat == SemIR::ExprCategory::Initializing && + if (SemIR::IsInitializerCategory(value_cat) && target.kind == ConversionTarget::ValueOrRef) { return value_id; } + // Final destination store is handled as part of the enclosing conversion. + if (value_cat == SemIR::ExprCategory::ReprInitializing && + target.kind == ConversionTarget::InPlaceInitializing) { + return value_id; + } + // PerformBuiltinConversion converts each part of a tuple or struct, even // when the types are the same. This is not done for classes since they have // to define their conversions as part of their api. @@ -1370,7 +1384,7 @@ static auto IsCppEnum(Context& context, SemIR::TypeId type_id) -> bool { // Given a value expression, form a corresponding initializer that copies from // that value to the specified target, if it is possible to do so. static auto PerformCopy(Context& context, SemIR::InstId expr_id, - ConversionTarget& target) -> SemIR::InstId { + const ConversionTarget& target) -> SemIR::InstId { // TODO: We don't have a mechanism yet to generate `Copy` impls for each enum // type imported from C++. For now we fake it by providing a direct copy. auto type_id = context.insts().Get(expr_id).type_id(); @@ -1388,7 +1402,6 @@ static auto PerformCopy(Context& context, SemIR::InstId expr_id, "cannot copy value of type {0}", TypeOfInstId); return context.emitter().Build(expr_id, CopyOfUncopyableType, expr_id); }); - MarkInitializerFor(context.sem_ir(), copy_id, target); return copy_id; } @@ -1503,14 +1516,17 @@ class CategoryConverter { Context& context_; SemIR::File& sem_ir_; SemIR::LocId loc_id_; - ConversionTarget& target_; + const ConversionTarget& target_; bool performed_builtin_conversion_; }; auto CategoryConverter::DoStep(const SemIR::InstId expr_id, const SemIR::ExprCategory category) const -> State { - CARBON_DCHECK(SemIR::GetExprCategory(sem_ir_, expr_id) == category); + CARBON_DCHECK(SemIR::GetExprCategory(sem_ir_, expr_id) == category || + // TODO: Drop this special case once PerformCopy on C++ enums + // produces an initializing expression. + IsCppEnum(context_, target_.type_id)); switch (category) { case SemIR::ExprCategory::NotExpr: case SemIR::ExprCategory::Mixed: @@ -1521,15 +1537,33 @@ auto CategoryConverter::DoStep(const SemIR::InstId expr_id, case SemIR::ExprCategory::Error: return Done{SemIR::ErrorInst::InstId}; - case SemIR::ExprCategory::Initializing: + case SemIR::ExprCategory::InPlaceInitializing: + case SemIR::ExprCategory::ReprInitializing: if (target_.is_initializer()) { - if (!performed_builtin_conversion_) { - // Don't fill in the return slot if we created the expression through - // a builtin conversion. In that case, we will have created it with - // the target already set. - // TODO: Find a better way to track whether we need to do this, - // and then make target_ immutable if possible. - MarkInitializerFor(sem_ir_, expr_id, target_); + // Overwrite the initializer's storage argument with the inst currently + // at target_.storage_id, if both are present. However, we skip this + // in certain cases: + // - If we created the expression through a builtin conversion, we + // will have created it with the target already set. + // - If the type is a C++ enum, we don't actually have an initializing + // expression, we're just pretending we do. + auto new_storage_id = target_.storage_id; + if (!performed_builtin_conversion_ && + !IsCppEnum(context_, target_.type_id)) { + new_storage_id = OverwriteStorageArg(sem_ir_, expr_id, target_); + } + + // If in-place initialization was requested, and it hasn't already + // happened, ensure it happens now. + if (target_.kind == ConversionTarget::InPlaceInitializing && + category != SemIR::ExprCategory::InPlaceInitializing && + SemIR::InitRepr::ForType(sem_ir_, target_.type_id) + .MightBeByCopy()) { + target_.storage_access_block->InsertHere(); + return Done{AddInst(context_, loc_id_, + {.type_id = target_.type_id, + .src_id = expr_id, + .dest_id = new_storage_id})}; } return Done{expr_id}; } @@ -1540,10 +1574,10 @@ auto CategoryConverter::DoStep(const SemIR::InstId expr_id, // TODO: If the target is DurableRef, materialize a VarStorage instead of // a TemporaryStorage to lifetime-extend. if (target_.kind == ConversionTarget::Discarded) { - return Done{FinalizeTemporary(context_, expr_id, /*discarded=*/true)}; + DiscardInitializer(context_, expr_id); + return Done{SemIR::InstId::None}; } else { - return NextStep{.expr_id = FinalizeTemporary(context_, expr_id, - /*discarded=*/false), + return NextStep{.expr_id = MaterializeTemporary(context_, expr_id), .category = SemIR::ExprCategory::EphemeralRef}; } @@ -1627,7 +1661,31 @@ auto CategoryConverter::DoStep(const SemIR::InstId expr_id, // When initializing from a value, perform a copy. if (target_.is_initializer()) { - return Done{PerformCopy(context_, expr_id, target_)}; + auto copy_id = PerformCopy(context_, expr_id, target_); + if (copy_id == SemIR::ErrorInst::InstId) { + return Done{SemIR::ErrorInst::InstId}; + } + // Deal with special-case category behavior of PerformCopy. + switch (SemIR::GetExprCategory(sem_ir_, copy_id)) { + case SemIR::ExprCategory::Value: + // As a temporary workaround, PerformCopy on a C++ enum currently + // returns the unchanged value, but we treat it as an initializing + // expression. + // TODO: Drop this case once it's no longer applicable. + CARBON_CHECK(IsCppEnum(context_, target_.type_id)); + [[fallthrough]]; + case SemIR::ExprCategory::ReprInitializing: + // The common case: PerformCopy produces an initializing expression. + return NextStep{.expr_id = copy_id, + .category = SemIR::ExprCategory::ReprInitializing}; + case SemIR::ExprCategory::InPlaceInitializing: + // A C++ copy operation produces an ephemeral entire reference. + return NextStep{ + .expr_id = copy_id, + .category = SemIR::ExprCategory::InPlaceInitializing}; + default: + CARBON_FATAL("Unexpected category of copy operation {0}", category); + } } // When initializing a C++ thunk parameter, form a reference, creating a @@ -1714,13 +1772,11 @@ auto Convert(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id, return SemIR::ErrorInst::InstId; } - if (target.kind != ConversionTarget::FullInitializer && - (target.kind != ConversionTarget::Initializer || - !SemIR::InitRepr::ForType(context.sem_ir(), target.type_id) - .MightBeInPlace())) { - // storage_id should only be used for a FullInitializer, or an Initializer - // if the type has an in-place init representation. This ensures we don't - // accidentally use it for anything else. + // Clear storage_id in cases where it's clearly meaningless, to avoid misuse + // and simplify the resulting SemIR. + if (!target.is_initializer() || + SemIR::InitRepr::ForType(context.sem_ir(), target.type_id).kind == + SemIR::InitRepr::None) { target.storage_id = SemIR::InstId::None; } @@ -1830,27 +1886,21 @@ auto Convert(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id, CategoryConverter(context, loc_id, target, performed_builtin_conversion) .Convert(expr_id); - // Perform a final destination store, if necessary. - if (target.kind == ConversionTarget::FullInitializer) { - if (auto init_rep = SemIR::InitRepr::ForType(sem_ir, target.type_id); - init_rep.MightBeByCopy()) { - target.storage_access_block->InsertHere(); - expr_id = AddInst(context, loc_id, - {.type_id = target.type_id, - .src_id = expr_id, - .dest_id = target.storage_id}); - } - } - return expr_id; } auto Initialize(Context& context, SemIR::LocId loc_id, SemIR::InstId storage_id, - SemIR::InstId value_id) -> SemIR::InstId { + SemIR::InstId value_id, bool for_return) -> SemIR::InstId { + auto type_id = context.insts().Get(storage_id).type_id(); + if (for_return && + !SemIR::InitRepr::ForType(context.sem_ir(), type_id).MightBeInPlace()) { + // TODO: is it safe to use storage_id when the init repr is dependent? + storage_id = SemIR::InstId::None; + } PendingBlock target_block(&context); return Convert(context, loc_id, value_id, - {.kind = ConversionTarget::Initializer, - .type_id = context.insts().Get(storage_id).type_id(), + {.kind = ConversionTarget::Initializing, + .type_id = type_id, .storage_id = storage_id, .storage_access_block = &target_block}); } diff --git a/toolchain/check/convert.h b/toolchain/check/convert.h index f089beea0d0e..0e9a860450a2 100644 --- a/toolchain/check/convert.h +++ b/toolchain/check/convert.h @@ -44,17 +44,17 @@ struct ConversionTarget { // The result of the conversion is discarded. It can't be an initializing // expression, but can be anything else. Discarded, - // Convert to an initializing expression, which a subsequent operation (such - // as `InitializeFrom` or `Temporary`) can use to initialize `storage_id`. - // `storage_id` is only used if `type_id` has an in-place initializing - // representation; otherwise, `storage_id` can be `None`, and the resulting - // initializing expression can be used to initialize any object of the - // appropriate type. - Initializer, - // Convert to an initializing expression, and use it to initialize - // `storage_id` (which must not be `None`). - FullInitializer, - Last = FullInitializer + // Convert to an initializing expression that uses `type_id`'s initializing + // representation. The resulting expression will usually be a + // repr-initializing expression, but may be an in-place initializing + // expression if the source expression was. If `storage_id` is present, it + // is used as the storage argument for the converted expression, and it must + // be present if the initializing representation might be in-place. + Initializing, + // Convert to an in-place initializing expression whose storage is + // designated by `storage_id` (which must not be `None`) + InPlaceInitializing, + Last = InPlaceInitializing }; // The kind of the target for this conversion. Kind kind; @@ -72,7 +72,7 @@ struct ConversionTarget { // Are we converting this value into an initializer for an object? auto is_initializer() const -> bool { - return kind == Initializer || kind == FullInitializer; + return kind == Initializing || kind == InPlaceInitializing; } // Is this some kind of explicit `as` conversion? auto is_explicit_as() const -> bool { @@ -91,16 +91,22 @@ auto Convert(Context& context, SemIR::LocId loc_id, SemIR::InstId expr_id, SemIR::ClassType* vtable_class_type = nullptr) -> SemIR::InstId; // Converts `value_id` to an initializing expression of the type of -// `storage_id`, and returns the possibly-converted initializing expression. If -// initialization is in-place, `storage_id` is used as the in-place storage; -// otherwise it is used only to determine the target type. The caller is -// responsible for assigning the returned initializing expression to the target -// using a suitable node for the kind of initialization. +// `storage_id`, and returns the possibly-converted initializing expression. +// `storage_id` is used as the storage argument of the resulting expression +// except as noted below. The caller is responsible for passing the result to an +// inst that is documented as consuming it, such as `Assign`. +// +// `for_return` indicates that this conversion is initializing the operand of a +// `return` statement. This means that `storage_id` will be the return slot +// parameter, which isn't valid to access if the type's initializing +// representation is not in-place, so in that case `storage_id` will be used +// solely for its type. // // TODO: Consider making the target type a separate parameter, and making // storage_id optional. auto Initialize(Context& context, SemIR::LocId loc_id, SemIR::InstId storage_id, - SemIR::InstId value_id) -> SemIR::InstId; + SemIR::InstId value_id, bool for_return = false) + -> SemIR::InstId; // Convert the given expression to a value expression of the same type. auto ConvertToValueExpr(Context& context, SemIR::InstId expr_id) diff --git a/toolchain/check/cpp/thunk.cpp b/toolchain/check/cpp/thunk.cpp index fe09f3f347aa..06fde46ea7f5 100644 --- a/toolchain/check/cpp/thunk.cpp +++ b/toolchain/check/cpp/thunk.cpp @@ -731,10 +731,10 @@ auto PerformCppThunkCall(Context& context, SemIR::LocId loc_id, // Produce the result of the call, taking the value from the return storage. if (thunk_takes_return_address) { - result_id = AddInst(context, loc_id, - {.type_id = return_type_id, - .src_id = result_id, - .dest_id = return_slot_id}); + result_id = AddInst(context, loc_id, + {.type_id = return_type_id, + .src_id = result_id, + .dest_id = return_slot_id}); } return result_id; diff --git a/toolchain/check/cpp/type_mapping.cpp b/toolchain/check/cpp/type_mapping.cpp index 92e9c252bf50..b79641f092e6 100644 --- a/toolchain/check/cpp/type_mapping.cpp +++ b/toolchain/check/cpp/type_mapping.cpp @@ -514,7 +514,8 @@ static auto InventPrimitiveClangArg(Context& context, FormInfo form) break; case SemIR::ExprCategory::Value: - case SemIR::ExprCategory::Initializing: + case SemIR::ExprCategory::ReprInitializing: + case SemIR::ExprCategory::InPlaceInitializing: value_kind = clang::ExprValueKind::VK_PRValue; break; diff --git a/toolchain/check/eval_inst.cpp b/toolchain/check/eval_inst.cpp index 84cb106f75e4..205d5607777b 100644 --- a/toolchain/check/eval_inst.cpp +++ b/toolchain/check/eval_inst.cpp @@ -442,7 +442,7 @@ auto EvalConstantInst(Context& /*context*/, SemIR::ImportRefUnloaded inst) inst); } -auto EvalConstantInst(Context& context, SemIR::InitializeFrom inst) +auto EvalConstantInst(Context& context, SemIR::InPlaceInit inst) -> ConstantEvalResult { // Initialization is not performed in-place during constant evaluation, so // just return the value of the initializer. diff --git a/toolchain/check/return.cpp b/toolchain/check/return.cpp index 0f0766186f7f..cf5997fb744b 100644 --- a/toolchain/check/return.cpp +++ b/toolchain/check/return.cpp @@ -179,7 +179,8 @@ auto BuildReturnWithExpr(Context& context, SemIR::LocId loc_id, GetCurrentFunctionForReturn(context).call_params_id); out_param_id = call_params[init_form.index.index]; CARBON_CHECK(out_param_id.has_value()); - expr_id = Initialize(context, loc_id, out_param_id, expr_id); + expr_id = Initialize(context, loc_id, out_param_id, expr_id, + /*for_return=*/true); if (!SemIR::InitRepr::ForType(context.sem_ir(), return_type_id) .MightBeInPlace()) { out_param_id = SemIR::InstId::None; diff --git a/toolchain/check/testdata/alias/import_order.carbon b/toolchain/check/testdata/alias/import_order.carbon index eaa11e7f81bd..7c2539e4379c 100644 --- a/toolchain/check/testdata/alias/import_order.carbon +++ b/toolchain/check/testdata/alias/import_order.carbon @@ -164,7 +164,7 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: %.loc7_23.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_24.1: %struct_type.v = struct_literal (%.loc7_23.1) [concrete = constants.%struct.5f2] // CHECK:STDOUT: %.loc7_24.2: ref %empty_tuple.type = class_element_access file.%d_val.var, element0 [concrete = constants.%.cad] -// CHECK:STDOUT: %.loc7_23.2: init %empty_tuple.type to %.loc7_24.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc7_23.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_24.3: init %empty_tuple.type = converted %.loc7_23.1, %.loc7_23.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_24.4: init %C to file.%d_val.var = class_init (%.loc7_24.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc7_1: init %C = converted %.loc7_24.1, %.loc7_24.4 [concrete = constants.%C.val] @@ -174,7 +174,7 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: %.loc8_27.1: ref %empty_tuple.type = class_element_access %d_val.ref, element0 [concrete = constants.%.cad] // CHECK:STDOUT: %.loc8_29.1: %struct_type.v = struct_literal (%.loc8_27.1) [concrete = constants.%struct.d07] // CHECK:STDOUT: %.loc8_29.2: ref %empty_tuple.type = class_element_access file.%c_val.var, element0 [concrete = constants.%.da4] -// CHECK:STDOUT: %.loc8_27.2: init %empty_tuple.type to %.loc8_29.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_27.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc8_29.3: init %empty_tuple.type = converted %.loc8_27.1, %.loc8_27.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc8_29.4: init %C to file.%c_val.var = class_init (%.loc8_29.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc8_1: init %C = converted %.loc8_29.1, %.loc8_29.4 [concrete = constants.%C.val] @@ -184,7 +184,7 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: %.loc9_27.1: ref %empty_tuple.type = class_element_access %c_val.ref, element0 [concrete = constants.%.da4] // CHECK:STDOUT: %.loc9_29.1: %struct_type.v = struct_literal (%.loc9_27.1) [concrete = constants.%struct.f0b] // CHECK:STDOUT: %.loc9_29.2: ref %empty_tuple.type = class_element_access file.%b_val.var, element0 [concrete = constants.%.0f2] -// CHECK:STDOUT: %.loc9_27.2: init %empty_tuple.type to %.loc9_29.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_27.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc9_29.3: init %empty_tuple.type = converted %.loc9_27.1, %.loc9_27.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc9_29.4: init %C to file.%b_val.var = class_init (%.loc9_29.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc9_1: init %C = converted %.loc9_29.1, %.loc9_29.4 [concrete = constants.%C.val] @@ -194,7 +194,7 @@ var a_val: a = {.v = b_val.v}; // CHECK:STDOUT: %.loc10_27.1: ref %empty_tuple.type = class_element_access %b_val.ref, element0 [concrete = constants.%.0f2] // CHECK:STDOUT: %.loc10_29.1: %struct_type.v = struct_literal (%.loc10_27.1) [concrete = constants.%struct.938] // CHECK:STDOUT: %.loc10_29.2: ref %empty_tuple.type = class_element_access file.%a_val.var, element0 [concrete = constants.%.851] -// CHECK:STDOUT: %.loc10_27.2: init %empty_tuple.type to %.loc10_29.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc10_27.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc10_29.3: init %empty_tuple.type = converted %.loc10_27.1, %.loc10_27.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc10_29.4: init %C to file.%a_val.var = class_init (%.loc10_29.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc10_1: init %C = converted %.loc10_29.1, %.loc10_29.4 [concrete = constants.%C.val] diff --git a/toolchain/check/testdata/array/basics.carbon b/toolchain/check/testdata/array/basics.carbon index b1fbe8478f68..d6a48ab4d325 100644 --- a/toolchain/check/testdata/array/basics.carbon +++ b/toolchain/check/testdata/array/basics.carbon @@ -147,17 +147,17 @@ var a: array(1, 1); // CHECK:STDOUT: %tuple.elem0: ref %empty_tuple.type = tuple_access %a.ref, element0 [concrete = constants.%tuple.elem0] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc6_23.1: ref %empty_tuple.type = array_index file.%b.var, %int_0 -// CHECK:STDOUT: %.loc6_23.2: init %empty_tuple.type to %.loc6_23.1 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc6_23.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_23.3: init %empty_tuple.type = converted %tuple.elem0, %.loc6_23.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %tuple.elem1: ref %empty_tuple.type = tuple_access %a.ref, element1 [concrete = constants.%tuple.elem1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: %.loc6_23.4: ref %empty_tuple.type = array_index file.%b.var, %int_1 -// CHECK:STDOUT: %.loc6_23.5: init %empty_tuple.type to %.loc6_23.4 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc6_23.5: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_23.6: init %empty_tuple.type = converted %tuple.elem1, %.loc6_23.5 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %tuple.elem2: ref %empty_tuple.type = tuple_access %a.ref, element2 [concrete = constants.%tuple.elem2] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2] // CHECK:STDOUT: %.loc6_23.7: ref %empty_tuple.type = array_index file.%b.var, %int_2 -// CHECK:STDOUT: %.loc6_23.8: init %empty_tuple.type to %.loc6_23.7 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc6_23.8: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_23.9: init %empty_tuple.type = converted %tuple.elem2, %.loc6_23.8 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_23.10: init %array_type to file.%b.var = array_init (%.loc6_23.3, %.loc6_23.6, %.loc6_23.9) [concrete = constants.%array] // CHECK:STDOUT: %.loc6_1: init %array_type = converted %a.ref, %.loc6_23.10 [concrete = constants.%array] @@ -325,7 +325,7 @@ var a: array(1, 1); // CHECK:STDOUT: %tuple.elem0: ref %empty_tuple.type = tuple_access %.loc8_27.2, element0 // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc8_27.3: ref %empty_tuple.type = array_index %t.var, %int_0 -// CHECK:STDOUT: %.loc8_27.4: init %empty_tuple.type to %.loc8_27.3 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_27.4: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc8_27.5: init %empty_tuple.type = converted %tuple.elem0, %.loc8_27.4 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc8_27.6: init %array_type to %t.var = array_init (%.loc8_27.5) [concrete = constants.%array] // CHECK:STDOUT: %.loc8_3: init %array_type = converted %F.call, %.loc8_27.6 [concrete = constants.%array] @@ -403,47 +403,47 @@ var a: array(1, 1); // CHECK:STDOUT: %tuple.elem0.loc9: ref %empty_tuple.type = tuple_access %a.ref, element0 [concrete = constants.%tuple.elem0] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc9_23.1: ref %empty_tuple.type = array_index file.%b.var, %int_0 -// CHECK:STDOUT: %.loc9_23.2: init %empty_tuple.type to %.loc9_23.1 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_23.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc9_23.3: init %empty_tuple.type = converted %tuple.elem0.loc9, %.loc9_23.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %tuple.elem1.loc9: ref %empty_tuple.type = tuple_access %a.ref, element1 [concrete = constants.%tuple.elem1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: %.loc9_23.4: ref %empty_tuple.type = array_index file.%b.var, %int_1 -// CHECK:STDOUT: %.loc9_23.5: init %empty_tuple.type to %.loc9_23.4 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_23.5: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc9_23.6: init %empty_tuple.type = converted %tuple.elem1.loc9, %.loc9_23.5 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %tuple.elem2.loc9: ref %empty_tuple.type = tuple_access %a.ref, element2 [concrete = constants.%tuple.elem2] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2] // CHECK:STDOUT: %.loc9_23.7: ref %empty_tuple.type = array_index file.%b.var, %int_2 -// CHECK:STDOUT: %.loc9_23.8: init %empty_tuple.type to %.loc9_23.7 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_23.8: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc9_23.9: init %empty_tuple.type = converted %tuple.elem2.loc9, %.loc9_23.8 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %tuple.elem3.loc9: ref %empty_tuple.type = tuple_access %a.ref, element3 [concrete = constants.%tuple.elem3] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3] // CHECK:STDOUT: %.loc9_23.10: ref %empty_tuple.type = array_index file.%b.var, %int_3 -// CHECK:STDOUT: %.loc9_23.11: init %empty_tuple.type to %.loc9_23.10 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_23.11: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc9_23.12: init %empty_tuple.type = converted %tuple.elem3.loc9, %.loc9_23.11 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %tuple.elem4.loc9: ref %empty_tuple.type = tuple_access %a.ref, element4 [concrete = constants.%tuple.elem4] // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4] // CHECK:STDOUT: %.loc9_23.13: ref %empty_tuple.type = array_index file.%b.var, %int_4 -// CHECK:STDOUT: %.loc9_23.14: init %empty_tuple.type to %.loc9_23.13 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_23.14: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc9_23.15: init %empty_tuple.type = converted %tuple.elem4.loc9, %.loc9_23.14 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %tuple.elem5.loc9: ref %empty_tuple.type = tuple_access %a.ref, element5 [concrete = constants.%tuple.elem5] // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5] // CHECK:STDOUT: %.loc9_23.16: ref %empty_tuple.type = array_index file.%b.var, %int_5 -// CHECK:STDOUT: %.loc9_23.17: init %empty_tuple.type to %.loc9_23.16 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_23.17: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc9_23.18: init %empty_tuple.type = converted %tuple.elem5.loc9, %.loc9_23.17 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %tuple.elem6.loc9: ref %empty_tuple.type = tuple_access %a.ref, element6 [concrete = constants.%tuple.elem6] // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete = constants.%int_6] // CHECK:STDOUT: %.loc9_23.19: ref %empty_tuple.type = array_index file.%b.var, %int_6 -// CHECK:STDOUT: %.loc9_23.20: init %empty_tuple.type to %.loc9_23.19 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_23.20: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc9_23.21: init %empty_tuple.type = converted %tuple.elem6.loc9, %.loc9_23.20 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %tuple.elem7.loc9: ref %empty_tuple.type = tuple_access %a.ref, element7 [concrete = constants.%tuple.elem7] // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [concrete = constants.%int_7] // CHECK:STDOUT: %.loc9_23.22: ref %empty_tuple.type = array_index file.%b.var, %int_7 -// CHECK:STDOUT: %.loc9_23.23: init %empty_tuple.type to %.loc9_23.22 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_23.23: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc9_23.24: init %empty_tuple.type = converted %tuple.elem7.loc9, %.loc9_23.23 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %tuple.elem8.loc9: ref %empty_tuple.type = tuple_access %a.ref, element8 [concrete = constants.%tuple.elem8] // CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8] // CHECK:STDOUT: %.loc9_23.25: ref %empty_tuple.type = array_index file.%b.var, %int_8 -// CHECK:STDOUT: %.loc9_23.26: init %empty_tuple.type to %.loc9_23.25 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_23.26: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc9_23.27: init %empty_tuple.type = converted %tuple.elem8.loc9, %.loc9_23.26 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc9_23.28: init %array_type to file.%b.var = array_init (%.loc9_23.3, %.loc9_23.6, %.loc9_23.9, %.loc9_23.12, %.loc9_23.15, %.loc9_23.18, %.loc9_23.21, %.loc9_23.24, %.loc9_23.27) [concrete = constants.%array] // CHECK:STDOUT: %.loc9_1: init %array_type = converted %a.ref, %.loc9_23.28 [concrete = constants.%array] diff --git a/toolchain/check/testdata/array/index_not_literal.carbon b/toolchain/check/testdata/array/index_not_literal.carbon index ca75744945d0..f9e17db36ed1 100644 --- a/toolchain/check/testdata/array/index_not_literal.carbon +++ b/toolchain/check/testdata/array/index_not_literal.carbon @@ -138,7 +138,7 @@ fn F(a: array({}, 3)) -> {} { // CHECK:STDOUT: %.loc10_20.3: ref %array_type = temporary_storage // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc10_20.4: ref %i32 = array_index %.loc10_20.3, %int_0 -// CHECK:STDOUT: %.loc10_20.5: init %i32 to %.loc10_20.4 = initialize_from %.loc10_20.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc10_20.5: init %i32 to %.loc10_20.4 = in_place_init %.loc10_20.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc10_20.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc10_20.3: = bound_method %int_2.loc10_16, %impl.elem0.loc10_20.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc10_20.2: = specific_function %impl.elem0.loc10_20.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -147,7 +147,7 @@ fn F(a: array({}, 3)) -> {} { // CHECK:STDOUT: %.loc10_20.6: init %i32 = converted %int_2.loc10_16, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_20.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc10_20: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc10_20.7: ref %i32 = array_index %.loc10_20.3, %int_1.loc10_20 -// CHECK:STDOUT: %.loc10_20.8: init %i32 to %.loc10_20.7 = initialize_from %.loc10_20.6 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc10_20.8: init %i32 to %.loc10_20.7 = in_place_init %.loc10_20.6 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc10_20.3: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc10_20.5: = bound_method %int_3, %impl.elem0.loc10_20.3 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] // CHECK:STDOUT: %specific_fn.loc10_20.3: = specific_function %impl.elem0.loc10_20.3, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -156,7 +156,7 @@ fn F(a: array({}, 3)) -> {} { // CHECK:STDOUT: %.loc10_20.9: init %i32 = converted %int_3, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_20.3 [concrete = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc10_20: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc10_20.10: ref %i32 = array_index %.loc10_20.3, %int_2.loc10_20 -// CHECK:STDOUT: %.loc10_20.11: init %i32 to %.loc10_20.10 = initialize_from %.loc10_20.9 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc10_20.11: init %i32 to %.loc10_20.10 = in_place_init %.loc10_20.9 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc10_20.12: init %array_type to %.loc10_20.3 = array_init (%.loc10_20.5, %.loc10_20.8, %.loc10_20.11) [concrete = constants.%array] // CHECK:STDOUT: %.loc10_20.13: init %array_type = converted %.loc10_20.1, %.loc10_20.12 [concrete = constants.%array] // CHECK:STDOUT: %.loc10_20.14: ref %array_type = temporary %.loc10_20.3, %.loc10_20.13 diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index 8ca58a104e27..c13b6b7da18d 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -406,7 +406,7 @@ var b: B = {.x = ()} as B; // CHECK:STDOUT: %.loc14_34.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14_34.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc14_34.3: ref %A = temporary_storage // CHECK:STDOUT: %.loc14_34.4: ref %i32 = class_element_access %.loc14_34.3, element0 -// CHECK:STDOUT: %.loc14_34.5: init %i32 to %.loc14_34.4 = initialize_from %.loc14_34.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc14_34.5: init %i32 to %.loc14_34.4 = in_place_init %.loc14_34.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc14_34.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc14_34.3: = bound_method %int_2, %impl.elem0.loc14_34.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc14_34.2: = specific_function %impl.elem0.loc14_34.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -414,7 +414,7 @@ var b: B = {.x = ()} as B; // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14_34.2: init %i32 = call %bound_method.loc14_34.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_34.6: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14_34.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_34.7: ref %i32 = class_element_access %.loc14_34.3, element1 -// CHECK:STDOUT: %.loc14_34.8: init %i32 to %.loc14_34.7 = initialize_from %.loc14_34.6 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc14_34.8: init %i32 to %.loc14_34.7 = in_place_init %.loc14_34.6 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc14_34.9: init %A to %.loc14_34.3 = class_init (%.loc14_34.5, %.loc14_34.8) [concrete = constants.%A.val] // CHECK:STDOUT: %.loc14_34.10: ref %A = temporary %.loc14_34.3, %.loc14_34.9 // CHECK:STDOUT: %.loc14_36: ref %A = converted %.loc14_34.1, %.loc14_34.10 diff --git a/toolchain/check/testdata/as/basics.carbon b/toolchain/check/testdata/as/basics.carbon index d42b914d45f5..95120e608804 100644 --- a/toolchain/check/testdata/as/basics.carbon +++ b/toolchain/check/testdata/as/basics.carbon @@ -160,11 +160,11 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: %.loc6_29.1: %struct_type.x.y = converted %.loc6_27.1, %struct [concrete = constants.%struct.005] // CHECK:STDOUT: %.loc6_29.2: %empty_tuple.type = struct_access %.loc6_29.1, element0 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_29.3: ref %empty_tuple.type = struct_access %return.param, element0 -// CHECK:STDOUT: %.loc6_29.4: init %empty_tuple.type to %.loc6_29.3 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc6_29.4: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_29.5: init %empty_tuple.type = converted %.loc6_29.2, %.loc6_29.4 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_29.6: %empty_tuple.type = struct_access %.loc6_29.1, element1 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_29.7: ref %empty_tuple.type = struct_access %return.param, element1 -// CHECK:STDOUT: %.loc6_29.8: init %empty_tuple.type to %.loc6_29.7 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc6_29.8: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_29.9: init %empty_tuple.type = converted %.loc6_29.6, %.loc6_29.8 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_29.10: init %struct_type.x.y to %return.param = struct_init (%.loc6_29.5, %.loc6_29.9) [concrete = constants.%struct.005] // CHECK:STDOUT: %.loc6_48: init %struct_type.x.y = converted %.loc6_29.1, %.loc6_29.10 [concrete = constants.%struct.005] @@ -402,7 +402,7 @@ let n: {.x: ()} = {.x = ()} as {.x = ()}; // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X] // CHECK:STDOUT: %.loc19_21.2: ref %X = temporary_storage // CHECK:STDOUT: %.loc19_21.3: ref %empty_tuple.type = class_element_access %.loc19_21.2, element0 -// CHECK:STDOUT: %.loc19_20.2: init %empty_tuple.type to %.loc19_21.3 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc19_20.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc19_21.4: init %empty_tuple.type = converted %.loc19_20.1, %.loc19_20.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc19_21.5: init %X to %.loc19_21.2 = class_init (%.loc19_21.4) [concrete = constants.%X.val] // CHECK:STDOUT: %.loc19_21.6: ref %X = temporary %.loc19_21.2, %.loc19_21.5 diff --git a/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon b/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon index 39b02c4e75df..e47bde3ff806 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/one_file.carbon @@ -784,9 +784,9 @@ fn Foo[T:! type](p: T*) -> (T*, ()) { // CHECK:STDOUT: inst6000016C: {kind: BoundMethod, arg0: inst60000046, arg1: inst60000169, type: type(inst(BoundMethodType))} // CHECK:STDOUT: inst6000016D: {kind: RequireCompleteType, arg0: inst6000001C, type: type(inst(WitnessType))} // CHECK:STDOUT: inst6000016E: {kind: Call, arg0: inst6000016C, arg1: inst_block6000007F, type: type(symbolic_constant60000004)} -// CHECK:STDOUT: inst6000016F: {kind: InitializeFrom, arg0: inst6000016E, arg1: inst6000004A, type: type(symbolic_constant60000004)} +// CHECK:STDOUT: inst6000016F: {kind: InPlaceInit, arg0: inst6000016E, arg1: inst6000004A, type: type(symbolic_constant60000004)} // CHECK:STDOUT: inst60000170: {kind: TupleAccess, arg0: inst6000003A, arg1: element1, type: type(inst60000025)} -// CHECK:STDOUT: inst60000171: {kind: TupleInit, arg0: inst_block_empty, arg1: inst60000170, type: type(inst60000025)} +// CHECK:STDOUT: inst60000171: {kind: TupleInit, arg0: inst_block_empty, arg1: inst, type: type(inst60000025)} // CHECK:STDOUT: inst60000172: {kind: Converted, arg0: inst60000047, arg1: inst60000171, type: type(inst60000025)} // CHECK:STDOUT: inst60000173: {kind: TupleInit, arg0: inst_block60000080, arg1: inst6000003A, type: type(symbolic_constant6000000A)} // CHECK:STDOUT: inst60000174: {kind: Converted, arg0: inst60000048, arg1: inst60000173, type: type(symbolic_constant6000000A)} diff --git a/toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon b/toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon index fc01247e24ed..08dedf7d050a 100644 --- a/toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon +++ b/toolchain/check/testdata/basics/raw_sem_ir/one_file_with_textual_ir.carbon @@ -97,10 +97,10 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: inst6000002E: {kind: TupleLiteral, arg0: inst_block_empty, type: type(inst60000010)} // CHECK:STDOUT: inst6000002F: {kind: TupleLiteral, arg0: inst_block60000010, type: type(inst6000001A)} // CHECK:STDOUT: inst60000030: {kind: TupleAccess, arg0: inst60000028, arg1: element0, type: type(inst60000010)} -// CHECK:STDOUT: inst60000031: {kind: TupleInit, arg0: inst_block60000011, arg1: inst60000030, type: type(inst60000010)} +// CHECK:STDOUT: inst60000031: {kind: TupleInit, arg0: inst_block60000011, arg1: inst, type: type(inst60000010)} // CHECK:STDOUT: inst60000032: {kind: Converted, arg0: inst6000002D, arg1: inst60000031, type: type(inst60000010)} // CHECK:STDOUT: inst60000033: {kind: TupleAccess, arg0: inst60000028, arg1: element1, type: type(inst60000010)} -// CHECK:STDOUT: inst60000034: {kind: TupleInit, arg0: inst_block_empty, arg1: inst60000033, type: type(inst60000010)} +// CHECK:STDOUT: inst60000034: {kind: TupleInit, arg0: inst_block_empty, arg1: inst, type: type(inst60000010)} // CHECK:STDOUT: inst60000035: {kind: Converted, arg0: inst6000002E, arg1: inst60000034, type: type(inst60000010)} // CHECK:STDOUT: inst60000036: {kind: TupleInit, arg0: inst_block60000012, arg1: inst60000028, type: type(inst6000001A)} // CHECK:STDOUT: inst60000037: {kind: Converted, arg0: inst6000002F, arg1: inst60000036, type: type(inst6000001A)} @@ -271,10 +271,10 @@ fn Foo(n: ()) -> ((), ()) { // CHECK:STDOUT: %.loc17_15.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc17_16.1: %tuple.type = tuple_literal (%n.ref, %.loc17_15.1) // CHECK:STDOUT: %tuple.elem0: ref %empty_tuple.type = tuple_access %return.param, element0 -// CHECK:STDOUT: %.loc17_11: init %empty_tuple.type to %tuple.elem0 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc17_11: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc17_16.2: init %empty_tuple.type = converted %n.ref, %.loc17_11 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %tuple.elem1: ref %empty_tuple.type = tuple_access %return.param, element1 -// CHECK:STDOUT: %.loc17_15.2: init %empty_tuple.type to %tuple.elem1 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc17_15.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc17_16.3: init %empty_tuple.type = converted %.loc17_15.1, %.loc17_15.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc17_16.4: init %tuple.type to %return.param = tuple_init (%.loc17_16.2, %.loc17_16.3) [concrete = constants.%tuple] // CHECK:STDOUT: %.loc17_17: init %tuple.type = converted %.loc17_16.1, %.loc17_16.4 [concrete = constants.%tuple] diff --git a/toolchain/check/testdata/choice/basic.carbon b/toolchain/check/testdata/choice/basic.carbon index 894bee37d2b0..a90f0330b543 100644 --- a/toolchain/check/testdata/choice/basic.carbon +++ b/toolchain/check/testdata/choice/basic.carbon @@ -114,7 +114,7 @@ let never: Never = {}; // CHECK:STDOUT: %.loc6_1.3: %struct_type.discriminant = struct_literal (%.loc6_1.2) [concrete = constants.%struct] // CHECK:STDOUT: %.loc6_1.4: ref %Always = temporary_storage // CHECK:STDOUT: %.loc6_1.5: ref %empty_tuple.type = class_element_access %.loc6_1.4, element0 -// CHECK:STDOUT: %.loc6_1.6: init %empty_tuple.type to %.loc6_1.5 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc6_1.6: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_1.7: init %empty_tuple.type = converted %.loc6_1.2, %.loc6_1.6 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_1.8: init %Always to %.loc6_1.4 = class_init (%.loc6_1.7) [concrete = constants.%Always.val] // CHECK:STDOUT: %.loc6_1.9: ref %Always = temporary %.loc6_1.4, %.loc6_1.8 @@ -250,7 +250,7 @@ let never: Never = {}; // CHECK:STDOUT: %UInt.as.Copy.impl.Op.call.loc5: init %u2 = call %bound_method.loc5_7.4(%.loc5_7.2) [concrete = constants.%int_0.9fd] // CHECK:STDOUT: %.loc5_7.4: ref %Ordering = temporary_storage // CHECK:STDOUT: %.loc5_7.5: ref %u2 = class_element_access %.loc5_7.4, element0 -// CHECK:STDOUT: %.loc5_7.6: init %u2 to %.loc5_7.5 = initialize_from %UInt.as.Copy.impl.Op.call.loc5 [concrete = constants.%int_0.9fd] +// CHECK:STDOUT: %.loc5_7.6: init %u2 to %.loc5_7.5 = in_place_init %UInt.as.Copy.impl.Op.call.loc5 [concrete = constants.%int_0.9fd] // CHECK:STDOUT: %.loc5_7.7: init %Ordering to %.loc5_7.4 = class_init (%.loc5_7.6) [concrete = constants.%Ordering.val.9ea] // CHECK:STDOUT: %.loc5_7.8: ref %Ordering = temporary %.loc5_7.4, %.loc5_7.7 // CHECK:STDOUT: %.loc5_7.9: ref %Ordering = converted %.loc5_7.3, %.loc5_7.8 @@ -272,7 +272,7 @@ let never: Never = {}; // CHECK:STDOUT: %UInt.as.Copy.impl.Op.call.loc6: init %u2 = call %bound_method.loc6_13.4(%.loc6_13.2) [concrete = constants.%int_1.b2c] // CHECK:STDOUT: %.loc6_13.4: ref %Ordering = temporary_storage // CHECK:STDOUT: %.loc6_13.5: ref %u2 = class_element_access %.loc6_13.4, element0 -// CHECK:STDOUT: %.loc6_13.6: init %u2 to %.loc6_13.5 = initialize_from %UInt.as.Copy.impl.Op.call.loc6 [concrete = constants.%int_1.b2c] +// CHECK:STDOUT: %.loc6_13.6: init %u2 to %.loc6_13.5 = in_place_init %UInt.as.Copy.impl.Op.call.loc6 [concrete = constants.%int_1.b2c] // CHECK:STDOUT: %.loc6_13.7: init %Ordering to %.loc6_13.4 = class_init (%.loc6_13.6) [concrete = constants.%Ordering.val.d41] // CHECK:STDOUT: %.loc6_13.8: ref %Ordering = temporary %.loc6_13.4, %.loc6_13.7 // CHECK:STDOUT: %.loc6_13.9: ref %Ordering = converted %.loc6_13.3, %.loc6_13.8 @@ -294,7 +294,7 @@ let never: Never = {}; // CHECK:STDOUT: %UInt.as.Copy.impl.Op.call.loc7: init %u2 = call %bound_method.loc7_10.4(%.loc7_10.2) [concrete = constants.%int_2.788] // CHECK:STDOUT: %.loc7_10.4: ref %Ordering = temporary_storage // CHECK:STDOUT: %.loc7_10.5: ref %u2 = class_element_access %.loc7_10.4, element0 -// CHECK:STDOUT: %.loc7_10.6: init %u2 to %.loc7_10.5 = initialize_from %UInt.as.Copy.impl.Op.call.loc7 [concrete = constants.%int_2.788] +// CHECK:STDOUT: %.loc7_10.6: init %u2 to %.loc7_10.5 = in_place_init %UInt.as.Copy.impl.Op.call.loc7 [concrete = constants.%int_2.788] // CHECK:STDOUT: %.loc7_10.7: init %Ordering to %.loc7_10.4 = class_init (%.loc7_10.6) [concrete = constants.%Ordering.val.e86] // CHECK:STDOUT: %.loc7_10.8: ref %Ordering = temporary %.loc7_10.4, %.loc7_10.7 // CHECK:STDOUT: %.loc7_10.9: ref %Ordering = converted %.loc7_10.3, %.loc7_10.8 @@ -316,7 +316,7 @@ let never: Never = {}; // CHECK:STDOUT: %UInt.as.Copy.impl.Op.call.loc9: init %u2 = call %bound_method.loc9_1.4(%.loc9_1.2) [concrete = constants.%int_3.975] // CHECK:STDOUT: %.loc9_1.4: ref %Ordering = temporary_storage // CHECK:STDOUT: %.loc9_1.5: ref %u2 = class_element_access %.loc9_1.4, element0 -// CHECK:STDOUT: %.loc9_1.6: init %u2 to %.loc9_1.5 = initialize_from %UInt.as.Copy.impl.Op.call.loc9 [concrete = constants.%int_3.975] +// CHECK:STDOUT: %.loc9_1.6: init %u2 to %.loc9_1.5 = in_place_init %UInt.as.Copy.impl.Op.call.loc9 [concrete = constants.%int_3.975] // CHECK:STDOUT: %.loc9_1.7: init %Ordering to %.loc9_1.4 = class_init (%.loc9_1.6) [concrete = constants.%Ordering.val.a17] // CHECK:STDOUT: %.loc9_1.8: ref %Ordering = temporary %.loc9_1.4, %.loc9_1.7 // CHECK:STDOUT: %.loc9_1.9: ref %Ordering = converted %.loc9_1.3, %.loc9_1.8 diff --git a/toolchain/check/testdata/choice/generic.carbon b/toolchain/check/testdata/choice/generic.carbon index 3eb5fa40b7ea..a18090840756 100644 --- a/toolchain/check/testdata/choice/generic.carbon +++ b/toolchain/check/testdata/choice/generic.carbon @@ -61,7 +61,7 @@ choice Always(T:! type) { // CHECK:STDOUT: %.loc16_1.3: %struct_type.discriminant = struct_literal (%.loc16_1.2) [concrete = constants.%struct] // CHECK:STDOUT: %.loc16_1.4: ref @Always.%Always (%Always) = temporary_storage // CHECK:STDOUT: %.loc16_1.5: ref %empty_tuple.type = class_element_access %.loc16_1.4, element0 -// CHECK:STDOUT: %.loc16_1.6: init %empty_tuple.type to %.loc16_1.5 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc16_1.6: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc16_1.7: init %empty_tuple.type = converted %.loc16_1.2, %.loc16_1.6 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc16_1.8: init @Always.%Always (%Always) to %.loc16_1.4 = class_init (%.loc16_1.7) [symbolic = %Always.val (constants.%Always.val)] // CHECK:STDOUT: %.loc16_1.9: ref @Always.%Always (%Always) = temporary %.loc16_1.4, %.loc16_1.8 diff --git a/toolchain/check/testdata/class/access_modifers.carbon b/toolchain/check/testdata/class/access_modifers.carbon index eac2b01a7aa0..2ad542248e8b 100644 --- a/toolchain/check/testdata/class/access_modifers.carbon +++ b/toolchain/check/testdata/class/access_modifers.carbon @@ -300,7 +300,7 @@ class A { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc13_24.2(%int_5) [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc13_24.2: init %i32 = converted %int_5, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc13_24.3: ref %i32 = class_element_access %return.param, element0 -// CHECK:STDOUT: %.loc13_24.4: init %i32 to %.loc13_24.3 = initialize_from %.loc13_24.2 [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %.loc13_24.4: init %i32 to %.loc13_24.3 = in_place_init %.loc13_24.2 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc13_24.5: init %Circle to %return.param = class_init (%.loc13_24.4) [concrete = constants.%Circle.val] // CHECK:STDOUT: %.loc13_25: init %Circle = converted %.loc13_24.1, %.loc13_24.5 [concrete = constants.%Circle.val] // CHECK:STDOUT: return %.loc13_25 to %return.param diff --git a/toolchain/check/testdata/class/adapter/adapt_copy.carbon b/toolchain/check/testdata/class/adapter/adapt_copy.carbon index b6b251d5b377..c2accceb2d45 100644 --- a/toolchain/check/testdata/class/adapter/adapt_copy.carbon +++ b/toolchain/check/testdata/class/adapter/adapt_copy.carbon @@ -173,7 +173,6 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] -// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic] // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete] // CHECK:STDOUT: %complete_type.f8a: = complete_type_witness %i32.builtin [concrete] @@ -182,7 +181,6 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %F.type: type = fn_type @F [concrete] // CHECK:STDOUT: %F: %F.type = struct_value () [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] -// CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %DestroyOp.type.3e79c2.1: type = fn_type @DestroyOp.loc16 [concrete] // CHECK:STDOUT: %DestroyOp.b0ebf8.1: %DestroyOp.type.3e79c2.1 = struct_value () [concrete] @@ -196,14 +194,6 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %.25c: form = init_form %tuple.type.d78, call_param1 [concrete] // CHECK:STDOUT: %InTuple.type: type = fn_type @InTuple [concrete] // CHECK:STDOUT: %InTuple: %InTuple.type = struct_value () [concrete] -// CHECK:STDOUT: %UInt.as.Copy.impl.Op.type.68f: type = fn_type @UInt.as.Copy.impl.Op, @UInt.as.Copy.impl(%N) [symbolic] -// CHECK:STDOUT: %UInt.as.Copy.impl.Op.576: %UInt.as.Copy.impl.Op.type.68f = struct_value () [symbolic] -// CHECK:STDOUT: %Copy.impl_witness.514: = impl_witness imports.%Copy.impl_witness_table.bd0, @UInt.as.Copy.impl(%int_32) [concrete] -// CHECK:STDOUT: %UInt.as.Copy.impl.Op.type.2fc: type = fn_type @UInt.as.Copy.impl.Op, @UInt.as.Copy.impl(%int_32) [concrete] -// CHECK:STDOUT: %UInt.as.Copy.impl.Op.c10: %UInt.as.Copy.impl.Op.type.2fc = struct_value () [concrete] -// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %u32, (%Copy.impl_witness.514) [concrete] -// CHECK:STDOUT: %.fcc: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete] -// CHECK:STDOUT: %UInt.as.Copy.impl.Op.specific_fn: = specific_function %UInt.as.Copy.impl.Op.c10, @UInt.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %DestroyOp.type.3e79c2.2: type = fn_type @DestroyOp.loc35 [concrete] // CHECK:STDOUT: %DestroyOp.b0ebf8.2: %DestroyOp.type.3e79c2.2 = struct_value () [concrete] // CHECK:STDOUT: } @@ -221,8 +211,6 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type] // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: %Core.UInt: %UInt.type = import_ref Core//prelude/parts/uint, UInt, loaded [concrete = constants.%UInt.generic] -// CHECK:STDOUT: %Core.import_ref.c3c: @UInt.as.Copy.impl.%UInt.as.Copy.impl.Op.type (%UInt.as.Copy.impl.Op.type.68f) = import_ref Core//prelude/parts/uint, loc{{\d+_\d+}}, loaded [symbolic = @UInt.as.Copy.impl.%UInt.as.Copy.impl.Op (constants.%UInt.as.Copy.impl.Op.576)] -// CHECK:STDOUT: %Copy.impl_witness_table.bd0 = impl_witness_table (%Core.import_ref.c3c), @UInt.as.Copy.impl [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -313,20 +301,8 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: } // CHECK:STDOUT: %d.var: ref %tuple.type.d78 = var %d.var_patt // CHECK:STDOUT: %c.ref: %tuple.type.d78 = name_ref c, %c -// CHECK:STDOUT: %tuple.elem0.loc35_33.1: %AdaptCopyable = tuple_access %c.ref, element0 -// CHECK:STDOUT: %tuple.elem0.loc35_33.2: ref %AdaptCopyable = tuple_access %d.var, element0 -// CHECK:STDOUT: %.loc35_33.1: init %AdaptCopyable to %tuple.elem0.loc35_33.2 = initialize_from [concrete = ] -// CHECK:STDOUT: %tuple.elem1.loc35_33.1: %u32 = tuple_access %c.ref, element1 -// CHECK:STDOUT: %impl.elem0.loc35: %.fcc = impl_witness_access constants.%Copy.impl_witness.514, element0 [concrete = constants.%UInt.as.Copy.impl.Op.c10] -// CHECK:STDOUT: %bound_method.loc35_33.1: = bound_method %tuple.elem1.loc35_33.1, %impl.elem0.loc35 -// CHECK:STDOUT: %specific_fn.loc35: = specific_function %impl.elem0.loc35, @UInt.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%UInt.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc35_33.2: = bound_method %tuple.elem1.loc35_33.1, %specific_fn.loc35 -// CHECK:STDOUT: %UInt.as.Copy.impl.Op.call.loc35: init %u32 = call %bound_method.loc35_33.2(%tuple.elem1.loc35_33.1) -// CHECK:STDOUT: %tuple.elem1.loc35_33.2: ref %u32 = tuple_access %d.var, element1 -// CHECK:STDOUT: %.loc35_33.2: init %u32 to %tuple.elem1.loc35_33.2 = initialize_from %UInt.as.Copy.impl.Op.call.loc35 -// CHECK:STDOUT: %.loc35_33.3: init %tuple.type.d78 to %d.var = tuple_init (%.loc35_33.1, %.loc35_33.2) -// CHECK:STDOUT: %.loc35_3: init %tuple.type.d78 = converted %c.ref, %.loc35_33.3 -// CHECK:STDOUT: assign %d.var, %.loc35_3 +// CHECK:STDOUT: %tuple.elem0.loc35: %AdaptCopyable = tuple_access %c.ref, element0 +// CHECK:STDOUT: assign %d.var, // CHECK:STDOUT: %.loc35_29.1: type = splice_block %.loc35_29.3 [concrete = constants.%tuple.type.d78] { // CHECK:STDOUT: %AdaptCopyable.ref.loc35: type = name_ref AdaptCopyable, file.%AdaptCopyable.decl [concrete = constants.%AdaptCopyable] // CHECK:STDOUT: %int_32.loc35: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] @@ -336,24 +312,11 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: } // CHECK:STDOUT: %d: ref %tuple.type.d78 = ref_binding d, %d.var // CHECK:STDOUT: %d.ref: ref %tuple.type.d78 = name_ref d, %d -// CHECK:STDOUT: %tuple.elem0.loc43_10.1: ref %AdaptCopyable = tuple_access %d.ref, element0 -// CHECK:STDOUT: %.loc43_10.1: %AdaptCopyable = acquire_value %tuple.elem0.loc43_10.1 -// CHECK:STDOUT: %tuple.elem0.loc43_10.2: ref %AdaptCopyable = tuple_access %return.param, element0 -// CHECK:STDOUT: %.loc43_10.2: init %AdaptCopyable to %tuple.elem0.loc43_10.2 = initialize_from [concrete = ] -// CHECK:STDOUT: %tuple.elem1.loc43_10.1: ref %u32 = tuple_access %d.ref, element1 -// CHECK:STDOUT: %.loc43_10.3: %u32 = acquire_value %tuple.elem1.loc43_10.1 -// CHECK:STDOUT: %impl.elem0.loc43: %.fcc = impl_witness_access constants.%Copy.impl_witness.514, element0 [concrete = constants.%UInt.as.Copy.impl.Op.c10] -// CHECK:STDOUT: %bound_method.loc43_10.1: = bound_method %.loc43_10.3, %impl.elem0.loc43 -// CHECK:STDOUT: %specific_fn.loc43: = specific_function %impl.elem0.loc43, @UInt.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%UInt.as.Copy.impl.Op.specific_fn] -// CHECK:STDOUT: %bound_method.loc43_10.2: = bound_method %.loc43_10.3, %specific_fn.loc43 -// CHECK:STDOUT: %UInt.as.Copy.impl.Op.call.loc43: init %u32 = call %bound_method.loc43_10.2(%.loc43_10.3) -// CHECK:STDOUT: %tuple.elem1.loc43_10.2: ref %u32 = tuple_access %return.param, element1 -// CHECK:STDOUT: %.loc43_10.4: init %u32 to %tuple.elem1.loc43_10.2 = initialize_from %UInt.as.Copy.impl.Op.call.loc43 -// CHECK:STDOUT: %.loc43_10.5: init %tuple.type.d78 to %return.param = tuple_init (%.loc43_10.2, %.loc43_10.4) -// CHECK:STDOUT: %.loc43_11: init %tuple.type.d78 = converted %d.ref, %.loc43_10.5 +// CHECK:STDOUT: %tuple.elem0.loc43: ref %AdaptCopyable = tuple_access %d.ref, element0 +// CHECK:STDOUT: %.loc43: %AdaptCopyable = acquire_value %tuple.elem0.loc43 // CHECK:STDOUT: %DestroyOp.bound: = bound_method %d.var, constants.%DestroyOp.b0ebf8.2 // CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%d.var) -// CHECK:STDOUT: return %.loc43_11 to %return.param +// CHECK:STDOUT: return to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @DestroyOp.loc35(%self.param: %tuple.type.d78) = "no_op"; @@ -510,7 +473,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc9_3.1: init %i32 = call %bound_method.loc9_3.2(%tuple.elem0.loc9_3.1) // CHECK:STDOUT: %.loc9_3.2: ref %tuple.type.d07 = as_compatible %d.var // CHECK:STDOUT: %tuple.elem0.loc9_3.2: ref %i32 = tuple_access %.loc9_3.2, element0 -// CHECK:STDOUT: %.loc9_3.3: init %i32 to %tuple.elem0.loc9_3.2 = initialize_from %Int.as.Copy.impl.Op.call.loc9_3.1 +// CHECK:STDOUT: %.loc9_3.3: init %i32 to %tuple.elem0.loc9_3.2 = in_place_init %Int.as.Copy.impl.Op.call.loc9_3.1 // CHECK:STDOUT: %tuple.elem1.loc9_3.1: %i32 = tuple_access %.loc9_3.1, element1 // CHECK:STDOUT: %impl.elem0.loc9_3.2: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] // CHECK:STDOUT: %bound_method.loc9_3.3: = bound_method %tuple.elem1.loc9_3.1, %impl.elem0.loc9_3.2 @@ -518,7 +481,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %bound_method.loc9_3.4: = bound_method %tuple.elem1.loc9_3.1, %specific_fn.loc9_3.2 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc9_3.2: init %i32 = call %bound_method.loc9_3.4(%tuple.elem1.loc9_3.1) // CHECK:STDOUT: %tuple.elem1.loc9_3.2: ref %i32 = tuple_access %.loc9_3.2, element1 -// CHECK:STDOUT: %.loc9_3.4: init %i32 to %tuple.elem1.loc9_3.2 = initialize_from %Int.as.Copy.impl.Op.call.loc9_3.2 +// CHECK:STDOUT: %.loc9_3.4: init %i32 to %tuple.elem1.loc9_3.2 = in_place_init %Int.as.Copy.impl.Op.call.loc9_3.2 // CHECK:STDOUT: %.loc9_3.5: init %tuple.type.d07 to %.loc9_3.2 = tuple_init (%.loc9_3.3, %.loc9_3.4) // CHECK:STDOUT: %.loc9_3.6: init %AdaptTuple = as_compatible %.loc9_3.5 // CHECK:STDOUT: %.loc9_3.7: init %AdaptTuple = converted %c.ref, %.loc9_3.6 @@ -536,7 +499,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc10_11.1: init %i32 = call %bound_method.loc10_11.2(%.loc10_11.2) // CHECK:STDOUT: %.loc10_11.3: ref %tuple.type.d07 = as_compatible %return.param // CHECK:STDOUT: %tuple.elem0.loc10_11.2: ref %i32 = tuple_access %.loc10_11.3, element0 -// CHECK:STDOUT: %.loc10_11.4: init %i32 to %tuple.elem0.loc10_11.2 = initialize_from %Int.as.Copy.impl.Op.call.loc10_11.1 +// CHECK:STDOUT: %.loc10_11.4: init %i32 to %tuple.elem0.loc10_11.2 = in_place_init %Int.as.Copy.impl.Op.call.loc10_11.1 // CHECK:STDOUT: %tuple.elem1.loc10_11.1: ref %i32 = tuple_access %.loc10_11.1, element1 // CHECK:STDOUT: %.loc10_11.5: %i32 = acquire_value %tuple.elem1.loc10_11.1 // CHECK:STDOUT: %impl.elem0.loc10_11.2: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] @@ -545,7 +508,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %bound_method.loc10_11.4: = bound_method %.loc10_11.5, %specific_fn.loc10_11.2 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc10_11.2: init %i32 = call %bound_method.loc10_11.4(%.loc10_11.5) // CHECK:STDOUT: %tuple.elem1.loc10_11.2: ref %i32 = tuple_access %.loc10_11.3, element1 -// CHECK:STDOUT: %.loc10_11.6: init %i32 to %tuple.elem1.loc10_11.2 = initialize_from %Int.as.Copy.impl.Op.call.loc10_11.2 +// CHECK:STDOUT: %.loc10_11.6: init %i32 to %tuple.elem1.loc10_11.2 = in_place_init %Int.as.Copy.impl.Op.call.loc10_11.2 // CHECK:STDOUT: %.loc10_11.7: init %tuple.type.d07 to %.loc10_11.3 = tuple_init (%.loc10_11.4, %.loc10_11.6) // CHECK:STDOUT: %.loc10_11.8: init %AdaptTuple = as_compatible %.loc10_11.7 // CHECK:STDOUT: %.loc10_11.9: init %AdaptTuple = converted %d.ref, %.loc10_11.8 @@ -575,7 +538,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %tuple.elem0.loc14_30.3: ref %AdaptTuple = tuple_access %d.var, element0 // CHECK:STDOUT: %.loc14_30.2: ref %tuple.type.d07 = as_compatible %tuple.elem0.loc14_30.3 // CHECK:STDOUT: %tuple.elem0.loc14_30.4: ref %i32 = tuple_access %.loc14_30.2, element0 -// CHECK:STDOUT: %.loc14_30.3: init %i32 to %tuple.elem0.loc14_30.4 = initialize_from %Int.as.Copy.impl.Op.call.loc14_30.1 +// CHECK:STDOUT: %.loc14_30.3: init %i32 to %tuple.elem0.loc14_30.4 = in_place_init %Int.as.Copy.impl.Op.call.loc14_30.1 // CHECK:STDOUT: %tuple.elem1.loc14_30.1: %i32 = tuple_access %.loc14_30.1, element1 // CHECK:STDOUT: %impl.elem0.loc14_30.2: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] // CHECK:STDOUT: %bound_method.loc14_30.3: = bound_method %tuple.elem1.loc14_30.1, %impl.elem0.loc14_30.2 @@ -583,7 +546,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %bound_method.loc14_30.4: = bound_method %tuple.elem1.loc14_30.1, %specific_fn.loc14_30.2 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc14_30.2: init %i32 = call %bound_method.loc14_30.4(%tuple.elem1.loc14_30.1) // CHECK:STDOUT: %tuple.elem1.loc14_30.2: ref %i32 = tuple_access %.loc14_30.2, element1 -// CHECK:STDOUT: %.loc14_30.4: init %i32 to %tuple.elem1.loc14_30.2 = initialize_from %Int.as.Copy.impl.Op.call.loc14_30.2 +// CHECK:STDOUT: %.loc14_30.4: init %i32 to %tuple.elem1.loc14_30.2 = in_place_init %Int.as.Copy.impl.Op.call.loc14_30.2 // CHECK:STDOUT: %.loc14_30.5: init %tuple.type.d07 to %.loc14_30.2 = tuple_init (%.loc14_30.3, %.loc14_30.4) // CHECK:STDOUT: %.loc14_30.6: init %AdaptTuple = as_compatible %.loc14_30.5 // CHECK:STDOUT: %.loc14_30.7: init %AdaptTuple = converted %tuple.elem0.loc14_30.1, %.loc14_30.6 @@ -594,7 +557,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %bound_method.loc14_30.6: = bound_method %tuple.elem1.loc14_30.3, %specific_fn.loc14_30.3 // CHECK:STDOUT: %UInt.as.Copy.impl.Op.call.loc14: init %u32 = call %bound_method.loc14_30.6(%tuple.elem1.loc14_30.3) // CHECK:STDOUT: %tuple.elem1.loc14_30.4: ref %u32 = tuple_access %d.var, element1 -// CHECK:STDOUT: %.loc14_30.8: init %u32 to %tuple.elem1.loc14_30.4 = initialize_from %UInt.as.Copy.impl.Op.call.loc14 +// CHECK:STDOUT: %.loc14_30.8: init %u32 to %tuple.elem1.loc14_30.4 = in_place_init %UInt.as.Copy.impl.Op.call.loc14 // CHECK:STDOUT: %.loc14_30.9: init %tuple.type.3c7 to %d.var = tuple_init (%.loc14_30.7, %.loc14_30.8) // CHECK:STDOUT: %.loc14_3: init %tuple.type.3c7 = converted %c.ref, %.loc14_30.9 // CHECK:STDOUT: assign %d.var, %.loc14_3 @@ -619,7 +582,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %tuple.elem0.loc15_10.3: ref %AdaptTuple = tuple_access %return.param, element0 // CHECK:STDOUT: %.loc15_10.3: ref %tuple.type.d07 = as_compatible %tuple.elem0.loc15_10.3 // CHECK:STDOUT: %tuple.elem0.loc15_10.4: ref %i32 = tuple_access %.loc15_10.3, element0 -// CHECK:STDOUT: %.loc15_10.4: init %i32 to %tuple.elem0.loc15_10.4 = initialize_from %Int.as.Copy.impl.Op.call.loc15_10.1 +// CHECK:STDOUT: %.loc15_10.4: init %i32 to %tuple.elem0.loc15_10.4 = in_place_init %Int.as.Copy.impl.Op.call.loc15_10.1 // CHECK:STDOUT: %tuple.elem1.loc15_10.1: ref %i32 = tuple_access %.loc15_10.1, element1 // CHECK:STDOUT: %.loc15_10.5: %i32 = acquire_value %tuple.elem1.loc15_10.1 // CHECK:STDOUT: %impl.elem0.loc15_10.2: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] @@ -628,7 +591,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %bound_method.loc15_10.4: = bound_method %.loc15_10.5, %specific_fn.loc15_10.2 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc15_10.2: init %i32 = call %bound_method.loc15_10.4(%.loc15_10.5) // CHECK:STDOUT: %tuple.elem1.loc15_10.2: ref %i32 = tuple_access %.loc15_10.3, element1 -// CHECK:STDOUT: %.loc15_10.6: init %i32 to %tuple.elem1.loc15_10.2 = initialize_from %Int.as.Copy.impl.Op.call.loc15_10.2 +// CHECK:STDOUT: %.loc15_10.6: init %i32 to %tuple.elem1.loc15_10.2 = in_place_init %Int.as.Copy.impl.Op.call.loc15_10.2 // CHECK:STDOUT: %.loc15_10.7: init %tuple.type.d07 to %.loc15_10.3 = tuple_init (%.loc15_10.4, %.loc15_10.6) // CHECK:STDOUT: %.loc15_10.8: init %AdaptTuple = as_compatible %.loc15_10.7 // CHECK:STDOUT: %.loc15_10.9: init %AdaptTuple = converted %tuple.elem0.loc15_10.1, %.loc15_10.8 @@ -640,7 +603,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %bound_method.loc15_10.6: = bound_method %.loc15_10.10, %specific_fn.loc15_10.3 // CHECK:STDOUT: %UInt.as.Copy.impl.Op.call.loc15: init %u32 = call %bound_method.loc15_10.6(%.loc15_10.10) // CHECK:STDOUT: %tuple.elem1.loc15_10.4: ref %u32 = tuple_access %return.param, element1 -// CHECK:STDOUT: %.loc15_10.11: init %u32 to %tuple.elem1.loc15_10.4 = initialize_from %UInt.as.Copy.impl.Op.call.loc15 +// CHECK:STDOUT: %.loc15_10.11: init %u32 to %tuple.elem1.loc15_10.4 = in_place_init %UInt.as.Copy.impl.Op.call.loc15 // CHECK:STDOUT: %.loc15_10.12: init %tuple.type.3c7 to %return.param = tuple_init (%.loc15_10.9, %.loc15_10.11) // CHECK:STDOUT: %.loc15_11: init %tuple.type.3c7 = converted %d.ref, %.loc15_10.12 // CHECK:STDOUT: %DestroyOp.bound: = bound_method %d.var, constants.%DestroyOp.b0ebf8.2 @@ -863,7 +826,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc23: init %i32 = call %bound_method.loc23_3.2(%tuple.elem0.loc23_3.1) // CHECK:STDOUT: %.loc23_3.2: ref %tuple.type.7f9 = as_compatible %b.var // CHECK:STDOUT: %tuple.elem0.loc23_3.2: ref %i32 = tuple_access %.loc23_3.2, element0 -// CHECK:STDOUT: %.loc23_3.3: init %i32 to %tuple.elem0.loc23_3.2 = initialize_from %Int.as.Copy.impl.Op.call.loc23 +// CHECK:STDOUT: %.loc23_3.3: init %i32 to %tuple.elem0.loc23_3.2 = in_place_init %Int.as.Copy.impl.Op.call.loc23 // CHECK:STDOUT: %tuple.elem1.loc23: %Noncopyable = tuple_access %.loc23_3.1, element1 // CHECK:STDOUT: assign %b.var, // CHECK:STDOUT: %AdaptNoncopyableIndirect.ref.loc23: type = name_ref AdaptNoncopyableIndirect, file.%AdaptNoncopyableIndirect.decl [concrete = constants.%AdaptNoncopyableIndirect] @@ -879,7 +842,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc34: init %i32 = call %bound_method.loc34_11.2(%.loc34_11.2) // CHECK:STDOUT: %.loc34_11.3: ref %tuple.type.7f9 = as_compatible %return.param // CHECK:STDOUT: %tuple.elem0.loc34_11.2: ref %i32 = tuple_access %.loc34_11.3, element0 -// CHECK:STDOUT: %.loc34_11.4: init %i32 to %tuple.elem0.loc34_11.2 = initialize_from %Int.as.Copy.impl.Op.call.loc34 +// CHECK:STDOUT: %.loc34_11.4: init %i32 to %tuple.elem0.loc34_11.2 = in_place_init %Int.as.Copy.impl.Op.call.loc34 // CHECK:STDOUT: %tuple.elem1.loc34: ref %Noncopyable = tuple_access %.loc34_11.1, element1 // CHECK:STDOUT: %.loc34_11.5: %Noncopyable = acquire_value %tuple.elem1.loc34 // CHECK:STDOUT: %DestroyOp.bound: = bound_method %b.var, constants.%DestroyOp @@ -1039,7 +1002,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc9_3.1: init %i32 = call %bound_method.loc9_3.2(%.loc9_3.2) // CHECK:STDOUT: %.loc9_3.3: ref %struct_type.e.f = as_compatible %h.var // CHECK:STDOUT: %.loc9_3.4: ref %i32 = struct_access %.loc9_3.3, element0 -// CHECK:STDOUT: %.loc9_3.5: init %i32 to %.loc9_3.4 = initialize_from %Int.as.Copy.impl.Op.call.loc9_3.1 +// CHECK:STDOUT: %.loc9_3.5: init %i32 to %.loc9_3.4 = in_place_init %Int.as.Copy.impl.Op.call.loc9_3.1 // CHECK:STDOUT: %.loc9_3.6: %i32 = struct_access %.loc9_3.1, element1 // CHECK:STDOUT: %impl.elem0.loc9_3.2: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] // CHECK:STDOUT: %bound_method.loc9_3.3: = bound_method %.loc9_3.6, %impl.elem0.loc9_3.2 @@ -1047,7 +1010,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %bound_method.loc9_3.4: = bound_method %.loc9_3.6, %specific_fn.loc9_3.2 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc9_3.2: init %i32 = call %bound_method.loc9_3.4(%.loc9_3.6) // CHECK:STDOUT: %.loc9_3.7: ref %i32 = struct_access %.loc9_3.3, element1 -// CHECK:STDOUT: %.loc9_3.8: init %i32 to %.loc9_3.7 = initialize_from %Int.as.Copy.impl.Op.call.loc9_3.2 +// CHECK:STDOUT: %.loc9_3.8: init %i32 to %.loc9_3.7 = in_place_init %Int.as.Copy.impl.Op.call.loc9_3.2 // CHECK:STDOUT: %.loc9_3.9: init %struct_type.e.f to %.loc9_3.3 = struct_init (%.loc9_3.5, %.loc9_3.8) // CHECK:STDOUT: %.loc9_3.10: init %AdaptStruct = as_compatible %.loc9_3.9 // CHECK:STDOUT: %.loc9_3.11: init %AdaptStruct = converted %g.ref, %.loc9_3.10 @@ -1065,7 +1028,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc10_11.1: init %i32 = call %bound_method.loc10_11.2(%.loc10_11.3) // CHECK:STDOUT: %.loc10_11.4: ref %struct_type.e.f = as_compatible %return.param // CHECK:STDOUT: %.loc10_11.5: ref %i32 = struct_access %.loc10_11.4, element0 -// CHECK:STDOUT: %.loc10_11.6: init %i32 to %.loc10_11.5 = initialize_from %Int.as.Copy.impl.Op.call.loc10_11.1 +// CHECK:STDOUT: %.loc10_11.6: init %i32 to %.loc10_11.5 = in_place_init %Int.as.Copy.impl.Op.call.loc10_11.1 // CHECK:STDOUT: %.loc10_11.7: ref %i32 = struct_access %.loc10_11.1, element1 // CHECK:STDOUT: %.loc10_11.8: %i32 = acquire_value %.loc10_11.7 // CHECK:STDOUT: %impl.elem0.loc10_11.2: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] @@ -1074,7 +1037,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %bound_method.loc10_11.4: = bound_method %.loc10_11.8, %specific_fn.loc10_11.2 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc10_11.2: init %i32 = call %bound_method.loc10_11.4(%.loc10_11.8) // CHECK:STDOUT: %.loc10_11.9: ref %i32 = struct_access %.loc10_11.4, element1 -// CHECK:STDOUT: %.loc10_11.10: init %i32 to %.loc10_11.9 = initialize_from %Int.as.Copy.impl.Op.call.loc10_11.2 +// CHECK:STDOUT: %.loc10_11.10: init %i32 to %.loc10_11.9 = in_place_init %Int.as.Copy.impl.Op.call.loc10_11.2 // CHECK:STDOUT: %.loc10_11.11: init %struct_type.e.f to %.loc10_11.4 = struct_init (%.loc10_11.6, %.loc10_11.10) // CHECK:STDOUT: %.loc10_11.12: init %AdaptStruct = as_compatible %.loc10_11.11 // CHECK:STDOUT: %.loc10_11.13: init %AdaptStruct = converted %h.ref, %.loc10_11.12 @@ -1104,7 +1067,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %tuple.elem0.loc14_31.2: ref %AdaptStruct = tuple_access %d.var, element0 // CHECK:STDOUT: %.loc14_31.3: ref %struct_type.e.f = as_compatible %tuple.elem0.loc14_31.2 // CHECK:STDOUT: %.loc14_31.4: ref %i32 = struct_access %.loc14_31.3, element0 -// CHECK:STDOUT: %.loc14_31.5: init %i32 to %.loc14_31.4 = initialize_from %Int.as.Copy.impl.Op.call.loc14_31.1 +// CHECK:STDOUT: %.loc14_31.5: init %i32 to %.loc14_31.4 = in_place_init %Int.as.Copy.impl.Op.call.loc14_31.1 // CHECK:STDOUT: %.loc14_31.6: %i32 = struct_access %.loc14_31.1, element1 // CHECK:STDOUT: %impl.elem0.loc14_31.2: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] // CHECK:STDOUT: %bound_method.loc14_31.3: = bound_method %.loc14_31.6, %impl.elem0.loc14_31.2 @@ -1112,7 +1075,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %bound_method.loc14_31.4: = bound_method %.loc14_31.6, %specific_fn.loc14_31.2 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc14_31.2: init %i32 = call %bound_method.loc14_31.4(%.loc14_31.6) // CHECK:STDOUT: %.loc14_31.7: ref %i32 = struct_access %.loc14_31.3, element1 -// CHECK:STDOUT: %.loc14_31.8: init %i32 to %.loc14_31.7 = initialize_from %Int.as.Copy.impl.Op.call.loc14_31.2 +// CHECK:STDOUT: %.loc14_31.8: init %i32 to %.loc14_31.7 = in_place_init %Int.as.Copy.impl.Op.call.loc14_31.2 // CHECK:STDOUT: %.loc14_31.9: init %struct_type.e.f to %.loc14_31.3 = struct_init (%.loc14_31.5, %.loc14_31.8) // CHECK:STDOUT: %.loc14_31.10: init %AdaptStruct = as_compatible %.loc14_31.9 // CHECK:STDOUT: %.loc14_31.11: init %AdaptStruct = converted %tuple.elem0.loc14_31.1, %.loc14_31.10 @@ -1123,7 +1086,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %bound_method.loc14_31.6: = bound_method %tuple.elem1.loc14_31.1, %specific_fn.loc14_31.3 // CHECK:STDOUT: %UInt.as.Copy.impl.Op.call.loc14: init %u32 = call %bound_method.loc14_31.6(%tuple.elem1.loc14_31.1) // CHECK:STDOUT: %tuple.elem1.loc14_31.2: ref %u32 = tuple_access %d.var, element1 -// CHECK:STDOUT: %.loc14_31.12: init %u32 to %tuple.elem1.loc14_31.2 = initialize_from %UInt.as.Copy.impl.Op.call.loc14 +// CHECK:STDOUT: %.loc14_31.12: init %u32 to %tuple.elem1.loc14_31.2 = in_place_init %UInt.as.Copy.impl.Op.call.loc14 // CHECK:STDOUT: %.loc14_31.13: init %tuple.type.691 to %d.var = tuple_init (%.loc14_31.11, %.loc14_31.12) // CHECK:STDOUT: %.loc14_3: init %tuple.type.691 = converted %c.ref, %.loc14_31.13 // CHECK:STDOUT: assign %d.var, %.loc14_3 @@ -1148,7 +1111,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %tuple.elem0.loc15_10.2: ref %AdaptStruct = tuple_access %return.param, element0 // CHECK:STDOUT: %.loc15_10.4: ref %struct_type.e.f = as_compatible %tuple.elem0.loc15_10.2 // CHECK:STDOUT: %.loc15_10.5: ref %i32 = struct_access %.loc15_10.4, element0 -// CHECK:STDOUT: %.loc15_10.6: init %i32 to %.loc15_10.5 = initialize_from %Int.as.Copy.impl.Op.call.loc15_10.1 +// CHECK:STDOUT: %.loc15_10.6: init %i32 to %.loc15_10.5 = in_place_init %Int.as.Copy.impl.Op.call.loc15_10.1 // CHECK:STDOUT: %.loc15_10.7: ref %i32 = struct_access %.loc15_10.1, element1 // CHECK:STDOUT: %.loc15_10.8: %i32 = acquire_value %.loc15_10.7 // CHECK:STDOUT: %impl.elem0.loc15_10.2: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] @@ -1157,7 +1120,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %bound_method.loc15_10.4: = bound_method %.loc15_10.8, %specific_fn.loc15_10.2 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc15_10.2: init %i32 = call %bound_method.loc15_10.4(%.loc15_10.8) // CHECK:STDOUT: %.loc15_10.9: ref %i32 = struct_access %.loc15_10.4, element1 -// CHECK:STDOUT: %.loc15_10.10: init %i32 to %.loc15_10.9 = initialize_from %Int.as.Copy.impl.Op.call.loc15_10.2 +// CHECK:STDOUT: %.loc15_10.10: init %i32 to %.loc15_10.9 = in_place_init %Int.as.Copy.impl.Op.call.loc15_10.2 // CHECK:STDOUT: %.loc15_10.11: init %struct_type.e.f to %.loc15_10.4 = struct_init (%.loc15_10.6, %.loc15_10.10) // CHECK:STDOUT: %.loc15_10.12: init %AdaptStruct = as_compatible %.loc15_10.11 // CHECK:STDOUT: %.loc15_10.13: init %AdaptStruct = converted %tuple.elem0.loc15_10.1, %.loc15_10.12 @@ -1169,7 +1132,7 @@ fn InTuple(c: (AdaptStruct, u32)) -> (AdaptStruct, u32) { // CHECK:STDOUT: %bound_method.loc15_10.6: = bound_method %.loc15_10.14, %specific_fn.loc15_10.3 // CHECK:STDOUT: %UInt.as.Copy.impl.Op.call.loc15: init %u32 = call %bound_method.loc15_10.6(%.loc15_10.14) // CHECK:STDOUT: %tuple.elem1.loc15_10.2: ref %u32 = tuple_access %return.param, element1 -// CHECK:STDOUT: %.loc15_10.15: init %u32 to %tuple.elem1.loc15_10.2 = initialize_from %UInt.as.Copy.impl.Op.call.loc15 +// CHECK:STDOUT: %.loc15_10.15: init %u32 to %tuple.elem1.loc15_10.2 = in_place_init %UInt.as.Copy.impl.Op.call.loc15 // CHECK:STDOUT: %.loc15_10.16: init %tuple.type.691 to %return.param = tuple_init (%.loc15_10.13, %.loc15_10.15) // CHECK:STDOUT: %.loc15_11: init %tuple.type.691 = converted %d.ref, %.loc15_10.16 // CHECK:STDOUT: %DestroyOp.bound: = bound_method %d.var, constants.%DestroyOp.b0ebf8.2 diff --git a/toolchain/check/testdata/class/adapter/init_adapt.carbon b/toolchain/check/testdata/class/adapter/init_adapt.carbon index 043138050d18..5a21044cdab9 100644 --- a/toolchain/check/testdata/class/adapter/init_adapt.carbon +++ b/toolchain/check/testdata/class/adapter/init_adapt.carbon @@ -183,7 +183,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %.loc13_27.1: init %i32 = converted @__global_init.%int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_27.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_27.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc13_27.3: ref %i32 = class_element_access %.loc13_27.2, element0 -// CHECK:STDOUT: %.loc13_27.4: init %i32 to %.loc13_27.3 = initialize_from %.loc13_27.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc13_27.4: init %i32 to %.loc13_27.3 = in_place_init %.loc13_27.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc13_27.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc13_27.3: = bound_method @__global_init.%int_2, %impl.elem0.loc13_27.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc13_27.2: = specific_function %impl.elem0.loc13_27.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -191,7 +191,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_27.2: init %i32 = call %bound_method.loc13_27.4(@__global_init.%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_27.5: init %i32 = converted @__global_init.%int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_27.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_27.6: ref %i32 = class_element_access %.loc13_27.2, element1 -// CHECK:STDOUT: %.loc13_27.7: init %i32 to %.loc13_27.6 = initialize_from %.loc13_27.5 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc13_27.7: init %i32 to %.loc13_27.6 = in_place_init %.loc13_27.5 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_27.8: init %C to %.loc13_27.2 = class_init (%.loc13_27.4, %.loc13_27.7) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc13_27.9: ref %C = temporary %.loc13_27.2, %.loc13_27.8 // CHECK:STDOUT: %.loc13_27.10: ref %C = converted @__global_init.%.loc13, %.loc13_27.9 @@ -389,7 +389,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %.loc13_27.1: init %i32 = converted @__global_init.%int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_27.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_27.2: ref %C = temporary_storage // CHECK:STDOUT: %.loc13_27.3: ref %i32 = class_element_access %.loc13_27.2, element0 -// CHECK:STDOUT: %.loc13_27.4: init %i32 to %.loc13_27.3 = initialize_from %.loc13_27.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc13_27.4: init %i32 to %.loc13_27.3 = in_place_init %.loc13_27.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc13_27.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc13_27.3: = bound_method @__global_init.%int_2, %impl.elem0.loc13_27.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc13_27.2: = specific_function %impl.elem0.loc13_27.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -397,7 +397,7 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_27.2: init %i32 = call %bound_method.loc13_27.4(@__global_init.%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_27.5: init %i32 = converted @__global_init.%int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_27.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_27.6: ref %i32 = class_element_access %.loc13_27.2, element1 -// CHECK:STDOUT: %.loc13_27.7: init %i32 to %.loc13_27.6 = initialize_from %.loc13_27.5 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc13_27.7: init %i32 to %.loc13_27.6 = in_place_init %.loc13_27.5 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_27.8: init %C to %.loc13_27.2 = class_init (%.loc13_27.4, %.loc13_27.7) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc13_27.9: ref %C = temporary %.loc13_27.2, %.loc13_27.8 // CHECK:STDOUT: %.loc13_27.10: ref %C = converted @__global_init.%.loc13, %.loc13_27.9 diff --git a/toolchain/check/testdata/class/base.carbon b/toolchain/check/testdata/class/base.carbon index c409310bb027..f30cf3d6ff0f 100644 --- a/toolchain/check/testdata/class/base.carbon +++ b/toolchain/check/testdata/class/base.carbon @@ -217,7 +217,7 @@ class Derived { // CHECK:STDOUT: %.loc14_26.2: init %i32 = converted %int_4, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14_26 [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc14_35.2: ref %Base = class_element_access %return.param, element0 // CHECK:STDOUT: %.loc14_26.3: ref %i32 = class_element_access %.loc14_35.2, element0 -// CHECK:STDOUT: %.loc14_26.4: init %i32 to %.loc14_26.3 = initialize_from %.loc14_26.2 [concrete = constants.%int_4.940] +// CHECK:STDOUT: %.loc14_26.4: init %i32 to %.loc14_26.3 = in_place_init %.loc14_26.2 [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc14_26.5: init %Base to %.loc14_35.2 = class_init (%.loc14_26.4) [concrete = constants.%Base.val] // CHECK:STDOUT: %.loc14_35.3: init %Base = converted %.loc14_26.1, %.loc14_26.5 [concrete = constants.%Base.val] // CHECK:STDOUT: %impl.elem0.loc14_35: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] @@ -227,7 +227,7 @@ class Derived { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14_35: init %i32 = call %bound_method.loc14_35.2(%int_7) [concrete = constants.%int_7.0b1] // CHECK:STDOUT: %.loc14_35.4: init %i32 = converted %int_7, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14_35 [concrete = constants.%int_7.0b1] // CHECK:STDOUT: %.loc14_35.5: ref %i32 = class_element_access %return.param, element1 -// CHECK:STDOUT: %.loc14_35.6: init %i32 to %.loc14_35.5 = initialize_from %.loc14_35.4 [concrete = constants.%int_7.0b1] +// CHECK:STDOUT: %.loc14_35.6: init %i32 to %.loc14_35.5 = in_place_init %.loc14_35.4 [concrete = constants.%int_7.0b1] // CHECK:STDOUT: %.loc14_35.7: init %Derived to %return.param = class_init (%.loc14_35.3, %.loc14_35.6) [concrete = constants.%Derived.val] // CHECK:STDOUT: %.loc14_36: init %Derived = converted %.loc14_35.1, %.loc14_35.7 [concrete = constants.%Derived.val] // CHECK:STDOUT: return %.loc14_36 to %return.param @@ -253,14 +253,14 @@ class Derived { // CHECK:STDOUT: %bound_method.loc18_12.2: = bound_method %.loc18_12.2, %specific_fn.loc18_12 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc18_12: init %i32 = call %bound_method.loc18_12.2(%.loc18_12.2) // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %return.param, element0 -// CHECK:STDOUT: %.loc18_24.2: init %i32 to %tuple.elem0 = initialize_from %Int.as.Copy.impl.Op.call.loc18_12 +// CHECK:STDOUT: %.loc18_24.2: init %i32 to %tuple.elem0 = in_place_init %Int.as.Copy.impl.Op.call.loc18_12 // CHECK:STDOUT: %impl.elem0.loc18_22: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] // CHECK:STDOUT: %bound_method.loc18_22.1: = bound_method %.loc18_22.2, %impl.elem0.loc18_22 // CHECK:STDOUT: %specific_fn.loc18_22: = specific_function %impl.elem0.loc18_22, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc18_22.2: = bound_method %.loc18_22.2, %specific_fn.loc18_22 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc18_22: init %i32 = call %bound_method.loc18_22.2(%.loc18_22.2) // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access %return.param, element1 -// CHECK:STDOUT: %.loc18_24.3: init %i32 to %tuple.elem1 = initialize_from %Int.as.Copy.impl.Op.call.loc18_22 +// CHECK:STDOUT: %.loc18_24.3: init %i32 to %tuple.elem1 = in_place_init %Int.as.Copy.impl.Op.call.loc18_22 // CHECK:STDOUT: %.loc18_24.4: init %tuple.type.d07 to %return.param = tuple_init (%.loc18_24.2, %.loc18_24.3) // CHECK:STDOUT: %.loc18_25: init %tuple.type.d07 = converted %.loc18_24.1, %.loc18_24.4 // CHECK:STDOUT: return %.loc18_25 to %return.param diff --git a/toolchain/check/testdata/class/derived_to_base.carbon b/toolchain/check/testdata/class/derived_to_base.carbon index 06ebca0cfc99..9c3a04aee04b 100644 --- a/toolchain/check/testdata/class/derived_to_base.carbon +++ b/toolchain/check/testdata/class/derived_to_base.carbon @@ -391,7 +391,7 @@ fn PassConstB(p: const B) { // CHECK:STDOUT: %.loc32_57.3: ref %B = class_element_access %.loc32_57.2, element0 // CHECK:STDOUT: %.loc32_48.2: ref %A = class_element_access %.loc32_57.3, element0 // CHECK:STDOUT: %.loc32_39.3: ref %i32 = class_element_access %.loc32_48.2, element0 -// CHECK:STDOUT: %.loc32_39.4: init %i32 to %.loc32_39.3 = initialize_from %.loc32_39.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc32_39.4: init %i32 to %.loc32_39.3 = in_place_init %.loc32_39.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc32_39.5: init %A to %.loc32_48.2 = class_init (%.loc32_39.4) [concrete = constants.%A.val] // CHECK:STDOUT: %.loc32_48.3: init %A = converted %.loc32_39.1, %.loc32_39.5 [concrete = constants.%A.val] // CHECK:STDOUT: %impl.elem0.loc32_48: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] @@ -401,7 +401,7 @@ fn PassConstB(p: const B) { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_48: init %i32 = call %bound_method.loc32_48.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc32_48.4: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_48 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc32_48.5: ref %i32 = class_element_access %.loc32_57.3, element1 -// CHECK:STDOUT: %.loc32_48.6: init %i32 to %.loc32_48.5 = initialize_from %.loc32_48.4 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc32_48.6: init %i32 to %.loc32_48.5 = in_place_init %.loc32_48.4 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc32_48.7: init %B to %.loc32_57.3 = class_init (%.loc32_48.3, %.loc32_48.6) [concrete = constants.%B.val] // CHECK:STDOUT: %.loc32_57.4: init %B = converted %.loc32_48.1, %.loc32_48.7 [concrete = constants.%B.val] // CHECK:STDOUT: %impl.elem0.loc32_57: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] @@ -411,7 +411,7 @@ fn PassConstB(p: const B) { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_57: init %i32 = call %bound_method.loc32_57.2(%int_3) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc32_57.5: init %i32 = converted %int_3, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_57 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc32_57.6: ref %i32 = class_element_access %.loc32_57.2, element1 -// CHECK:STDOUT: %.loc32_57.7: init %i32 to %.loc32_57.6 = initialize_from %.loc32_57.5 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc32_57.7: init %i32 to %.loc32_57.6 = in_place_init %.loc32_57.5 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc32_57.8: init %C to %.loc32_57.2 = class_init (%.loc32_57.4, %.loc32_57.7) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc32_57.9: ref %C = temporary %.loc32_57.2, %.loc32_57.8 // CHECK:STDOUT: %.loc32_59.1: ref %C = converted %.loc32_57.1, %.loc32_57.9 diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index e174d6b18f30..31a5215a6097 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -426,7 +426,7 @@ class Class(U:! type) { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc9_17.2(%int_1) [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc9_17.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc9_17.3: ref %i32 = class_element_access %return.param, element0 -// CHECK:STDOUT: %.loc9_17.4: init %i32 to %.loc9_17.3 = initialize_from %.loc9_17.2 [concrete = constants.%int_1.47b] +// CHECK:STDOUT: %.loc9_17.4: init %i32 to %.loc9_17.3 = in_place_init %.loc9_17.2 [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc9_17.5: init %CompleteClass.667 to %return.param = class_init (%.loc9_17.4) [concrete = constants.%CompleteClass.val] // CHECK:STDOUT: %.loc9_18: init %CompleteClass.667 = converted %.loc9_17.1, %.loc9_17.5 [concrete = constants.%CompleteClass.val] // CHECK:STDOUT: return %.loc9_18 to %return.param diff --git a/toolchain/check/testdata/class/generic/init.carbon b/toolchain/check/testdata/class/generic/init.carbon index f6257992c7c5..0834a83518f5 100644 --- a/toolchain/check/testdata/class/generic/init.carbon +++ b/toolchain/check/testdata/class/generic/init.carbon @@ -203,7 +203,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %bound_method.loc10_27.2: = bound_method %x.ref, %specific_impl_fn.loc10_27.1 // CHECK:STDOUT: %.loc10_28.2: ref @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) = class_element_access %v.var, element0 // CHECK:STDOUT: %Copy.Op.call.loc10: init @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) to %.loc10_28.2 = call %bound_method.loc10_27.2(%x.ref) -// CHECK:STDOUT: %.loc10_28.3: init @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) to %.loc10_28.2 = initialize_from %Copy.Op.call.loc10 +// CHECK:STDOUT: %.loc10_28.3: init @InitFromStructGeneric.%T.binding.as_type (%T.binding.as_type) to %.loc10_28.2 = in_place_init %Copy.Op.call.loc10 // CHECK:STDOUT: %.loc10_28.4: init @InitFromStructGeneric.%Class.loc10_17.2 (%Class.316) to %v.var = class_init (%.loc10_28.3) // CHECK:STDOUT: %.loc10_3.1: init @InitFromStructGeneric.%Class.loc10_17.2 (%Class.316) = converted %.loc10_28.1, %.loc10_28.4 // CHECK:STDOUT: assign %v.var, %.loc10_3.1 @@ -248,7 +248,7 @@ fn InitFromAdaptedSpecific(x: i32) -> i32 { // CHECK:STDOUT: %bound_method.loc15_29.2: = bound_method %x.ref, %specific_fn.loc15 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc15: init %i32 = call %bound_method.loc15_29.2(%x.ref) // CHECK:STDOUT: %.loc15_30.2: ref %i32 = class_element_access %v.var, element0 -// CHECK:STDOUT: %.loc15_30.3: init %i32 to %.loc15_30.2 = initialize_from %Int.as.Copy.impl.Op.call.loc15 +// CHECK:STDOUT: %.loc15_30.3: init %i32 to %.loc15_30.2 = in_place_init %Int.as.Copy.impl.Op.call.loc15 // CHECK:STDOUT: %.loc15_30.4: init %Class.805 to %v.var = class_init (%.loc15_30.3) // CHECK:STDOUT: %.loc15_3: init %Class.805 = converted %.loc15_30.1, %.loc15_30.4 // CHECK:STDOUT: assign %v.var, %.loc15_3 diff --git a/toolchain/check/testdata/class/generic/member_type.carbon b/toolchain/check/testdata/class/generic/member_type.carbon index c28d6c66cc9e..56493a6891e3 100644 --- a/toolchain/check/testdata/class/generic/member_type.carbon +++ b/toolchain/check/testdata/class/generic/member_type.carbon @@ -282,7 +282,7 @@ fn Test() -> i32 { // CHECK:STDOUT: %bound_method.loc9_38.2: = bound_method %n.ref, %specific_impl_fn.loc9_38.1 // CHECK:STDOUT: %.loc9_39.2: ref @Outer.F.%T.binding.as_type (%T.binding.as_type) = class_element_access %return.param, element0 // CHECK:STDOUT: %Copy.Op.call: init @Outer.F.%T.binding.as_type (%T.binding.as_type) to %.loc9_39.2 = call %bound_method.loc9_38.2(%n.ref) -// CHECK:STDOUT: %.loc9_39.3: init @Outer.F.%T.binding.as_type (%T.binding.as_type) to %.loc9_39.2 = initialize_from %Copy.Op.call +// CHECK:STDOUT: %.loc9_39.3: init @Outer.F.%T.binding.as_type (%T.binding.as_type) to %.loc9_39.2 = in_place_init %Copy.Op.call // CHECK:STDOUT: %.loc9_39.4: init @Outer.F.%Inner (%Inner.bcf) to %return.param = class_init (%.loc9_39.3) // CHECK:STDOUT: %.loc9_40: init @Outer.F.%Inner (%Inner.bcf) = converted %.loc9_39.1, %.loc9_39.4 // CHECK:STDOUT: return %.loc9_40 to %return.param diff --git a/toolchain/check/testdata/class/generic/stringify.carbon b/toolchain/check/testdata/class/generic/stringify.carbon index 7fceda04696d..366c236db1fb 100644 --- a/toolchain/check/testdata/class/generic/stringify.carbon +++ b/toolchain/check/testdata/class/generic/stringify.carbon @@ -558,7 +558,7 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %.loc25_25.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25_25.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc25_25.3: ref %D = temporary_storage // CHECK:STDOUT: %.loc25_25.4: ref %i32 = class_element_access %.loc25_25.3, element0 -// CHECK:STDOUT: %.loc25_25.5: init %i32 to %.loc25_25.4 = initialize_from %.loc25_25.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc25_25.5: init %i32 to %.loc25_25.4 = in_place_init %.loc25_25.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc25_25.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc25_25.3: = bound_method %int_2, %impl.elem0.loc25_25.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc25_25.2: = specific_function %impl.elem0.loc25_25.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -566,7 +566,7 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25_25.2: init %i32 = call %bound_method.loc25_25.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc25_25.6: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25_25.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc25_25.7: ref %i32 = class_element_access %.loc25_25.3, element1 -// CHECK:STDOUT: %.loc25_25.8: init %i32 to %.loc25_25.7 = initialize_from %.loc25_25.6 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc25_25.8: init %i32 to %.loc25_25.7 = in_place_init %.loc25_25.6 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc25_25.9: init %D to %.loc25_25.3 = class_init (%.loc25_25.5, %.loc25_25.8) [concrete = constants.%D.val.525] // CHECK:STDOUT: %.loc25_25.10: ref %D = temporary %.loc25_25.3, %.loc25_25.9 // CHECK:STDOUT: %.loc25_26.1: ref %D = converted %.loc25_25.1, %.loc25_25.10 @@ -621,7 +621,7 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %.loc25_53.2: init %i32 = converted %int_3, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25_53.1 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc25_53.3: ref %D = temporary_storage // CHECK:STDOUT: %.loc25_53.4: ref %i32 = class_element_access %.loc25_53.3, element0 -// CHECK:STDOUT: %.loc25_53.5: init %i32 to %.loc25_53.4 = initialize_from %.loc25_53.2 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc25_53.5: init %i32 to %.loc25_53.4 = in_place_init %.loc25_53.2 [concrete = constants.%int_3.822] // CHECK:STDOUT: %impl.elem0.loc25_53.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc25_53.3: = bound_method %int_4, %impl.elem0.loc25_53.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f0c] // CHECK:STDOUT: %specific_fn.loc25_53.2: = specific_function %impl.elem0.loc25_53.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -629,7 +629,7 @@ var g: E({.a = 1, .b = 2}) = {} as E({.a = 3, .b = 4} as D); // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25_53.2: init %i32 = call %bound_method.loc25_53.4(%int_4) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc25_53.6: init %i32 = converted %int_4, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc25_53.2 [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc25_53.7: ref %i32 = class_element_access %.loc25_53.3, element1 -// CHECK:STDOUT: %.loc25_53.8: init %i32 to %.loc25_53.7 = initialize_from %.loc25_53.6 [concrete = constants.%int_4.940] +// CHECK:STDOUT: %.loc25_53.8: init %i32 to %.loc25_53.7 = in_place_init %.loc25_53.6 [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc25_53.9: init %D to %.loc25_53.3 = class_init (%.loc25_53.5, %.loc25_53.8) [concrete = constants.%D.val.659] // CHECK:STDOUT: %.loc25_53.10: ref %D = temporary %.loc25_53.3, %.loc25_53.9 // CHECK:STDOUT: %.loc25_55.1: ref %D = converted %.loc25_53.1, %.loc25_53.10 diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index c3fb35ae1971..6f29a795b079 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -343,7 +343,7 @@ fn Run() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9: init %i32 = call %bound_method.loc9_25.2(%int_1) [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc9_25.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9 [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc9_25.3: ref %i32 = class_element_access %b.var, element0 -// CHECK:STDOUT: %.loc9_25.4: init %i32 to %.loc9_25.3 = initialize_from %.loc9_25.2 [concrete = constants.%int_1.47b] +// CHECK:STDOUT: %.loc9_25.4: init %i32 to %.loc9_25.3 = in_place_init %.loc9_25.2 [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc9_25.5: init %Field to %b.var = class_init (%.loc9_25.4) [concrete = constants.%Field.val] // CHECK:STDOUT: %.loc9_3: init %Field = converted %.loc9_25.1, %.loc9_25.5 [concrete = constants.%Field.val] // CHECK:STDOUT: assign %b.var, %.loc9_3 diff --git a/toolchain/check/testdata/class/import_base.carbon b/toolchain/check/testdata/class/import_base.carbon index 7ec711430337..87fde58250cf 100644 --- a/toolchain/check/testdata/class/import_base.carbon +++ b/toolchain/check/testdata/class/import_base.carbon @@ -266,7 +266,7 @@ fn Run() { // CHECK:STDOUT: %.loc7_49.2: init %i32 = converted %int_0, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_49.1 [concrete = constants.%int_0.263] // CHECK:STDOUT: %.loc7_50.2: ref %Base = class_element_access %a.var, element0 // CHECK:STDOUT: %.loc7_49.3: ref %i32 = class_element_access %.loc7_50.2, element0 -// CHECK:STDOUT: %.loc7_49.4: init %i32 to %.loc7_49.3 = initialize_from %.loc7_49.2 [concrete = constants.%int_0.263] +// CHECK:STDOUT: %.loc7_49.4: init %i32 to %.loc7_49.3 = in_place_init %.loc7_49.2 [concrete = constants.%int_0.263] // CHECK:STDOUT: %impl.elem0.loc7_49.2: %.952 = impl_witness_access constants.%ImplicitAs.impl_witness.58d, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.5f4] // CHECK:STDOUT: %bound_method.loc7_49.3: = bound_method %int_1, %impl.elem0.loc7_49.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.f07] // CHECK:STDOUT: %specific_fn.loc7_49.2: = specific_function %impl.elem0.loc7_49.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -274,7 +274,7 @@ fn Run() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_49.2: init %i32 = call %bound_method.loc7_49.4(%int_1) [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc7_49.5: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_49.2 [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc7_49.6: ref %i32 = class_element_access %.loc7_50.2, element1 -// CHECK:STDOUT: %.loc7_49.7: init %i32 to %.loc7_49.6 = initialize_from %.loc7_49.5 [concrete = constants.%int_1.47b] +// CHECK:STDOUT: %.loc7_49.7: init %i32 to %.loc7_49.6 = in_place_init %.loc7_49.5 [concrete = constants.%int_1.47b] // CHECK:STDOUT: %.loc7_49.8: init %Base to %.loc7_50.2 = class_init (%.loc7_49.4, %.loc7_49.7) [concrete = constants.%Base.val] // CHECK:STDOUT: %.loc7_50.3: init %Base = converted %.loc7_49.1, %.loc7_49.8 [concrete = constants.%Base.val] // CHECK:STDOUT: %.loc7_50.4: init %Child to %a.var = class_init (%.loc7_50.3) [concrete = constants.%Child.val] diff --git a/toolchain/check/testdata/class/inheritance_access.carbon b/toolchain/check/testdata/class/inheritance_access.carbon index afbf76ccdc01..ee9bb85c9f55 100644 --- a/toolchain/check/testdata/class/inheritance_access.carbon +++ b/toolchain/check/testdata/class/inheritance_access.carbon @@ -414,7 +414,7 @@ class B { // CHECK:STDOUT: %bound_method.loc13_17.2: = bound_method %.loc13_17.4, %specific_fn.loc13_17 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc13_17: init %i32 = call %bound_method.loc13_17.2(%.loc13_17.4) // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %return.param, element0 -// CHECK:STDOUT: %.loc13_27.2: init %i32 to %tuple.elem0 = initialize_from %Int.as.Copy.impl.Op.call.loc13_17 +// CHECK:STDOUT: %.loc13_27.2: init %i32 to %tuple.elem0 = in_place_init %Int.as.Copy.impl.Op.call.loc13_17 // CHECK:STDOUT: %.loc13_25.4: %i32 = acquire_value %.loc13_25.3 // CHECK:STDOUT: %impl.elem0.loc13_25: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] // CHECK:STDOUT: %bound_method.loc13_25.1: = bound_method %.loc13_25.4, %impl.elem0.loc13_25 @@ -422,7 +422,7 @@ class B { // CHECK:STDOUT: %bound_method.loc13_25.2: = bound_method %.loc13_25.4, %specific_fn.loc13_25 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc13_25: init %i32 = call %bound_method.loc13_25.2(%.loc13_25.4) // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access %return.param, element1 -// CHECK:STDOUT: %.loc13_27.3: init %i32 to %tuple.elem1 = initialize_from %Int.as.Copy.impl.Op.call.loc13_25 +// CHECK:STDOUT: %.loc13_27.3: init %i32 to %tuple.elem1 = in_place_init %Int.as.Copy.impl.Op.call.loc13_25 // CHECK:STDOUT: %.loc13_27.4: init %tuple.type.d07 to %return.param = tuple_init (%.loc13_27.2, %.loc13_27.3) // CHECK:STDOUT: %.loc13_28: init %tuple.type.d07 = converted %.loc13_27.1, %.loc13_27.4 // CHECK:STDOUT: return %.loc13_28 to %return.param diff --git a/toolchain/check/testdata/class/init.carbon b/toolchain/check/testdata/class/init.carbon index 600b9357fae5..39158c0d9c72 100644 --- a/toolchain/check/testdata/class/init.carbon +++ b/toolchain/check/testdata/class/init.carbon @@ -173,14 +173,14 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: %bound_method.loc21_16.2: = bound_method %n.ref, %specific_fn.loc21_16 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc21_16.2(%n.ref) // CHECK:STDOUT: %.loc21_31.2: ref %i32 = class_element_access %return.param, element0 -// CHECK:STDOUT: %.loc21_31.3: init %i32 to %.loc21_31.2 = initialize_from %Int.as.Copy.impl.Op.call +// CHECK:STDOUT: %.loc21_31.3: init %i32 to %.loc21_31.2 = in_place_init %Int.as.Copy.impl.Op.call // CHECK:STDOUT: %impl.elem0.loc21_27: %.105 = impl_witness_access constants.%Copy.impl_witness.9d3, element0 [concrete = constants.%ptr.as.Copy.impl.Op.120] // CHECK:STDOUT: %bound_method.loc21_27.1: = bound_method %next.ref, %impl.elem0.loc21_27 // CHECK:STDOUT: %specific_fn.loc21_27: = specific_function %impl.elem0.loc21_27, @ptr.as.Copy.impl.Op(constants.%Class) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc21_27.2: = bound_method %next.ref, %specific_fn.loc21_27 // CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.8e5 = call %bound_method.loc21_27.2(%next.ref) // CHECK:STDOUT: %.loc21_31.4: ref %ptr.8e5 = class_element_access %return.param, element1 -// CHECK:STDOUT: %.loc21_31.5: init %ptr.8e5 to %.loc21_31.4 = initialize_from %ptr.as.Copy.impl.Op.call +// CHECK:STDOUT: %.loc21_31.5: init %ptr.8e5 to %.loc21_31.4 = in_place_init %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: %.loc21_31.6: init %Class to %return.param = class_init (%.loc21_31.3, %.loc21_31.5) // CHECK:STDOUT: %.loc21_32: init %Class = converted %.loc21_31.1, %.loc21_31.6 // CHECK:STDOUT: return %.loc21_32 to %return.param @@ -197,14 +197,14 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: %bound_method.loc25_30.2: = bound_method %n.ref, %specific_fn.loc25_30 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc25_30.2(%n.ref) // CHECK:STDOUT: %.loc25_31.2: ref %i32 = class_element_access %return.param, element1 -// CHECK:STDOUT: %.loc25_31.3: init %i32 to %.loc25_31.2 = initialize_from %Int.as.Copy.impl.Op.call +// CHECK:STDOUT: %.loc25_31.3: init %i32 to %.loc25_31.2 = in_place_init %Int.as.Copy.impl.Op.call // CHECK:STDOUT: %impl.elem0.loc25_19: %.105 = impl_witness_access constants.%Copy.impl_witness.9d3, element0 [concrete = constants.%ptr.as.Copy.impl.Op.120] // CHECK:STDOUT: %bound_method.loc25_19.1: = bound_method %next.ref, %impl.elem0.loc25_19 // CHECK:STDOUT: %specific_fn.loc25_19: = specific_function %impl.elem0.loc25_19, @ptr.as.Copy.impl.Op(constants.%Class) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc25_19.2: = bound_method %next.ref, %specific_fn.loc25_19 // CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.8e5 = call %bound_method.loc25_19.2(%next.ref) // CHECK:STDOUT: %.loc25_31.4: ref %ptr.8e5 = class_element_access %return.param, element0 -// CHECK:STDOUT: %.loc25_31.5: init %ptr.8e5 to %.loc25_31.4 = initialize_from %ptr.as.Copy.impl.Op.call +// CHECK:STDOUT: %.loc25_31.5: init %ptr.8e5 to %.loc25_31.4 = in_place_init %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: %.loc25_31.6: init %Class to %return.param = class_init (%.loc25_31.3, %.loc25_31.5) // CHECK:STDOUT: %.loc25_32: init %Class = converted %.loc25_31.1, %.loc25_31.6 // CHECK:STDOUT: return %.loc25_32 to %return.param diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index ff8606ec99f8..b47ddee8ff42 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -146,7 +146,7 @@ fn F() -> i32 { // CHECK:STDOUT: %.loc21_26.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21_26.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc21_26.3: ref %Class = temporary_storage // CHECK:STDOUT: %.loc21_26.4: ref %i32 = class_element_access %.loc21_26.3, element0 -// CHECK:STDOUT: %.loc21_26.5: init %i32 to %.loc21_26.4 = initialize_from %.loc21_26.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc21_26.5: init %i32 to %.loc21_26.4 = in_place_init %.loc21_26.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc21_26.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc21_26.3: = bound_method %int_2, %impl.elem0.loc21_26.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc21_26.2: = specific_function %impl.elem0.loc21_26.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -154,7 +154,7 @@ fn F() -> i32 { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21_26.2: init %i32 = call %bound_method.loc21_26.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc21_26.6: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21_26.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc21_26.7: ref %i32 = class_element_access %.loc21_26.3, element1 -// CHECK:STDOUT: %.loc21_26.8: init %i32 to %.loc21_26.7 = initialize_from %.loc21_26.6 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc21_26.8: init %i32 to %.loc21_26.7 = in_place_init %.loc21_26.6 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc21_26.9: init %Class to %.loc21_26.3 = class_init (%.loc21_26.5, %.loc21_26.8) [concrete = constants.%Class.val] // CHECK:STDOUT: %.loc21_26.10: ref %Class = temporary %.loc21_26.3, %.loc21_26.9 // CHECK:STDOUT: %.loc21_28: ref %Class = converted %.loc21_26.1, %.loc21_26.10 diff --git a/toolchain/check/testdata/class/local.carbon b/toolchain/check/testdata/class/local.carbon index 79ee86d5c751..b540c586335c 100644 --- a/toolchain/check/testdata/class/local.carbon +++ b/toolchain/check/testdata/class/local.carbon @@ -191,7 +191,7 @@ class A { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc19_39.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc19_39.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc19_39.3: ref %i32 = class_element_access %return.param, element0 -// CHECK:STDOUT: %.loc19_39.4: init %i32 to %.loc19_39.3 = initialize_from %.loc19_39.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc19_39.4: init %i32 to %.loc19_39.3 = in_place_init %.loc19_39.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc19_39.5: init %B to %return.param = class_init (%.loc19_39.4) [concrete = constants.%B.val] // CHECK:STDOUT: %.loc19_18: init %B = converted %.loc19_39.1, %.loc19_39.5 [concrete = constants.%B.val] // CHECK:STDOUT: assign %return.param, %.loc19_18 diff --git a/toolchain/check/testdata/class/method.carbon b/toolchain/check/testdata/class/method.carbon index 772ad8f46b9b..be2b3e00d0b6 100644 --- a/toolchain/check/testdata/class/method.carbon +++ b/toolchain/check/testdata/class/method.carbon @@ -400,7 +400,7 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: %.loc39_18.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc39_18.3: ref %Class = temporary_storage // CHECK:STDOUT: %.loc39_18.4: ref %i32 = class_element_access %.loc39_18.3, element0 -// CHECK:STDOUT: %.loc39_18.5: init %i32 to %.loc39_18.4 = initialize_from %.loc39_18.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc39_18.5: init %i32 to %.loc39_18.4 = in_place_init %.loc39_18.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc39_18.6: init %Class to %.loc39_18.3 = class_init (%.loc39_18.5) [concrete = constants.%Class.val] // CHECK:STDOUT: %.loc39_18.7: ref %Class = temporary %.loc39_18.3, %.loc39_18.6 // CHECK:STDOUT: %.loc39_20.1: ref %Class = converted %.loc39_18.1, %.loc39_18.7 diff --git a/toolchain/check/testdata/class/raw_self.carbon b/toolchain/check/testdata/class/raw_self.carbon index d28672db6aba..d6a93cdf91a1 100644 --- a/toolchain/check/testdata/class/raw_self.carbon +++ b/toolchain/check/testdata/class/raw_self.carbon @@ -212,14 +212,14 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: %bound_method.loc26_15.2: = bound_method %.loc26_15.2, %specific_fn.loc26_15 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc26_15: init %i32 = call %bound_method.loc26_15.2(%.loc26_15.2) // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %return.param.loc25, element0 -// CHECK:STDOUT: %.loc26_25.2: init %i32 to %tuple.elem0 = initialize_from %Int.as.Copy.impl.Op.call.loc26_15 +// CHECK:STDOUT: %.loc26_25.2: init %i32 to %tuple.elem0 = in_place_init %Int.as.Copy.impl.Op.call.loc26_15 // CHECK:STDOUT: %impl.elem0.loc26_19: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] // CHECK:STDOUT: %bound_method.loc26_19.1: = bound_method %self.ref.loc26_19, %impl.elem0.loc26_19 // CHECK:STDOUT: %specific_fn.loc26_19: = specific_function %impl.elem0.loc26_19, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc26_19.2: = bound_method %self.ref.loc26_19, %specific_fn.loc26_19 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc26_19: init %i32 = call %bound_method.loc26_19.2(%self.ref.loc26_19) // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access %return.param.loc25, element1 -// CHECK:STDOUT: %.loc26_25.3: init %i32 to %tuple.elem1 = initialize_from %Int.as.Copy.impl.Op.call.loc26_19 +// CHECK:STDOUT: %.loc26_25.3: init %i32 to %tuple.elem1 = in_place_init %Int.as.Copy.impl.Op.call.loc26_19 // CHECK:STDOUT: %.loc26_25.4: init %tuple.type.d07 to %return.param.loc25 = tuple_init (%.loc26_25.2, %.loc26_25.3) // CHECK:STDOUT: %.loc26_26: init %tuple.type.d07 = converted %.loc26_25.1, %.loc26_25.4 // CHECK:STDOUT: return %.loc26_26 to %return.param.loc25 diff --git a/toolchain/check/testdata/class/reorder_qualified.carbon b/toolchain/check/testdata/class/reorder_qualified.carbon index 5ddb2edfd7ff..0b75980a0b70 100644 --- a/toolchain/check/testdata/class/reorder_qualified.carbon +++ b/toolchain/check/testdata/class/reorder_qualified.carbon @@ -266,7 +266,7 @@ class A { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc33: init %i32 = call %bound_method.loc33_25.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc33_25.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc33 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc33_25.3: ref %i32 = class_element_access %a.var, element0 -// CHECK:STDOUT: %.loc33_25.4: init %i32 to %.loc33_25.3 = initialize_from %.loc33_25.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc33_25.4: init %i32 to %.loc33_25.3 = in_place_init %.loc33_25.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc33_25.5: init %A to %a.var = class_init (%.loc33_25.4) [concrete = constants.%A.val] // CHECK:STDOUT: %.loc33_7: init %A = converted %.loc33_25.1, %.loc33_25.5 [concrete = constants.%A.val] // CHECK:STDOUT: assign %a.var, %.loc33_7 @@ -286,7 +286,7 @@ class A { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc34: init %i32 = call %bound_method.loc34_25.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc34_25.2: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc34 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc34_25.3: ref %i32 = class_element_access %b.var, element0 -// CHECK:STDOUT: %.loc34_25.4: init %i32 to %.loc34_25.3 = initialize_from %.loc34_25.2 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc34_25.4: init %i32 to %.loc34_25.3 = in_place_init %.loc34_25.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc34_25.5: init %B to %b.var = class_init (%.loc34_25.4) [concrete = constants.%B.val] // CHECK:STDOUT: %.loc34_7: init %B = converted %.loc34_25.1, %.loc34_25.5 [concrete = constants.%B.val] // CHECK:STDOUT: assign %b.var, %.loc34_7 @@ -306,7 +306,7 @@ class A { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc35: init %i32 = call %bound_method.loc35_25.2(%int_3) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc35_25.2: init %i32 = converted %int_3, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc35 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc35_25.3: ref %i32 = class_element_access %c.var, element0 -// CHECK:STDOUT: %.loc35_25.4: init %i32 to %.loc35_25.3 = initialize_from %.loc35_25.2 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc35_25.4: init %i32 to %.loc35_25.3 = in_place_init %.loc35_25.2 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc35_25.5: init %C to %c.var = class_init (%.loc35_25.4) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc35_7: init %C = converted %.loc35_25.1, %.loc35_25.5 [concrete = constants.%C.val] // CHECK:STDOUT: assign %c.var, %.loc35_7 @@ -326,7 +326,7 @@ class A { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc36: init %i32 = call %bound_method.loc36_25.2(%int_4) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc36_25.2: init %i32 = converted %int_4, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc36 [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc36_25.3: ref %i32 = class_element_access %d.var, element0 -// CHECK:STDOUT: %.loc36_25.4: init %i32 to %.loc36_25.3 = initialize_from %.loc36_25.2 [concrete = constants.%int_4.940] +// CHECK:STDOUT: %.loc36_25.4: init %i32 to %.loc36_25.3 = in_place_init %.loc36_25.2 [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc36_25.5: init %D to %d.var = class_init (%.loc36_25.4) [concrete = constants.%D.val] // CHECK:STDOUT: %.loc36_7: init %D = converted %.loc36_25.1, %.loc36_25.5 [concrete = constants.%D.val] // CHECK:STDOUT: assign %d.var, %.loc36_7 diff --git a/toolchain/check/testdata/class/self_type.carbon b/toolchain/check/testdata/class/self_type.carbon index 700b5015cdec..48650a8b8a82 100644 --- a/toolchain/check/testdata/class/self_type.carbon +++ b/toolchain/check/testdata/class/self_type.carbon @@ -166,7 +166,7 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: %bound_method.loc19_15.2: = bound_method %addr, %specific_fn // CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.8e5 = call %bound_method.loc19_15.2(%addr) // CHECK:STDOUT: %.loc19_17.2: ref %ptr.8e5 = class_element_access %s.ref.loc19_5, element0 -// CHECK:STDOUT: %.loc19_17.3: init %ptr.8e5 to %.loc19_17.2 = initialize_from %ptr.as.Copy.impl.Op.call +// CHECK:STDOUT: %.loc19_17.3: init %ptr.8e5 to %.loc19_17.2 = in_place_init %ptr.as.Copy.impl.Op.call // CHECK:STDOUT: %.loc19_17.4: init %Class to %s.ref.loc19_5 = class_init (%.loc19_17.3) // CHECK:STDOUT: %.loc19_7: init %Class = converted %.loc19_17.1, %.loc19_17.4 // CHECK:STDOUT: assign %s.ref.loc19_5, %.loc19_7 diff --git a/toolchain/check/testdata/class/virtual_modifiers.carbon b/toolchain/check/testdata/class/virtual_modifiers.carbon index e74e341995c6..02c791b7a7d7 100644 --- a/toolchain/check/testdata/class/virtual_modifiers.carbon +++ b/toolchain/check/testdata/class/virtual_modifiers.carbon @@ -738,7 +738,7 @@ class T2(G2:! type) { // CHECK:STDOUT: %.loc12_31.2: ref %Base = class_element_access %d.var, element0 // CHECK:STDOUT: %.loc12_30.2: ref %ptr.454 = class_element_access %.loc12_31.2, element0 // CHECK:STDOUT: %Derived.vtable_ptr: ref %ptr.454 = vtable_ptr @Derived.vtable [concrete = constants.%Derived.vtable_ptr] -// CHECK:STDOUT: %.loc12_30.3: init %ptr.454 to %.loc12_30.2 = initialize_from %Derived.vtable_ptr [concrete = constants.%Derived.vtable_ptr] +// CHECK:STDOUT: %.loc12_30.3: init %ptr.454 to %.loc12_30.2 = in_place_init %Derived.vtable_ptr [concrete = constants.%Derived.vtable_ptr] // CHECK:STDOUT: %.loc12_30.4: init %Base to %.loc12_31.2 = class_init (%.loc12_30.3) [concrete = constants.%Base.val] // CHECK:STDOUT: %.loc12_31.3: init %Base = converted %.loc12_30.1, %.loc12_30.4 [concrete = constants.%Base.val] // CHECK:STDOUT: %.loc12_31.4: init %Derived to %d.var = class_init (%.loc12_31.3) [concrete = constants.%Derived.val] @@ -922,7 +922,7 @@ class T2(G2:! type) { // CHECK:STDOUT: %.loc7_28.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc7_28.2: ref %ptr.454 = class_element_access %v.var, element0 // CHECK:STDOUT: %Base.vtable_ptr: ref %ptr.454 = vtable_ptr @Base.vtable [concrete = constants.%Base.vtable_ptr] -// CHECK:STDOUT: %.loc7_28.3: init %ptr.454 to %.loc7_28.2 = initialize_from %Base.vtable_ptr [concrete = constants.%Base.vtable_ptr] +// CHECK:STDOUT: %.loc7_28.3: init %ptr.454 to %.loc7_28.2 = in_place_init %Base.vtable_ptr [concrete = constants.%Base.vtable_ptr] // CHECK:STDOUT: %.loc7_28.4: init %Base to %v.var = class_init (%.loc7_28.3) [concrete = constants.%Base.val] // CHECK:STDOUT: %.loc7_3: init %Base = converted %.loc7_28.1, %.loc7_28.4 [concrete = constants.%Base.val] // CHECK:STDOUT: assign %v.var, %.loc7_3 @@ -1207,7 +1207,7 @@ class T2(G2:! type) { // CHECK:STDOUT: %.loc19_17.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc19_17.2: ref %ptr.454 = class_element_access %b1.var, element0 // CHECK:STDOUT: %B1.vtable_ptr: ref %ptr.454 = vtable_ptr @B1.vtable [concrete = constants.%B1.vtable_ptr] -// CHECK:STDOUT: %.loc19_17.3: init %ptr.454 to %.loc19_17.2 = initialize_from %B1.vtable_ptr [concrete = constants.%B1.vtable_ptr] +// CHECK:STDOUT: %.loc19_17.3: init %ptr.454 to %.loc19_17.2 = in_place_init %B1.vtable_ptr [concrete = constants.%B1.vtable_ptr] // CHECK:STDOUT: %.loc19_17.4: init %B1 to %b1.var = class_init (%.loc19_17.3) [concrete = constants.%B1.val.d17] // CHECK:STDOUT: %.loc19_3: init %B1 = converted %.loc19_17.1, %.loc19_17.4 [concrete = constants.%B1.val.d17] // CHECK:STDOUT: assign %b1.var, %.loc19_3 @@ -1223,7 +1223,7 @@ class T2(G2:! type) { // CHECK:STDOUT: %.loc20_27.2: ref %B1 = class_element_access %b2.var, element0 // CHECK:STDOUT: %.loc20_26.2: ref %ptr.454 = class_element_access %.loc20_27.2, element0 // CHECK:STDOUT: %B2.vtable_ptr: ref %ptr.454 = vtable_ptr @B2.vtable [concrete = constants.%B2.vtable_ptr] -// CHECK:STDOUT: %.loc20_26.3: init %ptr.454 to %.loc20_26.2 = initialize_from %B2.vtable_ptr [concrete = constants.%B2.vtable_ptr] +// CHECK:STDOUT: %.loc20_26.3: init %ptr.454 to %.loc20_26.2 = in_place_init %B2.vtable_ptr [concrete = constants.%B2.vtable_ptr] // CHECK:STDOUT: %.loc20_26.4: init %B1 to %.loc20_27.2 = class_init (%.loc20_26.3) [concrete = constants.%B1.val.f0b] // CHECK:STDOUT: %.loc20_27.3: init %B1 = converted %.loc20_26.1, %.loc20_26.4 [concrete = constants.%B1.val.f0b] // CHECK:STDOUT: %.loc20_27.4: init %B2 to %b2.var = class_init (%.loc20_27.3) [concrete = constants.%B2.val.e28] @@ -1243,7 +1243,7 @@ class T2(G2:! type) { // CHECK:STDOUT: %.loc21_34.2: ref %B1 = class_element_access %.loc21_35.2, element0 // CHECK:STDOUT: %.loc21_33.2: ref %ptr.454 = class_element_access %.loc21_34.2, element0 // CHECK:STDOUT: %C.vtable_ptr: ref %ptr.454 = vtable_ptr @C.vtable [concrete = constants.%C.vtable_ptr] -// CHECK:STDOUT: %.loc21_33.3: init %ptr.454 to %.loc21_33.2 = initialize_from %C.vtable_ptr [concrete = constants.%C.vtable_ptr] +// CHECK:STDOUT: %.loc21_33.3: init %ptr.454 to %.loc21_33.2 = in_place_init %C.vtable_ptr [concrete = constants.%C.vtable_ptr] // CHECK:STDOUT: %.loc21_33.4: init %B1 to %.loc21_34.2 = class_init (%.loc21_33.3) [concrete = constants.%B1.val.dd4] // CHECK:STDOUT: %.loc21_34.3: init %B1 = converted %.loc21_33.1, %.loc21_33.4 [concrete = constants.%B1.val.dd4] // CHECK:STDOUT: %.loc21_34.4: init %B2 to %.loc21_35.2 = class_init (%.loc21_34.3) [concrete = constants.%B2.val.b52] @@ -1475,7 +1475,7 @@ class T2(G2:! type) { // CHECK:STDOUT: %.loc13_35.1: %struct_type.m2.m1.68c = struct_literal (%i.ref.loc13_25, %i.ref.loc13_34) // CHECK:STDOUT: %.loc13_35.2: ref %ptr.454 = class_element_access %b1.var, element0 // CHECK:STDOUT: %Base.vtable_ptr.loc13: ref %ptr.454 = vtable_ptr @Base.vtable [concrete = constants.%Base.vtable_ptr] -// CHECK:STDOUT: %.loc13_35.3: init %ptr.454 to %.loc13_35.2 = initialize_from %Base.vtable_ptr.loc13 [concrete = constants.%Base.vtable_ptr] +// CHECK:STDOUT: %.loc13_35.3: init %ptr.454 to %.loc13_35.2 = in_place_init %Base.vtable_ptr.loc13 [concrete = constants.%Base.vtable_ptr] // CHECK:STDOUT: %.loc13_34: %i32 = acquire_value %i.ref.loc13_34 // CHECK:STDOUT: %impl.elem0.loc13_34: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] // CHECK:STDOUT: %bound_method.loc13_34.1: = bound_method %.loc13_34, %impl.elem0.loc13_34 @@ -1483,7 +1483,7 @@ class T2(G2:! type) { // CHECK:STDOUT: %bound_method.loc13_34.2: = bound_method %.loc13_34, %specific_fn.loc13_34 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc13_34: init %i32 = call %bound_method.loc13_34.2(%.loc13_34) // CHECK:STDOUT: %.loc13_35.4: ref %i32 = class_element_access %b1.var, element2 -// CHECK:STDOUT: %.loc13_35.5: init %i32 to %.loc13_35.4 = initialize_from %Int.as.Copy.impl.Op.call.loc13_34 +// CHECK:STDOUT: %.loc13_35.5: init %i32 to %.loc13_35.4 = in_place_init %Int.as.Copy.impl.Op.call.loc13_34 // CHECK:STDOUT: %.loc13_25: %i32 = acquire_value %i.ref.loc13_25 // CHECK:STDOUT: %impl.elem0.loc13_25: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] // CHECK:STDOUT: %bound_method.loc13_25.1: = bound_method %.loc13_25, %impl.elem0.loc13_25 @@ -1491,7 +1491,7 @@ class T2(G2:! type) { // CHECK:STDOUT: %bound_method.loc13_25.2: = bound_method %.loc13_25, %specific_fn.loc13_25 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc13_25: init %i32 = call %bound_method.loc13_25.2(%.loc13_25) // CHECK:STDOUT: %.loc13_35.6: ref %i32 = class_element_access %b1.var, element1 -// CHECK:STDOUT: %.loc13_35.7: init %i32 to %.loc13_35.6 = initialize_from %Int.as.Copy.impl.Op.call.loc13_25 +// CHECK:STDOUT: %.loc13_35.7: init %i32 to %.loc13_35.6 = in_place_init %Int.as.Copy.impl.Op.call.loc13_25 // CHECK:STDOUT: %.loc13_35.8: init %Base to %b1.var = class_init (%.loc13_35.3, %.loc13_35.5, %.loc13_35.7) // CHECK:STDOUT: %.loc13_3: init %Base = converted %.loc13_35.1, %.loc13_35.8 // CHECK:STDOUT: assign %b1.var, %.loc13_3 @@ -1507,7 +1507,7 @@ class T2(G2:! type) { // CHECK:STDOUT: %.loc14_35.1: %struct_type.m2.m1.5f2 = struct_literal (%int_3.loc14, %int_5) [concrete = constants.%struct] // CHECK:STDOUT: %.loc14_35.2: ref %ptr.454 = class_element_access %b2.var, element0 // CHECK:STDOUT: %Base.vtable_ptr.loc14: ref %ptr.454 = vtable_ptr @Base.vtable [concrete = constants.%Base.vtable_ptr] -// CHECK:STDOUT: %.loc14_35.3: init %ptr.454 to %.loc14_35.2 = initialize_from %Base.vtable_ptr.loc14 [concrete = constants.%Base.vtable_ptr] +// CHECK:STDOUT: %.loc14_35.3: init %ptr.454 to %.loc14_35.2 = in_place_init %Base.vtable_ptr.loc14 [concrete = constants.%Base.vtable_ptr] // CHECK:STDOUT: %impl.elem0.loc14_35.1: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc14_35.1: = bound_method %int_5, %impl.elem0.loc14_35.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.005] // CHECK:STDOUT: %specific_fn.loc14_35.1: = specific_function %impl.elem0.loc14_35.1, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -1515,7 +1515,7 @@ class T2(G2:! type) { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14_35.1: init %i32 = call %bound_method.loc14_35.2(%int_5) [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc14_35.4: init %i32 = converted %int_5, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14_35.1 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %.loc14_35.5: ref %i32 = class_element_access %b2.var, element2 -// CHECK:STDOUT: %.loc14_35.6: init %i32 to %.loc14_35.5 = initialize_from %.loc14_35.4 [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %.loc14_35.6: init %i32 to %.loc14_35.5 = in_place_init %.loc14_35.4 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %impl.elem0.loc14_35.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc14_35.3: = bound_method %int_3.loc14, %impl.elem0.loc14_35.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] // CHECK:STDOUT: %specific_fn.loc14_35.2: = specific_function %impl.elem0.loc14_35.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -1523,7 +1523,7 @@ class T2(G2:! type) { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14_35.2: init %i32 = call %bound_method.loc14_35.4(%int_3.loc14) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc14_35.7: init %i32 = converted %int_3.loc14, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc14_35.2 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc14_35.8: ref %i32 = class_element_access %b2.var, element1 -// CHECK:STDOUT: %.loc14_35.9: init %i32 to %.loc14_35.8 = initialize_from %.loc14_35.7 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc14_35.9: init %i32 to %.loc14_35.8 = in_place_init %.loc14_35.7 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc14_35.10: init %Base to %b2.var = class_init (%.loc14_35.3, %.loc14_35.6, %.loc14_35.9) [concrete = constants.%Base.val] // CHECK:STDOUT: %.loc14_3: init %Base = converted %.loc14_35.1, %.loc14_35.10 [concrete = constants.%Base.val] // CHECK:STDOUT: assign %b2.var, %.loc14_3 @@ -4903,7 +4903,7 @@ class T2(G2:! type) { // CHECK:STDOUT: %.loc7_20.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc7_20.2: ref %ptr.454 = class_element_access file.%v.var, element0 [concrete = constants.%.ae5] // CHECK:STDOUT: %Base.vtable_ptr: ref %ptr.454 = vtable_ptr @Base.vtable, @Base(constants.%T1) [concrete = constants.%Base.vtable_ptr] -// CHECK:STDOUT: %.loc7_20.3: init %ptr.454 to %.loc7_20.2 = initialize_from %Base.vtable_ptr [concrete = constants.%Base.vtable_ptr] +// CHECK:STDOUT: %.loc7_20.3: init %ptr.454 to %.loc7_20.2 = in_place_init %Base.vtable_ptr [concrete = constants.%Base.vtable_ptr] // CHECK:STDOUT: %.loc7_20.4: init %Base.d5d to file.%v.var = class_init (%.loc7_20.3) [concrete = constants.%Base.val] // CHECK:STDOUT: %.loc7_1: init %Base.d5d = converted %.loc7_20.1, %.loc7_20.4 [concrete = constants.%Base.val] // CHECK:STDOUT: assign file.%v.var, %.loc7_1 diff --git a/toolchain/check/testdata/deduce/value_with_type_through_access.carbon b/toolchain/check/testdata/deduce/value_with_type_through_access.carbon index 7023a6d66bba..5ea6ec3ee14e 100644 --- a/toolchain/check/testdata/deduce/value_with_type_through_access.carbon +++ b/toolchain/check/testdata/deduce/value_with_type_through_access.carbon @@ -736,7 +736,7 @@ fn G() { // CHECK:STDOUT: %type.as.Copy.impl.Op.call: init type = call %bound_method(%C.ref) [concrete = constants.%C] // CHECK:STDOUT: %.loc37_12.2: ref %Class = temporary_storage // CHECK:STDOUT: %.loc37_12.3: ref type = class_element_access %.loc37_12.2, element0 -// CHECK:STDOUT: %.loc37_12.4: init type to %.loc37_12.3 = initialize_from %type.as.Copy.impl.Op.call [concrete = constants.%C] +// CHECK:STDOUT: %.loc37_12.4: init type to %.loc37_12.3 = in_place_init %type.as.Copy.impl.Op.call [concrete = constants.%C] // CHECK:STDOUT: %.loc37_12.5: init %Class to %.loc37_12.2 = class_init (%.loc37_12.4) [concrete = constants.%Class.val] // CHECK:STDOUT: %.loc37_12.6: ref %Class = temporary %.loc37_12.2, %.loc37_12.5 // CHECK:STDOUT: %.loc37_13.1: ref %Class = converted %.loc37_12.1, %.loc37_12.6 @@ -963,7 +963,7 @@ fn G() { // CHECK:STDOUT: %.loc24_25.2: ref %array_type = temporary_storage // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc24_25.3: ref type = array_index %.loc24_25.2, %int_0 -// CHECK:STDOUT: %.loc24_25.4: init type to %.loc24_25.3 = initialize_from %type.as.Copy.impl.Op.call [concrete = constants.%C] +// CHECK:STDOUT: %.loc24_25.4: init type to %.loc24_25.3 = in_place_init %type.as.Copy.impl.Op.call [concrete = constants.%C] // CHECK:STDOUT: %.loc24_25.5: init %array_type to %.loc24_25.2 = array_init (%.loc24_25.4) [concrete = constants.%array] // CHECK:STDOUT: %.loc24_27.1: init %array_type = converted %.loc24_25.1, %.loc24_25.5 [concrete = constants.%array] // CHECK:STDOUT: %.loc24_27.2: ref %array_type = temporary %.loc24_25.2, %.loc24_27.1 diff --git a/toolchain/check/testdata/eval/aggregates.carbon b/toolchain/check/testdata/eval/aggregates.carbon index 599c7e943456..aace79621ac4 100644 --- a/toolchain/check/testdata/eval/aggregates.carbon +++ b/toolchain/check/testdata/eval/aggregates.carbon @@ -232,7 +232,7 @@ fn G(N:! i32) { // CHECK:STDOUT: %bound_method.loc4_37.2: = bound_method %tuple.elem0.loc4_37.1, %specific_fn.loc4_37.1 [concrete = constants.%bound_method.4d7] // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc4_37.1: init %i32 = call %bound_method.loc4_37.2(%tuple.elem0.loc4_37.1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple.elem0.loc4_37.2: ref %i32 = tuple_access file.%tuple_copy.var, element0 [concrete = constants.%tuple.elem0] -// CHECK:STDOUT: %.loc4_37.2: init %i32 to %tuple.elem0.loc4_37.2 = initialize_from %Int.as.Copy.impl.Op.call.loc4_37.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc4_37.2: init %i32 to %tuple.elem0.loc4_37.2 = in_place_init %Int.as.Copy.impl.Op.call.loc4_37.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple.elem1.loc4_37.1: %i32 = tuple_access %.loc4_37.1, element1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc4_37.2: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] // CHECK:STDOUT: %bound_method.loc4_37.3: = bound_method %tuple.elem1.loc4_37.1, %impl.elem0.loc4_37.2 [concrete = constants.%Int.as.Copy.impl.Op.bound.5e8] @@ -240,7 +240,7 @@ fn G(N:! i32) { // CHECK:STDOUT: %bound_method.loc4_37.4: = bound_method %tuple.elem1.loc4_37.1, %specific_fn.loc4_37.2 [concrete = constants.%bound_method.f15] // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc4_37.2: init %i32 = call %bound_method.loc4_37.4(%tuple.elem1.loc4_37.1) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem1.loc4_37.2: ref %i32 = tuple_access file.%tuple_copy.var, element1 [concrete = constants.%tuple.elem1] -// CHECK:STDOUT: %.loc4_37.3: init %i32 to %tuple.elem1.loc4_37.2 = initialize_from %Int.as.Copy.impl.Op.call.loc4_37.2 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc4_37.3: init %i32 to %tuple.elem1.loc4_37.2 = in_place_init %Int.as.Copy.impl.Op.call.loc4_37.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc4_37.4: init %tuple.type.d07 to file.%tuple_copy.var = tuple_init (%.loc4_37.2, %.loc4_37.3) [concrete = constants.%tuple.21c] // CHECK:STDOUT: %.loc4_1: init %tuple.type.d07 = converted %.loc4_37.1, %.loc4_37.4 [concrete = constants.%tuple.21c] // CHECK:STDOUT: assign file.%tuple_copy.var, %.loc4_1 @@ -285,7 +285,7 @@ fn G(N:! i32) { // CHECK:STDOUT: %bound_method.loc6_73.2: = bound_method %.loc6_73.2, %specific_fn.loc6_73.1 [concrete = constants.%bound_method.4d7] // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc6_73.1: init %i32 = call %bound_method.loc6_73.2(%.loc6_73.2) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc6_73.3: ref %i32 = struct_access file.%struct_copy.var, element1 [concrete = constants.%.460] -// CHECK:STDOUT: %.loc6_73.4: init %i32 to %.loc6_73.3 = initialize_from %Int.as.Copy.impl.Op.call.loc6_73.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc6_73.4: init %i32 to %.loc6_73.3 = in_place_init %Int.as.Copy.impl.Op.call.loc6_73.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc6_73.5: %i32 = struct_access %.loc6_73.1, element0 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc6_73.2: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] // CHECK:STDOUT: %bound_method.loc6_73.3: = bound_method %.loc6_73.5, %impl.elem0.loc6_73.2 [concrete = constants.%Int.as.Copy.impl.Op.bound.5e8] @@ -293,7 +293,7 @@ fn G(N:! i32) { // CHECK:STDOUT: %bound_method.loc6_73.4: = bound_method %.loc6_73.5, %specific_fn.loc6_73.2 [concrete = constants.%bound_method.f15] // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc6_73.2: init %i32 = call %bound_method.loc6_73.4(%.loc6_73.5) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc6_73.6: ref %i32 = struct_access file.%struct_copy.var, element0 [concrete = constants.%.61f] -// CHECK:STDOUT: %.loc6_73.7: init %i32 to %.loc6_73.6 = initialize_from %Int.as.Copy.impl.Op.call.loc6_73.2 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc6_73.7: init %i32 to %.loc6_73.6 = in_place_init %Int.as.Copy.impl.Op.call.loc6_73.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc6_73.8: %i32 = struct_access %.loc6_73.1, element2 [concrete = constants.%int_3.822] // CHECK:STDOUT: %impl.elem0.loc6_73.3: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] // CHECK:STDOUT: %bound_method.loc6_73.5: = bound_method %.loc6_73.8, %impl.elem0.loc6_73.3 [concrete = constants.%Int.as.Copy.impl.Op.bound.ecc] @@ -301,7 +301,7 @@ fn G(N:! i32) { // CHECK:STDOUT: %bound_method.loc6_73.6: = bound_method %.loc6_73.8, %specific_fn.loc6_73.3 [concrete = constants.%bound_method.4f5] // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc6_73.3: init %i32 = call %bound_method.loc6_73.6(%.loc6_73.8) [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc6_73.9: ref %i32 = struct_access file.%struct_copy.var, element2 [concrete = constants.%.f68] -// CHECK:STDOUT: %.loc6_73.10: init %i32 to %.loc6_73.9 = initialize_from %Int.as.Copy.impl.Op.call.loc6_73.3 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc6_73.10: init %i32 to %.loc6_73.9 = in_place_init %Int.as.Copy.impl.Op.call.loc6_73.3 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc6_73.11: init %struct_type.a.b.c to file.%struct_copy.var = struct_init (%.loc6_73.4, %.loc6_73.7, %.loc6_73.10) [concrete = constants.%struct.cff] // CHECK:STDOUT: %.loc6_1: init %struct_type.a.b.c = converted %.loc6_73.1, %.loc6_73.11 [concrete = constants.%struct.cff] // CHECK:STDOUT: assign file.%struct_copy.var, %.loc6_1 @@ -328,7 +328,7 @@ fn G(N:! i32) { // CHECK:STDOUT: %.loc8_1: ref %array_type = splice_block file.%tuple_index.var [concrete = file.%tuple_index.var] {} // CHECK:STDOUT: %int_0.loc8_37: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc8_37.3: ref %i32 = array_index %.loc8_1, %int_0.loc8_37 -// CHECK:STDOUT: %.loc8_37.4: init %i32 to %.loc8_37.3 = initialize_from %.loc8_37.2 [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc8_37.4: init %i32 to %.loc8_37.3 = in_place_init %.loc8_37.2 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc8_37.5: init %array_type to %.loc8_1 = array_init (%.loc8_37.4) [concrete = constants.%array] // CHECK:STDOUT: %.loc8_39: init %array_type = converted %.loc8_37.1, %.loc8_37.5 [concrete = constants.%array] // CHECK:STDOUT: assign file.%tuple_index.var, %.loc8_39 @@ -352,7 +352,7 @@ fn G(N:! i32) { // CHECK:STDOUT: %.loc10_1: ref %array_type = splice_block file.%struct_access.var [concrete = file.%struct_access.var] {} // CHECK:STDOUT: %int_0.loc10_39: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc10_39.3: ref %i32 = array_index %.loc10_1, %int_0.loc10_39 -// CHECK:STDOUT: %.loc10_39.4: init %i32 to %.loc10_39.3 = initialize_from %.loc10_39.2 [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc10_39.4: init %i32 to %.loc10_39.3 = in_place_init %.loc10_39.2 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc10_39.5: init %array_type to %.loc10_1 = array_init (%.loc10_39.4) [concrete = constants.%array] // CHECK:STDOUT: %.loc10_41: init %array_type = converted %.loc10_39.1, %.loc10_39.5 [concrete = constants.%array] // CHECK:STDOUT: assign file.%struct_access.var, %.loc10_41 @@ -452,7 +452,7 @@ fn G(N:! i32) { // CHECK:STDOUT: %.loc9_65.3: ref %array_type.f32 = temporary_storage // CHECK:STDOUT: %int_0.loc9_65: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc9_65.4: ref %i32 = array_index %.loc9_65.3, %int_0.loc9_65 -// CHECK:STDOUT: %.loc9_65.5: init %i32 to %.loc9_65.4 = initialize_from %.loc9_65.2 [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %.loc9_65.5: init %i32 to %.loc9_65.4 = in_place_init %.loc9_65.2 [concrete = constants.%int_5.0f6] // CHECK:STDOUT: %impl.elem0.loc9_65.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc9_65.3: = bound_method %int_7, %impl.elem0.loc9_65.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.1e0] // CHECK:STDOUT: %specific_fn.loc9_65.2: = specific_function %impl.elem0.loc9_65.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -461,7 +461,7 @@ fn G(N:! i32) { // CHECK:STDOUT: %.loc9_65.6: init %i32 = converted %int_7, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_65.2 [concrete = constants.%int_7.0b1] // CHECK:STDOUT: %int_1.loc9_65: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc9_65.7: ref %i32 = array_index %.loc9_65.3, %int_1.loc9_65 -// CHECK:STDOUT: %.loc9_65.8: init %i32 to %.loc9_65.7 = initialize_from %.loc9_65.6 [concrete = constants.%int_7.0b1] +// CHECK:STDOUT: %.loc9_65.8: init %i32 to %.loc9_65.7 = in_place_init %.loc9_65.6 [concrete = constants.%int_7.0b1] // CHECK:STDOUT: %impl.elem0.loc9_65.3: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc9_65.5: = bound_method %int_1.loc9_61, %impl.elem0.loc9_65.3 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.215] // CHECK:STDOUT: %specific_fn.loc9_65.3: = specific_function %impl.elem0.loc9_65.3, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -470,7 +470,7 @@ fn G(N:! i32) { // CHECK:STDOUT: %.loc9_65.9: init %i32 = converted %int_1.loc9_61, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_65.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %int_2.loc9_65: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc9_65.10: ref %i32 = array_index %.loc9_65.3, %int_2.loc9_65 -// CHECK:STDOUT: %.loc9_65.11: init %i32 to %.loc9_65.10 = initialize_from %.loc9_65.9 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc9_65.11: init %i32 to %.loc9_65.10 = in_place_init %.loc9_65.9 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc9_65.4: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc9_65.7: = bound_method %int_9, %impl.elem0.loc9_65.4 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.87d] // CHECK:STDOUT: %specific_fn.loc9_65.4: = specific_function %impl.elem0.loc9_65.4, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -479,7 +479,7 @@ fn G(N:! i32) { // CHECK:STDOUT: %.loc9_65.12: init %i32 = converted %int_9, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc9_65.4 [concrete = constants.%int_9.f88] // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3] // CHECK:STDOUT: %.loc9_65.13: ref %i32 = array_index %.loc9_65.3, %int_3 -// CHECK:STDOUT: %.loc9_65.14: init %i32 to %.loc9_65.13 = initialize_from %.loc9_65.12 [concrete = constants.%int_9.f88] +// CHECK:STDOUT: %.loc9_65.14: init %i32 to %.loc9_65.13 = in_place_init %.loc9_65.12 [concrete = constants.%int_9.f88] // CHECK:STDOUT: %.loc9_65.15: init %array_type.f32 to %.loc9_65.3 = array_init (%.loc9_65.5, %.loc9_65.8, %.loc9_65.11, %.loc9_65.14) [concrete = constants.%array] // CHECK:STDOUT: %.loc9_67.1: init %array_type.f32 = converted %.loc9_65.1, %.loc9_65.15 [concrete = constants.%array] // CHECK:STDOUT: %int_2.loc9_85: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] diff --git a/toolchain/check/testdata/for/actual.carbon b/toolchain/check/testdata/for/actual.carbon index ff542cae5f0a..6dcc3c3f75bc 100644 --- a/toolchain/check/testdata/for/actual.carbon +++ b/toolchain/check/testdata/for/actual.carbon @@ -511,14 +511,14 @@ fn Read(y:! Core.IntLiteral()) { // CHECK:STDOUT: %bound_method.loc6_22.2: = bound_method %start.ref, %specific_impl_fn.loc6_22.1 // CHECK:STDOUT: %Copy.Op.call.loc6_22: init @IntRange.Make.%Int.loc5_28.1 (%Int.fc6021.1) = call %bound_method.loc6_22.2(%start.ref) // CHECK:STDOUT: %.loc6_39.2: ref @IntRange.Make.%Int.loc5_28.1 (%Int.fc6021.1) = class_element_access %return.param, element0 -// CHECK:STDOUT: %.loc6_39.3: init @IntRange.Make.%Int.loc5_28.1 (%Int.fc6021.1) to %.loc6_39.2 = initialize_from %Copy.Op.call.loc6_22 +// CHECK:STDOUT: %.loc6_39.3: init @IntRange.Make.%Int.loc5_28.1 (%Int.fc6021.1) to %.loc6_39.2 = in_place_init %Copy.Op.call.loc6_22 // CHECK:STDOUT: %impl.elem0.loc6_36: @IntRange.Make.%.loc6_22.2 (%.3676) = impl_witness_access constants.%Copy.lookup_impl_witness.7a8, element0 [symbolic = %impl.elem0.loc6_22.2 (constants.%impl.elem0.053)] // CHECK:STDOUT: %bound_method.loc6_36.1: = bound_method %end.ref, %impl.elem0.loc6_36 // CHECK:STDOUT: %specific_impl_fn.loc6_36: = specific_impl_function %impl.elem0.loc6_36, @Copy.Op(constants.%Copy.facet.3b9) [symbolic = %specific_impl_fn.loc6_22.2 (constants.%specific_impl_fn.62b)] // CHECK:STDOUT: %bound_method.loc6_36.2: = bound_method %end.ref, %specific_impl_fn.loc6_36 // CHECK:STDOUT: %Copy.Op.call.loc6_36: init @IntRange.Make.%Int.loc5_28.1 (%Int.fc6021.1) = call %bound_method.loc6_36.2(%end.ref) // CHECK:STDOUT: %.loc6_39.4: ref @IntRange.Make.%Int.loc5_28.1 (%Int.fc6021.1) = class_element_access %return.param, element1 -// CHECK:STDOUT: %.loc6_39.5: init @IntRange.Make.%Int.loc5_28.1 (%Int.fc6021.1) to %.loc6_39.4 = initialize_from %Copy.Op.call.loc6_36 +// CHECK:STDOUT: %.loc6_39.5: init @IntRange.Make.%Int.loc5_28.1 (%Int.fc6021.1) to %.loc6_39.4 = in_place_init %Copy.Op.call.loc6_36 // CHECK:STDOUT: %.loc6_39.6: init @IntRange.Make.%IntRange (%IntRange.265) to %return.param = class_init (%.loc6_39.3, %.loc6_39.5) // CHECK:STDOUT: %.loc6_40: init @IntRange.Make.%IntRange (%IntRange.265) = converted %.loc6_39.1, %.loc6_39.6 // CHECK:STDOUT: return %.loc6_40 to %return.param diff --git a/toolchain/check/testdata/function/builtin/call_from_operator.carbon b/toolchain/check/testdata/function/builtin/call_from_operator.carbon index fc04dcc01699..eeb8ef4e8a26 100644 --- a/toolchain/check/testdata/function/builtin/call_from_operator.carbon +++ b/toolchain/check/testdata/function/builtin/call_from_operator.carbon @@ -1062,17 +1062,17 @@ var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32)); // CHECK:STDOUT: %.loc4_78.2: init %i32.builtin = converted %int_3.loc4_49, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc4_78.1 [concrete = constants.%int_3.a0f] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc4_78.3: ref %i32.builtin = array_index file.%arr.var, %int_0 -// CHECK:STDOUT: %.loc4_78.4: init %i32.builtin to %.loc4_78.3 = initialize_from %.loc4_78.2 [concrete = constants.%int_3.a0f] +// CHECK:STDOUT: %.loc4_78.4: init %i32.builtin to %.loc4_78.3 = in_place_init %.loc4_78.2 [concrete = constants.%int_3.a0f] // CHECK:STDOUT: %impl.elem0.loc4_78.2: %.7de = impl_witness_access constants.%ImplicitAs.impl_witness.586, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert] // CHECK:STDOUT: %bound_method.loc4_78.2: = bound_method %int_4.loc4_52, %impl.elem0.loc4_78.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.762] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc4_78.2: init %i32.builtin = call %bound_method.loc4_78.2(%int_4.loc4_52) [concrete = constants.%int_4.4f1] // CHECK:STDOUT: %.loc4_78.5: init %i32.builtin = converted %int_4.loc4_52, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc4_78.2 [concrete = constants.%int_4.4f1] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc4_78.6: ref %i32.builtin = array_index file.%arr.var, %int_1 -// CHECK:STDOUT: %.loc4_78.7: init %i32.builtin to %.loc4_78.6 = initialize_from %.loc4_78.5 [concrete = constants.%int_4.4f1] +// CHECK:STDOUT: %.loc4_78.7: init %i32.builtin to %.loc4_78.6 = in_place_init %.loc4_78.5 [concrete = constants.%int_4.4f1] // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc4_78.8: ref %i32.builtin = array_index file.%arr.var, %int_2 -// CHECK:STDOUT: %.loc4_78.9: init %i32.builtin to %.loc4_78.8 = initialize_from %i32.builtin.as.AddWith.impl.Op.call [concrete = constants.%int_7] +// CHECK:STDOUT: %.loc4_78.9: init %i32.builtin to %.loc4_78.8 = in_place_init %i32.builtin.as.AddWith.impl.Op.call [concrete = constants.%int_7] // CHECK:STDOUT: %.loc4_78.10: init %array_type to file.%arr.var = array_init (%.loc4_78.4, %.loc4_78.7, %.loc4_78.9) [concrete = constants.%array] // CHECK:STDOUT: %.loc4_1: init %array_type = converted %.loc4_78.1, %.loc4_78.10 [concrete = constants.%array] // CHECK:STDOUT: assign file.%arr.var, %.loc4_1 diff --git a/toolchain/check/testdata/function/builtin/import.carbon b/toolchain/check/testdata/function/builtin/import.carbon index 6a7a9cc120af..75f22fe514de 100644 --- a/toolchain/check/testdata/function/builtin/import.carbon +++ b/toolchain/check/testdata/function/builtin/import.carbon @@ -287,13 +287,13 @@ var arr: array(i32, Core.AsIntLiteral(Core.TestAdd(Core.AsI32(1), Core.AsI32(2)) // CHECK:STDOUT: %.loc4_130.1: %tuple.type = tuple_literal (%AsI32.call.loc4_99, %AsI32.call.loc4_114, %AsI32.call.loc4_129) [concrete = constants.%tuple] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc4_130.2: ref %i32.builtin = array_index file.%arr.var, %int_0 -// CHECK:STDOUT: %.loc4_130.3: init %i32.builtin to %.loc4_130.2 = initialize_from %AsI32.call.loc4_99 [concrete = constants.%int_1.f38] +// CHECK:STDOUT: %.loc4_130.3: init %i32.builtin to %.loc4_130.2 = in_place_init %AsI32.call.loc4_99 [concrete = constants.%int_1.f38] // CHECK:STDOUT: %int_1.loc4_130: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc4_130.4: ref %i32.builtin = array_index file.%arr.var, %int_1.loc4_130 -// CHECK:STDOUT: %.loc4_130.5: init %i32.builtin to %.loc4_130.4 = initialize_from %AsI32.call.loc4_114 [concrete = constants.%int_2.5a1] +// CHECK:STDOUT: %.loc4_130.5: init %i32.builtin to %.loc4_130.4 = in_place_init %AsI32.call.loc4_114 [concrete = constants.%int_2.5a1] // CHECK:STDOUT: %int_2.loc4_130: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc4_130.6: ref %i32.builtin = array_index file.%arr.var, %int_2.loc4_130 -// CHECK:STDOUT: %.loc4_130.7: init %i32.builtin to %.loc4_130.6 = initialize_from %AsI32.call.loc4_129 [concrete = constants.%int_3.a0f] +// CHECK:STDOUT: %.loc4_130.7: init %i32.builtin to %.loc4_130.6 = in_place_init %AsI32.call.loc4_129 [concrete = constants.%int_3.a0f] // CHECK:STDOUT: %.loc4_130.8: init %array_type to file.%arr.var = array_init (%.loc4_130.3, %.loc4_130.5, %.loc4_130.7) [concrete = constants.%array] // CHECK:STDOUT: %.loc4_1: init %array_type = converted %.loc4_130.1, %.loc4_130.8 [concrete = constants.%array] // CHECK:STDOUT: assign file.%arr.var, %.loc4_1 diff --git a/toolchain/check/testdata/function/call/more_param_ir.carbon b/toolchain/check/testdata/function/call/more_param_ir.carbon index 754417f9fb33..aecf6d6537ae 100644 --- a/toolchain/check/testdata/function/call/more_param_ir.carbon +++ b/toolchain/check/testdata/function/call/more_param_ir.carbon @@ -131,7 +131,7 @@ fn Main() { // CHECK:STDOUT: %bound_method.loc18_22.2: = bound_method %int_1, %specific_fn.loc18 [concrete = constants.%bound_method.38b] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18: init %i32 = call %bound_method.loc18_22.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc18_22.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc18_22.3: init %tuple.type.a1c = tuple_init (%.loc18_22.2) [concrete = constants.%tuple.246] +// CHECK:STDOUT: %.loc18_22.3: init %tuple.type.a1c to %x.var = tuple_init (%.loc18_22.2) [concrete = constants.%tuple.246] // CHECK:STDOUT: %.loc18_3: init %tuple.type.a1c = converted %.loc18_22.1, %.loc18_22.3 [concrete = constants.%tuple.246] // CHECK:STDOUT: assign %x.var, %.loc18_3 // CHECK:STDOUT: %.loc18_15.1: type = splice_block %.loc18_15.3 [concrete = constants.%tuple.type.a1c] { diff --git a/toolchain/check/testdata/generic/local.carbon b/toolchain/check/testdata/generic/local.carbon index 408068dea0f2..21602ee4055a 100644 --- a/toolchain/check/testdata/generic/local.carbon +++ b/toolchain/check/testdata/generic/local.carbon @@ -169,7 +169,7 @@ class C(C:! type) { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc8_26.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_26.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_26.3: ref %i32 = class_element_access %v.var, element0 -// CHECK:STDOUT: %.loc8_26.4: init %i32 to %.loc8_26.3 = initialize_from %.loc8_26.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc8_26.4: init %i32 to %.loc8_26.3 = in_place_init %.loc8_26.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc8_26.5: init %C.d45 to %v.var = class_init (%.loc8_26.4) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc8_3: init %C.d45 = converted %.loc8_26.1, %.loc8_26.5 [concrete = constants.%C.val] // CHECK:STDOUT: assign %v.var, %.loc8_3 diff --git a/toolchain/check/testdata/if_expr/basic.carbon b/toolchain/check/testdata/if_expr/basic.carbon index 9b59568582ad..7c6b59d92a5d 100644 --- a/toolchain/check/testdata/if_expr/basic.carbon +++ b/toolchain/check/testdata/if_expr/basic.carbon @@ -152,7 +152,7 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: %.loc16_29.2: init %i32 = converted %int_0.loc16_27, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %int_0.loc16_29: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc16_29.3: ref %i32 = array_index %x.var, %int_0.loc16_29 -// CHECK:STDOUT: %.loc16_29.4: init %i32 to %.loc16_29.3 = initialize_from %.loc16_29.2 [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc16_29.4: init %i32 to %.loc16_29.3 = in_place_init %.loc16_29.2 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc16_29.5: init %array_type to %x.var = array_init (%.loc16_29.4) [concrete = constants.%array] // CHECK:STDOUT: %.loc16_3: init %array_type = converted %.loc16_29.1, %.loc16_29.5 [concrete = constants.%array] // CHECK:STDOUT: assign %x.var, %.loc16_3 diff --git a/toolchain/check/testdata/if_expr/struct.carbon b/toolchain/check/testdata/if_expr/struct.carbon index 58bdda01ebe3..2756853eae73 100644 --- a/toolchain/check/testdata/if_expr/struct.carbon +++ b/toolchain/check/testdata/if_expr/struct.carbon @@ -136,7 +136,7 @@ fn F(cond: bool) { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18_46.1: init %i32 = call %bound_method.loc18_46.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc18_46.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18_46.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc18_46.3: ref %i32 = struct_access %a.var, element0 -// CHECK:STDOUT: %.loc18_46.4: init %i32 to %.loc18_46.3 = initialize_from %.loc18_46.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc18_46.4: init %i32 to %.loc18_46.3 = in_place_init %.loc18_46.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc18_46.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc18_46.3: = bound_method %int_2, %impl.elem0.loc18_46.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc18_46.2: = specific_function %impl.elem0.loc18_46.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -144,7 +144,7 @@ fn F(cond: bool) { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18_46.2: init %i32 = call %bound_method.loc18_46.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc18_46.5: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18_46.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc18_46.6: ref %i32 = struct_access %a.var, element1 -// CHECK:STDOUT: %.loc18_46.7: init %i32 to %.loc18_46.6 = initialize_from %.loc18_46.5 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc18_46.7: init %i32 to %.loc18_46.6 = in_place_init %.loc18_46.5 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc18_46.8: init %struct_type.a.b.501 to %a.var = struct_init (%.loc18_46.4, %.loc18_46.7) [concrete = constants.%struct.ed5] // CHECK:STDOUT: %.loc18_3: init %struct_type.a.b.501 = converted %.loc18_46.1, %.loc18_46.8 [concrete = constants.%struct.ed5] // CHECK:STDOUT: assign %a.var, %.loc18_3 diff --git a/toolchain/check/testdata/impl/extend_impl_generic.carbon b/toolchain/check/testdata/impl/extend_impl_generic.carbon index d9ca9d2d8c44..3f1b3e38a623 100644 --- a/toolchain/check/testdata/impl/extend_impl_generic.carbon +++ b/toolchain/check/testdata/impl/extend_impl_generic.carbon @@ -284,7 +284,7 @@ class X(U:! type) { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc15_21.2(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_21.2: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_21.3: ref %i32 = class_element_access %return.param, element0 -// CHECK:STDOUT: %.loc15_21.4: init %i32 to %.loc15_21.3 = initialize_from %.loc15_21.2 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc15_21.4: init %i32 to %.loc15_21.3 = in_place_init %.loc15_21.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc15_21.5: init %Param to %return.param = class_init (%.loc15_21.4) [concrete = constants.%Param.val] // CHECK:STDOUT: %.loc15_22: init %Param = converted %.loc15_21.1, %.loc15_21.5 [concrete = constants.%Param.val] // CHECK:STDOUT: return %.loc15_22 to %return.param diff --git a/toolchain/check/testdata/impl/impl_thunk.carbon b/toolchain/check/testdata/impl/impl_thunk.carbon index 6b26f4da8634..d6ab3f39acd3 100644 --- a/toolchain/check/testdata/impl/impl_thunk.carbon +++ b/toolchain/check/testdata/impl/impl_thunk.carbon @@ -399,11 +399,11 @@ impl () as I({}) { // CHECK:STDOUT: %.loc10_48.2: ref %struct_type.d.c.b36 = temporary %.loc10_48.1, %empty_tuple.type.as.I.impl.F.call // CHECK:STDOUT: %.loc10_48.3: ref %empty_tuple.type = struct_access %.loc10_48.2, element1 // CHECK:STDOUT: %.loc10_48.4: ref %empty_tuple.type = struct_access %return.param, element1 -// CHECK:STDOUT: %.loc10_48.5: init %empty_tuple.type to %.loc10_48.4 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc10_48.5: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc10_48.6: init %empty_tuple.type = converted %.loc10_48.3, %.loc10_48.5 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc10_48.7: ref %empty_struct_type = struct_access %.loc10_48.2, element0 // CHECK:STDOUT: %.loc10_48.8: ref %empty_struct_type = struct_access %return.param, element0 -// CHECK:STDOUT: %.loc10_48.9: init %empty_struct_type to %.loc10_48.8 = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc10_48.9: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc10_48.10: init %empty_struct_type = converted %.loc10_48.7, %.loc10_48.9 [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc10_48.11: init %struct_type.c.d.15a to %return.param = struct_init (%.loc10_48.6, %.loc10_48.10) [concrete = constants.%struct] // CHECK:STDOUT: %.loc10_48.12: init %struct_type.c.d.15a = converted %empty_tuple.type.as.I.impl.F.call, %.loc10_48.11 [concrete = constants.%struct] @@ -1217,11 +1217,11 @@ impl () as I({}) { // CHECK:STDOUT: %.loc10_29.2: ref %struct_type.b.a.1b0 = temporary %.loc10_29.1, %empty_tuple.type.as.I.impl.F.call // CHECK:STDOUT: %.loc10_29.3: ref %empty_struct_type = struct_access %.loc10_29.2, element1 // CHECK:STDOUT: %.loc10_29.4: ref %empty_struct_type = struct_access %return.param, element1 -// CHECK:STDOUT: %.loc10_29.5: init %empty_struct_type to %.loc10_29.4 = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc10_29.5: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc10_29.6: init %empty_struct_type = converted %.loc10_29.3, %.loc10_29.5 [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc10_29.7: ref %empty_struct_type = struct_access %.loc10_29.2, element0 // CHECK:STDOUT: %.loc10_29.8: ref %empty_struct_type = struct_access %return.param, element0 -// CHECK:STDOUT: %.loc10_29.9: init %empty_struct_type to %.loc10_29.8 = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc10_29.9: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc10_29.10: init %empty_struct_type = converted %.loc10_29.7, %.loc10_29.9 [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc10_29.11: init %struct_type.a.b.f95 to %return.param = struct_init (%.loc10_29.6, %.loc10_29.10) [concrete = constants.%struct] // CHECK:STDOUT: %.loc10_29.12: init %struct_type.a.b.f95 = converted %empty_tuple.type.as.I.impl.F.call, %.loc10_29.11 [concrete = constants.%struct] diff --git a/toolchain/check/testdata/impl/use_assoc_entity.carbon b/toolchain/check/testdata/impl/use_assoc_entity.carbon index a138556f5926..f51cc8e86135 100644 --- a/toolchain/check/testdata/impl/use_assoc_entity.carbon +++ b/toolchain/check/testdata/impl/use_assoc_entity.carbon @@ -4189,13 +4189,13 @@ fn F() { // CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc9_50: init bool = call %bound_method.loc9_50(%true) [concrete = constants.%true] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc9_61.2: ref bool = array_index %return.param, %int_0 -// CHECK:STDOUT: %.loc9_61.3: init bool to %.loc9_61.2 = initialize_from %bool.as.Copy.impl.Op.call.loc9_50 [concrete = constants.%true] +// CHECK:STDOUT: %.loc9_61.3: init bool to %.loc9_61.2 = in_place_init %bool.as.Copy.impl.Op.call.loc9_50 [concrete = constants.%true] // CHECK:STDOUT: %impl.elem0.loc9_56: %.56b = impl_witness_access constants.%Copy.impl_witness.348, element0 [concrete = constants.%bool.as.Copy.impl.Op] // CHECK:STDOUT: %bound_method.loc9_56: = bound_method %false, %impl.elem0.loc9_56 [concrete = constants.%bool.as.Copy.impl.Op.bound.082] // CHECK:STDOUT: %bool.as.Copy.impl.Op.call.loc9_56: init bool = call %bound_method.loc9_56(%false) [concrete = constants.%false] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: %.loc9_61.4: ref bool = array_index %return.param, %int_1 -// CHECK:STDOUT: %.loc9_61.5: init bool to %.loc9_61.4 = initialize_from %bool.as.Copy.impl.Op.call.loc9_56 [concrete = constants.%false] +// CHECK:STDOUT: %.loc9_61.5: init bool to %.loc9_61.4 = in_place_init %bool.as.Copy.impl.Op.call.loc9_56 [concrete = constants.%false] // CHECK:STDOUT: %.loc9_61.6: init %array_type.c9b to %return.param = array_init (%.loc9_61.3, %.loc9_61.5) [concrete = constants.%array] // CHECK:STDOUT: %.loc9_62: init %array_type.c9b = converted %.loc9_61.1, %.loc9_61.6 [concrete = constants.%array] // CHECK:STDOUT: return %.loc9_62 to %return.param diff --git a/toolchain/check/testdata/index/array_element_access.carbon b/toolchain/check/testdata/index/array_element_access.carbon index beac8ab35210..c0157ac6f703 100644 --- a/toolchain/check/testdata/index/array_element_access.carbon +++ b/toolchain/check/testdata/index/array_element_access.carbon @@ -156,7 +156,7 @@ var d: i32 = a[b]; // CHECK:STDOUT: %.loc15_31.2: init %i32 = converted %int_12, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc15_31.1 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %int_0.loc15: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc15_31.3: ref %i32 = array_index file.%a.var, %int_0.loc15 -// CHECK:STDOUT: %.loc15_31.4: init %i32 to %.loc15_31.3 = initialize_from %.loc15_31.2 [concrete = constants.%int_12.1e1] +// CHECK:STDOUT: %.loc15_31.4: init %i32 to %.loc15_31.3 = in_place_init %.loc15_31.2 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %impl.elem0.loc15_31.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc15_31.3: = bound_method %int_24, %impl.elem0.loc15_31.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.3b2] // CHECK:STDOUT: %specific_fn.loc15_31.2: = specific_function %impl.elem0.loc15_31.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -165,7 +165,7 @@ var d: i32 = a[b]; // CHECK:STDOUT: %.loc15_31.5: init %i32 = converted %int_24, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc15_31.2 [concrete = constants.%int_24.365] // CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc15_31.6: ref %i32 = array_index file.%a.var, %int_1.loc15 -// CHECK:STDOUT: %.loc15_31.7: init %i32 to %.loc15_31.6 = initialize_from %.loc15_31.5 [concrete = constants.%int_24.365] +// CHECK:STDOUT: %.loc15_31.7: init %i32 to %.loc15_31.6 = in_place_init %.loc15_31.5 [concrete = constants.%int_24.365] // CHECK:STDOUT: %.loc15_31.8: init %array_type to file.%a.var = array_init (%.loc15_31.4, %.loc15_31.7) [concrete = constants.%array] // CHECK:STDOUT: %.loc15_1: init %array_type = converted %.loc15_31.1, %.loc15_31.8 [concrete = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc15_1 diff --git a/toolchain/check/testdata/index/expr_category.carbon b/toolchain/check/testdata/index/expr_category.carbon index 327dcbaa53f7..ddb744cc3a4d 100644 --- a/toolchain/check/testdata/index/expr_category.carbon +++ b/toolchain/check/testdata/index/expr_category.carbon @@ -193,7 +193,7 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %.loc18_34.2: init %i32 = converted %int_1.loc18_27, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18_34.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %int_0.loc18: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc18_34.3: ref %i32 = array_index %a.var, %int_0.loc18 -// CHECK:STDOUT: %.loc18_34.4: init %i32 to %.loc18_34.3 = initialize_from %.loc18_34.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc18_34.4: init %i32 to %.loc18_34.3 = in_place_init %.loc18_34.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc18_34.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc18_34.3: = bound_method %int_2.loc18_30, %impl.elem0.loc18_34.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc18_34.2: = specific_function %impl.elem0.loc18_34.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -202,7 +202,7 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %.loc18_34.5: init %i32 = converted %int_2.loc18_30, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18_34.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc18_34: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc18_34.6: ref %i32 = array_index %a.var, %int_1.loc18_34 -// CHECK:STDOUT: %.loc18_34.7: init %i32 to %.loc18_34.6 = initialize_from %.loc18_34.5 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc18_34.7: init %i32 to %.loc18_34.6 = in_place_init %.loc18_34.5 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc18_34.3: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc18_34.5: = bound_method %int_3.loc18_33, %impl.elem0.loc18_34.3 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] // CHECK:STDOUT: %specific_fn.loc18_34.3: = specific_function %impl.elem0.loc18_34.3, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -211,7 +211,7 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %.loc18_34.8: init %i32 = converted %int_3.loc18_33, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18_34.3 [concrete = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc18_34: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc18_34.9: ref %i32 = array_index %a.var, %int_2.loc18_34 -// CHECK:STDOUT: %.loc18_34.10: init %i32 to %.loc18_34.9 = initialize_from %.loc18_34.8 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc18_34.10: init %i32 to %.loc18_34.9 = in_place_init %.loc18_34.8 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc18_34.11: init %array_type to %a.var = array_init (%.loc18_34.4, %.loc18_34.7, %.loc18_34.10) [concrete = constants.%array] // CHECK:STDOUT: %.loc18_3: init %array_type = converted %.loc18_34.1, %.loc18_34.11 [concrete = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc18_3 @@ -302,7 +302,7 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %.loc26_34.2: init %i32 = converted %int_1.loc26_27, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc26_34.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %int_0.loc26: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] // CHECK:STDOUT: %.loc26_34.3: ref %i32 = array_index %a.var, %int_0.loc26 -// CHECK:STDOUT: %.loc26_34.4: init %i32 to %.loc26_34.3 = initialize_from %.loc26_34.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc26_34.4: init %i32 to %.loc26_34.3 = in_place_init %.loc26_34.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc26_34.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc26_34.3: = bound_method %int_2.loc26_30, %impl.elem0.loc26_34.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc26_34.2: = specific_function %impl.elem0.loc26_34.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -311,7 +311,7 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %.loc26_34.5: init %i32 = converted %int_2.loc26_30, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc26_34.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc26_34: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc26_34.6: ref %i32 = array_index %a.var, %int_1.loc26_34 -// CHECK:STDOUT: %.loc26_34.7: init %i32 to %.loc26_34.6 = initialize_from %.loc26_34.5 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc26_34.7: init %i32 to %.loc26_34.6 = in_place_init %.loc26_34.5 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc26_34.3: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc26_34.5: = bound_method %int_3.loc26_33, %impl.elem0.loc26_34.3 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] // CHECK:STDOUT: %specific_fn.loc26_34.3: = specific_function %impl.elem0.loc26_34.3, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -320,7 +320,7 @@ fn ValueBinding(b: array(i32, 3)) { // CHECK:STDOUT: %.loc26_34.8: init %i32 = converted %int_3.loc26_33, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc26_34.3 [concrete = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc26_34: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc26_34.9: ref %i32 = array_index %a.var, %int_2.loc26_34 -// CHECK:STDOUT: %.loc26_34.10: init %i32 to %.loc26_34.9 = initialize_from %.loc26_34.8 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc26_34.10: init %i32 to %.loc26_34.9 = in_place_init %.loc26_34.8 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc26_34.11: init %array_type to %a.var = array_init (%.loc26_34.4, %.loc26_34.7, %.loc26_34.10) [concrete = constants.%array] // CHECK:STDOUT: %.loc26_3: init %array_type = converted %.loc26_34.1, %.loc26_34.11 [concrete = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc26_3 diff --git a/toolchain/check/testdata/index/fail_array_large_index.carbon b/toolchain/check/testdata/index/fail_array_large_index.carbon index 93bcba496e5d..bfbc8a785d24 100644 --- a/toolchain/check/testdata/index/fail_array_large_index.carbon +++ b/toolchain/check/testdata/index/fail_array_large_index.carbon @@ -149,7 +149,7 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: %.loc15_28.2: init %i32 = converted %int_12, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc15 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc15_28.3: ref %i32 = array_index file.%a.var, %int_0 -// CHECK:STDOUT: %.loc15_28.4: init %i32 to %.loc15_28.3 = initialize_from %.loc15_28.2 [concrete = constants.%int_12.1e1] +// CHECK:STDOUT: %.loc15_28.4: init %i32 to %.loc15_28.3 = in_place_init %.loc15_28.2 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %.loc15_28.5: init %array_type to file.%a.var = array_init (%.loc15_28.4) [concrete = constants.%array] // CHECK:STDOUT: %.loc15_1: init %array_type = converted %.loc15_28.1, %.loc15_28.5 [concrete = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc15_1 diff --git a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon index a78b85917bd5..bf9361930183 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -128,7 +128,7 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: %.loc15_28.2: init %i32 = converted %int_12, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc15_28.3: ref %i32 = array_index file.%a.var, %int_0 -// CHECK:STDOUT: %.loc15_28.4: init %i32 to %.loc15_28.3 = initialize_from %.loc15_28.2 [concrete = constants.%int_12.1e1] +// CHECK:STDOUT: %.loc15_28.4: init %i32 to %.loc15_28.3 = in_place_init %.loc15_28.2 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %.loc15_28.5: init %array_type to file.%a.var = array_init (%.loc15_28.4) [concrete = constants.%array] // CHECK:STDOUT: %.loc15_1: init %array_type = converted %.loc15_28.1, %.loc15_28.5 [concrete = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc15_1 diff --git a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon index 697f921ec625..93f46331ff91 100644 --- a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon +++ b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon @@ -127,7 +127,7 @@ var b: i32 = a[1]; // CHECK:STDOUT: %.loc15_28.2: init %i32 = converted %int_12, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc15 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc15_28.3: ref %i32 = array_index file.%a.var, %int_0 -// CHECK:STDOUT: %.loc15_28.4: init %i32 to %.loc15_28.3 = initialize_from %.loc15_28.2 [concrete = constants.%int_12.1e1] +// CHECK:STDOUT: %.loc15_28.4: init %i32 to %.loc15_28.3 = in_place_init %.loc15_28.2 [concrete = constants.%int_12.1e1] // CHECK:STDOUT: %.loc15_28.5: init %array_type to file.%a.var = array_init (%.loc15_28.4) [concrete = constants.%array] // CHECK:STDOUT: %.loc15_1: init %array_type = converted %.loc15_28.1, %.loc15_28.5 [concrete = constants.%array] // CHECK:STDOUT: assign file.%a.var, %.loc15_1 diff --git a/toolchain/check/testdata/index/fail_negative_indexing.carbon b/toolchain/check/testdata/index/fail_negative_indexing.carbon index 44cd683cbaca..681a3637dc51 100644 --- a/toolchain/check/testdata/index/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/index/fail_negative_indexing.carbon @@ -145,7 +145,7 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %.loc15_31.2: init %i32 = converted %int_42.loc15_25, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc15_31.1 [concrete = constants.%int_42.c68] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc15_31.3: ref %i32 = array_index file.%c.var, %int_0 -// CHECK:STDOUT: %.loc15_31.4: init %i32 to %.loc15_31.3 = initialize_from %.loc15_31.2 [concrete = constants.%int_42.c68] +// CHECK:STDOUT: %.loc15_31.4: init %i32 to %.loc15_31.3 = in_place_init %.loc15_31.2 [concrete = constants.%int_42.c68] // CHECK:STDOUT: %impl.elem0.loc15_31.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc15_31.3: = bound_method %int_42.loc15_29, %impl.elem0.loc15_31.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.c83] // CHECK:STDOUT: %specific_fn.loc15_31.2: = specific_function %impl.elem0.loc15_31.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -154,7 +154,7 @@ var d: i32 = c[-10]; // CHECK:STDOUT: %.loc15_31.5: init %i32 = converted %int_42.loc15_29, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc15_31.2 [concrete = constants.%int_42.c68] // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: %.loc15_31.6: ref %i32 = array_index file.%c.var, %int_1 -// CHECK:STDOUT: %.loc15_31.7: init %i32 to %.loc15_31.6 = initialize_from %.loc15_31.5 [concrete = constants.%int_42.c68] +// CHECK:STDOUT: %.loc15_31.7: init %i32 to %.loc15_31.6 = in_place_init %.loc15_31.5 [concrete = constants.%int_42.c68] // CHECK:STDOUT: %.loc15_31.8: init %array_type to file.%c.var = array_init (%.loc15_31.4, %.loc15_31.7) [concrete = constants.%array] // CHECK:STDOUT: %.loc15_1: init %array_type = converted %.loc15_31.1, %.loc15_31.8 [concrete = constants.%array] // CHECK:STDOUT: assign file.%c.var, %.loc15_1 diff --git a/toolchain/check/testdata/interface/generic_method.carbon b/toolchain/check/testdata/interface/generic_method.carbon index 0e40a7ca84bf..1307266edb70 100644 --- a/toolchain/check/testdata/interface/generic_method.carbon +++ b/toolchain/check/testdata/interface/generic_method.carbon @@ -426,7 +426,7 @@ fn CallIndirect() { // CHECK:STDOUT: %bound_method.loc17_21.2: = bound_method %u.ref, %specific_impl_fn.loc17_21.1 // CHECK:STDOUT: %Copy.Op.call: init @Y.as.A.impl.F.%ptr.loc16_22.1 (%ptr.e8f8f9.1) = call %bound_method.loc17_21.2(%u.ref) // CHECK:STDOUT: %tuple.elem2: ref @Y.as.A.impl.F.%ptr.loc16_22.1 (%ptr.e8f8f9.1) = tuple_access %return.param, element2 -// CHECK:STDOUT: %.loc17_22.4: init @Y.as.A.impl.F.%ptr.loc16_22.1 (%ptr.e8f8f9.1) to %tuple.elem2 = initialize_from %Copy.Op.call +// CHECK:STDOUT: %.loc17_22.4: init @Y.as.A.impl.F.%ptr.loc16_22.1 (%ptr.e8f8f9.1) to %tuple.elem2 = in_place_init %Copy.Op.call // CHECK:STDOUT: %.loc17_22.5: init @Y.as.A.impl.F.%tuple.type.loc16 (%tuple.type.244) to %return.param = tuple_init (%.loc17_22.2, %.loc17_22.3, %.loc17_22.4) // CHECK:STDOUT: %.loc17_23: init @Y.as.A.impl.F.%tuple.type.loc16 (%tuple.type.244) = converted %.loc17_22.1, %.loc17_22.5 // CHECK:STDOUT: return %.loc17_23 to %return.param diff --git a/toolchain/check/testdata/interop/cpp/builtins.llp64.carbon b/toolchain/check/testdata/interop/cpp/builtins.llp64.carbon index 259679ac1b3c..35946a2c0048 100644 --- a/toolchain/check/testdata/interop/cpp/builtins.llp64.carbon +++ b/toolchain/check/testdata/interop/cpp/builtins.llp64.carbon @@ -841,7 +841,7 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc11_48.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc11_48.3: ref %f32.97e = array_index %a.var, %int_0 -// CHECK:STDOUT: %.loc11_48.4: init %f32.97e to %.loc11_48.3 = initialize_from %.loc11_48.2 [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc11_48.4: init %f32.97e to %.loc11_48.3 = in_place_init %.loc11_48.2 [concrete = constants.%float.e3b] // CHECK:STDOUT: %.loc11_48.5: init %array_type to %a.var = array_init (%.loc11_48.4) [concrete = constants.%array] // CHECK:STDOUT: %.loc11_3: init %array_type = converted %.loc11_48.1, %.loc11_48.5 [concrete = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc11_3 @@ -1007,7 +1007,7 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc11_57.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc11_57.3: ref %f32.97e = array_index %a.var, %int_0 -// CHECK:STDOUT: %.loc11_57.4: init %f32.97e to %.loc11_57.3 = initialize_from %.loc11_57.2 [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc11_57.4: init %f32.97e to %.loc11_57.3 = in_place_init %.loc11_57.2 [concrete = constants.%float.e3b] // CHECK:STDOUT: %.loc11_57.5: init %array_type to %a.var = array_init (%.loc11_57.4) [concrete = constants.%array] // CHECK:STDOUT: %.loc11_3: init %array_type = converted %.loc11_57.1, %.loc11_57.5 [concrete = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc11_3 @@ -1217,7 +1217,7 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc16_62.1: ref %LongResult = temporary_storage // CHECK:STDOUT: %addr.loc16: %ptr.305 = addr_of %.loc16_62.1 // CHECK:STDOUT: %PassLong__carbon_thunk.call.loc16: init %empty_tuple.type = call imports.%PassLong__carbon_thunk.decl.d16229.1(%cpp_long.ref.loc16, %addr.loc16) -// CHECK:STDOUT: %.loc16_62.2: init %LongResult to %.loc16_62.1 = in_place_init %PassLong__carbon_thunk.call.loc16 +// CHECK:STDOUT: %.loc16_62.2: init %LongResult to %.loc16_62.1 = mark_in_place_init %PassLong__carbon_thunk.call.loc16 // CHECK:STDOUT: %.loc16_27: type = splice_block %LongResult.ref.loc16 [concrete = constants.%LongResult] { // CHECK:STDOUT: %Cpp.ref.loc16_24: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %LongResult.ref.loc16: type = name_ref LongResult, imports.%LongResult.decl [concrete = constants.%LongResult] @@ -1244,7 +1244,7 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc19_76.1: ref %LongResult = temporary_storage // CHECK:STDOUT: %addr.loc19: %ptr.305 = addr_of %.loc19_76.1 // CHECK:STDOUT: %PassLong__carbon_thunk.call.loc19: init %empty_tuple.type = call imports.%PassLong__carbon_thunk.decl.d16229.1(%cpp_compat_long.ref, %addr.loc19) -// CHECK:STDOUT: %.loc19_76.2: init %LongResult to %.loc19_76.1 = in_place_init %PassLong__carbon_thunk.call.loc19 +// CHECK:STDOUT: %.loc19_76.2: init %LongResult to %.loc19_76.1 = mark_in_place_init %PassLong__carbon_thunk.call.loc19 // CHECK:STDOUT: %.loc19_34: type = splice_block %LongResult.ref.loc19 [concrete = constants.%LongResult] { // CHECK:STDOUT: %Cpp.ref.loc19_31: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %LongResult.ref.loc19: type = name_ref LongResult, imports.%LongResult.decl [concrete = constants.%LongResult] @@ -1274,7 +1274,7 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc22_65.1: ref %IntResult = temporary_storage // CHECK:STDOUT: %addr.loc22: %ptr.3cb = addr_of %.loc22_65.1 // CHECK:STDOUT: %PassLong__carbon_thunk.call.loc22: init %empty_tuple.type = call imports.%PassLong__carbon_thunk.decl.d16229.2(%carbon_i32.ref, %addr.loc22) -// CHECK:STDOUT: %.loc22_65.2: init %IntResult to %.loc22_65.1 = in_place_init %PassLong__carbon_thunk.call.loc22 +// CHECK:STDOUT: %.loc22_65.2: init %IntResult to %.loc22_65.1 = mark_in_place_init %PassLong__carbon_thunk.call.loc22 // CHECK:STDOUT: %.loc22_29: type = splice_block %IntResult.ref [concrete = constants.%IntResult] { // CHECK:STDOUT: %Cpp.ref.loc22_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %IntResult.ref: type = name_ref IntResult, imports.%IntResult.decl [concrete = constants.%IntResult] @@ -1311,7 +1311,7 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc26_43.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc26_43.3: ref %f32.97e = array_index %a.var, %int_0 -// CHECK:STDOUT: %.loc26_43.4: init %f32.97e to %.loc26_43.3 = initialize_from %.loc26_43.2 [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc26_43.4: init %f32.97e to %.loc26_43.3 = in_place_init %.loc26_43.2 [concrete = constants.%float.e3b] // CHECK:STDOUT: %.loc26_43.5: init %array_type to %a.var = array_init (%.loc26_43.4) [concrete = constants.%array] // CHECK:STDOUT: %.loc26_3: init %array_type = converted %.loc26_43.1, %.loc26_43.5 [concrete = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc26_3 @@ -8208,7 +8208,7 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc16_82.1: ref %ULongResult = temporary_storage // CHECK:STDOUT: %addr.loc16: %ptr.f5e = addr_of %.loc16_82.1 // CHECK:STDOUT: %PassULong__carbon_thunk.call.loc16: init %empty_tuple.type = call imports.%PassULong__carbon_thunk.decl.108234.1(%cpp_unsigned_long.ref.loc16, %addr.loc16) -// CHECK:STDOUT: %.loc16_82.2: init %ULongResult to %.loc16_82.1 = in_place_init %PassULong__carbon_thunk.call.loc16 +// CHECK:STDOUT: %.loc16_82.2: init %ULongResult to %.loc16_82.1 = mark_in_place_init %PassULong__carbon_thunk.call.loc16 // CHECK:STDOUT: %.loc16_36: type = splice_block %ULongResult.ref.loc16 [concrete = constants.%ULongResult] { // CHECK:STDOUT: %Cpp.ref.loc16_33: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ULongResult.ref.loc16: type = name_ref ULongResult, imports.%ULongResult.decl [concrete = constants.%ULongResult] @@ -8235,7 +8235,7 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc19_80.1: ref %ULongResult = temporary_storage // CHECK:STDOUT: %addr.loc19: %ptr.f5e = addr_of %.loc19_80.1 // CHECK:STDOUT: %PassULong__carbon_thunk.call.loc19: init %empty_tuple.type = call imports.%PassULong__carbon_thunk.decl.108234.1(%cpp_compat_ulong.ref, %addr.loc19) -// CHECK:STDOUT: %.loc19_80.2: init %ULongResult to %.loc19_80.1 = in_place_init %PassULong__carbon_thunk.call.loc19 +// CHECK:STDOUT: %.loc19_80.2: init %ULongResult to %.loc19_80.1 = mark_in_place_init %PassULong__carbon_thunk.call.loc19 // CHECK:STDOUT: %.loc19_35: type = splice_block %ULongResult.ref.loc19 [concrete = constants.%ULongResult] { // CHECK:STDOUT: %Cpp.ref.loc19_32: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ULongResult.ref.loc19: type = name_ref ULongResult, imports.%ULongResult.decl [concrete = constants.%ULongResult] @@ -8266,7 +8266,7 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc22_67.1: ref %UIntResult = temporary_storage // CHECK:STDOUT: %addr.loc22: %ptr.059 = addr_of %.loc22_67.1 // CHECK:STDOUT: %PassULong__carbon_thunk.call.loc22: init %empty_tuple.type = call imports.%PassULong__carbon_thunk.decl.108234.2(%carbon_u32.ref, %addr.loc22) -// CHECK:STDOUT: %.loc22_67.2: init %UIntResult to %.loc22_67.1 = in_place_init %PassULong__carbon_thunk.call.loc22 +// CHECK:STDOUT: %.loc22_67.2: init %UIntResult to %.loc22_67.1 = mark_in_place_init %PassULong__carbon_thunk.call.loc22 // CHECK:STDOUT: %.loc22_29: type = splice_block %UIntResult.ref [concrete = constants.%UIntResult] { // CHECK:STDOUT: %Cpp.ref.loc22_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %UIntResult.ref: type = name_ref UIntResult, imports.%UIntResult.decl [concrete = constants.%UIntResult] @@ -8289,7 +8289,7 @@ fn CopyUnsignedLong() { // CHECK:STDOUT: %.loc24_52.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc24_52.3: ref %f32.97e = array_index %a.var, %int_0 -// CHECK:STDOUT: %.loc24_52.4: init %f32.97e to %.loc24_52.3 = initialize_from %.loc24_52.2 [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc24_52.4: init %f32.97e to %.loc24_52.3 = in_place_init %.loc24_52.2 [concrete = constants.%float.e3b] // CHECK:STDOUT: %.loc24_52.5: init %array_type to %a.var = array_init (%.loc24_52.4) [concrete = constants.%array] // CHECK:STDOUT: %.loc24_3: init %array_type = converted %.loc24_52.1, %.loc24_52.5 [concrete = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc24_3 diff --git a/toolchain/check/testdata/interop/cpp/builtins.lp64.carbon b/toolchain/check/testdata/interop/cpp/builtins.lp64.carbon index 23f92ee7d21e..14d35caf52e6 100644 --- a/toolchain/check/testdata/interop/cpp/builtins.lp64.carbon +++ b/toolchain/check/testdata/interop/cpp/builtins.lp64.carbon @@ -791,7 +791,7 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.loc11_43.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc11_43.3: ref %f32.97e = array_index %a.var, %int_0 -// CHECK:STDOUT: %.loc11_43.4: init %f32.97e to %.loc11_43.3 = initialize_from %.loc11_43.2 [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc11_43.4: init %f32.97e to %.loc11_43.3 = in_place_init %.loc11_43.2 [concrete = constants.%float.e3b] // CHECK:STDOUT: %.loc11_43.5: init %array_type to %a.var = array_init (%.loc11_43.4) [concrete = constants.%array] // CHECK:STDOUT: %.loc11_3: init %array_type = converted %.loc11_43.1, %.loc11_43.5 [concrete = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc11_3 @@ -957,7 +957,7 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.loc11_52.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc11_52.3: ref %f32.97e = array_index %a.var, %int_0 -// CHECK:STDOUT: %.loc11_52.4: init %f32.97e to %.loc11_52.3 = initialize_from %.loc11_52.2 [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc11_52.4: init %f32.97e to %.loc11_52.3 = in_place_init %.loc11_52.2 [concrete = constants.%float.e3b] // CHECK:STDOUT: %.loc11_52.5: init %array_type to %a.var = array_init (%.loc11_52.4) [concrete = constants.%array] // CHECK:STDOUT: %.loc11_3: init %array_type = converted %.loc11_52.1, %.loc11_52.5 [concrete = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc11_3 @@ -1156,7 +1156,7 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.loc16_80.1: ref %LongLongResult = temporary_storage // CHECK:STDOUT: %addr.loc16: %ptr.a95 = addr_of %.loc16_80.1 // CHECK:STDOUT: %PassLongLong__carbon_thunk.call.loc16: init %empty_tuple.type = call imports.%PassLongLong__carbon_thunk.decl.139b1c.1(%cpp_long_long.ref.loc16, %addr.loc16) -// CHECK:STDOUT: %.loc16_80.2: init %LongLongResult to %.loc16_80.1 = in_place_init %PassLongLong__carbon_thunk.call.loc16 +// CHECK:STDOUT: %.loc16_80.2: init %LongLongResult to %.loc16_80.1 = mark_in_place_init %PassLongLong__carbon_thunk.call.loc16 // CHECK:STDOUT: %.loc16_32: type = splice_block %LongLongResult.ref.loc16 [concrete = constants.%LongLongResult] { // CHECK:STDOUT: %Cpp.ref.loc16_29: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %LongLongResult.ref.loc16: type = name_ref LongLongResult, imports.%LongLongResult.decl [concrete = constants.%LongLongResult] @@ -1183,7 +1183,7 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.loc19_94.1: ref %LongLongResult = temporary_storage // CHECK:STDOUT: %addr.loc19: %ptr.a95 = addr_of %.loc19_94.1 // CHECK:STDOUT: %PassLongLong__carbon_thunk.call.loc19: init %empty_tuple.type = call imports.%PassLongLong__carbon_thunk.decl.139b1c.1(%cpp_compat_long_long.ref, %addr.loc19) -// CHECK:STDOUT: %.loc19_94.2: init %LongLongResult to %.loc19_94.1 = in_place_init %PassLongLong__carbon_thunk.call.loc19 +// CHECK:STDOUT: %.loc19_94.2: init %LongLongResult to %.loc19_94.1 = mark_in_place_init %PassLongLong__carbon_thunk.call.loc19 // CHECK:STDOUT: %.loc19_39: type = splice_block %LongLongResult.ref.loc19 [concrete = constants.%LongLongResult] { // CHECK:STDOUT: %Cpp.ref.loc19_36: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %LongLongResult.ref.loc19: type = name_ref LongLongResult, imports.%LongLongResult.decl [concrete = constants.%LongLongResult] @@ -1213,7 +1213,7 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.loc22_70.1: ref %LongResult = temporary_storage // CHECK:STDOUT: %addr.loc22: %ptr.305 = addr_of %.loc22_70.1 // CHECK:STDOUT: %PassLongLong__carbon_thunk.call.loc22: init %empty_tuple.type = call imports.%PassLongLong__carbon_thunk.decl.139b1c.2(%carbon_i64.ref, %addr.loc22) -// CHECK:STDOUT: %.loc22_70.2: init %LongResult to %.loc22_70.1 = in_place_init %PassLongLong__carbon_thunk.call.loc22 +// CHECK:STDOUT: %.loc22_70.2: init %LongResult to %.loc22_70.1 = mark_in_place_init %PassLongLong__carbon_thunk.call.loc22 // CHECK:STDOUT: %.loc22_29: type = splice_block %LongResult.ref [concrete = constants.%LongResult] { // CHECK:STDOUT: %Cpp.ref.loc22_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %LongResult.ref: type = name_ref LongResult, imports.%LongResult.decl [concrete = constants.%LongResult] @@ -1236,7 +1236,7 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.loc24_48.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc24_48.3: ref %f32.97e = array_index %a.var, %int_0 -// CHECK:STDOUT: %.loc24_48.4: init %f32.97e to %.loc24_48.3 = initialize_from %.loc24_48.2 [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc24_48.4: init %f32.97e to %.loc24_48.3 = in_place_init %.loc24_48.2 [concrete = constants.%float.e3b] // CHECK:STDOUT: %.loc24_48.5: init %array_type to %a.var = array_init (%.loc24_48.4) [concrete = constants.%array] // CHECK:STDOUT: %.loc24_3: init %array_type = converted %.loc24_48.1, %.loc24_48.5 [concrete = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc24_3 @@ -8100,7 +8100,7 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.loc16_100.1: ref %ULongLongResult = temporary_storage // CHECK:STDOUT: %addr.loc16: %ptr.d19 = addr_of %.loc16_100.1 // CHECK:STDOUT: %PassULongLong__carbon_thunk.call.loc16: init %empty_tuple.type = call imports.%PassULongLong__carbon_thunk.decl.f0c073.1(%cpp_unsigned_long_long.ref.loc16, %addr.loc16) -// CHECK:STDOUT: %.loc16_100.2: init %ULongLongResult to %.loc16_100.1 = in_place_init %PassULongLong__carbon_thunk.call.loc16 +// CHECK:STDOUT: %.loc16_100.2: init %ULongLongResult to %.loc16_100.1 = mark_in_place_init %PassULongLong__carbon_thunk.call.loc16 // CHECK:STDOUT: %.loc16_41: type = splice_block %ULongLongResult.ref.loc16 [concrete = constants.%ULongLongResult] { // CHECK:STDOUT: %Cpp.ref.loc16_38: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ULongLongResult.ref.loc16: type = name_ref ULongLongResult, imports.%ULongLongResult.decl [concrete = constants.%ULongLongResult] @@ -8127,7 +8127,7 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.loc19_98.1: ref %ULongLongResult = temporary_storage // CHECK:STDOUT: %addr.loc19: %ptr.d19 = addr_of %.loc19_98.1 // CHECK:STDOUT: %PassULongLong__carbon_thunk.call.loc19: init %empty_tuple.type = call imports.%PassULongLong__carbon_thunk.decl.f0c073.1(%cpp_compat_ulong_long.ref, %addr.loc19) -// CHECK:STDOUT: %.loc19_98.2: init %ULongLongResult to %.loc19_98.1 = in_place_init %PassULongLong__carbon_thunk.call.loc19 +// CHECK:STDOUT: %.loc19_98.2: init %ULongLongResult to %.loc19_98.1 = mark_in_place_init %PassULongLong__carbon_thunk.call.loc19 // CHECK:STDOUT: %.loc19_40: type = splice_block %ULongLongResult.ref.loc19 [concrete = constants.%ULongLongResult] { // CHECK:STDOUT: %Cpp.ref.loc19_37: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ULongLongResult.ref.loc19: type = name_ref ULongLongResult, imports.%ULongLongResult.decl [concrete = constants.%ULongLongResult] @@ -8158,7 +8158,7 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.loc22_72.1: ref %ULongResult = temporary_storage // CHECK:STDOUT: %addr.loc22: %ptr.f5e = addr_of %.loc22_72.1 // CHECK:STDOUT: %PassULongLong__carbon_thunk.call.loc22: init %empty_tuple.type = call imports.%PassULongLong__carbon_thunk.decl.f0c073.2(%carbon_u64.ref, %addr.loc22) -// CHECK:STDOUT: %.loc22_72.2: init %ULongResult to %.loc22_72.1 = in_place_init %PassULongLong__carbon_thunk.call.loc22 +// CHECK:STDOUT: %.loc22_72.2: init %ULongResult to %.loc22_72.1 = mark_in_place_init %PassULongLong__carbon_thunk.call.loc22 // CHECK:STDOUT: %.loc22_29: type = splice_block %ULongResult.ref [concrete = constants.%ULongResult] { // CHECK:STDOUT: %Cpp.ref.loc22_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %ULongResult.ref: type = name_ref ULongResult, imports.%ULongResult.decl [concrete = constants.%ULongResult] @@ -8181,7 +8181,7 @@ fn CopyUnsignedLongLong() { // CHECK:STDOUT: %.loc24_57.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc24_57.3: ref %f32.97e = array_index %a.var, %int_0 -// CHECK:STDOUT: %.loc24_57.4: init %f32.97e to %.loc24_57.3 = initialize_from %.loc24_57.2 [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc24_57.4: init %f32.97e to %.loc24_57.3 = in_place_init %.loc24_57.2 [concrete = constants.%float.e3b] // CHECK:STDOUT: %.loc24_57.5: init %array_type to %a.var = array_init (%.loc24_57.4) [concrete = constants.%array] // CHECK:STDOUT: %.loc24_3: init %array_type = converted %.loc24_57.1, %.loc24_57.5 [concrete = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc24_3 diff --git a/toolchain/check/testdata/interop/cpp/class/access.carbon b/toolchain/check/testdata/interop/cpp/class/access.carbon index d6bfc0980df8..9bcd893feaaa 100644 --- a/toolchain/check/testdata/interop/cpp/class/access.carbon +++ b/toolchain/check/testdata/interop/cpp/class/access.carbon @@ -1998,7 +1998,7 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc8_37.1: ref %PublicCall = temporary_storage // CHECK:STDOUT: %addr.loc8_37: %ptr.dfa = addr_of %.loc8_37.1 // CHECK:STDOUT: %PublicCall__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%PublicCall__carbon_thunk.decl(%addr.loc8_37) -// CHECK:STDOUT: %.loc8_37.2: init %PublicCall to %.loc8_37.1 = in_place_init %PublicCall__carbon_thunk.call.loc8 +// CHECK:STDOUT: %.loc8_37.2: init %PublicCall to %.loc8_37.1 = mark_in_place_init %PublicCall__carbon_thunk.call.loc8 // CHECK:STDOUT: %.loc8_38.1: ref %C = temporary_storage // CHECK:STDOUT: %.loc8_37.3: ref %PublicCall = temporary %.loc8_37.1, %.loc8_37.2 // CHECK:STDOUT: %.loc8_37.4: %PublicCall = acquire_value %.loc8_37.3 @@ -2006,7 +2006,7 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %addr.loc8_38.1: %ptr.dfa = addr_of %.loc8_37.5 // CHECK:STDOUT: %addr.loc8_38.2: %ptr.d9e = addr_of %.loc8_38.1 // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8_38.1, %addr.loc8_38.2) -// CHECK:STDOUT: %.loc8_38.2: init %C to %.loc8_38.1 = in_place_init %C__carbon_thunk.call +// CHECK:STDOUT: %.loc8_38.2: init %C to %.loc8_38.1 = mark_in_place_init %C__carbon_thunk.call // CHECK:STDOUT: %.loc8_38.3: ref %C = temporary %.loc8_38.1, %.loc8_38.2 // CHECK:STDOUT: %Cpp.ref.loc9_3: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc9: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -2017,7 +2017,7 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc9_44.1: ref %PublicCall = temporary_storage // CHECK:STDOUT: %addr.loc9_44: %ptr.dfa = addr_of %.loc9_44.1 // CHECK:STDOUT: %PublicCall__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%PublicCall__carbon_thunk.decl(%addr.loc9_44) -// CHECK:STDOUT: %.loc9_44.2: init %PublicCall to %.loc9_44.1 = in_place_init %PublicCall__carbon_thunk.call.loc9 +// CHECK:STDOUT: %.loc9_44.2: init %PublicCall to %.loc9_44.1 = mark_in_place_init %PublicCall__carbon_thunk.call.loc9 // CHECK:STDOUT: %.loc9_44.3: ref %PublicCall = temporary %.loc9_44.1, %.loc9_44.2 // CHECK:STDOUT: %.loc9_44.4: %PublicCall = acquire_value %.loc9_44.3 // CHECK:STDOUT: %.loc9_44.5: ref %PublicCall = value_as_ref %.loc9_44.4 @@ -2146,7 +2146,7 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc11_49.1: ref %PublicCall = temporary_storage // CHECK:STDOUT: %addr.loc11_49: %ptr.dfa = addr_of %.loc11_49.1 // CHECK:STDOUT: %PublicCall__carbon_thunk.call: init %empty_tuple.type = call imports.%PublicCall__carbon_thunk.decl(%addr.loc11_49) -// CHECK:STDOUT: %.loc11_49.2: init %PublicCall to %.loc11_49.1 = in_place_init %PublicCall__carbon_thunk.call +// CHECK:STDOUT: %.loc11_49.2: init %PublicCall to %.loc11_49.1 = mark_in_place_init %PublicCall__carbon_thunk.call // CHECK:STDOUT: %.loc11_51.1: ref %C = class_element_access %return.param, element0 // CHECK:STDOUT: %.loc11_49.3: ref %PublicCall = temporary %.loc11_49.1, %.loc11_49.2 // CHECK:STDOUT: %.loc11_49.4: %PublicCall = acquire_value %.loc11_49.3 @@ -2154,7 +2154,7 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %addr.loc11_50.1: %ptr.dfa = addr_of %.loc11_49.5 // CHECK:STDOUT: %addr.loc11_50.2: %ptr.d9e = addr_of %.loc11_51.1 // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%addr.loc11_50.1, %addr.loc11_50.2) -// CHECK:STDOUT: %.loc11_50: init %C to %.loc11_51.1 = in_place_init %C__carbon_thunk.call +// CHECK:STDOUT: %.loc11_50: init %C to %.loc11_51.1 = mark_in_place_init %C__carbon_thunk.call // CHECK:STDOUT: %.loc11_51.2: %struct_type.base.7c3 = struct_literal (%.loc11_50) // CHECK:STDOUT: %.loc11_51.3: init %D to %return.param = class_init (%.loc11_50) // CHECK:STDOUT: %.loc11_52: init %D = converted %.loc11_51.2, %.loc11_51.3 @@ -2172,7 +2172,7 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc17_55.1: ref %ProtectedCall = temporary_storage // CHECK:STDOUT: %addr.loc17_55: %ptr.8e6 = addr_of %.loc17_55.1 // CHECK:STDOUT: %ProtectedCall__carbon_thunk.call: init %empty_tuple.type = call imports.%ProtectedCall__carbon_thunk.decl(%addr.loc17_55) -// CHECK:STDOUT: %.loc17_55.2: init %ProtectedCall to %.loc17_55.1 = in_place_init %ProtectedCall__carbon_thunk.call +// CHECK:STDOUT: %.loc17_55.2: init %ProtectedCall to %.loc17_55.1 = mark_in_place_init %ProtectedCall__carbon_thunk.call // CHECK:STDOUT: %.loc17_57.1: ref %C = class_element_access %return.param, element0 // CHECK:STDOUT: %.loc17_55.3: ref %ProtectedCall = temporary %.loc17_55.1, %.loc17_55.2 // CHECK:STDOUT: %.loc17_55.4: %ProtectedCall = acquire_value %.loc17_55.3 @@ -2180,7 +2180,7 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %addr.loc17_56.1: %ptr.8e6 = addr_of %.loc17_55.5 // CHECK:STDOUT: %addr.loc17_56.2: %ptr.d9e = addr_of %.loc17_57.1 // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%addr.loc17_56.1, %addr.loc17_56.2) -// CHECK:STDOUT: %.loc17_56: init %C to %.loc17_57.1 = in_place_init %C__carbon_thunk.call +// CHECK:STDOUT: %.loc17_56: init %C to %.loc17_57.1 = mark_in_place_init %C__carbon_thunk.call // CHECK:STDOUT: %.loc17_57.2: %struct_type.base.7c3 = struct_literal (%.loc17_56) // CHECK:STDOUT: %.loc17_57.3: init %D to %return.param = class_init (%.loc17_56) // CHECK:STDOUT: %.loc17_58: init %D = converted %.loc17_57.2, %.loc17_57.3 @@ -2198,7 +2198,7 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc23_40.1: ref %PublicCall = temporary_storage // CHECK:STDOUT: %addr.loc23_40: %ptr.dfa = addr_of %.loc23_40.1 // CHECK:STDOUT: %PublicCall__carbon_thunk.call: init %empty_tuple.type = call imports.%PublicCall__carbon_thunk.decl(%addr.loc23_40) -// CHECK:STDOUT: %.loc23_40.2: init %PublicCall to %.loc23_40.1 = in_place_init %PublicCall__carbon_thunk.call +// CHECK:STDOUT: %.loc23_40.2: init %PublicCall to %.loc23_40.1 = mark_in_place_init %PublicCall__carbon_thunk.call // CHECK:STDOUT: %.loc23_40.3: ref %PublicCall = temporary %.loc23_40.1, %.loc23_40.2 // CHECK:STDOUT: %.loc23_40.4: %PublicCall = acquire_value %.loc23_40.3 // CHECK:STDOUT: %.loc23_40.5: ref %PublicCall = value_as_ref %.loc23_40.4 @@ -2218,7 +2218,7 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc29_46.1: ref %ProtectedCall = temporary_storage // CHECK:STDOUT: %addr.loc29_46: %ptr.8e6 = addr_of %.loc29_46.1 // CHECK:STDOUT: %ProtectedCall__carbon_thunk.call: init %empty_tuple.type = call imports.%ProtectedCall__carbon_thunk.decl(%addr.loc29_46) -// CHECK:STDOUT: %.loc29_46.2: init %ProtectedCall to %.loc29_46.1 = in_place_init %ProtectedCall__carbon_thunk.call +// CHECK:STDOUT: %.loc29_46.2: init %ProtectedCall to %.loc29_46.1 = mark_in_place_init %ProtectedCall__carbon_thunk.call // CHECK:STDOUT: %.loc29_46.3: ref %ProtectedCall = temporary %.loc29_46.1, %.loc29_46.2 // CHECK:STDOUT: %.loc29_46.4: %ProtectedCall = acquire_value %.loc29_46.3 // CHECK:STDOUT: %.loc29_46.5: ref %ProtectedCall = value_as_ref %.loc29_46.4 @@ -2285,7 +2285,7 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc8_49.1: ref %PublicCall = temporary_storage // CHECK:STDOUT: %addr.loc8_49: %ptr.dfa = addr_of %.loc8_49.1 // CHECK:STDOUT: %PublicCall__carbon_thunk.call: init %empty_tuple.type = call imports.%PublicCall__carbon_thunk.decl(%addr.loc8_49) -// CHECK:STDOUT: %.loc8_49.2: init %PublicCall to %.loc8_49.1 = in_place_init %PublicCall__carbon_thunk.call +// CHECK:STDOUT: %.loc8_49.2: init %PublicCall to %.loc8_49.1 = mark_in_place_init %PublicCall__carbon_thunk.call // CHECK:STDOUT: %.loc8_49.3: ref %PublicCall = temporary %.loc8_49.1, %.loc8_49.2 // CHECK:STDOUT: %.loc8_49.4: %PublicCall = acquire_value %.loc8_49.3 // CHECK:STDOUT: %.loc8_49.5: ref %PublicCall = value_as_ref %.loc8_49.4 @@ -2384,7 +2384,7 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc11_40.1: ref %PublicCall = temporary_storage // CHECK:STDOUT: %addr.loc11_40: %ptr.dfa = addr_of %.loc11_40.1 // CHECK:STDOUT: %PublicCall__carbon_thunk.call: init %empty_tuple.type = call imports.%PublicCall__carbon_thunk.decl(%addr.loc11_40) -// CHECK:STDOUT: %.loc11_40.2: init %PublicCall to %.loc11_40.1 = in_place_init %PublicCall__carbon_thunk.call +// CHECK:STDOUT: %.loc11_40.2: init %PublicCall to %.loc11_40.1 = mark_in_place_init %PublicCall__carbon_thunk.call // CHECK:STDOUT: %.loc11_40.3: ref %PublicCall = temporary %.loc11_40.1, %.loc11_40.2 // CHECK:STDOUT: %.loc11_40.4: %PublicCall = acquire_value %.loc11_40.3 // CHECK:STDOUT: %.loc11_40.5: ref %PublicCall = value_as_ref %.loc11_40.4 @@ -2397,7 +2397,7 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc12_46.1: ref %ProtectedCall = temporary_storage // CHECK:STDOUT: %addr.loc12_46: %ptr.8e6 = addr_of %.loc12_46.1 // CHECK:STDOUT: %ProtectedCall__carbon_thunk.call: init %empty_tuple.type = call imports.%ProtectedCall__carbon_thunk.decl(%addr.loc12_46) -// CHECK:STDOUT: %.loc12_46.2: init %ProtectedCall to %.loc12_46.1 = in_place_init %ProtectedCall__carbon_thunk.call +// CHECK:STDOUT: %.loc12_46.2: init %ProtectedCall to %.loc12_46.1 = mark_in_place_init %ProtectedCall__carbon_thunk.call // CHECK:STDOUT: %.loc12_46.3: ref %ProtectedCall = temporary %.loc12_46.1, %.loc12_46.2 // CHECK:STDOUT: %.loc12_46.4: %ProtectedCall = acquire_value %.loc12_46.3 // CHECK:STDOUT: %.loc12_46.5: ref %ProtectedCall = value_as_ref %.loc12_46.4 @@ -2500,7 +2500,7 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc11_40.1: ref %PublicCall = temporary_storage // CHECK:STDOUT: %addr.loc11_40: %ptr.dfa = addr_of %.loc11_40.1 // CHECK:STDOUT: %PublicCall__carbon_thunk.call: init %empty_tuple.type = call imports.%PublicCall__carbon_thunk.decl(%addr.loc11_40) -// CHECK:STDOUT: %.loc11_40.2: init %PublicCall to %.loc11_40.1 = in_place_init %PublicCall__carbon_thunk.call +// CHECK:STDOUT: %.loc11_40.2: init %PublicCall to %.loc11_40.1 = mark_in_place_init %PublicCall__carbon_thunk.call // CHECK:STDOUT: %.loc11_40.3: ref %PublicCall = temporary %.loc11_40.1, %.loc11_40.2 // CHECK:STDOUT: %.loc11_40.4: %PublicCall = acquire_value %.loc11_40.3 // CHECK:STDOUT: %.loc11_40.5: ref %PublicCall = value_as_ref %.loc11_40.4 @@ -2513,7 +2513,7 @@ fn Call(var instance: Cpp.PublicPrivate) { // CHECK:STDOUT: %.loc12_46.1: ref %ProtectedCall = temporary_storage // CHECK:STDOUT: %addr.loc12_46: %ptr.8e6 = addr_of %.loc12_46.1 // CHECK:STDOUT: %ProtectedCall__carbon_thunk.call: init %empty_tuple.type = call imports.%ProtectedCall__carbon_thunk.decl(%addr.loc12_46) -// CHECK:STDOUT: %.loc12_46.2: init %ProtectedCall to %.loc12_46.1 = in_place_init %ProtectedCall__carbon_thunk.call +// CHECK:STDOUT: %.loc12_46.2: init %ProtectedCall to %.loc12_46.1 = mark_in_place_init %ProtectedCall__carbon_thunk.call // CHECK:STDOUT: %.loc12_46.3: ref %ProtectedCall = temporary %.loc12_46.1, %.loc12_46.2 // CHECK:STDOUT: %.loc12_46.4: %ProtectedCall = acquire_value %.loc12_46.3 // CHECK:STDOUT: %.loc12_46.5: ref %ProtectedCall = value_as_ref %.loc12_46.4 diff --git a/toolchain/check/testdata/interop/cpp/class/constructor.carbon b/toolchain/check/testdata/interop/cpp/class/constructor.carbon index 9cb35a3089d5..06432b379bb4 100644 --- a/toolchain/check/testdata/interop/cpp/class/constructor.carbon +++ b/toolchain/check/testdata/interop/cpp/class/constructor.carbon @@ -295,7 +295,7 @@ fn F() { // CHECK:STDOUT: %.loc8_26.1: ref %C = temporary_storage // CHECK:STDOUT: %addr: %ptr.d9e = addr_of %.loc8_26.1 // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %.loc8_26.2: init %C to %.loc8_26.1 = in_place_init %C__carbon_thunk.call +// CHECK:STDOUT: %.loc8_26.2: init %C to %.loc8_26.1 = mark_in_place_init %C__carbon_thunk.call // CHECK:STDOUT: %.loc8_13: type = splice_block %C.ref.loc8_13 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc8_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc8_13: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -389,7 +389,7 @@ fn F() { // CHECK:STDOUT: %.loc8_31.2: %i32 = converted %int_456, %.loc8_31.1 [concrete = constants.%int_456.d17] // CHECK:STDOUT: %addr: %ptr.d9e = addr_of %.loc8_34.1 // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%.loc8_26.2, %.loc8_31.2, %addr) -// CHECK:STDOUT: %.loc8_34.2: init %C to %.loc8_34.1 = in_place_init %C__carbon_thunk.call +// CHECK:STDOUT: %.loc8_34.2: init %C to %.loc8_34.1 = mark_in_place_init %C__carbon_thunk.call // CHECK:STDOUT: %.loc8_13: type = splice_block %C.ref.loc8_13 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc8_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc8_13: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -474,7 +474,7 @@ fn F() { // CHECK:STDOUT: %.loc8_27.1: ref %C = temporary_storage // CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_27.1 // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%addr.loc8) -// CHECK:STDOUT: %.loc8_27.2: init %C to %.loc8_27.1 = in_place_init %C__carbon_thunk.call.loc8 +// CHECK:STDOUT: %.loc8_27.2: init %C to %.loc8_27.1 = mark_in_place_init %C__carbon_thunk.call.loc8 // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc8_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -507,7 +507,7 @@ fn F() { // CHECK:STDOUT: %.loc9_32.2: %i32 = converted %int_456, %.loc9_32.1 [concrete = constants.%int_456.d17] // CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_35.1 // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc9_27.2, %.loc9_32.2, %addr.loc9) -// CHECK:STDOUT: %.loc9_35.2: init %C to %.loc9_35.1 = in_place_init %C__carbon_thunk.call.loc9 +// CHECK:STDOUT: %.loc9_35.2: init %C to %.loc9_35.1 = mark_in_place_init %C__carbon_thunk.call.loc9 // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc9_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -610,7 +610,7 @@ fn F() { // CHECK:STDOUT: %.loc8_30.2: %i32 = converted %int_9, %.loc8_30.1 [concrete = constants.%int_9.f88] // CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_31.1 // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%.loc8_27.2, %.loc8_30.2, %addr.loc8) -// CHECK:STDOUT: %.loc8_31.2: init %C to %.loc8_31.1 = in_place_init %C__carbon_thunk.call.loc8 +// CHECK:STDOUT: %.loc8_31.2: init %C to %.loc8_31.1 = mark_in_place_init %C__carbon_thunk.call.loc8 // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc8_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -635,7 +635,7 @@ fn F() { // CHECK:STDOUT: %.loc9_27.2: %i32 = converted %int_8.loc9, %.loc9_27.1 [concrete = constants.%int_8.98c] // CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_28.1 // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc9_27.2, %addr.loc9) -// CHECK:STDOUT: %.loc9_28.2: init %C to %.loc9_28.1 = in_place_init %C__carbon_thunk.call.loc9 +// CHECK:STDOUT: %.loc9_28.2: init %C to %.loc9_28.1 = mark_in_place_init %C__carbon_thunk.call.loc9 // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc9_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -749,7 +749,7 @@ fn F() { // CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int_123, %.loc8_27.1 [concrete = constants.%int_123.f7f] // CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_3 // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%.loc8_27.2, %addr.loc8) -// CHECK:STDOUT: %.loc8_30: init %C to %.loc8_3 = in_place_init %C__carbon_thunk.call.loc8 +// CHECK:STDOUT: %.loc8_30: init %C to %.loc8_3 = mark_in_place_init %C__carbon_thunk.call.loc8 // CHECK:STDOUT: assign %c1.var, %.loc8_30 // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc8_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -774,7 +774,7 @@ fn F() { // CHECK:STDOUT: %addr.loc9_31.1: %ptr.bb2 = addr_of %.loc9_27.2 // CHECK:STDOUT: %addr.loc9_31.2: %ptr.d9e = addr_of %.loc9_3 // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%addr.loc9_31.1, %addr.loc9_31.2) -// CHECK:STDOUT: %.loc9_31: init %C to %.loc9_3 = in_place_init %C__carbon_thunk.call.loc9 +// CHECK:STDOUT: %.loc9_31: init %C to %.loc9_3 = mark_in_place_init %C__carbon_thunk.call.loc9 // CHECK:STDOUT: assign %c2.var, %.loc9_31 // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc9_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -794,7 +794,7 @@ fn F() { // CHECK:STDOUT: %.loc10_3: ref %C = splice_block %c3.var {} // CHECK:STDOUT: %addr.loc10_30: %ptr.d9e = addr_of %.loc10_3 // CHECK:STDOUT: %C__carbon_thunk.call.loc10: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.3(%addr.loc10_27, %addr.loc10_30) -// CHECK:STDOUT: %.loc10_30: init %C to %.loc10_3 = in_place_init %C__carbon_thunk.call.loc10 +// CHECK:STDOUT: %.loc10_30: init %C to %.loc10_3 = mark_in_place_init %C__carbon_thunk.call.loc10 // CHECK:STDOUT: assign %c3.var, %.loc10_30 // CHECK:STDOUT: %.loc10_14: type = splice_block %C.ref.loc10_14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc10_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -897,7 +897,7 @@ fn F() { // CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int_8.loc8, %.loc8_27.1 [concrete = constants.%int_8.98c] // CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_28.1 // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%.loc8_27.2, %addr.loc8) -// CHECK:STDOUT: %.loc8_28.2: init %C to %.loc8_28.1 = in_place_init %C__carbon_thunk.call.loc8 +// CHECK:STDOUT: %.loc8_28.2: init %C to %.loc8_28.1 = mark_in_place_init %C__carbon_thunk.call.loc8 // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc8_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -925,7 +925,7 @@ fn F() { // CHECK:STDOUT: %.loc9_21.3: ref %C = temporary_storage // CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_21.3 // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%.loc9_21.2, %addr.loc9) -// CHECK:STDOUT: %.loc9_21.4: init %C to %.loc9_21.3 = in_place_init %C__carbon_thunk.call.loc9 +// CHECK:STDOUT: %.loc9_21.4: init %C to %.loc9_21.3 = mark_in_place_init %C__carbon_thunk.call.loc9 // CHECK:STDOUT: %.loc9_21.5: init %C = converted %.loc9_21.2, %.loc9_21.4 // CHECK:STDOUT: %.loc9_21.6: ref %C = temporary %.loc9_21.3, %.loc9_21.5 // CHECK:STDOUT: %.loc9_21.7: %C = acquire_value %.loc9_21.6 @@ -1039,7 +1039,7 @@ fn F() { // CHECK:STDOUT: %.loc8_30.2: %i32 = converted %int_9, %.loc8_30.1 [concrete = constants.%int_9.f88] // CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_31.1 // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.1(%.loc8_27.2, %.loc8_30.2, %addr.loc8) -// CHECK:STDOUT: %.loc8_31.2: init %C to %.loc8_31.1 = in_place_init %C__carbon_thunk.call.loc8 +// CHECK:STDOUT: %.loc8_31.2: init %C to %.loc8_31.1 = mark_in_place_init %C__carbon_thunk.call.loc8 // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc8_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -1064,7 +1064,7 @@ fn F() { // CHECK:STDOUT: %.loc9_27.2: %i32 = converted %int_8.loc9, %.loc9_27.1 [concrete = constants.%int_8.98c] // CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_28.1 // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc9_27.2, %addr.loc9) -// CHECK:STDOUT: %.loc9_28.2: init %C to %.loc9_28.1 = in_place_init %C__carbon_thunk.call.loc9 +// CHECK:STDOUT: %.loc9_28.2: init %C to %.loc9_28.1 = mark_in_place_init %C__carbon_thunk.call.loc9 // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc9_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -1092,7 +1092,7 @@ fn F() { // CHECK:STDOUT: %.loc10_21.3: ref %C = temporary_storage // CHECK:STDOUT: %addr.loc10: %ptr.d9e = addr_of %.loc10_21.3 // CHECK:STDOUT: %C__carbon_thunk.call.loc10: init %empty_tuple.type = call imports.%C__carbon_thunk.decl.8acdfe.2(%.loc10_21.2, %addr.loc10) -// CHECK:STDOUT: %.loc10_21.4: init %C to %.loc10_21.3 = in_place_init %C__carbon_thunk.call.loc10 +// CHECK:STDOUT: %.loc10_21.4: init %C to %.loc10_21.3 = mark_in_place_init %C__carbon_thunk.call.loc10 // CHECK:STDOUT: %.loc10_21.5: init %C = converted %.loc10_21.2, %.loc10_21.4 // CHECK:STDOUT: %.loc10_21.6: ref %C = temporary %.loc10_21.3, %.loc10_21.5 // CHECK:STDOUT: %.loc10_21.7: %C = acquire_value %.loc10_21.6 diff --git a/toolchain/check/testdata/interop/cpp/class/field.carbon b/toolchain/check/testdata/interop/cpp/class/field.carbon index 32bec46b5eda..f3c055273a61 100644 --- a/toolchain/check/testdata/interop/cpp/class/field.carbon +++ b/toolchain/check/testdata/interop/cpp/class/field.carbon @@ -295,14 +295,14 @@ fn Test(m: Cpp.UnsupportedMembers*) { // CHECK:STDOUT: %bound_method.loc8_12.2: = bound_method %.loc8_12.2, %specific_fn.loc8_12 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc8_12: init %i32 = call %bound_method.loc8_12.2(%.loc8_12.2) // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %return.param, element0 -// CHECK:STDOUT: %.loc8_43.2: init %i32 to %tuple.elem0 = initialize_from %Int.as.Copy.impl.Op.call.loc8_12 +// CHECK:STDOUT: %.loc8_43.2: init %i32 to %tuple.elem0 = in_place_init %Int.as.Copy.impl.Op.call.loc8_12 // CHECK:STDOUT: %impl.elem0.loc8_17: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] // CHECK:STDOUT: %bound_method.loc8_17.1: = bound_method %.loc8_17.2, %impl.elem0.loc8_17 // CHECK:STDOUT: %specific_fn.loc8_17: = specific_function %impl.elem0.loc8_17, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc8_17.2: = bound_method %.loc8_17.2, %specific_fn.loc8_17 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc8_17: init %i32 = call %bound_method.loc8_17.2(%.loc8_17.2) // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access %return.param, element1 -// CHECK:STDOUT: %.loc8_43.3: init %i32 to %tuple.elem1 = initialize_from %Int.as.Copy.impl.Op.call.loc8_17 +// CHECK:STDOUT: %.loc8_43.3: init %i32 to %tuple.elem1 = in_place_init %Int.as.Copy.impl.Op.call.loc8_17 // CHECK:STDOUT: %.loc8_21.2: %i32 = acquire_value %.loc8_21.1 // CHECK:STDOUT: %impl.elem0.loc8_21: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] // CHECK:STDOUT: %bound_method.loc8_21.1: = bound_method %.loc8_21.2, %impl.elem0.loc8_21 @@ -310,7 +310,7 @@ fn Test(m: Cpp.UnsupportedMembers*) { // CHECK:STDOUT: %bound_method.loc8_21.2: = bound_method %.loc8_21.2, %specific_fn.loc8_21 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc8_21: init %i32 = call %bound_method.loc8_21.2(%.loc8_21.2) // CHECK:STDOUT: %tuple.elem2: ref %i32 = tuple_access %return.param, element2 -// CHECK:STDOUT: %.loc8_43.4: init %i32 to %tuple.elem2 = initialize_from %Int.as.Copy.impl.Op.call.loc8_21 +// CHECK:STDOUT: %.loc8_43.4: init %i32 to %tuple.elem2 = in_place_init %Int.as.Copy.impl.Op.call.loc8_21 // CHECK:STDOUT: %.loc8_27.2: %i32 = acquire_value %.loc8_27.1 // CHECK:STDOUT: %impl.elem0.loc8_27: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] // CHECK:STDOUT: %bound_method.loc8_27.1: = bound_method %.loc8_27.2, %impl.elem0.loc8_27 @@ -318,7 +318,7 @@ fn Test(m: Cpp.UnsupportedMembers*) { // CHECK:STDOUT: %bound_method.loc8_27.2: = bound_method %.loc8_27.2, %specific_fn.loc8_27 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc8_27: init %i32 = call %bound_method.loc8_27.2(%.loc8_27.2) // CHECK:STDOUT: %tuple.elem3: ref %i32 = tuple_access %return.param, element3 -// CHECK:STDOUT: %.loc8_43.5: init %i32 to %tuple.elem3 = initialize_from %Int.as.Copy.impl.Op.call.loc8_27 +// CHECK:STDOUT: %.loc8_43.5: init %i32 to %tuple.elem3 = in_place_init %Int.as.Copy.impl.Op.call.loc8_27 // CHECK:STDOUT: %.loc8_39.2: %i32 = acquire_value %.loc8_39.1 // CHECK:STDOUT: %impl.elem0.loc8_39: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] // CHECK:STDOUT: %bound_method.loc8_39.1: = bound_method %.loc8_39.2, %impl.elem0.loc8_39 @@ -326,7 +326,7 @@ fn Test(m: Cpp.UnsupportedMembers*) { // CHECK:STDOUT: %bound_method.loc8_39.2: = bound_method %.loc8_39.2, %specific_fn.loc8_39 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc8_39: init %i32 = call %bound_method.loc8_39.2(%.loc8_39.2) // CHECK:STDOUT: %tuple.elem4: ref %i32 = tuple_access %return.param, element4 -// CHECK:STDOUT: %.loc8_43.6: init %i32 to %tuple.elem4 = initialize_from %Int.as.Copy.impl.Op.call.loc8_39 +// CHECK:STDOUT: %.loc8_43.6: init %i32 to %tuple.elem4 = in_place_init %Int.as.Copy.impl.Op.call.loc8_39 // CHECK:STDOUT: %.loc8_43.7: init %tuple.type.a78 to %return.param = tuple_init (%.loc8_43.2, %.loc8_43.3, %.loc8_43.4, %.loc8_43.5, %.loc8_43.6) // CHECK:STDOUT: %.loc8_44: init %tuple.type.a78 = converted %.loc8_43.1, %.loc8_43.7 // CHECK:STDOUT: return %.loc8_44 to %return.param diff --git a/toolchain/check/testdata/interop/cpp/enum/anonymous.carbon b/toolchain/check/testdata/interop/cpp/enum/anonymous.carbon index 3ad8c5bf04b4..0d068bb60b21 100644 --- a/toolchain/check/testdata/interop/cpp/enum/anonymous.carbon +++ b/toolchain/check/testdata/interop/cpp/enum/anonymous.carbon @@ -117,7 +117,7 @@ fn G() { // CHECK:STDOUT: %.loc10_11.1: ref %C = temporary_storage // CHECK:STDOUT: %addr: %ptr.d9e = addr_of %.loc10_11.1 // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %.loc10_11.2: init %C to %.loc10_11.1 = in_place_init %C__carbon_thunk.call +// CHECK:STDOUT: %.loc10_11.2: init %C to %.loc10_11.1 = mark_in_place_init %C__carbon_thunk.call // CHECK:STDOUT: %.loc10_11.3: ref %C = temporary %.loc10_11.1, %.loc10_11.2 // CHECK:STDOUT: %F.ref.loc10: %C.F.cpp_overload_set.type = name_ref F, imports.%C.F.cpp_overload_set.value [concrete = constants.%C.F.cpp_overload_set.value] // CHECK:STDOUT: %bound_method: = bound_method %.loc10_11.3, %F.ref.loc10 diff --git a/toolchain/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon b/toolchain/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon index 9178e62efbe5..63a2e481af97 100644 --- a/toolchain/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon +++ b/toolchain/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon @@ -2075,6 +2075,8 @@ fn F() { // CHECK:STDOUT: %ptr: type = ptr_type bool [concrete] // CHECK:STDOUT: %foo_bool__carbon_thunk.type: type = fn_type @foo_bool__carbon_thunk [concrete] // CHECK:STDOUT: %foo_bool__carbon_thunk: %foo_bool__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %DestroyOp.type: type = fn_type @DestroyOp [concrete] +// CHECK:STDOUT: %DestroyOp: %DestroyOp.type = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2100,18 +2102,22 @@ fn F() { // CHECK:STDOUT: %.loc8_30.1: ref bool = temporary_storage // CHECK:STDOUT: %addr: %ptr = addr_of %.loc8_30.1 // CHECK:STDOUT: %foo_bool__carbon_thunk.call: init %empty_tuple.type = call imports.%foo_bool__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %.loc8_30.2: init bool = in_place_init %foo_bool__carbon_thunk.call, %.loc8_30.1 +// CHECK:STDOUT: %.loc8_30.2: init bool to %.loc8_30.1 = mark_in_place_init %foo_bool__carbon_thunk.call // CHECK:STDOUT: %.loc8_10.1: type = splice_block %.loc8_10.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool] // CHECK:STDOUT: %.loc8_10.2: type = value_of_initializer %Bool.call [concrete = bool] // CHECK:STDOUT: %.loc8_10.3: type = converted %Bool.call, %.loc8_10.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_30.3: bool = value_of_initializer %.loc8_30.2 -// CHECK:STDOUT: %.loc8_30.4: bool = converted %.loc8_30.2, %.loc8_30.3 +// CHECK:STDOUT: %.loc8_30.3: ref bool = temporary %.loc8_30.1, %.loc8_30.2 +// CHECK:STDOUT: %.loc8_30.4: bool = acquire_value %.loc8_30.3 // CHECK:STDOUT: %x: bool = value_binding x, %.loc8_30.4 +// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc8_30.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc8_30.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @DestroyOp(%self.param: bool) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: --- import_short_return.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -2124,6 +2130,8 @@ fn F() { // CHECK:STDOUT: %ptr: type = ptr_type %i16 [concrete] // CHECK:STDOUT: %foo_short__carbon_thunk.type: type = fn_type @foo_short__carbon_thunk [concrete] // CHECK:STDOUT: %foo_short__carbon_thunk: %foo_short__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %DestroyOp.type: type = fn_type @DestroyOp [concrete] +// CHECK:STDOUT: %DestroyOp: %DestroyOp.type = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2149,17 +2157,21 @@ fn F() { // CHECK:STDOUT: %.loc8_30.1: ref %i16 = temporary_storage // CHECK:STDOUT: %addr: %ptr = addr_of %.loc8_30.1 // CHECK:STDOUT: %foo_short__carbon_thunk.call: init %empty_tuple.type = call imports.%foo_short__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %.loc8_30.2: init %i16 = in_place_init %foo_short__carbon_thunk.call, %.loc8_30.1 +// CHECK:STDOUT: %.loc8_30.2: init %i16 to %.loc8_30.1 = mark_in_place_init %foo_short__carbon_thunk.call // CHECK:STDOUT: %.loc8_10: type = splice_block %i16 [concrete = constants.%i16] { // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_30.3: %i16 = value_of_initializer %.loc8_30.2 -// CHECK:STDOUT: %.loc8_30.4: %i16 = converted %.loc8_30.2, %.loc8_30.3 +// CHECK:STDOUT: %.loc8_30.3: ref %i16 = temporary %.loc8_30.1, %.loc8_30.2 +// CHECK:STDOUT: %.loc8_30.4: %i16 = acquire_value %.loc8_30.3 // CHECK:STDOUT: %x: %i16 = value_binding x, %.loc8_30.4 +// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc8_30.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc8_30.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @DestroyOp(%self.param: %i16) = "no_op"; +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_import_bit_int_24_param.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -2196,6 +2208,8 @@ fn F() { // CHECK:STDOUT: %ptr: type = ptr_type %f64.d77 [concrete] // CHECK:STDOUT: %foo_double__carbon_thunk.type: type = fn_type @foo_double__carbon_thunk [concrete] // CHECK:STDOUT: %foo_double__carbon_thunk: %foo_double__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %DestroyOp.type: type = fn_type @DestroyOp [concrete] +// CHECK:STDOUT: %DestroyOp: %DestroyOp.type = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -2221,14 +2235,18 @@ fn F() { // CHECK:STDOUT: %.loc8_31.1: ref %f64.d77 = temporary_storage // CHECK:STDOUT: %addr: %ptr = addr_of %.loc8_31.1 // CHECK:STDOUT: %foo_double__carbon_thunk.call: init %empty_tuple.type = call imports.%foo_double__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %.loc8_31.2: init %f64.d77 = in_place_init %foo_double__carbon_thunk.call, %.loc8_31.1 +// CHECK:STDOUT: %.loc8_31.2: init %f64.d77 to %.loc8_31.1 = mark_in_place_init %foo_double__carbon_thunk.call // CHECK:STDOUT: %.loc8_10: type = splice_block %f64 [concrete = constants.%f64.d77] { // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] // CHECK:STDOUT: %f64: type = class_type @Float, @Float(constants.%int_64) [concrete = constants.%f64.d77] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc8_31.3: %f64.d77 = value_of_initializer %.loc8_31.2 -// CHECK:STDOUT: %.loc8_31.4: %f64.d77 = converted %.loc8_31.2, %.loc8_31.3 +// CHECK:STDOUT: %.loc8_31.3: ref %f64.d77 = temporary %.loc8_31.1, %.loc8_31.2 +// CHECK:STDOUT: %.loc8_31.4: %f64.d77 = acquire_value %.loc8_31.3 // CHECK:STDOUT: %x: %f64.d77 = value_binding x, %.loc8_31.4 +// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc8_31.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc8_31.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @DestroyOp(%self.param: %f64.d77) = "no_op"; +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/class.carbon b/toolchain/check/testdata/interop/cpp/function/class.carbon index 0f05490a8cb9..8ee5d6516461 100644 --- a/toolchain/check/testdata/interop/cpp/function/class.carbon +++ b/toolchain/check/testdata/interop/cpp/function/class.carbon @@ -1006,7 +1006,7 @@ fn F() { // CHECK:STDOUT: %.loc8_11.1: ref %C = temporary_storage // CHECK:STDOUT: %addr: %ptr.d9e = addr_of %.loc8_11.1 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %.loc8_11.2: init %C to %.loc8_11.1 = in_place_init %foo__carbon_thunk.call +// CHECK:STDOUT: %.loc8_11.2: init %C to %.loc8_11.1 = mark_in_place_init %foo__carbon_thunk.call // CHECK:STDOUT: %.loc8_11.3: ref %C = temporary %.loc8_11.1, %.loc8_11.2 // CHECK:STDOUT: %C.cpp_destructor.bound: = bound_method %.loc8_11.3, constants.%C.cpp_destructor // CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call %C.cpp_destructor.bound(%.loc8_11.3) diff --git a/toolchain/check/testdata/interop/cpp/function/extern_c.carbon b/toolchain/check/testdata/interop/cpp/function/extern_c.carbon index ffb990d9fa60..0e28115fecf2 100644 --- a/toolchain/check/testdata/interop/cpp/function/extern_c.carbon +++ b/toolchain/check/testdata/interop/cpp/function/extern_c.carbon @@ -234,7 +234,7 @@ fn MyF(a: Cpp.X, b: Cpp.X) -> Cpp.X { // CHECK:STDOUT: %addr.loc11_12.2: %ptr.1f9 = addr_of %.loc11_14 // CHECK:STDOUT: %addr.loc11_12.3: %ptr.1f9 = addr_of %.loc9_34.1 // CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc11_12.1, %addr.loc11_12.2, %addr.loc11_12.3) -// CHECK:STDOUT: %.loc11_12: init %X to %.loc9_34.1 = in_place_init %operator_Plus__carbon_thunk.call +// CHECK:STDOUT: %.loc11_12: init %X to %.loc9_34.1 = mark_in_place_init %operator_Plus__carbon_thunk.call // CHECK:STDOUT: return %.loc11_12 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/full_semir.carbon b/toolchain/check/testdata/interop/cpp/function/full_semir.carbon index 951923a73719..837900d8e548 100644 --- a/toolchain/check/testdata/interop/cpp/function/full_semir.carbon +++ b/toolchain/check/testdata/interop/cpp/function/full_semir.carbon @@ -309,11 +309,15 @@ fn F() { // CHECK:STDOUT: %pattern_type.54c: type = pattern_type %ptr [concrete] // CHECK:STDOUT: %foo_short__carbon_thunk.type: type = fn_type @foo_short__carbon_thunk [concrete] // CHECK:STDOUT: %foo_short__carbon_thunk: %foo_short__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %DestroyOp.type: type = fn_type @DestroyOp [concrete] +// CHECK:STDOUT: %DestroyOp: %DestroyOp.type = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .Int = %Core.Int +// CHECK:STDOUT: .Destroy = %Core.Destroy // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/... // CHECK:STDOUT: } @@ -334,6 +338,7 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: %return: %ptr = value_binding r#return, %return.param // CHECK:STDOUT: } +// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -359,14 +364,16 @@ fn F() { // CHECK:STDOUT: %.loc7_30.1: ref %i16 = temporary_storage // CHECK:STDOUT: %addr: %ptr = addr_of %.loc7_30.1 // CHECK:STDOUT: %foo_short__carbon_thunk.call: init %empty_tuple.type = call imports.%foo_short__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %.loc7_30.2: init %i16 = in_place_init %foo_short__carbon_thunk.call, %.loc7_30.1 +// CHECK:STDOUT: %.loc7_30.2: init %i16 to %.loc7_30.1 = mark_in_place_init %foo_short__carbon_thunk.call // CHECK:STDOUT: %.loc7_10: type = splice_block %i16 [concrete = constants.%i16] { // CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] // CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc7_30.3: %i16 = value_of_initializer %.loc7_30.2 -// CHECK:STDOUT: %.loc7_30.4: %i16 = converted %.loc7_30.2, %.loc7_30.3 +// CHECK:STDOUT: %.loc7_30.3: ref %i16 = temporary %.loc7_30.1, %.loc7_30.2 +// CHECK:STDOUT: %.loc7_30.4: %i16 = acquire_value %.loc7_30.3 // CHECK:STDOUT: %x: %i16 = value_binding x, %.loc7_30.4 +// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc7_30.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc7_30.3) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -374,3 +381,5 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: fn @foo_short__carbon_thunk(%return.param: %ptr); // CHECK:STDOUT: +// CHECK:STDOUT: fn @DestroyOp(%self.param: %i16) = "no_op"; +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/inline.carbon b/toolchain/check/testdata/interop/cpp/function/inline.carbon index 043b6de2a36e..8d8f01188836 100644 --- a/toolchain/check/testdata/interop/cpp/function/inline.carbon +++ b/toolchain/check/testdata/interop/cpp/function/inline.carbon @@ -319,13 +319,13 @@ fn MyF() { // CHECK:STDOUT: %.loc15_36.1: ref %i16 = temporary_storage // CHECK:STDOUT: %addr.loc15: %ptr.251 = addr_of %.loc15_36.1 // CHECK:STDOUT: %ThunkOnReturn__carbon_thunk.call: init %empty_tuple.type = call imports.%ThunkOnReturn__carbon_thunk.decl(%.loc15_35.2, %addr.loc15) -// CHECK:STDOUT: %.loc15_36.2: init %i16 = in_place_init %ThunkOnReturn__carbon_thunk.call, %.loc15_36.1 +// CHECK:STDOUT: %.loc15_36.2: init %i16 to %.loc15_36.1 = mark_in_place_init %ThunkOnReturn__carbon_thunk.call // CHECK:STDOUT: %.loc15_11: type = splice_block %i16.loc15 [concrete = constants.%i16] { // CHECK:STDOUT: %int_16.loc15: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] // CHECK:STDOUT: %i16.loc15: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc15_36.3: %i16 = value_of_initializer %.loc15_36.2 -// CHECK:STDOUT: %.loc15_36.4: %i16 = converted %.loc15_36.2, %.loc15_36.3 +// CHECK:STDOUT: %.loc15_36.3: ref %i16 = temporary %.loc15_36.1, %.loc15_36.2 +// CHECK:STDOUT: %.loc15_36.4: %i16 = acquire_value %.loc15_36.3 // CHECK:STDOUT: %r3: %i16 = value_binding r3, %.loc15_36.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %r4.patt: %pattern_type.2f8 = value_binding_pattern r4 [concrete] @@ -351,16 +351,20 @@ fn MyF() { // CHECK:STDOUT: %.loc16_34.1: ref %i16 = temporary_storage // CHECK:STDOUT: %addr.loc16_34.2: %ptr.251 = addr_of %.loc16_34.1 // CHECK:STDOUT: %ThunkOnBoth__carbon_thunk.call: init %empty_tuple.type = call imports.%ThunkOnBoth__carbon_thunk.decl(%addr.loc16_34.1, %addr.loc16_34.2) -// CHECK:STDOUT: %.loc16_34.2: init %i16 = in_place_init %ThunkOnBoth__carbon_thunk.call, %.loc16_34.1 +// CHECK:STDOUT: %.loc16_34.2: init %i16 to %.loc16_34.1 = mark_in_place_init %ThunkOnBoth__carbon_thunk.call // CHECK:STDOUT: %.loc16_11: type = splice_block %i16.loc16 [concrete = constants.%i16] { // CHECK:STDOUT: %int_16.loc16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16] // CHECK:STDOUT: %i16.loc16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc16_34.3: %i16 = value_of_initializer %.loc16_34.2 -// CHECK:STDOUT: %.loc16_34.4: %i16 = converted %.loc16_34.2, %.loc16_34.3 +// CHECK:STDOUT: %.loc16_34.3: ref %i16 = temporary %.loc16_34.1, %.loc16_34.2 +// CHECK:STDOUT: %.loc16_34.4: %i16 = acquire_value %.loc16_34.3 // CHECK:STDOUT: %r4: %i16 = value_binding r4, %.loc16_34.4 -// CHECK:STDOUT: %DestroyOp.bound.loc16: = bound_method %.loc16_33.4, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc16: init %empty_tuple.type = call %DestroyOp.bound.loc16(%.loc16_33.4) +// CHECK:STDOUT: %DestroyOp.bound.loc16_34: = bound_method %.loc16_34.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc16_34: init %empty_tuple.type = call %DestroyOp.bound.loc16_34(%.loc16_34.3) +// CHECK:STDOUT: %DestroyOp.bound.loc16_33: = bound_method %.loc16_33.4, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc16_33: init %empty_tuple.type = call %DestroyOp.bound.loc16_33(%.loc16_33.4) +// CHECK:STDOUT: %DestroyOp.bound.loc15: = bound_method %.loc15_36.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc15: init %empty_tuple.type = call %DestroyOp.bound.loc15(%.loc15_36.3) // CHECK:STDOUT: %DestroyOp.bound.loc14: = bound_method %.loc14_32.4, constants.%DestroyOp // CHECK:STDOUT: %DestroyOp.call.loc14: init %empty_tuple.type = call %DestroyOp.bound.loc14(%.loc14_32.4) // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/operators.carbon b/toolchain/check/testdata/interop/cpp/function/operators.carbon index 5578b64299a0..b9195bf0465b 100644 --- a/toolchain/check/testdata/interop/cpp/function/operators.carbon +++ b/toolchain/check/testdata/interop/cpp/function/operators.carbon @@ -1118,7 +1118,7 @@ fn F() { // CHECK:STDOUT: %.loc8_3: ref %C = splice_block %c.var {} // CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_3 // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8) -// CHECK:STDOUT: %.loc8_26: init %C to %.loc8_3 = in_place_init %C__carbon_thunk.call +// CHECK:STDOUT: %.loc8_26: init %C to %.loc8_3 = mark_in_place_init %C__carbon_thunk.call // CHECK:STDOUT: assign %c.var, %.loc8_26 // CHECK:STDOUT: %.loc8_13: type = splice_block %C.ref.loc8_13 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc8_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -1139,7 +1139,7 @@ fn F() { // CHECK:STDOUT: %addr.loc15_22.1: %ptr.d9e = addr_of %.loc15_23.2 // CHECK:STDOUT: %addr.loc15_22.2: %ptr.d9e = addr_of %.loc15_22.1 // CHECK:STDOUT: %operator_Minus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Minus__carbon_thunk.decl(%addr.loc15_22.1, %addr.loc15_22.2) -// CHECK:STDOUT: %.loc15_22.2: init %C to %.loc15_22.1 = in_place_init %operator_Minus__carbon_thunk.call +// CHECK:STDOUT: %.loc15_22.2: init %C to %.loc15_22.1 = mark_in_place_init %operator_Minus__carbon_thunk.call // CHECK:STDOUT: %.loc15_17: type = splice_block %C.ref.loc15 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc15: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc15: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -1157,7 +1157,7 @@ fn F() { // CHECK:STDOUT: %addr.loc18_27.1: %ptr.d9e = addr_of %.loc18_28.2 // CHECK:STDOUT: %addr.loc18_27.2: %ptr.d9e = addr_of %.loc18_27.1 // CHECK:STDOUT: %operator_Tilde__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Tilde__carbon_thunk.decl(%addr.loc18_27.1, %addr.loc18_27.2) -// CHECK:STDOUT: %.loc18_27.2: init %C to %.loc18_27.1 = in_place_init %operator_Tilde__carbon_thunk.call +// CHECK:STDOUT: %.loc18_27.2: init %C to %.loc18_27.1 = mark_in_place_init %operator_Tilde__carbon_thunk.call // CHECK:STDOUT: %.loc18_22: type = splice_block %C.ref.loc18 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc18: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc18: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -1271,6 +1271,8 @@ fn F() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.c83: = bound_method %int_42.20e, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete] // CHECK:STDOUT: %bound_method.cb9: = bound_method %int_42.20e, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_42.c68: %i32 = int_value 42 [concrete] +// CHECK:STDOUT: %DestroyOp.type.3e79c2.1: type = fn_type @DestroyOp.loc45 [concrete] +// CHECK:STDOUT: %DestroyOp.b0ebf8.1: %DestroyOp.type.3e79c2.1 = struct_value () [concrete] // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete] // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -1444,7 +1446,7 @@ fn F() { // CHECK:STDOUT: %.loc8_3: ref %C = splice_block %c1.var {} // CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_3 // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8) -// CHECK:STDOUT: %.loc8_27: init %C to %.loc8_3 = in_place_init %C__carbon_thunk.call.loc8 +// CHECK:STDOUT: %.loc8_27: init %C to %.loc8_3 = mark_in_place_init %C__carbon_thunk.call.loc8 // CHECK:STDOUT: assign %c1.var, %.loc8_27 // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc8_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -1462,7 +1464,7 @@ fn F() { // CHECK:STDOUT: %.loc9_3: ref %C = splice_block %c2.var {} // CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_3 // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc9) -// CHECK:STDOUT: %.loc9_27: init %C to %.loc9_3 = in_place_init %C__carbon_thunk.call.loc9 +// CHECK:STDOUT: %.loc9_27: init %C to %.loc9_3 = mark_in_place_init %C__carbon_thunk.call.loc9 // CHECK:STDOUT: assign %c2.var, %.loc9_27 // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc9_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -1483,7 +1485,7 @@ fn F() { // CHECK:STDOUT: %addr.loc12_28.2: %ptr.d9e = addr_of %.loc12_30.2 // CHECK:STDOUT: %addr.loc12_28.3: %ptr.d9e = addr_of %.loc12_28.1 // CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc12_28.1, %addr.loc12_28.2, %addr.loc12_28.3) -// CHECK:STDOUT: %.loc12_28.2: init %C to %.loc12_28.1 = in_place_init %operator_Plus__carbon_thunk.call +// CHECK:STDOUT: %.loc12_28.2: init %C to %.loc12_28.1 = mark_in_place_init %operator_Plus__carbon_thunk.call // CHECK:STDOUT: %.loc12_20: type = splice_block %C.ref.loc12 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc12: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc12: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -1505,7 +1507,7 @@ fn F() { // CHECK:STDOUT: %addr.loc13_31.2: %ptr.d9e = addr_of %.loc13_33.2 // CHECK:STDOUT: %addr.loc13_31.3: %ptr.d9e = addr_of %.loc13_31.1 // CHECK:STDOUT: %operator_Minus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Minus__carbon_thunk.decl(%addr.loc13_31.1, %addr.loc13_31.2, %addr.loc13_31.3) -// CHECK:STDOUT: %.loc13_31.2: init %C to %.loc13_31.1 = in_place_init %operator_Minus__carbon_thunk.call +// CHECK:STDOUT: %.loc13_31.2: init %C to %.loc13_31.1 = mark_in_place_init %operator_Minus__carbon_thunk.call // CHECK:STDOUT: %.loc13_23: type = splice_block %C.ref.loc13 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc13: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -1527,7 +1529,7 @@ fn F() { // CHECK:STDOUT: %addr.loc14_34.2: %ptr.d9e = addr_of %.loc14_36.2 // CHECK:STDOUT: %addr.loc14_34.3: %ptr.d9e = addr_of %.loc14_34.1 // CHECK:STDOUT: %operator_Star__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Star__carbon_thunk.decl(%addr.loc14_34.1, %addr.loc14_34.2, %addr.loc14_34.3) -// CHECK:STDOUT: %.loc14_34.2: init %C to %.loc14_34.1 = in_place_init %operator_Star__carbon_thunk.call +// CHECK:STDOUT: %.loc14_34.2: init %C to %.loc14_34.1 = mark_in_place_init %operator_Star__carbon_thunk.call // CHECK:STDOUT: %.loc14_26: type = splice_block %C.ref.loc14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc14: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc14: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -1549,7 +1551,7 @@ fn F() { // CHECK:STDOUT: %addr.loc15_28.2: %ptr.d9e = addr_of %.loc15_30.2 // CHECK:STDOUT: %addr.loc15_28.3: %ptr.d9e = addr_of %.loc15_28.1 // CHECK:STDOUT: %operator_Slash__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Slash__carbon_thunk.decl(%addr.loc15_28.1, %addr.loc15_28.2, %addr.loc15_28.3) -// CHECK:STDOUT: %.loc15_28.2: init %C to %.loc15_28.1 = in_place_init %operator_Slash__carbon_thunk.call +// CHECK:STDOUT: %.loc15_28.2: init %C to %.loc15_28.1 = mark_in_place_init %operator_Slash__carbon_thunk.call // CHECK:STDOUT: %.loc15_20: type = splice_block %C.ref.loc15 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc15: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc15: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -1571,7 +1573,7 @@ fn F() { // CHECK:STDOUT: %addr.loc16_26.2: %ptr.d9e = addr_of %.loc16_28.2 // CHECK:STDOUT: %addr.loc16_26.3: %ptr.d9e = addr_of %.loc16_26.1 // CHECK:STDOUT: %operator_Percent__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Percent__carbon_thunk.decl(%addr.loc16_26.1, %addr.loc16_26.2, %addr.loc16_26.3) -// CHECK:STDOUT: %.loc16_26.2: init %C to %.loc16_26.1 = in_place_init %operator_Percent__carbon_thunk.call +// CHECK:STDOUT: %.loc16_26.2: init %C to %.loc16_26.1 = mark_in_place_init %operator_Percent__carbon_thunk.call // CHECK:STDOUT: %.loc16_18: type = splice_block %C.ref.loc16 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc16: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc16: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -1593,7 +1595,7 @@ fn F() { // CHECK:STDOUT: %addr.loc19_31.2: %ptr.d9e = addr_of %.loc19_33.2 // CHECK:STDOUT: %addr.loc19_31.3: %ptr.d9e = addr_of %.loc19_31.1 // CHECK:STDOUT: %operator_Amp__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Amp__carbon_thunk.decl(%addr.loc19_31.1, %addr.loc19_31.2, %addr.loc19_31.3) -// CHECK:STDOUT: %.loc19_31.2: init %C to %.loc19_31.1 = in_place_init %operator_Amp__carbon_thunk.call +// CHECK:STDOUT: %.loc19_31.2: init %C to %.loc19_31.1 = mark_in_place_init %operator_Amp__carbon_thunk.call // CHECK:STDOUT: %.loc19_23: type = splice_block %C.ref.loc19 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc19: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc19: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -1615,7 +1617,7 @@ fn F() { // CHECK:STDOUT: %addr.loc20_30.2: %ptr.d9e = addr_of %.loc20_32.2 // CHECK:STDOUT: %addr.loc20_30.3: %ptr.d9e = addr_of %.loc20_30.1 // CHECK:STDOUT: %operator_Pipe__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Pipe__carbon_thunk.decl(%addr.loc20_30.1, %addr.loc20_30.2, %addr.loc20_30.3) -// CHECK:STDOUT: %.loc20_30.2: init %C to %.loc20_30.1 = in_place_init %operator_Pipe__carbon_thunk.call +// CHECK:STDOUT: %.loc20_30.2: init %C to %.loc20_30.1 = mark_in_place_init %operator_Pipe__carbon_thunk.call // CHECK:STDOUT: %.loc20_22: type = splice_block %C.ref.loc20 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc20: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc20: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -1637,7 +1639,7 @@ fn F() { // CHECK:STDOUT: %addr.loc21_31.2: %ptr.d9e = addr_of %.loc21_33.2 // CHECK:STDOUT: %addr.loc21_31.3: %ptr.d9e = addr_of %.loc21_31.1 // CHECK:STDOUT: %operator_Caret__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Caret__carbon_thunk.decl(%addr.loc21_31.1, %addr.loc21_31.2, %addr.loc21_31.3) -// CHECK:STDOUT: %.loc21_31.2: init %C to %.loc21_31.1 = in_place_init %operator_Caret__carbon_thunk.call +// CHECK:STDOUT: %.loc21_31.2: init %C to %.loc21_31.1 = mark_in_place_init %operator_Caret__carbon_thunk.call // CHECK:STDOUT: %.loc21_23: type = splice_block %C.ref.loc21 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc21: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc21: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -1663,7 +1665,7 @@ fn F() { // CHECK:STDOUT: %addr.loc22_30.1: %ptr.d9e = addr_of %.loc22_27.2 // CHECK:STDOUT: %addr.loc22_30.2: %ptr.d9e = addr_of %.loc22_30.1 // CHECK:STDOUT: %operator_LessLess__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_LessLess__carbon_thunk.decl(%addr.loc22_30.1, %.loc22_33.2, %addr.loc22_30.2) -// CHECK:STDOUT: %.loc22_30.2: init %C to %.loc22_30.1 = in_place_init %operator_LessLess__carbon_thunk.call +// CHECK:STDOUT: %.loc22_30.2: init %C to %.loc22_30.1 = mark_in_place_init %operator_LessLess__carbon_thunk.call // CHECK:STDOUT: %.loc22_22: type = splice_block %C.ref.loc22 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc22: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -1689,7 +1691,7 @@ fn F() { // CHECK:STDOUT: %addr.loc23_31.1: %ptr.d9e = addr_of %.loc23_28.2 // CHECK:STDOUT: %addr.loc23_31.2: %ptr.d9e = addr_of %.loc23_31.1 // CHECK:STDOUT: %operator_GreaterGreater__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_GreaterGreater__carbon_thunk.decl(%addr.loc23_31.1, %.loc23_34.2, %addr.loc23_31.2) -// CHECK:STDOUT: %.loc23_31.2: init %C to %.loc23_31.1 = in_place_init %operator_GreaterGreater__carbon_thunk.call +// CHECK:STDOUT: %.loc23_31.2: init %C to %.loc23_31.1 = mark_in_place_init %operator_GreaterGreater__carbon_thunk.call // CHECK:STDOUT: %.loc23_23: type = splice_block %C.ref.loc23 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc23: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc23: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -1779,14 +1781,14 @@ fn F() { // CHECK:STDOUT: %.loc40_24.1: ref bool = temporary_storage // CHECK:STDOUT: %addr.loc40_24.3: %ptr.bb2 = addr_of %.loc40_24.1 // CHECK:STDOUT: %operator_EqualEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_EqualEqual__carbon_thunk.decl(%addr.loc40_24.1, %addr.loc40_24.2, %addr.loc40_24.3) -// CHECK:STDOUT: %.loc40_24.2: init bool = in_place_init %operator_EqualEqual__carbon_thunk.call, %.loc40_24.1 +// CHECK:STDOUT: %.loc40_24.2: init bool to %.loc40_24.1 = mark_in_place_init %operator_EqualEqual__carbon_thunk.call // CHECK:STDOUT: %.loc40_14.1: type = splice_block %.loc40_14.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc40: init type = call constants.%Bool() [concrete = bool] // CHECK:STDOUT: %.loc40_14.2: type = value_of_initializer %Bool.call.loc40 [concrete = bool] // CHECK:STDOUT: %.loc40_14.3: type = converted %Bool.call.loc40, %.loc40_14.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc40_24.3: bool = value_of_initializer %.loc40_24.2 -// CHECK:STDOUT: %.loc40_24.4: bool = converted %.loc40_24.2, %.loc40_24.3 +// CHECK:STDOUT: %.loc40_24.3: ref bool = temporary %.loc40_24.1, %.loc40_24.2 +// CHECK:STDOUT: %.loc40_24.4: bool = acquire_value %.loc40_24.3 // CHECK:STDOUT: %equal: bool = value_binding equal, %.loc40_24.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %not_equal.patt: %pattern_type.831 = value_binding_pattern not_equal [concrete] @@ -1802,14 +1804,14 @@ fn F() { // CHECK:STDOUT: %.loc41_28.1: ref bool = temporary_storage // CHECK:STDOUT: %addr.loc41_28.3: %ptr.bb2 = addr_of %.loc41_28.1 // CHECK:STDOUT: %operator_ExclaimEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_ExclaimEqual__carbon_thunk.decl(%addr.loc41_28.1, %addr.loc41_28.2, %addr.loc41_28.3) -// CHECK:STDOUT: %.loc41_28.2: init bool = in_place_init %operator_ExclaimEqual__carbon_thunk.call, %.loc41_28.1 +// CHECK:STDOUT: %.loc41_28.2: init bool to %.loc41_28.1 = mark_in_place_init %operator_ExclaimEqual__carbon_thunk.call // CHECK:STDOUT: %.loc41_18.1: type = splice_block %.loc41_18.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc41: init type = call constants.%Bool() [concrete = bool] // CHECK:STDOUT: %.loc41_18.2: type = value_of_initializer %Bool.call.loc41 [concrete = bool] // CHECK:STDOUT: %.loc41_18.3: type = converted %Bool.call.loc41, %.loc41_18.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc41_28.3: bool = value_of_initializer %.loc41_28.2 -// CHECK:STDOUT: %.loc41_28.4: bool = converted %.loc41_28.2, %.loc41_28.3 +// CHECK:STDOUT: %.loc41_28.3: ref bool = temporary %.loc41_28.1, %.loc41_28.2 +// CHECK:STDOUT: %.loc41_28.4: bool = acquire_value %.loc41_28.3 // CHECK:STDOUT: %not_equal: bool = value_binding not_equal, %.loc41_28.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %greater_than.patt: %pattern_type.831 = value_binding_pattern greater_than [concrete] @@ -1825,14 +1827,14 @@ fn F() { // CHECK:STDOUT: %.loc42_31.1: ref bool = temporary_storage // CHECK:STDOUT: %addr.loc42_31.3: %ptr.bb2 = addr_of %.loc42_31.1 // CHECK:STDOUT: %operator_Greater__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Greater__carbon_thunk.decl(%addr.loc42_31.1, %addr.loc42_31.2, %addr.loc42_31.3) -// CHECK:STDOUT: %.loc42_31.2: init bool = in_place_init %operator_Greater__carbon_thunk.call, %.loc42_31.1 +// CHECK:STDOUT: %.loc42_31.2: init bool to %.loc42_31.1 = mark_in_place_init %operator_Greater__carbon_thunk.call // CHECK:STDOUT: %.loc42_21.1: type = splice_block %.loc42_21.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc42: init type = call constants.%Bool() [concrete = bool] // CHECK:STDOUT: %.loc42_21.2: type = value_of_initializer %Bool.call.loc42 [concrete = bool] // CHECK:STDOUT: %.loc42_21.3: type = converted %Bool.call.loc42, %.loc42_21.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc42_31.3: bool = value_of_initializer %.loc42_31.2 -// CHECK:STDOUT: %.loc42_31.4: bool = converted %.loc42_31.2, %.loc42_31.3 +// CHECK:STDOUT: %.loc42_31.3: ref bool = temporary %.loc42_31.1, %.loc42_31.2 +// CHECK:STDOUT: %.loc42_31.4: bool = acquire_value %.loc42_31.3 // CHECK:STDOUT: %greater_than: bool = value_binding greater_than, %.loc42_31.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %less_than.patt: %pattern_type.831 = value_binding_pattern less_than [concrete] @@ -1848,14 +1850,14 @@ fn F() { // CHECK:STDOUT: %.loc43_28.1: ref bool = temporary_storage // CHECK:STDOUT: %addr.loc43_28.3: %ptr.bb2 = addr_of %.loc43_28.1 // CHECK:STDOUT: %operator_Less__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Less__carbon_thunk.decl(%addr.loc43_28.1, %addr.loc43_28.2, %addr.loc43_28.3) -// CHECK:STDOUT: %.loc43_28.2: init bool = in_place_init %operator_Less__carbon_thunk.call, %.loc43_28.1 +// CHECK:STDOUT: %.loc43_28.2: init bool to %.loc43_28.1 = mark_in_place_init %operator_Less__carbon_thunk.call // CHECK:STDOUT: %.loc43_18.1: type = splice_block %.loc43_18.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc43: init type = call constants.%Bool() [concrete = bool] // CHECK:STDOUT: %.loc43_18.2: type = value_of_initializer %Bool.call.loc43 [concrete = bool] // CHECK:STDOUT: %.loc43_18.3: type = converted %Bool.call.loc43, %.loc43_18.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc43_28.3: bool = value_of_initializer %.loc43_28.2 -// CHECK:STDOUT: %.loc43_28.4: bool = converted %.loc43_28.2, %.loc43_28.3 +// CHECK:STDOUT: %.loc43_28.3: ref bool = temporary %.loc43_28.1, %.loc43_28.2 +// CHECK:STDOUT: %.loc43_28.4: bool = acquire_value %.loc43_28.3 // CHECK:STDOUT: %less_than: bool = value_binding less_than, %.loc43_28.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %greater_than_or_equal.patt: %pattern_type.831 = value_binding_pattern greater_than_or_equal [concrete] @@ -1871,14 +1873,14 @@ fn F() { // CHECK:STDOUT: %.loc44_40.1: ref bool = temporary_storage // CHECK:STDOUT: %addr.loc44_40.3: %ptr.bb2 = addr_of %.loc44_40.1 // CHECK:STDOUT: %operator_GreaterEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_GreaterEqual__carbon_thunk.decl(%addr.loc44_40.1, %addr.loc44_40.2, %addr.loc44_40.3) -// CHECK:STDOUT: %.loc44_40.2: init bool = in_place_init %operator_GreaterEqual__carbon_thunk.call, %.loc44_40.1 +// CHECK:STDOUT: %.loc44_40.2: init bool to %.loc44_40.1 = mark_in_place_init %operator_GreaterEqual__carbon_thunk.call // CHECK:STDOUT: %.loc44_30.1: type = splice_block %.loc44_30.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc44: init type = call constants.%Bool() [concrete = bool] // CHECK:STDOUT: %.loc44_30.2: type = value_of_initializer %Bool.call.loc44 [concrete = bool] // CHECK:STDOUT: %.loc44_30.3: type = converted %Bool.call.loc44, %.loc44_30.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc44_40.3: bool = value_of_initializer %.loc44_40.2 -// CHECK:STDOUT: %.loc44_40.4: bool = converted %.loc44_40.2, %.loc44_40.3 +// CHECK:STDOUT: %.loc44_40.3: ref bool = temporary %.loc44_40.1, %.loc44_40.2 +// CHECK:STDOUT: %.loc44_40.4: bool = acquire_value %.loc44_40.3 // CHECK:STDOUT: %greater_than_or_equal: bool = value_binding greater_than_or_equal, %.loc44_40.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %less_than_or_equal.patt: %pattern_type.831 = value_binding_pattern less_than_or_equal [concrete] @@ -1894,14 +1896,14 @@ fn F() { // CHECK:STDOUT: %.loc45_37.1: ref bool = temporary_storage // CHECK:STDOUT: %addr.loc45_37.3: %ptr.bb2 = addr_of %.loc45_37.1 // CHECK:STDOUT: %operator_LessEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_LessEqual__carbon_thunk.decl(%addr.loc45_37.1, %addr.loc45_37.2, %addr.loc45_37.3) -// CHECK:STDOUT: %.loc45_37.2: init bool = in_place_init %operator_LessEqual__carbon_thunk.call, %.loc45_37.1 +// CHECK:STDOUT: %.loc45_37.2: init bool to %.loc45_37.1 = mark_in_place_init %operator_LessEqual__carbon_thunk.call // CHECK:STDOUT: %.loc45_27.1: type = splice_block %.loc45_27.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc45: init type = call constants.%Bool() [concrete = bool] // CHECK:STDOUT: %.loc45_27.2: type = value_of_initializer %Bool.call.loc45 [concrete = bool] // CHECK:STDOUT: %.loc45_27.3: type = converted %Bool.call.loc45, %.loc45_27.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc45_37.3: bool = value_of_initializer %.loc45_37.2 -// CHECK:STDOUT: %.loc45_37.4: bool = converted %.loc45_37.2, %.loc45_37.3 +// CHECK:STDOUT: %.loc45_37.3: ref bool = temporary %.loc45_37.1, %.loc45_37.2 +// CHECK:STDOUT: %.loc45_37.4: bool = acquire_value %.loc45_37.3 // CHECK:STDOUT: %less_than_or_equal: bool = value_binding less_than_or_equal, %.loc45_37.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %index.patt: %pattern_type.7ce = value_binding_pattern index [concrete] @@ -1924,6 +1926,18 @@ fn F() { // CHECK:STDOUT: %.loc48_25.1: %i32 = value_of_initializer %C.cpp_operator.call // CHECK:STDOUT: %.loc48_25.2: %i32 = converted %C.cpp_operator.call, %.loc48_25.1 // CHECK:STDOUT: %index: %i32 = value_binding index, %.loc48_25.2 +// CHECK:STDOUT: %DestroyOp.bound.loc45: = bound_method %.loc45_37.3, constants.%DestroyOp.b0ebf8.1 +// CHECK:STDOUT: %DestroyOp.call.loc45: init %empty_tuple.type = call %DestroyOp.bound.loc45(%.loc45_37.3) +// CHECK:STDOUT: %DestroyOp.bound.loc44: = bound_method %.loc44_40.3, constants.%DestroyOp.b0ebf8.1 +// CHECK:STDOUT: %DestroyOp.call.loc44: init %empty_tuple.type = call %DestroyOp.bound.loc44(%.loc44_40.3) +// CHECK:STDOUT: %DestroyOp.bound.loc43: = bound_method %.loc43_28.3, constants.%DestroyOp.b0ebf8.1 +// CHECK:STDOUT: %DestroyOp.call.loc43: init %empty_tuple.type = call %DestroyOp.bound.loc43(%.loc43_28.3) +// CHECK:STDOUT: %DestroyOp.bound.loc42: = bound_method %.loc42_31.3, constants.%DestroyOp.b0ebf8.1 +// CHECK:STDOUT: %DestroyOp.call.loc42: init %empty_tuple.type = call %DestroyOp.bound.loc42(%.loc42_31.3) +// CHECK:STDOUT: %DestroyOp.bound.loc41: = bound_method %.loc41_28.3, constants.%DestroyOp.b0ebf8.1 +// CHECK:STDOUT: %DestroyOp.call.loc41: init %empty_tuple.type = call %DestroyOp.bound.loc41(%.loc41_28.3) +// CHECK:STDOUT: %DestroyOp.bound.loc40: = bound_method %.loc40_24.3, constants.%DestroyOp.b0ebf8.1 +// CHECK:STDOUT: %DestroyOp.call.loc40: init %empty_tuple.type = call %DestroyOp.bound.loc40(%.loc40_24.3) // CHECK:STDOUT: %C.cpp_destructor.bound.loc23: = bound_method %.loc23_31.3, constants.%C.cpp_destructor // CHECK:STDOUT: %C.cpp_destructor.call.loc23: init %empty_tuple.type = call %C.cpp_destructor.bound.loc23(%.loc23_31.3) // CHECK:STDOUT: %C.cpp_destructor.bound.loc22: = bound_method %.loc22_30.3, constants.%C.cpp_destructor @@ -1951,7 +1965,9 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @DestroyOp(%self.param: %C) = "no_op"; +// CHECK:STDOUT: fn @DestroyOp.loc45(%self.param: bool) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @DestroyOp.loc23(%self.param: %C) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: --- multiple_calls.carbon // CHECK:STDOUT: @@ -2000,7 +2016,7 @@ fn F() { // CHECK:STDOUT: %.loc8_27.1: ref %C = temporary_storage // CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_27.1 // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8) -// CHECK:STDOUT: %.loc8_27.2: init %C to %.loc8_27.1 = in_place_init %C__carbon_thunk.call.loc8 +// CHECK:STDOUT: %.loc8_27.2: init %C to %.loc8_27.1 = mark_in_place_init %C__carbon_thunk.call.loc8 // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc8_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc8_14: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -2017,7 +2033,7 @@ fn F() { // CHECK:STDOUT: %.loc9_27.1: ref %C = temporary_storage // CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_27.1 // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc9) -// CHECK:STDOUT: %.loc9_27.2: init %C to %.loc9_27.1 = in_place_init %C__carbon_thunk.call.loc9 +// CHECK:STDOUT: %.loc9_27.2: init %C to %.loc9_27.1 = mark_in_place_init %C__carbon_thunk.call.loc9 // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9_14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc9_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc9_14: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -2037,7 +2053,7 @@ fn F() { // CHECK:STDOUT: %addr.loc10_22.2: %ptr.d9e = addr_of %.loc10_24 // CHECK:STDOUT: %addr.loc10_22.3: %ptr.d9e = addr_of %.loc10_22.1 // CHECK:STDOUT: %operator_Plus__carbon_thunk.call.loc10: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc10_22.1, %addr.loc10_22.2, %addr.loc10_22.3) -// CHECK:STDOUT: %.loc10_22.2: init %C to %.loc10_22.1 = in_place_init %operator_Plus__carbon_thunk.call.loc10 +// CHECK:STDOUT: %.loc10_22.2: init %C to %.loc10_22.1 = mark_in_place_init %operator_Plus__carbon_thunk.call.loc10 // CHECK:STDOUT: %.loc10_14: type = splice_block %C.ref.loc10 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -2057,7 +2073,7 @@ fn F() { // CHECK:STDOUT: %addr.loc11_22.2: %ptr.d9e = addr_of %.loc11_24 // CHECK:STDOUT: %addr.loc11_22.3: %ptr.d9e = addr_of %.loc11_22.1 // CHECK:STDOUT: %operator_Plus__carbon_thunk.call.loc11: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc11_22.1, %addr.loc11_22.2, %addr.loc11_22.3) -// CHECK:STDOUT: %.loc11_22.2: init %C to %.loc11_22.1 = in_place_init %operator_Plus__carbon_thunk.call.loc11 +// CHECK:STDOUT: %.loc11_22.2: init %C to %.loc11_22.1 = mark_in_place_init %operator_Plus__carbon_thunk.call.loc11 // CHECK:STDOUT: %.loc11_14: type = splice_block %C.ref.loc11 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc11: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -2077,7 +2093,7 @@ fn F() { // CHECK:STDOUT: %addr.loc12_22.2: %ptr.d9e = addr_of %.loc12_24 // CHECK:STDOUT: %addr.loc12_22.3: %ptr.d9e = addr_of %.loc12_22.1 // CHECK:STDOUT: %operator_Plus__carbon_thunk.call.loc12: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc12_22.1, %addr.loc12_22.2, %addr.loc12_22.3) -// CHECK:STDOUT: %.loc12_22.2: init %C to %.loc12_22.1 = in_place_init %operator_Plus__carbon_thunk.call.loc12 +// CHECK:STDOUT: %.loc12_22.2: init %C to %.loc12_22.1 = mark_in_place_init %operator_Plus__carbon_thunk.call.loc12 // CHECK:STDOUT: %.loc12_14: type = splice_block %C.ref.loc12 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc12: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc12: type = name_ref C, imports.%C.decl [concrete = constants.%C] @@ -2119,6 +2135,8 @@ fn F() { // CHECK:STDOUT: %operator_Greater__carbon_thunk: %operator_Greater__carbon_thunk.type = struct_value () [concrete] // CHECK:STDOUT: %operator_LessEqual__carbon_thunk.type: type = fn_type @operator_LessEqual__carbon_thunk [concrete] // CHECK:STDOUT: %operator_LessEqual__carbon_thunk: %operator_LessEqual__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %DestroyOp.type.3e79c2.1: type = fn_type @DestroyOp.loc36 [concrete] +// CHECK:STDOUT: %DestroyOp.b0ebf8.1: %DestroyOp.type.3e79c2.1 = struct_value () [concrete] // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete] // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -2160,7 +2178,7 @@ fn F() { // CHECK:STDOUT: %.loc15_3: ref %C = splice_block %c1.var {} // CHECK:STDOUT: %addr.loc15: %ptr.d9e = addr_of %.loc15_3 // CHECK:STDOUT: %C__carbon_thunk.call.loc15: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc15) -// CHECK:STDOUT: %.loc15_27: init %C to %.loc15_3 = in_place_init %C__carbon_thunk.call.loc15 +// CHECK:STDOUT: %.loc15_27: init %C to %.loc15_3 = mark_in_place_init %C__carbon_thunk.call.loc15 // CHECK:STDOUT: assign %c1.var, %.loc15_27 // CHECK:STDOUT: %.loc15_14: type = splice_block %C.ref.loc15_14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc15_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -2178,7 +2196,7 @@ fn F() { // CHECK:STDOUT: %.loc16_3: ref %C = splice_block %c2.var {} // CHECK:STDOUT: %addr.loc16: %ptr.d9e = addr_of %.loc16_3 // CHECK:STDOUT: %C__carbon_thunk.call.loc16: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc16) -// CHECK:STDOUT: %.loc16_27: init %C to %.loc16_3 = in_place_init %C__carbon_thunk.call.loc16 +// CHECK:STDOUT: %.loc16_27: init %C to %.loc16_3 = mark_in_place_init %C__carbon_thunk.call.loc16 // CHECK:STDOUT: assign %c2.var, %.loc16_27 // CHECK:STDOUT: %.loc16_14: type = splice_block %C.ref.loc16_14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc16_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -2199,14 +2217,14 @@ fn F() { // CHECK:STDOUT: %.loc19_31.1: ref bool = temporary_storage // CHECK:STDOUT: %addr.loc19_31.3: %ptr.bb2 = addr_of %.loc19_31.1 // CHECK:STDOUT: %operator_Greater__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Greater__carbon_thunk.decl(%addr.loc19_31.1, %addr.loc19_31.2, %addr.loc19_31.3) -// CHECK:STDOUT: %.loc19_31.2: init bool = in_place_init %operator_Greater__carbon_thunk.call, %.loc19_31.1 +// CHECK:STDOUT: %.loc19_31.2: init bool to %.loc19_31.1 = mark_in_place_init %operator_Greater__carbon_thunk.call // CHECK:STDOUT: %.loc19_21.1: type = splice_block %.loc19_21.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc19: init type = call constants.%Bool() [concrete = bool] // CHECK:STDOUT: %.loc19_21.2: type = value_of_initializer %Bool.call.loc19 [concrete = bool] // CHECK:STDOUT: %.loc19_21.3: type = converted %Bool.call.loc19, %.loc19_21.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc19_31.3: bool = value_of_initializer %.loc19_31.2 -// CHECK:STDOUT: %.loc19_31.4: bool = converted %.loc19_31.2, %.loc19_31.3 +// CHECK:STDOUT: %.loc19_31.3: ref bool = temporary %.loc19_31.1, %.loc19_31.2 +// CHECK:STDOUT: %.loc19_31.4: bool = acquire_value %.loc19_31.3 // CHECK:STDOUT: %greater_than: bool = value_binding greater_than, %.loc19_31.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %less_than.patt: %pattern_type.831 = value_binding_pattern less_than [concrete] @@ -2244,15 +2262,19 @@ fn F() { // CHECK:STDOUT: %.loc36_37.1: ref bool = temporary_storage // CHECK:STDOUT: %addr.loc36_37.3: %ptr.bb2 = addr_of %.loc36_37.1 // CHECK:STDOUT: %operator_LessEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_LessEqual__carbon_thunk.decl(%addr.loc36_37.1, %addr.loc36_37.2, %addr.loc36_37.3) -// CHECK:STDOUT: %.loc36_37.2: init bool = in_place_init %operator_LessEqual__carbon_thunk.call, %.loc36_37.1 +// CHECK:STDOUT: %.loc36_37.2: init bool to %.loc36_37.1 = mark_in_place_init %operator_LessEqual__carbon_thunk.call // CHECK:STDOUT: %.loc36_27.1: type = splice_block %.loc36_27.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc36: init type = call constants.%Bool() [concrete = bool] // CHECK:STDOUT: %.loc36_27.2: type = value_of_initializer %Bool.call.loc36 [concrete = bool] // CHECK:STDOUT: %.loc36_27.3: type = converted %Bool.call.loc36, %.loc36_27.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc36_37.3: bool = value_of_initializer %.loc36_37.2 -// CHECK:STDOUT: %.loc36_37.4: bool = converted %.loc36_37.2, %.loc36_37.3 +// CHECK:STDOUT: %.loc36_37.3: ref bool = temporary %.loc36_37.1, %.loc36_37.2 +// CHECK:STDOUT: %.loc36_37.4: bool = acquire_value %.loc36_37.3 // CHECK:STDOUT: %less_than_or_equal: bool = value_binding less_than_or_equal, %.loc36_37.4 +// CHECK:STDOUT: %DestroyOp.bound.loc36: = bound_method %.loc36_37.3, constants.%DestroyOp.b0ebf8.1 +// CHECK:STDOUT: %DestroyOp.call.loc36: init %empty_tuple.type = call %DestroyOp.bound.loc36(%.loc36_37.3) +// CHECK:STDOUT: %DestroyOp.bound.loc19: = bound_method %.loc19_31.3, constants.%DestroyOp.b0ebf8.1 +// CHECK:STDOUT: %DestroyOp.call.loc19: init %empty_tuple.type = call %DestroyOp.bound.loc19(%.loc19_31.3) // CHECK:STDOUT: %C.cpp_destructor.bound.loc16: = bound_method %c2.var, constants.%C.cpp_destructor // CHECK:STDOUT: %C.cpp_destructor.call.loc16: init %empty_tuple.type = call %C.cpp_destructor.bound.loc16(%c2.var) // CHECK:STDOUT: %C.cpp_destructor.bound.loc15: = bound_method %c1.var, constants.%C.cpp_destructor @@ -2260,7 +2282,9 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @DestroyOp(%self.param: %C) = "no_op"; +// CHECK:STDOUT: fn @DestroyOp.loc36(%self.param: bool) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @DestroyOp.loc16(%self.param: %C) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_rewrite_equal.carbon // CHECK:STDOUT: @@ -2279,6 +2303,8 @@ fn F() { // CHECK:STDOUT: %ptr.bb2: type = ptr_type bool [concrete] // CHECK:STDOUT: %operator_EqualEqual__carbon_thunk.type: type = fn_type @operator_EqualEqual__carbon_thunk [concrete] // CHECK:STDOUT: %operator_EqualEqual__carbon_thunk: %operator_EqualEqual__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %DestroyOp.type.3e79c2.1: type = fn_type @DestroyOp.loc16 [concrete] +// CHECK:STDOUT: %DestroyOp.b0ebf8.1: %DestroyOp.type.3e79c2.1 = struct_value () [concrete] // CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete] // CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete] // CHECK:STDOUT: } @@ -2315,7 +2341,7 @@ fn F() { // CHECK:STDOUT: %.loc12_3: ref %C = splice_block %c1.var {} // CHECK:STDOUT: %addr.loc12: %ptr.d9e = addr_of %.loc12_3 // CHECK:STDOUT: %C__carbon_thunk.call.loc12: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc12) -// CHECK:STDOUT: %.loc12_27: init %C to %.loc12_3 = in_place_init %C__carbon_thunk.call.loc12 +// CHECK:STDOUT: %.loc12_27: init %C to %.loc12_3 = mark_in_place_init %C__carbon_thunk.call.loc12 // CHECK:STDOUT: assign %c1.var, %.loc12_27 // CHECK:STDOUT: %.loc12_14: type = splice_block %C.ref.loc12_14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc12_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -2333,7 +2359,7 @@ fn F() { // CHECK:STDOUT: %.loc13_3: ref %C = splice_block %c2.var {} // CHECK:STDOUT: %addr.loc13: %ptr.d9e = addr_of %.loc13_3 // CHECK:STDOUT: %C__carbon_thunk.call.loc13: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc13) -// CHECK:STDOUT: %.loc13_27: init %C to %.loc13_3 = in_place_init %C__carbon_thunk.call.loc13 +// CHECK:STDOUT: %.loc13_27: init %C to %.loc13_3 = mark_in_place_init %C__carbon_thunk.call.loc13 // CHECK:STDOUT: assign %c2.var, %.loc13_27 // CHECK:STDOUT: %.loc13_14: type = splice_block %C.ref.loc13_14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc13_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -2354,14 +2380,14 @@ fn F() { // CHECK:STDOUT: %.loc16_24.1: ref bool = temporary_storage // CHECK:STDOUT: %addr.loc16_24.3: %ptr.bb2 = addr_of %.loc16_24.1 // CHECK:STDOUT: %operator_EqualEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_EqualEqual__carbon_thunk.decl(%addr.loc16_24.1, %addr.loc16_24.2, %addr.loc16_24.3) -// CHECK:STDOUT: %.loc16_24.2: init bool = in_place_init %operator_EqualEqual__carbon_thunk.call, %.loc16_24.1 +// CHECK:STDOUT: %.loc16_24.2: init bool to %.loc16_24.1 = mark_in_place_init %operator_EqualEqual__carbon_thunk.call // CHECK:STDOUT: %.loc16_14.1: type = splice_block %.loc16_14.3 [concrete = bool] { // CHECK:STDOUT: %Bool.call.loc16: init type = call constants.%Bool() [concrete = bool] // CHECK:STDOUT: %.loc16_14.2: type = value_of_initializer %Bool.call.loc16 [concrete = bool] // CHECK:STDOUT: %.loc16_14.3: type = converted %Bool.call.loc16, %.loc16_14.2 [concrete = bool] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc16_24.3: bool = value_of_initializer %.loc16_24.2 -// CHECK:STDOUT: %.loc16_24.4: bool = converted %.loc16_24.2, %.loc16_24.3 +// CHECK:STDOUT: %.loc16_24.3: ref bool = temporary %.loc16_24.1, %.loc16_24.2 +// CHECK:STDOUT: %.loc16_24.4: bool = acquire_value %.loc16_24.3 // CHECK:STDOUT: %equal: bool = value_binding equal, %.loc16_24.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %not_equal.patt: %pattern_type.831 = value_binding_pattern not_equal [concrete] @@ -2374,6 +2400,8 @@ fn F() { // CHECK:STDOUT: %.loc23_18.3: type = converted %Bool.call.loc23, %.loc23_18.2 [concrete = bool] // CHECK:STDOUT: } // CHECK:STDOUT: %not_equal: bool = value_binding not_equal, [concrete = ] +// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc16_24.3, constants.%DestroyOp.b0ebf8.1 +// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc16_24.3) // CHECK:STDOUT: %C.cpp_destructor.bound.loc13: = bound_method %c2.var, constants.%C.cpp_destructor // CHECK:STDOUT: %C.cpp_destructor.call.loc13: init %empty_tuple.type = call %C.cpp_destructor.bound.loc13(%c2.var) // CHECK:STDOUT: %C.cpp_destructor.bound.loc12: = bound_method %c1.var, constants.%C.cpp_destructor @@ -2381,7 +2409,9 @@ fn F() { // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @DestroyOp(%self.param: %C) = "no_op"; +// CHECK:STDOUT: fn @DestroyOp.loc16(%self.param: bool) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @DestroyOp.loc13(%self.param: %C) = "no_op"; // CHECK:STDOUT: // CHECK:STDOUT: --- import_single_namespace.carbon // CHECK:STDOUT: @@ -2435,7 +2465,7 @@ fn F() { // CHECK:STDOUT: %.loc8_31.1: ref %C = temporary_storage // CHECK:STDOUT: %addr.loc8: %ptr.838 = addr_of %.loc8_31.1 // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8) -// CHECK:STDOUT: %.loc8_31.2: init %C to %.loc8_31.1 = in_place_init %C__carbon_thunk.call.loc8 +// CHECK:STDOUT: %.loc8_31.2: init %C to %.loc8_31.1 = mark_in_place_init %C__carbon_thunk.call.loc8 // CHECK:STDOUT: %.loc8_16: type = splice_block %C.ref.loc8_16 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc8_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %N.ref.loc8_14: = name_ref N, imports.%N [concrete = imports.%N] @@ -2454,7 +2484,7 @@ fn F() { // CHECK:STDOUT: %.loc9_31.1: ref %C = temporary_storage // CHECK:STDOUT: %addr.loc9: %ptr.838 = addr_of %.loc9_31.1 // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc9) -// CHECK:STDOUT: %.loc9_31.2: init %C to %.loc9_31.1 = in_place_init %C__carbon_thunk.call.loc9 +// CHECK:STDOUT: %.loc9_31.2: init %C to %.loc9_31.1 = mark_in_place_init %C__carbon_thunk.call.loc9 // CHECK:STDOUT: %.loc9_16: type = splice_block %C.ref.loc9_16 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc9_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %N.ref.loc9_14: = name_ref N, imports.%N [concrete = imports.%N] @@ -2475,7 +2505,7 @@ fn F() { // CHECK:STDOUT: %addr.loc10_24.2: %ptr.838 = addr_of %.loc10_26 // CHECK:STDOUT: %addr.loc10_24.3: %ptr.838 = addr_of %.loc10_24.1 // CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc10_24.1, %addr.loc10_24.2, %addr.loc10_24.3) -// CHECK:STDOUT: %.loc10_24.2: init %C to %.loc10_24.1 = in_place_init %operator_Plus__carbon_thunk.call +// CHECK:STDOUT: %.loc10_24.2: init %C to %.loc10_24.1 = mark_in_place_init %operator_Plus__carbon_thunk.call // CHECK:STDOUT: %.loc10_16: type = splice_block %C.ref.loc10 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %N.ref.loc10: = name_ref N, imports.%N [concrete = imports.%N] @@ -2575,7 +2605,7 @@ fn F() { // CHECK:STDOUT: %.loc8_36.1: ref %C1 = temporary_storage // CHECK:STDOUT: %addr.loc8: %ptr.087 = addr_of %.loc8_36.1 // CHECK:STDOUT: %C1__carbon_thunk.call: init %empty_tuple.type = call imports.%C1__carbon_thunk.decl(%addr.loc8) -// CHECK:STDOUT: %.loc8_36.2: init %C1 to %.loc8_36.1 = in_place_init %C1__carbon_thunk.call +// CHECK:STDOUT: %.loc8_36.2: init %C1 to %.loc8_36.1 = mark_in_place_init %C1__carbon_thunk.call // CHECK:STDOUT: %.loc8_17: type = splice_block %C1.ref.loc8_17 [concrete = constants.%C1] { // CHECK:STDOUT: %Cpp.ref.loc8_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %N1.ref.loc8_14: = name_ref N1, imports.%N1 [concrete = imports.%N1] @@ -2594,7 +2624,7 @@ fn F() { // CHECK:STDOUT: %.loc9_36.1: ref %C2 = temporary_storage // CHECK:STDOUT: %addr.loc9: %ptr.51f = addr_of %.loc9_36.1 // CHECK:STDOUT: %C2__carbon_thunk.call: init %empty_tuple.type = call imports.%C2__carbon_thunk.decl(%addr.loc9) -// CHECK:STDOUT: %.loc9_36.2: init %C2 to %.loc9_36.1 = in_place_init %C2__carbon_thunk.call +// CHECK:STDOUT: %.loc9_36.2: init %C2 to %.loc9_36.1 = mark_in_place_init %C2__carbon_thunk.call // CHECK:STDOUT: %.loc9_17: type = splice_block %C2.ref.loc9_17 [concrete = constants.%C2] { // CHECK:STDOUT: %Cpp.ref.loc9_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %N2.ref.loc9_14: = name_ref N2, imports.%N2 [concrete = imports.%N2] @@ -2615,7 +2645,7 @@ fn F() { // CHECK:STDOUT: %addr.loc10_26.2: %ptr.51f = addr_of %.loc10_28 // CHECK:STDOUT: %addr.loc10_26.3: %ptr.51f = addr_of %.loc10_26.1 // CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc10_26.1, %addr.loc10_26.2, %addr.loc10_26.3) -// CHECK:STDOUT: %.loc10_26.2: init %C2 to %.loc10_26.1 = in_place_init %operator_Plus__carbon_thunk.call +// CHECK:STDOUT: %.loc10_26.2: init %C2 to %.loc10_26.1 = mark_in_place_init %operator_Plus__carbon_thunk.call // CHECK:STDOUT: %.loc10_17: type = splice_block %C2.ref.loc10 [concrete = constants.%C2] { // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %N2.ref.loc10: = name_ref N2, imports.%N2 [concrete = imports.%N2] @@ -2636,7 +2666,7 @@ fn F() { // CHECK:STDOUT: %addr.loc11_26.2: %ptr.087 = addr_of %.loc11_28 // CHECK:STDOUT: %addr.loc11_26.3: %ptr.51f = addr_of %.loc11_26.1 // CHECK:STDOUT: %operator_Minus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Minus__carbon_thunk.decl(%addr.loc11_26.1, %addr.loc11_26.2, %addr.loc11_26.3) -// CHECK:STDOUT: %.loc11_26.2: init %C2 to %.loc11_26.1 = in_place_init %operator_Minus__carbon_thunk.call +// CHECK:STDOUT: %.loc11_26.2: init %C2 to %.loc11_26.1 = mark_in_place_init %operator_Minus__carbon_thunk.call // CHECK:STDOUT: %.loc11_17: type = splice_block %C2.ref.loc11 [concrete = constants.%C2] { // CHECK:STDOUT: %Cpp.ref.loc11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %N2.ref.loc11: = name_ref N2, imports.%N2 [concrete = imports.%N2] @@ -2705,7 +2735,7 @@ fn F() { // CHECK:STDOUT: %.loc8_31.1: ref %C = temporary_storage // CHECK:STDOUT: %addr.loc8: %ptr.838 = addr_of %.loc8_31.1 // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8) -// CHECK:STDOUT: %.loc8_31.2: init %C to %.loc8_31.1 = in_place_init %C__carbon_thunk.call.loc8 +// CHECK:STDOUT: %.loc8_31.2: init %C to %.loc8_31.1 = mark_in_place_init %C__carbon_thunk.call.loc8 // CHECK:STDOUT: %.loc8_16: type = splice_block %C.ref.loc8_16 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc8_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %N.ref.loc8_14: = name_ref N, imports.%N [concrete = imports.%N] @@ -2724,7 +2754,7 @@ fn F() { // CHECK:STDOUT: %.loc9_31.1: ref %C = temporary_storage // CHECK:STDOUT: %addr.loc9: %ptr.838 = addr_of %.loc9_31.1 // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc9) -// CHECK:STDOUT: %.loc9_31.2: init %C to %.loc9_31.1 = in_place_init %C__carbon_thunk.call.loc9 +// CHECK:STDOUT: %.loc9_31.2: init %C to %.loc9_31.1 = mark_in_place_init %C__carbon_thunk.call.loc9 // CHECK:STDOUT: %.loc9_16: type = splice_block %C.ref.loc9_16 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc9_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %N.ref.loc9_14: = name_ref N, imports.%N [concrete = imports.%N] @@ -2803,7 +2833,7 @@ fn F() { // CHECK:STDOUT: %.loc8_31.1: ref %C = temporary_storage // CHECK:STDOUT: %addr.loc8: %ptr.de2 = addr_of %.loc8_31.1 // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8) -// CHECK:STDOUT: %.loc8_31.2: init %C to %.loc8_31.1 = in_place_init %C__carbon_thunk.call.loc8 +// CHECK:STDOUT: %.loc8_31.2: init %C to %.loc8_31.1 = mark_in_place_init %C__carbon_thunk.call.loc8 // CHECK:STDOUT: %.loc8_16: type = splice_block %C.ref.loc8_16 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc8_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %O.ref.loc8_14: type = name_ref O, imports.%O.decl [concrete = constants.%O] @@ -2822,7 +2852,7 @@ fn F() { // CHECK:STDOUT: %.loc9_31.1: ref %C = temporary_storage // CHECK:STDOUT: %addr.loc9: %ptr.de2 = addr_of %.loc9_31.1 // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc9) -// CHECK:STDOUT: %.loc9_31.2: init %C to %.loc9_31.1 = in_place_init %C__carbon_thunk.call.loc9 +// CHECK:STDOUT: %.loc9_31.2: init %C to %.loc9_31.1 = mark_in_place_init %C__carbon_thunk.call.loc9 // CHECK:STDOUT: %.loc9_16: type = splice_block %C.ref.loc9_16 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc9_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %O.ref.loc9_14: type = name_ref O, imports.%O.decl [concrete = constants.%O] @@ -2843,7 +2873,7 @@ fn F() { // CHECK:STDOUT: %addr.loc10_24.2: %ptr.de2 = addr_of %.loc10_26 // CHECK:STDOUT: %addr.loc10_24.3: %ptr.de2 = addr_of %.loc10_24.1 // CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc10_24.1, %addr.loc10_24.2, %addr.loc10_24.3) -// CHECK:STDOUT: %.loc10_24.2: init %C to %.loc10_24.1 = in_place_init %operator_Plus__carbon_thunk.call +// CHECK:STDOUT: %.loc10_24.2: init %C to %.loc10_24.1 = mark_in_place_init %operator_Plus__carbon_thunk.call // CHECK:STDOUT: %.loc10_16: type = splice_block %C.ref.loc10 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %O.ref.loc10: type = name_ref O, imports.%O.decl [concrete = constants.%O] @@ -2918,7 +2948,7 @@ fn F() { // CHECK:STDOUT: %.loc8_35.1: ref %C = temporary_storage // CHECK:STDOUT: %addr.loc8: %ptr.4b2 = addr_of %.loc8_35.1 // CHECK:STDOUT: %C__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8) -// CHECK:STDOUT: %.loc8_35.2: init %C to %.loc8_35.1 = in_place_init %C__carbon_thunk.call.loc8 +// CHECK:STDOUT: %.loc8_35.2: init %C to %.loc8_35.1 = mark_in_place_init %C__carbon_thunk.call.loc8 // CHECK:STDOUT: %.loc8_18: type = splice_block %C.ref.loc8_18 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc8_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %N.ref.loc8_14: = name_ref N, imports.%N [concrete = imports.%N] @@ -2939,7 +2969,7 @@ fn F() { // CHECK:STDOUT: %.loc9_35.1: ref %C = temporary_storage // CHECK:STDOUT: %addr.loc9: %ptr.4b2 = addr_of %.loc9_35.1 // CHECK:STDOUT: %C__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc9) -// CHECK:STDOUT: %.loc9_35.2: init %C to %.loc9_35.1 = in_place_init %C__carbon_thunk.call.loc9 +// CHECK:STDOUT: %.loc9_35.2: init %C to %.loc9_35.1 = mark_in_place_init %C__carbon_thunk.call.loc9 // CHECK:STDOUT: %.loc9_18: type = splice_block %C.ref.loc9_18 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc9_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %N.ref.loc9_14: = name_ref N, imports.%N [concrete = imports.%N] @@ -2961,7 +2991,7 @@ fn F() { // CHECK:STDOUT: %addr.loc10_26.2: %ptr.4b2 = addr_of %.loc10_28 // CHECK:STDOUT: %addr.loc10_26.3: %ptr.4b2 = addr_of %.loc10_26.1 // CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc10_26.1, %addr.loc10_26.2, %addr.loc10_26.3) -// CHECK:STDOUT: %.loc10_26.2: init %C to %.loc10_26.1 = in_place_init %operator_Plus__carbon_thunk.call +// CHECK:STDOUT: %.loc10_26.2: init %C to %.loc10_26.1 = mark_in_place_init %operator_Plus__carbon_thunk.call // CHECK:STDOUT: %.loc10_18: type = splice_block %C.ref.loc10 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %N.ref.loc10: = name_ref N, imports.%N [concrete = imports.%N] @@ -3060,7 +3090,7 @@ fn F() { // CHECK:STDOUT: %.loc8_3: ref %C = splice_block %c1.var {} // CHECK:STDOUT: %addr.loc8: %ptr.d9e = addr_of %.loc8_3 // CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%addr.loc8) -// CHECK:STDOUT: %.loc8_27: init %C to %.loc8_3 = in_place_init %C__carbon_thunk.call +// CHECK:STDOUT: %.loc8_27: init %C to %.loc8_3 = mark_in_place_init %C__carbon_thunk.call // CHECK:STDOUT: assign %c1.var, %.loc8_27 // CHECK:STDOUT: %.loc8_14: type = splice_block %C.ref.loc8_14 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc8_11: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -3077,7 +3107,7 @@ fn F() { // CHECK:STDOUT: %.loc9_3: ref %C = splice_block %c2.var {} // CHECK:STDOUT: %addr.loc9: %ptr.d9e = addr_of %.loc9_3 // CHECK:STDOUT: %operator_Minus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Minus__carbon_thunk.decl(%c1.ref.loc9, %addr.loc9) -// CHECK:STDOUT: %.loc9_19: init %C to %.loc9_3 = in_place_init %operator_Minus__carbon_thunk.call +// CHECK:STDOUT: %.loc9_19: init %C to %.loc9_3 = mark_in_place_init %operator_Minus__carbon_thunk.call // CHECK:STDOUT: assign %c2.var, %.loc9_19 // CHECK:STDOUT: %.loc9_14: type = splice_block %C.ref.loc9 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc9: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -3098,7 +3128,7 @@ fn F() { // CHECK:STDOUT: %addr.loc10_22.1: %ptr.d9e = addr_of %.loc10_24.2 // CHECK:STDOUT: %addr.loc10_22.2: %ptr.d9e = addr_of %.loc10_3 // CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%c1.ref.loc10, %addr.loc10_22.1, %addr.loc10_22.2) -// CHECK:STDOUT: %.loc10_22: init %C to %.loc10_3 = in_place_init %operator_Plus__carbon_thunk.call +// CHECK:STDOUT: %.loc10_22: init %C to %.loc10_3 = mark_in_place_init %operator_Plus__carbon_thunk.call // CHECK:STDOUT: assign %c3.var, %.loc10_22 // CHECK:STDOUT: %.loc10_14: type = splice_block %C.ref.loc10 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -3188,7 +3218,7 @@ fn F() { // CHECK:STDOUT: %addr.loc10_22.2: %ptr.d9e = addr_of %.loc10_24 // CHECK:STDOUT: %addr.loc10_22.3: %ptr.d9e = addr_of %.loc10_22.1 // CHECK:STDOUT: %operator_Plus__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_Plus__carbon_thunk.decl(%addr.loc10_22.1, %addr.loc10_22.2, %addr.loc10_22.3) -// CHECK:STDOUT: %.loc10_22.2: init %C to %.loc10_22.1 = in_place_init %operator_Plus__carbon_thunk.call +// CHECK:STDOUT: %.loc10_22.2: init %C to %.loc10_22.1 = mark_in_place_init %operator_Plus__carbon_thunk.call // CHECK:STDOUT: %.loc10_14: type = splice_block %C.ref.loc10 [concrete = constants.%C] { // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, imports.%C.decl [concrete = constants.%C] diff --git a/toolchain/check/testdata/interop/cpp/function/overloads.carbon b/toolchain/check/testdata/interop/cpp/function/overloads.carbon index fc8bb6efcf1e..b4280afcfaa1 100644 --- a/toolchain/check/testdata/interop/cpp/function/overloads.carbon +++ b/toolchain/check/testdata/interop/cpp/function/overloads.carbon @@ -1651,13 +1651,13 @@ fn F() { // CHECK:STDOUT: %.loc22_44.1: ref %i128 = temporary_storage // CHECK:STDOUT: %addr.loc22_44.2: %ptr.974 = addr_of %.loc22_44.1 // CHECK:STDOUT: %foo__carbon_thunk.call.loc22: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc22_44.1, %addr.loc22_44.2) -// CHECK:STDOUT: %.loc22_44.2: init %i128 = in_place_init %foo__carbon_thunk.call.loc22, %.loc22_44.1 +// CHECK:STDOUT: %.loc22_44.2: init %i128 to %.loc22_44.1 = mark_in_place_init %foo__carbon_thunk.call.loc22 // CHECK:STDOUT: %.loc22_10: type = splice_block %i128.loc22 [concrete = constants.%i128] { // CHECK:STDOUT: %int_128.loc22: Core.IntLiteral = int_value 128 [concrete = constants.%int_128] // CHECK:STDOUT: %i128.loc22: type = class_type @Int, @Int(constants.%int_128) [concrete = constants.%i128] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc22_44.3: %i128 = value_of_initializer %.loc22_44.2 -// CHECK:STDOUT: %.loc22_44.4: %i128 = converted %.loc22_44.2, %.loc22_44.3 +// CHECK:STDOUT: %.loc22_44.3: ref %i128 = temporary %.loc22_44.1, %.loc22_44.2 +// CHECK:STDOUT: %.loc22_44.4: %i128 = acquire_value %.loc22_44.3 // CHECK:STDOUT: %d: %i128 = value_binding d, %.loc22_44.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %e.patt: %pattern_type.57d = value_binding_pattern e [concrete] @@ -1683,13 +1683,13 @@ fn F() { // CHECK:STDOUT: %.loc25_45.1: ref %i128 = temporary_storage // CHECK:STDOUT: %addr.loc25_45.2: %ptr.974 = addr_of %.loc25_45.1 // CHECK:STDOUT: %foo__carbon_thunk.call.loc25: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc25_45.1, %addr.loc25_45.2) -// CHECK:STDOUT: %.loc25_45.2: init %i128 = in_place_init %foo__carbon_thunk.call.loc25, %.loc25_45.1 +// CHECK:STDOUT: %.loc25_45.2: init %i128 to %.loc25_45.1 = mark_in_place_init %foo__carbon_thunk.call.loc25 // CHECK:STDOUT: %.loc25_10: type = splice_block %i128.loc25 [concrete = constants.%i128] { // CHECK:STDOUT: %int_128.loc25: Core.IntLiteral = int_value 128 [concrete = constants.%int_128] // CHECK:STDOUT: %i128.loc25: type = class_type @Int, @Int(constants.%int_128) [concrete = constants.%i128] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc25_45.3: %i128 = value_of_initializer %.loc25_45.2 -// CHECK:STDOUT: %.loc25_45.4: %i128 = converted %.loc25_45.2, %.loc25_45.3 +// CHECK:STDOUT: %.loc25_45.3: ref %i128 = temporary %.loc25_45.1, %.loc25_45.2 +// CHECK:STDOUT: %.loc25_45.4: %i128 = acquire_value %.loc25_45.3 // CHECK:STDOUT: %e: %i128 = value_binding e, %.loc25_45.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %f.patt: %pattern_type.57d = value_binding_pattern f [concrete] @@ -1715,13 +1715,13 @@ fn F() { // CHECK:STDOUT: %.loc28_45.1: ref %i128 = temporary_storage // CHECK:STDOUT: %addr.loc28_45.2: %ptr.974 = addr_of %.loc28_45.1 // CHECK:STDOUT: %foo__carbon_thunk.call.loc28: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc28_45.1, %addr.loc28_45.2) -// CHECK:STDOUT: %.loc28_45.2: init %i128 = in_place_init %foo__carbon_thunk.call.loc28, %.loc28_45.1 +// CHECK:STDOUT: %.loc28_45.2: init %i128 to %.loc28_45.1 = mark_in_place_init %foo__carbon_thunk.call.loc28 // CHECK:STDOUT: %.loc28_10: type = splice_block %i128.loc28 [concrete = constants.%i128] { // CHECK:STDOUT: %int_128.loc28: Core.IntLiteral = int_value 128 [concrete = constants.%int_128] // CHECK:STDOUT: %i128.loc28: type = class_type @Int, @Int(constants.%int_128) [concrete = constants.%i128] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc28_45.3: %i128 = value_of_initializer %.loc28_45.2 -// CHECK:STDOUT: %.loc28_45.4: %i128 = converted %.loc28_45.2, %.loc28_45.3 +// CHECK:STDOUT: %.loc28_45.3: ref %i128 = temporary %.loc28_45.1, %.loc28_45.2 +// CHECK:STDOUT: %.loc28_45.4: %i128 = acquire_value %.loc28_45.3 // CHECK:STDOUT: %f: %i128 = value_binding f, %.loc28_45.4 // CHECK:STDOUT: name_binding_decl { // CHECK:STDOUT: %g.patt: %pattern_type.57d = value_binding_pattern g [concrete] @@ -1747,22 +1747,30 @@ fn F() { // CHECK:STDOUT: %.loc31_64.1: ref %i128 = temporary_storage // CHECK:STDOUT: %addr.loc31_64.2: %ptr.974 = addr_of %.loc31_64.1 // CHECK:STDOUT: %foo__carbon_thunk.call.loc31: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc31_64.1, %addr.loc31_64.2) -// CHECK:STDOUT: %.loc31_64.2: init %i128 = in_place_init %foo__carbon_thunk.call.loc31, %.loc31_64.1 +// CHECK:STDOUT: %.loc31_64.2: init %i128 to %.loc31_64.1 = mark_in_place_init %foo__carbon_thunk.call.loc31 // CHECK:STDOUT: %.loc31_10: type = splice_block %i128.loc31 [concrete = constants.%i128] { // CHECK:STDOUT: %int_128.loc31: Core.IntLiteral = int_value 128 [concrete = constants.%int_128] // CHECK:STDOUT: %i128.loc31: type = class_type @Int, @Int(constants.%int_128) [concrete = constants.%i128] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc31_64.3: %i128 = value_of_initializer %.loc31_64.2 -// CHECK:STDOUT: %.loc31_64.4: %i128 = converted %.loc31_64.2, %.loc31_64.3 +// CHECK:STDOUT: %.loc31_64.3: ref %i128 = temporary %.loc31_64.1, %.loc31_64.2 +// CHECK:STDOUT: %.loc31_64.4: %i128 = acquire_value %.loc31_64.3 // CHECK:STDOUT: %g: %i128 = value_binding g, %.loc31_64.4 -// CHECK:STDOUT: %DestroyOp.bound.loc31: = bound_method %.loc31_25.4, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc31: init %empty_tuple.type = call %DestroyOp.bound.loc31(%.loc31_25.4) -// CHECK:STDOUT: %DestroyOp.bound.loc28: = bound_method %.loc28_25.4, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc28: init %empty_tuple.type = call %DestroyOp.bound.loc28(%.loc28_25.4) -// CHECK:STDOUT: %DestroyOp.bound.loc25: = bound_method %.loc25_25.4, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc25: init %empty_tuple.type = call %DestroyOp.bound.loc25(%.loc25_25.4) -// CHECK:STDOUT: %DestroyOp.bound.loc22: = bound_method %.loc22_25.4, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call.loc22: init %empty_tuple.type = call %DestroyOp.bound.loc22(%.loc22_25.4) +// CHECK:STDOUT: %DestroyOp.bound.loc31_64: = bound_method %.loc31_64.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc31_64: init %empty_tuple.type = call %DestroyOp.bound.loc31_64(%.loc31_64.3) +// CHECK:STDOUT: %DestroyOp.bound.loc31_25: = bound_method %.loc31_25.4, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc31_25: init %empty_tuple.type = call %DestroyOp.bound.loc31_25(%.loc31_25.4) +// CHECK:STDOUT: %DestroyOp.bound.loc28_45: = bound_method %.loc28_45.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc28_45: init %empty_tuple.type = call %DestroyOp.bound.loc28_45(%.loc28_45.3) +// CHECK:STDOUT: %DestroyOp.bound.loc28_25: = bound_method %.loc28_25.4, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc28_25: init %empty_tuple.type = call %DestroyOp.bound.loc28_25(%.loc28_25.4) +// CHECK:STDOUT: %DestroyOp.bound.loc25_45: = bound_method %.loc25_45.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc25_45: init %empty_tuple.type = call %DestroyOp.bound.loc25_45(%.loc25_45.3) +// CHECK:STDOUT: %DestroyOp.bound.loc25_25: = bound_method %.loc25_25.4, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc25_25: init %empty_tuple.type = call %DestroyOp.bound.loc25_25(%.loc25_25.4) +// CHECK:STDOUT: %DestroyOp.bound.loc22_44: = bound_method %.loc22_44.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc22_44: init %empty_tuple.type = call %DestroyOp.bound.loc22_44(%.loc22_44.3) +// CHECK:STDOUT: %DestroyOp.bound.loc22_25: = bound_method %.loc22_25.4, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc22_25: init %empty_tuple.type = call %DestroyOp.bound.loc22_25(%.loc22_25.4) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2194,16 +2202,18 @@ fn F() { // CHECK:STDOUT: %.loc7_27.1: ref %f64.d77 = temporary_storage // CHECK:STDOUT: %addr.loc7_27.2: %ptr.bcc = addr_of %.loc7_27.1 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc7_27.1, %addr.loc7_27.2) -// CHECK:STDOUT: %.loc7_27.2: init %f64.d77 = in_place_init %foo__carbon_thunk.call, %.loc7_27.1 +// CHECK:STDOUT: %.loc7_27.2: init %f64.d77 to %.loc7_27.1 = mark_in_place_init %foo__carbon_thunk.call // CHECK:STDOUT: %.loc7_10: type = splice_block %f64 [concrete = constants.%f64.d77] { // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64] // CHECK:STDOUT: %f64: type = class_type @Float, @Float(constants.%int_64) [concrete = constants.%f64.d77] // CHECK:STDOUT: } -// CHECK:STDOUT: %.loc7_27.3: %f64.d77 = value_of_initializer %.loc7_27.2 -// CHECK:STDOUT: %.loc7_27.4: %f64.d77 = converted %.loc7_27.2, %.loc7_27.3 +// CHECK:STDOUT: %.loc7_27.3: ref %f64.d77 = temporary %.loc7_27.1, %.loc7_27.2 +// CHECK:STDOUT: %.loc7_27.4: %f64.d77 = acquire_value %.loc7_27.3 // CHECK:STDOUT: %d: %f64.d77 = value_binding d, %.loc7_27.4 -// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc7_24.4, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc7_24.4) +// CHECK:STDOUT: %DestroyOp.bound.loc7_27: = bound_method %.loc7_27.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc7_27: init %empty_tuple.type = call %DestroyOp.bound.loc7_27(%.loc7_27.3) +// CHECK:STDOUT: %DestroyOp.bound.loc7_24: = bound_method %.loc7_24.4, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc7_24: init %empty_tuple.type = call %DestroyOp.bound.loc7_24(%.loc7_24.4) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: @@ -2340,9 +2350,12 @@ fn F() { // CHECK:STDOUT: %.loc15_19.1: ref %f64.d77 = temporary_storage // CHECK:STDOUT: %addr.loc15_19.2: %ptr.bcc = addr_of %.loc15_19.1 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr.loc15_19.1, %addr.loc15_19.2) -// CHECK:STDOUT: %.loc15_19.2: init %f64.d77 = in_place_init %foo__carbon_thunk.call, %.loc15_19.1 -// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc15_11.4, constants.%DestroyOp -// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc15_11.4) +// CHECK:STDOUT: %.loc15_19.2: init %f64.d77 to %.loc15_19.1 = mark_in_place_init %foo__carbon_thunk.call +// CHECK:STDOUT: %.loc15_19.3: ref %f64.d77 = temporary %.loc15_19.1, %.loc15_19.2 +// CHECK:STDOUT: %DestroyOp.bound.loc15_19: = bound_method %.loc15_19.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc15_19: init %empty_tuple.type = call %DestroyOp.bound.loc15_19(%.loc15_19.3) +// CHECK:STDOUT: %DestroyOp.bound.loc15_11: = bound_method %.loc15_11.4, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call.loc15_11: init %empty_tuple.type = call %DestroyOp.bound.loc15_11(%.loc15_11.4) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/return.carbon b/toolchain/check/testdata/interop/cpp/function/return.carbon index c01773e4108f..c0f68bcb2d28 100644 --- a/toolchain/check/testdata/interop/cpp/function/return.carbon +++ b/toolchain/check/testdata/interop/cpp/function/return.carbon @@ -2,7 +2,7 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/primitives.carbon +// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/full.carbon // // AUTOUPDATE // TIP: To test this file alone, run: @@ -55,6 +55,55 @@ fn Call() { Cpp.UndeducedReturn(); } +// ============================================================================ +// Initialize a variable from a thunk output parameter +// ============================================================================ + +// --- var_from_thunk_param.carbon + +library "[[@TEST_NAME]]"; + +import Cpp inline ''' +using nullptr_t = decltype(nullptr); +auto ReturnNullPtr() -> nullptr_t; +'''; + +fn InitializeFromReturn() { + //@dump-sem-ir-begin + var c: Cpp.nullptr_t = Cpp.ReturnNullPtr(); + //@dump-sem-ir-end +} + +// ============================================================================ +// Return from a thunk output parameter +// ============================================================================ + +// --- return_from_thunk_param.carbon +//@include-in-dumps +library "[[@TEST_NAME]]"; + +import Cpp inline ''' +unsigned char ReturnU8(); +'''; + +fn GetU8() -> u8 { return Cpp.ReturnU8(); } + +// ============================================================================ +// Initialize a variable from a thunk with no output parameter +// ============================================================================ + +// --- var_from_thunk_by_value.carbon +//@include-in-dumps +library "[[@TEST_NAME]]"; + +import Cpp inline ''' +unsigned int ReturnU32(); +'''; + +fn Var() { + var my_u32: u32 = Cpp.ReturnU32(); +} + // CHECK:STDOUT: --- import_multiple.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -76,6 +125,8 @@ fn Call() { // CHECK:STDOUT: %foo2.cpp_overload_set.value: %foo2.cpp_overload_set.type = cpp_overload_set_value @foo2.cpp_overload_set [concrete] // CHECK:STDOUT: %foo2.type: type = fn_type @foo2 [concrete] // CHECK:STDOUT: %foo2: %foo2.type = struct_value () [concrete] +// CHECK:STDOUT: %DestroyOp.type: type = fn_type @DestroyOp [concrete] +// CHECK:STDOUT: %DestroyOp: %DestroyOp.type = struct_value () [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -106,9 +157,9 @@ fn Call() { // CHECK:STDOUT: %.loc11_22.1: ref %i16 = temporary_storage // CHECK:STDOUT: %addr: %ptr = addr_of %.loc11_22.1 // CHECK:STDOUT: %foo1__carbon_thunk.call: init %empty_tuple.type = call imports.%foo1__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %.loc11_22.2: init %i16 = in_place_init %foo1__carbon_thunk.call, %.loc11_22.1 -// CHECK:STDOUT: %.loc11_22.3: %i16 = value_of_initializer %.loc11_22.2 -// CHECK:STDOUT: %.loc11_22.4: %i16 = converted %.loc11_22.2, %.loc11_22.3 +// CHECK:STDOUT: %.loc11_22.2: init %i16 to %.loc11_22.1 = mark_in_place_init %foo1__carbon_thunk.call +// CHECK:STDOUT: %.loc11_22.3: ref %i16 = temporary %.loc11_22.1, %.loc11_22.2 +// CHECK:STDOUT: %.loc11_22.4: %i16 = acquire_value %.loc11_22.3 // CHECK:STDOUT: %IngestI16.call: init %empty_tuple.type = call %IngestI16.ref(%.loc11_22.4) // CHECK:STDOUT: %IngestI32.ref: %IngestI32.type = name_ref IngestI32, file.%IngestI32.decl [concrete = constants.%IngestI32] // CHECK:STDOUT: %Cpp.ref.loc12: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] @@ -117,6 +168,230 @@ fn Call() { // CHECK:STDOUT: %.loc12_22.1: %i32 = value_of_initializer %foo2.call // CHECK:STDOUT: %.loc12_22.2: %i32 = converted %foo2.call, %.loc12_22.1 // CHECK:STDOUT: %IngestI32.call: init %empty_tuple.type = call %IngestI32.ref(%.loc12_22.2) +// CHECK:STDOUT: %DestroyOp.bound: = bound_method %.loc11_22.3, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%.loc11_22.3) // CHECK:STDOUT: // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: fn @DestroyOp(%self.param: %i16) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: --- var_from_thunk_param.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %Cpp.nullptr_t: type = class_type @NullptrT [concrete] +// CHECK:STDOUT: %pattern_type.f05: type = pattern_type %Cpp.nullptr_t [concrete] +// CHECK:STDOUT: %ReturnNullPtr.cpp_overload_set.type: type = cpp_overload_set_type @ReturnNullPtr.cpp_overload_set [concrete] +// CHECK:STDOUT: %ReturnNullPtr.cpp_overload_set.value: %ReturnNullPtr.cpp_overload_set.type = cpp_overload_set_value @ReturnNullPtr.cpp_overload_set [concrete] +// CHECK:STDOUT: %ptr.142: type = ptr_type %Cpp.nullptr_t [concrete] +// CHECK:STDOUT: %ReturnNullPtr__carbon_thunk.type: type = fn_type @ReturnNullPtr__carbon_thunk [concrete] +// CHECK:STDOUT: %ReturnNullPtr__carbon_thunk: %ReturnNullPtr__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: %DestroyOp.type.3e79c2.2: type = fn_type @DestroyOp.loc11 [concrete] +// CHECK:STDOUT: %DestroyOp.b0ebf8.2: %DestroyOp.type.3e79c2.2 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Cpp: = namespace file.%Cpp.import_cpp, [concrete] { +// CHECK:STDOUT: .nullptr_t = constants.%Cpp.nullptr_t +// CHECK:STDOUT: .ReturnNullPtr = %ReturnNullPtr.cpp_overload_set.value +// CHECK:STDOUT: import Cpp//... +// CHECK:STDOUT: } +// CHECK:STDOUT: %ReturnNullPtr.cpp_overload_set.value: %ReturnNullPtr.cpp_overload_set.type = cpp_overload_set_value @ReturnNullPtr.cpp_overload_set [concrete = constants.%ReturnNullPtr.cpp_overload_set.value] +// CHECK:STDOUT: %ReturnNullPtr__carbon_thunk.decl: %ReturnNullPtr__carbon_thunk.type = fn_decl @ReturnNullPtr__carbon_thunk [concrete = constants.%ReturnNullPtr__carbon_thunk] { +// CHECK:STDOUT: +// CHECK:STDOUT: } { +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @InitializeFromReturn() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %c.patt: %pattern_type.f05 = ref_binding_pattern c [concrete] +// CHECK:STDOUT: %c.var_patt: %pattern_type.f05 = var_pattern %c.patt [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %c.var: ref %Cpp.nullptr_t = var %c.var_patt +// CHECK:STDOUT: %Cpp.ref.loc11_26: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %ReturnNullPtr.ref: %ReturnNullPtr.cpp_overload_set.type = name_ref ReturnNullPtr, imports.%ReturnNullPtr.cpp_overload_set.value [concrete = constants.%ReturnNullPtr.cpp_overload_set.value] +// CHECK:STDOUT: %.loc11_3: ref %Cpp.nullptr_t = splice_block %c.var {} +// CHECK:STDOUT: %addr: %ptr.142 = addr_of %.loc11_3 +// CHECK:STDOUT: %ReturnNullPtr__carbon_thunk.call: init %empty_tuple.type = call imports.%ReturnNullPtr__carbon_thunk.decl(%addr) +// CHECK:STDOUT: %.loc11_44: init %Cpp.nullptr_t to %.loc11_3 = mark_in_place_init %ReturnNullPtr__carbon_thunk.call +// CHECK:STDOUT: assign %c.var, %.loc11_44 +// CHECK:STDOUT: %.loc11_13: type = splice_block %nullptr_t.ref [concrete = constants.%Cpp.nullptr_t] { +// CHECK:STDOUT: %Cpp.ref.loc11_10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %nullptr_t.ref: type = name_ref nullptr_t, constants.%Cpp.nullptr_t [concrete = constants.%Cpp.nullptr_t] +// CHECK:STDOUT: } +// CHECK:STDOUT: %c: ref %Cpp.nullptr_t = ref_binding c, %c.var +// CHECK:STDOUT: %DestroyOp.bound: = bound_method %c.var, constants.%DestroyOp.b0ebf8.2 +// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%c.var) +// CHECK:STDOUT: +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @DestroyOp.loc11(%self.param: %Cpp.nullptr_t) = "no_op"; +// CHECK:STDOUT: +// CHECK:STDOUT: --- return_from_thunk_param.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete] +// CHECK:STDOUT: %UInt.type: type = generic_class_type @UInt [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %UInt.generic: %UInt.type = struct_value () [concrete] +// CHECK:STDOUT: %u8: type = class_type @UInt, @UInt(%int_8) [concrete] +// CHECK:STDOUT: %.98d: form = init_form %u8, call_param0 [concrete] +// CHECK:STDOUT: %pattern_type.8f3: type = pattern_type %u8 [concrete] +// CHECK:STDOUT: %GetU8.type: type = fn_type @GetU8 [concrete] +// CHECK:STDOUT: %GetU8: %GetU8.type = struct_value () [concrete] +// CHECK:STDOUT: %ReturnU8.cpp_overload_set.type: type = cpp_overload_set_type @ReturnU8.cpp_overload_set [concrete] +// CHECK:STDOUT: %ReturnU8.cpp_overload_set.value: %ReturnU8.cpp_overload_set.type = cpp_overload_set_value @ReturnU8.cpp_overload_set [concrete] +// CHECK:STDOUT: %ptr: type = ptr_type %u8 [concrete] +// CHECK:STDOUT: %pattern_type.a66: type = pattern_type %ptr [concrete] +// CHECK:STDOUT: %ReturnU8__carbon_thunk.type: type = fn_type @ReturnU8__carbon_thunk [concrete] +// CHECK:STDOUT: %ReturnU8__carbon_thunk: %ReturnU8__carbon_thunk.type = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .UInt = %Core.UInt +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Cpp: = namespace file.%Cpp.import_cpp, [concrete] { +// CHECK:STDOUT: .ReturnU8 = %ReturnU8.cpp_overload_set.value +// CHECK:STDOUT: import Cpp//... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.UInt: %UInt.type = import_ref Core//prelude/types/uint, UInt, loaded [concrete = constants.%UInt.generic] +// CHECK:STDOUT: %ReturnU8.cpp_overload_set.value: %ReturnU8.cpp_overload_set.type = cpp_overload_set_value @ReturnU8.cpp_overload_set [concrete = constants.%ReturnU8.cpp_overload_set.value] +// CHECK:STDOUT: %ReturnU8__carbon_thunk.decl: %ReturnU8__carbon_thunk.type = fn_decl @ReturnU8__carbon_thunk [concrete = constants.%ReturnU8__carbon_thunk] { +// CHECK:STDOUT: %return.patt: %pattern_type.a66 = value_binding_pattern r#return [concrete] +// CHECK:STDOUT: %return.param_patt: %pattern_type.a66 = value_param_pattern %return.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %return.param: %ptr = value_param call_param0 +// CHECK:STDOUT: %.1: type = splice_block constants.%ptr [concrete = constants.%ptr] { +// CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8] +// CHECK:STDOUT: %u8: type = class_type @UInt, @UInt(constants.%int_8) [concrete = constants.%u8] +// CHECK:STDOUT: } +// CHECK:STDOUT: %return: %ptr = value_binding r#return, %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Cpp = imports.%Cpp +// CHECK:STDOUT: .GetU8 = %GetU8.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Cpp.import_cpp = import_cpp { +// CHECK:STDOUT: import Cpp inline +// CHECK:STDOUT: } +// CHECK:STDOUT: %GetU8.decl: %GetU8.type = fn_decl @GetU8 [concrete = constants.%GetU8] { +// CHECK:STDOUT: %return.patt: %pattern_type.8f3 = return_slot_pattern [concrete] +// CHECK:STDOUT: %return.param_patt: %pattern_type.8f3 = out_param_pattern %return.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8] +// CHECK:STDOUT: %u8: type = class_type @UInt, @UInt(constants.%int_8) [concrete = constants.%u8] +// CHECK:STDOUT: %.loc8_15: form = init_form %u8, call_param0 [concrete = constants.%.98d] +// CHECK:STDOUT: %return.param: ref %u8 = out_param call_param0 +// CHECK:STDOUT: %return: ref %u8 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @GetU8() -> out %return.param: %u8 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %ReturnU8.ref: %ReturnU8.cpp_overload_set.type = name_ref ReturnU8, imports.%ReturnU8.cpp_overload_set.value [concrete = constants.%ReturnU8.cpp_overload_set.value] +// CHECK:STDOUT: %.loc8_40.1: ref %u8 = temporary_storage +// CHECK:STDOUT: %addr: %ptr = addr_of %.loc8_40.1 +// CHECK:STDOUT: %ReturnU8__carbon_thunk.call: init %empty_tuple.type = call imports.%ReturnU8__carbon_thunk.decl(%addr) +// CHECK:STDOUT: %.loc8_40.2: init %u8 to %.loc8_40.1 = mark_in_place_init %ReturnU8__carbon_thunk.call +// CHECK:STDOUT: return %.loc8_40.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @ReturnU8() -> out %return.param: %u8; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @ReturnU8__carbon_thunk(%return.param: %ptr); +// CHECK:STDOUT: +// CHECK:STDOUT: --- var_from_thunk_by_value.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %Var.type: type = fn_type @Var [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %Var: %Var.type = struct_value () [concrete] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// CHECK:STDOUT: %UInt.type: type = generic_class_type @UInt [concrete] +// CHECK:STDOUT: %UInt.generic: %UInt.type = struct_value () [concrete] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.4a9: type = pattern_type %u32 [concrete] +// CHECK:STDOUT: %ReturnU32.cpp_overload_set.type: type = cpp_overload_set_type @ReturnU32.cpp_overload_set [concrete] +// CHECK:STDOUT: %ReturnU32.cpp_overload_set.value: %ReturnU32.cpp_overload_set.type = cpp_overload_set_value @ReturnU32.cpp_overload_set [concrete] +// CHECK:STDOUT: %ReturnU32.type: type = fn_type @ReturnU32 [concrete] +// CHECK:STDOUT: %ReturnU32: %ReturnU32.type = struct_value () [concrete] +// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] +// CHECK:STDOUT: %DestroyOp.type: type = fn_type @DestroyOp [concrete] +// CHECK:STDOUT: %DestroyOp: %DestroyOp.type = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .UInt = %Core.UInt +// CHECK:STDOUT: .Destroy = %Core.Destroy +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Cpp: = namespace file.%Cpp.import_cpp, [concrete] { +// CHECK:STDOUT: .ReturnU32 = %ReturnU32.cpp_overload_set.value +// CHECK:STDOUT: import Cpp//... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.UInt: %UInt.type = import_ref Core//prelude/types/uint, UInt, loaded [concrete = constants.%UInt.generic] +// CHECK:STDOUT: %ReturnU32.cpp_overload_set.value: %ReturnU32.cpp_overload_set.type = cpp_overload_set_value @ReturnU32.cpp_overload_set [concrete = constants.%ReturnU32.cpp_overload_set.value] +// CHECK:STDOUT: %ReturnU32.decl: %ReturnU32.type = fn_decl @ReturnU32 [concrete = constants.%ReturnU32] { +// CHECK:STDOUT: %return.patt: %pattern_type.4a9 = return_slot_pattern [concrete] +// CHECK:STDOUT: %return.param_patt: %pattern_type.4a9 = out_param_pattern %return.patt, call_param0 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [concrete = constants.%u32] +// CHECK:STDOUT: %return.param: ref %u32 = out_param call_param0 +// CHECK:STDOUT: %return: ref %u32 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/destroy, Destroy, loaded [concrete = constants.%Destroy.type] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Cpp = imports.%Cpp +// CHECK:STDOUT: .Var = %Var.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Cpp.import_cpp = import_cpp { +// CHECK:STDOUT: import Cpp inline +// CHECK:STDOUT: } +// CHECK:STDOUT: %Var.decl: %Var.type = fn_decl @Var [concrete = constants.%Var] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Var() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %my_u32.patt: %pattern_type.4a9 = ref_binding_pattern my_u32 [concrete] +// CHECK:STDOUT: %my_u32.var_patt: %pattern_type.4a9 = var_pattern %my_u32.patt [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %my_u32.var: ref %u32 = var %my_u32.var_patt +// CHECK:STDOUT: %Cpp.ref: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] +// CHECK:STDOUT: %ReturnU32.ref: %ReturnU32.cpp_overload_set.type = name_ref ReturnU32, imports.%ReturnU32.cpp_overload_set.value [concrete = constants.%ReturnU32.cpp_overload_set.value] +// CHECK:STDOUT: %ReturnU32.call: init %u32 = call imports.%ReturnU32.decl() +// CHECK:STDOUT: assign %my_u32.var, %ReturnU32.call +// CHECK:STDOUT: %.loc9: type = splice_block %u32 [concrete = constants.%u32] { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [concrete = constants.%u32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %my_u32: ref %u32 = ref_binding my_u32, %my_u32.var +// CHECK:STDOUT: %DestroyOp.bound: = bound_method %my_u32.var, constants.%DestroyOp +// CHECK:STDOUT: %DestroyOp.call: init %empty_tuple.type = call %DestroyOp.bound(%my_u32.var) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @ReturnU32() -> out %return.param: %u32; +// CHECK:STDOUT: +// CHECK:STDOUT: fn @DestroyOp(%self.param: %u32) = "no_op"; +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/function/struct.carbon b/toolchain/check/testdata/interop/cpp/function/struct.carbon index a175c2ddbad3..f26d6d18c553 100644 --- a/toolchain/check/testdata/interop/cpp/function/struct.carbon +++ b/toolchain/check/testdata/interop/cpp/function/struct.carbon @@ -1005,7 +1005,7 @@ fn F() { // CHECK:STDOUT: %.loc8_11.1: ref %S = temporary_storage // CHECK:STDOUT: %addr: %ptr.5c7 = addr_of %.loc8_11.1 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %.loc8_11.2: init %S to %.loc8_11.1 = in_place_init %foo__carbon_thunk.call +// CHECK:STDOUT: %.loc8_11.2: init %S to %.loc8_11.1 = mark_in_place_init %foo__carbon_thunk.call // CHECK:STDOUT: %.loc8_11.3: ref %S = temporary %.loc8_11.1, %.loc8_11.2 // CHECK:STDOUT: %S.cpp_destructor.bound: = bound_method %.loc8_11.3, constants.%S.cpp_destructor // CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call %S.cpp_destructor.bound(%.loc8_11.3) diff --git a/toolchain/check/testdata/interop/cpp/function/union.carbon b/toolchain/check/testdata/interop/cpp/function/union.carbon index c5d5948ba2d8..5954702666a5 100644 --- a/toolchain/check/testdata/interop/cpp/function/union.carbon +++ b/toolchain/check/testdata/interop/cpp/function/union.carbon @@ -930,7 +930,7 @@ fn F() { // CHECK:STDOUT: %.loc8_11.1: ref %U = temporary_storage // CHECK:STDOUT: %addr: %ptr.86f = addr_of %.loc8_11.1 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %.loc8_11.2: init %U to %.loc8_11.1 = in_place_init %foo__carbon_thunk.call +// CHECK:STDOUT: %.loc8_11.2: init %U to %.loc8_11.1 = mark_in_place_init %foo__carbon_thunk.call // CHECK:STDOUT: %.loc8_11.3: ref %U = temporary %.loc8_11.1, %.loc8_11.2 // CHECK:STDOUT: %U.cpp_destructor.bound: = bound_method %.loc8_11.3, constants.%U.cpp_destructor // CHECK:STDOUT: %U.cpp_destructor.call: init %empty_tuple.type = call %U.cpp_destructor.bound(%.loc8_11.3) diff --git a/toolchain/check/testdata/interop/cpp/impls/as.carbon b/toolchain/check/testdata/interop/cpp/impls/as.carbon index 5a8d93187bc2..4f3b48f45eab 100644 --- a/toolchain/check/testdata/interop/cpp/impls/as.carbon +++ b/toolchain/check/testdata/interop/cpp/impls/as.carbon @@ -231,7 +231,7 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %.loc8_5.1: ref %Dest = temporary_storage // CHECK:STDOUT: %addr: %ptr.551 = addr_of %.loc8_5.1 // CHECK:STDOUT: %Dest__carbon_thunk.call: init %empty_tuple.type = call imports.%Dest__carbon_thunk.decl.b58ecd.1(%s.ref, %addr) -// CHECK:STDOUT: %.loc8_5.2: init %Dest to %.loc8_5.1 = in_place_init %Dest__carbon_thunk.call +// CHECK:STDOUT: %.loc8_5.2: init %Dest to %.loc8_5.1 = mark_in_place_init %Dest__carbon_thunk.call // CHECK:STDOUT: %.loc8_5.3: init %Dest = converted %s.ref, %.loc8_5.2 // CHECK:STDOUT: %.loc8_5.4: ref %Dest = temporary %.loc8_5.1, %.loc8_5.3 // CHECK:STDOUT: %Dest.cpp_destructor.bound: = bound_method %.loc8_5.4, constants.%Dest.cpp_destructor @@ -251,7 +251,7 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %addr.loc14_5.1: %ptr.472 = addr_of %.loc14_3 // CHECK:STDOUT: %addr.loc14_5.2: %ptr.9ae = addr_of %.loc14_5.1 // CHECK:STDOUT: %Dest2__carbon_thunk.call: init %empty_tuple.type = call imports.%Dest2__carbon_thunk.decl(%addr.loc14_5.1, %addr.loc14_5.2) -// CHECK:STDOUT: %.loc14_5.2: init %Dest2 to %.loc14_5.1 = in_place_init %Dest2__carbon_thunk.call +// CHECK:STDOUT: %.loc14_5.2: init %Dest2 to %.loc14_5.1 = mark_in_place_init %Dest2__carbon_thunk.call // CHECK:STDOUT: %.loc14_5.3: init %Dest2 = converted %s.ref, %.loc14_5.2 // CHECK:STDOUT: %.loc14_5.4: ref %Dest2 = temporary %.loc14_5.1, %.loc14_5.3 // CHECK:STDOUT: %Dest2.cpp_destructor.bound: = bound_method %.loc14_5.4, constants.%Dest2.cpp_destructor @@ -271,7 +271,7 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %addr.loc20_5.1: %ptr.1fc = addr_of %.loc20_3 // CHECK:STDOUT: %addr.loc20_5.2: %ptr.5b5 = addr_of %.loc20_5.1 // CHECK:STDOUT: %ExplicitConstructor__carbon_thunk.call: init %empty_tuple.type = call imports.%ExplicitConstructor__carbon_thunk.decl(%addr.loc20_5.1, %addr.loc20_5.2) -// CHECK:STDOUT: %.loc20_5.2: init %ExplicitConstructor to %.loc20_5.1 = in_place_init %ExplicitConstructor__carbon_thunk.call +// CHECK:STDOUT: %.loc20_5.2: init %ExplicitConstructor to %.loc20_5.1 = mark_in_place_init %ExplicitConstructor__carbon_thunk.call // CHECK:STDOUT: %.loc20_5.3: init %ExplicitConstructor = converted %s.ref, %.loc20_5.2 // CHECK:STDOUT: %.loc20_5.4: ref %ExplicitConstructor = temporary %.loc20_5.1, %.loc20_5.3 // CHECK:STDOUT: %ExplicitConstructor.cpp_destructor.bound: = bound_method %.loc20_5.4, constants.%ExplicitConstructor.cpp_destructor @@ -290,7 +290,7 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %.loc26_5.1: ref %Dest = temporary_storage // CHECK:STDOUT: %addr: %ptr.551 = addr_of %.loc26_5.1 // CHECK:STDOUT: %Dest__carbon_thunk.call: init %empty_tuple.type = call imports.%Dest__carbon_thunk.decl.b58ecd.2(%s.ref, %addr) -// CHECK:STDOUT: %.loc26_5.2: init %Dest to %.loc26_5.1 = in_place_init %Dest__carbon_thunk.call +// CHECK:STDOUT: %.loc26_5.2: init %Dest to %.loc26_5.1 = mark_in_place_init %Dest__carbon_thunk.call // CHECK:STDOUT: %.loc26_5.3: init %Dest = converted %s.ref, %.loc26_5.2 // CHECK:STDOUT: %.loc26_5.4: ref %Dest = temporary %.loc26_5.1, %.loc26_5.3 // CHECK:STDOUT: %Dest.cpp_destructor.bound: = bound_method %.loc26_5.4, constants.%Dest.cpp_destructor @@ -381,7 +381,7 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %addr.loc8_43.1: %ptr.1fc = addr_of %.loc8_43.2 // CHECK:STDOUT: %addr.loc8_43.2: %ptr.ca4178.1 = addr_of %.loc8_43.1 // CHECK:STDOUT: %ConditionallyExplicit__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%ConditionallyExplicit__carbon_thunk.decl.22daaa.1(%addr.loc8_43.1, %addr.loc8_43.2) -// CHECK:STDOUT: %.loc8_43.3: init %ConditionallyExplicit.c52b91.1 to %.loc8_43.1 = in_place_init %ConditionallyExplicit__carbon_thunk.call.loc8 +// CHECK:STDOUT: %.loc8_43.3: init %ConditionallyExplicit.c52b91.1 to %.loc8_43.1 = mark_in_place_init %ConditionallyExplicit__carbon_thunk.call.loc8 // CHECK:STDOUT: %.loc8_43.4: init %ConditionallyExplicit.c52b91.1 = converted %s.ref.loc8, %.loc8_43.3 // CHECK:STDOUT: %.loc8_43.5: ref %ConditionallyExplicit.c52b91.1 = temporary %.loc8_43.1, %.loc8_43.4 // CHECK:STDOUT: %.loc8_43.6: %ConditionallyExplicit.c52b91.1 = acquire_value %.loc8_43.5 @@ -394,7 +394,7 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %addr.loc9_5.1: %ptr.1fc = addr_of %.loc9_3 // CHECK:STDOUT: %addr.loc9_5.2: %ptr.ca4178.1 = addr_of %.loc9_5.1 // CHECK:STDOUT: %ConditionallyExplicit__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%ConditionallyExplicit__carbon_thunk.decl.22daaa.1(%addr.loc9_5.1, %addr.loc9_5.2) -// CHECK:STDOUT: %.loc9_5.2: init %ConditionallyExplicit.c52b91.1 to %.loc9_5.1 = in_place_init %ConditionallyExplicit__carbon_thunk.call.loc9 +// CHECK:STDOUT: %.loc9_5.2: init %ConditionallyExplicit.c52b91.1 to %.loc9_5.1 = mark_in_place_init %ConditionallyExplicit__carbon_thunk.call.loc9 // CHECK:STDOUT: %.loc9_5.3: init %ConditionallyExplicit.c52b91.1 = converted %s.ref.loc9, %.loc9_5.2 // CHECK:STDOUT: %.loc9_5.4: ref %ConditionallyExplicit.c52b91.1 = temporary %.loc9_5.1, %.loc9_5.3 // CHECK:STDOUT: %ConditionallyExplicit.cpp_destructor.bound.loc9: = bound_method %.loc9_5.4, constants.%ConditionallyExplicit.cpp_destructor.1ba031.1 @@ -416,7 +416,7 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %addr.loc15_5.1: %ptr.1fc = addr_of %.loc15_3 // CHECK:STDOUT: %addr.loc15_5.2: %ptr.ca4178.2 = addr_of %.loc15_5.1 // CHECK:STDOUT: %ConditionallyExplicit__carbon_thunk.call: init %empty_tuple.type = call imports.%ConditionallyExplicit__carbon_thunk.decl.22daaa.2(%addr.loc15_5.1, %addr.loc15_5.2) -// CHECK:STDOUT: %.loc15_5.2: init %ConditionallyExplicit.c52b91.2 to %.loc15_5.1 = in_place_init %ConditionallyExplicit__carbon_thunk.call +// CHECK:STDOUT: %.loc15_5.2: init %ConditionallyExplicit.c52b91.2 to %.loc15_5.1 = mark_in_place_init %ConditionallyExplicit__carbon_thunk.call // CHECK:STDOUT: %.loc15_5.3: init %ConditionallyExplicit.c52b91.2 = converted %s.ref, %.loc15_5.2 // CHECK:STDOUT: %.loc15_5.4: ref %ConditionallyExplicit.c52b91.2 = temporary %.loc15_5.1, %.loc15_5.3 // CHECK:STDOUT: %ConditionallyExplicit.cpp_destructor.bound: = bound_method %.loc15_5.4, constants.%ConditionallyExplicit.cpp_destructor.1ba031.2 @@ -440,7 +440,7 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %.loc21_21.1: ref %Dest = temporary_storage // CHECK:STDOUT: %addr.loc21: %ptr.551 = addr_of %.loc21_21.1 // CHECK:STDOUT: %Dest__carbon_thunk.call.loc21: init %empty_tuple.type = call imports.%Dest__carbon_thunk.decl(%s.ref.loc21, %addr.loc21) -// CHECK:STDOUT: %.loc21_21.2: init %Dest to %.loc21_21.1 = in_place_init %Dest__carbon_thunk.call.loc21 +// CHECK:STDOUT: %.loc21_21.2: init %Dest to %.loc21_21.1 = mark_in_place_init %Dest__carbon_thunk.call.loc21 // CHECK:STDOUT: %.loc21_21.3: init %Dest = converted %s.ref.loc21, %.loc21_21.2 // CHECK:STDOUT: %.loc21_21.4: ref %Dest = temporary %.loc21_21.1, %.loc21_21.3 // CHECK:STDOUT: %.loc21_21.5: %Dest = acquire_value %.loc21_21.4 @@ -452,7 +452,7 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %.loc22_5.1: ref %Dest = temporary_storage // CHECK:STDOUT: %addr.loc22: %ptr.551 = addr_of %.loc22_5.1 // CHECK:STDOUT: %Dest__carbon_thunk.call.loc22: init %empty_tuple.type = call imports.%Dest__carbon_thunk.decl(%s.ref.loc22, %addr.loc22) -// CHECK:STDOUT: %.loc22_5.2: init %Dest to %.loc22_5.1 = in_place_init %Dest__carbon_thunk.call.loc22 +// CHECK:STDOUT: %.loc22_5.2: init %Dest to %.loc22_5.1 = mark_in_place_init %Dest__carbon_thunk.call.loc22 // CHECK:STDOUT: %.loc22_5.3: init %Dest = converted %s.ref.loc22, %.loc22_5.2 // CHECK:STDOUT: %.loc22_5.4: ref %Dest = temporary %.loc22_5.1, %.loc22_5.3 // CHECK:STDOUT: %Dest.cpp_destructor.bound.loc22: = bound_method %.loc22_5.4, constants.%Dest.cpp_destructor @@ -473,7 +473,7 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %.loc28_5.1: ref %Dest = temporary_storage // CHECK:STDOUT: %addr: %ptr.551 = addr_of %.loc28_5.1 // CHECK:STDOUT: %Dest__carbon_thunk.call: init %empty_tuple.type = call imports.%Dest__carbon_thunk.decl(%s.ref, %addr) -// CHECK:STDOUT: %.loc28_5.2: init %Dest to %.loc28_5.1 = in_place_init %Dest__carbon_thunk.call +// CHECK:STDOUT: %.loc28_5.2: init %Dest to %.loc28_5.1 = mark_in_place_init %Dest__carbon_thunk.call // CHECK:STDOUT: %.loc28_5.3: init %Dest = converted %s.ref, %.loc28_5.2 // CHECK:STDOUT: %.loc28_5.4: ref %Dest = temporary %.loc28_5.1, %.loc28_5.3 // CHECK:STDOUT: %Dest.cpp_destructor.bound: = bound_method %.loc28_5.4, constants.%Dest.cpp_destructor @@ -558,7 +558,7 @@ fn ConversionExplicit(s: Cpp.ConditionallyExplicitFalse) { // CHECK:STDOUT: %.loc21_21.1: ref %Dest.5e7 = temporary_storage // CHECK:STDOUT: %addr: %ptr.551 = addr_of %.loc21_21.1 // CHECK:STDOUT: %Dest__carbon_thunk.call: init %empty_tuple.type = call imports.%Dest__carbon_thunk.decl(%s.ref, %addr) -// CHECK:STDOUT: %.loc21_21.2: init %Dest.5e7 to %.loc21_21.1 = in_place_init %Dest__carbon_thunk.call +// CHECK:STDOUT: %.loc21_21.2: init %Dest.5e7 to %.loc21_21.1 = mark_in_place_init %Dest__carbon_thunk.call // CHECK:STDOUT: %.loc21_21.3: init %Dest.5e7 = converted %s.ref, %.loc21_21.2 // CHECK:STDOUT: %.loc21_21.4: ref %Dest.5e7 = temporary %.loc21_21.1, %.loc21_21.3 // CHECK:STDOUT: %.loc21_21.5: %Dest.5e7 = acquire_value %.loc21_21.4 diff --git a/toolchain/check/testdata/interop/cpp/impls/copy.carbon b/toolchain/check/testdata/interop/cpp/impls/copy.carbon index 370fdb580eb4..50837e9f4612 100644 --- a/toolchain/check/testdata/interop/cpp/impls/copy.carbon +++ b/toolchain/check/testdata/interop/cpp/impls/copy.carbon @@ -264,7 +264,7 @@ fn EqualWitnesses(p: Wrap(Cpp.Copyable)*) -> Wrap(Cpp.Copyable)* { // CHECK:STDOUT: %.loc8_10.4: %ptr.29d = converted %addr.loc8_10.1, %.loc8_10.3 // CHECK:STDOUT: %addr.loc8_10.2: %ptr.e47 = addr_of %.loc6_40.1 // CHECK:STDOUT: %Copyable__carbon_thunk.call: init %empty_tuple.type = call imports.%Copyable__carbon_thunk.decl(%.loc8_10.4, %addr.loc8_10.2) -// CHECK:STDOUT: %.loc8_10.5: init %Copyable to %.loc6_40.1 = in_place_init %Copyable__carbon_thunk.call +// CHECK:STDOUT: %.loc8_10.5: init %Copyable to %.loc6_40.1 = mark_in_place_init %Copyable__carbon_thunk.call // CHECK:STDOUT: return %.loc8_10.5 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: @@ -283,7 +283,7 @@ fn EqualWitnesses(p: Wrap(Cpp.Copyable)*) -> Wrap(Cpp.Copyable)* { // CHECK:STDOUT: %.loc14_10.4: %ptr.093 = converted %addr.loc14_10.1, %.loc14_10.3 // CHECK:STDOUT: %addr.loc14_10.2: %ptr.84c = addr_of %.loc12_48.1 // CHECK:STDOUT: %ExplicitCopy__carbon_thunk.call: init %empty_tuple.type = call imports.%ExplicitCopy__carbon_thunk.decl(%.loc14_10.4, %addr.loc14_10.2) -// CHECK:STDOUT: %.loc14_10.5: init %ExplicitCopy to %.loc12_48.1 = in_place_init %ExplicitCopy__carbon_thunk.call +// CHECK:STDOUT: %.loc14_10.5: init %ExplicitCopy to %.loc12_48.1 = mark_in_place_init %ExplicitCopy__carbon_thunk.call // CHECK:STDOUT: return %.loc14_10.5 to %return.param // 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 ddd46e87c0b9..b4aedbb29705 100644 --- a/toolchain/check/testdata/interop/cpp/impls/implicit_as.carbon +++ b/toolchain/check/testdata/interop/cpp/impls/implicit_as.carbon @@ -512,7 +512,7 @@ fn InitFromStruct() { // CHECK:STDOUT: %.loc8_21.1: ref %Dest = temporary_storage // CHECK:STDOUT: %addr: %ptr.551 = addr_of %.loc8_21.1 // CHECK:STDOUT: %Dest__carbon_thunk.call: init %empty_tuple.type = call imports.%Dest__carbon_thunk.decl.b58ecd.1(%s.ref, %addr) -// CHECK:STDOUT: %.loc8_21.2: init %Dest to %.loc8_21.1 = in_place_init %Dest__carbon_thunk.call +// CHECK:STDOUT: %.loc8_21.2: init %Dest to %.loc8_21.1 = mark_in_place_init %Dest__carbon_thunk.call // CHECK:STDOUT: %.loc8_21.3: init %Dest = converted %s.ref, %.loc8_21.2 // CHECK:STDOUT: %.loc8_21.4: ref %Dest = temporary %.loc8_21.1, %.loc8_21.3 // CHECK:STDOUT: %.loc8_21.5: %Dest = acquire_value %.loc8_21.4 @@ -538,7 +538,7 @@ fn InitFromStruct() { // CHECK:STDOUT: %.loc14_21.1: ref %Dest = temporary_storage // CHECK:STDOUT: %addr: %ptr.551 = addr_of %.loc14_21.1 // CHECK:STDOUT: %Dest__carbon_thunk.call: init %empty_tuple.type = call imports.%Dest__carbon_thunk.decl.b58ecd.2(%s.ref, %addr) -// CHECK:STDOUT: %.loc14_21.2: init %Dest to %.loc14_21.1 = in_place_init %Dest__carbon_thunk.call +// CHECK:STDOUT: %.loc14_21.2: init %Dest to %.loc14_21.1 = mark_in_place_init %Dest__carbon_thunk.call // CHECK:STDOUT: %.loc14_21.3: init %Dest = converted %s.ref, %.loc14_21.2 // CHECK:STDOUT: %.loc14_21.4: ref %Dest = temporary %.loc14_21.1, %.loc14_21.3 // CHECK:STDOUT: %.loc14_21.5: %Dest = acquire_value %.loc14_21.4 @@ -563,7 +563,7 @@ fn InitFromStruct() { // CHECK:STDOUT: %addr.loc20_22.1: %ptr.472 = addr_of %.loc20_22.2 // CHECK:STDOUT: %addr.loc20_22.2: %ptr.9ae = addr_of %.loc20_22.1 // CHECK:STDOUT: %Dest2__carbon_thunk.call: init %empty_tuple.type = call imports.%Dest2__carbon_thunk.decl(%addr.loc20_22.1, %addr.loc20_22.2) -// CHECK:STDOUT: %.loc20_22.3: init %Dest2 to %.loc20_22.1 = in_place_init %Dest2__carbon_thunk.call +// CHECK:STDOUT: %.loc20_22.3: init %Dest2 to %.loc20_22.1 = mark_in_place_init %Dest2__carbon_thunk.call // CHECK:STDOUT: %.loc20_22.4: init %Dest2 = converted %s.ref, %.loc20_22.3 // CHECK:STDOUT: %.loc20_22.5: ref %Dest2 = temporary %.loc20_22.1, %.loc20_22.4 // CHECK:STDOUT: %.loc20_22.6: %Dest2 = acquire_value %.loc20_22.5 @@ -630,7 +630,7 @@ fn InitFromStruct() { // CHECK:STDOUT: %.loc15_21.1: ref %Dest = temporary_storage // CHECK:STDOUT: %addr: %ptr.551 = addr_of %.loc15_21.1 // CHECK:STDOUT: %Dest__carbon_thunk.call: init %empty_tuple.type = call imports.%Dest__carbon_thunk.decl(, %addr) -// CHECK:STDOUT: %.loc15_21.2: init %Dest to %.loc15_21.1 = in_place_init %Dest__carbon_thunk.call +// CHECK:STDOUT: %.loc15_21.2: init %Dest to %.loc15_21.1 = mark_in_place_init %Dest__carbon_thunk.call // CHECK:STDOUT: %.loc15_21.3: init %Dest = converted %s.ref, %.loc15_21.2 // CHECK:STDOUT: %.loc15_21.4: ref %Dest = temporary %.loc15_21.1, %.loc15_21.3 // CHECK:STDOUT: %.loc15_21.5: %Dest = acquire_value %.loc15_21.4 @@ -716,7 +716,7 @@ fn InitFromStruct() { // CHECK:STDOUT: %addr.loc16_40.1: %ptr.1fc = addr_of %.loc16_40.2 // CHECK:STDOUT: %addr.loc16_40.2: %ptr.12d = addr_of %.loc16_40.1 // CHECK:STDOUT: %InaccessibleConstructor__carbon_thunk.call: init %empty_tuple.type = call imports.%InaccessibleConstructor__carbon_thunk.decl(%addr.loc16_40.1, %addr.loc16_40.2) -// CHECK:STDOUT: %.loc16_40.3: init %InaccessibleConstructor to %.loc16_40.1 = in_place_init %InaccessibleConstructor__carbon_thunk.call +// CHECK:STDOUT: %.loc16_40.3: init %InaccessibleConstructor to %.loc16_40.1 = mark_in_place_init %InaccessibleConstructor__carbon_thunk.call // CHECK:STDOUT: %.loc16_40.4: init %InaccessibleConstructor = converted %s.ref, %.loc16_40.3 // CHECK:STDOUT: %.loc16_40.5: ref %InaccessibleConstructor = temporary %.loc16_40.1, %.loc16_40.4 // CHECK:STDOUT: %.loc16_40.6: %InaccessibleConstructor = acquire_value %.loc16_40.5 @@ -742,7 +742,7 @@ fn InitFromStruct() { // CHECK:STDOUT: %.loc30_21.1: ref %Dest = temporary_storage // CHECK:STDOUT: %addr: %ptr.551 = addr_of %.loc30_21.1 // CHECK:STDOUT: %Dest__carbon_thunk.call: init %empty_tuple.type = call imports.%Dest__carbon_thunk.decl(%s.ref, %addr) -// CHECK:STDOUT: %.loc30_21.2: init %Dest to %.loc30_21.1 = in_place_init %Dest__carbon_thunk.call +// CHECK:STDOUT: %.loc30_21.2: init %Dest to %.loc30_21.1 = mark_in_place_init %Dest__carbon_thunk.call // CHECK:STDOUT: %.loc30_21.3: init %Dest = converted %s.ref, %.loc30_21.2 // CHECK:STDOUT: %.loc30_21.4: ref %Dest = temporary %.loc30_21.1, %.loc30_21.3 // CHECK:STDOUT: %.loc30_21.5: %Dest = acquire_value %.loc30_21.4 @@ -905,7 +905,7 @@ fn InitFromStruct() { // CHECK:STDOUT: %.loc8_31.1: ref %IntConstructor.f49 = temporary_storage // CHECK:STDOUT: %addr: %ptr.d59 = addr_of %.loc8_31.1 // CHECK:STDOUT: %IntConstructor__carbon_thunk.call: init %empty_tuple.type = call imports.%IntConstructor__carbon_thunk.decl(%i.ref, %addr) -// CHECK:STDOUT: %.loc8_31.2: init %IntConstructor.f49 to %.loc8_31.1 = in_place_init %IntConstructor__carbon_thunk.call +// CHECK:STDOUT: %.loc8_31.2: init %IntConstructor.f49 to %.loc8_31.1 = mark_in_place_init %IntConstructor__carbon_thunk.call // CHECK:STDOUT: %.loc8_31.3: init %IntConstructor.f49 = converted %i.ref, %.loc8_31.2 // CHECK:STDOUT: %.loc8_31.4: ref %IntConstructor.f49 = temporary %.loc8_31.1, %.loc8_31.3 // CHECK:STDOUT: %.loc8_31.5: %IntConstructor.f49 = acquire_value %.loc8_31.4 @@ -960,7 +960,7 @@ fn InitFromStruct() { // CHECK:STDOUT: %.loc19_31.2: %i32 = converted %u.ref, [concrete = ] // CHECK:STDOUT: %addr: %ptr.d59 = addr_of %.loc19_31.1 // CHECK:STDOUT: %IntConstructor__carbon_thunk.call: init %empty_tuple.type = call imports.%IntConstructor__carbon_thunk.decl(, %addr) -// CHECK:STDOUT: %.loc19_31.3: init %IntConstructor to %.loc19_31.1 = in_place_init %IntConstructor__carbon_thunk.call +// CHECK:STDOUT: %.loc19_31.3: init %IntConstructor to %.loc19_31.1 = mark_in_place_init %IntConstructor__carbon_thunk.call // CHECK:STDOUT: %.loc19_31.4: init %IntConstructor = converted %u.ref, %.loc19_31.3 // CHECK:STDOUT: %.loc19_31.5: ref %IntConstructor = temporary %.loc19_31.1, %.loc19_31.4 // CHECK:STDOUT: %.loc19_31.6: %IntConstructor = acquire_value %.loc19_31.5 @@ -1015,7 +1015,7 @@ fn InitFromStruct() { // CHECK:STDOUT: %.loc9_36.2: ref %DefaultConstructor = temporary_storage // CHECK:STDOUT: %addr: %ptr.3f7 = addr_of %.loc9_36.2 // CHECK:STDOUT: %DefaultConstructor__carbon_thunk.call: init %empty_tuple.type = call imports.%DefaultConstructor__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %.loc9_36.3: init %DefaultConstructor to %.loc9_36.2 = in_place_init %DefaultConstructor__carbon_thunk.call +// CHECK:STDOUT: %.loc9_36.3: init %DefaultConstructor to %.loc9_36.2 = mark_in_place_init %DefaultConstructor__carbon_thunk.call // CHECK:STDOUT: %.loc9_36.4: init %DefaultConstructor = converted %.loc9_36.1, %.loc9_36.3 // CHECK:STDOUT: %.loc9_36.5: ref %DefaultConstructor = temporary %.loc9_36.2, %.loc9_36.4 // CHECK:STDOUT: %.loc9_36.6: %DefaultConstructor = acquire_value %.loc9_36.5 @@ -1150,7 +1150,7 @@ fn InitFromStruct() { // CHECK:STDOUT: %.loc8_24.2: %i32 = converted %int_2.loc8, %.loc8_24.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %addr.loc8: %ptr.677 = addr_of %.loc8_25.2 // CHECK:STDOUT: %Two__carbon_thunk.call: init %empty_tuple.type = call imports.%Two__carbon_thunk.decl(%.loc8_21.2, %.loc8_24.2, %addr.loc8) -// CHECK:STDOUT: %.loc8_25.3: init %Two to %.loc8_25.2 = in_place_init %Two__carbon_thunk.call +// CHECK:STDOUT: %.loc8_25.3: init %Two to %.loc8_25.2 = mark_in_place_init %Two__carbon_thunk.call // CHECK:STDOUT: %.loc8_25.4: init %Two = converted %.loc8_25.1, %.loc8_25.3 // CHECK:STDOUT: %.loc8_25.5: ref %Two = temporary %.loc8_25.2, %.loc8_25.4 // CHECK:STDOUT: %.loc8_25.6: %Two = acquire_value %.loc8_25.5 @@ -1182,7 +1182,7 @@ fn InitFromStruct() { // CHECK:STDOUT: %.loc10_37.2: %i32 = converted %int_2.loc10, %.loc10_37.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %addr.loc10: %ptr.ea4 = addr_of %.loc10_38.2 // CHECK:STDOUT: %ThreeWithDefault__carbon_thunk.call.loc10: init %empty_tuple.type = call imports.%ThreeWithDefault__carbon_thunk.decl.482856.1(%.loc10_34.2, %.loc10_37.2, %addr.loc10) -// CHECK:STDOUT: %.loc10_38.3: init %ThreeWithDefault to %.loc10_38.2 = in_place_init %ThreeWithDefault__carbon_thunk.call.loc10 +// CHECK:STDOUT: %.loc10_38.3: init %ThreeWithDefault to %.loc10_38.2 = mark_in_place_init %ThreeWithDefault__carbon_thunk.call.loc10 // CHECK:STDOUT: %.loc10_38.4: init %ThreeWithDefault = converted %.loc10_38.1, %.loc10_38.3 // CHECK:STDOUT: %.loc10_38.5: ref %ThreeWithDefault = temporary %.loc10_38.2, %.loc10_38.4 // CHECK:STDOUT: %.loc10_38.6: %ThreeWithDefault = acquire_value %.loc10_38.5 @@ -1222,7 +1222,7 @@ fn InitFromStruct() { // CHECK:STDOUT: %.loc12_40.2: %i32 = converted %int_3, %.loc12_40.1 [concrete = constants.%int_3.822] // CHECK:STDOUT: %addr.loc12: %ptr.ea4 = addr_of %.loc12_41.2 // CHECK:STDOUT: %ThreeWithDefault__carbon_thunk.call.loc12: init %empty_tuple.type = call imports.%ThreeWithDefault__carbon_thunk.decl.482856.2(%.loc12_34.2, %.loc12_37.2, %.loc12_40.2, %addr.loc12) -// CHECK:STDOUT: %.loc12_41.3: init %ThreeWithDefault to %.loc12_41.2 = in_place_init %ThreeWithDefault__carbon_thunk.call.loc12 +// CHECK:STDOUT: %.loc12_41.3: init %ThreeWithDefault to %.loc12_41.2 = mark_in_place_init %ThreeWithDefault__carbon_thunk.call.loc12 // CHECK:STDOUT: %.loc12_41.4: init %ThreeWithDefault = converted %.loc12_41.1, %.loc12_41.3 // CHECK:STDOUT: %.loc12_41.5: ref %ThreeWithDefault = temporary %.loc12_41.2, %.loc12_41.4 // CHECK:STDOUT: %.loc12_41.6: %ThreeWithDefault = acquire_value %.loc12_41.5 @@ -1443,7 +1443,7 @@ fn InitFromStruct() { // CHECK:STDOUT: %.loc8_30.2: ref %NonAggregate = temporary_storage // CHECK:STDOUT: %addr.loc8: %ptr.9b6 = addr_of %.loc8_30.2 // CHECK:STDOUT: %NonAggregate__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%NonAggregate__carbon_thunk.decl.712b28.1(%addr.loc8) -// CHECK:STDOUT: %.loc8_30.3: init %NonAggregate to %.loc8_30.2 = in_place_init %NonAggregate__carbon_thunk.call.loc8 +// CHECK:STDOUT: %.loc8_30.3: init %NonAggregate to %.loc8_30.2 = mark_in_place_init %NonAggregate__carbon_thunk.call.loc8 // CHECK:STDOUT: %.loc8_30.4: init %NonAggregate = converted %.loc8_30.1, %.loc8_30.3 // CHECK:STDOUT: %.loc8_30.5: ref %NonAggregate = temporary %.loc8_30.2, %.loc8_30.4 // CHECK:STDOUT: %.loc8_30.6: %NonAggregate = acquire_value %.loc8_30.5 @@ -1467,7 +1467,7 @@ fn InitFromStruct() { // CHECK:STDOUT: %.loc9_30.2: %i32 = converted %int_1.loc9, %.loc9_30.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %addr.loc9: %ptr.9b6 = addr_of %.loc9_32.2 // CHECK:STDOUT: %NonAggregate__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%NonAggregate__carbon_thunk.decl.712b28.2(%.loc9_30.2, %addr.loc9) -// CHECK:STDOUT: %.loc9_32.3: init %NonAggregate to %.loc9_32.2 = in_place_init %NonAggregate__carbon_thunk.call.loc9 +// CHECK:STDOUT: %.loc9_32.3: init %NonAggregate to %.loc9_32.2 = mark_in_place_init %NonAggregate__carbon_thunk.call.loc9 // CHECK:STDOUT: %.loc9_32.4: init %NonAggregate = converted %.loc9_32.1, %.loc9_32.3 // CHECK:STDOUT: %.loc9_32.5: ref %NonAggregate = temporary %.loc9_32.2, %.loc9_32.4 // CHECK:STDOUT: %.loc9_32.6: %NonAggregate = acquire_value %.loc9_32.5 @@ -1499,7 +1499,7 @@ fn InitFromStruct() { // CHECK:STDOUT: %.loc10_33.2: %i32 = converted %int_2, %.loc10_33.1 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %addr.loc10: %ptr.9b6 = addr_of %.loc10_34.2 // CHECK:STDOUT: %NonAggregate__carbon_thunk.call.loc10: init %empty_tuple.type = call imports.%NonAggregate__carbon_thunk.decl.712b28.3(%.loc10_30.2, %.loc10_33.2, %addr.loc10) -// CHECK:STDOUT: %.loc10_34.3: init %NonAggregate to %.loc10_34.2 = in_place_init %NonAggregate__carbon_thunk.call.loc10 +// CHECK:STDOUT: %.loc10_34.3: init %NonAggregate to %.loc10_34.2 = mark_in_place_init %NonAggregate__carbon_thunk.call.loc10 // CHECK:STDOUT: %.loc10_34.4: init %NonAggregate = converted %.loc10_34.1, %.loc10_34.3 // CHECK:STDOUT: %.loc10_34.5: ref %NonAggregate = temporary %.loc10_34.2, %.loc10_34.4 // CHECK:STDOUT: %.loc10_34.6: %NonAggregate = acquire_value %.loc10_34.5 diff --git a/toolchain/check/testdata/interop/cpp/macros.carbon b/toolchain/check/testdata/interop/cpp/macros.carbon index 2b26a7109577..e18dbe77d4b0 100644 --- a/toolchain/check/testdata/interop/cpp/macros.carbon +++ b/toolchain/check/testdata/interop/cpp/macros.carbon @@ -1045,7 +1045,7 @@ fn F() { // CHECK:STDOUT: %.loc10_35.2: init %f32.97e = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.e3b] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc10_35.3: ref %f32.97e = array_index %a.var, %int_0 -// CHECK:STDOUT: %.loc10_35.4: init %f32.97e to %.loc10_35.3 = initialize_from %.loc10_35.2 [concrete = constants.%float.e3b] +// CHECK:STDOUT: %.loc10_35.4: init %f32.97e to %.loc10_35.3 = in_place_init %.loc10_35.2 [concrete = constants.%float.e3b] // CHECK:STDOUT: %.loc10_35.5: init %array_type to %a.var = array_init (%.loc10_35.4) [concrete = constants.%array] // CHECK:STDOUT: %.loc10_3: init %array_type = converted %.loc10_35.1, %.loc10_35.5 [concrete = constants.%array] // CHECK:STDOUT: assign %a.var, %.loc10_3 diff --git a/toolchain/check/testdata/interop/cpp/namespace.carbon b/toolchain/check/testdata/interop/cpp/namespace.carbon index d41f0e669d7c..d93aad822743 100644 --- a/toolchain/check/testdata/interop/cpp/namespace.carbon +++ b/toolchain/check/testdata/interop/cpp/namespace.carbon @@ -396,7 +396,7 @@ fn Use(y: Cpp.Y) -> i32 { // CHECK:STDOUT: %.loc8_11.1: ref %X = temporary_storage // CHECK:STDOUT: %addr: %ptr.13d = addr_of %.loc8_11.1 // CHECK:STDOUT: %foo__carbon_thunk.call: init %empty_tuple.type = call imports.%foo__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %.loc8_11.2: init %X to %.loc8_11.1 = in_place_init %foo__carbon_thunk.call +// CHECK:STDOUT: %.loc8_11.2: init %X to %.loc8_11.1 = mark_in_place_init %foo__carbon_thunk.call // CHECK:STDOUT: %.loc8_11.3: ref %X = temporary %.loc8_11.1, %.loc8_11.2 // CHECK:STDOUT: %X.cpp_destructor.bound: = bound_method %.loc8_11.3, constants.%X.cpp_destructor // CHECK:STDOUT: %X.cpp_destructor.call: init %empty_tuple.type = call %X.cpp_destructor.bound(%.loc8_11.3) diff --git a/toolchain/check/testdata/interop/cpp/stdlib/initializer_list.carbon b/toolchain/check/testdata/interop/cpp/stdlib/initializer_list.carbon index 694422385f43..3351f33754eb 100644 --- a/toolchain/check/testdata/interop/cpp/stdlib/initializer_list.carbon +++ b/toolchain/check/testdata/interop/cpp/stdlib/initializer_list.carbon @@ -206,7 +206,7 @@ fn F() { // CHECK:STDOUT: %.loc8_50.4: ref %array_type = temporary_storage // CHECK:STDOUT: %int_0.loc8: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc8_50.5: ref %i32 = array_index %.loc8_50.4, %int_0.loc8 -// CHECK:STDOUT: %.loc8_50.6: init %i32 to %.loc8_50.5 = initialize_from %.loc8_50.3 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc8_50.6: init %i32 to %.loc8_50.5 = in_place_init %.loc8_50.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc8_50.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc8_50.3: = bound_method %int_2.loc8_46, %impl.elem0.loc8_50.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc8_50.2: = specific_function %impl.elem0.loc8_50.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -215,7 +215,7 @@ fn F() { // CHECK:STDOUT: %.loc8_50.7: init %i32 = converted %int_2.loc8_46, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_50.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc8_50: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc8_50.8: ref %i32 = array_index %.loc8_50.4, %int_1.loc8_50 -// CHECK:STDOUT: %.loc8_50.9: init %i32 to %.loc8_50.8 = initialize_from %.loc8_50.7 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc8_50.9: init %i32 to %.loc8_50.8 = in_place_init %.loc8_50.7 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc8_50.3: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc8_50.5: = bound_method %int_3.loc8_49, %impl.elem0.loc8_50.3 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] // CHECK:STDOUT: %specific_fn.loc8_50.3: = specific_function %impl.elem0.loc8_50.3, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -224,7 +224,7 @@ fn F() { // CHECK:STDOUT: %.loc8_50.10: init %i32 = converted %int_3.loc8_49, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc8_50.3 [concrete = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc8_50: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc8_50.11: ref %i32 = array_index %.loc8_50.4, %int_2.loc8_50 -// CHECK:STDOUT: %.loc8_50.12: init %i32 to %.loc8_50.11 = initialize_from %.loc8_50.10 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc8_50.12: init %i32 to %.loc8_50.11 = in_place_init %.loc8_50.10 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc8_50.13: init %array_type to %.loc8_50.4 = array_init (%.loc8_50.6, %.loc8_50.9, %.loc8_50.12) [concrete = constants.%array] // CHECK:STDOUT: %.loc8_50.14: init %array_type = converted %.loc8_50.1, %.loc8_50.13 [concrete = constants.%array] // CHECK:STDOUT: %.loc8_50.15: ref %array_type = temporary %.loc8_50.4, %.loc8_50.14 @@ -253,7 +253,7 @@ fn F() { // CHECK:STDOUT: %.loc10_23.4: ref %array_type = temporary_storage // CHECK:STDOUT: %int_0.loc10: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc10_23.5: ref %i32 = array_index %.loc10_23.4, %int_0.loc10 -// CHECK:STDOUT: %.loc10_23.6: init %i32 to %.loc10_23.5 = initialize_from %.loc10_23.3 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc10_23.6: init %i32 to %.loc10_23.5 = in_place_init %.loc10_23.3 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc10_23.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc10_23.3: = bound_method %int_2.loc10_19, %impl.elem0.loc10_23.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc10_23.2: = specific_function %impl.elem0.loc10_23.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -262,7 +262,7 @@ fn F() { // CHECK:STDOUT: %.loc10_23.7: init %i32 = converted %int_2.loc10_19, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_23.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc10_23: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc10_23.8: ref %i32 = array_index %.loc10_23.4, %int_1.loc10_23 -// CHECK:STDOUT: %.loc10_23.9: init %i32 to %.loc10_23.8 = initialize_from %.loc10_23.7 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc10_23.9: init %i32 to %.loc10_23.8 = in_place_init %.loc10_23.7 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc10_23.3: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc10_23.5: = bound_method %int_3.loc10_22, %impl.elem0.loc10_23.3 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] // CHECK:STDOUT: %specific_fn.loc10_23.3: = specific_function %impl.elem0.loc10_23.3, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -271,7 +271,7 @@ fn F() { // CHECK:STDOUT: %.loc10_23.10: init %i32 = converted %int_3.loc10_22, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc10_23.3 [concrete = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc10_23: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc10_23.11: ref %i32 = array_index %.loc10_23.4, %int_2.loc10_23 -// CHECK:STDOUT: %.loc10_23.12: init %i32 to %.loc10_23.11 = initialize_from %.loc10_23.10 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc10_23.12: init %i32 to %.loc10_23.11 = in_place_init %.loc10_23.10 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc10_23.13: init %array_type to %.loc10_23.4 = array_init (%.loc10_23.6, %.loc10_23.9, %.loc10_23.12) [concrete = constants.%array] // CHECK:STDOUT: %.loc10_23.14: init %array_type = converted %.loc10_23.1, %.loc10_23.13 [concrete = constants.%array] // CHECK:STDOUT: %.loc10_23.15: ref %array_type = temporary %.loc10_23.4, %.loc10_23.14 @@ -308,7 +308,7 @@ fn F() { // CHECK:STDOUT: %.loc12_44.5: ref %array_type = temporary_storage // CHECK:STDOUT: %int_0.loc12: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] // CHECK:STDOUT: %.loc12_44.6: ref %i32 = array_index %.loc12_44.5, %int_0.loc12 -// CHECK:STDOUT: %.loc12_44.7: init %i32 to %.loc12_44.6 = initialize_from %.loc12_44.4 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc12_44.7: init %i32 to %.loc12_44.6 = in_place_init %.loc12_44.4 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc12_44.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc12_44.3: = bound_method %int_2.loc12_40, %impl.elem0.loc12_44.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc12_44.2: = specific_function %impl.elem0.loc12_44.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -317,7 +317,7 @@ fn F() { // CHECK:STDOUT: %.loc12_44.8: init %i32 = converted %int_2.loc12_40, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc12_44.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %int_1.loc12_44: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] // CHECK:STDOUT: %.loc12_44.9: ref %i32 = array_index %.loc12_44.5, %int_1.loc12_44 -// CHECK:STDOUT: %.loc12_44.10: init %i32 to %.loc12_44.9 = initialize_from %.loc12_44.8 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc12_44.10: init %i32 to %.loc12_44.9 = in_place_init %.loc12_44.8 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %impl.elem0.loc12_44.3: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc12_44.5: = bound_method %int_3.loc12_43, %impl.elem0.loc12_44.3 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.061] // CHECK:STDOUT: %specific_fn.loc12_44.3: = specific_function %impl.elem0.loc12_44.3, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -326,7 +326,7 @@ fn F() { // CHECK:STDOUT: %.loc12_44.11: init %i32 = converted %int_3.loc12_43, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc12_44.3 [concrete = constants.%int_3.822] // CHECK:STDOUT: %int_2.loc12_44: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] // CHECK:STDOUT: %.loc12_44.12: ref %i32 = array_index %.loc12_44.5, %int_2.loc12_44 -// CHECK:STDOUT: %.loc12_44.13: init %i32 to %.loc12_44.12 = initialize_from %.loc12_44.11 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc12_44.13: init %i32 to %.loc12_44.12 = in_place_init %.loc12_44.11 [concrete = constants.%int_3.822] // CHECK:STDOUT: %.loc12_44.14: init %array_type to %.loc12_44.5 = array_init (%.loc12_44.7, %.loc12_44.10, %.loc12_44.13) [concrete = constants.%array] // CHECK:STDOUT: %.loc12_44.15: init %array_type = converted %.loc12_44.1, %.loc12_44.14 [concrete = constants.%array] // CHECK:STDOUT: %.loc12_44.16: ref %array_type = temporary %.loc12_44.5, %.loc12_44.15 @@ -339,7 +339,7 @@ fn F() { // CHECK:STDOUT: %addr.loc12_44.1: %ptr.82f = addr_of %.loc12_44.21 // CHECK:STDOUT: %addr.loc12_44.2: %ptr.79d = addr_of %.loc12_44.2 // CHECK:STDOUT: %InitListConstructor__carbon_thunk.call: init %empty_tuple.type = call imports.%InitListConstructor__carbon_thunk.decl(%addr.loc12_44.1, %addr.loc12_44.2) -// CHECK:STDOUT: %.loc12_44.22: init %InitListConstructor to %.loc12_44.2 = in_place_init %InitListConstructor__carbon_thunk.call +// CHECK:STDOUT: %.loc12_44.22: init %InitListConstructor to %.loc12_44.2 = mark_in_place_init %InitListConstructor__carbon_thunk.call // CHECK:STDOUT: %.loc12_44.23: init %InitListConstructor = converted %.loc12_44.1, %.loc12_44.22 // CHECK:STDOUT: %.loc12_44.24: ref %InitListConstructor = temporary %.loc12_44.2, %.loc12_44.23 // CHECK:STDOUT: %.loc12_44.25: %InitListConstructor = acquire_value %.loc12_44.24 diff --git a/toolchain/check/testdata/interop/cpp/stdlib/string_view.carbon b/toolchain/check/testdata/interop/cpp/stdlib/string_view.carbon index d43c14faeb89..d6513da96191 100644 --- a/toolchain/check/testdata/interop/cpp/stdlib/string_view.carbon +++ b/toolchain/check/testdata/interop/cpp/stdlib/string_view.carbon @@ -154,7 +154,7 @@ fn StarstWith(a: str, b: str) -> bool { // CHECK:STDOUT: %.loc13_11.1: ref %str.ee0 = splice_block %return.param {} // CHECK:STDOUT: %addr: %ptr.85f = addr_of %.loc13_11.1 // CHECK:STDOUT: %Produce__carbon_thunk.call: init %empty_tuple.type = call imports.%Produce__carbon_thunk.decl(%addr) -// CHECK:STDOUT: %.loc14: init %str.ee0 to %.loc13_11.1 = in_place_init %Produce__carbon_thunk.call +// CHECK:STDOUT: %.loc14: init %str.ee0 to %.loc13_11.1 = mark_in_place_init %Produce__carbon_thunk.call // CHECK:STDOUT: return %.loc14 to %return.param // CHECK:STDOUT: } // CHECK:STDOUT: @@ -228,7 +228,7 @@ fn StarstWith(a: str, b: str) -> bool { // CHECK:STDOUT: %.loc8_53.1: ref bool = temporary_storage // CHECK:STDOUT: %addr.loc8_53.2: %ptr.bb2 = addr_of %.loc8_53.1 // CHECK:STDOUT: %starts_with__carbon_thunk.call: init %empty_tuple.type = call imports.%starts_with__carbon_thunk.decl(%a.ref, %addr.loc8_53.1, %addr.loc8_53.2) -// CHECK:STDOUT: %.loc8_53.2: init bool = in_place_init %starts_with__carbon_thunk.call, %.loc8_53.1 +// CHECK:STDOUT: %.loc8_53.2: init bool to %.loc8_53.1 = mark_in_place_init %starts_with__carbon_thunk.call // CHECK:STDOUT: return %.loc8_53.2 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interop/cpp/template/alias_template.carbon b/toolchain/check/testdata/interop/cpp/template/alias_template.carbon index aa529fb750a8..d1aaeaa61e68 100644 --- a/toolchain/check/testdata/interop/cpp/template/alias_template.carbon +++ b/toolchain/check/testdata/interop/cpp/template/alias_template.carbon @@ -116,7 +116,7 @@ var a2: Cpp.Second(Cpp.B, Cpp.A) = Cpp.A.A(); // CHECK:STDOUT: %.loc7_1: ref %A = splice_block file.%a1.var [concrete = file.%a1.var] {} // CHECK:STDOUT: %addr.loc7: %ptr.270 = addr_of %.loc7_1 // CHECK:STDOUT: %A__carbon_thunk.call.loc7: init %empty_tuple.type = call imports.%A__carbon_thunk.decl(%addr.loc7) -// CHECK:STDOUT: %.loc7_43: init %A to %.loc7_1 = in_place_init %A__carbon_thunk.call.loc7 +// CHECK:STDOUT: %.loc7_43: init %A to %.loc7_1 = mark_in_place_init %A__carbon_thunk.call.loc7 // CHECK:STDOUT: assign file.%a1.var, %.loc7_43 // CHECK:STDOUT: %Cpp.ref.loc8: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %B.ref.loc8_38: type = name_ref B, imports.%B.decl [concrete = constants.%B] @@ -124,7 +124,7 @@ var a2: Cpp.Second(Cpp.B, Cpp.A) = Cpp.A.A(); // CHECK:STDOUT: %.loc8_1: ref %B = splice_block file.%b1.var [concrete = file.%b1.var] {} // CHECK:STDOUT: %addr.loc8: %ptr.a04 = addr_of %.loc8_1 // CHECK:STDOUT: %B__carbon_thunk.call.loc8: init %empty_tuple.type = call imports.%B__carbon_thunk.decl(%addr.loc8) -// CHECK:STDOUT: %.loc8_43: init %B to %.loc8_1 = in_place_init %B__carbon_thunk.call.loc8 +// CHECK:STDOUT: %.loc8_43: init %B to %.loc8_1 = mark_in_place_init %B__carbon_thunk.call.loc8 // CHECK:STDOUT: assign file.%b1.var, %.loc8_43 // CHECK:STDOUT: %Cpp.ref.loc9: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %B.ref.loc9_39: type = name_ref B, imports.%B.decl [concrete = constants.%B] @@ -132,7 +132,7 @@ var a2: Cpp.Second(Cpp.B, Cpp.A) = Cpp.A.A(); // CHECK:STDOUT: %.loc9_1: ref %B = splice_block file.%b2.var [concrete = file.%b2.var] {} // CHECK:STDOUT: %addr.loc9: %ptr.a04 = addr_of %.loc9_1 // CHECK:STDOUT: %B__carbon_thunk.call.loc9: init %empty_tuple.type = call imports.%B__carbon_thunk.decl(%addr.loc9) -// CHECK:STDOUT: %.loc9_44: init %B to %.loc9_1 = in_place_init %B__carbon_thunk.call.loc9 +// CHECK:STDOUT: %.loc9_44: init %B to %.loc9_1 = mark_in_place_init %B__carbon_thunk.call.loc9 // CHECK:STDOUT: assign file.%b2.var, %.loc9_44 // CHECK:STDOUT: %Cpp.ref.loc10: = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp] // CHECK:STDOUT: %A.ref.loc10_39: type = name_ref A, imports.%A.decl [concrete = constants.%A] @@ -140,7 +140,7 @@ var a2: Cpp.Second(Cpp.B, Cpp.A) = Cpp.A.A(); // CHECK:STDOUT: %.loc10_1: ref %A = splice_block file.%a2.var [concrete = file.%a2.var] {} // CHECK:STDOUT: %addr.loc10: %ptr.270 = addr_of %.loc10_1 // CHECK:STDOUT: %A__carbon_thunk.call.loc10: init %empty_tuple.type = call imports.%A__carbon_thunk.decl(%addr.loc10) -// CHECK:STDOUT: %.loc10_44: init %A to %.loc10_1 = in_place_init %A__carbon_thunk.call.loc10 +// CHECK:STDOUT: %.loc10_44: init %A to %.loc10_1 = mark_in_place_init %A__carbon_thunk.call.loc10 // CHECK:STDOUT: assign file.%a2.var, %.loc10_44 // CHECK:STDOUT: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/interop/cpp/template/class_template.carbon b/toolchain/check/testdata/interop/cpp/template/class_template.carbon index b907c4b87177..7edfd967409a 100644 --- a/toolchain/check/testdata/interop/cpp/template/class_template.carbon +++ b/toolchain/check/testdata/interop/cpp/template/class_template.carbon @@ -103,7 +103,7 @@ var a: Cpp.A = Cpp.X(Cpp.A, Cpp.B).f({} as Cpp.B); // CHECK:STDOUT: %addr.loc7_49.1: %ptr.a04 = addr_of %.loc7_41.3 // CHECK:STDOUT: %addr.loc7_49.2: %ptr.270 = addr_of %.loc7_1 // CHECK:STDOUT: %f__carbon_thunk.call: init %empty_tuple.type = call imports.%f__carbon_thunk.decl(%addr.loc7_49.1, %addr.loc7_49.2) -// CHECK:STDOUT: %.loc7_49: init %A to %.loc7_1 = in_place_init %f__carbon_thunk.call +// CHECK:STDOUT: %.loc7_49: init %A to %.loc7_1 = mark_in_place_init %f__carbon_thunk.call // CHECK:STDOUT: assign file.%a.var, %.loc7_49 // CHECK:STDOUT: // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/operators/builtin/assignment.carbon b/toolchain/check/testdata/operators/builtin/assignment.carbon index 4f3460511bcc..6f8acb2a8176 100644 --- a/toolchain/check/testdata/operators/builtin/assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/assignment.carbon @@ -196,7 +196,7 @@ fn Main() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc19_28.1: init %i32 = call %bound_method.loc19_28.2(%int_1.loc19) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc19_28.2: init %i32 = converted %int_1.loc19, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc19_28.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple.elem0.loc19: ref %i32 = tuple_access %b.var, element0 -// CHECK:STDOUT: %.loc19_28.3: init %i32 to %tuple.elem0.loc19 = initialize_from %.loc19_28.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc19_28.3: init %i32 to %tuple.elem0.loc19 = in_place_init %.loc19_28.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc19_28.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc19_28.3: = bound_method %int_2.loc19, %impl.elem0.loc19_28.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc19_28.2: = specific_function %impl.elem0.loc19_28.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -204,7 +204,7 @@ fn Main() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc19_28.2: init %i32 = call %bound_method.loc19_28.4(%int_2.loc19) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc19_28.4: init %i32 = converted %int_2.loc19, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc19_28.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem1.loc19: ref %i32 = tuple_access %b.var, element1 -// CHECK:STDOUT: %.loc19_28.5: init %i32 to %tuple.elem1.loc19 = initialize_from %.loc19_28.4 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc19_28.5: init %i32 to %tuple.elem1.loc19 = in_place_init %.loc19_28.4 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc19_28.6: init %tuple.type.d07 to %b.var = tuple_init (%.loc19_28.3, %.loc19_28.5) [concrete = constants.%tuple.21c] // CHECK:STDOUT: %.loc19_3: init %tuple.type.d07 = converted %.loc19_28.1, %.loc19_28.6 [concrete = constants.%tuple.21c] // CHECK:STDOUT: assign %b.var, %.loc19_3 @@ -254,7 +254,7 @@ fn Main() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23_46.1: init %i32 = call %bound_method.loc23_46.2(%int_1.loc23) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc23_46.2: init %i32 = converted %int_1.loc23, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23_46.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc23_46.3: ref %i32 = struct_access %c.var, element0 -// CHECK:STDOUT: %.loc23_46.4: init %i32 to %.loc23_46.3 = initialize_from %.loc23_46.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc23_46.4: init %i32 to %.loc23_46.3 = in_place_init %.loc23_46.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc23_46.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc23_46.3: = bound_method %int_2.loc23, %impl.elem0.loc23_46.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc23_46.2: = specific_function %impl.elem0.loc23_46.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -262,7 +262,7 @@ fn Main() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23_46.2: init %i32 = call %bound_method.loc23_46.4(%int_2.loc23) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc23_46.5: init %i32 = converted %int_2.loc23, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23_46.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc23_46.6: ref %i32 = struct_access %c.var, element1 -// CHECK:STDOUT: %.loc23_46.7: init %i32 to %.loc23_46.6 = initialize_from %.loc23_46.5 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc23_46.7: init %i32 to %.loc23_46.6 = in_place_init %.loc23_46.5 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc23_46.8: init %struct_type.a.b.501 to %c.var = struct_init (%.loc23_46.4, %.loc23_46.7) [concrete = constants.%struct.ed5] // CHECK:STDOUT: %.loc23_3: init %struct_type.a.b.501 = converted %.loc23_46.1, %.loc23_46.8 [concrete = constants.%struct.ed5] // CHECK:STDOUT: assign %c.var, %.loc23_3 diff --git a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon index 774f483fb292..a30f6b881859 100644 --- a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon @@ -211,12 +211,12 @@ fn Main() { // CHECK:STDOUT: %bound_method.loc32_13: = bound_method %int_3.loc32, %impl.elem0.loc32_13 [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op.bound.04c] // CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op.call.loc32_13: init Core.IntLiteral = call %bound_method.loc32_13(%int_3.loc32) [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %tuple.elem0.loc32: Core.IntLiteral = tuple_access %.loc32_8.1, element0 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc32_17.2: init Core.IntLiteral to %tuple.elem0.loc32 = initialize_from %Core.IntLiteral.as.Copy.impl.Op.call.loc32_13 [concrete = constants.%int_3.1ba] +// CHECK:STDOUT: %.loc32_17.2: init Core.IntLiteral to %tuple.elem0.loc32 = in_place_init %Core.IntLiteral.as.Copy.impl.Op.call.loc32_13 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %impl.elem0.loc32_16: %.6b5 = impl_witness_access constants.%Copy.impl_witness.98e, element0 [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op] // CHECK:STDOUT: %bound_method.loc32_16: = bound_method %int_4.loc32, %impl.elem0.loc32_16 [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op.bound.e8e] // CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op.call.loc32_16: init Core.IntLiteral = call %bound_method.loc32_16(%int_4.loc32) [concrete = constants.%int_4] // CHECK:STDOUT: %tuple.elem1.loc32: Core.IntLiteral = tuple_access %.loc32_8.1, element1 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %.loc32_17.3: init Core.IntLiteral to %tuple.elem1.loc32 = initialize_from %Core.IntLiteral.as.Copy.impl.Op.call.loc32_16 [concrete = constants.%int_4] +// CHECK:STDOUT: %.loc32_17.3: init Core.IntLiteral to %tuple.elem1.loc32 = in_place_init %Core.IntLiteral.as.Copy.impl.Op.call.loc32_16 [concrete = constants.%int_4] // CHECK:STDOUT: %.loc32_17.4: init %tuple.type.f94 to %.loc32_8.1 = tuple_init (%.loc32_17.2, %.loc32_17.3) [concrete = constants.%tuple.302] // CHECK:STDOUT: %.loc32_10: init %tuple.type.f94 = converted %.loc32_17.1, %.loc32_17.4 [concrete = constants.%tuple.302] // CHECK:STDOUT: assign %.loc32_8.1, %.loc32_10 @@ -253,7 +253,7 @@ fn Main() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc38_17.1: init %i32 = call %bound_method.loc38_17.2(%int_1.loc38) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc38_17.2: init %i32 = converted %int_1.loc38, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc38_17.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple.elem0.loc38: %i32 = tuple_access %.loc38_8.1, element0 -// CHECK:STDOUT: %.loc38_17.3: init %i32 to %tuple.elem0.loc38 = initialize_from %.loc38_17.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc38_17.3: init %i32 to %tuple.elem0.loc38 = in_place_init %.loc38_17.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc38_17.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc38_17.3: = bound_method %int_2.loc38, %impl.elem0.loc38_17.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc38_17.2: = specific_function %impl.elem0.loc38_17.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -261,7 +261,7 @@ fn Main() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc38_17.2: init %i32 = call %bound_method.loc38_17.4(%int_2.loc38) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc38_17.4: init %i32 = converted %int_2.loc38, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc38_17.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem1.loc38: %i32 = tuple_access %.loc38_8.1, element1 -// CHECK:STDOUT: %.loc38_17.5: init %i32 to %tuple.elem1.loc38 = initialize_from %.loc38_17.4 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc38_17.5: init %i32 to %tuple.elem1.loc38 = in_place_init %.loc38_17.4 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc38_17.6: init %tuple.type.d07 to %.loc38_8.1 = tuple_init (%.loc38_17.3, %.loc38_17.5) [concrete = constants.%tuple.21c] // CHECK:STDOUT: %.loc38_10: init %tuple.type.d07 = converted %.loc38_17.1, %.loc38_17.6 [concrete = constants.%tuple.21c] // CHECK:STDOUT: assign %.loc38_8.1, %.loc38_10 @@ -288,12 +288,12 @@ fn Main() { // CHECK:STDOUT: %bound_method.loc48_28: = bound_method %int_3.loc48, %impl.elem0.loc48_28 [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op.bound.04c] // CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op.call.loc48_28: init Core.IntLiteral = call %bound_method.loc48_28(%int_3.loc48) [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %.loc48_37.2: Core.IntLiteral = struct_access %.loc48_18.1, element0 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc48_37.3: init Core.IntLiteral to %.loc48_37.2 = initialize_from %Core.IntLiteral.as.Copy.impl.Op.call.loc48_28 [concrete = constants.%int_3.1ba] +// CHECK:STDOUT: %.loc48_37.3: init Core.IntLiteral to %.loc48_37.2 = in_place_init %Core.IntLiteral.as.Copy.impl.Op.call.loc48_28 [concrete = constants.%int_3.1ba] // CHECK:STDOUT: %impl.elem0.loc48_36: %.6b5 = impl_witness_access constants.%Copy.impl_witness.98e, element0 [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op] // CHECK:STDOUT: %bound_method.loc48_36: = bound_method %int_4.loc48, %impl.elem0.loc48_36 [concrete = constants.%Core.IntLiteral.as.Copy.impl.Op.bound.e8e] // CHECK:STDOUT: %Core.IntLiteral.as.Copy.impl.Op.call.loc48_36: init Core.IntLiteral = call %bound_method.loc48_36(%int_4.loc48) [concrete = constants.%int_4] // CHECK:STDOUT: %.loc48_37.4: Core.IntLiteral = struct_access %.loc48_18.1, element1 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %.loc48_37.5: init Core.IntLiteral to %.loc48_37.4 = initialize_from %Core.IntLiteral.as.Copy.impl.Op.call.loc48_36 [concrete = constants.%int_4] +// CHECK:STDOUT: %.loc48_37.5: init Core.IntLiteral to %.loc48_37.4 = in_place_init %Core.IntLiteral.as.Copy.impl.Op.call.loc48_36 [concrete = constants.%int_4] // CHECK:STDOUT: %.loc48_37.6: init %struct_type.x.y to %.loc48_18.1 = struct_init (%.loc48_37.3, %.loc48_37.5) [concrete = constants.%struct.a0d] // CHECK:STDOUT: %.loc48_20: init %struct_type.x.y = converted %.loc48_37.1, %.loc48_37.6 [concrete = constants.%struct.a0d] // CHECK:STDOUT: assign %.loc48_18.1, %.loc48_20 diff --git a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon index 3a2eeca14b87..eecfa88fc973 100644 --- a/toolchain/check/testdata/operators/overloaded/implicit_as.carbon +++ b/toolchain/check/testdata/operators/overloaded/implicit_as.carbon @@ -257,7 +257,7 @@ fn Test() { // CHECK:STDOUT: %bound_method.loc20_47.2: = bound_method %self.ref, %specific_fn // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc20_47.2(%self.ref) // CHECK:STDOUT: %.loc20_51.2: ref %i32 = class_element_access %return.param, element0 -// CHECK:STDOUT: %.loc20_51.3: init %i32 to %.loc20_51.2 = initialize_from %Int.as.Copy.impl.Op.call +// CHECK:STDOUT: %.loc20_51.3: init %i32 to %.loc20_51.2 = in_place_init %Int.as.Copy.impl.Op.call // CHECK:STDOUT: %.loc20_51.4: init %X to %return.param = class_init (%.loc20_51.3) // CHECK:STDOUT: %.loc20_52: init %X = converted %.loc20_51.1, %.loc20_51.4 // CHECK:STDOUT: return %.loc20_52 to %return.param diff --git a/toolchain/check/testdata/packages/cross_package_export.carbon b/toolchain/check/testdata/packages/cross_package_export.carbon index ea10be68231f..eb0563981852 100644 --- a/toolchain/check/testdata/packages/cross_package_export.carbon +++ b/toolchain/check/testdata/packages/cross_package_export.carbon @@ -437,7 +437,7 @@ alias C = Other.C; // CHECK:STDOUT: %.loc6_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_26.1: %struct_type.x = struct_literal (%.loc6_25.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc6_26.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.dd7] -// CHECK:STDOUT: %.loc6_25.2: init %empty_tuple.type to %.loc6_26.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc6_25.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_26.3: init %empty_tuple.type = converted %.loc6_25.1, %.loc6_25.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_26.4: init %C to file.%c.var = class_init (%.loc6_26.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc6_1: init %C = converted %.loc6_26.1, %.loc6_26.4 [concrete = constants.%C.val] @@ -503,7 +503,7 @@ alias C = Other.C; // CHECK:STDOUT: %.loc7_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_26.1: %struct_type.x = struct_literal (%.loc7_25.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc7_26.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.dd7] -// CHECK:STDOUT: %.loc7_25.2: init %empty_tuple.type to %.loc7_26.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc7_25.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_26.3: init %empty_tuple.type = converted %.loc7_25.1, %.loc7_25.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_26.4: init %C to file.%c.var = class_init (%.loc7_26.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc7_1: init %C = converted %.loc7_26.1, %.loc7_26.4 [concrete = constants.%C.val] @@ -569,7 +569,7 @@ alias C = Other.C; // CHECK:STDOUT: %.loc6_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_26.1: %struct_type.x = struct_literal (%.loc6_25.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc6_26.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.dd7] -// CHECK:STDOUT: %.loc6_25.2: init %empty_tuple.type to %.loc6_26.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc6_25.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_26.3: init %empty_tuple.type = converted %.loc6_25.1, %.loc6_25.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_26.4: init %C to file.%c.var = class_init (%.loc6_26.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc6_1: init %C = converted %.loc6_26.1, %.loc6_26.4 [concrete = constants.%C.val] @@ -633,7 +633,7 @@ alias C = Other.C; // CHECK:STDOUT: %.loc6_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_26.1: %struct_type.x = struct_literal (%.loc6_25.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc6_26.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.dd7] -// CHECK:STDOUT: %.loc6_25.2: init %empty_tuple.type to %.loc6_26.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc6_25.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_26.3: init %empty_tuple.type = converted %.loc6_25.1, %.loc6_25.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_26.4: init %C to file.%c.var = class_init (%.loc6_26.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc6_1: init %C = converted %.loc6_26.1, %.loc6_26.4 [concrete = constants.%C.val] @@ -698,7 +698,7 @@ alias C = Other.C; // CHECK:STDOUT: %.loc7_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_26.1: %struct_type.x = struct_literal (%.loc7_25.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc7_26.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.dd7] -// CHECK:STDOUT: %.loc7_25.2: init %empty_tuple.type to %.loc7_26.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc7_25.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_26.3: init %empty_tuple.type = converted %.loc7_25.1, %.loc7_25.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_26.4: init %C to file.%c.var = class_init (%.loc7_26.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc7_1: init %C = converted %.loc7_26.1, %.loc7_26.4 [concrete = constants.%C.val] @@ -762,7 +762,7 @@ alias C = Other.C; // CHECK:STDOUT: %.loc6_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_26.1: %struct_type.x = struct_literal (%.loc6_25.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc6_26.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.dd7] -// CHECK:STDOUT: %.loc6_25.2: init %empty_tuple.type to %.loc6_26.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc6_25.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_26.3: init %empty_tuple.type = converted %.loc6_25.1, %.loc6_25.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_26.4: init %C to file.%c.var = class_init (%.loc6_26.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc6_1: init %C = converted %.loc6_26.1, %.loc6_26.4 [concrete = constants.%C.val] @@ -832,7 +832,7 @@ alias C = Other.C; // CHECK:STDOUT: %.loc11_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc11_26.1: %struct_type.x = struct_literal (%.loc11_25.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc11_26.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.dd7] -// CHECK:STDOUT: %.loc11_25.2: init %empty_tuple.type to %.loc11_26.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc11_25.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc11_26.3: init %empty_tuple.type = converted %.loc11_25.1, %.loc11_25.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc11_26.4: init %C to file.%c.var = class_init (%.loc11_26.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc11_1: init %C = converted %.loc11_26.1, %.loc11_26.4 [concrete = constants.%C.val] diff --git a/toolchain/check/testdata/packages/export_import.carbon b/toolchain/check/testdata/packages/export_import.carbon index 1a39cdca38a5..35559d6c856f 100644 --- a/toolchain/check/testdata/packages/export_import.carbon +++ b/toolchain/check/testdata/packages/export_import.carbon @@ -340,7 +340,7 @@ export Poison; // CHECK:STDOUT: %.loc6_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.1: %struct_type.x = struct_literal (%.loc6_19.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc6_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.1d2] -// CHECK:STDOUT: %.loc6_19.2: init %empty_tuple.type to %.loc6_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc6_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.3: init %empty_tuple.type = converted %.loc6_19.1, %.loc6_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.4: init %C to file.%c.var = class_init (%.loc6_20.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc6_1: init %C = converted %.loc6_20.1, %.loc6_20.4 [concrete = constants.%C.val] @@ -400,7 +400,7 @@ export Poison; // CHECK:STDOUT: %.loc4_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc4_20.1: %struct_type.x = struct_literal (%.loc4_19.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc4_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.1d2] -// CHECK:STDOUT: %.loc4_19.2: init %empty_tuple.type to %.loc4_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc4_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc4_20.3: init %empty_tuple.type = converted %.loc4_19.1, %.loc4_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc4_20.4: init %C to file.%c.var = class_init (%.loc4_20.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc4_1: init %C = converted %.loc4_20.1, %.loc4_20.4 [concrete = constants.%C.val] @@ -457,7 +457,7 @@ export Poison; // CHECK:STDOUT: %.loc6_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.1: %struct_type.x = struct_literal (%.loc6_19.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc6_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.1d2] -// CHECK:STDOUT: %.loc6_19.2: init %empty_tuple.type to %.loc6_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc6_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.3: init %empty_tuple.type = converted %.loc6_19.1, %.loc6_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.4: init %C to file.%c.var = class_init (%.loc6_20.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc6_1: init %C = converted %.loc6_20.1, %.loc6_20.4 [concrete = constants.%C.val] @@ -514,7 +514,7 @@ export Poison; // CHECK:STDOUT: %.loc6_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.1: %struct_type.x = struct_literal (%.loc6_19.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc6_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.1d2] -// CHECK:STDOUT: %.loc6_19.2: init %empty_tuple.type to %.loc6_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc6_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.3: init %empty_tuple.type = converted %.loc6_19.1, %.loc6_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.4: init %C to file.%c.var = class_init (%.loc6_20.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc6_1: init %C = converted %.loc6_20.1, %.loc6_20.4 [concrete = constants.%C.val] @@ -571,7 +571,7 @@ export Poison; // CHECK:STDOUT: %.loc6_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.1: %struct_type.x = struct_literal (%.loc6_19.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc6_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.1d2] -// CHECK:STDOUT: %.loc6_19.2: init %empty_tuple.type to %.loc6_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc6_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.3: init %empty_tuple.type = converted %.loc6_19.1, %.loc6_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.4: init %C to file.%c.var = class_init (%.loc6_20.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc6_1: init %C = converted %.loc6_20.1, %.loc6_20.4 [concrete = constants.%C.val] @@ -628,7 +628,7 @@ export Poison; // CHECK:STDOUT: %.loc7_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.1: %struct_type.x = struct_literal (%.loc7_19.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc7_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.1d2] -// CHECK:STDOUT: %.loc7_19.2: init %empty_tuple.type to %.loc7_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc7_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.3: init %empty_tuple.type = converted %.loc7_19.1, %.loc7_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.4: init %C to file.%c.var = class_init (%.loc7_20.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc7_1: init %C = converted %.loc7_20.1, %.loc7_20.4 [concrete = constants.%C.val] @@ -685,7 +685,7 @@ export Poison; // CHECK:STDOUT: %.loc7_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.1: %struct_type.x = struct_literal (%.loc7_19.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc7_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.1d2] -// CHECK:STDOUT: %.loc7_19.2: init %empty_tuple.type to %.loc7_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc7_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.3: init %empty_tuple.type = converted %.loc7_19.1, %.loc7_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.4: init %C to file.%c.var = class_init (%.loc7_20.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc7_1: init %C = converted %.loc7_20.1, %.loc7_20.4 [concrete = constants.%C.val] @@ -742,7 +742,7 @@ export Poison; // CHECK:STDOUT: %.loc7_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.1: %struct_type.x = struct_literal (%.loc7_19.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc7_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.1d2] -// CHECK:STDOUT: %.loc7_19.2: init %empty_tuple.type to %.loc7_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc7_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.3: init %empty_tuple.type = converted %.loc7_19.1, %.loc7_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.4: init %C to file.%c.var = class_init (%.loc7_20.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc7_1: init %C = converted %.loc7_20.1, %.loc7_20.4 [concrete = constants.%C.val] @@ -811,7 +811,7 @@ export Poison; // CHECK:STDOUT: %.loc7_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.1: %struct_type.x = struct_literal (%.loc7_19.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc7_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.1d2] -// CHECK:STDOUT: %.loc7_19.2: init %empty_tuple.type to %.loc7_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc7_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.3: init %empty_tuple.type = converted %.loc7_19.1, %.loc7_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.4: init %C to file.%c.var = class_init (%.loc7_20.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc7_1: init %C = converted %.loc7_20.1, %.loc7_20.4 [concrete = constants.%C.val] @@ -870,7 +870,7 @@ export Poison; // CHECK:STDOUT: %.loc6_28.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_29.1: %struct_type.x = struct_literal (%.loc6_28.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc6_29.2: ref %empty_tuple.type = class_element_access file.%indirect_c.var, element0 [concrete = constants.%.ef1] -// CHECK:STDOUT: %.loc6_28.2: init %empty_tuple.type to %.loc6_29.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc6_28.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_29.3: init %empty_tuple.type = converted %.loc6_28.1, %.loc6_28.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_29.4: init %C to file.%indirect_c.var = class_init (%.loc6_29.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc6_1: init %C = converted %.loc6_29.1, %.loc6_29.4 [concrete = constants.%C.val] diff --git a/toolchain/check/testdata/packages/export_mixed.carbon b/toolchain/check/testdata/packages/export_mixed.carbon index b77ee21f20e7..3f42fe46e4cb 100644 --- a/toolchain/check/testdata/packages/export_mixed.carbon +++ b/toolchain/check/testdata/packages/export_mixed.carbon @@ -311,7 +311,7 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %.loc6_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.1: %struct_type.x = struct_literal (%.loc6_19.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc6_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.1d2] -// CHECK:STDOUT: %.loc6_19.2: init %empty_tuple.type to %.loc6_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc6_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.3: init %empty_tuple.type = converted %.loc6_19.1, %.loc6_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.4: init %C to file.%c.var = class_init (%.loc6_20.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc6_1: init %C = converted %.loc6_20.1, %.loc6_20.4 [concrete = constants.%C.val] @@ -368,7 +368,7 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %.loc6_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.1: %struct_type.x = struct_literal (%.loc6_19.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc6_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.1d2] -// CHECK:STDOUT: %.loc6_19.2: init %empty_tuple.type to %.loc6_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc6_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.3: init %empty_tuple.type = converted %.loc6_19.1, %.loc6_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.4: init %C to file.%c.var = class_init (%.loc6_20.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc6_1: init %C = converted %.loc6_20.1, %.loc6_20.4 [concrete = constants.%C.val] @@ -425,7 +425,7 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %.loc7_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.1: %struct_type.x = struct_literal (%.loc7_19.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc7_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.1d2] -// CHECK:STDOUT: %.loc7_19.2: init %empty_tuple.type to %.loc7_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc7_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.3: init %empty_tuple.type = converted %.loc7_19.1, %.loc7_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.4: init %C to file.%c.var = class_init (%.loc7_20.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc7_1: init %C = converted %.loc7_20.1, %.loc7_20.4 [concrete = constants.%C.val] @@ -519,7 +519,7 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %.loc7_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.1: %struct_type.x = struct_literal (%.loc7_19.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc7_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.1d2] -// CHECK:STDOUT: %.loc7_19.2: init %empty_tuple.type to %.loc7_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc7_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.3: init %empty_tuple.type = converted %.loc7_19.1, %.loc7_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.4: init %C to file.%c.var = class_init (%.loc7_20.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc7_1: init %C = converted %.loc7_20.1, %.loc7_20.4 [concrete = constants.%C.val] @@ -604,7 +604,7 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %.loc8_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc8_20.1: %struct_type.x = struct_literal (%.loc8_19.1) [concrete = constants.%struct.948] // CHECK:STDOUT: %.loc8_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.1d2] -// CHECK:STDOUT: %.loc8_19.2: init %empty_tuple.type to %.loc8_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc8_20.3: init %empty_tuple.type = converted %.loc8_19.1, %.loc8_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc8_20.4: init %C to file.%c.var = class_init (%.loc8_20.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc8_1: init %C = converted %.loc8_20.1, %.loc8_20.4 [concrete = constants.%C.val] @@ -612,7 +612,7 @@ var d: D = {.y = ()}; // CHECK:STDOUT: %.loc9_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc9_20.1: %struct_type.y = struct_literal (%.loc9_19.1) [concrete = constants.%struct.8ce] // CHECK:STDOUT: %.loc9_20.2: ref %empty_tuple.type = class_element_access file.%d.var, element0 [concrete = constants.%.0cf] -// CHECK:STDOUT: %.loc9_19.2: init %empty_tuple.type to %.loc9_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc9_20.3: init %empty_tuple.type = converted %.loc9_19.1, %.loc9_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc9_20.4: init %D to file.%d.var = class_init (%.loc9_20.3) [concrete = constants.%D.val] // CHECK:STDOUT: %.loc9_1: init %D = converted %.loc9_20.1, %.loc9_20.4 [concrete = constants.%D.val] diff --git a/toolchain/check/testdata/packages/export_name.carbon b/toolchain/check/testdata/packages/export_name.carbon index 55939d2dceee..921687f8c401 100644 --- a/toolchain/check/testdata/packages/export_name.carbon +++ b/toolchain/check/testdata/packages/export_name.carbon @@ -471,7 +471,7 @@ private export C; // CHECK:STDOUT: %.loc6_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.1: %struct_type.x = struct_literal (%.loc6_19.1) [concrete = constants.%struct.948] // CHECK:STDOUT: %.loc6_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.1d2] -// CHECK:STDOUT: %.loc6_19.2: init %empty_tuple.type to %.loc6_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc6_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.3: init %empty_tuple.type = converted %.loc6_19.1, %.loc6_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.4: init %C to file.%c.var = class_init (%.loc6_20.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc6_1: init %C = converted %.loc6_20.1, %.loc6_20.4 [concrete = constants.%C.val] @@ -479,7 +479,7 @@ private export C; // CHECK:STDOUT: %.loc7_26.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_27.1: %struct_type.y = struct_literal (%.loc7_26.1) [concrete = constants.%struct.8ce] // CHECK:STDOUT: %.loc7_27.2: ref %empty_tuple.type = class_element_access file.%nsc.var, element0 [concrete = constants.%.160] -// CHECK:STDOUT: %.loc7_26.2: init %empty_tuple.type to %.loc7_27.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc7_26.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_27.3: init %empty_tuple.type = converted %.loc7_26.1, %.loc7_26.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_27.4: init %NSC to file.%nsc.var = class_init (%.loc7_27.3) [concrete = constants.%NSC.val] // CHECK:STDOUT: %.loc7_1: init %NSC = converted %.loc7_27.1, %.loc7_27.4 [concrete = constants.%NSC.val] @@ -572,7 +572,7 @@ private export C; // CHECK:STDOUT: %.loc4_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc4_20.1: %struct_type.x = struct_literal (%.loc4_19.1) [concrete = constants.%struct.948] // CHECK:STDOUT: %.loc4_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.1d2] -// CHECK:STDOUT: %.loc4_19.2: init %empty_tuple.type to %.loc4_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc4_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc4_20.3: init %empty_tuple.type = converted %.loc4_19.1, %.loc4_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc4_20.4: init %C to file.%c.var = class_init (%.loc4_20.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc4_1: init %C = converted %.loc4_20.1, %.loc4_20.4 [concrete = constants.%C.val] @@ -580,7 +580,7 @@ private export C; // CHECK:STDOUT: %.loc5_26.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc5_27.1: %struct_type.y = struct_literal (%.loc5_26.1) [concrete = constants.%struct.8ce] // CHECK:STDOUT: %.loc5_27.2: ref %empty_tuple.type = class_element_access file.%nsc.var, element0 [concrete = constants.%.2e1] -// CHECK:STDOUT: %.loc5_26.2: init %empty_tuple.type to %.loc5_27.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_26.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc5_27.3: init %empty_tuple.type = converted %.loc5_26.1, %.loc5_26.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc5_27.4: init %NSC to file.%nsc.var = class_init (%.loc5_27.3) [concrete = constants.%NSC.val] // CHECK:STDOUT: %.loc5_1: init %NSC = converted %.loc5_27.1, %.loc5_27.4 [concrete = constants.%NSC.val] @@ -672,7 +672,7 @@ private export C; // CHECK:STDOUT: %.loc6_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.1: %struct_type.x = struct_literal (%.loc6_19.1) [concrete = constants.%struct.948] // CHECK:STDOUT: %.loc6_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.1d2] -// CHECK:STDOUT: %.loc6_19.2: init %empty_tuple.type to %.loc6_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc6_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.3: init %empty_tuple.type = converted %.loc6_19.1, %.loc6_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.4: init %C to file.%c.var = class_init (%.loc6_20.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc6_1: init %C = converted %.loc6_20.1, %.loc6_20.4 [concrete = constants.%C.val] @@ -680,7 +680,7 @@ private export C; // CHECK:STDOUT: %.loc7_26.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_27.1: %struct_type.y = struct_literal (%.loc7_26.1) [concrete = constants.%struct.8ce] // CHECK:STDOUT: %.loc7_27.2: ref %empty_tuple.type = class_element_access file.%nsc.var, element0 [concrete = constants.%.2e1] -// CHECK:STDOUT: %.loc7_26.2: init %empty_tuple.type to %.loc7_27.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc7_26.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_27.3: init %empty_tuple.type = converted %.loc7_26.1, %.loc7_26.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_27.4: init %NSC to file.%nsc.var = class_init (%.loc7_27.3) [concrete = constants.%NSC.val] // CHECK:STDOUT: %.loc7_1: init %NSC = converted %.loc7_27.1, %.loc7_27.4 [concrete = constants.%NSC.val] @@ -851,7 +851,7 @@ private export C; // CHECK:STDOUT: %.loc7_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.1: %struct_type.x = struct_literal (%.loc7_19.1) [concrete = constants.%struct.948] // CHECK:STDOUT: %.loc7_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.1d2] -// CHECK:STDOUT: %.loc7_19.2: init %empty_tuple.type to %.loc7_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc7_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.3: init %empty_tuple.type = converted %.loc7_19.1, %.loc7_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.4: init %C to file.%c.var = class_init (%.loc7_20.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc7_1: init %C = converted %.loc7_20.1, %.loc7_20.4 [concrete = constants.%C.val] @@ -859,7 +859,7 @@ private export C; // CHECK:STDOUT: %.loc8_26.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc8_27.1: %struct_type.y = struct_literal (%.loc8_26.1) [concrete = constants.%struct.8ce] // CHECK:STDOUT: %.loc8_27.2: ref %empty_tuple.type = class_element_access file.%nsc.var, element0 [concrete = constants.%.b2f] -// CHECK:STDOUT: %.loc8_26.2: init %empty_tuple.type to %.loc8_27.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_26.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc8_27.3: init %empty_tuple.type = converted %.loc8_26.1, %.loc8_26.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc8_27.4: init %NSC to file.%nsc.var = class_init (%.loc8_27.3) [concrete = constants.%NSC.val] // CHECK:STDOUT: %.loc8_1: init %NSC = converted %.loc8_27.1, %.loc8_27.4 [concrete = constants.%NSC.val] @@ -951,7 +951,7 @@ private export C; // CHECK:STDOUT: %.loc7_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.1: %struct_type.x = struct_literal (%.loc7_19.1) [concrete = constants.%struct.948] // CHECK:STDOUT: %.loc7_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.1d2] -// CHECK:STDOUT: %.loc7_19.2: init %empty_tuple.type to %.loc7_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc7_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.3: init %empty_tuple.type = converted %.loc7_19.1, %.loc7_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_20.4: init %C to file.%c.var = class_init (%.loc7_20.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc7_1: init %C = converted %.loc7_20.1, %.loc7_20.4 [concrete = constants.%C.val] @@ -959,7 +959,7 @@ private export C; // CHECK:STDOUT: %.loc8_26.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc8_27.1: %struct_type.y = struct_literal (%.loc8_26.1) [concrete = constants.%struct.8ce] // CHECK:STDOUT: %.loc8_27.2: ref %empty_tuple.type = class_element_access file.%nsc.var, element0 [concrete = constants.%.160] -// CHECK:STDOUT: %.loc8_26.2: init %empty_tuple.type to %.loc8_27.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_26.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc8_27.3: init %empty_tuple.type = converted %.loc8_26.1, %.loc8_26.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc8_27.4: init %NSC to file.%nsc.var = class_init (%.loc8_27.3) [concrete = constants.%NSC.val] // CHECK:STDOUT: %.loc8_1: init %NSC = converted %.loc8_27.1, %.loc8_27.4 [concrete = constants.%NSC.val] @@ -1074,7 +1074,7 @@ private export C; // CHECK:STDOUT: %.loc6_19.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.1: %struct_type.x = struct_literal (%.loc6_19.1) [concrete = constants.%struct] // CHECK:STDOUT: %.loc6_20.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.1d2] -// CHECK:STDOUT: %.loc6_19.2: init %empty_tuple.type to %.loc6_20.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc6_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.3: init %empty_tuple.type = converted %.loc6_19.1, %.loc6_19.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc6_20.4: init %C to file.%c.var = class_init (%.loc6_20.3) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc6_1: init %C = converted %.loc6_20.1, %.loc6_20.4 [concrete = constants.%C.val] diff --git a/toolchain/check/testdata/packages/raw_core.carbon b/toolchain/check/testdata/packages/raw_core.carbon index de9079aa83e4..5d270db2547e 100644 --- a/toolchain/check/testdata/packages/raw_core.carbon +++ b/toolchain/check/testdata/packages/raw_core.carbon @@ -307,7 +307,7 @@ var c: r#Core = {.n = 0 as Core.Int(32)}; // CHECK:STDOUT: %bound_method.loc6_25.4: = bound_method %.loc6_25.2, %specific_fn.loc6_25.2 [concrete = constants.%bound_method.5f6] // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc6_25.4(%.loc6_25.2) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_40.2: ref %i32 = class_element_access file.%c.var, element0 [concrete = constants.%.cb0] -// CHECK:STDOUT: %.loc6_40.3: init %i32 to %.loc6_40.2 = initialize_from %Int.as.Copy.impl.Op.call [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc6_40.3: init %i32 to %.loc6_40.2 = in_place_init %Int.as.Copy.impl.Op.call [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_40.4: init %Core to file.%c.var = class_init (%.loc6_40.3) [concrete = constants.%Core.val] // CHECK:STDOUT: %.loc6_1: init %Core = converted %.loc6_40.1, %.loc6_40.4 [concrete = constants.%Core.val] // CHECK:STDOUT: assign file.%c.var, %.loc6_1 diff --git a/toolchain/check/testdata/pointer/address_of_lvalue.carbon b/toolchain/check/testdata/pointer/address_of_lvalue.carbon index e139969fb9c9..825464e5dd22 100644 --- a/toolchain/check/testdata/pointer/address_of_lvalue.carbon +++ b/toolchain/check/testdata/pointer/address_of_lvalue.carbon @@ -145,7 +145,7 @@ fn F() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc16_46.1: init %i32 = call %bound_method.loc16_46.2(%int_1.loc16) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_46.2: init %i32 = converted %int_1.loc16, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc16_46.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc16_46.3: ref %i32 = struct_access %s.var, element0 -// CHECK:STDOUT: %.loc16_46.4: init %i32 to %.loc16_46.3 = initialize_from %.loc16_46.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc16_46.4: init %i32 to %.loc16_46.3 = in_place_init %.loc16_46.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc16_46.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc16_46.3: = bound_method %int_2.loc16, %impl.elem0.loc16_46.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc16_46.2: = specific_function %impl.elem0.loc16_46.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -153,7 +153,7 @@ fn F() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc16_46.2: init %i32 = call %bound_method.loc16_46.4(%int_2.loc16) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc16_46.5: init %i32 = converted %int_2.loc16, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc16_46.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc16_46.6: ref %i32 = struct_access %s.var, element1 -// CHECK:STDOUT: %.loc16_46.7: init %i32 to %.loc16_46.6 = initialize_from %.loc16_46.5 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc16_46.7: init %i32 to %.loc16_46.6 = in_place_init %.loc16_46.5 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc16_46.8: init %struct_type.a.b.501 to %s.var = struct_init (%.loc16_46.4, %.loc16_46.7) [concrete = constants.%struct.ed5] // CHECK:STDOUT: %.loc16_3: init %struct_type.a.b.501 = converted %.loc16_46.1, %.loc16_46.8 [concrete = constants.%struct.ed5] // CHECK:STDOUT: assign %s.var, %.loc16_3 @@ -242,7 +242,7 @@ fn F() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22_28.1: init %i32 = call %bound_method.loc22_28.2(%int_1.loc22) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc22_28.2: init %i32 = converted %int_1.loc22, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22_28.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple.elem0.loc22: ref %i32 = tuple_access %t.var, element0 -// CHECK:STDOUT: %.loc22_28.3: init %i32 to %tuple.elem0.loc22 = initialize_from %.loc22_28.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc22_28.3: init %i32 to %tuple.elem0.loc22 = in_place_init %.loc22_28.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc22_28.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc22_28.3: = bound_method %int_2.loc22, %impl.elem0.loc22_28.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc22_28.2: = specific_function %impl.elem0.loc22_28.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -250,7 +250,7 @@ fn F() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22_28.2: init %i32 = call %bound_method.loc22_28.4(%int_2.loc22) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc22_28.4: init %i32 = converted %int_2.loc22, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22_28.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem1.loc22: ref %i32 = tuple_access %t.var, element1 -// CHECK:STDOUT: %.loc22_28.5: init %i32 to %tuple.elem1.loc22 = initialize_from %.loc22_28.4 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc22_28.5: init %i32 to %tuple.elem1.loc22 = in_place_init %.loc22_28.4 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc22_28.6: init %tuple.type.d07 to %t.var = tuple_init (%.loc22_28.3, %.loc22_28.5) [concrete = constants.%tuple.21c] // CHECK:STDOUT: %.loc22_3: init %tuple.type.d07 = converted %.loc22_28.1, %.loc22_28.6 [concrete = constants.%tuple.21c] // CHECK:STDOUT: assign %t.var, %.loc22_3 diff --git a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon index e8d738901f60..ec7140679bf0 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -195,7 +195,7 @@ fn G() -> C { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc29_38.1: init %i32 = call %bound_method.loc29_38.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc29_38.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc29_38.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc29_38.3: ref %i32 = class_element_access %return.param, element0 -// CHECK:STDOUT: %.loc29_38.4: init %i32 to %.loc29_38.3 = initialize_from %.loc29_38.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc29_38.4: init %i32 to %.loc29_38.3 = in_place_init %.loc29_38.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc29_38.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc29_38.3: = bound_method %int_2, %impl.elem0.loc29_38.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc29_38.2: = specific_function %impl.elem0.loc29_38.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -203,7 +203,7 @@ fn G() -> C { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc29_38.2: init %i32 = call %bound_method.loc29_38.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc29_38.5: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc29_38.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc29_38.6: ref %i32 = class_element_access %return.param, element1 -// CHECK:STDOUT: %.loc29_38.7: init %i32 to %.loc29_38.6 = initialize_from %.loc29_38.5 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc29_38.7: init %i32 to %.loc29_38.6 = in_place_init %.loc29_38.5 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc29_38.8: init %C to %return.param = class_init (%.loc29_38.4, %.loc29_38.7) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc29_12: init %C = converted %.loc29_38.1, %.loc29_38.8 [concrete = constants.%C.val] // CHECK:STDOUT: assign %return.param, %.loc29_12 diff --git a/toolchain/check/testdata/return/import_convert_function.carbon b/toolchain/check/testdata/return/import_convert_function.carbon index f2bc8d478367..39789e13e256 100644 --- a/toolchain/check/testdata/return/import_convert_function.carbon +++ b/toolchain/check/testdata/return/import_convert_function.carbon @@ -576,7 +576,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_40.1: init %i32 = call %bound_method.loc6_40.2(%int_0.loc6_31) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_40.2: init %i32 = converted %int_0.loc6_31, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_40.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_40.3: ref %i32 = class_element_access %return.param, element0 -// CHECK:STDOUT: %.loc6_40.4: init %i32 to %.loc6_40.3 = initialize_from %.loc6_40.2 [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc6_40.4: init %i32 to %.loc6_40.3 = in_place_init %.loc6_40.2 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %impl.elem0.loc6_40.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc6_40.3: = bound_method %int_0.loc6_39, %impl.elem0.loc6_40.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.897] // CHECK:STDOUT: %specific_fn.loc6_40.2: = specific_function %impl.elem0.loc6_40.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -584,7 +584,7 @@ fn F0(n: i32) -> P.D { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_40.2: init %i32 = call %bound_method.loc6_40.4(%int_0.loc6_39) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_40.5: init %i32 = converted %int_0.loc6_39, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_40.2 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_40.6: ref %i32 = class_element_access %return.param, element1 -// CHECK:STDOUT: %.loc6_40.7: init %i32 to %.loc6_40.6 = initialize_from %.loc6_40.5 [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc6_40.7: init %i32 to %.loc6_40.6 = in_place_init %.loc6_40.5 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc6_40.8: init %D to %return.param = class_init (%.loc6_40.4, %.loc6_40.7) [concrete = constants.%D.val] // CHECK:STDOUT: %.loc6_41: init %D = converted %.loc6_40.1, %.loc6_40.8 [concrete = constants.%D.val] // CHECK:STDOUT: return %.loc6_41 to %return.param diff --git a/toolchain/check/testdata/return/returned_var.carbon b/toolchain/check/testdata/return/returned_var.carbon index 9b218f96f97c..fba47011c82f 100644 --- a/toolchain/check/testdata/return/returned_var.carbon +++ b/toolchain/check/testdata/return/returned_var.carbon @@ -157,7 +157,7 @@ fn G() -> i32 { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21_43.1: init %i32 = call %bound_method.loc21_43.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc21_43.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21_43.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc21_43.3: ref %i32 = class_element_access %return.param, element0 -// CHECK:STDOUT: %.loc21_43.4: init %i32 to %.loc21_43.3 = initialize_from %.loc21_43.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc21_43.4: init %i32 to %.loc21_43.3 = in_place_init %.loc21_43.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc21_43.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc21_43.3: = bound_method %int_2, %impl.elem0.loc21_43.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc21_43.2: = specific_function %impl.elem0.loc21_43.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -165,7 +165,7 @@ fn G() -> i32 { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21_43.2: init %i32 = call %bound_method.loc21_43.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc21_43.5: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21_43.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc21_43.6: ref %i32 = class_element_access %return.param, element1 -// CHECK:STDOUT: %.loc21_43.7: init %i32 to %.loc21_43.6 = initialize_from %.loc21_43.5 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc21_43.7: init %i32 to %.loc21_43.6 = in_place_init %.loc21_43.5 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc21_43.8: init %C to %return.param = class_init (%.loc21_43.4, %.loc21_43.7) [concrete = constants.%C.val] // CHECK:STDOUT: %.loc21_12: init %C = converted %.loc21_43.1, %.loc21_43.8 [concrete = constants.%C.val] // CHECK:STDOUT: assign %return.param, %.loc21_12 diff --git a/toolchain/check/testdata/return/tuple.carbon b/toolchain/check/testdata/return/tuple.carbon index 7f41f3e18273..2d364360a1ea 100644 --- a/toolchain/check/testdata/return/tuple.carbon +++ b/toolchain/check/testdata/return/tuple.carbon @@ -104,7 +104,7 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc17_17.1: init %i32 = call %bound_method.loc17_17.2(%int_15) [concrete = constants.%int_15.7f7] // CHECK:STDOUT: %.loc17_17.2: init %i32 = converted %int_15, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc17_17.1 [concrete = constants.%int_15.7f7] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %return.param, element0 -// CHECK:STDOUT: %.loc17_17.3: init %i32 to %tuple.elem0 = initialize_from %.loc17_17.2 [concrete = constants.%int_15.7f7] +// CHECK:STDOUT: %.loc17_17.3: init %i32 to %tuple.elem0 = in_place_init %.loc17_17.2 [concrete = constants.%int_15.7f7] // CHECK:STDOUT: %impl.elem0.loc17_17.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc17_17.3: = bound_method %int_35, %impl.elem0.loc17_17.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4c2] // CHECK:STDOUT: %specific_fn.loc17_17.2: = specific_function %impl.elem0.loc17_17.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -112,7 +112,7 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc17_17.2: init %i32 = call %bound_method.loc17_17.4(%int_35) [concrete = constants.%int_35.c78] // CHECK:STDOUT: %.loc17_17.4: init %i32 = converted %int_35, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc17_17.2 [concrete = constants.%int_35.c78] // CHECK:STDOUT: %tuple.elem1: ref %i32 = tuple_access %return.param, element1 -// CHECK:STDOUT: %.loc17_17.5: init %i32 to %tuple.elem1 = initialize_from %.loc17_17.4 [concrete = constants.%int_35.c78] +// CHECK:STDOUT: %.loc17_17.5: init %i32 to %tuple.elem1 = in_place_init %.loc17_17.4 [concrete = constants.%int_35.c78] // CHECK:STDOUT: %.loc17_17.6: init %tuple.type.d07 to %return.param = tuple_init (%.loc17_17.3, %.loc17_17.5) [concrete = constants.%tuple.851] // CHECK:STDOUT: %.loc17_18: init %tuple.type.d07 = converted %.loc17_17.1, %.loc17_17.6 [concrete = constants.%tuple.851] // CHECK:STDOUT: return %.loc17_18 to %return.param diff --git a/toolchain/check/testdata/struct/fail_member_access_type.carbon b/toolchain/check/testdata/struct/fail_member_access_type.carbon index 5f5f39596f76..6d88143fb04b 100644 --- a/toolchain/check/testdata/struct/fail_member_access_type.carbon +++ b/toolchain/check/testdata/struct/fail_member_access_type.carbon @@ -110,7 +110,7 @@ var y: i32 = x.b; // CHECK:STDOUT: %bound_method.loc15_29.2: = bound_method %float, %specific_fn [concrete = constants.%bound_method] // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f64.d77 = call %bound_method.loc15_29.2(%float) [concrete = constants.%float.d15] // CHECK:STDOUT: %.loc15_29.2: init %f64.d77 = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.d15] -// CHECK:STDOUT: %.loc15_29.3: init %struct_type.a.5e8 = struct_init (%.loc15_29.2) [concrete = constants.%struct.d6a] +// CHECK:STDOUT: %.loc15_29.3: init %struct_type.a.5e8 to file.%x.var = struct_init (%.loc15_29.2) [concrete = constants.%struct.d6a] // CHECK:STDOUT: %.loc15_1: init %struct_type.a.5e8 = converted %.loc15_29.1, %.loc15_29.3 [concrete = constants.%struct.d6a] // CHECK:STDOUT: assign file.%x.var, %.loc15_1 // CHECK:STDOUT: %x.ref: ref %struct_type.a.5e8 = name_ref x, file.%x [concrete = file.%x.var] diff --git a/toolchain/check/testdata/struct/fail_non_member_access.carbon b/toolchain/check/testdata/struct/fail_non_member_access.carbon index e37846104700..a602ac56f661 100644 --- a/toolchain/check/testdata/struct/fail_non_member_access.carbon +++ b/toolchain/check/testdata/struct/fail_non_member_access.carbon @@ -104,7 +104,7 @@ var y: i32 = x.b; // CHECK:STDOUT: %bound_method.loc15_27.2: = bound_method %int_4, %specific_fn [concrete = constants.%bound_method] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc15_27.2(%int_4) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc15_27.2: init %i32 = converted %int_4, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_4.940] -// CHECK:STDOUT: %.loc15_27.3: init %struct_type.a.ba9 = struct_init (%.loc15_27.2) [concrete = constants.%struct.a51] +// CHECK:STDOUT: %.loc15_27.3: init %struct_type.a.ba9 to file.%x.var = struct_init (%.loc15_27.2) [concrete = constants.%struct.a51] // CHECK:STDOUT: %.loc15_1: init %struct_type.a.ba9 = converted %.loc15_27.1, %.loc15_27.3 [concrete = constants.%struct.a51] // CHECK:STDOUT: assign file.%x.var, %.loc15_1 // CHECK:STDOUT: %x.ref: ref %struct_type.a.ba9 = name_ref x, file.%x [concrete = file.%x.var] diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index 7c4d12be38a1..da0952c98f5e 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -232,7 +232,7 @@ fn F() -> {.x: i32} { // CHECK:STDOUT: %specific_fn.loc5: = specific_function %impl.elem0.loc5, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc5_20.2: = bound_method %.loc5_20.2, %specific_fn.loc5 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc5: init %i32 = call %bound_method.loc5_20.2(%.loc5_20.2) -// CHECK:STDOUT: %.loc5_20.3: init %struct_type.a = struct_init (%Int.as.Copy.impl.Op.call.loc5) +// CHECK:STDOUT: %.loc5_20.3: init %struct_type.a to file.%a.var = struct_init (%Int.as.Copy.impl.Op.call.loc5) // CHECK:STDOUT: %.loc5_1: init %struct_type.a = converted %a_ref.ref, %.loc5_20.3 // CHECK:STDOUT: assign file.%a.var, %.loc5_1 // CHECK:STDOUT: %b_ref.ref: ref %struct_type.a.d.9db = name_ref b_ref, imports.%Implicit.b_ref [concrete = imports.%b_ref.var] @@ -246,7 +246,7 @@ fn F() -> {.x: i32} { // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc6_47.1: init %i32 = call %bound_method.loc6_47.2(%.loc6_47.3) // CHECK:STDOUT: %.loc6_47.4: ref %struct_type.b.c = struct_access file.%b.var, element0 [concrete = constants.%.273] // CHECK:STDOUT: %.loc6_47.5: ref %i32 = struct_access %.loc6_47.4, element0 [concrete = constants.%.e4e] -// CHECK:STDOUT: %.loc6_47.6: init %i32 to %.loc6_47.5 = initialize_from %Int.as.Copy.impl.Op.call.loc6_47.1 +// CHECK:STDOUT: %.loc6_47.6: init %i32 to %.loc6_47.5 = in_place_init %Int.as.Copy.impl.Op.call.loc6_47.1 // CHECK:STDOUT: %.loc6_47.7: ref %tuple.type.dd4 = struct_access %.loc6_47.1, element1 [concrete = constants.%.d35] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %.loc6_47.7, element0 [concrete = constants.%tuple.elem0.4a3] // CHECK:STDOUT: %.loc6_47.8: %i32 = acquire_value %tuple.elem0 @@ -258,7 +258,7 @@ fn F() -> {.x: i32} { // CHECK:STDOUT: %.loc6_47.9: ref %tuple.type.dd4 = struct_access %.loc6_47.4, element1 [concrete = constants.%.de6] // CHECK:STDOUT: %.loc6_47.10: init %tuple.type.dd4 to %.loc6_47.9 = tuple_init (%Int.as.Copy.impl.Op.call.loc6_47.2) // CHECK:STDOUT: %.loc6_47.11: init %tuple.type.dd4 = converted %.loc6_47.7, %.loc6_47.10 -// CHECK:STDOUT: %.loc6_47.12: init %tuple.type.dd4 to %.loc6_47.9 = initialize_from %.loc6_47.11 +// CHECK:STDOUT: %.loc6_47.12: init %tuple.type.dd4 to %.loc6_47.9 = in_place_init %.loc6_47.11 // CHECK:STDOUT: %.loc6_47.13: init %struct_type.b.c to %.loc6_47.4 = struct_init (%.loc6_47.6, %.loc6_47.12) // CHECK:STDOUT: %.loc6_47.14: init %struct_type.b.c = converted %.loc6_47.1, %.loc6_47.13 // CHECK:STDOUT: %.loc6_47.15: ref %i32 = struct_access %b_ref.ref, element1 [concrete = constants.%.7f4] @@ -269,7 +269,7 @@ fn F() -> {.x: i32} { // CHECK:STDOUT: %bound_method.loc6_47.6: = bound_method %.loc6_47.16, %specific_fn.loc6_47.3 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc6_47.3: init %i32 = call %bound_method.loc6_47.6(%.loc6_47.16) // CHECK:STDOUT: %.loc6_47.17: ref %i32 = struct_access file.%b.var, element1 [concrete = constants.%.440] -// CHECK:STDOUT: %.loc6_47.18: init %i32 to %.loc6_47.17 = initialize_from %Int.as.Copy.impl.Op.call.loc6_47.3 +// CHECK:STDOUT: %.loc6_47.18: init %i32 to %.loc6_47.17 = in_place_init %Int.as.Copy.impl.Op.call.loc6_47.3 // CHECK:STDOUT: %.loc6_47.19: init %struct_type.a.d.9db to file.%b.var = struct_init (%.loc6_47.14, %.loc6_47.18) // CHECK:STDOUT: %.loc6_1: init %struct_type.a.d.9db = converted %b_ref.ref, %.loc6_47.19 // CHECK:STDOUT: assign file.%b.var, %.loc6_1 diff --git a/toolchain/check/testdata/struct/member_access.carbon b/toolchain/check/testdata/struct/member_access.carbon index 83ae27150d8f..3ad25f6aa76c 100644 --- a/toolchain/check/testdata/struct/member_access.carbon +++ b/toolchain/check/testdata/struct/member_access.carbon @@ -155,7 +155,7 @@ var z: i32 = y; // CHECK:STDOUT: %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call: init %f64.d77 = call %bound_method.loc15_46.2(%float) [concrete = constants.%float.0a8] // CHECK:STDOUT: %.loc15_46.2: init %f64.d77 = converted %float, %Core.FloatLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%float.0a8] // CHECK:STDOUT: %.loc15_46.3: ref %f64.d77 = struct_access file.%x.var, element0 [concrete = constants.%.82d] -// CHECK:STDOUT: %.loc15_46.4: init %f64.d77 to %.loc15_46.3 = initialize_from %.loc15_46.2 [concrete = constants.%float.0a8] +// CHECK:STDOUT: %.loc15_46.4: init %f64.d77 to %.loc15_46.3 = in_place_init %.loc15_46.2 [concrete = constants.%float.0a8] // CHECK:STDOUT: %impl.elem0.loc15_46.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc15_46.3: = bound_method %int_1, %impl.elem0.loc15_46.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] // CHECK:STDOUT: %specific_fn.loc15_46.2: = specific_function %impl.elem0.loc15_46.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -163,7 +163,7 @@ var z: i32 = y; // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc15_46.4(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_46.5: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_46.6: ref %i32 = struct_access file.%x.var, element1 [concrete = constants.%.b93] -// CHECK:STDOUT: %.loc15_46.7: init %i32 to %.loc15_46.6 = initialize_from %.loc15_46.5 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc15_46.7: init %i32 to %.loc15_46.6 = in_place_init %.loc15_46.5 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_46.8: init %struct_type.a.b.d2f to file.%x.var = struct_init (%.loc15_46.4, %.loc15_46.7) [concrete = constants.%struct.454] // CHECK:STDOUT: %.loc15_1: init %struct_type.a.b.d2f = converted %.loc15_46.1, %.loc15_46.8 [concrete = constants.%struct.454] // CHECK:STDOUT: assign file.%x.var, %.loc15_1 diff --git a/toolchain/check/testdata/struct/one_entry.carbon b/toolchain/check/testdata/struct/one_entry.carbon index ea84c9d2b0ea..00fb8861f60c 100644 --- a/toolchain/check/testdata/struct/one_entry.carbon +++ b/toolchain/check/testdata/struct/one_entry.carbon @@ -28,6 +28,7 @@ var y: {.a: i32} = x; // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete] // CHECK:STDOUT: %struct_type.a.a6c: type = struct_type {.a: Core.IntLiteral} [concrete] // CHECK:STDOUT: %struct.2cb: %struct_type.a.a6c = struct_value (%int_4.0c1) [concrete] +// CHECK:STDOUT: %.3cb: ref %i32 = struct_access file.%x.var, element0 [concrete] // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] @@ -45,7 +46,6 @@ var y: {.a: i32} = x; // CHECK:STDOUT: %bound_method: = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete] // CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] // CHECK:STDOUT: %struct.a51: %struct_type.a.ba9 = struct_value (%int_4.940) [concrete] -// CHECK:STDOUT: %.3cb: ref %i32 = struct_access file.%x.var, element0 [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.824: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] @@ -116,7 +116,7 @@ var y: {.a: i32} = x; // CHECK:STDOUT: %bound_method.loc15_27.2: = bound_method %int_4, %specific_fn.loc15 [concrete = constants.%bound_method] // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc15_27.2(%int_4) [concrete = constants.%int_4.940] // CHECK:STDOUT: %.loc15_27.2: init %i32 = converted %int_4, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_4.940] -// CHECK:STDOUT: %.loc15_27.3: init %struct_type.a.ba9 = struct_init (%.loc15_27.2) [concrete = constants.%struct.a51] +// CHECK:STDOUT: %.loc15_27.3: init %struct_type.a.ba9 to file.%x.var = struct_init (%.loc15_27.2) [concrete = constants.%struct.a51] // CHECK:STDOUT: %.loc15_1: init %struct_type.a.ba9 = converted %.loc15_27.1, %.loc15_27.3 [concrete = constants.%struct.a51] // CHECK:STDOUT: assign file.%x.var, %.loc15_1 // CHECK:STDOUT: %x.ref: ref %struct_type.a.ba9 = name_ref x, file.%x [concrete = file.%x.var] @@ -127,7 +127,7 @@ var y: {.a: i32} = x; // CHECK:STDOUT: %specific_fn.loc16: = specific_function %impl.elem0.loc16, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc16_20.2: = bound_method %.loc16_20.2, %specific_fn.loc16 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc16_20.2(%.loc16_20.2) -// CHECK:STDOUT: %.loc16_20.3: init %struct_type.a.ba9 = struct_init (%Int.as.Copy.impl.Op.call) +// CHECK:STDOUT: %.loc16_20.3: init %struct_type.a.ba9 to file.%y.var = struct_init (%Int.as.Copy.impl.Op.call) // CHECK:STDOUT: %.loc16_1: init %struct_type.a.ba9 = converted %x.ref, %.loc16_20.3 // CHECK:STDOUT: assign file.%y.var, %.loc16_1 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/struct/partially_const.carbon b/toolchain/check/testdata/struct/partially_const.carbon index e43008801d87..7948ec3e8b92 100644 --- a/toolchain/check/testdata/struct/partially_const.carbon +++ b/toolchain/check/testdata/struct/partially_const.carbon @@ -121,14 +121,14 @@ fn Make(n: i32) -> {.a: i32, .b: i32, .c: i32} { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc16_33.1: init %i32 = call %bound_method.loc16_33.2(%int_0.loc16_16) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc16_33.2: init %i32 = converted %int_0.loc16_16, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc16_33.1 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc16_33.3: ref %i32 = struct_access %return.param, element0 -// CHECK:STDOUT: %.loc16_33.4: init %i32 to %.loc16_33.3 = initialize_from %.loc16_33.2 [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc16_33.4: init %i32 to %.loc16_33.3 = in_place_init %.loc16_33.2 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %impl.elem0.loc16_24: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] // CHECK:STDOUT: %bound_method.loc16_24.1: = bound_method %n.ref, %impl.elem0.loc16_24 // CHECK:STDOUT: %specific_fn.loc16_24: = specific_function %impl.elem0.loc16_24, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc16_24.2: = bound_method %n.ref, %specific_fn.loc16_24 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc16_24.2(%n.ref) // CHECK:STDOUT: %.loc16_33.5: ref %i32 = struct_access %return.param, element1 -// CHECK:STDOUT: %.loc16_33.6: init %i32 to %.loc16_33.5 = initialize_from %Int.as.Copy.impl.Op.call +// CHECK:STDOUT: %.loc16_33.6: init %i32 to %.loc16_33.5 = in_place_init %Int.as.Copy.impl.Op.call // CHECK:STDOUT: %impl.elem0.loc16_33.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc16_33.3: = bound_method %int_0.loc16_32, %impl.elem0.loc16_33.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound] // CHECK:STDOUT: %specific_fn.loc16_33.2: = specific_function %impl.elem0.loc16_33.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -136,7 +136,7 @@ fn Make(n: i32) -> {.a: i32, .b: i32, .c: i32} { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc16_33.2: init %i32 = call %bound_method.loc16_33.4(%int_0.loc16_32) [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc16_33.7: init %i32 = converted %int_0.loc16_32, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc16_33.2 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc16_33.8: ref %i32 = struct_access %return.param, element2 -// CHECK:STDOUT: %.loc16_33.9: init %i32 to %.loc16_33.8 = initialize_from %.loc16_33.7 [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc16_33.9: init %i32 to %.loc16_33.8 = in_place_init %.loc16_33.7 [concrete = constants.%int_0.6a9] // CHECK:STDOUT: %.loc16_33.10: init %struct_type.a.b.c.0b6 to %return.param = struct_init (%.loc16_33.4, %.loc16_33.6, %.loc16_33.9) // CHECK:STDOUT: %.loc16_34: init %struct_type.a.b.c.0b6 = converted %.loc16_33.1, %.loc16_33.10 // CHECK:STDOUT: return %.loc16_34 to %return.param diff --git a/toolchain/check/testdata/struct/reorder_fields.carbon b/toolchain/check/testdata/struct/reorder_fields.carbon index c045d4e47d25..2a4ec098e587 100644 --- a/toolchain/check/testdata/struct/reorder_fields.carbon +++ b/toolchain/check/testdata/struct/reorder_fields.carbon @@ -180,7 +180,7 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: %bound_method.loc21_10.2: = bound_method %.loc21_10.1, %specific_fn.loc21_10.1 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc21_10.2(%.loc21_10.1) // CHECK:STDOUT: %.loc21_10.2: ref %i32 = struct_access %return.param, element1 -// CHECK:STDOUT: %.loc21_10.3: init %i32 to %.loc21_10.2 = initialize_from %Int.as.Copy.impl.Op.call +// CHECK:STDOUT: %.loc21_10.3: init %i32 to %.loc21_10.2 = in_place_init %Int.as.Copy.impl.Op.call // CHECK:STDOUT: %.loc21_10.4: %f64.d77 = struct_access %y.ref, element0 // CHECK:STDOUT: %impl.elem0.loc21_10.2: %.c41 = impl_witness_access constants.%Copy.impl_witness.1e3, element0 [concrete = constants.%Float.as.Copy.impl.Op.f05] // CHECK:STDOUT: %bound_method.loc21_10.3: = bound_method %.loc21_10.4, %impl.elem0.loc21_10.2 @@ -188,7 +188,7 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: %bound_method.loc21_10.4: = bound_method %.loc21_10.4, %specific_fn.loc21_10.2 // CHECK:STDOUT: %Float.as.Copy.impl.Op.call: init %f64.d77 = call %bound_method.loc21_10.4(%.loc21_10.4) // CHECK:STDOUT: %.loc21_10.5: ref %f64.d77 = struct_access %return.param, element0 -// CHECK:STDOUT: %.loc21_10.6: init %f64.d77 to %.loc21_10.5 = initialize_from %Float.as.Copy.impl.Op.call +// CHECK:STDOUT: %.loc21_10.6: init %f64.d77 to %.loc21_10.5 = in_place_init %Float.as.Copy.impl.Op.call // CHECK:STDOUT: %.loc21_10.7: init %struct_type.a.b to %return.param = struct_init (%.loc21_10.3, %.loc21_10.6) // CHECK:STDOUT: %.loc21_11: init %struct_type.a.b = converted %y.ref, %.loc21_10.7 // CHECK:STDOUT: return %.loc21_11 to %return.param diff --git a/toolchain/check/testdata/struct/tuple_as_element.carbon b/toolchain/check/testdata/struct/tuple_as_element.carbon index 73da01fb0ab1..1bf3bbb63751 100644 --- a/toolchain/check/testdata/struct/tuple_as_element.carbon +++ b/toolchain/check/testdata/struct/tuple_as_element.carbon @@ -141,7 +141,7 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc15_50: init %i32 = call %bound_method.loc15_50.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_50.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc15_50 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc15_50.3: ref %i32 = struct_access file.%x.var, element0 [concrete = constants.%.ae3] -// CHECK:STDOUT: %.loc15_50.4: init %i32 to %.loc15_50.3 = initialize_from %.loc15_50.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc15_50.4: init %i32 to %.loc15_50.3 = in_place_init %.loc15_50.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc15_49: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc15_49.1: = bound_method %int_2, %impl.elem0.loc15_49 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc15_49: = specific_function %impl.elem0.loc15_49, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -151,7 +151,7 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %.loc15_50.5: ref %tuple.type.a1c = struct_access file.%x.var, element1 [concrete = constants.%.03e] // CHECK:STDOUT: %.loc15_49.3: init %tuple.type.a1c to %.loc15_50.5 = tuple_init (%.loc15_49.2) [concrete = constants.%tuple.092] // CHECK:STDOUT: %.loc15_50.6: init %tuple.type.a1c = converted %.loc15_49.1, %.loc15_49.3 [concrete = constants.%tuple.092] -// CHECK:STDOUT: %.loc15_50.7: init %tuple.type.a1c to %.loc15_50.5 = initialize_from %.loc15_50.6 [concrete = constants.%tuple.092] +// CHECK:STDOUT: %.loc15_50.7: init %tuple.type.a1c to %.loc15_50.5 = in_place_init %.loc15_50.6 [concrete = constants.%tuple.092] // CHECK:STDOUT: %.loc15_50.8: init %struct_type.a.b.3d5 to file.%x.var = struct_init (%.loc15_50.4, %.loc15_50.7) [concrete = constants.%struct.646] // CHECK:STDOUT: %.loc15_1: init %struct_type.a.b.3d5 = converted %.loc15_50.1, %.loc15_50.8 [concrete = constants.%struct.646] // CHECK:STDOUT: assign file.%x.var, %.loc15_1 @@ -164,7 +164,7 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %bound_method.loc16_32.2: = bound_method %.loc16_32.2, %specific_fn.loc16_32.1 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc16_32.1: init %i32 = call %bound_method.loc16_32.2(%.loc16_32.2) // CHECK:STDOUT: %.loc16_32.3: ref %i32 = struct_access file.%y.var, element0 [concrete = constants.%.a20] -// CHECK:STDOUT: %.loc16_32.4: init %i32 to %.loc16_32.3 = initialize_from %Int.as.Copy.impl.Op.call.loc16_32.1 +// CHECK:STDOUT: %.loc16_32.4: init %i32 to %.loc16_32.3 = in_place_init %Int.as.Copy.impl.Op.call.loc16_32.1 // CHECK:STDOUT: %.loc16_32.5: ref %tuple.type.a1c = struct_access %x.ref, element1 [concrete = constants.%.03e] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %.loc16_32.5, element0 [concrete = constants.%tuple.elem0.83d] // CHECK:STDOUT: %.loc16_32.6: %i32 = acquire_value %tuple.elem0 @@ -176,7 +176,7 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: %.loc16_32.7: ref %tuple.type.a1c = struct_access file.%y.var, element1 [concrete = constants.%.07f] // CHECK:STDOUT: %.loc16_32.8: init %tuple.type.a1c to %.loc16_32.7 = tuple_init (%Int.as.Copy.impl.Op.call.loc16_32.2) // CHECK:STDOUT: %.loc16_32.9: init %tuple.type.a1c = converted %.loc16_32.5, %.loc16_32.8 -// CHECK:STDOUT: %.loc16_32.10: init %tuple.type.a1c to %.loc16_32.7 = initialize_from %.loc16_32.9 +// CHECK:STDOUT: %.loc16_32.10: init %tuple.type.a1c to %.loc16_32.7 = in_place_init %.loc16_32.9 // CHECK:STDOUT: %.loc16_32.11: init %struct_type.a.b.3d5 to file.%y.var = struct_init (%.loc16_32.4, %.loc16_32.10) // CHECK:STDOUT: %.loc16_1: init %struct_type.a.b.3d5 = converted %x.ref, %.loc16_32.11 // CHECK:STDOUT: assign file.%y.var, %.loc16_1 diff --git a/toolchain/check/testdata/struct/two_entries.carbon b/toolchain/check/testdata/struct/two_entries.carbon index e81864b266ce..d76253fed285 100644 --- a/toolchain/check/testdata/struct/two_entries.carbon +++ b/toolchain/check/testdata/struct/two_entries.carbon @@ -176,7 +176,7 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18_44.1: init %i32 = call %bound_method.loc18_44.2(%int_1.loc18) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc18_44.2: init %i32 = converted %int_1.loc18, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18_44.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc18_44.3: ref %i32 = struct_access file.%x.var, element0 [concrete = constants.%.61d] -// CHECK:STDOUT: %.loc18_44.4: init %i32 to %.loc18_44.3 = initialize_from %.loc18_44.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc18_44.4: init %i32 to %.loc18_44.3 = in_place_init %.loc18_44.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc18_44.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc18_44.3: = bound_method %int_2.loc18, %impl.elem0.loc18_44.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc18_44.2: = specific_function %impl.elem0.loc18_44.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -184,7 +184,7 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18_44.2: init %i32 = call %bound_method.loc18_44.4(%int_2.loc18) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc18_44.5: init %i32 = converted %int_2.loc18, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc18_44.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc18_44.6: ref %i32 = struct_access file.%x.var, element1 [concrete = constants.%.fe1] -// CHECK:STDOUT: %.loc18_44.7: init %i32 to %.loc18_44.6 = initialize_from %.loc18_44.5 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc18_44.7: init %i32 to %.loc18_44.6 = in_place_init %.loc18_44.5 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc18_44.8: init %struct_type.a.b.501 to file.%x.var = struct_init (%.loc18_44.4, %.loc18_44.7) [concrete = constants.%struct.ed5] // CHECK:STDOUT: %.loc18_1: init %struct_type.a.b.501 = converted %.loc18_44.1, %.loc18_44.8 [concrete = constants.%struct.ed5] // CHECK:STDOUT: assign file.%x.var, %.loc18_1 @@ -197,7 +197,7 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %bound_method.loc19_29.2: = bound_method %.loc19_29.2, %specific_fn.loc19_29.1 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc19_29.1: init %i32 = call %bound_method.loc19_29.2(%.loc19_29.2) // CHECK:STDOUT: %.loc19_29.3: ref %i32 = struct_access file.%y.var, element0 [concrete = constants.%.101] -// CHECK:STDOUT: %.loc19_29.4: init %i32 to %.loc19_29.3 = initialize_from %Int.as.Copy.impl.Op.call.loc19_29.1 +// CHECK:STDOUT: %.loc19_29.4: init %i32 to %.loc19_29.3 = in_place_init %Int.as.Copy.impl.Op.call.loc19_29.1 // CHECK:STDOUT: %.loc19_29.5: ref %i32 = struct_access %x.ref, element1 [concrete = constants.%.fe1] // CHECK:STDOUT: %.loc19_29.6: %i32 = acquire_value %.loc19_29.5 // CHECK:STDOUT: %impl.elem0.loc19_29.2: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664] @@ -206,7 +206,7 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: %bound_method.loc19_29.4: = bound_method %.loc19_29.6, %specific_fn.loc19_29.2 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc19_29.2: init %i32 = call %bound_method.loc19_29.4(%.loc19_29.6) // CHECK:STDOUT: %.loc19_29.7: ref %i32 = struct_access file.%y.var, element1 [concrete = constants.%.960] -// CHECK:STDOUT: %.loc19_29.8: init %i32 to %.loc19_29.7 = initialize_from %Int.as.Copy.impl.Op.call.loc19_29.2 +// CHECK:STDOUT: %.loc19_29.8: init %i32 to %.loc19_29.7 = in_place_init %Int.as.Copy.impl.Op.call.loc19_29.2 // CHECK:STDOUT: %.loc19_29.9: init %struct_type.a.b.501 to file.%y.var = struct_init (%.loc19_29.4, %.loc19_29.8) // CHECK:STDOUT: %.loc19_1: init %struct_type.a.b.501 = converted %x.ref, %.loc19_29.9 // CHECK:STDOUT: assign file.%y.var, %.loc19_1 diff --git a/toolchain/check/testdata/tuple/basics.carbon b/toolchain/check/testdata/tuple/basics.carbon index c50a040bef46..8151b8fc0f19 100644 --- a/toolchain/check/testdata/tuple/basics.carbon +++ b/toolchain/check/testdata/tuple/basics.carbon @@ -138,15 +138,15 @@ var y: ((), ()) = x; // CHECK:STDOUT: %.loc4_38.1: %tuple.type.6e8 = tuple_literal (%.loc4_33.1, %.loc4_37.1) [concrete = constants.%tuple.0ca] // CHECK:STDOUT: %tuple.elem0.loc4_38: ref %tuple.type.bcd = tuple_access file.%x.var, element0 [concrete = constants.%tuple.elem0.876] // CHECK:STDOUT: %tuple.elem0.loc4_33: ref %empty_tuple.type = tuple_access %tuple.elem0.loc4_38, element0 [concrete = constants.%tuple.elem0.b2a] -// CHECK:STDOUT: %.loc4_28.2: init %empty_tuple.type to %tuple.elem0.loc4_33 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc4_28.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc4_33.2: init %empty_tuple.type = converted %.loc4_28.1, %.loc4_28.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %tuple.elem1.loc4_33: ref %empty_tuple.type = tuple_access %tuple.elem0.loc4_38, element1 [concrete = constants.%tuple.elem1.894] -// CHECK:STDOUT: %.loc4_32.2: init %empty_tuple.type to %tuple.elem1.loc4_33 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc4_32.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc4_33.3: init %empty_tuple.type = converted %.loc4_32.1, %.loc4_32.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc4_33.4: init %tuple.type.bcd to %tuple.elem0.loc4_38 = tuple_init (%.loc4_33.2, %.loc4_33.3) [concrete = constants.%tuple.d8f] // CHECK:STDOUT: %.loc4_38.2: init %tuple.type.bcd = converted %.loc4_33.1, %.loc4_33.4 [concrete = constants.%tuple.d8f] // CHECK:STDOUT: %tuple.elem1.loc4_38: ref %empty_tuple.type = tuple_access file.%x.var, element1 [concrete = constants.%tuple.elem1.adb] -// CHECK:STDOUT: %.loc4_37.2: init %empty_tuple.type to %tuple.elem1.loc4_38 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc4_37.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc4_38.3: init %empty_tuple.type = converted %.loc4_37.1, %.loc4_37.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc4_38.4: init %tuple.type.6e8 to file.%x.var = tuple_init (%.loc4_38.2, %.loc4_38.3) [concrete = constants.%tuple.0ca] // CHECK:STDOUT: %.loc4_1: init %tuple.type.6e8 = converted %.loc4_38.1, %.loc4_38.4 [concrete = constants.%tuple.0ca] @@ -162,7 +162,8 @@ var y: ((), ()) = x; // CHECK:STDOUT: %tuple.type: type = tuple_type (%empty_tuple.type) [concrete] // CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%empty_tuple) [concrete] // CHECK:STDOUT: %pattern_type: type = pattern_type %tuple.type [concrete] -// CHECK:STDOUT: %tuple.elem0: ref %empty_tuple.type = tuple_access file.%x.var, element0 [concrete] +// CHECK:STDOUT: %tuple.elem0.129: ref %empty_tuple.type = tuple_access file.%x.var, element0 [concrete] +// CHECK:STDOUT: %tuple.elem0.b49: ref %empty_tuple.type = tuple_access file.%y.var, element0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -196,16 +197,18 @@ var y: ((), ()) = x; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc4_18.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc4_20.1: %tuple.type = tuple_literal (%.loc4_18.1) [concrete = constants.%tuple] +// CHECK:STDOUT: %tuple.elem0.loc4: ref %empty_tuple.type = tuple_access file.%x.var, element0 [concrete = constants.%tuple.elem0.129] // CHECK:STDOUT: %.loc4_18.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc4_20.2: init %empty_tuple.type = converted %.loc4_18.1, %.loc4_18.2 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc4_20.3: init %tuple.type = tuple_init (%.loc4_20.2) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc4_20.3: init %tuple.type to file.%x.var = tuple_init (%.loc4_20.2) [concrete = constants.%tuple] // CHECK:STDOUT: %.loc4_1: init %tuple.type = converted %.loc4_20.1, %.loc4_20.3 [concrete = constants.%tuple] // CHECK:STDOUT: assign file.%x.var, %.loc4_1 // CHECK:STDOUT: %x.ref: ref %tuple.type = name_ref x, file.%x [concrete = file.%x.var] -// CHECK:STDOUT: %tuple.elem0: ref %empty_tuple.type = tuple_access %x.ref, element0 [concrete = constants.%tuple.elem0] +// CHECK:STDOUT: %tuple.elem0.loc5_16.1: ref %empty_tuple.type = tuple_access %x.ref, element0 [concrete = constants.%tuple.elem0.129] +// CHECK:STDOUT: %tuple.elem0.loc5_16.2: ref %empty_tuple.type = tuple_access file.%y.var, element0 [concrete = constants.%tuple.elem0.b49] // CHECK:STDOUT: %.loc5_16.1: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_16.2: init %empty_tuple.type = converted %tuple.elem0, %.loc5_16.1 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_16.3: init %tuple.type = tuple_init (%.loc5_16.2) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc5_16.2: init %empty_tuple.type = converted %tuple.elem0.loc5_16.1, %.loc5_16.1 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_16.3: init %tuple.type to file.%y.var = tuple_init (%.loc5_16.2) [concrete = constants.%tuple] // CHECK:STDOUT: %.loc5_1: init %tuple.type = converted %x.ref, %.loc5_16.3 [concrete = constants.%tuple] // CHECK:STDOUT: assign file.%y.var, %.loc5_1 // CHECK:STDOUT: @@ -296,10 +299,10 @@ var y: ((), ()) = x; // CHECK:STDOUT: %.loc7_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_26.1: %tuple.type = tuple_literal (%.loc7_21.1, %.loc7_25.1) [concrete = constants.%tuple] // CHECK:STDOUT: %tuple.elem0.loc7: ref %empty_tuple.type = tuple_access file.%x.var, element0 [concrete = constants.%tuple.elem0.f07] -// CHECK:STDOUT: %.loc7_21.2: init %empty_tuple.type to %tuple.elem0.loc7 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc7_21.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_26.2: init %empty_tuple.type = converted %.loc7_21.1, %.loc7_21.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %tuple.elem1.loc7: ref %empty_tuple.type = tuple_access file.%x.var, element1 [concrete = constants.%tuple.elem1.6f8] -// CHECK:STDOUT: %.loc7_25.2: init %empty_tuple.type to %tuple.elem1.loc7 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc7_25.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_26.3: init %empty_tuple.type = converted %.loc7_25.1, %.loc7_25.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc7_26.4: init %tuple.type to file.%x.var = tuple_init (%.loc7_26.2, %.loc7_26.3) [concrete = constants.%tuple] // CHECK:STDOUT: %.loc7_1: init %tuple.type = converted %.loc7_26.1, %.loc7_26.4 [concrete = constants.%tuple] @@ -307,11 +310,11 @@ var y: ((), ()) = x; // CHECK:STDOUT: %x.ref: ref %tuple.type = name_ref x, file.%x [concrete = file.%x.var] // CHECK:STDOUT: %tuple.elem0.loc8_19.1: ref %empty_tuple.type = tuple_access %x.ref, element0 [concrete = constants.%tuple.elem0.f07] // CHECK:STDOUT: %tuple.elem0.loc8_19.2: ref %empty_tuple.type = tuple_access file.%y.var, element0 [concrete = constants.%tuple.elem0.2e2] -// CHECK:STDOUT: %.loc8_19.1: init %empty_tuple.type to %tuple.elem0.loc8_19.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_19.1: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc8_19.2: init %empty_tuple.type = converted %tuple.elem0.loc8_19.1, %.loc8_19.1 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %tuple.elem1.loc8_19.1: ref %empty_tuple.type = tuple_access %x.ref, element1 [concrete = constants.%tuple.elem1.6f8] // CHECK:STDOUT: %tuple.elem1.loc8_19.2: ref %empty_tuple.type = tuple_access file.%y.var, element1 [concrete = constants.%tuple.elem1.a5b] -// CHECK:STDOUT: %.loc8_19.3: init %empty_tuple.type to %tuple.elem1.loc8_19.2 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_19.3: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc8_19.4: init %empty_tuple.type = converted %tuple.elem1.loc8_19.1, %.loc8_19.3 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc8_19.5: init %tuple.type to file.%y.var = tuple_init (%.loc8_19.2, %.loc8_19.4) [concrete = constants.%tuple] // CHECK:STDOUT: %.loc8_1: init %tuple.type = converted %x.ref, %.loc8_19.5 [concrete = constants.%tuple] diff --git a/toolchain/check/testdata/tuple/class_tuples.carbon b/toolchain/check/testdata/tuple/class_tuples.carbon index 79ef250d7a2d..20526aaf457b 100644 --- a/toolchain/check/testdata/tuple/class_tuples.carbon +++ b/toolchain/check/testdata/tuple/class_tuples.carbon @@ -21,17 +21,10 @@ class D {} var c: C; var d: D; -// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+14]]:19: error: cannot implicitly convert expression of type `C` to `C*` [ConversionFailure] +// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+7]]:19: error: cannot implicitly convert expression of type `C` to `C*` [ConversionFailure] // CHECK:STDERR: var x: (C*, C*) = (c, d); // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+11]]:19: note: type `C` does not implement interface `Core.ImplicitAs(C*)` [MissingImplInMemberAccessNote] -// CHECK:STDERR: var x: (C*, C*) = (c, d); -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: -// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+7]]:19: error: cannot implicitly convert expression of type `D` to `C*` [ConversionFailure] -// CHECK:STDERR: var x: (C*, C*) = (c, d); -// CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+4]]:19: note: type `D` does not implement interface `Core.ImplicitAs(C*)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+4]]:19: note: type `C` does not implement interface `Core.ImplicitAs(C*)` [MissingImplInMemberAccessNote] // CHECK:STDERR: var x: (C*, C*) = (c, d); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: diff --git a/toolchain/check/testdata/tuple/element_access.carbon b/toolchain/check/testdata/tuple/element_access.carbon index 7cf92d73fd0e..58b722cc7a50 100644 --- a/toolchain/check/testdata/tuple/element_access.carbon +++ b/toolchain/check/testdata/tuple/element_access.carbon @@ -209,6 +209,7 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] // CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [concrete] // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] +// CHECK:STDOUT: %tuple.elem0.aa1: ref %i32 = tuple_access file.%b.var, element0 [concrete] // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete] // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.824: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic] @@ -220,7 +221,6 @@ var b: i32 = a.({.index = 2}.index); // CHECK:STDOUT: %.f79: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete] // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete] // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] -// CHECK:STDOUT: %tuple.elem0.aa1: ref %i32 = tuple_access file.%b.var, element0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index cb3ac85e97ef..3a99cf750924 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -250,7 +250,7 @@ fn F() -> (i32,) { // CHECK:STDOUT: %specific_fn.loc5: = specific_function %impl.elem0.loc5, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn] // CHECK:STDOUT: %bound_method.loc5_17.2: = bound_method %.loc5_17.1, %specific_fn.loc5 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc5: init %i32 = call %bound_method.loc5_17.2(%.loc5_17.1) -// CHECK:STDOUT: %.loc5_17.2: init %tuple.type.dd4 = tuple_init (%Int.as.Copy.impl.Op.call.loc5) +// CHECK:STDOUT: %.loc5_17.2: init %tuple.type.dd4 to file.%a.var = tuple_init (%Int.as.Copy.impl.Op.call.loc5) // CHECK:STDOUT: %.loc5_1: init %tuple.type.dd4 = converted %a_ref.ref, %.loc5_17.2 // CHECK:STDOUT: assign file.%a.var, %.loc5_1 // CHECK:STDOUT: %b_ref.ref: ref %tuple.type.cfa = name_ref b_ref, imports.%Implicit.b_ref [concrete = imports.%b_ref.var] @@ -267,7 +267,7 @@ fn F() -> (i32,) { // CHECK:STDOUT: %tuple.elem0.loc6_38.5: ref %tuple.type.dd4 = tuple_access %tuple.elem0.loc6_38.4, element0 [concrete = constants.%tuple.elem0.021] // CHECK:STDOUT: %.loc6_38.2: init %tuple.type.dd4 to %tuple.elem0.loc6_38.5 = tuple_init (%Int.as.Copy.impl.Op.call.loc6_38.1) // CHECK:STDOUT: %.loc6_38.3: init %tuple.type.dd4 = converted %tuple.elem0.loc6_38.2, %.loc6_38.2 -// CHECK:STDOUT: %.loc6_38.4: init %tuple.type.dd4 to %tuple.elem0.loc6_38.5 = initialize_from %.loc6_38.3 +// CHECK:STDOUT: %.loc6_38.4: init %tuple.type.dd4 to %tuple.elem0.loc6_38.5 = in_place_init %.loc6_38.3 // CHECK:STDOUT: %tuple.elem1.loc6_38.1: ref %i32 = tuple_access %tuple.elem0.loc6_38.1, element1 [concrete = constants.%tuple.elem1.1c3] // CHECK:STDOUT: %.loc6_38.5: %i32 = acquire_value %tuple.elem1.loc6_38.1 // CHECK:STDOUT: %impl.elem0.loc6_38.2: %.70e = impl_witness_access constants.%Copy.impl_witness.a2f, element0 [concrete = constants.%Int.as.Copy.impl.Op.2b1] @@ -276,7 +276,7 @@ fn F() -> (i32,) { // CHECK:STDOUT: %bound_method.loc6_38.4: = bound_method %.loc6_38.5, %specific_fn.loc6_38.2 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc6_38.2: init %i32 = call %bound_method.loc6_38.4(%.loc6_38.5) // CHECK:STDOUT: %tuple.elem1.loc6_38.2: ref %i32 = tuple_access %tuple.elem0.loc6_38.4, element1 [concrete = constants.%tuple.elem1.83b] -// CHECK:STDOUT: %.loc6_38.6: init %i32 to %tuple.elem1.loc6_38.2 = initialize_from %Int.as.Copy.impl.Op.call.loc6_38.2 +// CHECK:STDOUT: %.loc6_38.6: init %i32 to %tuple.elem1.loc6_38.2 = in_place_init %Int.as.Copy.impl.Op.call.loc6_38.2 // CHECK:STDOUT: %.loc6_38.7: init %tuple.type.154 to %tuple.elem0.loc6_38.4 = tuple_init (%.loc6_38.4, %.loc6_38.6) // CHECK:STDOUT: %.loc6_38.8: init %tuple.type.154 = converted %tuple.elem0.loc6_38.1, %.loc6_38.7 // CHECK:STDOUT: %tuple.elem1.loc6_38.3: ref %tuple.type.c2c = tuple_access %b_ref.ref, element1 [concrete = constants.%tuple.elem1.565] @@ -289,7 +289,7 @@ fn F() -> (i32,) { // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc6_38.3: init %i32 = call %bound_method.loc6_38.6(%.loc6_38.9) // CHECK:STDOUT: %tuple.elem1.loc6_38.4: ref %tuple.type.c2c = tuple_access file.%b.var, element1 [concrete = constants.%tuple.elem1.11d] // CHECK:STDOUT: %tuple.elem0.loc6_38.7: ref %i32 = tuple_access %tuple.elem1.loc6_38.4, element0 [concrete = constants.%tuple.elem0.5bc] -// CHECK:STDOUT: %.loc6_38.10: init %i32 to %tuple.elem0.loc6_38.7 = initialize_from %Int.as.Copy.impl.Op.call.loc6_38.3 +// CHECK:STDOUT: %.loc6_38.10: init %i32 to %tuple.elem0.loc6_38.7 = in_place_init %Int.as.Copy.impl.Op.call.loc6_38.3 // CHECK:STDOUT: %tuple.elem1.loc6_38.5: ref %i32 = tuple_access %tuple.elem1.loc6_38.3, element1 [concrete = constants.%tuple.elem1.7b5] // CHECK:STDOUT: %.loc6_38.11: %i32 = acquire_value %tuple.elem1.loc6_38.5 // CHECK:STDOUT: %impl.elem0.loc6_38.4: %.70e = impl_witness_access constants.%Copy.impl_witness.a2f, element0 [concrete = constants.%Int.as.Copy.impl.Op.2b1] @@ -298,7 +298,7 @@ fn F() -> (i32,) { // CHECK:STDOUT: %bound_method.loc6_38.8: = bound_method %.loc6_38.11, %specific_fn.loc6_38.4 // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc6_38.4: init %i32 = call %bound_method.loc6_38.8(%.loc6_38.11) // CHECK:STDOUT: %tuple.elem1.loc6_38.6: ref %i32 = tuple_access %tuple.elem1.loc6_38.4, element1 [concrete = constants.%tuple.elem1.240] -// CHECK:STDOUT: %.loc6_38.12: init %i32 to %tuple.elem1.loc6_38.6 = initialize_from %Int.as.Copy.impl.Op.call.loc6_38.4 +// CHECK:STDOUT: %.loc6_38.12: init %i32 to %tuple.elem1.loc6_38.6 = in_place_init %Int.as.Copy.impl.Op.call.loc6_38.4 // CHECK:STDOUT: %.loc6_38.13: init %tuple.type.c2c to %tuple.elem1.loc6_38.4 = tuple_init (%.loc6_38.10, %.loc6_38.12) // CHECK:STDOUT: %.loc6_38.14: init %tuple.type.c2c = converted %tuple.elem1.loc6_38.3, %.loc6_38.13 // CHECK:STDOUT: %.loc6_38.15: init %tuple.type.cfa to file.%b.var = tuple_init (%.loc6_38.8, %.loc6_38.14) diff --git a/toolchain/check/testdata/tuple/in_place_tuple_init.carbon b/toolchain/check/testdata/tuple/in_place_tuple_init.carbon index 4585d4986239..898d4877f52d 100644 --- a/toolchain/check/testdata/tuple/in_place_tuple_init.carbon +++ b/toolchain/check/testdata/tuple/in_place_tuple_init.carbon @@ -250,7 +250,7 @@ fn H() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_50.1: init %i32 = call %bound_method.loc13_50.2(%int_1) [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %.loc13_50.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_50.1 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %tuple.elem0: ref %i32 = tuple_access %v.var, element0 -// CHECK:STDOUT: %.loc13_50.3: init %i32 to %tuple.elem0 = initialize_from %.loc13_50.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc13_50.3: init %i32 to %tuple.elem0 = in_place_init %.loc13_50.2 [concrete = constants.%int_1.5d2] // CHECK:STDOUT: %impl.elem0.loc13_50.2: %.863 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5] // CHECK:STDOUT: %bound_method.loc13_50.3: = bound_method %int_2, %impl.elem0.loc13_50.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.4e5] // CHECK:STDOUT: %specific_fn.loc13_50.2: = specific_function %impl.elem0.loc13_50.2, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn] @@ -258,7 +258,7 @@ fn H() { // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_50.2: init %i32 = call %bound_method.loc13_50.4(%int_2) [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_50.4: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc13_50.2 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %tuple.elem2: ref %i32 = tuple_access %v.var, element2 -// CHECK:STDOUT: %.loc13_50.5: init %i32 to %tuple.elem2 = initialize_from %.loc13_50.4 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc13_50.5: init %i32 to %tuple.elem2 = in_place_init %.loc13_50.4 [concrete = constants.%int_2.ef8] // CHECK:STDOUT: %.loc13_50.6: init %tuple.type.516 to %v.var = tuple_init (%.loc13_50.3, %F.call, %.loc13_50.5) // CHECK:STDOUT: %.loc13_3: init %tuple.type.516 = converted %.loc13_50.1, %.loc13_50.6 // CHECK:STDOUT: assign %v.var, %.loc13_3 diff --git a/toolchain/check/testdata/tuple/tuple_pattern.carbon b/toolchain/check/testdata/tuple/tuple_pattern.carbon index 42a38ace6f13..83ddd7e90d6b 100644 --- a/toolchain/check/testdata/tuple/tuple_pattern.carbon +++ b/toolchain/check/testdata/tuple/tuple_pattern.carbon @@ -170,10 +170,10 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: %.loc8_30.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc8_31.1: %tuple.type.b6b = tuple_literal (%.loc8_26.1, %.loc8_30.1) [concrete = constants.%tuple] // CHECK:STDOUT: %tuple.elem0.loc8_31: ref %empty_struct_type = tuple_access %.var.loc8, element0 -// CHECK:STDOUT: %.loc8_26.2: init %empty_struct_type to %tuple.elem0.loc8_31 = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc8_26.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc8_31.2: init %empty_struct_type = converted %.loc8_26.1, %.loc8_26.2 [concrete = constants.%empty_struct] // CHECK:STDOUT: %tuple.elem1.loc8_31: ref %empty_struct_type = tuple_access %.var.loc8, element1 -// CHECK:STDOUT: %.loc8_30.2: init %empty_struct_type to %tuple.elem1.loc8_31 = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc8_30.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc8_31.3: init %empty_struct_type = converted %.loc8_30.1, %.loc8_30.2 [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc8_31.4: init %tuple.type.b6b to %.var.loc8 = tuple_init (%.loc8_31.2, %.loc8_31.3) [concrete = constants.%tuple] // CHECK:STDOUT: %.loc8_3: init %tuple.type.b6b = converted %.loc8_31.1, %.loc8_31.4 [concrete = constants.%tuple] @@ -229,10 +229,10 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: %.loc6_31.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc6_32.1: %tuple.type.b6b = tuple_literal (%.loc6_27.1, %.loc6_31.1) [concrete = constants.%tuple] // CHECK:STDOUT: %tuple.elem0.loc6: ref %empty_struct_type = tuple_access %tuple.var, element0 -// CHECK:STDOUT: %.loc6_27.2: init %empty_struct_type to %tuple.elem0.loc6 = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc6_27.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc6_32.2: init %empty_struct_type = converted %.loc6_27.1, %.loc6_27.2 [concrete = constants.%empty_struct] // CHECK:STDOUT: %tuple.elem1.loc6: ref %empty_struct_type = tuple_access %tuple.var, element1 -// CHECK:STDOUT: %.loc6_31.2: init %empty_struct_type to %tuple.elem1.loc6 = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc6_31.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc6_32.3: init %empty_struct_type = converted %.loc6_31.1, %.loc6_31.2 [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc6_32.4: init %tuple.type.b6b to %tuple.var = tuple_init (%.loc6_32.2, %.loc6_32.3) [concrete = constants.%tuple] // CHECK:STDOUT: %.loc6_3: init %tuple.type.b6b = converted %.loc6_32.1, %.loc6_32.4 [concrete = constants.%tuple] @@ -256,11 +256,11 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: %tuple.ref: ref %tuple.type.b6b = name_ref tuple, %tuple // CHECK:STDOUT: %tuple.elem0.loc7_24.1: ref %empty_struct_type = tuple_access %tuple.ref, element0 // CHECK:STDOUT: %tuple.elem0.loc7_24.2: ref %empty_struct_type = tuple_access %.var, element0 -// CHECK:STDOUT: %.loc7_24.1: init %empty_struct_type to %tuple.elem0.loc7_24.2 = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc7_24.1: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc7_24.2: init %empty_struct_type = converted %tuple.elem0.loc7_24.1, %.loc7_24.1 [concrete = constants.%empty_struct] // CHECK:STDOUT: %tuple.elem1.loc7_24.1: ref %empty_struct_type = tuple_access %tuple.ref, element1 // CHECK:STDOUT: %tuple.elem1.loc7_24.2: ref %empty_struct_type = tuple_access %.var, element1 -// CHECK:STDOUT: %.loc7_24.3: init %empty_struct_type to %tuple.elem1.loc7_24.2 = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc7_24.3: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc7_24.4: init %empty_struct_type = converted %tuple.elem1.loc7_24.1, %.loc7_24.3 [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc7_24.5: init %tuple.type.b6b to %.var = tuple_init (%.loc7_24.2, %.loc7_24.4) [concrete = constants.%tuple] // CHECK:STDOUT: %.loc7_3: init %tuple.type.b6b = converted %tuple.ref, %.loc7_24.5 [concrete = constants.%tuple] @@ -319,11 +319,11 @@ let (a: {}, b: {}) = ({}, {}, {}); // CHECK:STDOUT: %tuple.ref: %tuple.type.b6b = name_ref tuple, %tuple.loc13_7 // CHECK:STDOUT: %tuple.elem0.loc14_24.1: %empty_struct_type = tuple_access %tuple.ref, element0 // CHECK:STDOUT: %tuple.elem0.loc14_24.2: ref %empty_struct_type = tuple_access %.var, element0 -// CHECK:STDOUT: %.loc14_24.1: init %empty_struct_type to %tuple.elem0.loc14_24.2 = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc14_24.1: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc14_24.2: init %empty_struct_type = converted %tuple.elem0.loc14_24.1, %.loc14_24.1 [concrete = constants.%empty_struct] // CHECK:STDOUT: %tuple.elem1.loc14_24.1: %empty_struct_type = tuple_access %tuple.ref, element1 // CHECK:STDOUT: %tuple.elem1.loc14_24.2: ref %empty_struct_type = tuple_access %.var, element1 -// CHECK:STDOUT: %.loc14_24.3: init %empty_struct_type to %tuple.elem1.loc14_24.2 = struct_init () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc14_24.3: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc14_24.4: init %empty_struct_type = converted %tuple.elem1.loc14_24.1, %.loc14_24.3 [concrete = constants.%empty_struct] // CHECK:STDOUT: %.loc14_24.5: init %tuple.type.b6b to %.var = tuple_init (%.loc14_24.2, %.loc14_24.4) [concrete = constants.%tuple] // CHECK:STDOUT: %.loc14_3: init %tuple.type.b6b = converted %tuple.ref, %.loc14_24.5 [concrete = constants.%tuple] diff --git a/toolchain/check/testdata/var/global_decl_with_init.carbon b/toolchain/check/testdata/var/global_decl_with_init.carbon index dfd46d486ca9..0e898138f1a7 100644 --- a/toolchain/check/testdata/var/global_decl_with_init.carbon +++ b/toolchain/check/testdata/var/global_decl_with_init.carbon @@ -38,6 +38,7 @@ var (x: (), y: ()) = ((), ()); // CHECK:STDOUT: %struct_type.v: type = struct_type {.v: %empty_tuple.type} [concrete] // CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.v [concrete] // CHECK:STDOUT: %struct: %struct_type.v = struct_value (%empty_tuple) [concrete] +// CHECK:STDOUT: %.c0c: ref %empty_tuple.type = struct_access file.%x.var, element0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -61,10 +62,11 @@ var (x: (), y: ()) = ((), ()); // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc4_26.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc4_27.1: %struct_type.v = struct_literal (%.loc4_26.1) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc4_27.2: ref %empty_tuple.type = struct_access file.%x.var, element0 [concrete = constants.%.c0c] // CHECK:STDOUT: %.loc4_26.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc4_27.2: init %empty_tuple.type = converted %.loc4_26.1, %.loc4_26.2 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc4_27.3: init %struct_type.v = struct_init (%.loc4_27.2) [concrete = constants.%struct] -// CHECK:STDOUT: %.loc4_1: init %struct_type.v = converted %.loc4_27.1, %.loc4_27.3 [concrete = constants.%struct] +// CHECK:STDOUT: %.loc4_27.3: init %empty_tuple.type = converted %.loc4_26.1, %.loc4_26.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc4_27.4: init %struct_type.v to file.%x.var = struct_init (%.loc4_27.3) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc4_1: init %struct_type.v = converted %.loc4_27.1, %.loc4_27.4 [concrete = constants.%struct] // CHECK:STDOUT: assign file.%x.var, %.loc4_1 // CHECK:STDOUT: return // CHECK:STDOUT: } @@ -162,10 +164,10 @@ var (x: (), y: ()) = ((), ()); // CHECK:STDOUT: %.loc4_28.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc4_29.1: %tuple.type = tuple_literal (%.loc4_24.1, %.loc4_28.1) [concrete = constants.%tuple] // CHECK:STDOUT: %tuple.elem0: ref %empty_tuple.type = tuple_access file.%.var, element0 [concrete = constants.%tuple.elem0] -// CHECK:STDOUT: %.loc4_24.2: init %empty_tuple.type to %tuple.elem0 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc4_24.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc4_29.2: init %empty_tuple.type = converted %.loc4_24.1, %.loc4_24.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %tuple.elem1: ref %empty_tuple.type = tuple_access file.%.var, element1 [concrete = constants.%tuple.elem1] -// CHECK:STDOUT: %.loc4_28.2: init %empty_tuple.type to %tuple.elem1 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc4_28.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc4_29.3: init %empty_tuple.type = converted %.loc4_28.1, %.loc4_28.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc4_29.4: init %tuple.type to file.%.var = tuple_init (%.loc4_29.2, %.loc4_29.3) [concrete = constants.%tuple] // CHECK:STDOUT: %.loc4_1: init %tuple.type = converted %.loc4_29.1, %.loc4_29.4 [concrete = constants.%tuple] diff --git a/toolchain/check/testdata/var/global_lookup.carbon b/toolchain/check/testdata/var/global_lookup.carbon index 0cf11fe3f565..7c06c56bea82 100644 --- a/toolchain/check/testdata/var/global_lookup.carbon +++ b/toolchain/check/testdata/var/global_lookup.carbon @@ -24,6 +24,7 @@ var y: {.v: ()} = x; // CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.v [concrete] // CHECK:STDOUT: %struct: %struct_type.v = struct_value (%empty_tuple) [concrete] // CHECK:STDOUT: %.c0c: ref %empty_tuple.type = struct_access file.%x.var, element0 [concrete] +// CHECK:STDOUT: %.ff0: ref %empty_tuple.type = struct_access file.%y.var, element0 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { @@ -59,17 +60,19 @@ var y: {.v: ()} = x; // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc15_26.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc15_27.1: %struct_type.v = struct_literal (%.loc15_26.1) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc15_27.2: ref %empty_tuple.type = struct_access file.%x.var, element0 [concrete = constants.%.c0c] // CHECK:STDOUT: %.loc15_26.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc15_27.2: init %empty_tuple.type = converted %.loc15_26.1, %.loc15_26.2 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc15_27.3: init %struct_type.v = struct_init (%.loc15_27.2) [concrete = constants.%struct] -// CHECK:STDOUT: %.loc15_1: init %struct_type.v = converted %.loc15_27.1, %.loc15_27.3 [concrete = constants.%struct] +// CHECK:STDOUT: %.loc15_27.3: init %empty_tuple.type = converted %.loc15_26.1, %.loc15_26.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc15_27.4: init %struct_type.v to file.%x.var = struct_init (%.loc15_27.3) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc15_1: init %struct_type.v = converted %.loc15_27.1, %.loc15_27.4 [concrete = constants.%struct] // CHECK:STDOUT: assign file.%x.var, %.loc15_1 // CHECK:STDOUT: %x.ref: ref %struct_type.v = name_ref x, file.%x [concrete = file.%x.var] // CHECK:STDOUT: %.loc16_19.1: ref %empty_tuple.type = struct_access %x.ref, element0 [concrete = constants.%.c0c] -// CHECK:STDOUT: %.loc16_19.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc16_19.3: init %empty_tuple.type = converted %.loc16_19.1, %.loc16_19.2 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc16_19.4: init %struct_type.v = struct_init (%.loc16_19.3) [concrete = constants.%struct] -// CHECK:STDOUT: %.loc16_1: init %struct_type.v = converted %x.ref, %.loc16_19.4 [concrete = constants.%struct] +// CHECK:STDOUT: %.loc16_19.2: ref %empty_tuple.type = struct_access file.%y.var, element0 [concrete = constants.%.ff0] +// CHECK:STDOUT: %.loc16_19.3: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc16_19.4: init %empty_tuple.type = converted %.loc16_19.1, %.loc16_19.3 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc16_19.5: init %struct_type.v to file.%y.var = struct_init (%.loc16_19.4) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc16_1: init %struct_type.v = converted %x.ref, %.loc16_19.5 [concrete = constants.%struct] // CHECK:STDOUT: assign file.%y.var, %.loc16_1 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/global_lookup_in_scope.carbon b/toolchain/check/testdata/var/global_lookup_in_scope.carbon index ef54ba7e45ce..66b8b38a04cf 100644 --- a/toolchain/check/testdata/var/global_lookup_in_scope.carbon +++ b/toolchain/check/testdata/var/global_lookup_in_scope.carbon @@ -28,9 +28,9 @@ fn Main() { // CHECK:STDOUT: %struct_type.v: type = struct_type {.v: %empty_tuple.type} [concrete] // CHECK:STDOUT: %pattern_type.c4c: type = pattern_type %struct_type.v [concrete] // CHECK:STDOUT: %struct: %struct_type.v = struct_value (%empty_tuple) [concrete] +// CHECK:STDOUT: %.c0c: ref %empty_tuple.type = struct_access file.%x.var, element0 [concrete] // CHECK:STDOUT: %Main.type: type = fn_type @Main [concrete] // CHECK:STDOUT: %Main: %Main.type = struct_value () [concrete] -// CHECK:STDOUT: %.c0c: ref %empty_tuple.type = struct_access file.%x.var, element0 [concrete] // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete] // CHECK:STDOUT: %DestroyOp.type: type = fn_type @DestroyOp [concrete] // CHECK:STDOUT: %DestroyOp: %DestroyOp.type = struct_value () [concrete] @@ -75,10 +75,11 @@ fn Main() { // CHECK:STDOUT: %y.var: ref %struct_type.v = var %y.var_patt // CHECK:STDOUT: %x.ref: ref %struct_type.v = name_ref x, file.%x [concrete = file.%x.var] // CHECK:STDOUT: %.loc5_21.1: ref %empty_tuple.type = struct_access %x.ref, element0 [concrete = constants.%.c0c] -// CHECK:STDOUT: %.loc5_21.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_21.3: init %empty_tuple.type = converted %.loc5_21.1, %.loc5_21.2 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc5_21.4: init %struct_type.v = struct_init (%.loc5_21.3) [concrete = constants.%struct] -// CHECK:STDOUT: %.loc5_3: init %struct_type.v = converted %x.ref, %.loc5_21.4 [concrete = constants.%struct] +// CHECK:STDOUT: %.loc5_21.2: ref %empty_tuple.type = struct_access %y.var, element0 +// CHECK:STDOUT: %.loc5_21.3: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_21.4: init %empty_tuple.type = converted %.loc5_21.1, %.loc5_21.3 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_21.5: init %struct_type.v to %y.var = struct_init (%.loc5_21.4) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc5_3: init %struct_type.v = converted %x.ref, %.loc5_21.5 [concrete = constants.%struct] // CHECK:STDOUT: assign %y.var, %.loc5_3 // CHECK:STDOUT: %.loc5_17: type = splice_block %struct_type.v [concrete = constants.%struct_type.v] { // CHECK:STDOUT: %.loc5_16.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] @@ -97,10 +98,11 @@ fn Main() { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %.loc2_26.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc2_27.1: %struct_type.v = struct_literal (%.loc2_26.1) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc2_27.2: ref %empty_tuple.type = struct_access file.%x.var, element0 [concrete = constants.%.c0c] // CHECK:STDOUT: %.loc2_26.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc2_27.2: init %empty_tuple.type = converted %.loc2_26.1, %.loc2_26.2 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc2_27.3: init %struct_type.v = struct_init (%.loc2_27.2) [concrete = constants.%struct] -// CHECK:STDOUT: %.loc2_1: init %struct_type.v = converted %.loc2_27.1, %.loc2_27.3 [concrete = constants.%struct] +// CHECK:STDOUT: %.loc2_27.3: init %empty_tuple.type = converted %.loc2_26.1, %.loc2_26.2 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc2_27.4: init %struct_type.v to file.%x.var = struct_init (%.loc2_27.3) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc2_1: init %struct_type.v = converted %.loc2_27.1, %.loc2_27.4 [concrete = constants.%struct] // CHECK:STDOUT: assign file.%x.var, %.loc2_1 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/var/var_pattern.carbon b/toolchain/check/testdata/var/var_pattern.carbon index 6bbf9a2860c4..94467a5de379 100644 --- a/toolchain/check/testdata/var/var_pattern.carbon +++ b/toolchain/check/testdata/var/var_pattern.carbon @@ -314,10 +314,10 @@ fn G() { // CHECK:STDOUT: %.loc5_30.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc5_31.1: %tuple.type = tuple_literal (%.loc5_26.1, %.loc5_30.1) [concrete = constants.%tuple] // CHECK:STDOUT: %tuple.elem0.loc5_31: ref %empty_tuple.type = tuple_access %.var, element0 -// CHECK:STDOUT: %.loc5_26.2: init %empty_tuple.type to %tuple.elem0.loc5_31 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_26.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc5_31.2: init %empty_tuple.type = converted %.loc5_26.1, %.loc5_26.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %tuple.elem1.loc5_31: ref %empty_tuple.type = tuple_access %.var, element1 -// CHECK:STDOUT: %.loc5_30.2: init %empty_tuple.type to %tuple.elem1.loc5_31 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_30.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc5_31.3: init %empty_tuple.type = converted %.loc5_30.1, %.loc5_30.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc5_31.4: init %tuple.type to %.var = tuple_init (%.loc5_31.2, %.loc5_31.3) [concrete = constants.%tuple] // CHECK:STDOUT: %.loc5_3: init %tuple.type = converted %.loc5_31.1, %.loc5_31.4 [concrete = constants.%tuple] @@ -388,10 +388,10 @@ fn G() { // CHECK:STDOUT: %.loc5_34.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc5_35.1: %tuple.type = tuple_literal (%.loc5_30.1, %.loc5_34.1) [concrete = constants.%tuple] // CHECK:STDOUT: %tuple.elem0.loc5_35: ref %empty_tuple.type = tuple_access %.var, element0 -// CHECK:STDOUT: %.loc5_30.2: init %empty_tuple.type to %tuple.elem0.loc5_35 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_30.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc5_35.2: init %empty_tuple.type = converted %.loc5_30.1, %.loc5_30.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %tuple.elem1.loc5_35: ref %empty_tuple.type = tuple_access %.var, element1 -// CHECK:STDOUT: %.loc5_34.2: init %empty_tuple.type to %tuple.elem1.loc5_35 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc5_34.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc5_35.3: init %empty_tuple.type = converted %.loc5_34.1, %.loc5_34.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc5_35.4: init %tuple.type to %.var = tuple_init (%.loc5_35.2, %.loc5_35.3) [concrete = constants.%tuple] // CHECK:STDOUT: %.loc5_7: init %tuple.type = converted %.loc5_35.1, %.loc5_35.4 [concrete = constants.%tuple] @@ -742,10 +742,10 @@ fn G() { // CHECK:STDOUT: %.loc9_43.2: %empty_tuple.type = converted %.loc9_43.1, %empty_tuple [concrete = constants.%empty_tuple] // CHECK:STDOUT: %x: %empty_tuple.type = value_binding x, %.loc9_43.2 // CHECK:STDOUT: %tuple.elem0.loc9_53: ref %empty_tuple.type = tuple_access %.var, element0 -// CHECK:STDOUT: %.loc9_48.2: init %empty_tuple.type to %tuple.elem0.loc9_53 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_48.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc9_53.2: init %empty_tuple.type = converted %.loc9_48.1, %.loc9_48.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %tuple.elem1.loc9_53: ref %empty_tuple.type = tuple_access %.var, element1 -// CHECK:STDOUT: %.loc9_52.2: init %empty_tuple.type to %tuple.elem1.loc9_53 = tuple_init () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc9_52.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc9_53.3: init %empty_tuple.type = converted %.loc9_52.1, %.loc9_52.2 [concrete = constants.%empty_tuple] // CHECK:STDOUT: %.loc9_53.4: init %tuple.type.bcd to %.var = tuple_init (%.loc9_53.2, %.loc9_53.3) [concrete = constants.%tuple.d8f] // CHECK:STDOUT: %.loc9_15.1: init %tuple.type.bcd = converted %.loc9_53.1, %.loc9_53.4 [concrete = constants.%tuple.d8f] diff --git a/toolchain/docs/check/README.md b/toolchain/docs/check/README.md index b424e3a45959..df9f80d35f34 100644 --- a/toolchain/docs/check/README.md +++ b/toolchain/docs/check/README.md @@ -299,6 +299,17 @@ after the `ir_name` -- in this example the `name_id` is `N`. From this we find that the instruction corresponds to an associated constant declaration in an interface like `let N:! i32;`. +In fact, the notation after the `:` records not just the instruction's type, but +also some information about its category, and the storage argument if it's an +initializer: + +- `%N: i32 = ...`: a value expression of type `i32`. +- `%N: init i32 = ...`: an initializing expression of type `i32` with no + storage argument. +- `%N: init i32 to %s = ...`: an initializing expression of type `i32` that + uses `%s` as its backing storage if needed. +- `%N: ref i32 = ...`: a reference of type `i32`. + Instructions producing a constant value, like `assoc_const_decl` above, are followed by their phase, either `[symbolic]` or `[template]`, and then `=` the value if it is the value of a different instruction. @@ -339,6 +350,14 @@ formatter will combine instructions together to make the IR more readable: followed by a `StructType` instruction, is collapsed into a single `struct_type{.field1: %value1, ..., .fieldN: %valueN}` line. +As noted above, initializer storage arguments are formatted with `... to %arg` +in the type position. To parallel that, the destination argument of a `return` +instruction is also formatted with `to`. For example: + +``` +return %N to %return.param +``` + These exceptions may be found in [toolchain/sem_ir/formatter.cpp](/toolchain/sem_ir/formatter.cpp). diff --git a/toolchain/lower/aggregate.cpp b/toolchain/lower/aggregate.cpp index f592d52eb9ce..d65d8eb277b9 100644 --- a/toolchain/lower/aggregate.cpp +++ b/toolchain/lower/aggregate.cpp @@ -40,6 +40,9 @@ static auto GetElementIndex(FunctionContext::TypeInFile type, return idx.index; } +// Extracts an element of an aggregate, such as a struct, tuple, or class, by +// index. Depending on the expression category and value representation of the +// aggregate input, this will either produce a value or a reference. auto GetAggregateElement(FunctionContext& context, SemIR::InstId aggr_inst_id, SemIR::ElementIndex idx, SemIR::InstId result_inst_id, llvm::Twine name) -> llvm::Value* { @@ -50,7 +53,8 @@ auto GetAggregateElement(FunctionContext& context, SemIR::InstId aggr_inst_id, case SemIR::ExprCategory::Error: case SemIR::ExprCategory::NotExpr: case SemIR::ExprCategory::Pattern: - case SemIR::ExprCategory::Initializing: + case SemIR::ExprCategory::ReprInitializing: + case SemIR::ExprCategory::InPlaceInitializing: case SemIR::ExprCategory::Mixed: CARBON_FATAL( "Unexpected expression category for aggregate access into {0}", @@ -194,10 +198,10 @@ auto EmitAggregateInitializer(FunctionContext& context, for (auto [i, ref_id] : llvm::enumerate(refs)) { if (context.sem_ir().constant_values().Get(ref_id).is_constant()) { auto dest_id = - SemIR::FindReturnSlotArgForInitializer(context.sem_ir(), ref_id); + SemIR::FindStorageArgForInitializer(context.sem_ir(), ref_id); auto src_id = ref_id; auto storage_type = context.GetTypeIdOfInst(dest_id); - context.FinishInit(storage_type, dest_id, src_id); + context.InitializeStorage(storage_type, dest_id, src_id); } } // TODO: Add a helper to poison a value slot. diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index c244226d4cef..f6ace4be4f45 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -181,7 +181,8 @@ auto FileContext::GetConstant(SemIR::ConstantId const_id, // initializing expressions, `FinishInit` will perform a copy if needed. switch (auto cat = SemIR::GetExprCategory(sem_ir(), const_inst_id)) { case SemIR::ExprCategory::Value: - case SemIR::ExprCategory::Initializing: + case SemIR::ExprCategory::ReprInitializing: + case SemIR::ExprCategory::InPlaceInitializing: break; case SemIR::ExprCategory::DurableRef: diff --git a/toolchain/lower/function_context.cpp b/toolchain/lower/function_context.cpp index 628b76d95f45..9ebc44ac6722 100644 --- a/toolchain/lower/function_context.cpp +++ b/toolchain/lower/function_context.cpp @@ -266,8 +266,8 @@ auto FunctionContext::GetDebugLoc(SemIR::InstId inst_id) -> llvm::DebugLoc { loc.column_number, di_subprogram_); } -auto FunctionContext::FinishInit(TypeInFile type, SemIR::InstId dest_id, - SemIR::InstId source_id) -> void { +auto FunctionContext::InitializeStorage(TypeInFile type, SemIR::InstId dest_id, + SemIR::InstId source_id) -> void { switch (GetInitRepr(type).kind) { case SemIR::InitRepr::None: break; diff --git a/toolchain/lower/function_context.h b/toolchain/lower/function_context.h index 23cb8ad2e3b5..38d4f1b63e86 100644 --- a/toolchain/lower/function_context.h +++ b/toolchain/lower/function_context.h @@ -178,12 +178,13 @@ class FunctionContext { auto StoreObject(TypeInFile type, llvm::Value* value, llvm::Value* addr) -> void; - // After emitting an initializer `init_id`, finishes performing the - // initialization of `dest_id` from that initializer. This is a no-op if the - // initialization was performed in-place, and otherwise performs a store or a - // copy. - auto FinishInit(TypeInFile type, SemIR::InstId dest_id, - SemIR::InstId source_id) -> void; + // Emits the instructions necessary to initialize the storage at `dest_id` + // from the repr-initializing expression `source_id`. This assumes the + // instructions for `source_id` have already been emitted, so it's a no-op if + // the initialization was performed in-place, and otherwise performs a store + // or a copy. + auto InitializeStorage(TypeInFile type, SemIR::InstId dest_id, + SemIR::InstId source_id) -> void; // When fingerprinting for a specific, adds the call, found in the function // body, to . `function_id` and `specific_id` are diff --git a/toolchain/lower/handle.cpp b/toolchain/lower/handle.cpp index 3d7331ccdde1..fbced2f83a22 100644 --- a/toolchain/lower/handle.cpp +++ b/toolchain/lower/handle.cpp @@ -13,6 +13,7 @@ #include "llvm/Support/Casting.h" #include "toolchain/lower/function_context.h" #include "toolchain/sem_ir/builtin_function_kind.h" +#include "toolchain/sem_ir/expr_info.h" #include "toolchain/sem_ir/function.h" #include "toolchain/sem_ir/inst.h" #include "toolchain/sem_ir/typed_insts.h" @@ -78,8 +79,11 @@ auto HandleInst(FunctionContext& context, SemIR::InstId inst_id, auto HandleInst(FunctionContext& context, SemIR::InstId /*inst_id*/, SemIR::Assign inst) -> void { - context.FinishInit(context.GetTypeIdOfInst(inst.lhs_id), inst.lhs_id, - inst.rhs_id); + if (SemIR::GetExprCategory(context.sem_ir(), inst.rhs_id) != + SemIR::ExprCategory::InPlaceInitializing) { + context.InitializeStorage(context.GetTypeIdOfInst(inst.lhs_id), inst.lhs_id, + inst.rhs_id); + } } auto HandleInst(FunctionContext& context, SemIR::InstId inst_id, @@ -199,9 +203,9 @@ auto HandleInst(FunctionContext& context, SemIR::InstId inst_id, } auto HandleInst(FunctionContext& context, SemIR::InstId /*inst_id*/, - SemIR::InitializeFrom inst) -> void { - context.FinishInit(context.GetTypeIdOfInst(inst.dest_id), inst.dest_id, - inst.src_id); + SemIR::InPlaceInit inst) -> void { + context.InitializeStorage(context.GetTypeIdOfInst(inst.dest_id), inst.dest_id, + inst.src_id); } auto HandleInst(FunctionContext& /*context*/, SemIR::InstId /*inst_id*/, @@ -264,13 +268,36 @@ auto HandleInst(FunctionContext& context, SemIR::InstId /*inst_id*/, context.builder().CreateRetVoid(); return; case SemIR::InitRepr::InPlace: - context.FinishInit(result_type, inst.dest_id, inst.expr_id); + CARBON_CHECK(context.GetValueRepr(result_type).repr.kind == + SemIR::ValueRepr::Pointer, + "TODO: Add support for ReturnExpr with custom value repr"); + // TODO: find a way to avoid the redundant call to GetInitRepr inside + // InitializeStorage. + context.InitializeStorage(result_type, inst.dest_id, inst.expr_id); context.builder().CreateRetVoid(); return; - case SemIR::InitRepr::ByCopy: - // The expression produces the value representation for the type. - context.builder().CreateRet(context.GetValue(inst.expr_id)); + case SemIR::InitRepr::ByCopy: { + auto* value = context.GetValue(inst.expr_id); + switch (SemIR::GetExprCategory(context.sem_ir(), inst.expr_id)) { + case SemIR::ExprCategory::Value: + case SemIR::ExprCategory::ReprInitializing: + case SemIR::ExprCategory::EphemeralRef: + case SemIR::ExprCategory::DurableRef: + break; + case SemIR::ExprCategory::InPlaceInitializing: + value = + context.builder().CreateLoad(context.GetType(result_type), value); + break; + case SemIR::ExprCategory::Mixed: + case SemIR::ExprCategory::RefTagged: + case SemIR::ExprCategory::NotExpr: + case SemIR::ExprCategory::Error: + case SemIR::ExprCategory::Pattern: + CARBON_FATAL("Unexpected category for `return` expression"); + } + context.builder().CreateRet(value); return; + } case SemIR::InitRepr::Abstract: CARBON_FATAL("Lowering return of abstract type {0}", result_type.file->types().GetAsInst(result_type.type_id)); diff --git a/toolchain/lower/handle_expr_category.cpp b/toolchain/lower/handle_expr_category.cpp index 4de7578cfcc4..37e32bb5fc3c 100644 --- a/toolchain/lower/handle_expr_category.cpp +++ b/toolchain/lower/handle_expr_category.cpp @@ -39,49 +39,17 @@ auto HandleInst(FunctionContext& context, SemIR::InstId inst_id, } auto HandleInst(FunctionContext& context, SemIR::InstId inst_id, - SemIR::InPlaceInit inst) -> void { - auto type = context.GetTypeIdOfInst(inst_id); - auto* value = context.GetValue(inst.dest_id); - - // If the initializing representation is by-value, and the value - // representation is by-copy, then we need to load from the storage. Otherwise - // we want a pointer to the result. - switch (context.GetInitRepr(type).kind) { - case SemIR::InitRepr::None: - case SemIR::InitRepr::InPlace: - break; - case SemIR::InitRepr::ByCopy: - switch (context.GetValueRepr(type).repr.kind) { - case SemIR::ValueRepr::Unknown: - CARBON_FATAL("Unexpected incomplete type"); - case SemIR::ValueRepr::Dependent: - CARBON_FATAL("Unexpected dependent type"); - case SemIR::ValueRepr::None: - case SemIR::ValueRepr::Pointer: - break; - case SemIR::ValueRepr::Copy: - value = context.builder().CreateLoad(context.GetType(type), value); - break; - case SemIR::ValueRepr::Custom: - CARBON_FATAL( - "TODO: Add support for InPlaceInit with custom value rep"); - } - break; - case SemIR::InitRepr::Abstract: - CARBON_FATAL("Unexpected abstract type"); - case SemIR::InitRepr::Incomplete: - CARBON_FATAL("Unexpected incomplete type"); - case SemIR::InitRepr::Dependent: - CARBON_FATAL("Unexpected dependent type"); - } - - context.SetLocal(inst_id, value); + SemIR::MarkInPlaceInit inst) -> void { + context.SetLocal(inst_id, context.GetValue(inst.dest_id)); } auto HandleInst(FunctionContext& context, SemIR::InstId inst_id, SemIR::Temporary inst) -> void { - context.FinishInit(context.GetTypeIdOfInst(inst_id), inst.storage_id, - inst.init_id); + if (SemIR::GetExprCategory(context.sem_ir(), inst.init_id) != + SemIR::ExprCategory::InPlaceInitializing) { + context.InitializeStorage(context.GetTypeIdOfInst(inst_id), inst.storage_id, + inst.init_id); + } context.SetLocal(inst_id, context.GetValue(inst.storage_id)); } @@ -104,7 +72,7 @@ auto HandleInst(FunctionContext& context, SemIR::InstId inst_id, auto HandleInst(FunctionContext& context, SemIR::InstId inst_id, SemIR::ValueOfInitializer inst) -> void { CARBON_CHECK(SemIR::GetExprCategory(context.sem_ir(), inst.init_id) == - SemIR::ExprCategory::Initializing); + SemIR::ExprCategory::ReprInitializing); auto inst_type = context.GetTypeIdOfInst(inst_id); auto value_repr = context.GetValueRepr(inst_type); auto init_repr = context.GetInitRepr(inst_type); diff --git a/toolchain/lower/testdata/interop/cpp/nullptr.carbon b/toolchain/lower/testdata/interop/cpp/nullptr.carbon index 58fca65fa66a..f18315d418b4 100644 --- a/toolchain/lower/testdata/interop/cpp/nullptr.carbon +++ b/toolchain/lower/testdata/interop/cpp/nullptr.carbon @@ -123,12 +123,8 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) { // CHECK:STDOUT: define ptr @_CReturnConvertedNullptrIndirectly.Main() #2 !dbg !36 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %a.var = alloca ptr, align 8, !dbg !37 -// CHECK:STDOUT: %.loc27_44.1.temp = alloca ptr, align 8, !dbg !38 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %a.var), !dbg !37 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc27_44.1.temp), !dbg !38 -// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk(ptr %.loc27_44.1.temp), !dbg !38 -// CHECK:STDOUT: %.loc27_44.2 = load ptr, ptr %.loc27_44.1.temp, align 8, !dbg !38 -// CHECK:STDOUT: store ptr %.loc27_44.2, ptr %a.var, align 8, !dbg !37 +// CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk(ptr %a.var), !dbg !38 // CHECK:STDOUT: %.loc28_10 = load ptr, ptr %a.var, align 8, !dbg !39 // CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.95db8d3a03540861.Core.b88d1103f417c6d4"(ptr %.loc28_10), !dbg !40 // CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !40 @@ -140,8 +136,8 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) { // CHECK:STDOUT: %.loc32_28.1.temp = alloca ptr, align 8, !dbg !42 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc32_28.1.temp), !dbg !42 // CHECK:STDOUT: call void @_Z13ReturnNullptrv.carbon_thunk(ptr %.loc32_28.1.temp), !dbg !42 -// CHECK:STDOUT: %.loc32_28.2 = load ptr, ptr %.loc32_28.1.temp, align 8, !dbg !42 -// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.95db8d3a03540861.Core.b88d1103f417c6d4"(ptr %.loc32_28.2), !dbg !43 +// CHECK:STDOUT: %.loc32_28.4 = load ptr, ptr %.loc32_28.1.temp, align 8, !dbg !42 +// CHECK:STDOUT: %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call = call ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.95db8d3a03540861.Core.b88d1103f417c6d4"(ptr %.loc32_28.4), !dbg !43 // CHECK:STDOUT: ret ptr %Cpp.nullptr_t.as.ImplicitAs.impl.Convert.call, !dbg !43 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -170,7 +166,7 @@ fn ConvertNullptrConstant() -> Core.Optional(i32*) { // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives // CHECK:STDOUT: uselistorder ptr @"_CConvert.NullptrT.CppCompat.Core:ImplicitAs.95db8d3a03540861.Core.b88d1103f417c6d4", { 3, 2, 1, 0 } -// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 5, 4, 3, 2, 1, 0 } +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 4, 3, 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { 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 #1 = { "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" } diff --git a/toolchain/lower/testdata/interop/cpp/return.carbon b/toolchain/lower/testdata/interop/cpp/return.carbon index eb3982ae0d37..29f37c085270 100644 --- a/toolchain/lower/testdata/interop/cpp/return.carbon +++ b/toolchain/lower/testdata/interop/cpp/return.carbon @@ -175,8 +175,8 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: %.loc6_40.1.temp = alloca i8, align 1, !dbg !24 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc6_40.1.temp), !dbg !24 // CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk(ptr %.loc6_40.1.temp), !dbg !24 -// CHECK:STDOUT: %.loc6_40.2 = load i8, ptr %.loc6_40.1.temp, align 1, !dbg !24 -// CHECK:STDOUT: ret i8 %.loc6_40.2, !dbg !25 +// CHECK:STDOUT: %0 = load i8, ptr %.loc6_40.1.temp, align 1, !dbg !25 +// CHECK:STDOUT: ret i8 %0, !dbg !25 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind @@ -185,8 +185,8 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: %.loc7_43.1.temp = alloca i16, align 2, !dbg !30 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc7_43.1.temp), !dbg !30 // CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk(ptr %.loc7_43.1.temp), !dbg !30 -// CHECK:STDOUT: %.loc7_43.2 = load i16, ptr %.loc7_43.1.temp, align 2, !dbg !30 -// CHECK:STDOUT: ret i16 %.loc7_43.2, !dbg !31 +// CHECK:STDOUT: %0 = load i16, ptr %.loc7_43.1.temp, align 2, !dbg !31 +// CHECK:STDOUT: ret i16 %0, !dbg !31 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind @@ -213,8 +213,8 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: %.loc11_40.1.temp = alloca i8, align 1, !dbg !48 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc11_40.1.temp), !dbg !48 // CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk(ptr %.loc11_40.1.temp), !dbg !48 -// CHECK:STDOUT: %.loc11_40.2 = load i8, ptr %.loc11_40.1.temp, align 1, !dbg !48 -// CHECK:STDOUT: ret i8 %.loc11_40.2, !dbg !49 +// CHECK:STDOUT: %0 = load i8, ptr %.loc11_40.1.temp, align 1, !dbg !49 +// CHECK:STDOUT: ret i8 %0, !dbg !49 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind @@ -223,8 +223,8 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: %.loc12_43.1.temp = alloca i16, align 2, !dbg !54 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc12_43.1.temp), !dbg !54 // CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk(ptr %.loc12_43.1.temp), !dbg !54 -// CHECK:STDOUT: %.loc12_43.2 = load i16, ptr %.loc12_43.1.temp, align 2, !dbg !54 -// CHECK:STDOUT: ret i16 %.loc12_43.2, !dbg !55 +// CHECK:STDOUT: %0 = load i16, ptr %.loc12_43.1.temp, align 2, !dbg !55 +// CHECK:STDOUT: ret i16 %0, !dbg !55 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: ; Function Attrs: nounwind @@ -256,21 +256,21 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: %.loc25_35.1.temp = alloca i16, align 2, !dbg !74 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_32.1.temp), !dbg !71 // CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk(ptr %.loc19_32.1.temp), !dbg !71 -// CHECK:STDOUT: %.loc19_32.2 = load i8, ptr %.loc19_32.1.temp, align 1, !dbg !71 +// CHECK:STDOUT: %.loc19_32.4 = load i8, ptr %.loc19_32.1.temp, align 1, !dbg !71 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc20_35.1.temp), !dbg !72 // CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk(ptr %.loc20_35.1.temp), !dbg !72 -// CHECK:STDOUT: %.loc20_35.2 = load i16, ptr %.loc20_35.1.temp, align 2, !dbg !72 +// CHECK:STDOUT: %.loc20_35.4 = load i16, ptr %.loc20_35.1.temp, align 2, !dbg !72 // CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !75 // CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !76 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_32.1.temp), !dbg !73 // CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk(ptr %.loc24_32.1.temp), !dbg !73 -// CHECK:STDOUT: %.loc24_32.2 = load i8, ptr %.loc24_32.1.temp, align 1, !dbg !73 +// CHECK:STDOUT: %.loc24_32.4 = load i8, ptr %.loc24_32.1.temp, align 1, !dbg !73 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc25_35.1.temp), !dbg !74 // CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk(ptr %.loc25_35.1.temp), !dbg !74 -// CHECK:STDOUT: %.loc25_35.2 = load i16, ptr %.loc25_35.1.temp, align 2, !dbg !74 +// CHECK:STDOUT: %.loc25_35.4 = load i16, ptr %.loc25_35.1.temp, align 2, !dbg !74 // CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !77 // CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !78 -// CHECK:STDOUT: call void @_CUse.Main(i8 %.loc19_32.2, i16 %.loc20_35.2, i32 %ReturnU32.call, i64 %ReturnU64.call, i8 %.loc24_32.2, i16 %.loc25_35.2, i32 %ReturnI32.call, i64 %ReturnI64.call), !dbg !79 +// CHECK:STDOUT: call void @_CUse.Main(i8 %.loc19_32.4, i16 %.loc20_35.4, i32 %ReturnU32.call, i64 %ReturnU64.call, i8 %.loc24_32.4, i16 %.loc25_35.4, i32 %ReturnI32.call, i64 %ReturnI64.call), !dbg !79 // CHECK:STDOUT: ret void, !dbg !80 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -278,49 +278,33 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: define void @_CVars.Main() #2 !dbg !81 { // CHECK:STDOUT: entry: // CHECK:STDOUT: %my_u8.var = alloca i8, align 1, !dbg !82 -// CHECK:STDOUT: %.loc33_32.1.temp = alloca i8, align 1, !dbg !83 -// CHECK:STDOUT: %my_u16.var = alloca i16, align 2, !dbg !84 -// CHECK:STDOUT: %.loc34_35.1.temp = alloca i16, align 2, !dbg !85 -// CHECK:STDOUT: %my_u32.var = alloca i32, align 4, !dbg !86 -// CHECK:STDOUT: %my_u64.var = alloca i64, align 8, !dbg !87 -// CHECK:STDOUT: %my_i8.var = alloca i8, align 1, !dbg !88 -// CHECK:STDOUT: %.loc38_32.1.temp = alloca i8, align 1, !dbg !89 -// CHECK:STDOUT: %my_i16.var = alloca i16, align 2, !dbg !90 -// CHECK:STDOUT: %.loc39_35.1.temp = alloca i16, align 2, !dbg !91 -// CHECK:STDOUT: %my_i32.var = alloca i32, align 4, !dbg !92 -// CHECK:STDOUT: %my_i64.var = alloca i64, align 8, !dbg !93 +// CHECK:STDOUT: %my_u16.var = alloca i16, align 2, !dbg !83 +// CHECK:STDOUT: %my_u32.var = alloca i32, align 4, !dbg !84 +// CHECK:STDOUT: %my_u64.var = alloca i64, align 8, !dbg !85 +// CHECK:STDOUT: %my_i8.var = alloca i8, align 1, !dbg !86 +// CHECK:STDOUT: %my_i16.var = alloca i16, align 2, !dbg !87 +// CHECK:STDOUT: %my_i32.var = alloca i32, align 4, !dbg !88 +// CHECK:STDOUT: %my_i64.var = alloca i64, align 8, !dbg !89 // CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u8.var), !dbg !82 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc33_32.1.temp), !dbg !83 -// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk(ptr %.loc33_32.1.temp), !dbg !83 -// CHECK:STDOUT: %.loc33_32.2 = load i8, ptr %.loc33_32.1.temp, align 1, !dbg !83 -// CHECK:STDOUT: store i8 %.loc33_32.2, ptr %my_u8.var, align 1, !dbg !82 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u16.var), !dbg !84 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc34_35.1.temp), !dbg !85 -// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk(ptr %.loc34_35.1.temp), !dbg !85 -// CHECK:STDOUT: %.loc34_35.2 = load i16, ptr %.loc34_35.1.temp, align 2, !dbg !85 -// CHECK:STDOUT: store i16 %.loc34_35.2, ptr %my_u16.var, align 2, !dbg !84 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u32.var), !dbg !86 -// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !94 -// CHECK:STDOUT: store i32 %ReturnU32.call, ptr %my_u32.var, align 4, !dbg !86 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u64.var), !dbg !87 -// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !95 -// CHECK:STDOUT: store i64 %ReturnU64.call, ptr %my_u64.var, align 8, !dbg !87 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i8.var), !dbg !88 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc38_32.1.temp), !dbg !89 -// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk(ptr %.loc38_32.1.temp), !dbg !89 -// CHECK:STDOUT: %.loc38_32.2 = load i8, ptr %.loc38_32.1.temp, align 1, !dbg !89 -// CHECK:STDOUT: store i8 %.loc38_32.2, ptr %my_i8.var, align 1, !dbg !88 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i16.var), !dbg !90 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc39_35.1.temp), !dbg !91 -// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk(ptr %.loc39_35.1.temp), !dbg !91 -// CHECK:STDOUT: %.loc39_35.2 = load i16, ptr %.loc39_35.1.temp, align 2, !dbg !91 -// CHECK:STDOUT: store i16 %.loc39_35.2, ptr %my_i16.var, align 2, !dbg !90 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i32.var), !dbg !92 +// CHECK:STDOUT: call void @_Z8ReturnU8v.carbon_thunk(ptr %my_u8.var), !dbg !90 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u16.var), !dbg !83 +// CHECK:STDOUT: call void @_Z9ReturnU16v.carbon_thunk(ptr %my_u16.var), !dbg !91 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u32.var), !dbg !84 +// CHECK:STDOUT: %ReturnU32.call = call i32 @_Z9ReturnU32v(), !dbg !92 +// CHECK:STDOUT: store i32 %ReturnU32.call, ptr %my_u32.var, align 4, !dbg !84 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_u64.var), !dbg !85 +// CHECK:STDOUT: %ReturnU64.call = call i64 @_Z9ReturnU64v(), !dbg !93 +// CHECK:STDOUT: store i64 %ReturnU64.call, ptr %my_u64.var, align 8, !dbg !85 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i8.var), !dbg !86 +// CHECK:STDOUT: call void @_Z8ReturnI8v.carbon_thunk(ptr %my_i8.var), !dbg !94 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i16.var), !dbg !87 +// CHECK:STDOUT: call void @_Z9ReturnI16v.carbon_thunk(ptr %my_i16.var), !dbg !95 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i32.var), !dbg !88 // CHECK:STDOUT: %ReturnI32.call = call i32 @_Z9ReturnI32v(), !dbg !96 -// CHECK:STDOUT: store i32 %ReturnI32.call, ptr %my_i32.var, align 4, !dbg !92 -// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i64.var), !dbg !93 +// CHECK:STDOUT: store i32 %ReturnI32.call, ptr %my_i32.var, align 4, !dbg !88 +// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %my_i64.var), !dbg !89 // CHECK:STDOUT: %ReturnI64.call = call i64 @_Z9ReturnI64v(), !dbg !97 -// CHECK:STDOUT: store i64 %ReturnI64.call, ptr %my_i64.var, align 8, !dbg !93 +// CHECK:STDOUT: store i64 %ReturnI64.call, ptr %my_i64.var, align 8, !dbg !89 // CHECK:STDOUT: %.loc43_7 = load i8, ptr %my_u8.var, align 1, !dbg !98 // CHECK:STDOUT: %.loc43_14 = load i16, ptr %my_u16.var, align 2, !dbg !99 // CHECK:STDOUT: %.loc43_22 = load i32, ptr %my_u32.var, align 4, !dbg !100 @@ -337,7 +321,7 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #3 // CHECK:STDOUT: // CHECK:STDOUT: ; uselistorder directives -// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 } +// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 } // CHECK:STDOUT: // CHECK:STDOUT: attributes #0 = { 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 #1 = { "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" } @@ -431,19 +415,19 @@ fn Call(x: Cpp.D) -> Cpp.C { // CHECK:STDOUT: !80 = !DILocation(line: 18, column: 1, scope: !68) // CHECK:STDOUT: !81 = distinct !DISubprogram(name: "Vars", linkageName: "_CVars.Main", scope: null, file: !7, line: 32, type: !69, spFlags: DISPFlagDefinition, unit: !6) // CHECK:STDOUT: !82 = !DILocation(line: 33, column: 3, scope: !81) -// CHECK:STDOUT: !83 = !DILocation(line: 33, column: 19, scope: !81) -// CHECK:STDOUT: !84 = !DILocation(line: 34, column: 3, scope: !81) -// CHECK:STDOUT: !85 = !DILocation(line: 34, column: 21, scope: !81) -// CHECK:STDOUT: !86 = !DILocation(line: 35, column: 3, scope: !81) -// CHECK:STDOUT: !87 = !DILocation(line: 36, column: 3, scope: !81) -// CHECK:STDOUT: !88 = !DILocation(line: 38, column: 3, scope: !81) -// CHECK:STDOUT: !89 = !DILocation(line: 38, column: 19, scope: !81) -// CHECK:STDOUT: !90 = !DILocation(line: 39, column: 3, scope: !81) -// CHECK:STDOUT: !91 = !DILocation(line: 39, column: 21, scope: !81) -// CHECK:STDOUT: !92 = !DILocation(line: 40, column: 3, scope: !81) -// CHECK:STDOUT: !93 = !DILocation(line: 41, column: 3, scope: !81) -// CHECK:STDOUT: !94 = !DILocation(line: 35, column: 21, scope: !81) -// CHECK:STDOUT: !95 = !DILocation(line: 36, column: 21, scope: !81) +// CHECK:STDOUT: !83 = !DILocation(line: 34, column: 3, scope: !81) +// CHECK:STDOUT: !84 = !DILocation(line: 35, column: 3, scope: !81) +// CHECK:STDOUT: !85 = !DILocation(line: 36, column: 3, scope: !81) +// CHECK:STDOUT: !86 = !DILocation(line: 38, column: 3, scope: !81) +// CHECK:STDOUT: !87 = !DILocation(line: 39, column: 3, scope: !81) +// CHECK:STDOUT: !88 = !DILocation(line: 40, column: 3, scope: !81) +// CHECK:STDOUT: !89 = !DILocation(line: 41, column: 3, scope: !81) +// CHECK:STDOUT: !90 = !DILocation(line: 33, column: 19, scope: !81) +// CHECK:STDOUT: !91 = !DILocation(line: 34, column: 21, scope: !81) +// CHECK:STDOUT: !92 = !DILocation(line: 35, column: 21, scope: !81) +// CHECK:STDOUT: !93 = !DILocation(line: 36, column: 21, scope: !81) +// CHECK:STDOUT: !94 = !DILocation(line: 38, column: 19, scope: !81) +// CHECK:STDOUT: !95 = !DILocation(line: 39, column: 21, scope: !81) // CHECK:STDOUT: !96 = !DILocation(line: 40, column: 21, scope: !81) // CHECK:STDOUT: !97 = !DILocation(line: 41, column: 21, scope: !81) // CHECK:STDOUT: !98 = !DILocation(line: 43, column: 7, scope: !81) diff --git a/toolchain/sem_ir/expr_info.cpp b/toolchain/sem_ir/expr_info.cpp index 3c669442ad6b..6f7fdb898c80 100644 --- a/toolchain/sem_ir/expr_info.cpp +++ b/toolchain/sem_ir/expr_info.cpp @@ -69,12 +69,12 @@ static auto GetExprCategoryImpl(const File* ir, InstId inst_id) *ir, callee_function.resolved_specific_id); if (!return_form_id.has_value()) { // Treat as equivalent to `-> ()`. - return ExprCategory::Initializing; + return ExprCategory::ReprInitializing; } auto return_form = ir->insts().Get(return_form_id); CARBON_KIND_SWITCH(return_form) { case CARBON_KIND(InitForm _): - return ExprCategory::Initializing; + return ExprCategory::ReprInitializing; case CARBON_KIND(RefForm _): return ExprCategory::DurableRef; case CARBON_KIND(ErrorInst _): @@ -88,7 +88,7 @@ static auto GetExprCategoryImpl(const File* ir, InstId inst_id) } case CARBON_KIND(SemIR::CalleeCppOverloadSet _): { // TODO: support `ref` returns from C++. - return ExprCategory::Initializing; + return ExprCategory::ReprInitializing; } } } else { @@ -140,8 +140,8 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory { return GetExprCategoryImpl(&file, inst_id); } -auto FindReturnSlotArgForInitializer(const File& sem_ir, InstId init_id, - bool allow_transitive) -> InstId { +auto FindStorageArgForInitializer(const File& sem_ir, InstId init_id, + bool allow_transitive) -> InstId { while (true) { Inst init_untyped = sem_ir.insts().Get(init_id); CARBON_KIND_SWITCH(init_untyped) { @@ -171,13 +171,10 @@ auto FindReturnSlotArgForInitializer(const File& sem_ir, InstId init_id, case CARBON_KIND(TupleInit init): { return init.dest_id; } - case CARBON_KIND(InitializeFrom init): { + case CARBON_KIND(InPlaceInit init): { return init.dest_id; } - case CARBON_KIND(InPlaceInit init): { - if (!InitRepr::ForType(sem_ir, init.type_id).MightBeInPlace()) { - return InstId::None; - } + case CARBON_KIND(MarkInPlaceInit init): { return init.dest_id; } case CARBON_KIND(Call call): { diff --git a/toolchain/sem_ir/expr_info.h b/toolchain/sem_ir/expr_info.h index 81136b362963..f4f91a3032ce 100644 --- a/toolchain/sem_ir/expr_info.h +++ b/toolchain/sem_ir/expr_info.h @@ -21,13 +21,23 @@ inline auto IsRefCategory(ExprCategory cat) -> bool { return cat == ExprCategory::DurableRef || cat == ExprCategory::EphemeralRef; } -// Given a primitive-form initializing expression, find its return slot -// argument. If `allow_transitive` is true, the result may be an argument to -// some other inst whose outcome is forwarded by `init_id`; otherwise the result -// must be an argument to `init_id` itself. Returns `None` if no such return -// slot is found. -auto FindReturnSlotArgForInitializer(const File& sem_ir, InstId init_id, - bool allow_transitive = true) -> InstId; +// Returns whether the given expression category is for an initializer +// (see inst_kind.h for background). +inline auto IsInitializerCategory(ExprCategory cat) -> bool { + return cat == ExprCategory::ReprInitializing || + cat == ExprCategory::InPlaceInitializing; +} + +// If `init_id` is an initializer, find the inst ID that specifies the storage +// to initialize, if any. If `allow_transitive` is true, the result may be an +// argument to some other inst whose outcome is forwarded by `init_id`; +// otherwise the result must be an argument to `init_id` itself. Returns `None` +// if there is no such storage argument. When `allow_transitive` is true, this +// can only return `None` if `init_id` is known not to perform in-place +// initialization; i.e. its type's initializing representation is not in-place, +// and its category is `Initializing`. +auto FindStorageArgForInitializer(const File& sem_ir, InstId init_id, + bool allow_transitive = true) -> InstId; } // namespace Carbon::SemIR diff --git a/toolchain/sem_ir/formatter.cpp b/toolchain/sem_ir/formatter.cpp index 7551edca4acb..7d553f34777c 100644 --- a/toolchain/sem_ir/formatter.cpp +++ b/toolchain/sem_ir/formatter.cpp @@ -1029,10 +1029,11 @@ auto Formatter::FormatInstLhs(InstId inst_id, Inst inst) -> void { out_ << "ref "; FormatTypeOfInst(inst_id); break; - case ExprCategory::Initializing: { + case ExprCategory::InPlaceInitializing: + case ExprCategory::ReprInitializing: { out_ << "init "; FormatTypeOfInst(inst_id); - auto init_target_id = FindReturnSlotArgForInitializer( + auto init_target_id = FindStorageArgForInitializer( *sem_ir_, inst_id, /*allow_transitive=*/false); FormatReturnSlotArg(init_target_id); break; @@ -1159,7 +1160,7 @@ auto Formatter::FormatInstRhs(Inst inst) -> void { return; } - case CARBON_KIND(InitializeFrom init): { + case CARBON_KIND(InPlaceInit init): { FormatArgs(init.src_id); return; } @@ -1267,21 +1268,6 @@ auto Formatter::FormatInstRhs(Inst inst) -> void { return; } - case CARBON_KIND(InPlaceInit in_place): { - // Omit dest_id if it will be part of the expression form. - // - // TODO: should it always be part of the expression form? If so, fix - // FindReturnSlotArgForInitializer to always return it, and then - // FormatInstRhsDefault will do the right thing. - if (SemIR::InitRepr::ForType(*sem_ir_, in_place.type_id) - .MightBeInPlace()) { - FormatArgs(in_place.src_id); - } else { - FormatArgs(in_place.src_id, in_place.dest_id); - } - return; - } - default: FormatInstRhsDefault(inst); return; diff --git a/toolchain/sem_ir/inst_kind.def b/toolchain/sem_ir/inst_kind.def index 971321edd449..96bc79e552a5 100644 --- a/toolchain/sem_ir/inst_kind.def +++ b/toolchain/sem_ir/inst_kind.def @@ -86,9 +86,9 @@ CARBON_SEM_IR_INST_KIND(ImportCppDecl) CARBON_SEM_IR_INST_KIND(ImportDecl) CARBON_SEM_IR_INST_KIND(ImportRefLoaded) CARBON_SEM_IR_INST_KIND(ImportRefUnloaded) -CARBON_SEM_IR_INST_KIND(InPlaceInit) +CARBON_SEM_IR_INST_KIND(MarkInPlaceInit) CARBON_SEM_IR_INST_KIND(InitForm) -CARBON_SEM_IR_INST_KIND(InitializeFrom) +CARBON_SEM_IR_INST_KIND(InPlaceInit) CARBON_SEM_IR_INST_KIND(InstType) CARBON_SEM_IR_INST_KIND(InstValue) CARBON_SEM_IR_INST_KIND(IntLiteralType) diff --git a/toolchain/sem_ir/inst_kind.h b/toolchain/sem_ir/inst_kind.h index d3974782d2f1..62a69a7d7504 100644 --- a/toolchain/sem_ir/inst_kind.h +++ b/toolchain/sem_ir/inst_kind.h @@ -17,7 +17,47 @@ namespace Carbon::SemIR { struct TypeId; // The expression category of an instruction. See /docs/design/values.md for -// details. +// background. +// +// Several categories are concerned with object initialization. At the SemIR +// level, initialization consists of several phase transitions: +// 1. A _repr-initializing_ expression forms an initializing representation of +// the object's eventual contents. +// 2. An _in-place initializing_ expression commits to writing an object +// representation to memory. +// 3. An _ephemeral entire reference_ expression commits to a particular memory +// location for the object. +// 4. Finally, the owner/lifetime for that object is specified. This need not be +// an expression, so it doesn't correspond to a particular expression +// category. Instead, the inst kinds that perform this role are marked with +// has_cleanup = true.` +// +// If an inst combines more than one of those transitions, its category is +// determined by the last one it performs (which means a non-expression inst may +// perform some of the first three steps). Note that the language-level category +// "initializing expression" is the union of the repr-initializing and in-place +// initializing categories, which exist only in the implementation. +// +// An _initializer_ is an inst in any of those three categories. An inst that +// directly depends on it is said to _consume_ it, and typically an initializer +// must be consumed by exactly one inst. +// +// Thus, the key distinction between an initializing expression and a reference +// expression is that the storage location of a reference expression is fixed as +// soon as it is evaluated, but the storage location of an initializing +// expression is notionally set by the inst that consumes it. "Notionally", +// because that distinction is obscured by two optimizations: +// - The storage location inst is always a direct or indirect argument of the +// in-place initializing inst. The ID of the storage argument inst is fixed +// when the initializing inst is created, and can be found with +// `FindStorageArgForInitializer`, but the inst stored at that ID may be +// overwritten when the consumer is created. This makes the final SemIR appear +// as though the location was set by the initializing inst. +// - When the initializing inst and its consumer are created together, the +// initializing inst is typically created with its storage argument already +// set, rather than creating and then immediately overwriting a placeholder. +// +// TODO: Add an enumerator for ephemeral entire references, when needed. enum class ExprCategory : int8_t { // This instruction does not correspond to an expression, and as such has no // category. @@ -28,15 +68,21 @@ enum class ExprCategory : int8_t { Pattern, // This instruction represents a value expression. Value, - // This instruction represents a durable reference expression, that denotes an - // object that outlives the current full expression context. - DurableRef, - // This instruction represents an ephemeral reference expression, that denotes + // This instruction represents a repr-initializing expression (see above), + // which initializes an object using the type's initializing representation. + // It must be consumed exactly once unless the type's initializing + // representation is known not to be in-place. + ReprInitializing, + // This instruction represents an in-place initializing expression (see + // above), which initializes an object in-place, regardless of the type's + // initializing representation. It must be consumed exactly once. + InPlaceInitializing, + // This instruction represents a ephemeral non-entire reference, which denotes // an object that does not outlive the current full expression context. EphemeralRef, - // This instruction represents an initializing expression, that describes how - // to initialize an object. - Initializing, + // This instruction represents a durable reference expression, which denotes + // an object that outlives the current full expression context. + DurableRef, // This instruction represents a syntactic combination of expressions that are // permitted to have different expression categories. This is used for tuple // and struct literals, where the subexpressions for different elements can diff --git a/toolchain/sem_ir/type_info.cpp b/toolchain/sem_ir/type_info.cpp index 8c301a12d9e2..25f8e2e8dd77 100644 --- a/toolchain/sem_ir/type_info.cpp +++ b/toolchain/sem_ir/type_info.cpp @@ -56,6 +56,8 @@ auto ValueRepr::IsCopyOfObjectRepr(const File& file, TypeId orig_type_id) const auto InitRepr::ForType(const File& file, TypeId type_id) -> InitRepr { auto type_info = file.types().GetCompleteTypeInfo(type_id); if (type_info.abstract_class_id.has_value()) { + CARBON_CHECK(type_info.value_repr.kind == ValueRepr::Pointer, "{0}", + type_info.value_repr.kind); return {.kind = InitRepr::Abstract}; } switch (type_info.value_repr.kind) { diff --git a/toolchain/sem_ir/typed_insts.h b/toolchain/sem_ir/typed_insts.h index 77295bbd4524..926d2e5e79f1 100644 --- a/toolchain/sem_ir/typed_insts.h +++ b/toolchain/sem_ir/typed_insts.h @@ -166,7 +166,8 @@ struct ArrayIndex { // `dest_id` is the destination array object for the initialization. struct ArrayInit { static constexpr auto Kind = InstKind::ArrayInit.Define( - {.ir_name = "array_init", .expr_category = ExprCategory::Initializing}); + {.ir_name = "array_init", + .expr_category = ExprCategory::ReprInitializing}); TypeId type_id; InstBlockId inits_id; @@ -197,9 +198,9 @@ struct AsCompatible { InstId source_id; }; -// Performs a source-level initialization or assignment of `lhs_id` from -// `rhs_id`. This finishes initialization of `lhs_id` in the same way as -// `InitializeFrom`. +// Consumes the initializer `rhs_id`, and uses it to performs a source-level +// initialization or assignment of `lhs_id`. If `rhs_id` has a storage argument, +// it is required to already be `lhs_id`. struct Assign { // TODO: Make Parse::NodeId more specific. static constexpr auto Kind = InstKind::Assign.Define( @@ -435,7 +436,8 @@ struct ClassElementAccess { // Initializes a class object at dest_id with the contents of elements_id. struct ClassInit { static constexpr auto Kind = InstKind::ClassInit.Define( - {.ir_name = "class_init", .expr_category = ExprCategory::Initializing}); + {.ir_name = "class_init", + .expr_category = ExprCategory::ReprInitializing}); TypeId type_id; InstBlockId elements_id; @@ -1023,19 +1025,21 @@ struct ImportRefLoaded { EntityNameId entity_name_id; }; -// Tracks that an object has been initialized in-place to form the result of -// this expression, even if its type's initializing representation is not -// normally in-place. If the type does not use in-place initialization, -// initialization from this expression will copy the value out of the -// destination. +// DO NOT SUBMIT until this file and inst_kind.def are re-alphabetized. + +// Records that evaluation of the expression `src_id` will initialize the +// storage identified by `dest_id` (even if its type's initializing +// representation is not normally in-place), and forms an in-place initializing +// expression to represent it. Note that `src_id` must find its target storage +// using the exact ID `dest_id`, not another ID that aliases it. // // This is used to model the initialization performed by C++ thunks, where // in-place initialization is used even for types that would normally have a // copy initializing representation. -struct InPlaceInit { - static constexpr auto Kind = InstKind::InPlaceInit.Define( - {.ir_name = "in_place_init", - .expr_category = ExprCategory::Initializing, +struct MarkInPlaceInit { + static constexpr auto Kind = InstKind::MarkInPlaceInit.Define( + {.ir_name = "mark_in_place_init", + .expr_category = ExprCategory::InPlaceInitializing, .constant_kind = InstConstantKind::Never}); TypeId type_id; @@ -1061,16 +1065,17 @@ struct InitForm { CallParamIndex index; }; -// Finalizes the initialization of `dest_id` from the initializer expression -// `src_id`, by performing a final copy from source to destination, for types -// whose initialization is not in-place. -struct InitializeFrom { - // Note this Parse::NodeId is unused. InitializeFrom is only constructed by +// Consumes the repr-initializing expression `src_id` and forms an in-place +// initializing expression that initializes the storage at `dest_id`, by +// performing a final copy from source to destination for types whose +// initialization is not in-place. +struct InPlaceInit { + // Note this Parse::NodeId is unused. InPlaceInit is only constructed by // reusing locations. // TODO: Figure out if there's a better way to handle this case. - static constexpr auto Kind = InstKind::InitializeFrom.Define( - {.ir_name = "initialize_from", - .expr_category = ExprCategory::Initializing}); + static constexpr auto Kind = InstKind::InPlaceInit.Define( + {.ir_name = "in_place_init", + .expr_category = ExprCategory::InPlaceInitializing}); TypeId type_id; InstId src_id; @@ -1546,6 +1551,9 @@ struct Return { }; // A `return expr;` statement. +// +// If `expr_id` is an initializer, this consumes it. If `dest_id` is not `None` +// and `expr_id` has a storage argument, the storage argument must be `dest_id`. struct ReturnExpr { static constexpr auto Kind = InstKind::ReturnExpr.Define( {.ir_name = "return", @@ -1729,7 +1737,8 @@ struct StructAccess { // Initializes a dest struct with the provided elements. struct StructInit { static constexpr auto Kind = InstKind::StructInit.Define( - {.ir_name = "struct_init", .expr_category = ExprCategory::Initializing}); + {.ir_name = "struct_init", + .expr_category = ExprCategory::ReprInitializing}); TypeId type_id; InstBlockId elements_id; @@ -1817,7 +1826,9 @@ struct SymbolicBindingType { InstId facet_value_inst_id; }; -// A temporary value. +// Consumes the initializer `init_id`, uses it to initialize a temporary +// object, and forms an ephemeral reference to it. If `init_id` has a +// storage arg, it must be a `TemporaryStorage` inst. struct Temporary { static constexpr auto Kind = InstKind::Temporary.Define( {.ir_name = "temporary", @@ -1858,7 +1869,8 @@ struct TupleAccess { // Initializes the destination tuple with the given elements. struct TupleInit { static constexpr auto Kind = InstKind::TupleInit.Define( - {.ir_name = "tuple_init", .expr_category = ExprCategory::Initializing}); + {.ir_name = "tuple_init", + .expr_category = ExprCategory::ReprInitializing}); TypeId type_id; InstBlockId elements_id;