From 0d2d6cb8a06d90bbb1567222ce87d566e62e1fd3 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 19:04:24 +0100 Subject: [PATCH 001/100] IRGen, LLVMPasses: Switch from obsoleted APIs to `llvm::getPointerAuthStableSipHash` Per d68f8b96b1ff39cfcfcad94d5b16d28adaf6b5d0 (llvm-project). --- lib/IRGen/GenPointerAuth.cpp | 7 ++++--- lib/LLVMPasses/LLVMMergeFunctions.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/IRGen/GenPointerAuth.cpp b/lib/IRGen/GenPointerAuth.cpp index 9d094032747be..42b78ecc01bbe 100644 --- a/lib/IRGen/GenPointerAuth.cpp +++ b/lib/IRGen/GenPointerAuth.cpp @@ -26,6 +26,7 @@ #include "swift/SIL/TypeLowering.h" #include "clang/CodeGen/CodeGenABITypes.h" #include "llvm/ADT/APInt.h" +#include "llvm/Support/SipHash.h" #include "llvm/Support/raw_ostream.h" using namespace swift; @@ -332,7 +333,7 @@ static llvm::ConstantInt *getDiscriminatorForHash(IRGenModule &IGM, static llvm::ConstantInt *getDiscriminatorForString(IRGenModule &IGM, StringRef string) { - uint64_t rawHash = clang::CodeGen::computeStableStringHash(string); + uint64_t rawHash = llvm::getPointerAuthStableSipHash(string); return getDiscriminatorForHash(IGM, rawHash); } @@ -590,7 +591,7 @@ static uint64_t getTypeHash(IRGenModule &IGM, CanSILFunctionType type) { hashStringForFunctionType( IGM, type, Out, genericSig.getCanonicalSignature().getGenericEnvironment()); - return clang::CodeGen::computeStableStringHash(Out.str()); + return llvm::getPointerAuthStableSipHash(Out.str()); } static uint64_t getYieldTypesHash(IRGenModule &IGM, CanSILFunctionType type) { @@ -629,7 +630,7 @@ static uint64_t getYieldTypesHash(IRGenModule &IGM, CanSILFunctionType type) { out << ":"; } - return clang::CodeGen::computeStableStringHash(out.str()); + return llvm::getPointerAuthStableSipHash(out.str()); } llvm::ConstantInt * diff --git a/lib/LLVMPasses/LLVMMergeFunctions.cpp b/lib/LLVMPasses/LLVMMergeFunctions.cpp index 3f53edfa891ad..122c947df19d2 100644 --- a/lib/LLVMPasses/LLVMMergeFunctions.cpp +++ b/lib/LLVMPasses/LLVMMergeFunctions.cpp @@ -30,7 +30,6 @@ #include "swift/Basic/Assertions.h" #include "swift/LLVMPasses/Passes.h" -#include "clang/AST/StableHash.h" #include "clang/Basic/PointerAuthOptions.h" #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/FoldingSet.h" @@ -55,6 +54,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/Support/SipHash.h" #include "llvm/TargetParser/Triple.h" #include "llvm/Transforms/IPO.h" #include "llvm/Transforms/Utils/FunctionComparator.h" @@ -416,9 +416,10 @@ class SwiftMergeFunctions { if (auto *GO = dyn_cast(value)) concatenatedCalleeNames += GO->getName(); } - uint64_t rawHash = clang::getStableStringHash(concatenatedCalleeNames); + uint64_t hash = + llvm::getPointerAuthStableSipHash(concatenatedCalleeNames); IntegerType *discrTy = Type::getInt64Ty(Context); - discriminator = ConstantInt::get(discrTy, (rawHash % 0xFFFF) + 1); + discriminator = ConstantInt::get(discrTy, hash); } }; From f93aba0770e7ff73997d3afed2c1c50a765b2e05 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 20:02:04 +0100 Subject: [PATCH 002/100] IRGen, LLVMPasses: Switch from obsoleted `nocapture` to `captures(none)` Per 29441e4f5fa5f5c7709f7cf180815ba97f611297 (llvm-project). --- lib/IRGen/CallEmission.h | 5 +- lib/IRGen/GenCall.cpp | 26 ++- lib/LLVMPasses/ARCEntryPointBuilder.h | 11 +- .../IRGen/differentiable_function.sil | 4 +- test/DebugInfo/ErrorVar.swift | 2 +- ...tributed_actor_accessor_thunks_32bit.swift | 14 +- ...tributed_actor_accessor_thunks_64bit.swift | 2 +- test/IRGen/abi_v7k.swift | 4 +- test/IRGen/abitypes_objc.swift | 34 ++-- test/IRGen/access_markers.sil | 4 +- test/IRGen/argument_attrs.sil | 24 +-- test/IRGen/async_dynamic_replacement.swift | 2 +- test/IRGen/big_types_corner_cases.sil | 28 +-- test/IRGen/big_types_corner_cases.swift | 38 ++-- test/IRGen/big_types_corner_cases_tiny.swift | 2 +- test/IRGen/big_types_tests.sil | 2 +- test/IRGen/builtin_pack_length.swift | 2 +- test/IRGen/builtins.swift | 18 +- test/IRGen/c_layout.sil | 8 +- test/IRGen/casts.sil | 2 +- test/IRGen/class_field_other_module.swift | 4 +- ...ormances_class_with_defaulted_method.swift | 2 +- test/IRGen/coroutine_accessors.swift | 4 +- ...outine_accessors_backdeploy_async_56.swift | 2 +- ...outine_accessors_backdeploy_async_57.swift | 2 +- test/IRGen/dependent_reabstraction.swift | 2 +- test/IRGen/enum.sil | 42 ++-- test/IRGen/enum_derived.swift | 4 +- test/IRGen/enum_future.sil | 42 ++-- test/IRGen/enum_resilience.swift | 2 +- test/IRGen/errors.sil | 6 +- test/IRGen/existentials_objc.sil | 4 +- test/IRGen/extern_c_abitypes.swift | 12 +- test/IRGen/fixlifetime.sil | 4 +- test/IRGen/function_param_convention.sil | 2 +- test/IRGen/function_types.sil | 4 +- test/IRGen/generic_casts.swift | 4 +- test/IRGen/generic_metatypes.swift | 2 +- test/IRGen/generic_metatypes_future.swift | 2 +- test/IRGen/generic_ternary.swift | 2 +- test/IRGen/indexing.sil | 6 +- test/IRGen/indirect_argument.sil | 36 ++-- test/IRGen/indirect_return.swift | 2 +- test/IRGen/inout_noalias.sil | 2 +- test/IRGen/lazy_multi_file.swift | 2 +- test/IRGen/lifetime.sil | 2 +- .../moveonly_split_module_source_deinit.swift | 2 +- test/IRGen/moveonly_value_functions.swift | 6 +- .../moveonly_value_functions_onone.swift | 8 +- test/IRGen/objc_block_storage.sil | 10 +- test/IRGen/objc_class_export.swift | 4 +- .../objc_generic_protocol_conformance.swift | 2 +- test/IRGen/objc_simd.sil | 6 +- test/IRGen/objc_structs.swift | 10 +- test/IRGen/objc_super.swift | 2 +- test/IRGen/partial_apply.sil | 20 +- test/IRGen/partial_apply_coro.sil | 56 ++--- test/IRGen/partial_apply_generic.swift | 2 +- test/IRGen/pre_specialize.swift | 8 +- test/IRGen/protocol_accessor_multifile.swift | 2 +- test/IRGen/protocol_resilience.sil | 10 +- test/IRGen/protocol_resilience_thunks.swift | 4 +- test/IRGen/same_type_constraints.swift | 2 +- test/IRGen/select_enum.sil | 2 +- test/IRGen/sil_generic_witness_methods.swift | 2 +- test/IRGen/sil_witness_methods.sil | 8 +- test/IRGen/sil_witness_tables.swift | 4 +- test/IRGen/struct_resilience.swift | 8 +- test/IRGen/struct_with_resilient_type.swift | 2 +- test/IRGen/typed_throws.sil | 24 +-- test/IRGen/typed_throws.swift | 8 +- test/IRGen/typed_throws_abi.swift | 192 +++++++++--------- test/IRGen/typed_throws_thunks.swift | 16 +- .../typelayout_based_value_witness.swift | 4 +- test/IRGen/unconditional_checked_cast.sil | 2 +- test/IRGen/witness_method.sil | 4 +- test/IRGen/yield_once_big.sil | 6 +- test/IRGen/yield_once_indirect.sil | 2 +- ...ional_conformance_basic_conformances.swift | 8 +- ...onformance_basic_conformances_future.swift | 8 +- .../conditional_conformance_subclass.swift | 4 +- ...ditional_conformance_subclass_future.swift | 4 +- .../conditional_conformance_with_assoc.swift | 4 +- ...tional_conformance_with_assoc_future.swift | 4 +- .../Interop/Cxx/class/method/inreg-sret.swift | 4 +- .../class/protocol-conformance-irgen.swift | 2 +- .../Cxx/class/returns-large-class-irgen.swift | 2 +- .../Cxx/extern-var/extern-var-irgen.swift | 2 +- .../inline-static-member-var-irgen.swift | 2 +- .../Interop/Cxx/static/static-var-irgen.swift | 2 +- .../stdlib/msvc-abi-use-vector-iterator.swift | 2 +- .../Cxx/templates/mangling-irgen.swift | 4 +- test/LLVMPasses/allocation-deletion.ll | 2 +- ...irt_witness_method_empty_conformance.swift | 2 +- test/SILOptimizer/eager_specialize.sil | 4 +- test/SILOptimizer/eager_specialize_ossa.sil | 4 +- 96 files changed, 473 insertions(+), 459 deletions(-) diff --git a/lib/IRGen/CallEmission.h b/lib/IRGen/CallEmission.h index 89ac2baa265f7..e6c6ac8b36ebd 100644 --- a/lib/IRGen/CallEmission.h +++ b/lib/IRGen/CallEmission.h @@ -152,11 +152,12 @@ class CallEmission { WitnessMetadata *witnessMetadata); virtual Address getCalleeErrorSlot(SILType errorType, bool isCalleeAsync) = 0; - void addFnAttribute(llvm::Attribute::AttrKind Attr); + void addFnAttribute(llvm::Attribute::AttrKind kind); void setIndirectReturnAddress(Address addr) { indirectReturnAddress = addr; } - void addParamAttribute(unsigned ParamIndex, llvm::Attribute::AttrKind Attr); + void addParamAttribute(unsigned paramIndex, llvm::Attribute::AttrKind kind); + void addParamAttribute(unsigned paramIndex, llvm::Attribute attr); void emitToMemory(Address addr, const LoadableTypeInfo &substResultTI, bool isOutlined); diff --git a/lib/IRGen/GenCall.cpp b/lib/IRGen/GenCall.cpp index 2a886a2cf6219..be7ada6d0ee73 100644 --- a/lib/IRGen/GenCall.cpp +++ b/lib/IRGen/GenCall.cpp @@ -317,7 +317,7 @@ static void addIndirectValueParameterAttributes(IRGenModule &IGM, // Bitwise takable value types are guaranteed not to capture // a pointer into itself. if (!addressable && ti.isBitwiseTakable(ResilienceExpansion::Maximal)) - b.addAttribute(llvm::Attribute::NoCapture); + b.addCapturesAttr(llvm::CaptureInfo::none()); // The parameter must reference dereferenceable memory of the type. addDereferenceableAttributeToBuilder(IGM, b, ti); @@ -330,7 +330,7 @@ static void addPackParameterAttributes(IRGenModule &IGM, unsigned argIndex) { llvm::AttrBuilder b(IGM.getLLVMContext()); // Pack parameter pointers can't alias. - // Note: they are not marked `nocapture` as one + // Note: they are not marked `captures(none)` as one // pack parameter could be a value type (e.g. a C++ type) // that captures its own pointer in itself. b.addAttribute(llvm::Attribute::NoAlias); @@ -357,7 +357,7 @@ static void addInoutParameterAttributes(IRGenModule &IGM, SILType paramSILType, // Bitwise takable value types are guaranteed not to capture // a pointer into itself. if (!addressable && ti.isBitwiseTakable(ResilienceExpansion::Maximal)) - b.addAttribute(llvm::Attribute::NoCapture); + b.addCapturesAttr(llvm::CaptureInfo::none()); // The inout must reference dereferenceable memory of the type. addDereferenceableAttributeToBuilder(IGM, b, ti); @@ -411,7 +411,7 @@ static void addIndirectResultAttributes(IRGenModule &IGM, // Bitwise takable value types are guaranteed not to capture // a pointer into itself. if (typeInfo.isBitwiseTakable(ResilienceExpansion::Maximal)) - b.addAttribute(llvm::Attribute::NoCapture); + b.addCapturesAttr(llvm::CaptureInfo::none()); if (allowSRet) { assert(storageType); b.addStructRetAttr(storageType); @@ -530,7 +530,7 @@ void IRGenModule::addSwiftErrorAttributes(llvm::AttributeList &attrs, // The error result should not be aliased, captured, or pointed at invalid // addresses regardless. b.addAttribute(llvm::Attribute::NoAlias); - b.addAttribute(llvm::Attribute::NoCapture); + b.addCapturesAttr(llvm::CaptureInfo::none()); b.addDereferenceableAttr(getPointerSize().getValue()); attrs = attrs.addParamAttributes(this->getLLVMContext(), argIndex, b); @@ -2854,7 +2854,9 @@ class SyncCallEmission final : public CallEmission { } } Args[--LastArgWritten] = errorResultSlot.getAddress(); - addParamAttribute(LastArgWritten, llvm::Attribute::NoCapture); + addParamAttribute(LastArgWritten, llvm::Attribute::getWithCaptureInfo( + IGF.IGM.getLLVMContext(), + llvm::CaptureInfo::none())); IGF.IGM.addSwiftErrorAttributes(CurCallee.getMutableAttributes(), LastArgWritten); @@ -5577,14 +5579,20 @@ void CallEmission::setArgs(Explosion &adjusted, bool isOutlined, } } -void CallEmission::addFnAttribute(llvm::Attribute::AttrKind attr) { +void CallEmission::addFnAttribute(llvm::Attribute::AttrKind kind) { assert(state == State::Emitting); auto &attrs = CurCallee.getMutableAttributes(); - attrs = attrs.addFnAttribute(IGF.IGM.getLLVMContext(), attr); + attrs = attrs.addFnAttribute(IGF.IGM.getLLVMContext(), kind); } void CallEmission::addParamAttribute(unsigned paramIndex, - llvm::Attribute::AttrKind attr) { + llvm::Attribute::AttrKind kind) { + addParamAttribute(paramIndex, + llvm::Attribute::get(IGF.IGM.getLLVMContext(), kind)); +} + +void CallEmission::addParamAttribute(unsigned paramIndex, + llvm::Attribute attr) { assert(state == State::Emitting); auto &attrs = CurCallee.getMutableAttributes(); attrs = attrs.addParamAttribute(IGF.IGM.getLLVMContext(), paramIndex, attr); diff --git a/lib/LLVMPasses/ARCEntryPointBuilder.h b/lib/LLVMPasses/ARCEntryPointBuilder.h index 6811d8c405b0a..33290a95d7471 100644 --- a/lib/LLVMPasses/ARCEntryPointBuilder.h +++ b/lib/LLVMPasses/ARCEntryPointBuilder.h @@ -252,11 +252,16 @@ class ARCEntryPointBuilder { auto *ObjectPtrTy = getObjectPtrTy(); auto &M = getModule(); - auto AttrList = AttributeList::get(M.getContext(), 1, Attribute::NoCapture); - AttrList = AttrList.addFnAttribute(M.getContext(), Attribute::NoUnwind); + auto &C = M.getContext(); + + AttributeList AttrList; + AttrList = AttrList.addFnAttribute(C, Attribute::NoUnwind); + AttrList = AttrList.addParamAttribute( + C, 0, Attribute::getWithCaptureInfo(C, llvm::CaptureInfo::none())); + CheckUnowned = cast( M.getOrInsertFunction("swift_checkUnowned", AttrList, - Type::getVoidTy(M.getContext()), ObjectPtrTy) + Type::getVoidTy(C), ObjectPtrTy) .getCallee()); if (llvm::Triple(M.getTargetTriple()).isOSBinFormatCOFF() && !llvm::Triple(M.getTargetTriple()).isOSCygMing()) diff --git a/test/AutoDiff/IRGen/differentiable_function.sil b/test/AutoDiff/IRGen/differentiable_function.sil index 9acbeef82cd5a..d347d801b5112 100644 --- a/test/AutoDiff/IRGen/differentiable_function.sil +++ b/test/AutoDiff/IRGen/differentiable_function.sil @@ -33,7 +33,7 @@ bb0: return %result : $@differentiable(reverse) @callee_guaranteed (Float) -> Float } -// CHECK-LABEL: define{{.*}}test_form_diff_func(ptr noalias nocapture sret(<{ %swift.function, %swift.function, %swift.function }>) +// CHECK-LABEL: define{{.*}}test_form_diff_func(ptr noalias captures(none) sret(<{ %swift.function, %swift.function, %swift.function }>) // CHECK-SAME: [[OUT:%.*]]) // CHECK: [[OUT_ORIG:%.*]] = getelementptr{{.*}}[[OUT]], i32 0, i32 0 // CHECK: [[OUT_ORIG_FN:%.*]] = getelementptr{{.*}}[[OUT_ORIG]], i32 0, i32 0 @@ -60,7 +60,7 @@ bb0(%0 : $@differentiable(reverse) @callee_guaranteed (Float) -> Float): return %result : $(@callee_guaranteed (Float) -> Float, @callee_guaranteed (Float) -> (Float, @owned @callee_guaranteed (Float) -> Float), @callee_guaranteed (Float) -> (Float, @owned @callee_guaranteed (Float) -> Float)) } -// CHECK-LABEL: define{{.*}}@test_extract_components(ptr noalias nocapture sret(<{ %swift.function, %swift.function, %swift.function }>) +// CHECK-LABEL: define{{.*}}@test_extract_components(ptr noalias captures(none) sret(<{ %swift.function, %swift.function, %swift.function }>) // CHECK-SAME: [[OUT:%.*]], ptr{{.*}}[[IN:%.*]]) // CHECK: [[ORIG:%.*]] = getelementptr{{.*}}[[IN]], i32 0, i32 0 // CHECK: [[ORIG_FN_ADDR:%.*]] = getelementptr{{.*}}[[ORIG]], i32 0, i32 0 diff --git a/test/DebugInfo/ErrorVar.swift b/test/DebugInfo/ErrorVar.swift index 75c7fccf7a13f..3025b9931ed43 100644 --- a/test/DebugInfo/ErrorVar.swift +++ b/test/DebugInfo/ErrorVar.swift @@ -14,7 +14,7 @@ func simple(_ placeholder: Int64) throws -> () { // CHECK: define {{.*}}void @"$s8ErrorVar6simpleyys5Int64VKF"( // CHECK-SAME: i64 // CHECK-SAME: %swift.refcounted* {{.*}}swiftself - // CHECK-SAME: %swift.error** noalias nocapture dereferenceable(4) + // CHECK-SAME: %swift.error** noalias captures(none) dereferenceable(4) // CHECK: #dbg_declare // CHECK: #dbg_declare({{.*}}, ![[ERROR:[0-9]+]], !DIExpression(DW_OP_deref) // CHECK-DAG: ![[ERRTY:.*]] = !DICompositeType({{.*}}identifier: "$ss5Error_pD" diff --git a/test/Distributed/distributed_actor_accessor_thunks_32bit.swift b/test/Distributed/distributed_actor_accessor_thunks_32bit.swift index ce84f48c868ea..3ea45ea4d043d 100644 --- a/test/Distributed/distributed_actor_accessor_thunks_32bit.swift +++ b/test/Distributed/distributed_actor_accessor_thunks_32bit.swift @@ -94,7 +94,7 @@ public distributed actor MyOtherActor { // CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple1yySiYaKFTE" -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple1yySiYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* nocapture %1, i8* %2, i8* %3, {{.*}}, %T27distributed_actor_accessors7MyActorC* [[ACTOR:%.*]], %swift.type* [[DECODER_TYPE:%.*]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple1yySiYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* captures(none) %1, i8* %2, i8* %3, {{.*}}, %T27distributed_actor_accessors7MyActorC* [[ACTOR:%.*]], %swift.type* [[DECODER_TYPE:%.*]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) /// Read the current offset and cast an element to `Int` @@ -119,7 +119,7 @@ public distributed actor MyOtherActor { // CHECK: missing-witness1: // CHECK-NEXT: call void @llvm.trap() // CHECK-NEXT: unreachable -// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(%swift.opaque* noalias nocapture sret(%swift.opaque) [[ARG_0_RES_SLOT]], %swift.type* %arg_type, i8** [[ENCODABLE_WITNESS]], i8** [[DECODABLE_WITNESS]], %T27FakeDistributedActorSystems0A17InvocationDecoderC* swiftself [[DECODER]], %swift.error** noalias nocapture dereferenceable(4) %swifterror) +// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(%swift.opaque* noalias captures(none) sret(%swift.opaque) [[ARG_0_RES_SLOT]], %swift.type* %arg_type, i8** [[ENCODABLE_WITNESS]], i8** [[DECODABLE_WITNESS]], %T27FakeDistributedActorSystems0A17InvocationDecoderC* swiftself [[DECODER]], %swift.error** noalias captures(none) dereferenceable(4) %swifterror) // CHECK: store %swift.error* null, %swift.error** %swifterror // CHECK-NEXT: [[ARG_0_VAL_ADDR:%.*]] = bitcast i8* [[ARG_0_VALUE_BUF]] to %TSi* @@ -196,7 +196,7 @@ public distributed actor MyOtherActor { // CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple3ySiSSYaKFTE" /// !!! in `simple3` interesting bits are: argument value extraction (because string is exploded into N arguments) and call to distributed thunk -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple3ySiSSYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* nocapture [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE:%.*]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple3ySiSSYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* captures(none) [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE:%.*]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) // CHECK: [[TYPED_RESULT_BUFF:%.*]] = bitcast i8* [[RESULT_BUFF]] to %TSi* @@ -260,7 +260,7 @@ public distributed actor MyOtherActor { // CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC16single_case_enumyAA7SimpleEOAFYaKFTE" -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC16single_case_enumyAA7SimpleEOAFYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* nocapture [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC16single_case_enumyAA7SimpleEOAFYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* captures(none) [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) /// Let's check that the call doesn't have any arguments and returns nothing. @@ -307,7 +307,7 @@ public distributed actor MyOtherActor { // CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7complexyAA11LargeStructVSaySiG_AA3ObjCSSSgAFtYaKFTE" -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7complexyAA11LargeStructVSaySiG_AA3ObjCSSSgAFtYaKFTETF"(%swift.context* swiftasync {{.*}}, %swift.opaque* nocapture [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7complexyAA11LargeStructVSaySiG_AA3ObjCSSSgAFtYaKFTETF"(%swift.context* swiftasync {{.*}}, %swift.opaque* captures(none) [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) /// First, let's check that all of the different argument types here are loaded correctly. @@ -366,7 +366,7 @@ public distributed actor MyOtherActor { /// ---> Accessor for `genericArgs` -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC11genericArgsyyx_Sayq_GtYaKSeRzSERzSeR_SER_r0_lFTETF"(%swift.context* swiftasync %0, %swift.opaque* nocapture [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUF:%.*]], i8* [[GENERIC_SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR:%.*]], %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC11genericArgsyyx_Sayq_GtYaKSeRzSERzSeR_SER_r0_lFTETF"(%swift.context* swiftasync %0, %swift.opaque* captures(none) [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUF:%.*]], i8* [[GENERIC_SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR:%.*]], %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) /// ---> Load `T` @@ -422,7 +422,7 @@ public distributed actor MyOtherActor { /// Let's check that there is argument decoding since parameter list is empty -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors12MyOtherActorC5emptyyyYaKFTETF"(%swift.context* swiftasync {{.*}}, %swift.opaque* nocapture [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors12MyOtherActorC* {{.*}}, %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors12MyOtherActorC5emptyyyYaKFTETF"(%swift.context* swiftasync {{.*}}, %swift.opaque* captures(none) [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors12MyOtherActorC* {{.*}}, %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) // CHECK-NEXT: entry: // CHECK-NEXT: {{.*}} = alloca %swift.context* // CHECK-NEXT: %swifterror = alloca %swift.error* diff --git a/test/Distributed/distributed_actor_accessor_thunks_64bit.swift b/test/Distributed/distributed_actor_accessor_thunks_64bit.swift index ac91f313d20e0..f3651319e07d1 100644 --- a/test/Distributed/distributed_actor_accessor_thunks_64bit.swift +++ b/test/Distributed/distributed_actor_accessor_thunks_64bit.swift @@ -116,7 +116,7 @@ public distributed actor MyOtherActor { // CHECK: missing-witness1: // CHECK-NEXT: call void @llvm.trap() // CHECK-NEXT: unreachable -// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(ptr noalias sret(%swift.opaque) [[ARG_0_VALUE_BUF]], ptr %arg_type, ptr [[ENCODABLE_WITNESS]], ptr [[DECODABLE_WITNESS]], ptr swiftself [[DECODER]], ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(ptr noalias sret(%swift.opaque) [[ARG_0_VALUE_BUF]], ptr %arg_type, ptr [[ENCODABLE_WITNESS]], ptr [[DECODABLE_WITNESS]], ptr swiftself [[DECODER]], ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: store ptr null, ptr %swifterror // CHECK-NEXT: %._value = getelementptr inbounds %TSi, ptr [[ARG_0_VALUE_BUF]], i32 0, i32 0 diff --git a/test/IRGen/abi_v7k.swift b/test/IRGen/abi_v7k.swift index cec49c0801a88..e2e5bd766650e 100644 --- a/test/IRGen/abi_v7k.swift +++ b/test/IRGen/abi_v7k.swift @@ -296,7 +296,7 @@ func testRet3() -> MyRect2 { } // Returning tuple?: (Int x 6)? -// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax2{{.*}}"(ptr noalias nocapture sret({{.*}}) %0, i32 %1, i32 %2) +// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax2{{.*}}"(ptr noalias captures(none) sret({{.*}}) %0, i32 %1, i32 %2) // V7K-LABEL: _$s8test_v7k7minMax2 // We will indirectly return an optional with the address in r0, input parameters will be in r1 and r2 // V7K: str r0, [sp, [[IDX:#[0-9]+]]] @@ -324,7 +324,7 @@ func minMax2(x : Int, y : Int) -> (min: Int, max: Int, min2: Int, max2: Int, min } // Returning struct?: {Int x 6}? -// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax3{{.*}}"(ptr noalias nocapture sret({{.*}}) %0, i32 %1, i32 %2) +// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax3{{.*}}"(ptr noalias captures(none) sret({{.*}}) %0, i32 %1, i32 %2) // V7K-LABEL: _$s8test_v7k7minMax3 struct Ret { var min:Int diff --git a/test/IRGen/abitypes_objc.swift b/test/IRGen/abitypes_objc.swift index 3bf060dd3a650..d3eb9f8793739 100644 --- a/test/IRGen/abitypes_objc.swift +++ b/test/IRGen/abitypes_objc.swift @@ -27,20 +27,20 @@ class Foo { // x86_64-macosx: define internal { <2 x float>, <2 x float> } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { // x86_64-ios: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { // x86_64-ios: define internal { <2 x float>, <2 x float> } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { - // i386-ios: define hidden swiftcc void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr noalias nocapture sret({{.*}}) %0, ptr swiftself %1) {{.*}} { - // i386-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // i386-ios: define hidden swiftcc void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr noalias captures(none) sret({{.*}}) %0, ptr swiftself %1) {{.*}} { + // i386-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { // armv7-ios: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { - // armv7-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // armv7-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { // armv7s-ios: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { - // armv7s-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // armv7s-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { // arm64-ios: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { // arm64-ios: define internal [[ARM64_MYRECT]] @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { // x86_64-tvos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { // x86_64-tvos: define internal { <2 x float>, <2 x float> } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { // arm64-tvos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { // arm64-tvos: define internal [[ARM64_MYRECT]] @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { - // i386-watchos: define hidden swiftcc void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr noalias nocapture sret({{.*}}) %0, ptr swiftself %1) {{.*}} { - // i386-watchos: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // i386-watchos: define hidden swiftcc void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr noalias captures(none) sret({{.*}}) %0, ptr swiftself %1) {{.*}} { + // i386-watchos: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { // armv7k-watchos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { // armv7k-watchos: define internal [[ARMV7K_MYRECT]] @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { // armv64_32-watchos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { @@ -157,7 +157,7 @@ class Foo { // armv7-ios: define hidden swiftcc float @"$s8abitypes3FooC4barc{{[_0-9a-zA-Z]*}}F"(ptr %0, ptr swiftself %1) {{.*}} { // armv7-ios: [[RESULT:%.*]] = alloca [[RECTTYPE:%.*MyRect.*]], align 4 // armv7-ios: load ptr, ptr @"\01L_selector(newRect)", align 4 - // armv7-ios: call void @objc_msgSend_stret(ptr noalias nocapture sret({{.*}}) %call.aggresult + // armv7-ios: call void @objc_msgSend_stret(ptr noalias captures(none) sret({{.*}}) %call.aggresult // armv7-ios: [[GEP1:%.*]] = getelementptr inbounds [[RECTTYPE]], ptr [[RESULT]], i32 0, i32 1 // armv7-ios: [[GEP2:%.*]] = getelementptr inbounds {{.*}}, ptr [[GEP1]], i32 0, i32 0 // armv7-ios: [[RETVAL:%.*]] = load float, ptr [[GEP2]], align 4 @@ -167,7 +167,7 @@ class Foo { // armv7s-ios: define hidden swiftcc float @"$s8abitypes3FooC4barc{{[_0-9a-zA-Z]*}}F"(ptr %0, ptr swiftself %1) {{.*}} { // armv7s-ios: [[RESULT:%.*]] = alloca [[RECTTYPE:%.*MyRect.*]], align 4 // armv7s-ios: load ptr, ptr @"\01L_selector(newRect)", align 4 - // armv7s-ios: call void @objc_msgSend_stret(ptr noalias nocapture sret({{.*}}) %call.aggresult + // armv7s-ios: call void @objc_msgSend_stret(ptr noalias captures(none) sret({{.*}}) %call.aggresult // armv7s-ios: [[GEP1:%.*]] = getelementptr inbounds [[RECTTYPE]], ptr [[RESULT]], i32 0, i32 1 // armv7s-ios: [[GEP2:%.*]] = getelementptr inbounds {{.*}}, ptr [[GEP1]], i32 0, i32 0 // armv7s-ios: [[RETVAL:%.*]] = load float, ptr [[GEP2]], align 4 @@ -185,7 +185,7 @@ class Foo { } // x86_64-macosx: define hidden swiftcc { double, double, double } @"$s8abitypes3FooC3baz{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { - // x86_64-macosx: define internal void @"$s8abitypes3FooC3baz{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // x86_64-macosx: define internal void @"$s8abitypes3FooC3baz{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { @objc dynamic func baz() -> Trio { return Trio(i: 1.0, j: 2.0, k: 3.0) } @@ -480,17 +480,17 @@ class Foo { return g.invert(b) } - // x86_64-macosx: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) {{.*}} { + // x86_64-macosx: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) {{.*}} { // x86_64-macosx: [[SEL:%[0-9]+]] = load ptr, ptr @"\01L_selector(negateThrowing:error:)", align 8 // x86_64-macosx: call signext i8 @objc_msgSend(ptr {{%[0-9]+}}, ptr [[SEL]], i8 signext {{%[0-9]+}}, ptr {{%[0-9]+}}) // x86_64-macosx: } - // x86_64-ios: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) {{.*}} { + // x86_64-ios: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) {{.*}} { // x86_64-ios: [[SEL:%[0-9]+]] = load ptr, ptr @"\01L_selector(negateThrowing:error:)", align 8 // x86_64-ios: call zeroext i1 @objc_msgSend(ptr {{%[0-9]+}}, ptr [[SEL]], i1 zeroext {{%[0-9]+}}, ptr {{%[0-9]+}}) // x86_64-ios: } - // i386-ios: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture dereferenceable(4) %2) {{.*}} { + // i386-ios: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) dereferenceable(4) %2) {{.*}} { // i386-ios: [[SEL:%[0-9]+]] = load ptr, ptr @"\01L_selector(negateThrowing:error:)", align 4 // i386-ios: call signext i8 @objc_msgSend(ptr {{%[0-9]+}}, ptr [[SEL]], i8 signext {{%[0-9]+}}, ptr {{%[0-9]+}}) // i386-ios: } @@ -547,18 +547,18 @@ class Foo { } // arm64-ios: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} { - // arm64-ios: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { + // arm64-ios: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { // // arm64e-ios: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} { - // arm64e-ios: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{.*}} { + // arm64e-ios: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{.*}} { // // arm64-tvos: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} { - // arm64-tvos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { + // arm64-tvos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { // arm64-macosx: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} { - // arm64-macosx: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{.*}} { + // arm64-macosx: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{.*}} { // // arm64-watchos: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} { - // arm64-watchos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { + // arm64-watchos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { @objc dynamic func callJustReturn(_ r: StructReturns, with v: BigStruct) -> BigStruct { return r.justReturn(v) } diff --git a/test/IRGen/access_markers.sil b/test/IRGen/access_markers.sil index 0fe492f18343f..f551ad00bc2be 100644 --- a/test/IRGen/access_markers.sil +++ b/test/IRGen/access_markers.sil @@ -95,13 +95,13 @@ sil @testPairedBox : $(@guaranteed { var () }) -> () { bb0(%0 : ${ var () }): // CHECK: entry: %2 = project_box %0 : ${ var () }, 0 - // CHECK-NEXT: call {{.*}}void @writeEmptyTuple(ptr nocapture undef) + // CHECK-NEXT: call {{.*}}void @writeEmptyTuple(ptr captures(none) undef) %3 = begin_access [modify] [dynamic] %2 : $*() %write_fn = function_ref @writeEmptyTuple : $@convention(thin) (@inout ()) -> () apply %write_fn(%3) : $@convention(thin) (@inout ()) -> () end_access %3 : $*() - // CHECK-NEXT: call {{.*}}void @readEmptyTuple(ptr noalias nocapture undef) + // CHECK-NEXT: call {{.*}}void @readEmptyTuple(ptr noalias captures(none) undef) %5 = begin_access [read] [dynamic] %2 : $*() %read_fn = function_ref @readEmptyTuple : $@convention(thin) (@in_guaranteed ()) -> () apply %read_fn(%5) : $@convention(thin) (@in_guaranteed ()) -> () diff --git a/test/IRGen/argument_attrs.sil b/test/IRGen/argument_attrs.sil index ee82eb7eb4ddb..905842f443816 100644 --- a/test/IRGen/argument_attrs.sil +++ b/test/IRGen/argument_attrs.sil @@ -4,49 +4,49 @@ import Builtin struct Huge { var x, y, z, w, a, b, c, d, e, f: Builtin.Int32 } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def(ptr nocapture dereferenceable(4) %0, ptr noalias nocapture dereferenceable(4) %1, ptr noalias nocapture dereferenceable(4) %2, ptr noalias nocapture dereferenceable(40) %3, ptr noalias %4, ptr noalias nocapture %5, ptr %T) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def(ptr captures(none) dereferenceable(4) %0, ptr noalias captures(none) dereferenceable(4) %1, ptr noalias captures(none) dereferenceable(4) %2, ptr noalias captures(none) dereferenceable(40) %3, ptr noalias %4, ptr noalias captures(none) %5, ptr %T) sil @arguments_in_def : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () { entry(%1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*Builtin.Int32, %4 : $Huge, %5 : $*T, %6 : $*()): - // CHECK: call swiftcc void @arguments_in_decl(ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias nocapture {{%.*}}, ptr %T) + // CHECK: call swiftcc void @arguments_in_decl(ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr %T) %f = function_ref @arguments_in_decl : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () %x = apply %f(%1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () - // CHECK: call swiftcc void @arguments_in_def(ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias nocapture {{%.*}}, ptr %T) + // CHECK: call swiftcc void @arguments_in_def(ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr %T) %g = function_ref @arguments_in_def : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () %y = apply %g(%1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () return undef : $() } -// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl(ptr nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) +// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl(ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) sil @arguments_in_decl : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_out(ptr noalias nocapture sret({{.*}}) %0, ptr nocapture dereferenceable(4) %1, ptr noalias nocapture dereferenceable(4) %2, ptr noalias nocapture dereferenceable(4) %3, ptr noalias nocapture dereferenceable(40) %4, ptr noalias %5, ptr noalias nocapture %6, ptr %T) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_out(ptr noalias captures(none) sret({{.*}}) %0, ptr captures(none) dereferenceable(4) %1, ptr noalias captures(none) dereferenceable(4) %2, ptr noalias captures(none) dereferenceable(4) %3, ptr noalias captures(none) dereferenceable(40) %4, ptr noalias %5, ptr noalias captures(none) %6, ptr %T) sil @arguments_in_def_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 { entry(%0 : $*Builtin.Int32, %1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*Builtin.Int32, %4 : $Huge, %5 : $*T, %6 : $*()): - // CHECK: call swiftcc void @arguments_in_decl_out(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias nocapture {{%.*}}, ptr {{%.*}}) + // CHECK: call swiftcc void @arguments_in_decl_out(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) %f = function_ref @arguments_in_decl_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 %x = apply %f(%0, %1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 - // CHECK: call swiftcc void @arguments_in_def_out(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias nocapture {{%.*}}, ptr {{%.*}}) + // CHECK: call swiftcc void @arguments_in_def_out(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) %g = function_ref @arguments_in_def_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 %y = apply %g(%0, %1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 return undef : $() } -// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_out(ptr noalias nocapture sret({{.*}}), ptr nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) +// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_out(ptr noalias captures(none) sret({{.*}}), ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) sil @arguments_in_decl_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_huge_ret(ptr noalias nocapture sret({{.*}}V) %0, ptr nocapture dereferenceable(4) %1, ptr noalias nocapture dereferenceable(4) %2, ptr noalias nocapture dereferenceable(4) %3, ptr noalias nocapture dereferenceable(40) %4, ptr noalias %5, ptr noalias nocapture %6, ptr %T) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_huge_ret(ptr noalias captures(none) sret({{.*}}V) %0, ptr captures(none) dereferenceable(4) %1, ptr noalias captures(none) dereferenceable(4) %2, ptr noalias captures(none) dereferenceable(4) %3, ptr noalias captures(none) dereferenceable(40) %4, ptr noalias %5, ptr noalias captures(none) %6, ptr %T) sil @arguments_in_def_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge { entry(%1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*Builtin.Int32, %4 : $Huge, %5 : $*T, %6 : $*()): %f = function_ref @arguments_in_decl_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge - // CHECK: call swiftcc void @arguments_in_decl_huge_ret(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias nocapture {{%.*}}, ptr {{%.*}}) + // CHECK: call swiftcc void @arguments_in_decl_huge_ret(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) %x = apply %f(%1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge - // CHECK: call swiftcc void @arguments_in_def_huge_ret(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias nocapture {{%.*}}, ptr {{%.*}}) + // CHECK: call swiftcc void @arguments_in_def_huge_ret(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) %g = function_ref @arguments_in_def_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge %y = apply %g(%1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge return %y : $Huge } -// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_huge_ret(ptr noalias nocapture sret({{.*}}), ptr nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) +// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_huge_ret(ptr noalias captures(none) sret({{.*}}), ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) sil @arguments_in_decl_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge diff --git a/test/IRGen/async_dynamic_replacement.swift b/test/IRGen/async_dynamic_replacement.swift index bef67f42375f3..fb0e699ac4d35 100644 --- a/test/IRGen/async_dynamic_replacement.swift +++ b/test/IRGen/async_dynamic_replacement.swift @@ -26,7 +26,7 @@ public func calls_number() async -> Int { // CHECK-LABEL: define {{.*}}swifttailcc void @"$s25async_dynamic_replacement32indirectReturnDynamicReplaceableSi_S6ityYaKF"(ptr {{.*}}%0, ptr swiftasync %1) // CHECK: forward_to_replaced: -// CHECK: musttail call swifttailcc void {{.*}}(ptr noalias nocapture %0, ptr swiftasync {{.*}}) +// CHECK: musttail call swifttailcc void {{.*}}(ptr noalias captures(none) %0, ptr swiftasync {{.*}}) public dynamic func indirectReturnDynamicReplaceable() async throws -> (Int, Int, Int, Int, Int, Int, Int) { return (0, 0, 0, 0, 0, 0, 0) } diff --git a/test/IRGen/big_types_corner_cases.sil b/test/IRGen/big_types_corner_cases.sil index 270cd16c66cf1..cd1b8a307e5d0 100644 --- a/test/IRGen/big_types_corner_cases.sil +++ b/test/IRGen/big_types_corner_cases.sil @@ -38,7 +38,7 @@ public struct BigBigStruct { } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testBitfieldInBlock -// CHECK: call void {{%.*}}(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) +// CHECK: call void {{%.*}}(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) sil @testBitfieldInBlock : $@convention(thin) (@owned @convention(block) (BitfieldOne) -> BitfieldOne, BitfieldOne) -> BitfieldOne { entry(%b : $@convention(block) (BitfieldOne) -> BitfieldOne, %x : $BitfieldOne): %r = apply %b(%x) : $@convention(block) (BitfieldOne) -> BitfieldOne @@ -46,7 +46,7 @@ entry(%b : $@convention(block) (BitfieldOne) -> BitfieldOne, %x : $BitfieldOne): } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testTupleExtract -// CHECK: call void {{%.*}}(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) +// CHECK: call void {{%.*}}(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) sil @testTupleExtract : $@convention(thin) (@owned (BitfieldOne, @convention(block) (BitfieldOne) -> BitfieldOne), BitfieldOne) -> BitfieldOne { entry(%b : $(BitfieldOne, @convention(block) (BitfieldOne) -> (BitfieldOne)), %x : $BitfieldOne): %a = tuple_extract %b : $(BitfieldOne, @convention(block) (BitfieldOne) -> (BitfieldOne)), 1 @@ -54,9 +54,9 @@ entry(%b : $(BitfieldOne, @convention(block) (BitfieldOne) -> (BitfieldOne)), %x return %r : $BitfieldOne } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testBigTempStruct(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %Element) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testBigTempStruct(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %Element) // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases13BigTempStructV -// CHECK: call swiftcc void @testBigTempStruct(ptr noalias nocapture sret({{.*}}) [[ALLOC]], ptr %1, ptr %Element) +// CHECK: call swiftcc void @testBigTempStruct(ptr noalias captures(none) sret({{.*}}) [[ALLOC]], ptr %1, ptr %Element) // CHECK: ret void sil @testBigTempStruct : $@convention(method) (@guaranteed _ArrayBuffer) -> @owned BigTempStruct { bb0(%0 : $_ArrayBuffer): @@ -66,9 +66,9 @@ bb0(%0 : $_ArrayBuffer): return %9 : $BigTempStruct } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testTryApply(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr swiftself %3, ptr noalias nocapture swifterror dereferenceable(8) %4) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testTryApply(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr swiftself %3, ptr noalias captures(none) swifterror dereferenceable(8) %4) // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructV -// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture sret({{.*}}) [[ALLOC]] +// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) sret({{.*}}) [[ALLOC]] // CHECK: ret void sil @testTryApply : $@convention(thin)(() -> (@owned BigStruct, @error Error)) -> (@owned BigStruct, @error Error) { bb0(%0 : $() -> (@owned BigStruct, @error Error)): @@ -82,8 +82,8 @@ bb2(%err : $Error): throw %err : $Error } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testFuncWithModBlockStorageApply(ptr nocapture dereferenceable({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) -// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture dereferenceable({{.*}}) %1 +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testFuncWithModBlockStorageApply(ptr captures(none) dereferenceable({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) +// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) dereferenceable({{.*}}) %1 // CHECK: ret void sil @testFuncWithModBlockStorageApply : $@convention(thin) (@inout_aliasable @block_storage @callee_owned (@owned BigStruct) -> (), BigStruct) -> () { // %0 // user: %5 @@ -109,7 +109,7 @@ sil public_external @c_return_func : $@convention(thin) () -> () -> @owned BigSt // CHECK: [[RET:%.*]] = insertvalue { ptr, ptr } { ptr @"$s17part_apply_calleeTA", ptr undef }, ptr // CHECK: ret { ptr, ptr } [[RET]] -// CHECK-LABEL: define internal swiftcc void @"$s17part_apply_calleeTA"(ptr noalias nocapture sret({{.*}}) %0, i64 %1, ptr swiftself %2) +// CHECK-LABEL: define internal swiftcc void @"$s17part_apply_calleeTA"(ptr noalias captures(none) sret({{.*}}) %0, i64 %1, ptr swiftself %2) // CHECK: ret void sil @part_apply_caller : $@convention(thin) () -> @owned @callee_owned (@owned Builtin.Int64) -> @owned BigStruct { @@ -174,12 +174,12 @@ sil @get_optional_none : $@convention(method) <τ_0_0> (@thin Optional<τ_0_0>.T sil @short_circuit_operation : $@convention(thin) <τ_0_0> (@in Optional<τ_0_0>, @owned @callee_owned () -> (@out τ_0_0, @error Error)) -> (@out τ_0_0, @error Error) sil @autoclosure_partialapply : $@convention(thin) (@owned @callee_owned () -> (BigStruct, @error Error)) -> (@out BigStruct, @error Error) -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @closure(ptr noalias nocapture sret({{.*}}) %0, ptr %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @closure(ptr noalias captures(none) sret({{.*}}) %0, ptr %1) // CHECK-64: [[ALLOC1:%.*]] = alloca %T22big_types_corner_cases9BigStructV // CHECK-64: [[ALLOC2:%.*]] = alloca %T22big_types_corner_cases9BigStructV // CHECK-64: [[ALLOC3:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg // CHECK-64: [[ALLOC4:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg -// CHECK-64: call swiftcc void @"$s22big_types_corner_cases8SuperSubC1fyyFAA9BigStructVycfU_AFyKXKfu_TA"(ptr noalias nocapture sret({{.*}}) [[ALLOC1]], ptr swiftself {{.*}}, ptr nocapture swifterror %swifterror) +// CHECK-64: call swiftcc void @"$s22big_types_corner_cases8SuperSubC1fyyFAA9BigStructVycfU_AFyKXKfu_TA"(ptr noalias captures(none) sret({{.*}}) [[ALLOC1]], ptr swiftself {{.*}}, ptr captures(none) swifterror %swifterror) // CHECK: ret void sil @closure : $@convention(thin) (@owned SuperSub) -> BigStruct { bb0(%0 : $SuperSub): @@ -218,7 +218,7 @@ sil @returnBigStruct : $@convention(thin) () -> @owned BigStruct // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @closureToConvert() // CHECK: entry: // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructV -// CHECK: call swiftcc void @returnBigStruct(ptr noalias nocapture sret({{.*}}) [[ALLOC]]) +// CHECK: call swiftcc void @returnBigStruct(ptr noalias captures(none) sret({{.*}}) [[ALLOC]]) // CHECK: ret void // CHECK-LABEL: } sil @closureToConvert : $@convention(thin) () -> () { @@ -246,11 +246,11 @@ bb0: sil @convertToThickHelper : $@convention(thin) (@owned BigStruct) -> () -// CHECK-LABAL: define {{.*}} swiftcc void @convertToThick(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABAL: define {{.*}} swiftcc void @convertToThick(ptr noalias captures(none) dereferenceable({{.*}}) %0) // CHECK: entry: // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructV, align 4 // CHECK: call void @llvm.memcpy.p0.p0.i64 -// CHECK: call swiftcc void @convertToThickHelper(ptr noalias nocapture dereferenceable({{.*}}) [[ALLOC]], ptr swiftself null) +// CHECK: call swiftcc void @convertToThickHelper(ptr noalias captures(none) dereferenceable({{.*}}) [[ALLOC]], ptr swiftself null) // CHECK: ret void // CHECK-LABEL: } sil @convertToThick : $@convention(thin) (@in BigStruct) -> () { diff --git a/test/IRGen/big_types_corner_cases.swift b/test/IRGen/big_types_corner_cases.swift index d63789ac579ec..15201ff63f3bd 100644 --- a/test/IRGen/big_types_corner_cases.swift +++ b/test/IRGen/big_types_corner_cases.swift @@ -46,7 +46,7 @@ let bigStructGlobalArray : [BigStruct] = [ BigStruct() ] -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} internal swiftcc void @"$s22big_types_corner_cases21OptionalInoutFuncTypeC7executeyys5Error_pSgFyyXEfU_"(ptr nocapture dereferenceable({{.*}}) %0, ptr %1, ptr nocapture dereferenceable({{.*}}) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} internal swiftcc void @"$s22big_types_corner_cases21OptionalInoutFuncTypeC7executeyys5Error_pSgFyyXEfU_"(ptr captures(none) dereferenceable({{.*}}) %0, ptr %1, ptr captures(none) dereferenceable({{.*}}) // CHECK: call void @"$s22big_types_corner_cases9BigStructVSgs5Error_pSgIegng_SgWOe // CHECK: call void @"$s22big_types_corner_cases9BigStructVSgs5Error_pSgIegng_SgWOy // CHECK: ret void @@ -66,9 +66,9 @@ public func f3_uses_f2() { } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10f3_uses_f2yyF"() -// CHECK: call swiftcc void @"$s22big_types_corner_cases9BigStructVACycfC"(ptr noalias nocapture sret({{.*}}) +// CHECK: call swiftcc void @"$s22big_types_corner_cases9BigStructVACycfC"(ptr noalias captures(none) sret({{.*}}) // CHECK: call swiftcc { ptr, ptr } @"$s22big_types_corner_cases13f2_returns_f1AA9BigStructVADcyF"() -// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr noalias nocapture dereferenceable({{.*}}) {{.*}}, ptr swiftself {{.*}}) +// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr noalias captures(none) dereferenceable({{.*}}) {{.*}}, ptr swiftself {{.*}}) // CHECK: ret void public func f4_tuple_use_of_f2() { @@ -81,7 +81,7 @@ public func f4_tuple_use_of_f2() { // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases18f4_tuple_use_of_f2yyF"() // CHECK: [[TUPLE:%.*]] = call swiftcc { ptr, ptr } @"$s22big_types_corner_cases13f2_returns_f1AA9BigStructVADcyF"() // CHECK: [[TUPLE_EXTRACT:%.*]] = extractvalue { ptr, ptr } [[TUPLE]], 0 -// CHECK: call swiftcc void [[TUPLE_EXTRACT]](ptr noalias nocapture sret({{.*}}) {{.*}}, ptr noalias nocapture dereferenceable({{.*}}) {{.*}}, ptr swiftself %{{.*}}) +// CHECK: call swiftcc void [[TUPLE_EXTRACT]](ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr noalias captures(none) dereferenceable({{.*}}) {{.*}}, ptr swiftself %{{.*}}) // CHECK: ret void public class BigClass { @@ -95,8 +95,8 @@ public class BigClass { } } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} hidden swiftcc void @"$s22big_types_corner_cases8BigClassC03useE6Struct0aH0yAA0eH0V_tF"(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr swiftself %1) -// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr swiftself +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} hidden swiftcc void @"$s22big_types_corner_cases8BigClassC03useE6Struct0aH0yAA0eH0V_tF"(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr swiftself %1) +// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr swiftself // CHECK: ret void public struct MyStruct { @@ -134,17 +134,17 @@ public func enumCallee(_ x: LargeEnum) { case .Empty2: break } } -// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10enumCalleeyyAA9LargeEnumOF"(ptr noalias nocapture dereferenceable({{.*}}) %0) #0 { +// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10enumCalleeyyAA9LargeEnumOF"(ptr noalias captures(none) dereferenceable({{.*}}) %0) #0 { // CHECK-64: alloca %T22big_types_corner_cases9LargeEnumO05InnerF0O // CHECK-64: alloca %T22big_types_corner_cases9LargeEnumO // CHECK-64: $ss5print_9separator10terminatoryypd_S2StF // CHECK-64: ret void -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} internal swiftcc void @"$s22big_types_corner_cases8SuperSubC1fyyFAA9BigStructVycfU_"(ptr noalias nocapture sret({{.*}}) %0, ptr %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} internal swiftcc void @"$s22big_types_corner_cases8SuperSubC1fyyFAA9BigStructVycfU_"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1) // CHECK-64: [[ALLOC1:%.*]] = alloca %T22big_types_corner_cases9BigStructV // CHECK-64: [[ALLOC2:%.*]] = alloca %T22big_types_corner_cases9BigStructV // CHECK-64: [[ALLOC3:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg -// CHECK-64: call swiftcc void @"$s22big_types_corner_cases9SuperBaseC4boomAA9BigStructVyF"(ptr noalias nocapture sret({{.*}}) [[ALLOC1]], ptr swiftself {{.*}}) +// CHECK-64: call swiftcc void @"$s22big_types_corner_cases9SuperBaseC4boomAA9BigStructVyF"(ptr noalias captures(none) sret({{.*}}) [[ALLOC1]], ptr swiftself {{.*}}) // CHECK: ret void class SuperBase { func boom() -> BigStruct { @@ -164,10 +164,10 @@ class SuperSub : SuperBase { } } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10MUseStructV16superclassMirrorAA03BigF0VSgvg"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture swiftself dereferenceable({{.*}}) %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10MUseStructV16superclassMirrorAA03BigF0VSgvg"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) swiftself dereferenceable({{.*}}) %1) // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg // CHECK: [[LOAD:%.*]] = load ptr, ptr %.callInternalLet.data -// CHECK: call swiftcc void %{{[0-9]+}}(ptr noalias nocapture sret({{.*}}) [[ALLOC]], ptr swiftself [[LOAD]]) +// CHECK: call swiftcc void %{{[0-9]+}}(ptr noalias captures(none) sret({{.*}}) [[ALLOC]], ptr swiftself [[LOAD]]) // CHECK: ret void public struct MUseStruct { var x = BigStruct() @@ -296,9 +296,9 @@ public extension QueryHandler { body(query) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_25query8ReturnedQyd___AA9BigStructVSgtqd___tAA0E0Rd__lF"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias %1, ptr noalias %2, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias swiftself %3) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_25query8ReturnedQyd___AA9BigStructVSgtqd___tAA0E0Rd__lF"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias %1, ptr noalias %2, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias swiftself %3) // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg -// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture sret({{.*}}) [[ALLOC]], ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}) +// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) sret({{.*}}) [[ALLOC]], ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}) // CHECK: ret void func forceHandle_2(query: Q) -> (Q.Returned, BigStruct?) { guard let body = handle_2 as? (Q) -> (Q.Returned, BigStruct?) else { @@ -307,11 +307,11 @@ public extension QueryHandler { return body(query) } -// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_35query8ReturnedQyd___SbAA9BigStructVcSgtqd___tAA0E0Rd__lF"(ptr noalias %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2) +// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_35query8ReturnedQyd___SbAA9BigStructVcSgtqd___tAA0E0Rd__lF"(ptr noalias %0, ptr noalias captures(none) %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias captures(none) swiftself %2) // CHECK-64: {{.*}} = call swiftcc { i64, i64 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}) // CHECK-64: ret { i64, i64 } -// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_35query8ReturnedQyd___SbAA9BigStructVcSgtqd___tAA0E0Rd__lF"(ptr noalias %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2) +// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_35query8ReturnedQyd___SbAA9BigStructVcSgtqd___tAA0E0Rd__lF"(ptr noalias %0, ptr noalias captures(none) %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias captures(none) swiftself %2) // CHECK-32: {{.*}} = call swiftcc { i32, i32 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}) // CHECK-32: ret { i32, i32 } func forceHandle_3(query: Q) -> (Q.Returned, Filter?) { @@ -321,12 +321,12 @@ public extension QueryHandler { return body(query) } -// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0E0Rd__lF"(ptr noalias %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2, ptr swifterror %3) -// CHECK-64: {{.*}} = call swiftcc { i64, i64 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}, ptr noalias nocapture swifterror {{.*}}) +// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0E0Rd__lF"(ptr noalias %0, ptr noalias captures(none) %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias captures(none) swiftself %2, ptr swifterror %3) +// CHECK-64: {{.*}} = call swiftcc { i64, i64 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}, ptr noalias captures(none) swifterror {{.*}}) // CHECK-64: ret { i64, i64 } -// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0E0Rd__lF"(ptr noalias %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2, ptr swifterror %3) -// CHECK-32: {{.*}} = call swiftcc { i32, i32 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}, ptr noalias nocapture {{.*}}) +// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0E0Rd__lF"(ptr noalias %0, ptr noalias captures(none) %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias captures(none) swiftself %2, ptr swifterror %3) +// CHECK-32: {{.*}} = call swiftcc { i32, i32 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}, ptr noalias captures(none) {{.*}}) // CHECK-32: ret { i32, i32 } func forceHandle_4(query: Q) throws -> (Q.Returned, Filter?) { guard let body = handle_4 as? (Q) throws -> (Q.Returned, Filter?) else { diff --git a/test/IRGen/big_types_corner_cases_tiny.swift b/test/IRGen/big_types_corner_cases_tiny.swift index 3907e86260804..5ac56700330e7 100644 --- a/test/IRGen/big_types_corner_cases_tiny.swift +++ b/test/IRGen/big_types_corner_cases_tiny.swift @@ -6,6 +6,6 @@ // CHECK-LABEL: define internal void @{{.*}}WZ // CHECK: [[ALLOC:%.*]] = alloca %T27big_types_corner_cases_tiny30LoadableStructWithBiggerStringV -// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture sret({{.*}}) [[ALLOC]] +// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) sret({{.*}}) [[ALLOC]] let model = ClassWithLoadableStructWithBiggerString().f() diff --git a/test/IRGen/big_types_tests.sil b/test/IRGen/big_types_tests.sil index acd9a7161a75b..dfea630d68daa 100644 --- a/test/IRGen/big_types_tests.sil +++ b/test/IRGen/big_types_tests.sil @@ -19,7 +19,7 @@ public struct BigStruct { var i8 : Int32 = 8 } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testDestroyValue(ptr noalias nocapture dereferenceable({{.*}}) #0 { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testDestroyValue(ptr noalias captures(none) dereferenceable({{.*}}) #0 { // CHECK-NEXT: entry // CHECK-NEXT: ret void sil @testDestroyValue : $@convention(thin) (@owned BigStruct) -> () { diff --git a/test/IRGen/builtin_pack_length.swift b/test/IRGen/builtin_pack_length.swift index e543df1d4e020..10de5b275c66e 100644 --- a/test/IRGen/builtin_pack_length.swift +++ b/test/IRGen/builtin_pack_length.swift @@ -31,7 +31,7 @@ func weirdPackCountUse1(_ x: repeat each T) -> Builtin.Word { } struct Pack { -// CHECK: define {{.*}} @"$s8builtins4PackV5countBwvgZ"(i64 returned [[PACK_COUNT:%.*]], ptr nocapture readnone %"each T") +// CHECK: define {{.*}} @"$s8builtins4PackV5countBwvgZ"(i64 returned [[PACK_COUNT:%.*]], ptr captures(none) readnone %"each T") // CHECK-NEXT: entry: // CHECK-NEXT: ret i64 [[PACK_COUNT]] static var count: Builtin.Word { diff --git a/test/IRGen/builtins.swift b/test/IRGen/builtins.swift index 6cd0d59b5d317..20d447d2ec329 100644 --- a/test/IRGen/builtins.swift +++ b/test/IRGen/builtins.swift @@ -638,11 +638,11 @@ func zeroInitializerEmpty() { // isUnique variants // ---------------------------------------------------------------------------- -// CHECK: define hidden {{.*}}void @"$s8builtins26acceptsBuiltinNativeObjectyyBoSgzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define hidden {{.*}}void @"$s8builtins26acceptsBuiltinNativeObjectyyBoSgzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { func acceptsBuiltinNativeObject(_ ref: inout Builtin.NativeObject?) {} // native -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BoSgzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BoSgzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: %[[LD_RC:.+]] = load ptr, ptr %0 // CHECK-NEXT: %[[RET:.+]] = call zeroext i1 @swift_isUniquelyReferenced_native(ptr %[[LD_RC]]) @@ -652,7 +652,7 @@ func isUnique(_ ref: inout Builtin.NativeObject?) -> Bool { } // native nonNull -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BozF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BozF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: %[[LD_RC:.+]] = load ptr, ptr %0 // CHECK: %[[RET:.+]] = call zeroext i1 @swift_isUniquelyReferenced_nonNull_native(ptr %[[LD_RC]]) @@ -661,11 +661,11 @@ func isUnique(_ ref: inout Builtin.NativeObject) -> Bool { return Builtin.isUnique(&ref) } -// CHECK: define hidden {{.*}}void @"$s8builtins16acceptsAnyObjectyyyXlSgzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define hidden {{.*}}void @"$s8builtins16acceptsAnyObjectyyyXlSgzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { func acceptsAnyObject(_ ref: inout Builtin.AnyObject?) {} // ObjC -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_yXlSgzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_yXlSgzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: [[ADDR:%.+]] = getelementptr inbounds [[OPTIONAL_ANYOBJECT_TY:%.*]], ptr %0, i32 0, i32 0 // CHECK-NEXT: [[REF:%.+]] = load ptr, ptr [[ADDR]] @@ -678,7 +678,7 @@ func isUnique(_ ref: inout Builtin.AnyObject?) -> Bool { // ObjC nonNull // CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_yXlzF" -// CHECK-SAME: (ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-SAME: (ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: [[ADDR:%.+]] = getelementptr inbounds %AnyObject, ptr %0, i32 0, i32 0 // CHECK: [[REF:%.+]] = load ptr, ptr [[ADDR]] @@ -690,7 +690,7 @@ func isUnique(_ ref: inout Builtin.AnyObject) -> Bool { } // BridgeObject nonNull -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BbzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BbzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: %[[LD:.+]] = load ptr, ptr %0 // CHECK: %[[RET:.+]] = call zeroext i1 @swift_isUniquelyReferenced{{(NonObjC)?}}_nonNull_bridgeObject(ptr %[[LD]]) @@ -706,7 +706,7 @@ func assumeTrue(_ x: Builtin.Int1) { Builtin.assume_Int1(x) } // BridgeObject nonNull -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins15isUnique_nativeyBi1_BbzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins15isUnique_nativeyBi1_BbzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: %[[LD:.+]] = load ptr, ptr %0 // CHECK-NEXT: %[[RET:.+]] = call zeroext i1 @swift_isUniquelyReferenced_nonNull_native(ptr %[[LD]]) @@ -716,7 +716,7 @@ func isUnique_native(_ ref: inout Builtin.BridgeObject) -> Bool { } // ImplicitlyUnwrappedOptional argument to isUnique. -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins11isUniqueIUOyBi1_BoSgzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins11isUniqueIUOyBi1_BoSgzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: call zeroext i1 @swift_isUniquelyReferenced_native(ptr // CHECK: ret i1 diff --git a/test/IRGen/c_layout.sil b/test/IRGen/c_layout.sil index 6178b60f1d5d6..58fb788d65e5b 100644 --- a/test/IRGen/c_layout.sil +++ b/test/IRGen/c_layout.sil @@ -32,7 +32,7 @@ bb0: // CHECK-x86_64: [[RESULT:%.*]] = alloca %TSo11BitfieldOneV, align 8 // CHECK-x86_64: [[ARG:%.*]] = alloca %TSo11BitfieldOneV, align 8 // Make the first call and pull all the values out of the indirect result. -// CHECK-x86_64: call void @createBitfieldOne(ptr noalias nocapture sret({{.*}}) [[RESULT]]) +// CHECK-x86_64: call void @createBitfieldOne(ptr noalias captures(none) sret({{.*}}) [[RESULT]]) // CHECK-x86_64: [[ADDR_A:%.*]] = getelementptr inbounds %TSo11BitfieldOneV, ptr [[RESULT]], i32 0, i32 0 // CHECK-x86_64: [[ADDR_A_V:%.*]] = getelementptr inbounds %Ts6UInt32V, ptr [[ADDR_A]], i32 0, i32 0 // CHECK-x86_64: [[A:%.*]] = load i32, ptr [[ADDR_A_V]], align 8 @@ -102,7 +102,7 @@ sil public_external @consumeSIMDStruct : $@convention(c) (SIMDStruct) -> () // CHECK-x86_64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testSIMDStruct() // CHECK-SYSV-x86_64: call <3 x float> @createSIMDStruct -// CHECK-WIN-x86_64: call void @createSIMDStruct(ptr noalias nocapture sret({{.*}}) % +// CHECK-WIN-x86_64: call void @createSIMDStruct(ptr noalias captures(none) sret({{.*}}) % // CHECK-SYSV-x86_64: call void @consumeSIMDStruct(<3 x float> // CHECK-WIN-x86_64: call void @consumeSIMDStruct(ptr % sil @testSIMDStruct : $() -> () { @@ -389,8 +389,8 @@ entry(%b : $@convention(block) (CChar) -> CChar, %c : $CChar): } // CHECK-x86_64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testBitfieldInBlock -// CHECK-SYSV-x86_64: call void {{%.*}}(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) -// CHECK-WIN-x86_64: call void {{%.*}}(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr {{%.*}}) +// CHECK-SYSV-x86_64: call void {{%.*}}(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) +// CHECK-WIN-x86_64: call void {{%.*}}(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr {{%.*}}) sil @testBitfieldInBlock : $@convention(thin) (@owned @convention(block) (BitfieldOne) -> BitfieldOne, BitfieldOne) -> BitfieldOne { entry(%b : $@convention(block) (BitfieldOne) -> BitfieldOne, %x : $BitfieldOne): %r = apply %b(%x) : $@convention(block) (BitfieldOne) -> BitfieldOne diff --git a/test/IRGen/casts.sil b/test/IRGen/casts.sil index 13f0967353f4f..64b00ad43cd60 100644 --- a/test/IRGen/casts.sil +++ b/test/IRGen/casts.sil @@ -15,7 +15,7 @@ class B: A {} sil_vtable A {} sil_vtable B {} -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @unchecked_addr_cast(ptr noalias nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @unchecked_addr_cast(ptr noalias captures(none) dereferenceable({{.*}}) %0) {{.*}} { sil @unchecked_addr_cast : $(@in A) -> B { entry(%a : $*A): %b = unchecked_addr_cast %a : $*A to $*B diff --git a/test/IRGen/class_field_other_module.swift b/test/IRGen/class_field_other_module.swift index b74db17246396..ecd0e23285fec 100644 --- a/test/IRGen/class_field_other_module.swift +++ b/test/IRGen/class_field_other_module.swift @@ -7,7 +7,7 @@ import other_class -// CHECK-LABEL: define {{(protected )?}}{{(dllexport )?}}swiftcc i32 @"$s24class_field_other_module12getSubclassXys5Int32V0c1_A00F0CF"(ptr nocapture readonly %0) +// CHECK-LABEL: define {{(protected )?}}{{(dllexport )?}}swiftcc i32 @"$s24class_field_other_module12getSubclassXys5Int32V0c1_A00F0CF"(ptr captures(none) readonly %0) // CHECK-NEXT: entry: // An Int32 after the heap object header // CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds i8, ptr %0, i64 16 @@ -17,7 +17,7 @@ public func getSubclassX(_ o: Subclass) -> Int32 { return o.x } -// CHECK-LABEL: define {{(protected )?}}{{(dllexport )?}}swiftcc i32 @"$s24class_field_other_module12getSubclassYys5Int32V0c1_A00F0CF"(ptr nocapture readonly %0) +// CHECK-LABEL: define {{(protected )?}}{{(dllexport )?}}swiftcc i32 @"$s24class_field_other_module12getSubclassYys5Int32V0c1_A00F0CF"(ptr captures(none) readonly %0) // CHECK-NEXT: entry: // An Int32 after an Int32 after the heap object header // CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds i8, ptr %0, i64 20 diff --git a/test/IRGen/conditional_conformances_class_with_defaulted_method.swift b/test/IRGen/conditional_conformances_class_with_defaulted_method.swift index 1118b4ba4803d..05b321bd9b5ca 100644 --- a/test/IRGen/conditional_conformances_class_with_defaulted_method.swift +++ b/test/IRGen/conditional_conformances_class_with_defaulted_method.swift @@ -12,4 +12,4 @@ extension Foo { } class Box {} extension Box: Foo where T: Foo {} -// CHECK-LABEL: define internal swiftcc void @"$s1x3BoxCyqd__GAA3FooA2aEP3baryyFTW"(ptr noalias nocapture swiftself dereferenceable({{[48]}}) %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define internal swiftcc void @"$s1x3BoxCyqd__GAA3FooA2aEP3baryyFTW"(ptr noalias captures(none) swiftself dereferenceable({{[48]}}) %0, ptr %Self, ptr %SelfWitnessTable) diff --git a/test/IRGen/coroutine_accessors.swift b/test/IRGen/coroutine_accessors.swift index 48152378da682..7eba7101bf778 100644 --- a/test/IRGen/coroutine_accessors.swift +++ b/test/IRGen/coroutine_accessors.swift @@ -126,7 +126,7 @@ public var irm: Int { // CHECK-LABEL: define{{.*}} { ptr, ptr } @"$s19coroutine_accessors1SV3irmSivx"( // CHECK-SAME: ptr noalias [[FRAME:%[^,]+]], // CHECK-SAME: ptr swiftcoro [[ALLOCATOR:%[^,]+]], -// CHECK-SAME: ptr nocapture swiftself dereferenceable({{8|16}}) [[SELF:%[^)]+]] +// CHECK-SAME: ptr captures(none) swiftself dereferenceable({{8|16}}) [[SELF:%[^)]+]] // CHECK-SAME: ) // CHECK-SAME: { // CHECK: [[ID:%[^,]+]] = call token @llvm.coro.id.retcon.once.dynamic( @@ -293,7 +293,7 @@ public var force_yield_once_2_convention : () { // CHECK-LABEL: define{{.*}} { ptr, ptr } @increment_irm_yield_once_2( // ptr noalias %0 // CHECK-SAME: ptr swiftcoro [[ALLOCATOR:%[^,]+]] -// ptr nocapture swiftself dereferenceable(16) %2 +// ptr captures(none) swiftself dereferenceable(16) %2 // CHECK-SAME: ) // CHECK-SAME: { // : [[SIZE_32:%[^,]+]] = load i32 diff --git a/test/IRGen/coroutine_accessors_backdeploy_async_56.swift b/test/IRGen/coroutine_accessors_backdeploy_async_56.swift index 5ad8a79ac62d4..327fb4abd943a 100644 --- a/test/IRGen/coroutine_accessors_backdeploy_async_56.swift +++ b/test/IRGen/coroutine_accessors_backdeploy_async_56.swift @@ -126,7 +126,7 @@ public var i: Int { // CHECK-LABEL: define{{.*}} void @increment_i_async( // ptr swiftasync %0 -// CHECK-SAME: ptr nocapture swiftself dereferenceable({{8|4}}) %1 +// CHECK-SAME: ptr captures(none) swiftself dereferenceable({{8|4}}) %1 // CHECK-SAME: ) // CHECK-SAME: { // : [[SIZE_32:%[^,]+]] = load i32 diff --git a/test/IRGen/coroutine_accessors_backdeploy_async_57.swift b/test/IRGen/coroutine_accessors_backdeploy_async_57.swift index 117c310ef3aea..987332e34c1c8 100644 --- a/test/IRGen/coroutine_accessors_backdeploy_async_57.swift +++ b/test/IRGen/coroutine_accessors_backdeploy_async_57.swift @@ -101,7 +101,7 @@ public var i: Int { // CHECK-LABEL: define{{.*}} void @increment_i_async( // ptr swiftasync %0 -// CHECK-SAME: ptr nocapture swiftself dereferenceable({{8|4}}) %1 +// CHECK-SAME: ptr captures(none) swiftself dereferenceable({{8|4}}) %1 // CHECK-SAME: ) // CHECK-SAME: { // : [[SIZE_32:%[^,]+]] = load i32 diff --git a/test/IRGen/dependent_reabstraction.swift b/test/IRGen/dependent_reabstraction.swift index c0250b8f00b17..5eed638512ca9 100644 --- a/test/IRGen/dependent_reabstraction.swift +++ b/test/IRGen/dependent_reabstraction.swift @@ -8,7 +8,7 @@ protocol A { } struct X : A { - // CHECK-LABEL: define internal swiftcc void @"$s23dependent_reabstraction1XVyxGAA1AA2aEP1byy1BQzFTW"(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) + // CHECK-LABEL: define internal swiftcc void @"$s23dependent_reabstraction1XVyxGAA1AA2aEP1byy1BQzFTW"(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) func b(_ b: X.Type) { let x: Any = b markUsed(b as X.Type) diff --git a/test/IRGen/enum.sil b/test/IRGen/enum.sil index 22ad8968aa9cd..b1e0e1e44ae24 100644 --- a/test/IRGen/enum.sil +++ b/test/IRGen/enum.sil @@ -238,7 +238,7 @@ dest(%u2 : $(Builtin.Int64, Builtin.Int64)): return %x : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: br label %[[DEST:[0-9]+]] // CHECK: [[DEST]]: @@ -274,7 +274,7 @@ entry(%0 : $Builtin.Int64, %1 : $Builtin.Int64): return %u : $Singleton } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_inject_indirect(i64 %0, i64 %1, ptr nocapture dereferenceable({{.*}}) %2) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_inject_indirect(i64 %0, i64 %1, ptr captures(none) dereferenceable({{.*}}) %2) {{.*}} { // CHECK: entry: // CHECK: [[DATA_0_ADDR:%.*]] = getelementptr inbounds <{ i64, i64 }>, ptr %2, i32 0, i32 0 // CHECK: store i64 %0, ptr [[DATA_0_ADDR]] @@ -349,7 +349,7 @@ end: return %x : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { sil @no_payload_switch_indirect : $@convention(thin) (@inout NoPayloads) -> () { entry(%u : $*NoPayloads): // CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds %T4enum10NoPayloadsO, ptr %0, i32 0, i32 0 @@ -398,7 +398,7 @@ entry: return %u : $NoPayloads } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_inject_z_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_inject_z_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds %T4enum10NoPayloadsO, ptr %0, i32 0, i32 0 // CHECK: store i8 2, ptr [[TAG_ADDR]] @@ -629,7 +629,7 @@ entry(%0 : $Builtin.Word): return %u : $SinglePayloadNoXI2 } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_x_indirect([[WORD]] %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_x_indirect([[WORD]] %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK: entry: // CHECK: store [[WORD]] %0, ptr %1 // CHECK: [[T0:%.*]] = getelementptr inbounds %T4enum18SinglePayloadNoXI2O, ptr %1, i32 0, i32 1 @@ -655,7 +655,7 @@ entry: return %u : $SinglePayloadNoXI2 } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_y_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_y_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: store [[WORD]] 0, ptr %0 // CHECK: [[T0:%.*]] = getelementptr inbounds %T4enum18SinglePayloadNoXI2O, ptr %0, i32 0, i32 1 @@ -992,7 +992,7 @@ entry(%0 : $Builtin.Int63): return %u : $SinglePayloadSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[T:%.*]] = trunc i64 %0 to i63 // CHECK-64: [[BYTE:%.*]] = zext i63 [[T]] to i64 @@ -1019,7 +1019,7 @@ entry: return %u : $SinglePayloadSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_y_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_y_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0x8000_0000_0000_0000 // CHECK-64: store i64 -9223372036854775808, ptr %0 @@ -1304,7 +1304,7 @@ end(%z : $()): return %z : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc i8 @dynamic_single_payload_empty_payload_load(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc i8 @dynamic_single_payload_empty_payload_load(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: %1 = load i8, ptr %0 // CHECK: ret i8 %1 @@ -1315,7 +1315,7 @@ entry(%p : $*DynamicSinglePayload<()>): return %x : $DynamicSinglePayload<()> } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_empty_payload_store(ptr nocapture dereferenceable({{.*}}) %0, i8 %1) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_empty_payload_store(ptr captures(none) dereferenceable({{.*}}) %0, i8 %1) {{.*}} { // CHECK: entry: // CHECK: store i8 %1, ptr %0 // CHECK: ret void @@ -1440,7 +1440,7 @@ end: return %v : $() } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bits_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bits_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { sil @multi_payload_no_spare_bits_switch_indirect : $(@inout MultiPayloadNoSpareBits) -> () { entry(%u : $*MultiPayloadNoSpareBits): // CHECK-64: [[PAYLOAD:%.*]] = load i64, ptr %0 @@ -1494,7 +1494,7 @@ entry(%0 : $Builtin.Int64): return %u : $MultiPayloadNoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: store i64 %0, ptr %1 // CHECK-64: [[T0:%.*]] = getelementptr inbounds %T4enum23MultiPayloadNoSpareBitsO, ptr %1, i32 0, i32 1 @@ -1547,7 +1547,7 @@ entry: return %u : $MultiPayloadNoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // CHECK-64: store i64 0, ptr %0 // CHECK-64: [[T0:%.*]] = getelementptr inbounds %T4enum23MultiPayloadNoSpareBitsO, ptr %0, i32 0, i32 1 @@ -1738,7 +1738,7 @@ entry(%0 : $Builtin.Int62): return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i62 // CHECK-64: [[BYTE:%.*]] = zext i62 [[NATIVECC_TRUNC]] to i64 @@ -1776,7 +1776,7 @@ entry(%0 : $Builtin.Int63): return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_y_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_y_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i63 // CHECK-64: [[BYTE:%.*]] = zext i63 [[NATIVECC_TRUNC]] to i64 @@ -1826,7 +1826,7 @@ entry: return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0x8000_0000_0000_0000 // CHECK-64: store i64 -9223372036854775808, ptr %0 @@ -1970,7 +1970,7 @@ entry(%0 : $Builtin.Int62): return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i62 // CHECK-64: [[BYTE:%.*]] = zext i62 [[NATIVECC_TRUNC]] to i64 @@ -2004,7 +2004,7 @@ entry(%0 : $Builtin.Int60): return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_y_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_y_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i60 // CHECK-64: [[BYTE:%.*]] = zext i60 [[NATIVECC_TRUNC]] to i64 @@ -2051,7 +2051,7 @@ entry: return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0xC000_0000_0000_0000 // CHECK-64: store i64 -4611686018427387904, ptr %0 @@ -2255,7 +2255,7 @@ enum MultiPayloadNestedSpareBits { case B(MultiPayloadInnerSpareBits) } -// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_nested_spare_bits_switch(ptr noalias nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_nested_spare_bits_switch(ptr noalias captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // CHECK-64: %1 = load [[WORD]], ptr %0 // CHECK-64: %2 = lshr [[WORD]] %1, 61 @@ -2325,7 +2325,7 @@ enum MultiPayloadAddressOnlyFixed { case Y(Builtin.Int32) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_address_only_destroy(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_address_only_destroy(ptr noalias captures(none) dereferenceable({{.*}}) %0) sil @multi_payload_address_only_destroy : $@convention(thin) (@in MultiPayloadAddressOnlyFixed) -> () { entry(%m : $*MultiPayloadAddressOnlyFixed): destroy_addr %m : $*MultiPayloadAddressOnlyFixed diff --git a/test/IRGen/enum_derived.swift b/test/IRGen/enum_derived.swift index 02f91193ec81d..c15b4820f36ee 100644 --- a/test/IRGen/enum_derived.swift +++ b/test/IRGen/enum_derived.swift @@ -48,8 +48,8 @@ extension def_enum.TrafficLight : Error {} extension def_enum.Term : Error {} -// CHECK-NORMAL-LABEL: define hidden {{.*}}i64 @"$s12enum_derived7PhantomO8rawValues5Int64Vvg"(i8 %0, ptr nocapture readnone %T) local_unnamed_addr -// CHECK-TESTABLE-LABEL: define{{( dllexport)?}}{{( protected)?}} {{.*}}i64 @"$s12enum_derived7PhantomO8rawValues5Int64Vvg"(i8 %0, ptr nocapture readnone %T) +// CHECK-NORMAL-LABEL: define hidden {{.*}}i64 @"$s12enum_derived7PhantomO8rawValues5Int64Vvg"(i8 %0, ptr captures(none) readnone %T) local_unnamed_addr +// CHECK-TESTABLE-LABEL: define{{( dllexport)?}}{{( protected)?}} {{.*}}i64 @"$s12enum_derived7PhantomO8rawValues5Int64Vvg"(i8 %0, ptr captures(none) readnone %T) enum Phantom : Int64 { case Up diff --git a/test/IRGen/enum_future.sil b/test/IRGen/enum_future.sil index 0418359d96bcf..9aa3a6d45b542 100644 --- a/test/IRGen/enum_future.sil +++ b/test/IRGen/enum_future.sil @@ -242,7 +242,7 @@ dest(%u2 : $(Builtin.Int64, Builtin.Int64)): return %x : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: br label %[[DEST:[0-9]+]] // CHECK: [[DEST]]: @@ -278,7 +278,7 @@ entry(%0 : $Builtin.Int64, %1 : $Builtin.Int64): return %u : $Singleton } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_inject_indirect(i64 %0, i64 %1, ptr nocapture dereferenceable({{.*}}) %2) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_inject_indirect(i64 %0, i64 %1, ptr captures(none) dereferenceable({{.*}}) %2) {{.*}} { // CHECK: entry: // CHECK: [[DATA_0_ADDR:%.*]] = getelementptr inbounds <{ i64, i64 }>, ptr %2, i32 0, i32 0 // CHECK: store i64 %0, ptr [[DATA_0_ADDR]] @@ -353,7 +353,7 @@ end: return %x : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { sil @no_payload_switch_indirect : $@convention(thin) (@inout NoPayloads) -> () { entry(%u : $*NoPayloads): // CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds %T11enum_future10NoPayloadsO, ptr %0, i32 0, i32 0 @@ -402,7 +402,7 @@ entry: return %u : $NoPayloads } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_inject_z_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_inject_z_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds %T11enum_future10NoPayloadsO, ptr %0, i32 0, i32 0 // CHECK: store i8 2, ptr [[TAG_ADDR]] @@ -633,7 +633,7 @@ entry(%0 : $Builtin.Word): return %u : $SinglePayloadNoXI2 } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_x_indirect([[WORD]] %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_x_indirect([[WORD]] %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK: entry: // CHECK: store [[WORD]] %0, ptr %1 // CHECK: [[T0:%.*]] = getelementptr inbounds %T11enum_future18SinglePayloadNoXI2O, ptr %1, i32 0, i32 1 @@ -659,7 +659,7 @@ entry: return %u : $SinglePayloadNoXI2 } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_y_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_y_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: store [[WORD]] 0, ptr %0 // CHECK: [[T0:%.*]] = getelementptr inbounds %T11enum_future18SinglePayloadNoXI2O, ptr %0, i32 0, i32 1 @@ -996,7 +996,7 @@ entry(%0 : $Builtin.Int63): return %u : $SinglePayloadSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[T:%.*]] = trunc i64 %0 to i63 // CHECK-64: [[BYTE:%.*]] = zext i63 [[T]] to i64 @@ -1023,7 +1023,7 @@ entry: return %u : $SinglePayloadSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_y_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_y_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0x8000_0000_0000_0000 // CHECK-64: store i64 -9223372036854775808, ptr %0 @@ -1308,7 +1308,7 @@ end(%z : $()): return %z : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc i8 @dynamic_single_payload_empty_payload_load(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc i8 @dynamic_single_payload_empty_payload_load(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: %1 = load i8, ptr %0 // CHECK: ret i8 %1 @@ -1319,7 +1319,7 @@ entry(%p : $*DynamicSinglePayload<()>): return %x : $DynamicSinglePayload<()> } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_empty_payload_store(ptr nocapture dereferenceable({{.*}}) %0, i8 %1) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_empty_payload_store(ptr captures(none) dereferenceable({{.*}}) %0, i8 %1) {{.*}} { // CHECK: entry: // CHECK: store i8 %1, ptr %0 // CHECK: ret void @@ -1444,7 +1444,7 @@ end: return %v : $() } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bits_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bits_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { sil @multi_payload_no_spare_bits_switch_indirect : $(@inout MultiPayloadNoSpareBits) -> () { entry(%u : $*MultiPayloadNoSpareBits): // CHECK-64: [[PAYLOAD:%.*]] = load i64, ptr %0 @@ -1498,7 +1498,7 @@ entry(%0 : $Builtin.Int64): return %u : $MultiPayloadNoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: store i64 %0, ptr %1 // CHECK-64: [[T0:%.*]] = getelementptr inbounds %T11enum_future23MultiPayloadNoSpareBitsO, ptr %1, i32 0, i32 1 @@ -1551,7 +1551,7 @@ entry: return %u : $MultiPayloadNoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // CHECK-64: store i64 0, ptr %0 // CHECK-64: [[T0:%.*]] = getelementptr inbounds %T11enum_future23MultiPayloadNoSpareBitsO, ptr %0, i32 0, i32 1 @@ -1742,7 +1742,7 @@ entry(%0 : $Builtin.Int62): return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i62 // CHECK-64: [[VAL:%.*]] = zext i62 [[NATIVECC_TRUNC]] to i64 @@ -1780,7 +1780,7 @@ entry(%0 : $Builtin.Int63): return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_y_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_y_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i63 // CHECK-64: [[VAL:%.*]] = zext i63 [[NATIVECC_TRUNC]] to i64 @@ -1830,7 +1830,7 @@ entry: return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0x8000_0000_0000_0000 // CHECK-64: store i64 -9223372036854775808, ptr %0 @@ -1974,7 +1974,7 @@ entry(%0 : $Builtin.Int62): return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i62 // CHECK-64: [[VAL:%.*]] = zext i62 [[NATIVECC_TRUNC]] to i64 @@ -2008,7 +2008,7 @@ entry(%0 : $Builtin.Int60): return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_y_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_y_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i60 // CHECK-64: [[VAL:%.*]] = zext i60 [[NATIVECC_TRUNC]] to i64 @@ -2055,7 +2055,7 @@ entry: return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0xC000_0000_0000_0000 // CHECK-64: store i64 -4611686018427387904, ptr %0 @@ -2259,7 +2259,7 @@ enum MultiPayloadNestedSpareBits { case B(MultiPayloadInnerSpareBits) } -// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_nested_spare_bits_switch(ptr noalias nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_nested_spare_bits_switch(ptr noalias captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // CHECK-64: %1 = load [[WORD]], ptr %0 // CHECK-64: %2 = lshr [[WORD]] %1, 61 @@ -2329,7 +2329,7 @@ enum MultiPayloadAddressOnlyFixed { case Y(Builtin.Int32) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_address_only_destroy(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_address_only_destroy(ptr noalias captures(none) dereferenceable({{.*}}) %0) sil @multi_payload_address_only_destroy : $@convention(thin) (@in MultiPayloadAddressOnlyFixed) -> () { entry(%m : $*MultiPayloadAddressOnlyFixed): destroy_addr %m : $*MultiPayloadAddressOnlyFixed diff --git a/test/IRGen/enum_resilience.swift b/test/IRGen/enum_resilience.swift index 3220e4a0c1ef9..fd70946f1dbe8 100644 --- a/test/IRGen/enum_resilience.swift +++ b/test/IRGen/enum_resilience.swift @@ -260,7 +260,7 @@ public func resilientEnumPartialApply(_ f: (Medium) -> Int) { } -// CHECK-LABEL: define internal swiftcc void @"$s14resilient_enum6MediumOSiIgnd_ACSiIegnr_TRTA"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias %1, ptr swiftself %2) +// CHECK-LABEL: define internal swiftcc void @"$s14resilient_enum6MediumOSiIgnd_ACSiIegnr_TRTA"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias %1, ptr swiftself %2) // Enums with resilient payloads from a different resilience domain diff --git a/test/IRGen/errors.sil b/test/IRGen/errors.sil index fbb5d067594a3..217f619b8077c 100644 --- a/test/IRGen/errors.sil +++ b/test/IRGen/errors.sil @@ -79,8 +79,8 @@ entry(%0 : $AnyObject): // CHECK-wasm32: [[ERRORSLOT:%.*]] = alloca [[SWIFTERROR:.*]] ptr, align // CHECK-NEXT: store ptr null, ptr [[ERRORSLOT]], align - // CHECK-objc-NEXT: [[RESULT:%.*]] = call swiftcc ptr @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias nocapture [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) [[ERRORSLOT]]) - // CHECK-native-NEXT: [[RESULT:%.*]] = call swiftcc ptr @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias nocapture [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) [[ERRORSLOT]]) + // CHECK-objc-NEXT: [[RESULT:%.*]] = call swiftcc ptr @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias captures(none) [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) [[ERRORSLOT]]) + // CHECK-native-NEXT: [[RESULT:%.*]] = call swiftcc ptr @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias captures(none) [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) [[ERRORSLOT]]) // CHECK-NEXT: [[ERR:%.*]] = load ptr, ptr [[ERRORSLOT]], align // CHECK-NEXT: [[T0:%.*]] = icmp ne ptr [[ERR]], null // CHECK-NEXT: ptrtoint ptr [[ERR]] to i @@ -116,7 +116,7 @@ enum ColorError : Error { } // CHECK-LABEL: TestCallToWillThrowCallBack -// CHECK: call swiftcc void @swift_willThrow(ptr swiftself undef, ptr noalias nocapture readonly [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) %2) +// CHECK: call swiftcc void @swift_willThrow(ptr swiftself undef, ptr noalias captures(none) readonly [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) %2) // CHECK: store ptr %0 // CHECK: ret i64 undef sil hidden @TestCallToWillThrowCallBack : $@convention(thin) (@owned Error) -> (Int64, @error Error) { diff --git a/test/IRGen/existentials_objc.sil b/test/IRGen/existentials_objc.sil index 35bb3b5813f8b..4ca9b4a54fa58 100644 --- a/test/IRGen/existentials_objc.sil +++ b/test/IRGen/existentials_objc.sil @@ -22,7 +22,7 @@ bb0(%0 : $*Any, %1 : $T): return %3 : $() } -// CHECK-DAG: define{{( protected)?}} swiftcc void @init_opaque_existential(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %T) {{.*}} { +// CHECK-DAG: define{{( protected)?}} swiftcc void @init_opaque_existential(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %T) {{.*}} { // CHECK: [[T0:%.*]] = getelementptr inbounds [[ANY:%Any]], ptr %0, i32 0, i32 1 // CHECK-NEXT: store ptr %T, ptr [[T0]], align 8 // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[ANY]], ptr %0, i32 0, i32 0 @@ -37,7 +37,7 @@ bb0(%0 : $*Any, %1 : $*Any): return %3 : $() } -// CHECK-DAG: define{{( protected)?}} swiftcc void @take_opaque_existential(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-DAG: define{{( protected)?}} swiftcc void @take_opaque_existential(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK: call ptr @"$sypWOb"(ptr %1, ptr %0) // CHECK-NEXT: ret void diff --git a/test/IRGen/extern_c_abitypes.swift b/test/IRGen/extern_c_abitypes.swift index 34a9c818eb092..4a14163612ec4 100644 --- a/test/IRGen/extern_c_abitypes.swift +++ b/test/IRGen/extern_c_abitypes.swift @@ -101,12 +101,12 @@ func test() { // assume %struct.c_struct and %TSo8c_structV have compatible layout // - // CHECK-x86_64: call void @c_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) - // CHECK-x86_64: call void @swift_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) - // CHECK-arm64: call void @c_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) - // CHECK-arm64: call void @swift_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) - // CHECK-wasm32: call void @c_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) - // CHECK-wasm32: call void @swift_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) + // CHECK-x86_64: call void @c_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) + // CHECK-x86_64: call void @swift_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) + // CHECK-arm64: call void @c_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) + // CHECK-arm64: call void @swift_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) + // CHECK-wasm32: call void @c_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) + // CHECK-wasm32: call void @swift_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) // CHECK-armv7k: call [3 x i32] @c_roundtrip_c_struct([3 x i32] {{.*}}) // CHECK-armv7k: call [3 x i32] @swift_roundtrip_c_struct([3 x i32] {{.*}}) var c_struct_val = c_struct(foo: 496, bar: 28, baz: 8) diff --git a/test/IRGen/fixlifetime.sil b/test/IRGen/fixlifetime.sil index c6c971758c49e..df298bfb85831 100644 --- a/test/IRGen/fixlifetime.sil +++ b/test/IRGen/fixlifetime.sil @@ -8,7 +8,7 @@ // unnecessary. // ONONE-NOT: @__swift_fixLifetime -// CHECK-objc-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr noalias nocapture dereferenceable({{.*}}) %5, {{(i64|i32)}} %6, {{(i64|i32)}} %7) {{.*}} { +// CHECK-objc-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr noalias captures(none) dereferenceable({{.*}}) %5, {{(i64|i32)}} %6, {{(i64|i32)}} %7) {{.*}} { // CHECK-objc: entry: // CHECK-objc: call void @__swift_fixLifetime(ptr // CHECK-objc: call void @__swift_fixLifetime(ptr @@ -20,7 +20,7 @@ // CHECK-objc: call void @__swift_fixLifetime(ptr [[TEMP]]) // CHECK-objc: call void @__swift_fixLifetime(ptr -// CHECK-native-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr noalias nocapture dereferenceable({{.*}}) %5, {{(i64|i32)}} %6, {{(i64|i32)}} %7) {{.*}} { +// CHECK-native-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr noalias captures(none) dereferenceable({{.*}}) %5, {{(i64|i32)}} %6, {{(i64|i32)}} %7) {{.*}} { // CHECK-native: entry: // CHECK-native: call void @__swift_fixLifetime(ptr // CHECK-native: call void @__swift_fixLifetime(ptr diff --git a/test/IRGen/function_param_convention.sil b/test/IRGen/function_param_convention.sil index 124b964fefd72..a3190feccaa4c 100644 --- a/test/IRGen/function_param_convention.sil +++ b/test/IRGen/function_param_convention.sil @@ -10,7 +10,7 @@ struct X { // Make sure we can irgen a SIL function with various parameter attributes // without choking. This is just a basic reality check. -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @foo(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1, ptr nocapture dereferenceable({{.*}}) %2, ptr noalias nocapture dereferenceable({{.*}}) %3, i32 %4, i32 %5, i32 %6) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @foo(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1, ptr captures(none) dereferenceable({{.*}}) %2, ptr noalias captures(none) dereferenceable({{.*}}) %3, i32 %4, i32 %5, i32 %6) {{.*}} { sil @foo : $@convention(thin) (@in X, @inout X, @in_guaranteed X, @owned X, X, @guaranteed X) -> @out X { bb0(%0 : $*X, %1 : $*X, %2 : $*X, %3 : $*X, %4 : $X, %5 : $X, %6 : $X): diff --git a/test/IRGen/function_types.sil b/test/IRGen/function_types.sil index c2d022bd9ba32..d0857262b668b 100644 --- a/test/IRGen/function_types.sil +++ b/test/IRGen/function_types.sil @@ -52,9 +52,9 @@ struct X {} sil @out_void_return : $@convention(thin) () -> @out X -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @use_void_return_value(ptr noalias nocapture sret({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @use_void_return_value(ptr noalias captures(none) sret({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: -// CHECK-NEXT: call swiftcc void @out_void_return(ptr noalias nocapture sret({{.*}}) %0) +// CHECK-NEXT: call swiftcc void @out_void_return(ptr noalias captures(none) sret({{.*}}) %0) // CHECK-NEXT: ret void // CHECK-NEXT: } sil @use_void_return_value : $@convention(thin) () -> @out X { diff --git a/test/IRGen/generic_casts.swift b/test/IRGen/generic_casts.swift index edb132269d1f4..a7de242134627 100644 --- a/test/IRGen/generic_casts.swift +++ b/test/IRGen/generic_casts.swift @@ -58,7 +58,7 @@ func intToAll(_ x: Int) -> T { return x as! T } -// CHECK: define hidden swiftcc i64 @"$s13generic_casts8anyToIntySiypF"(ptr noalias nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define hidden swiftcc i64 @"$s13generic_casts8anyToIntySiypF"(ptr noalias captures(none) dereferenceable({{.*}}) %0) {{.*}} { func anyToInt(_ x: Any) -> Int { return x as! Int } @@ -104,7 +104,7 @@ func classExistentialToOpaqueArchetype(_ x: ObjCProto1) -> T { protocol P {} protocol Q {} -// CHECK: define hidden swiftcc void @"$s13generic_casts19compositionToMemberyAA1P_pAaC_AA1QpF{{.*}}"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK: define hidden swiftcc void @"$s13generic_casts19compositionToMemberyAA1P_pAaC_AA1QpF{{.*}}"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) {{.*}} { func compositionToMember(_ a: P & Q) -> P { return a } diff --git a/test/IRGen/generic_metatypes.swift b/test/IRGen/generic_metatypes.swift index d27fe84c46160..ed4e602c1dc63 100644 --- a/test/IRGen/generic_metatypes.swift +++ b/test/IRGen/generic_metatypes.swift @@ -58,7 +58,7 @@ func genericMetatypes(_ t: T.Type, _ u: U.Type) {} protocol Bas {} -// CHECK: define hidden swiftcc { ptr, ptr } @"$s17generic_metatypes14protocolTypeof{{.*}}"(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK: define hidden swiftcc { ptr, ptr } @"$s17generic_metatypes14protocolTypeof{{.*}}"(ptr noalias captures(none) dereferenceable({{.*}}) %0) func protocolTypeof(_ x: Bas) -> Bas.Type { // CHECK: [[METADATA_ADDR:%.*]] = getelementptr inbounds %T17generic_metatypes3BasP, ptr [[X:%.*]], i32 0, i32 1 // CHECK: [[METADATA:%.*]] = load ptr, ptr [[METADATA_ADDR]] diff --git a/test/IRGen/generic_metatypes_future.swift b/test/IRGen/generic_metatypes_future.swift index f1492f3c9f46e..052bb6551f3f7 100644 --- a/test/IRGen/generic_metatypes_future.swift +++ b/test/IRGen/generic_metatypes_future.swift @@ -59,7 +59,7 @@ func genericMetatypes(_ t: T.Type, _ u: U.Type) {} protocol Bas {} -// CHECK: define hidden swiftcc { ptr, ptr } @"$s17generic_metatypes14protocolTypeof{{.*}}"(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK: define hidden swiftcc { ptr, ptr } @"$s17generic_metatypes14protocolTypeof{{.*}}"(ptr noalias captures(none) dereferenceable({{.*}}) %0) func protocolTypeof(_ x: Bas) -> Bas.Type { // CHECK: [[METADATA_ADDR:%.*]] = getelementptr inbounds %T17generic_metatypes3BasP, ptr [[X:%.*]], i32 0, i32 1 // CHECK: [[METADATA:%.*]] = load ptr, ptr [[METADATA_ADDR]] diff --git a/test/IRGen/generic_ternary.swift b/test/IRGen/generic_ternary.swift index f44288913f1b2..7d679d68a50ef 100644 --- a/test/IRGen/generic_ternary.swift +++ b/test/IRGen/generic_ternary.swift @@ -4,7 +4,7 @@ // struct OptionalStreamAdaptor { - // CHECK: define hidden swiftcc void @"$s15generic_ternary21OptionalStreamAdaptorV4next{{[_0-9a-zA-Z]*}}F"(ptr noalias sret({{.*}}) %0, ptr %"OptionalStreamAdaptor", ptr nocapture swiftself dereferenceable({{.*}}) %1) + // CHECK: define hidden swiftcc void @"$s15generic_ternary21OptionalStreamAdaptorV4next{{[_0-9a-zA-Z]*}}F"(ptr noalias sret({{.*}}) %0, ptr %"OptionalStreamAdaptor", ptr captures(none) swiftself dereferenceable({{.*}}) %1) mutating func next() -> Optional { return x[0].next() diff --git a/test/IRGen/indexing.sil b/test/IRGen/indexing.sil index a908a84d15d9e..ed9c72218e81f 100644 --- a/test/IRGen/indexing.sil +++ b/test/IRGen/indexing.sil @@ -12,7 +12,7 @@ struct SameSizeStride { var x, y: Builtin.Int32 } // This type has unequal stride and size. struct DifferentSizeStride { var x: Builtin.Int32, y: Builtin.Int16 } -// CHECK: define{{( protected)?}} {{.*}}void @same_size_stride(ptr noalias nocapture dereferenceable({{.*}}) %0, i64 %1) {{.*}} { +// CHECK: define{{( protected)?}} {{.*}}void @same_size_stride(ptr noalias captures(none) dereferenceable({{.*}}) %0, i64 %1) {{.*}} { // CHECK: getelementptr inbounds %T8indexing14SameSizeStrideV, ptr %0, i64 %1 sil @same_size_stride : $@convention(thin) (@in SameSizeStride, Builtin.Word) -> () { entry(%p : $*SameSizeStride, %i: $Builtin.Word): @@ -20,7 +20,7 @@ entry(%p : $*SameSizeStride, %i: $Builtin.Word): return undef : $() } -// CHECK: define{{( protected)?}} {{.*}}void @different_size_stride(ptr noalias nocapture dereferenceable({{.*}}) %0, i64 %1) {{.*}} { +// CHECK: define{{( protected)?}} {{.*}}void @different_size_stride(ptr noalias captures(none) dereferenceable({{.*}}) %0, i64 %1) {{.*}} { // CHECK: %2 = mul nsw i64 %1, 8 // CHECK-NEXT: %3 = getelementptr inbounds i8, ptr %0, i64 %2 sil @different_size_stride : $@convention(thin) (@in DifferentSizeStride, Builtin.Word) -> () { @@ -29,7 +29,7 @@ entry(%p : $*DifferentSizeStride, %i: $Builtin.Word): return undef : $() } -// CHECK: define{{( protected)?}} {{.*}}void @zero_size(ptr noalias nocapture %0, i64 %1) {{.*}} { +// CHECK: define{{( protected)?}} {{.*}}void @zero_size(ptr noalias captures(none) %0, i64 %1) {{.*}} { // CHECK: %2 = mul nsw i64 %1, 1 // CHECK-NEXT: %3 = getelementptr inbounds i8, ptr %0, i64 %2 sil @zero_size : $@convention(thin) (@in (), Builtin.Word) -> () { diff --git a/test/IRGen/indirect_argument.sil b/test/IRGen/indirect_argument.sil index bb521b9ba5907..54017eab819d4 100644 --- a/test/IRGen/indirect_argument.sil +++ b/test/IRGen/indirect_argument.sil @@ -15,9 +15,9 @@ struct HugeAlignment { } // TODO: could be the context param -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_method(ptr noalias nocapture swiftself dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_method(ptr noalias captures(none) swiftself dereferenceable({{.*}}) %0) // CHECK-NOT: alloca -// CHECK: call swiftcc void @huge_method(ptr noalias nocapture swiftself dereferenceable({{.*}}) %0) +// CHECK: call swiftcc void @huge_method(ptr noalias captures(none) swiftself dereferenceable({{.*}}) %0) sil @huge_method : $@convention(method) (Huge) -> () { entry(%x : $Huge): %f = function_ref @huge_method : $@convention(method) (Huge) -> () @@ -25,9 +25,9 @@ entry(%x : $Huge): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) // CHECK-NOT: alloca -// CHECK: call swiftcc void @huge_param(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK: call swiftcc void @huge_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) sil @huge_param : $@convention(thin) (Huge) -> () { entry(%x : $Huge): %f = function_ref @huge_param : $@convention(thin) (Huge) -> () @@ -35,9 +35,9 @@ entry(%x : $Huge): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_alignment_param(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_alignment_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) // CHECK-NOT: alloca -// CHECK: call swiftcc void @huge_alignment_param(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK: call swiftcc void @huge_alignment_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) sil @huge_alignment_param : $@convention(thin) (HugeAlignment) -> () { entry(%x : $HugeAlignment): %f = function_ref @huge_alignment_param : $@convention(thin) (HugeAlignment) -> () @@ -45,9 +45,9 @@ entry(%x : $HugeAlignment): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param_and_return(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param_and_return(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) // CHECK: [[TMP_RET:%.*]] = alloca -// CHECK: call swiftcc void @huge_param_and_return(ptr noalias nocapture sret({{.*}}) [[TMP_RET]], ptr noalias nocapture dereferenceable({{.*}}) %1) +// CHECK: call swiftcc void @huge_param_and_return(ptr noalias captures(none) sret({{.*}}) [[TMP_RET]], ptr noalias captures(none) dereferenceable({{.*}}) %1) sil @huge_param_and_return : $@convention(thin) (Huge) -> Huge { entry(%x : $Huge): %f = function_ref @huge_param_and_return : $@convention(thin) (Huge) -> Huge @@ -55,9 +55,9 @@ entry(%x : $Huge): return %z : $Huge } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param_and_indirect_return(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param_and_indirect_return(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) // CHECK-NOT: alloca -// CHECK: call swiftcc void @huge_param_and_indirect_return(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) +// CHECK: call swiftcc void @huge_param_and_indirect_return(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) sil @huge_param_and_indirect_return : $@convention(thin) (Huge) -> @out Huge { entry(%o : $*Huge, %x : $Huge): %f = function_ref @huge_param_and_indirect_return : $@convention(thin) (Huge) -> @out Huge @@ -65,16 +65,16 @@ entry(%o : $*Huge, %x : $Huge): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_partial_application(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_partial_application(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) // CHECK-NOT: alloca // CHECK: [[CLOSURE:%.*]] = call noalias ptr @swift_allocObject -// CHECK: call swiftcc {{.*}} @"$s24huge_partial_applicationTA{{(\.ptrauth)?}}"{{.*}}(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr swiftself [[CLOSURE]]) -// CHECK: define internal swiftcc void @"$s24huge_partial_applicationTA"(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr swiftself %1) +// CHECK: call swiftcc {{.*}} @"$s24huge_partial_applicationTA{{(\.ptrauth)?}}"{{.*}}(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr swiftself [[CLOSURE]]) +// CHECK: define internal swiftcc void @"$s24huge_partial_applicationTA"(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr swiftself %1) // CHECK-NOT: alloca // CHECK: [[GEP:%.*]] = getelementptr inbounds <{ %swift.refcounted, %T17indirect_argument4HugeV }>, ptr %1, i32 0, i32 1 // CHECK-NOT: alloca // CHECK-NOT: tail -// CHECK: call swiftcc void @huge_partial_application(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) [[GEP]] +// CHECK: call swiftcc void @huge_partial_application(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) [[GEP]] // CHECK: call void @swift_release(ptr %1) sil @huge_partial_application : $@convention(thin) (Huge, Huge) -> () { entry(%x : $Huge, %y : $Huge): @@ -84,16 +84,16 @@ entry(%x : $Huge, %y : $Huge): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_partial_application_stret(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1, ptr noalias nocapture dereferenceable({{.*}}) %2) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_partial_application_stret(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1, ptr noalias captures(none) dereferenceable({{.*}}) %2) // CHECK: [[TMP_RET:%.*]] = alloca // CHECK: [[CLOSURE:%.*]] = call noalias ptr @swift_allocObject -// CHECK: call swiftcc {{.*}} @"$s30huge_partial_application_stretTA{{(\.ptrauth)?}}"{{.*}}(ptr noalias nocapture sret({{.*}}) [[TMP_RET]], ptr noalias nocapture dereferenceable({{.*}}) %1, ptr swiftself [[CLOSURE]]) -// CHECK: define internal swiftcc void @"$s30huge_partial_application_stretTA"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1, ptr swiftself %2) +// CHECK: call swiftcc {{.*}} @"$s30huge_partial_application_stretTA{{(\.ptrauth)?}}"{{.*}}(ptr noalias captures(none) sret({{.*}}) [[TMP_RET]], ptr noalias captures(none) dereferenceable({{.*}}) %1, ptr swiftself [[CLOSURE]]) +// CHECK: define internal swiftcc void @"$s30huge_partial_application_stretTA"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1, ptr swiftself %2) // CHECK-NOT: alloca // CHECK: [[GEP:%.*]] = getelementptr inbounds <{ %swift.refcounted, %T17indirect_argument4HugeV }>, ptr %2, i32 0, i32 1 // CHECK-NOT: alloca // CHECK-NOT: tail -// CHECK: call swiftcc void @huge_partial_application_stret(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1, ptr noalias nocapture dereferenceable({{.*}}) [[GEP]]) +// CHECK: call swiftcc void @huge_partial_application_stret(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1, ptr noalias captures(none) dereferenceable({{.*}}) [[GEP]]) // CHECK: call void @swift_release(ptr %2) sil @huge_partial_application_stret : $@convention(thin) (Huge, Huge) -> Huge { entry(%x : $Huge, %y : $Huge): diff --git a/test/IRGen/indirect_return.swift b/test/IRGen/indirect_return.swift index 96b2a9bb02953..965548eb3a8c9 100644 --- a/test/IRGen/indirect_return.swift +++ b/test/IRGen/indirect_return.swift @@ -20,6 +20,6 @@ func foo() -> (String, String, String, Number, Number) { } // CHECK-LABEL: define{{.*}}testCall func testCall() { -// CHECK: call swiftcc void @"$s15indirect_return3fooSS_S2SAA6Number_pAaC_ptyF"(ptr noalias nocapture %{{.*}} +// CHECK: call swiftcc void @"$s15indirect_return3fooSS_S2SAA6Number_pAaC_ptyF"(ptr noalias captures(none) %{{.*}} print(foo()) } diff --git a/test/IRGen/inout_noalias.sil b/test/IRGen/inout_noalias.sil index 6a3c4fe86bce6..165db0f297b0c 100644 --- a/test/IRGen/inout_noalias.sil +++ b/test/IRGen/inout_noalias.sil @@ -2,7 +2,7 @@ import Swift -// CHECK: define{{.*}}swiftcc void @takeInoutAliasable(ptr nocapture dereferenceable({{[0-9]+}}) %0, ptr %T) +// CHECK: define{{.*}}swiftcc void @takeInoutAliasable(ptr captures(none) dereferenceable({{[0-9]+}}) %0, ptr %T) sil @takeInoutAliasable : $ (@inout_aliasable UnsafePointer) -> () { entry(%ptr : $*UnsafePointer): %retval = tuple () diff --git a/test/IRGen/lazy_multi_file.swift b/test/IRGen/lazy_multi_file.swift index 7e53cbd4d6833..b66f542bbbf96 100644 --- a/test/IRGen/lazy_multi_file.swift +++ b/test/IRGen/lazy_multi_file.swift @@ -14,7 +14,7 @@ class Subclass : LazyContainerClass { // an indirect return value. When it shrinks back, remove the optional // indirect out. // - // CHECK-LABEL: @"$s15lazy_multi_file8SubclassC6getStrSSyF"({{(ptr noalias nocapture sret, )?}}ptr swiftself %0) {{.*}} { + // CHECK-LABEL: @"$s15lazy_multi_file8SubclassC6getStrSSyF"({{(ptr noalias captures(none) sret, )?}}ptr swiftself %0) {{.*}} { func getStr() -> String { // CHECK: = getelementptr inbounds %T15lazy_multi_file8SubclassC, ptr %0, i32 0, i32 3 return str diff --git a/test/IRGen/lifetime.sil b/test/IRGen/lifetime.sil index e4909f3356dd9..5139e22e5682a 100644 --- a/test/IRGen/lifetime.sil +++ b/test/IRGen/lifetime.sil @@ -99,7 +99,7 @@ bb0(%x : $*Builtin.Int64): %0 = tuple () return %0 : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @fixed_size(ptr noalias nocapture dereferenceable(8) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @fixed_size(ptr noalias captures(none) dereferenceable(8) %0) // CHECK: [[XBUF:%.*]] = alloca i64 // CHECK-NEXT: call void @llvm.lifetime.start.p0({{(i32|i64)}} 8, ptr [[XBUF]]) // CHECK-NEXT: load diff --git a/test/IRGen/moveonly_split_module_source_deinit.swift b/test/IRGen/moveonly_split_module_source_deinit.swift index a9b1836263f0d..7cae1a4aa3fb4 100644 --- a/test/IRGen/moveonly_split_module_source_deinit.swift +++ b/test/IRGen/moveonly_split_module_source_deinit.swift @@ -7,7 +7,7 @@ // Make sure we call the deinit through the value witness table in the other module. -// REFERRING_MODULE-LABEL: define {{.*}}swiftcc void @"$s6serverAAV4mainyyKFZ"(ptr swiftself %0, ptr noalias nocapture swifterror dereferenceable({{(8|4)}}) %1) {{.*}}{ +// REFERRING_MODULE-LABEL: define {{.*}}swiftcc void @"$s6serverAAV4mainyyKFZ"(ptr swiftself %0, ptr noalias captures(none) swifterror dereferenceable({{(8|4)}}) %1) {{.*}}{ // REFERRING_MODULE: [[SERVER:%.*]] = alloca %T6server8MoveOnlyV // REFERRING_MODULE: [[VALUE_WITNESS_TABLE:%.*]] = getelementptr inbounds ptr, ptr %"$s6server8MoveOnlyVN.valueWitnesses" // REFERRING_MODULE: [[VALUE_WITNESS:%.*]] = load ptr, ptr [[VALUE_WITNESS_TABLE]] diff --git a/test/IRGen/moveonly_value_functions.swift b/test/IRGen/moveonly_value_functions.swift index f14abc9f87622..d1093a5839032 100644 --- a/test/IRGen/moveonly_value_functions.swift +++ b/test/IRGen/moveonly_value_functions.swift @@ -198,7 +198,7 @@ public func takeOuterDeinitingNC_1(_ t: consuming OuterDeinitingNC_1) { // CHECK: [[INNER_DEINITING_RELEASABLE_NC_METADATA:%[^,]+]] = extractvalue %swift.metadata_response [[RESPONSE]] // CHECK: call swiftcc void @"$s24moveonly_value_functions26InnerDeinitingReleasableNCVfD"( // CHECK-SAME: ptr [[INNER_DEINITING_RELEASABLE_NC_METADATA]], -// : ptr noalias nocapture swiftself dereferenceable(64) %deinit.arg) +// : ptr noalias captures(none) swiftself dereferenceable(64) %deinit.arg) // CHECK: } public func takeOuterNC_1(_ o: consuming OuterNC_1) { external_symbol() @@ -295,7 +295,7 @@ public func takeGenericContext_1OuterNC_1(_ e: consuming GenericContext_1 public func takeOuterSinglePayloadNC_1(_ e: consuming OuterSinglePayloadNC_1) {} // CHECK-LABEL: define{{.*}} @"$s24moveonly_value_functions26takeOuterSinglePayloadNC_2yyAA0efgH2_2OyxGnlF"( -// : ptr noalias nocapture dereferenceable(64) %0, +// : ptr noalias captures(none) dereferenceable(64) %0, // CHECK-SAME: ptr %T) // CHECK-SAME: { // CHECK: call{{.*}} @"$s24moveonly_value_functions22OuterSinglePayloadNC_2OyxGlWOh"( @@ -388,7 +388,7 @@ public func takeOuterMultiPayloadNC_1(_ e: consuming OuterMultiPayloadNC_1 // CHECK: } public func takeOuterMultiPayloadNC_2(_ e: consuming OuterMultiPayloadNC_2) {} // CHECK-LABEL: define{{.*}} @"$s24moveonly_value_functions25takeOuterMultiPayloadNC_3yyAA0efgH2_3OyxGnlF"( -// : ptr noalias nocapture dereferenceable(64) %0, +// : ptr noalias captures(none) dereferenceable(64) %0, // CHECK-SAME: ptr %T) // CHECK-SAME: { // CHECK: call{{.*}} @"$s24moveonly_value_functions21OuterMultiPayloadNC_3OyxGlWOh"( diff --git a/test/IRGen/moveonly_value_functions_onone.swift b/test/IRGen/moveonly_value_functions_onone.swift index 9530a4b82bc62..1e4f91fc6b11e 100644 --- a/test/IRGen/moveonly_value_functions_onone.swift +++ b/test/IRGen/moveonly_value_functions_onone.swift @@ -195,7 +195,7 @@ public func takeOuterDeinitingNC_1(_ t: consuming OuterDeinitingNC_1) { // CHECK: [[INNER_DEINITING_RELEASABLE_NC_METADATA:%[^,]+]] = extractvalue %swift.metadata_response [[RESPONSE]] // CHECK: call swiftcc void @"$s30moveonly_value_functions_onone26InnerDeinitingReleasableNCVfD"( // CHECK-SAME: ptr [[INNER_DEINITING_RELEASABLE_NC_METADATA]], -// : ptr noalias nocapture swiftself dereferenceable(64) %deinit.arg) +// : ptr noalias captures(none) swiftself dereferenceable(64) %deinit.arg) // CHECK: } public func takeOuterNC_1(_ o: consuming OuterNC_1) { external_symbol() @@ -288,7 +288,7 @@ public func takeGenericContext_1OuterNC_1(_ e: consuming GenericContext_1 public func takeOuterSinglePayloadNC_1(_ e: consuming OuterSinglePayloadNC_1) {} // CHECK-LABEL: define{{.*}} @"$s30moveonly_value_functions_onone26takeOuterSinglePayloadNC_2yyAA0fghI2_2OyxGnlF"( -// : ptr noalias nocapture dereferenceable(64) %0, +// : ptr noalias captures(none) dereferenceable(64) %0, // CHECK-SAME: ptr %T) // CHECK-SAME: { // CHECK: call{{.*}} @"$s30moveonly_value_functions_onone22OuterSinglePayloadNC_2OyxGlWOh"( @@ -305,7 +305,7 @@ public func takeOuterSinglePayloadNC_1(_ e: consuming OuterSinglePayloadNC_1< // CHECK: [[METADATA:%[^,]+]] = extractvalue %swift.metadata_response [[RESPONSE]], 0 // CHECK: call swiftcc void @"$s30moveonly_value_functions_onone26InnerDeinitingReleasableNCVfD"( // CHECK-SAME: ptr [[METADATA]], -// : ptr noalias nocapture swiftself dereferenceable(64) %0) +// : ptr noalias captures(none) swiftself dereferenceable(64) %0) // CHECK: } public func takeOuterSinglePayloadNC_2(_ e: consuming OuterSinglePayloadNC_2) {} @@ -383,7 +383,7 @@ public func takeOuterMultiPayloadNC_1(_ e: consuming OuterMultiPayloadNC_1 // CHECK: } public func takeOuterMultiPayloadNC_2(_ e: consuming OuterMultiPayloadNC_2) {} // CHECK-LABEL: define{{.*}} @"$s30moveonly_value_functions_onone25takeOuterMultiPayloadNC_3yyAA0fghI2_3OyxGnlF"( -// : ptr noalias nocapture dereferenceable(64) %0, +// : ptr noalias captures(none) dereferenceable(64) %0, // CHECK-SAME: ptr %T) // CHECK-SAME: { // CHECK: call{{.*}} @"$s30moveonly_value_functions_onone21OuterMultiPayloadNC_3OyxGlWOh"( diff --git a/test/IRGen/objc_block_storage.sil b/test/IRGen/objc_block_storage.sil index 5ecd6d590d1a5..4954efe53fa8f 100644 --- a/test/IRGen/objc_block_storage.sil +++ b/test/IRGen/objc_block_storage.sil @@ -38,7 +38,7 @@ import gizmo // CHECK: ptr [[NSRECT_BLOCK_SIGNATURE]] // CHECK: } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @project_block_storage(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @project_block_storage(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK-NEXT: %1 = getelementptr inbounds { %objc_block, ptr }, ptr %0, i32 0, i32 1 // CHECK-NEXT: %2 = load ptr, ptr %1, align 8 @@ -51,7 +51,7 @@ entry(%0 : $*@block_storage Builtin.RawPointer): return %p : $Builtin.RawPointer } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc fp128 @overaligned_project_block_storage(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc fp128 @overaligned_project_block_storage(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK-NEXT: %1 = getelementptr inbounds { %objc_block, fp128 }, ptr %0, i32 0, i32 1 // CHECK-NEXT: %2 = load fp128, ptr %1, align 16 @@ -64,7 +64,7 @@ entry(%0 : $*@block_storage Builtin.FPIEEE128): return %p : $Builtin.FPIEEE128 } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_trivial(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_trivial(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: [[HEADER:%.*]] = getelementptr inbounds { %objc_block, ptr }, ptr %0, i32 0, i32 0 // CHECK: [[T0:%.*]] = getelementptr inbounds %objc_block, ptr [[HEADER]], i32 0, i32 0 // CHECK: store ptr [[BLOCK_ISA]], ptr [[T0]] @@ -109,7 +109,7 @@ entry(%0 : $*@block_storage Builtin.RawPointer, %1 : $Int): return %1 : $Int } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_nontrivial(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_nontrivial(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: [[HEADER:%.*]] = getelementptr inbounds // CHECK: [[T0:%.*]] = getelementptr inbounds %objc_block, ptr [[HEADER]], i32 0, i32 0 // CHECK: store ptr [[BLOCK_ISA]], ptr [[T0]] @@ -147,7 +147,7 @@ entry(%0 : $*@block_storage Builtin.NativeObject): sil public_external @invoke_nontrivial : $@convention(c) (@inout_aliasable @block_storage Builtin.NativeObject) -> () -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_stret(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_stret(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { // CHECK: [[HEADER:%.*]] = getelementptr inbounds // CHECK: [[T0:%.*]] = getelementptr inbounds %objc_block, ptr [[HEADER]], i32 0, i32 0 // CHECK: store ptr [[BLOCK_ISA]], ptr [[T0]] diff --git a/test/IRGen/objc_class_export.swift b/test/IRGen/objc_class_export.swift index 4f3e467940a27..c2b3b29460f34 100644 --- a/test/IRGen/objc_class_export.swift +++ b/test/IRGen/objc_class_export.swift @@ -87,13 +87,13 @@ struct BigStructWithNativeObjects { return NSRect(origin: NSPoint(x: 0, y: 0), size: NSSize(width: 0, height: 0)) } - // CHECK: define internal void @"$s17objc_class_export3FooC6boundsSo6NSRectVyFTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // CHECK: define internal void @"$s17objc_class_export3FooC6boundsSo6NSRectVyFTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { // CHECK: call swiftcc { double, double, double, double } @"$s17objc_class_export3FooC6boundsSo6NSRectVyF"(ptr swiftself %1) @objc func convertRectToBacking(r r: NSRect) -> NSRect { return r } - // CHECK: define internal void @"$s17objc_class_export3FooC20convertRectToBacking1rSo6NSRectVAG_tFTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr byval({{.*}} align 8 %3) {{[#0-9]*}} { + // CHECK: define internal void @"$s17objc_class_export3FooC20convertRectToBacking1rSo6NSRectVAG_tFTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr byval({{.*}} align 8 %3) {{[#0-9]*}} { // CHECK: call swiftcc { double, double, double, double } @"$s17objc_class_export3FooC20convertRectToBacking1rSo6NSRectVAG_tF"(double {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}, ptr swiftself %1) func doStuffToSwiftSlice(f f: [Int]) { diff --git a/test/IRGen/objc_generic_protocol_conformance.swift b/test/IRGen/objc_generic_protocol_conformance.swift index a87cebe9733e9..7510c614e9658 100644 --- a/test/IRGen/objc_generic_protocol_conformance.swift +++ b/test/IRGen/objc_generic_protocol_conformance.swift @@ -9,4 +9,4 @@ protocol P { extension Foo: P {} // SIL-LABEL: sil private [transparent] [thunk] [ossa] @$sSo3FooCyxG33objc_generic_protocol_conformance1PA2dEP3fooyyFTW {{.*}} @pseudogeneric -// IR-LABEL: define internal swiftcc void @"$sSo3FooCyxG33objc_generic_protocol_conformance1PA2dEP3fooyyFTW"(ptr noalias nocapture swiftself dereferenceable({{4|8}}) %0, ptr{{( %Self)?}}, ptr{{( %SelfWitnessTable)?}}) +// IR-LABEL: define internal swiftcc void @"$sSo3FooCyxG33objc_generic_protocol_conformance1PA2dEP3fooyyFTW"(ptr noalias captures(none) swiftself dereferenceable({{4|8}}) %0, ptr{{( %Self)?}}, ptr{{( %SelfWitnessTable)?}}) diff --git a/test/IRGen/objc_simd.sil b/test/IRGen/objc_simd.sil index cdbde09c874bf..b7803f97ba77c 100644 --- a/test/IRGen/objc_simd.sil +++ b/test/IRGen/objc_simd.sil @@ -57,15 +57,15 @@ entry(%x : $float3): } // x86_64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) -// i386-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @simd_native_args(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) +// i386-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @simd_native_args(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) // aarch64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // arm64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) -// armv6-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @simd_native_args(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) +// armv6-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @simd_native_args(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) // armv7-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // armv7s-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // armv7k-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // arm64_32-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) -// powerpc64-LABEL: define{{( dllexport)?}}{{( protected)?}} void @simd_native_args(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) +// powerpc64-LABEL: define{{( dllexport)?}}{{( protected)?}} void @simd_native_args(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) // powerpc64le-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // s390x-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // wasm32-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) diff --git a/test/IRGen/objc_structs.swift b/test/IRGen/objc_structs.swift index ab047f8476bfe..d09cd994e3bbc 100644 --- a/test/IRGen/objc_structs.swift +++ b/test/IRGen/objc_structs.swift @@ -16,7 +16,7 @@ import gizmo // CHECK: define hidden swiftcc { double, double, double, double } @"$s12objc_structs8getFrame{{[_0-9a-zA-Z]*}}F"(ptr %0) {{.*}} { func getFrame(_ g: Gizmo) -> NSRect { // CHECK: load ptr, ptr @"\01L_selector(frame)" - // CHECK: call void @objc_msgSend_stret(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}) + // CHECK: call void @objc_msgSend_stret(ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}) return g.frame() } // CHECK: } @@ -31,7 +31,7 @@ func setFrame(_ g: Gizmo, frame: NSRect) { // CHECK: define hidden swiftcc { double, double, double, double } @"$s12objc_structs8makeRect{{[_0-9a-zA-Z]*}}F"(double %0, double %1, double %2, double %3) func makeRect(_ a: Double, b: Double, c: Double, d: Double) -> NSRect { - // CHECK: call void @NSMakeRect(ptr noalias nocapture sret({{.*}}) {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}) + // CHECK: call void @NSMakeRect(ptr noalias captures(none) sret({{.*}}) {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}) return NSMakeRect(a,b,c,d) } // CHECK: } @@ -45,7 +45,7 @@ func stringFromRect(_ r: NSRect) -> String { // CHECK: define hidden swiftcc { double, double, double, double } @"$s12objc_structs9insetRect{{[_0-9a-zA-Z]*}}F"(double %0, double %1, double %2, double %3, double %4, double %5) func insetRect(_ r: NSRect, x: Double, y: Double) -> NSRect { - // CHECK: call void @NSInsetRect(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr byval({{.*}}) align 8 {{.*}}, double {{.*}}, double {{.*}}) + // CHECK: call void @NSInsetRect(ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr byval({{.*}}) align 8 {{.*}}, double {{.*}}, double {{.*}}) return NSInsetRect(r, x, y) } // CHECK: } @@ -53,13 +53,13 @@ func insetRect(_ r: NSRect, x: Double, y: Double) -> NSRect { // CHECK: define hidden swiftcc { double, double, double, double } @"$s12objc_structs19convertRectFromBase{{[_0-9a-zA-Z]*}}F"(ptr %0, double %1, double %2, double %3, double %4) func convertRectFromBase(_ v: NSView, r: NSRect) -> NSRect { // CHECK: load ptr, ptr @"\01L_selector(convertRectFromBase:)", align 8 - // CHECK: call void @objc_msgSend_stret(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}, ptr byval({{.*}}) align 8 {{.*}}) + // CHECK: call void @objc_msgSend_stret(ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}, ptr byval({{.*}}) align 8 {{.*}}) return v.convertRect(fromBase: r) } // CHECK: } // CHECK: define hidden swiftcc { ptr, ptr, ptr, ptr } @"$s12objc_structs20useStructOfNSStringsySo0deF0VADF"(ptr %0, ptr %1, ptr %2, ptr %3) -// CHECK: call void @useStructOfNSStringsInObjC(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) +// CHECK: call void @useStructOfNSStringsInObjC(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) func useStructOfNSStrings(_ s: StructOfNSStrings) -> StructOfNSStrings { return useStructOfNSStringsInObjC(s) } diff --git a/test/IRGen/objc_super.swift b/test/IRGen/objc_super.swift index b8a8a2cdea6e0..2cdbda5da233c 100644 --- a/test/IRGen/objc_super.swift +++ b/test/IRGen/objc_super.swift @@ -40,7 +40,7 @@ class Hoozit : Gizmo { // CHECK: [[T0:%.*]] = extractvalue %swift.metadata_response [[TMP]], 0 // CHECK: store ptr [[T0]], ptr {{.*}}, align 8 // CHECK: load ptr, ptr @"\01L_selector(frame)" - // CHECK: call void @objc_msgSendSuper2_stret(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}) + // CHECK: call void @objc_msgSendSuper2_stret(ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}) return NSInsetRect(super.frame(), 2.0, 2.0) } // CHECK: } diff --git a/test/IRGen/partial_apply.sil b/test/IRGen/partial_apply.sil index 6ebfac8e03a82..6b262b85abbf5 100644 --- a/test/IRGen/partial_apply.sil +++ b/test/IRGen/partial_apply.sil @@ -135,7 +135,7 @@ bb0(%x : $SwiftClass): sil public_external @indirect_guaranteed_captured_class_param : $@convention(thin) (Int, @in_guaranteed SwiftClass) -> Int -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_guaranteed_class_param(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_guaranteed_class_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) // CHECK-NOT: {{retain|release}} // CHECK: [[X:%.*]] = load ptr, ptr %0 // CHECK-NOT: {{retain|release}} @@ -148,7 +148,7 @@ sil public_external @indirect_guaranteed_captured_class_param : $@convention(thi // CHECK-NOT: load // CHECK-NOT: retain // CHECK-NOT: release -// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_guaranteed_captured_class_param(i64 %0, ptr noalias nocapture dereferenceable({{.*}}) [[X_TMP]] +// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_guaranteed_captured_class_param(i64 %0, ptr noalias captures(none) dereferenceable({{.*}}) [[X_TMP]] // CHECK-NOT: retain // CHECK: call void @swift_release(ptr %1) // CHECK: ret i64 [[RESULT]] @@ -162,7 +162,7 @@ bb0(%x : $*SwiftClass): sil public_external @indirect_consumed_captured_class_param : $@convention(thin) (Int, @in SwiftClass) -> Int -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_consumed_class_param(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_consumed_class_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) // CHECK-NOT: {{retain|release}} // CHECK: [[CONTEXT_OBJ:%.*]] = load ptr, ptr %0 // CHECK-NOT: {{retain|release}} @@ -175,7 +175,7 @@ sil public_external @indirect_consumed_captured_class_param : $@convention(thin) // CHECK-NOT: load // CHECK-NOT: retain // CHECK-NOT: release -// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_consumed_captured_class_param(i64 %0, ptr noalias nocapture dereferenceable({{.*}}) [[X_TMP]]) +// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_consumed_captured_class_param(i64 %0, ptr noalias captures(none) dereferenceable({{.*}}) [[X_TMP]]) // CHECK-NOT: retain // CHECK-NOT: release // CHECK: ret i64 [[RESULT]] @@ -227,7 +227,7 @@ bb0(%x : $SwiftClassPair): sil public_external @indirect_guaranteed_captured_class_pair_param : $@convention(thin) (Int, @in_guaranteed SwiftClassPair) -> Int -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_guaranteed_class_pair_param(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_guaranteed_class_pair_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) // CHECK: [[CONTEXT_OBJ:%.*]] = call noalias ptr @swift_allocObject // CHECK-NOT: {{retain|release}} // CHECK: [[T0:%.*]] = insertvalue {{.*}} [[PARTIAL_APPLY_FORWARDER:@"\$s[A-Za-z0-9_]+TA"]], {{.*}} [[CONTEXT_OBJ]] @@ -237,7 +237,7 @@ sil public_external @indirect_guaranteed_captured_class_pair_param : $@conventio // CHECK: [[PAIR_ADDR:%.*]] = getelementptr // CHECK-NOT: load // CHECK-NOT: retain -// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_guaranteed_captured_class_pair_param(i64 %0, ptr noalias nocapture dereferenceable({{.*}}) [[PAIR_ADDR]]) +// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_guaranteed_captured_class_pair_param(i64 %0, ptr noalias captures(none) dereferenceable({{.*}}) [[PAIR_ADDR]]) // CHECK: release{{.*}}%1) // CHECK: ret i64 [[RESULT]] @@ -250,7 +250,7 @@ bb0(%x : $*SwiftClassPair): sil public_external @indirect_consumed_captured_class_pair_param : $@convention(thin) (Int, @in SwiftClassPair) -> Int -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_consumed_class_pair_param(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_consumed_class_pair_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) // CHECK: [[CONTEXT_OBJ:%.*]] = call noalias ptr @swift_allocObject // CHECK-NOT: {{retain|release}} // CHECK: [[T0:%.*]] = insertvalue {{.*}} [[PARTIAL_APPLY_FORWARDER:@"\$s[A-Za-z0-9_]+TA"]], {{.*}} [[CONTEXT_OBJ]] @@ -260,7 +260,7 @@ sil public_external @indirect_consumed_captured_class_pair_param : $@convention( // CHECK: [[X_TMP:%.*]] = alloca // CHECK: call ptr @"$s13partial_apply14SwiftClassPairVWOc" // CHECK: release{{.*}}%1) -// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_consumed_captured_class_pair_param(i64 %0, ptr noalias nocapture dereferenceable({{.*}}) [[X_TMP]]) +// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_consumed_captured_class_pair_param(i64 %0, ptr noalias captures(none) dereferenceable({{.*}}) [[X_TMP]]) // CHECK: ret i64 [[RESULT]] sil @partial_apply_indirect_consumed_class_pair_param : $@convention(thin) (@in SwiftClassPair) -> @callee_owned (Int) -> Int { @@ -472,7 +472,7 @@ sil public_external @generic_indirect_return : $@convention(thin) (Int) -> @ // CHECK-LABEL: define{{.*}} @partial_apply_generic_indirect_return // CHECK: insertvalue {{.*}}$s23generic_indirect_returnTA -// CHECK-LABEL: define internal swiftcc void @"$s23generic_indirect_returnTA"(ptr noalias nocapture sret({{.*}}) %0, ptr swiftself +// CHECK-LABEL: define internal swiftcc void @"$s23generic_indirect_returnTA"(ptr noalias captures(none) sret({{.*}}) %0, ptr swiftself // CHECK: call swiftcc void @generic_indirect_return({{.*}} %0, // CHECK: ret void sil @partial_apply_generic_indirect_return : $@convention(thin) (Int) -> @callee_owned () -> @owned GenericEnum { @@ -500,7 +500,7 @@ sil public_external @generic_indirect_return2 : $@convention(thin) (Int) -> // CHECK: [[R2:%.*]] = insertvalue { ptr, ptr } [[R1]], ptr [[CTX2]], 1 // CHECK: ret { ptr, ptr } [[R2]] -// CHECK-LABEL: define internal swiftcc void @"$s24generic_indirect_return2TA"(ptr noalias nocapture sret({{.*}}) %0, ptr swiftself %1) +// CHECK-LABEL: define internal swiftcc void @"$s24generic_indirect_return2TA"(ptr noalias captures(none) sret({{.*}}) %0, ptr swiftself %1) // CHECK: call swiftcc void @generic_indirect_return2(ptr noalias sret({{.*}}) %0, // CHECK: ret void sil @partial_apply_generic_indirect_return2 : $@convention(thin) (Int) -> @callee_owned () -> @owned GenericEnum2 { diff --git a/test/IRGen/partial_apply_coro.sil b/test/IRGen/partial_apply_coro.sil index 26ed13a46b652..40e6f58c093ca 100644 --- a/test/IRGen/partial_apply_coro.sil +++ b/test/IRGen/partial_apply_coro.sil @@ -1012,7 +1012,7 @@ bb0(%x : $SwiftClass): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @indirect_guaranteed_captured_class_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %0, [[ARGTYPE:i32|i64]] %1, ptr noalias nocapture dereferenceable([[ARGPTR_SIZE:4|8]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %0, [[ARGTYPE:i32|i64]] %1, ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE:4|8]]) %2) sil public @indirect_guaranteed_captured_class_param : $@yield_once @convention(thin) (Int, @in_guaranteed SwiftClass) -> (@yields SwiftClass) { entry(%i : $Int, %c : $*SwiftClass): %0 = builtin "int_trap"() : $Never @@ -1020,7 +1020,7 @@ entry(%i : $Int, %c : $*SwiftClass): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @partial_apply_indirect_guaranteed_class_param -// CHECK-SAME: (ptr noalias nocapture dereferenceable([[ARGPTR_SIZE]]) %[[ARGPTR:.*]]) +// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE]]) %[[ARGPTR:.*]]) // CHECK: entry: // CHECK: %[[ARG:.*]] = load ptr, ptr %[[ARGPTR]] // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s40indirect_guaranteed_captured_class_paramTA{{.*}}", ptr undef }, ptr %[[ARG]], 1 @@ -1037,7 +1037,7 @@ entry(%i : $Int, %c : $*SwiftClass): // CHECK: store ptr %[[PA_CTX_BOX]], ptr %[[SELFPTR]] // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @indirect_guaranteed_captured_class_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable([[ARGPTR_SIZE]]) %[[SELFPTR]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @indirect_guaranteed_captured_class_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE]]) %[[SELFPTR]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s40indirect_guaranteed_captured_class_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -1079,7 +1079,7 @@ bb0(%x : $*SwiftClass): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @indirect_consumed_captured_class_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARGTYPE:(i32|i64)]] %1, ptr noalias nocapture dereferenceable([[ARGPTR_SIZE:(4|8)]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARGTYPE:(i32|i64)]] %1, ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE:(4|8)]]) %2) sil public @indirect_consumed_captured_class_param : $@yield_once @convention(thin) (Int, @in SwiftClass) -> (@yields SwiftClass) { entry(%i : $Int, %c : $*SwiftClass): %0 = builtin "int_trap"() : $Never @@ -1087,7 +1087,7 @@ entry(%i : $Int, %c : $*SwiftClass): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @partial_apply_indirect_consumed_class_param -// CHECK-SAME: (ptr noalias nocapture dereferenceable([[ARGPTR_SIZE]]) %[[ARGPTR:.*]]) +// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE]]) %[[ARGPTR:.*]]) // CHECK: entry: // CHECK: %[[ARG:.*]] = load ptr, ptr %[[ARGPTR]] // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s38indirect_consumed_captured_class_paramTA{{.*}}", ptr undef }, ptr %[[ARG]], 1 @@ -1105,7 +1105,7 @@ entry(%i : $Int, %c : $*SwiftClass): // CHECK: store ptr %[[PA_CTX_BOX]], ptr %[[SELFPTR]] // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @indirect_consumed_captured_class_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable([[ARGPTR_SIZE]]) %[[SELFPTR]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @indirect_consumed_captured_class_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE]]) %[[SELFPTR]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s38indirect_consumed_captured_class_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -1231,7 +1231,7 @@ bb0(%x : $SwiftClassPair): // CHECK-64-LABEL: define {{.*}} { ptr, i64 } @indirect_guaranteed_captured_class_pair_param // CHECK-32-LABEL: define {{.*}} { ptr, i32 } @indirect_guaranteed_captured_class_pair_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %1, ptr noalias nocapture dereferenceable([[PAIR_SIZE:(8|16)]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %1, ptr noalias captures(none) dereferenceable([[PAIR_SIZE:(8|16)]]) %2) sil public @indirect_guaranteed_captured_class_pair_param : $@yield_once @convention(thin) (Int, @in_guaranteed SwiftClassPair) -> (@yields Int) { entry(%i : $Int, %c : $*SwiftClassPair): %0 = builtin "int_trap"() : $Never @@ -1239,7 +1239,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @partial_apply_indirect_guaranteed_class_pair_param -// CHECK-SAME: (ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata.{{.*}} // CHECK: %[[BOXPTR:.*]] = getelementptr inbounds <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[BOX]], i32 0, i32 1 @@ -1258,7 +1258,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): // CHECK: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[SPILL1]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %1, ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[PA_CTX]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %1, ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[PA_CTX]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -1301,7 +1301,7 @@ bb0(%x : $*SwiftClassPair): // CHECK-32-LABEL: define {{.*}} { ptr, i32 } @indirect_consumed_captured_class_pair_param // CHECK-64-LABEL: define {{.*}} { ptr, i64 } @indirect_consumed_captured_class_pair_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %0, [[ARG_TYPE]] %1, ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %0, [[ARG_TYPE]] %1, ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %2) sil public @indirect_consumed_captured_class_pair_param : $@yield_once @convention(thin) (Int, @in SwiftClassPair) -> (@yields Int) { entry(%i : $Int, %c : $*SwiftClassPair): %0 = builtin "int_trap"() : $Never @@ -1309,7 +1309,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @partial_apply_indirect_consumed_class_pair_param -// CHECK-SAME: (ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata.{{.*}} // CHECK: %[[BOXPTR:.*]] = getelementptr inbounds <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[BOX]], i32 0, i32 1 @@ -1331,7 +1331,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): // CHECK: %{{.*}} = call ptr @"$s18partial_apply_coro14SwiftClassPairVWOc"(ptr %[[PA_CTX]], ptr %[[SPILL1]]) // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_consumed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %1, ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[SPILL1]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_consumed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %1, ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[SPILL1]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s43indirect_consumed_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 2 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -2059,7 +2059,7 @@ class A3 {} sil_vtable A3 {} // CHECK-LABEL: define {{.*}} { ptr, ptr, ptr } @amethod -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, ptr noalias nocapture swiftself dereferenceable([[SELF_SIZE:(4|8)]]) %1, ptr noalias nocapture swifterror dereferenceable([[ERROR_SIZE:(4|8)]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, ptr noalias captures(none) swiftself dereferenceable([[SELF_SIZE:(4|8)]]) %1, ptr noalias captures(none) swifterror dereferenceable([[ERROR_SIZE:(4|8)]]) %2) sil @amethod : $@yield_once @convention(method) (@in_guaranteed A2) -> (@yields A1, @error Error) { entry(%a : $*A2): %0 = builtin "int_trap"() : $Never @@ -2067,13 +2067,13 @@ entry(%a : $*A2): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @repo -// CHECK-SAME: (ptr noalias nocapture dereferenceable([[SELF_SIZE]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[SELF_SIZE]]) %[[ARG:.*]]) // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s7amethodTA{{.*}}", ptr undef }, ptr %{{.*}}, 1 // CHECK: ret { ptr, ptr } %[[RET]] // CHECK: } // // CHECK-LABEL: define {{.*}} { ptr, ptr, ptr } @"$s7amethodTA" -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX:.*]], ptr swiftself %[[SELF:.*]], ptr noalias nocapture swifterror dereferenceable([[ERROR_SIZE]]) %[[ERRORPTR:.*]]) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX:.*]], ptr swiftself %[[SELF:.*]], ptr noalias captures(none) swifterror dereferenceable([[ERROR_SIZE]]) %[[ERRORPTR:.*]]) // CHECK: entry: // CHECK: %[[SELFPTR:.*]] = alloca ptr // CHECK: %[[SPILL:.*]] = call ptr @malloc @@ -2083,7 +2083,7 @@ entry(%a : $*A2): // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) // CHECK: store ptr null, ptr %[[ERRORPTR]] -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr, ptr } @amethod(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], ptr noalias nocapture swiftself dereferenceable([[SELF_SIZE]]) %[[SELFPTR]], ptr noalias nocapture swifterror dereferenceable([[ERROR_SIZE]]) %[[ERRORPTR]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr, ptr } @amethod(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], ptr noalias captures(none) swiftself dereferenceable([[SELF_SIZE]]) %[[SELFPTR]], ptr noalias captures(none) swifterror dereferenceable([[ERROR_SIZE]]) %[[ERRORPTR]]) // CHECK: %[[ERRORVAL:.*]] = load ptr, ptr %[[ERRORPTR]] // CHECK: %[[RESUME0:.*]] = extractvalue { ptr, ptr, ptr } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s7amethodTA.Frame", ptr %[[SPILL]], i32 0, i32 1 @@ -2137,7 +2137,7 @@ bb0(%0 : $*A2): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @partial_apply_callee_guaranteed_indirect_guaranteed_class_pair_param -// CHECK-SAME: (ptr noalias nocapture dereferenceable([[ARG_SIZE:(8|16)]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[ARG_SIZE:(8|16)]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata // CHECK: %[[BOXPTR:.*]] = getelementptr inbounds <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[BOX]], i32 0, i32 1 @@ -2156,7 +2156,7 @@ bb0(%0 : $*A2): // CHECK: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: %[[PA_ARG:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[PA_ARG]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[PA_ARG]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable({{8|16}}) %[[PA_CTX]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[PA_ARG]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable({{8|16}}) %[[PA_CTX]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.{{[0-9]+}}.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]], @@ -2201,7 +2201,7 @@ bb0(%x : $*SwiftClassPair): sil public_external @use_closure2 : $@yield_once @convention(thin) (@noescape @yield_once @callee_guaranteed (Int) -> (@yields Int)) -> (@yields Int) // CHECK-LABEL: define {{.*}} @partial_apply_stack_callee_guaranteed_indirect_guaranteed_class_pair_param -// CHECK-SAME: (ptr noalias nocapture dereferenceable([[ARG_SIZE:(8|16)]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[ARG_SIZE:(8|16)]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8] // CHECK: %[[BOX:.*]] = alloca i8 @@ -2228,7 +2228,7 @@ sil public_external @use_closure2 : $@yield_once @convention(thin) (@noescape @y // CHECK: %[[PA_ARG:.*]] = load ptr, ptr %[[PA_CTX]] // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable({{8|16}}) %[[PA_ARG]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable({{8|16}}) %[[PA_ARG]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.{{[0-9]+}}.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -2276,7 +2276,7 @@ bb0(%x : $*SwiftClassPair): // CHECK-32-LABEL: define {{.*}} { ptr, i32 } @indirect_in_captured_class_pair_param // CHECK-64-LABEL: define {{.*}} { ptr, i64 } @indirect_in_captured_class_pair_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %{{.*}}, ptr noalias nocapture dereferenceable([[PAIR_SIZE:(8|16)]]) %{{.*}}) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %{{.*}}, ptr noalias captures(none) dereferenceable([[PAIR_SIZE:(8|16)]]) %{{.*}}) sil public @indirect_in_captured_class_pair_param : $@yield_once @convention(thin) (Int, @in_guaranteed SwiftClassPair) -> (@yields Int) { entry(%i : $Int, %p : $*SwiftClassPair): %0 = builtin "int_trap"() : $Never @@ -2284,7 +2284,7 @@ entry(%i : $Int, %p : $*SwiftClassPair): } // CHECK-LABEL: define {{.*}} void @partial_apply_stack_callee_guaranteed_indirect_in_class_pair_param -// CHECK-SAME: (ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8], // CHECK: %[[BOX:.*]] = alloca i8 @@ -2312,7 +2312,7 @@ entry(%i : $Int, %p : $*SwiftClassPair): // CHECK: %[[PA_ARG:.*]] = load ptr, ptr %[[PA_CTX]] // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_in_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[PA_ARG]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_in_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[PA_ARG]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s37indirect_in_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -2477,7 +2477,7 @@ entry: // CHECK-32: define {{.*}} { ptr, i32 } @indirect_in_constant_captured_class_pair_param // CHECK-64: define {{.*}} { ptr, i64 } @indirect_in_constant_captured_class_pair_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %1, ptr noalias nocapture dereferenceable([[PAIR_SIZE:(8|16)]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %1, ptr noalias captures(none) dereferenceable([[PAIR_SIZE:(8|16)]]) %2) sil public @indirect_in_constant_captured_class_pair_param : $@yield_once @convention(thin) (Int, @in_guaranteed SwiftClassPair) -> (@yields Int) { entry(%i : $Int, %ic : $*SwiftClassPair): %0 = builtin "int_trap"() : $Never @@ -2485,7 +2485,7 @@ entry(%i : $Int, %ic : $*SwiftClassPair): } // CHECK-LABEL: define {{.*}} void @partial_apply_stack_callee_guaranteed_indirect_in_constant_class_pair_param -// CHECK-SAME: (ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8] // CHECK: %[[BOX:.*]] = alloca i8 @@ -2513,7 +2513,7 @@ entry(%i : $Int, %ic : $*SwiftClassPair): // CHECK: %[[PA_ARG:.*]] = load ptr, ptr %[[PA_CTX]] // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_in_constant_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[PA_ARG]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_in_constant_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[PA_ARG]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s46indirect_in_constant_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -2579,7 +2579,7 @@ bb0(%thick : $@callee_guaranteed @yield_once @convention(thick) (Int64, Int32) - // CHECK: } // // CHECK-LABEL: define {{.*}} ptr @"$s16external_closureTA" -// CHECK-SAME: (ptr noalias {{.*}} %[[CTX:.*]], [[ARG_TYPE]] %[[ARG1:.*]], ptr swiftself %[[PA_CTX_BOX:.*]], ptr noalias nocapture swifterror {{.*}} %[[ERROR:.*]]) +// CHECK-SAME: (ptr noalias {{.*}} %[[CTX:.*]], [[ARG_TYPE]] %[[ARG1:.*]], ptr swiftself %[[PA_CTX_BOX:.*]], ptr noalias captures(none) swifterror {{.*}} %[[ERROR:.*]]) // CHECK: entry: // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] @@ -2590,7 +2590,7 @@ bb0(%thick : $@callee_guaranteed @yield_once @convention(thick) (Int64, Int32) - // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) // CHECK: store ptr null, ptr %[[ERROR]] -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc ptr @external_closure(ptr noalias {{.*}} %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG1]], [[ARG_TYPE]] %[[ARG2]], ptr swiftself undef, ptr noalias nocapture swifterror {{.*}} %[[ERROR]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc ptr @external_closure(ptr noalias {{.*}} %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG1]], [[ARG_TYPE]] %[[ARG2]], ptr swiftself undef, ptr noalias captures(none) swifterror {{.*}} %[[ERROR]]) // CHECK: %[[SPILL1:.*]] = getelementptr inbounds %"$s16external_closureTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[YIELD_PAIR]], ptr %[[SPILL1]] // CHECK: %[[ERRORVAL:.*]] = load ptr, ptr %[[ERROR]] diff --git a/test/IRGen/partial_apply_generic.swift b/test/IRGen/partial_apply_generic.swift index 20796c87214f0..d8a13172eb81d 100644 --- a/test/IRGen/partial_apply_generic.swift +++ b/test/IRGen/partial_apply_generic.swift @@ -37,7 +37,7 @@ var x = seq ~> split // Indirect return // -// CHECK-LABEL: define internal swiftcc { ptr, ptr } @"$s21partial_apply_generic5split{{[_0-9a-zA-Z]*}}FTA"(ptr noalias nocapture %0, ptr swiftself %1) +// CHECK-LABEL: define internal swiftcc { ptr, ptr } @"$s21partial_apply_generic5split{{[_0-9a-zA-Z]*}}FTA"(ptr noalias captures(none) %0, ptr swiftself %1) // CHECK: tail call swiftcc { ptr, ptr } @"$s21partial_apply_generic5split{{[_0-9a-zA-Z]*}}F"(ptr noalias %0, struct HugeStruct { var a, b, c, d: Int } diff --git a/test/IRGen/pre_specialize.swift b/test/IRGen/pre_specialize.swift index b959a4833cab3..d9901116c6e65 100644 --- a/test/IRGen/pre_specialize.swift +++ b/test/IRGen/pre_specialize.swift @@ -42,12 +42,12 @@ // specialized InternalThing.computedX.getter // CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc [[INT]] @"$s1A13InternalThingV9computedXxvgSi_Ts5"([[INT]]{{( returned)?}} %0) // specialized InternalThing.computedX.setter -// CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingV9computedXxvsSi_Ts5"([[INT]] %0, ptr nocapture swiftself {{(writeonly )?}}dereferenceable({{(4|8)}}) %1) +// CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingV9computedXxvsSi_Ts5"([[INT]] %0, ptr captures(none) swiftself {{(writeonly )?}}dereferenceable({{(4|8)}}) %1) // specialized InternalThing.subscript.getter // CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc [[INT]] @"$s1A13InternalThingVyxSicigSi_Ts5"([[INT]] %0, [[INT]]{{( returned)?}} %1) // specialized InternalThing.subscript.setter -// CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingVyxSicisSi_Ts5"([[INT]] %0, [[INT]] %1, ptr nocapture swiftself {{(writeonly )?}}dereferenceable({{(4|8)}}) %2) +// CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingVyxSicisSi_Ts5"([[INT]] %0, [[INT]] %1, ptr captures(none) swiftself {{(writeonly )?}}dereferenceable({{(4|8)}}) %2) // specialized InternalRef.compute() // CHECK-A-FRAG-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc [[INT:(i64|i32)]] @"$s1A11InternalRefC7computexyFAA09ResilientA10BoxedThingVySiG_Ts5" @@ -76,13 +76,13 @@ // CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @"$s1A13InternalThingV9computedXxvg1B07AnotherB0C_Ts5"(ptr{{( returned)?}} %0) // specialized InternalThing.computedX.setter -// CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingV9computedXxvs1B07AnotherB0C_Ts5"(ptr %0, ptr nocapture swiftself dereferenceable({{(4|8)}}) %1) +// CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingV9computedXxvs1B07AnotherB0C_Ts5"(ptr %0, ptr captures(none) swiftself dereferenceable({{(4|8)}}) %1) // specialized InternalThing.subscript.getter // CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @"$s1A13InternalThingVyxSicig1B07AnotherB0C_Ts5"([[INT:(i64|i32)]] %0, ptr{{( returned)?}} %1) // specialized InternalThing.subscript.setter -// CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingVyxSicis1B07AnotherB0C_Ts5"(ptr %0, [[INT]] %1, ptr nocapture swiftself dereferenceable({{(4|8)}}) %2) +// CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingVyxSicis1B07AnotherB0C_Ts5"(ptr %0, [[INT]] %1, ptr captures(none) swiftself dereferenceable({{(4|8)}}) %2) // specialized InternalRef.compute() // CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @"$s1A11InternalRefC7computexyF1B12AnotherThingC_Ts5 diff --git a/test/IRGen/protocol_accessor_multifile.swift b/test/IRGen/protocol_accessor_multifile.swift index ee4c41e3ecd32..65ccc1c7b0a48 100644 --- a/test/IRGen/protocol_accessor_multifile.swift +++ b/test/IRGen/protocol_accessor_multifile.swift @@ -8,7 +8,7 @@ // CHECK-LABEL: define{{.*}} void @"$s27protocol_accessor_multifile14useExistentialyyF"() func useExistential() { // CHECK: [[BOX:%.+]] = alloca %T27protocol_accessor_multifile5ProtoP, - // CHECK: call swiftcc void @"$s27protocol_accessor_multifile17globalExistentialAA5Proto_pvg"(ptr noalias nocapture sret({{.*}}) [[BOX]]) + // CHECK: call swiftcc void @"$s27protocol_accessor_multifile17globalExistentialAA5Proto_pvg"(ptr noalias captures(none) sret({{.*}}) [[BOX]]) // CHECK: call swiftcc void @"$s27protocol_accessor_multifile5ProtoPAAE6methodyyF" globalExistential.method() // CHECK: call void @__swift_destroy_boxed_opaque_existential_1(ptr [[BOX]]) diff --git a/test/IRGen/protocol_resilience.sil b/test/IRGen/protocol_resilience.sil index 7d2c1784e7401..be9a0af541bc0 100644 --- a/test/IRGen/protocol_resilience.sil +++ b/test/IRGen/protocol_resilience.sil @@ -262,7 +262,7 @@ struct ConformingStruct : ResilientProtocol { static func defaultF() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @noDefaultA(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @noDefaultA(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: sil @noDefaultA : $@convention(witness_method: ResilientProtocol) (@in_guaranteed ConformingStruct) -> () { @@ -281,7 +281,7 @@ bb0(%0 : $*ConformingStruct): } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @noDefaultB(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @noDefaultB(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: sil @noDefaultB : $@convention(witness_method: ResilientProtocol) (@in_guaranteed ConformingStruct) -> () { @@ -324,7 +324,7 @@ bb0(%0 : $*T): return %result : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingType(ptr noalias nocapture %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingType(ptr noalias captures(none) %0) sil @passConformingType : $@convention(thin) (@in ResilientConformingType) -> () { bb0(%0 : $*ResilientConformingType): @@ -381,7 +381,7 @@ bb0(%0 : $*T): return %result : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingTypeRefined(ptr noalias nocapture %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingTypeRefined(ptr noalias captures(none) %0) sil @passConformingTypeRefined : $@convention(thin) (@in AnotherConformingStruct) -> () { bb0(%0 : $*AnotherConformingStruct): @@ -424,7 +424,7 @@ bb0(%0 : $*T): return %result : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingTypeAssoc(ptr noalias nocapture %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingTypeAssoc(ptr noalias captures(none) %0) sil @passConformingTypeAssoc : $@convention(thin) (@in ConformsWithResilientAssoc) -> () { bb0(%0 : $*ConformsWithResilientAssoc): diff --git a/test/IRGen/protocol_resilience_thunks.swift b/test/IRGen/protocol_resilience_thunks.swift index 7317d671b3690..491fec9c2dffe 100644 --- a/test/IRGen/protocol_resilience_thunks.swift +++ b/test/IRGen/protocol_resilience_thunks.swift @@ -52,12 +52,12 @@ public protocol MyResilientProtocol { // CHECK-NEXT: [[RESULT:%.*]] = call swiftcc i1 [[WITNESS]](ptr noalias swiftself %0, ptr %1, ptr %2) // CHECK-NEXT: ret i1 [[RESULT]] -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP10returnsAnyypyFTj"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias swiftself %1, ptr %2, ptr %3) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP10returnsAnyypyFTj"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias swiftself %1, ptr %2, ptr %3) // CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds ptr, ptr %3, i32 3 // CHECK-NEXT: [[WITNESS:%.*]] = load ptr, ptr [[WITNESS_ADDR]] // CHECK-arm64e-NEXT: ptrtoint ptr [[WITNESS_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend -// CHECK-NEXT: call swiftcc void [[WITNESS]](ptr noalias nocapture sret({{.*}}) %0, ptr noalias swiftself %1, ptr %2, ptr %3) +// CHECK-NEXT: call swiftcc void [[WITNESS]](ptr noalias captures(none) sret({{.*}}) %0, ptr noalias swiftself %1, ptr %2, ptr %3) // CHECK-NEXT: ret void // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP12throwingFuncyyKFTj"(ptr noalias swiftself %0, ptr{{( noalias nocapture( swifterror)? dereferenceable\(.\))?}} %1, ptr %2, ptr %3) diff --git a/test/IRGen/same_type_constraints.swift b/test/IRGen/same_type_constraints.swift index 4287f34a4c96f..0adae5e99a89d 100644 --- a/test/IRGen/same_type_constraints.swift +++ b/test/IRGen/same_type_constraints.swift @@ -67,7 +67,7 @@ where Self : CodingType, print(Self.ValueType.self) } -// OSIZE: define internal swiftcc ptr @"$s21same_type_constraints12GenericKlazzCyxq_GAA1EAA4DataAaEP_AA0F4TypePWT"(ptr readnone %"GenericKlazz.Data", ptr nocapture readonly %"GenericKlazz", ptr nocapture readnone %"GenericKlazz.E") [[ATTRS:#[0-9]+]] { +// OSIZE: define internal swiftcc ptr @"$s21same_type_constraints12GenericKlazzCyxq_GAA1EAA4DataAaEP_AA0F4TypePWT"(ptr readnone %"GenericKlazz.Data", ptr captures(none) readonly %"GenericKlazz", ptr captures(none) readnone %"GenericKlazz.E") [[ATTRS:#[0-9]+]] { // OSIZE: [[ATTRS]] = {{{.*}}noinline // Check that same-typing two generic parameters together lowers correctly. diff --git a/test/IRGen/select_enum.sil b/test/IRGen/select_enum.sil index 24f8439eb8ff4..c0b7e8e7a1c91 100644 --- a/test/IRGen/select_enum.sil +++ b/test/IRGen/select_enum.sil @@ -7,7 +7,7 @@ enum SinglePayloadSingleEmpty { case DataCase(Builtin.Word) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @select_enum_SinglePayloadSingleEmpty(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @select_enum_SinglePayloadSingleEmpty(ptr noalias captures(none) dereferenceable({{.*}}) %0) sil @select_enum_SinglePayloadSingleEmpty : $@convention(thin) (@in SinglePayloadSingleEmpty) -> () { bb0(%0 : $*SinglePayloadSingleEmpty): %1 = load %0 : $*SinglePayloadSingleEmpty diff --git a/test/IRGen/sil_generic_witness_methods.swift b/test/IRGen/sil_generic_witness_methods.swift index a9c80505798c9..a6a4492708080 100644 --- a/test/IRGen/sil_generic_witness_methods.swift +++ b/test/IRGen/sil_generic_witness_methods.swift @@ -34,7 +34,7 @@ func call_methods(_ x: T, y: S, z: U) { x.generic_method(z) } -// CHECK-LABEL: define hidden swiftcc void @"$s27sil_generic_witness_methods017call_existential_D0{{[_0-9a-zA-Z]*}}F"(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define hidden swiftcc void @"$s27sil_generic_witness_methods017call_existential_D0{{[_0-9a-zA-Z]*}}F"(ptr noalias captures(none) dereferenceable({{.*}}) %0) func call_existential_methods(_ x: P, y: S) { // CHECK: [[METADATA_ADDR:%.*]] = getelementptr inbounds %T27sil_generic_witness_methods1PP, ptr [[X:%0]], i32 0, i32 1 // CHECK: [[METADATA:%.*]] = load ptr, ptr [[METADATA_ADDR]], align 8 diff --git a/test/IRGen/sil_witness_methods.sil b/test/IRGen/sil_witness_methods.sil index 2c2594a76940b..037bf031fdfef 100644 --- a/test/IRGen/sil_witness_methods.sil +++ b/test/IRGen/sil_witness_methods.sil @@ -28,14 +28,14 @@ struct X {} struct Y {} struct Z {} -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @concrete_type_concrete_method_witness(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @concrete_type_concrete_method_witness(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) sil @concrete_type_concrete_method_witness : $@convention(witness_method: P) (@in Foo) -> @thick Foo.Type { entry(%x : $*Foo): %m = metatype $@thick Foo.Type return %m : $@thick Foo.Type } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @generic_type_concrete_method_witness(ptr noalias nocapture swiftself dereferenceable({{.*}}) %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @generic_type_concrete_method_witness(ptr noalias captures(none) swiftself dereferenceable({{.*}}) %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-objc: [[T1:%.*]] = getelementptr inbounds ptr, ptr %Self, i64 10 // CHECK-native: [[T1:%.*]] = getelementptr inbounds ptr, ptr %Self, i64 7 // CHECK: %T = load ptr, ptr [[T1]], align 8 @@ -87,14 +87,14 @@ entry(%x : $@thick Bar.Type): // TODO: %Self Type arg is redundant for class method witness -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @concrete_type_generic_method_witness(ptr noalias %0, ptr %Z, ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @concrete_type_generic_method_witness(ptr noalias %0, ptr %Z, ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) sil @concrete_type_generic_method_witness : $@convention(witness_method: P) (@in Z, @in Foo) -> @thick Foo.Type { entry(%z : $*Z, %x : $*Foo): %m = metatype $@thick Foo.Type return %m : $@thick Foo.Type } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @generic_type_generic_method_witness(ptr noalias %0, ptr %Z, ptr noalias nocapture swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @generic_type_generic_method_witness(ptr noalias %0, ptr %Z, ptr noalias captures(none) swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) sil @generic_type_generic_method_witness : $@convention(witness_method: P) (@in Z, @in Bar) -> @thick Bar.Type { entry(%z : $*Z, %x : $*Bar): %t = metatype $@thick T.Type diff --git a/test/IRGen/sil_witness_tables.swift b/test/IRGen/sil_witness_tables.swift index 0318819450467..ab09f3938bc77 100644 --- a/test/IRGen/sil_witness_tables.swift +++ b/test/IRGen/sil_witness_tables.swift @@ -57,14 +57,14 @@ struct Conformer2: Q { func qMethod() {} } -// CHECK-LABEL: define hidden swiftcc void @"$s18sil_witness_tables7erasure1cAA2QQ_pAA9ConformerV_tF"(ptr noalias nocapture sret({{.*}}) %0) +// CHECK-LABEL: define hidden swiftcc void @"$s18sil_witness_tables7erasure1cAA2QQ_pAA9ConformerV_tF"(ptr noalias captures(none) sret({{.*}}) %0) // CHECK: [[WITNESS_TABLE_ADDR:%.*]] = getelementptr inbounds %T18sil_witness_tables2QQP, ptr %0, i32 0, i32 2 // CHECK-NEXT: store ptr [[CONFORMER_QQ_WITNESS_TABLE:@"\$s.*WP"]], ptr [[WITNESS_TABLE_ADDR]], align 8 func erasure(c: Conformer) -> QQ { return c } -// CHECK-LABEL: define hidden swiftcc void @"$s18sil_witness_tables15externalErasure1c0a1_b1_c1_D12_conformance9ExternalP_pAD0G9ConformerV_tF"(ptr noalias nocapture sret({{.*}}) %0) +// CHECK-LABEL: define hidden swiftcc void @"$s18sil_witness_tables15externalErasure1c0a1_b1_c1_D12_conformance9ExternalP_pAD0G9ConformerV_tF"(ptr noalias captures(none) sret({{.*}}) %0) // CHECK: [[WITNESS_TABLE_ADDR:%.*]] = getelementptr inbounds %T39sil_witness_tables_external_conformance9ExternalPP, ptr %0, i32 0, i32 2 // CHECK-NEXT: store ptr [[EXTERNAL_CONFORMER_EXTERNAL_P_WITNESS_TABLE]], ptr %2, align 8 func externalErasure(c: ExternalConformer) -> ExternalP { diff --git a/test/IRGen/struct_resilience.swift b/test/IRGen/struct_resilience.swift index 73960b0340bae..3917e51c06bdc 100644 --- a/test/IRGen/struct_resilience.swift +++ b/test/IRGen/struct_resilience.swift @@ -80,7 +80,7 @@ public struct MySize { public let h: Int } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience32functionWithMyResilientTypesSize_1fAA0eH0VAEn_A2EnXEtF"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{8|(16)}}) %1, ptr %2, ptr %3) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience32functionWithMyResilientTypesSize_1fAA0eH0VAEn_A2EnXEtF"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{8|(16)}}) %1, ptr %2, ptr %3) public func functionWithMyResilientTypesSize(_ s: __owned MySize, f: (__owned MySize) -> MySize) -> MySize { // There's an alloca for debug info? @@ -108,7 +108,7 @@ public func functionWithMyResilientTypesSize(_ s: __owned MySize, f: (__owned My // CHECK: store [[INT]] [[H]], ptr [[H_PTR]] -// CHECK: call swiftcc void %2(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{8|16}}) [[DST]], ptr swiftself %3) +// CHECK: call swiftcc void %2(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{8|16}}) [[DST]], ptr swiftself %3) // CHECK: call void @llvm.lifetime.end.p0({{i32|i64}} {{8|16}}, ptr [[DST]]) // CHECK: ret void @@ -164,7 +164,7 @@ public struct ResilientStructWithMethod { // Corner case -- type is address-only in SIL, but empty in IRGen -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience29partialApplyOfResilientMethod1ryAA0f10StructWithG0V_tF"(ptr noalias nocapture %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience29partialApplyOfResilientMethod1ryAA0f10StructWithG0V_tF"(ptr noalias captures(none) %0) public func partialApplyOfResilientMethod(r: ResilientStructWithMethod) { _ = r.method } @@ -190,7 +190,7 @@ public func resilientAny(s : ResilientWeakRef) { // CHECK: [[TYADDR:%.*]] = getelementptr inbounds %Any, ptr [[ANY]], i32 0, i32 1 // CHECK: store ptr [[META2]], ptr [[TYADDR]] // CHECK: call ptr @__swift_allocate_boxed_opaque_existential_0(ptr [[ANY]]) -// CHECK: call swiftcc void @"$s17struct_resilience8wantsAnyyyypF"(ptr noalias nocapture dereferenceable({{(32|16)}}) [[ANY]]) +// CHECK: call swiftcc void @"$s17struct_resilience8wantsAnyyyypF"(ptr noalias captures(none) dereferenceable({{(32|16)}}) [[ANY]]) // CHECK: call void @__swift_destroy_boxed_opaque_existential_0(ptr [[ANY]]) // CHECK: ret void diff --git a/test/IRGen/struct_with_resilient_type.swift b/test/IRGen/struct_with_resilient_type.swift index 20bc54a4cfa0b..ab9b90f609cb6 100644 --- a/test/IRGen/struct_with_resilient_type.swift +++ b/test/IRGen/struct_with_resilient_type.swift @@ -44,7 +44,7 @@ crashCaller() // Don't use the type layout based value witness based generation (i.e we load field offsets below). -// VWT-macosx: define {{.*}} ptr @"$s26struct_with_resilient_type9SomeValueVwta"(ptr noalias returned {{.*}}, ptr noalias {{.*}}, ptr nocapture readonly [[MT:%.*]]) +// VWT-macosx: define {{.*}} ptr @"$s26struct_with_resilient_type9SomeValueVwta"(ptr noalias returned {{.*}}, ptr noalias {{.*}}, ptr captures(none) readonly [[MT:%.*]]) // VWT-macosx: [[VAL1:%.*]] = load i64 // VWT-macosx: store i64 [[VAL1]] // VWT-macosx: [[T1:%.*]] = tail call swiftcc %swift.metadata_response @"$s16resilient_struct13ResilientBoolVMa"(i64 0) diff --git a/test/IRGen/typed_throws.sil b/test/IRGen/typed_throws.sil index 8d5caa462ee53..77845664dcbc6 100644 --- a/test/IRGen/typed_throws.sil +++ b/test/IRGen/typed_throws.sil @@ -18,7 +18,7 @@ sil_vtable A {} sil @create_error : $@convention(thin) () -> @owned A -// CHECK: define{{.*}} swiftcc { ptr, ptr } @throw_error(ptr swiftself %0, ptr noalias nocapture swifterror dereferenceable({{.*}}) %1) +// CHECK: define{{.*}} swiftcc { ptr, ptr } @throw_error(ptr swiftself %0, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %1) // CHECK: [[ERR:%.*]] = call swiftcc ptr @create_error() // CHECK: call ptr @swift_retain(ptr returned [[ERR]]) // CHECK: store ptr inttoptr (i64 1 to ptr), ptr %1 @@ -47,7 +47,7 @@ sil @try_apply_helper : $@convention(thin) (@owned AnyObject) -> (@owned AnyObje // CHECK: entry: // CHECK: %swifterror = alloca swifterror ptr // CHECK: store ptr null, ptr %swifterror -// CHECK: [[RES:%.*]] = call swiftcc { ptr, ptr } @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable({{.*}}) %swifterror) +// CHECK: [[RES:%.*]] = call swiftcc { ptr, ptr } @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %swifterror) // CHECK: [[RES_0:%.*]] = extractvalue { ptr, ptr } [[RES]], 0 // CHECK: [[RES_1:%.*]] = extractvalue { ptr, ptr } [[RES]], 1 // CHECK: [[ERRFLAG:%.*]] = load ptr, ptr %swifterror @@ -209,8 +209,8 @@ bb6: return %7 : $() } -// CHECK: define{{.*}} internal swiftcc { ptr, ptr } @"$s16try_apply_helperTA"(ptr swiftself %0, ptr noalias nocapture swifterror dereferenceable({{.*}}) %1) -// CHECK: tail call swiftcc { ptr, ptr } @try_apply_helper(ptr {{.*}}, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable({{.*}}) %1) +// CHECK: define{{.*}} internal swiftcc { ptr, ptr } @"$s16try_apply_helperTA"(ptr swiftself %0, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %1) +// CHECK: tail call swiftcc { ptr, ptr } @try_apply_helper(ptr {{.*}}, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %1) // CHECK: ret { ptr, ptr } sil @partial_apply_test : $@convention(thin) (@owned AnyObject) -> @owned @callee_guaranteed () ->(@owned AnyObject, @error S) { @@ -234,7 +234,7 @@ entry(%0: $AnyObject): // CHECK:entry: // CHECK: %swifterror = alloca swifterror ptr // CHECK: store ptr null, ptr %swifterror -// CHECK: call swiftcc { ptr, ptr } %0(ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable({{[0-9]+}}) %swifterror) +// CHECK: call swiftcc { ptr, ptr } %0(ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable({{[0-9]+}}) %swifterror) sil @apply_closure : $@convention(thin) (@guaranteed @callee_guaranteed () -> (@owned AnyObject, @error S)) -> () { entry(%0 : $@callee_guaranteed () ->(@owned AnyObject, @error S)): @@ -272,7 +272,7 @@ bb6: return %t : $() } -// CHECK: define{{.*}} swiftcc void @throwNoError(i64 %0, ptr noalias %1, ptr %"\CF\84_0_0", ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable({{.*}}) %3, ptr %4) +// CHECK: define{{.*}} swiftcc void @throwNoError(i64 %0, ptr noalias %1, ptr %"\CF\84_0_0", ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %3, ptr %4) // CHECK: ret void sil @throwNoError : $@convention(thin) <τ_0_0> (Builtin.Int64, @in τ_0_0) -> @error_indirect τ_0_0 { @@ -281,14 +281,14 @@ bb0(%0: $*τ_0_0, %1 : $Builtin.Int64, %2 : $*τ_0_0): return %5 : $() } -// CHECK: define{{.*}} swiftcc void @throwNoErrorGenericOut(ptr noalias sret(%swift.opaque) %0, i64 %1, ptr noalias %2, ptr %"\CF\84_0_0", ptr %"\CF\84_0_1", ptr swiftself %3, ptr noalias nocapture swifterror dereferenceable({{.*}}) %4, ptr %5) +// CHECK: define{{.*}} swiftcc void @throwNoErrorGenericOut(ptr noalias sret(%swift.opaque) %0, i64 %1, ptr noalias %2, ptr %"\CF\84_0_0", ptr %"\CF\84_0_1", ptr swiftself %3, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %4, ptr %5) sil @throwNoErrorGenericOut : $@convention(thin) <τ_0_0, τ_0_1> (Builtin.Int64, @in τ_0_0) -> (@error_indirect τ_0_0, @out τ_0_1) { bb0(%0: $*τ_0_1, %1: $*τ_0_0, %2 : $Builtin.Int64, %3 : $*τ_0_0): %5 = tuple () return %5 : $() } -// CHECK: define{{.*}} swiftcc void @throwError(i64 %0, ptr noalias %1, ptr %"\CF\84_0_0", ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable({{.*}}) %3, ptr %4) +// CHECK: define{{.*}} swiftcc void @throwError(i64 %0, ptr noalias %1, ptr %"\CF\84_0_0", ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %3, ptr %4) // CHECK: entry: // CHECK: load ptr, ptr // CHECK: [[VW:%.*]] = load ptr, ptr @@ -309,7 +309,7 @@ sil @throwError2 : $@convention(thin) (Builtin.Int64, @in T) -> (@error_i // CHECK: store ptr null, ptr %swifterror // CHECK: [[SIZE:%.*]] = load i64 // CHECK: [[TYPEDERR:%.*]] = alloca i8, i64 [[SIZE]] -// CHECK: call swiftcc void @throwError2(ptr noalias sret(%swift.opaque) %0, i64 0, ptr noalias %1, ptr %T, ptr %V, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr [[TYPEDERR]]) +// CHECK: call swiftcc void @throwError2(ptr noalias sret(%swift.opaque) %0, i64 0, ptr noalias %1, ptr %T, ptr %V, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr [[TYPEDERR]]) // CHECK: [[ERR_FLAG:%.*]] = load ptr, ptr %swifterror // CHECK: [[ISERR:%.*]] = icmp ne ptr [[ERR_FLAG]], null // CHECK: br i1 [[ISERR]] @@ -379,8 +379,8 @@ bb3: sil @try_apply_helper_generic : $@convention(thin) (@in T) -> (@out T, @error_indirect T) -// CHECK: define{{.*}} internal swiftcc void @"$s24try_apply_helper_genericTA"(ptr noalias sret(%swift.opaque) %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3) -// CHECK: call swiftcc void @try_apply_helper_generic(ptr noalias sret(%swift.opaque) %0, ptr noalias {{%.*}}, ptr %T, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3) +// CHECK: define{{.*}} internal swiftcc void @"$s24try_apply_helper_genericTA"(ptr noalias sret(%swift.opaque) %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3) +// CHECK: call swiftcc void @try_apply_helper_generic(ptr noalias sret(%swift.opaque) %0, ptr noalias {{%.*}}, ptr %T, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3) sil @partial_apply_test_generic : $@convention(thin) (@in T) -> @owned @callee_guaranteed () ->(@out T, @error_indirect T) { entry(%0: $*T): @@ -411,7 +411,7 @@ entry(%0: $*T): // CHECK: [[V2:%.*]] = getelementptr inbounds %swift.vwtable{{.*}} // CHECK: [[V3:%.*]] = load i64, ptr [[V2]] // CHECK: [[V4:%.*]] = alloca i8, i64 [[V3]] -// CHECK: call swiftcc void %0(ptr noalias sret(%swift.opaque) [[T4]], ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr [[V4]]) +// CHECK: call swiftcc void %0(ptr noalias sret(%swift.opaque) [[T4]], ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr [[V4]]) sil @apply_closure_generic : $@convention(thin) (@guaranteed @callee_guaranteed () ->(@out T, @error_indirect V)) -> () { entry(%0 : $@callee_guaranteed () ->(@out T, @error_indirect V)): %err = alloc_stack $V diff --git a/test/IRGen/typed_throws.swift b/test/IRGen/typed_throws.swift index f4581f0d039e1..897c1754dab4d 100644 --- a/test/IRGen/typed_throws.swift +++ b/test/IRGen/typed_throws.swift @@ -75,7 +75,7 @@ func reabstractAsConcreteThrowing() throws -> Int { try passthroughCall(fiveOrTypedBust) } -// CHECK-LABEL: define {{.*}} swiftcc void @"$sSi12typed_throws10MyBigErrorOIgdzo_SiACIegrzr_TR"(ptr noalias nocapture sret(%TSi) %0, ptr %1, ptr %2, ptr swiftself %3, ptr noalias nocapture swifterror dereferenceable(8) %4, ptr %5) +// CHECK-LABEL: define {{.*}} swiftcc void @"$sSi12typed_throws10MyBigErrorOIgdzo_SiACIegrzr_TR"(ptr noalias captures(none) sret(%TSi) %0, ptr %1, ptr %2, ptr swiftself %3, ptr noalias captures(none) swifterror dereferenceable(8) %4, ptr %5) // CHECK: call swiftcc {{i32|i64}} %1 // CHECK: [[CMP:%.*]] = icmp ne ptr {{%.*}}, null // CHECK: br i1 [[CMP]], label %typed.error.load @@ -107,7 +107,7 @@ func throwsSmallError() throws(SmallError) -> (Float, Int) { } // CHECK: define hidden swiftcc i64 @"$s12typed_throws17catchesSmallErrorSiyF"() -// CHECK: [[RES:%.*]] = call swiftcc { float, i64 } @"$s12typed_throws0B10SmallErrorSf_SityAA0cD0VYKF"(ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[RES:%.*]] = call swiftcc { float, i64 } @"$s12typed_throws0B10SmallErrorSf_SityAA0cD0VYKF"(ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[R0:%.*]] = extractvalue { float, i64 } [[RES]], 0 // CHECK: [[R1:%.*]] = extractvalue { float, i64 } [[RES]], 1 // CHECK: phi i64 [ [[R1]], %typed.error.load ] @@ -316,7 +316,7 @@ func smallResultLargerError() throws(SmallError) -> Int8? { } // CHECK: [[COERCED:%.*]] = alloca { i16 }, align 2 -// CHECK: [[RES:%.*]] = call swiftcc i64 @"$s12typed_throws22smallResultLargerErrors4Int8VSgyAA05SmallF0VYKF"(ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[RES:%.*]] = call swiftcc i64 @"$s12typed_throws22smallResultLargerErrors4Int8VSgyAA05SmallF0VYKF"(ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[TRUNC:%.*]] = trunc i64 [[RES]] to i16 // CHECK: [[COERCED_PTR:%.*]] = getelementptr inbounds { i16 }, ptr [[COERCED]], i32 0, i32 0 // CHECK: store i16 [[TRUNC]], ptr [[COERCED_PTR]], align 2 @@ -335,7 +335,7 @@ func smallErrorLargerResult() throws(UInt8OptSingletonError) -> Int { } // CHECK: [[COERCED:%.*]] = alloca { i16 }, align 2 -// CHECK: [[RES:%.*]] = call swiftcc i64 @"$s12typed_throws22smallErrorLargerResultSiyAA017UInt8OptSingletonD0OYKF"(ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[RES:%.*]] = call swiftcc i64 @"$s12typed_throws22smallErrorLargerResultSiyAA017UInt8OptSingletonD0OYKF"(ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[TRUNC:%.*]] = trunc i64 [[RES]] to i16 // CHECK: [[COERCED_PTR:%.*]] = getelementptr inbounds { i16 }, ptr [[COERCED]], i32 0, i32 0 // CHECK: store i16 [[TRUNC]], ptr [[COERCED_PTR]], align 2 diff --git a/test/IRGen/typed_throws_abi.swift b/test/IRGen/typed_throws_abi.swift index 6f2479d39c44e..d1c73656aa400 100644 --- a/test/IRGen/typed_throws_abi.swift +++ b/test/IRGen/typed_throws_abi.swift @@ -21,7 +21,7 @@ struct ThreeWords: Error { } struct Impl: P { - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2f0yySbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2f0yySbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret void @@ -38,7 +38,7 @@ struct Impl: P { } } - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2f1ySiSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2f1ySiSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret i64 1 @@ -56,7 +56,7 @@ struct Impl: P { return 1 } - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2f2ySi_SitSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2f2ySi_SitSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret { i64, i64 } { i64 1, i64 2 } @@ -74,7 +74,7 @@ struct Impl: P { return (1, 2) } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f3ySi_S2itSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f3ySi_S2itSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret { i64, i64, i64 } { i64 1, i64 2, i64 3 } @@ -92,7 +92,7 @@ struct Impl: P { return (1, 2, 3) } - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f4ySi_S3itSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f4ySi_S3itSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret { i64, i64, i64, i64 } { i64 1, i64 2, i64 3, i64 4 } @@ -110,7 +110,7 @@ struct Impl: P { return (1, 2, 3, 4) } - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2f5ySi_S4itSbAA5EmptyVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2f5ySi_S4itSbAA5EmptyVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4) // CHECK: br i1 %1, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: store i64 1, ptr %.elt._value, align 8 @@ -133,7 +133,7 @@ struct Impl: P { return (1, 2, 3, 4, 5) } - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2g0yySbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2g0yySbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -151,7 +151,7 @@ struct Impl: P { } } - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2g1ySiSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2g1ySiSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -170,7 +170,7 @@ struct Impl: P { return 1 } - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2g2ySi_SitSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2g2ySi_SitSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -189,7 +189,7 @@ struct Impl: P { return (1, 2) } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g3ySi_S2itSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g3ySi_S2itSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -208,7 +208,7 @@ struct Impl: P { return (1, 2, 3) } - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g4ySi_S3itSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g4ySi_S3itSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -227,7 +227,7 @@ struct Impl: P { return (1, 2, 3, 4) } - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2g5ySi_S4itSbAA7OneWordVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2g5ySi_S4itSbAA7OneWordVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4) // CHECK: entry: // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV, align 8 // CHECK: br i1 %1, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -252,7 +252,7 @@ struct Impl: P { return (1, 2, 3, 4, 5) } - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h0yySbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h0yySbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -270,7 +270,7 @@ struct Impl: P { } } - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h1ySiSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h1ySiSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -289,7 +289,7 @@ struct Impl: P { return 1 } - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h2ySi_SitSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h2ySi_SitSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -308,7 +308,7 @@ struct Impl: P { return (1, 2) } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h3ySi_S2itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h3ySi_S2itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -327,7 +327,7 @@ struct Impl: P { return (1, 2, 3) } - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h4ySi_S3itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h4ySi_S3itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -346,7 +346,7 @@ struct Impl: P { return (1, 2, 3, 4) } - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2h5ySi_S4itSbAA8TwoWordsVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2h5ySi_S4itSbAA8TwoWordsVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4) // CHECK: entry: // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV, align 8 // CHECK: br i1 %1, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -371,7 +371,7 @@ struct Impl: P { return (1, 2, 3, 4, 5) } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i0yySbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i0yySbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -389,7 +389,7 @@ struct Impl: P { } } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i1ySiSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i1ySiSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -408,7 +408,7 @@ struct Impl: P { return 1 } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i2ySi_SitSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i2ySi_SitSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -427,7 +427,7 @@ struct Impl: P { return (1, 2) } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i3ySi_S2itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i3ySi_S2itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -446,7 +446,7 @@ struct Impl: P { return (1, 2, 3) } - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i4ySi_S3itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i4ySi_S3itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -465,7 +465,7 @@ struct Impl: P { return (1, 2, 3, 4) } - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2i5ySi_S4itSbAA10ThreeWordsVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2i5ySi_S4itSbAA10ThreeWordsVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4) // CHECK: entry: // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV, align 8 // CHECK: br i1 %1, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -494,7 +494,7 @@ struct Impl: P { // CHECK: define hidden swiftcc i1 @"$s16typed_throws_abi11callImpl_f0ySbAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2f0yySbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2f0yySbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] @@ -521,7 +521,7 @@ func callImpl_f0(_ impl: Impl, _ b: Bool) -> Bool { // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi11callImpl_f1ySiAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2f1ySiSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2f1ySiSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] @@ -548,7 +548,7 @@ func callImpl_f1(_ impl: Impl, _ b: Bool) -> Int { // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi11callImpl_f2ySi_SitAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2f2ySi_SitSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2f2ySi_SitSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 1 // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 @@ -581,7 +581,7 @@ func callImpl_f2(_ impl: Impl, _ b: Bool) -> (Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_f3ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f3ySi_S2itSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f3ySi_S2itSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -618,7 +618,7 @@ func callImpl_f3(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi11callImpl_f4ySi_S3itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f4ySi_S3itSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f4ySi_S3itSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 2 @@ -656,12 +656,12 @@ func callImpl_f4(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int) { } } -// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_f5ySi_S4itAA0E0V_SbtF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) +// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_f5ySi_S4itAA0E0V_SbtF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 // CHECK: %swifterror1 = alloca ptr, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 -// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2f5ySi_S4itSbAA5EmptyVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr %swifterror1) +// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2f5ySi_S4itSbAA5EmptyVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr %swifterror1) // CHECK: [[CALL_RES0:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES1:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES2:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 @@ -706,7 +706,7 @@ func callImpl_f5(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int, Int) { // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi11callImpl_g0ySiAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2g0yySbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2g0yySbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] @@ -734,7 +734,7 @@ func callImpl_g0(_ impl: Impl, _ b: Bool) -> Int { // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi11callImpl_g1ySiAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2g1ySiSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2g1ySiSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] @@ -762,7 +762,7 @@ func callImpl_g1(_ impl: Impl, _ b: Bool) -> Int { // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi11callImpl_g2ySi_SitAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2g2ySi_SitSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2g2ySi_SitSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 1 // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 @@ -796,7 +796,7 @@ func callImpl_g2(_ impl: Impl, _ b: Bool) -> (Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_g3ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g3ySi_S2itSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g3ySi_S2itSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -834,7 +834,7 @@ func callImpl_g3(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi11callImpl_g4ySi_S3itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g4ySi_S3itSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g4ySi_S3itSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 2 @@ -873,12 +873,12 @@ func callImpl_g4(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int) { } } -// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_g5ySi_S4itAA0E0V_SbtF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) +// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_g5ySi_S4itAA0E0V_SbtF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 // CHECK: %swifterror1 = alloca %T16typed_throws_abi7OneWordV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 -// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2g5ySi_S4itSbAA7OneWordVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr %swifterror1) +// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2g5ySi_S4itSbAA7OneWordVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr %swifterror1) // CHECK: [[CALL_RES0:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES1:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES2:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 @@ -927,7 +927,7 @@ func callImpl_g5(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi11callImpl_h0ySi_SitAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h0yySbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h0yySbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 1 // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 @@ -961,7 +961,7 @@ func callImpl_h0(_ impl: Impl, _ b: Bool) -> (Int, Int) { // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi11callImpl_h1ySi_SitAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h1ySiSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h1ySiSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 1 // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 @@ -995,7 +995,7 @@ func callImpl_h1(_ impl: Impl, _ b: Bool) -> (Int, Int) { // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi11callImpl_h2ySi_SitAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h2ySi_SitSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h2ySi_SitSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 1 // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 @@ -1030,7 +1030,7 @@ func callImpl_h2(_ impl: Impl, _ b: Bool) -> (Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_h3ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h3ySi_S2itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h3ySi_S2itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -1069,7 +1069,7 @@ func callImpl_h3(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi11callImpl_h4ySi_S3itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h4ySi_S3itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h4ySi_S3itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 2 @@ -1109,12 +1109,12 @@ func callImpl_h4(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int) { } } -// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_h5ySi_S4itAA0E0V_SbtF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) +// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_h5ySi_S4itAA0E0V_SbtF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 // CHECK: %swifterror1 = alloca %T16typed_throws_abi8TwoWordsV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 -// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2h5ySi_S4itSbAA8TwoWordsVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr %swifterror1) +// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2h5ySi_S4itSbAA8TwoWordsVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr %swifterror1) // CHECK: [[CALL_RES0:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES1:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES2:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 @@ -1165,7 +1165,7 @@ func callImpl_h5(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_i0ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i0yySbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i0yySbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -1203,7 +1203,7 @@ func callImpl_i0(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_i1ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i1ySiSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i1ySiSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -1241,7 +1241,7 @@ func callImpl_i1(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_i2ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i2ySi_SitSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i2ySi_SitSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -1281,7 +1281,7 @@ func callImpl_i2(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_i3ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i3ySi_S2itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i3ySi_S2itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -1321,7 +1321,7 @@ func callImpl_i3(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi11callImpl_i4ySi_S3itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i4ySi_S3itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i4ySi_S3itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 2 @@ -1362,12 +1362,12 @@ func callImpl_i4(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int) { } } -// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_i5ySi_S4itAA0E0V_SbtF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) +// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_i5ySi_S4itAA0E0V_SbtF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 // CHECK: %swifterror1 = alloca %T16typed_throws_abi10ThreeWordsV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 -// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2i5ySi_S4itSbAA10ThreeWordsVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr %swifterror1) +// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2i5ySi_S4itSbAA10ThreeWordsVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr %swifterror1) // CHECK: [[CALL_RES0:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES1:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES2:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 @@ -1519,7 +1519,7 @@ struct ImplAsync: PAsync { return (1, 2, 3, 4) } - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2f5ySi_S4itSbYaAA5EmptyVYKF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr %3) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2f5ySi_S4itSbYaAA5EmptyVYKF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr %3) // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: br i1 %2, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -1648,7 +1648,7 @@ struct ImplAsync: PAsync { return (1, 2, 3, 4) } - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2g5ySi_S4itSbYaAA7OneWordVYKF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr %3) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2g5ySi_S4itSbYaAA7OneWordVYKF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr %3) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV, align 8 // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: br i1 %2, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -1778,7 +1778,7 @@ struct ImplAsync: PAsync { return (1, 2, 3, 4) } - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2h5ySi_S4itSbYaAA8TwoWordsVYKF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr %3) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2h5ySi_S4itSbYaAA8TwoWordsVYKF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr %3) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV, align 8 // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: br i1 %2, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -1908,7 +1908,7 @@ struct ImplAsync: PAsync { return (1, 2, 3, 4) } - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2i5ySi_S4itSbYaAA10ThreeWordsVYKF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr %3) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2i5ySi_S4itSbYaAA10ThreeWordsVYKF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr %3) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV, align 8 // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: br i1 %2, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -2127,7 +2127,7 @@ func callImplAsync_f4(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int } } -// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_f5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2) +// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_f5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2) // CHECK: %swifterror = alloca ptr, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 // CHECK: %swifterror1 = alloca swifterror ptr, align 8 @@ -2381,7 +2381,7 @@ func callImplAsync_g4(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int } -// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_g5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2) +// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_g5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2) // CHECK: %swifterror = alloca %T16typed_throws_abi7OneWordV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 // CHECK: %swifterror1 = alloca swifterror ptr, align 8 @@ -2647,7 +2647,7 @@ func callImplAsync_h4(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int } -// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_h5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2) +// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_h5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2) // CHECK: %swifterror = alloca %T16typed_throws_abi8TwoWordsV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 // CHECK: %swifterror1 = alloca swifterror ptr, align 8 @@ -2927,7 +2927,7 @@ func callImplAsync_i4(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int } -// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_i5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2) +// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_i5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2) // CHECK: %swifterror = alloca %T16typed_throws_abi10ThreeWordsV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 // CHECK: %swifterror1 = alloca swifterror ptr, align 8 @@ -2989,7 +2989,7 @@ func callImplAsync_i5(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int } } -// CHECK: define hidden swiftcc { float, float, i64 } @"$s16typed_throws_abi14nonMatching_f0ySf_SftSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) +// CHECK: define hidden swiftcc { float, float, i64 } @"$s16typed_throws_abi14nonMatching_f0ySf_SftSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret { float, float, i64 } { float 1.000000e+00, float 2.000000e+00, i64 undef } @@ -3009,7 +3009,7 @@ func nonMatching_f0(_ b: Bool) throws(OneWord) -> (Float, Float) { // CHECK: define hidden swiftcc { i64, float, float } @"$s16typed_throws_abi18callNonMatching_f0ySi_S2ftSbF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { float, float, i64 } @"$s16typed_throws_abi14nonMatching_f0ySf_SftSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { float, float, i64 } @"$s16typed_throws_abi14nonMatching_f0ySf_SftSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { float, float, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { float, float, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { float, float, i64 } [[CALL_RES]], 2 @@ -3044,7 +3044,7 @@ func callNonMatching_f0(_ b: Bool) -> (Int, Float, Float) { } } -// define hidden swiftcc { float, i64, float } @"$s16typed_throws_abi14nonMatching_f1ySf_SbSftSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) +// define hidden swiftcc { float, i64, float } @"$s16typed_throws_abi14nonMatching_f1ySf_SbSftSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret { float, i64, float } { float 1.000000e+00, i64 1, float 2.000000e+00 } @@ -3063,7 +3063,7 @@ func nonMatching_f1(_ b: Bool) throws(OneWord) -> (Float, Bool, Float) { // CHECK: define hidden swiftcc { i64, float, i1, float } @"$s16typed_throws_abi18callNonMatching_f1ySi_SfSbSftSbF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { float, i64, float } @"$s16typed_throws_abi14nonMatching_f1ySf_SbSftSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { float, i64, float } @"$s16typed_throws_abi14nonMatching_f1ySf_SbSftSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { float, i64, float } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { float, i64, float } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { float, i64, float } [[CALL_RES]], 2 @@ -3225,7 +3225,7 @@ func callNonMatching_f1_async(_ b: Bool) async -> (Int, Float, Bool, Float) { } protocol P { - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2f0yySbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2f0yySbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3236,7 +3236,7 @@ protocol P { // CHECK: } func f0(_ b: Bool) throws(Empty) - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2f1ySiSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2f1ySiSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3247,7 +3247,7 @@ protocol P { // CHECK: } func f1(_ b: Bool) throws(Empty) -> Int - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2f2ySi_SitSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2f2ySi_SitSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3258,7 +3258,7 @@ protocol P { // CHECK: } func f2(_ b: Bool) throws(Empty) -> (Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2f3ySi_S2itSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2f3ySi_S2itSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3269,7 +3269,7 @@ protocol P { // CHECK: } func f3(_ b: Bool) throws(Empty) -> (Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2f4ySi_S3itSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2f4ySi_S3itSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3280,13 +3280,13 @@ protocol P { // CHECK: } func f4(_ b: Bool) throws(Empty) -> (Int, Int, Int, Int) - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2f5ySi_S4itSbAA5EmptyVYKFTj"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) - // CHECK: call swiftcc void {{%.*}}(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2f5ySi_S4itSbAA5EmptyVYKFTj"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: call swiftcc void {{%.*}}(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) // CHECK: ret void // CHECK: } func f5(_ b: Bool) throws(Empty) -> (Int, Int, Int, Int, Int) - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2g0yySbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2g0yySbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3297,7 +3297,7 @@ protocol P { // CHECK: } func g0(_ b: Bool) throws(OneWord) - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2g1ySiSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2g1ySiSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3308,7 +3308,7 @@ protocol P { // CHECK: } func g1(_ b: Bool) throws(OneWord) -> Int - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2g2ySi_SitSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2g2ySi_SitSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3319,7 +3319,7 @@ protocol P { // CHECK: } func g2(_ b: Bool) throws(OneWord) -> (Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2g3ySi_S2itSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2g3ySi_S2itSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3330,7 +3330,7 @@ protocol P { // CHECK: } func g3(_ b: Bool) throws(OneWord) -> (Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2g4ySi_S3itSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2g4ySi_S3itSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3341,13 +3341,13 @@ protocol P { // CHECK: } func g4(_ b: Bool) throws(OneWord) -> (Int, Int, Int, Int) - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2g5ySi_S4itSbAA7OneWordVYKFTj"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) - // CHECK: call swiftcc void {{%.*}}(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2g5ySi_S4itSbAA7OneWordVYKFTj"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: call swiftcc void {{%.*}}(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) // CHECK: ret void // CHECK: } func g5(_ b: Bool) throws(OneWord) -> (Int, Int, Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h0yySbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h0yySbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3358,7 +3358,7 @@ protocol P { // CHECK: } func h0(_ b: Bool) throws(TwoWords) - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h1ySiSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h1ySiSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3369,7 +3369,7 @@ protocol P { // CHECK: } func h1(_ b: Bool) throws(TwoWords) -> Int - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h2ySi_SitSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h2ySi_SitSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3380,7 +3380,7 @@ protocol P { // CHECK: } func h2(_ b: Bool) throws(TwoWords) -> (Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2h3ySi_S2itSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2h3ySi_S2itSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3391,7 +3391,7 @@ protocol P { // CHECK: } func h3(_ b: Bool) throws(TwoWords) -> (Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2h4ySi_S3itSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2h4ySi_S3itSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3402,13 +3402,13 @@ protocol P { // CHECK: } func h4(_ b: Bool) throws(TwoWords) -> (Int, Int, Int, Int) - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2h5ySi_S4itSbAA8TwoWordsVYKFTj"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) - // CHECK: call swiftcc void {{%.*}}(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2h5ySi_S4itSbAA8TwoWordsVYKFTj"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: call swiftcc void {{%.*}}(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) // CHECK: ret void // CHECK: } func h5(_ b: Bool) throws(TwoWords) -> (Int, Int, Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i0yySbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i0yySbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3419,7 +3419,7 @@ protocol P { // CHECK: } func i0(_ b: Bool) throws(ThreeWords) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i1ySiSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i1ySiSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3430,7 +3430,7 @@ protocol P { // CHECK: } func i1(_ b: Bool) throws(ThreeWords) -> Int - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i2ySi_SitSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i2ySi_SitSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3441,7 +3441,7 @@ protocol P { // CHECK: } func i2(_ b: Bool) throws(ThreeWords) -> (Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i3ySi_S2itSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i3ySi_S2itSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3452,7 +3452,7 @@ protocol P { // CHECK: } func i3(_ b: Bool) throws(ThreeWords) -> (Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2i4ySi_S3itSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2i4ySi_S3itSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3463,8 +3463,8 @@ protocol P { // CHECK: } func i4(_ b: Bool) throws(ThreeWords) -> (Int, Int, Int, Int) - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2i5ySi_S4itSbAA10ThreeWordsVYKFTj"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) - // CHECK: call swiftcc void {{%.*}}(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2i5ySi_S4itSbAA10ThreeWordsVYKFTj"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: call swiftcc void {{%.*}}(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) // CHECK: ret void // CHECK: } func i5(_ b: Bool) throws(ThreeWords) -> (Int, Int, Int, Int, Int) @@ -3542,7 +3542,7 @@ protocol PAsync { // CHECK: } func f4(_ b: Bool) async throws(Empty) -> (Int, Int, Int, Int) - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2f5ySi_S4itSbYaAA5EmptyVYKFTj"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2f5ySi_S4itSbYaAA5EmptyVYKFTj"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) // CHECK: %swifterror = alloca swifterror ptr // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: store ptr null, ptr %swifterror @@ -3621,7 +3621,7 @@ protocol PAsync { // CHECK: } func g4(_ b: Bool) async throws(OneWord) -> (Int, Int, Int, Int) - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2g5ySi_S4itSbYaAA7OneWordVYKFTj"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2g5ySi_S4itSbYaAA7OneWordVYKFTj"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) // CHECK: %swifterror = alloca swifterror ptr // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: store ptr null, ptr %swifterror @@ -3700,7 +3700,7 @@ protocol PAsync { // CHECK: } func h4(_ b: Bool) async throws(TwoWords) -> (Int, Int, Int, Int) - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2h5ySi_S4itSbYaAA8TwoWordsVYKFTj"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2h5ySi_S4itSbYaAA8TwoWordsVYKFTj"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) // CHECK: %swifterror = alloca swifterror ptr // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: store ptr null, ptr %swifterror @@ -3779,7 +3779,7 @@ protocol PAsync { // CHECK: } func i4(_ b: Bool) async throws(ThreeWords) -> (Int, Int, Int, Int) - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2i5ySi_S4itSbYaAA10ThreeWordsVYKFTj"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2i5ySi_S4itSbYaAA10ThreeWordsVYKFTj"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) // CHECK: %swifterror = alloca swifterror ptr // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: store ptr null, ptr %swifterror diff --git a/test/IRGen/typed_throws_thunks.swift b/test/IRGen/typed_throws_thunks.swift index 4535cb4681f80..d72b00f349b79 100644 --- a/test/IRGen/typed_throws_thunks.swift +++ b/test/IRGen/typed_throws_thunks.swift @@ -45,9 +45,9 @@ extension P { } } - // CHECK-LABEL: define{{.*}} swiftcc void @"$s19typed_throws_thunks1PP2g24bodyyyy7FailureQzYKXE_tAGYKFTj"(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK-LABEL: define{{.*}} swiftcc void @"$s19typed_throws_thunks1PP2g24bodyyyy7FailureQzYKXE_tAGYKFTj"(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) // CHECK-NOT: ret - // CHECK: call swiftcc void {{.*}}(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: call swiftcc void {{.*}}(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) public func g2(body: () throws(Failure) -> Void) throws(Failure) { do { @@ -57,9 +57,9 @@ extension P { } } - // CHECK-LABEL: define{{.*}} swiftcc { i64, i64 } @"$s19typed_throws_thunks1PP2g34bodyyyyAA9FixedSizeVYKXE_tAGYKFTj"(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5) + // CHECK-LABEL: define{{.*}} swiftcc { i64, i64 } @"$s19typed_throws_thunks1PP2g34bodyyyyAA9FixedSizeVYKXE_tAGYKFTj"(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5) // CHECK-NOT: ret - // CHECK: call swiftcc { i64, i64 } {{.*}}(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5) + // CHECK: call swiftcc { i64, i64 } {{.*}}(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5) public func g3(body: () throws(FixedSize) -> Void) throws(FixedSize) { @@ -69,7 +69,7 @@ extension P { protocol P2 { // CHECK-LABEL: define{{.*}} swiftcc void @"$s19typed_throws_thunks2P2P1fyyAA1EOYKFTj"( // CHECK-SAME: ptr noalias swiftself %0, -// CHECK-SAME: ptr noalias nocapture swifterror dereferenceable(8) %1, +// CHECK-SAME: ptr noalias captures(none) swifterror dereferenceable(8) %1, // CHECK-SAME: ptr %2, ptr %3 // CHECK-SAME: ) // CHECK-SAME: { @@ -81,7 +81,7 @@ protocol P2 { func f() throws(E) // CHECK-LABEL: define{{.*}} swiftcc i8 @"$s19typed_throws_thunks2P2P1gyys4Int8VYKFTj"( // CHECk-SAME: ptr noalias swiftself %0 -// CHECK-SAME: ptr noalias nocapture swifterror dereferenceable(8) %1 +// CHECK-SAME: ptr noalias captures(none) swifterror dereferenceable(8) %1 // CHECK-SAME: ptr %2 // CHECK-SAME: ptr %3 // CHECK-SAME: ) @@ -93,7 +93,7 @@ protocol P2 { func g() throws(Int8) // CHECK-LABEL: define{{.*}} swiftcc i8 @"$s19typed_throws_thunks2P2P1hs4Int8VyAA1EOYKFTj"( // CHECK-SAME: ptr noalias swiftself %0 -// CHECK-SAME: ptr noalias nocapture swifterror dereferenceable(8) %1 +// CHECK-SAME: ptr noalias captures(none) swifterror dereferenceable(8) %1 // CHECK-SAME: ptr %2 // CHECK-SAME: ptr %3 // CHECK-SAME: ) @@ -105,7 +105,7 @@ protocol P2 { func h() throws(E) -> Int8 // CHECK-LABEL: define{{.*}} swiftcc i8 @"$s19typed_throws_thunks2P2P1is4Int8VyAFYKFTj"( // CHECK-SAME: ptr noalias swiftself %0 -// CHECK-SAME: ptr noalias nocapture swifterror dereferenceable(8) %1 +// CHECK-SAME: ptr noalias captures(none) swifterror dereferenceable(8) %1 // CHECK-SAME: ptr %2 // CHECK-SAME: ptr %3 // CHECK-SAME: ) diff --git a/test/IRGen/typelayout_based_value_witness.swift b/test/IRGen/typelayout_based_value_witness.swift index 77ee87f9d965b..a2798e5e13d0b 100644 --- a/test/IRGen/typelayout_based_value_witness.swift +++ b/test/IRGen/typelayout_based_value_witness.swift @@ -81,7 +81,7 @@ public enum ForwardEnum { // CHECK: } -// OPT: define{{.*}} void @"$s30typelayout_based_value_witness1AVwxx"(ptr noalias %object, ptr nocapture readonly %"A") +// OPT: define{{.*}} void @"$s30typelayout_based_value_witness1AVwxx"(ptr noalias %object, ptr captures(none) readonly %"A") // OPT: [[T_PARAM:%.*]] = getelementptr inbounds i8, ptr %"A", i64 16 // OPT: [[T:%.*]] = load ptr, ptr [[T_PARAM]] // OPT: [[VWT_ADDR:%.*]] = getelementptr inbounds i8, ptr [[T]], {{(i64|i32)}} -8 @@ -127,7 +127,7 @@ public enum ForwardEnum { // OPT: ret void // CHECK: } -// OPT: define internal void @"$s30typelayout_based_value_witness2E3Owui"(ptr noalias nocapture writeonly %value, i32 %tag, ptr nocapture readonly %"E3") +// OPT: define internal void @"$s30typelayout_based_value_witness2E3Owui"(ptr noalias captures(none) writeonly %value, i32 %tag, ptr captures(none) readonly %"E3") // OPT: [[IS_EMPTY:%.*]] = icmp eq i32 {{%.*}}, 0 // OPT: br i1 [[IS_EMPTY]], label %empty-payload, label %non-empty-payload // OPT: } diff --git a/test/IRGen/unconditional_checked_cast.sil b/test/IRGen/unconditional_checked_cast.sil index adb01d83790f0..b4f9198282b61 100644 --- a/test/IRGen/unconditional_checked_cast.sil +++ b/test/IRGen/unconditional_checked_cast.sil @@ -10,7 +10,7 @@ sil_vtable C {} class D : C {} sil_vtable D {} -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @downcast_test(ptr noalias nocapture sret({{.*}}) %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @downcast_test(ptr noalias captures(none) sret({{.*}}) %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { // CHECK: entry: // CHECK-NEXT: [[INPUTPTR:%[0-9]+]] = load ptr, ptr [[INPUTPTRPTR:%[0-9]+]], align 8 // CHECK-NEXT: [[TMP:%.*]] = call swiftcc %swift.metadata_response @"$s26unconditional_checked_cast1DCMa"(i64 0) diff --git a/test/IRGen/witness_method.sil b/test/IRGen/witness_method.sil index 83158ff57addc..c59e41bde9b0d 100644 --- a/test/IRGen/witness_method.sil +++ b/test/IRGen/witness_method.sil @@ -110,7 +110,7 @@ class TPSReport : Strategy { func disrupt() -> GrowthHack } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @classArchetypeWitnessMethod(ptr noalias nocapture swiftself dereferenceable({{4|8}}) %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @classArchetypeWitnessMethod(ptr noalias captures(none) swiftself dereferenceable({{4|8}}) %0, ptr %Self, ptr %SelfWitnessTable) sil @classArchetypeWitnessMethod : $@convention(witness_method: Strategy) > (@in_guaranteed T) -> () { entry(%self : $*T): @@ -118,7 +118,7 @@ entry(%self : $*T): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testClassArchetypeWitnessMethod(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{4|8}}) %1, ptr %T, ptr %CoverSheet) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testClassArchetypeWitnessMethod(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{4|8}}) %1, ptr %T, ptr %CoverSheet) // CHECK: entry: // CHECK: [[WITNESS_FN:%.*]] = load ptr, ptr getelementptr inbounds (ptr, ptr @"$s14witness_method9TPSReportCyxGAA8StrategyAAWP", i32 3) // CHECK: call swiftcc void [[WITNESS_FN]](ptr noalias sret({{.*}}) %0, ptr noalias swiftself %1, ptr %T, ptr @"$s14witness_method9TPSReportCyxGAA8StrategyAAWP") diff --git a/test/IRGen/yield_once_big.sil b/test/IRGen/yield_once_big.sil index af03283f3f129..bc57efa915fd7 100644 --- a/test/IRGen/yield_once_big.sil +++ b/test/IRGen/yield_once_big.sil @@ -57,7 +57,7 @@ entry: %1000 = integer_literal $Builtin.Int32, 1000 apply %marker(%1000) : $@convention(thin) (Builtin.Int32) -> () - // CHECK-NEXT: call swiftcc void @make_big(ptr noalias nocapture sret({{.*}}) [[TEMP]], ptr %C) + // CHECK-NEXT: call swiftcc void @make_big(ptr noalias captures(none) sret({{.*}}) [[TEMP]], ptr %C) %make = function_ref @make_big : $@convention(thin) () -> (@owned Big) %value = apply %make() : $@convention(thin) () -> (@owned Big) @@ -171,8 +171,8 @@ cont: } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @test_simple_guaranteed -// CHECK-32-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:16]]) %0, ptr noalias nocapture dereferenceable(32) %1, ptr %C) -// CHECK-64-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:32]]) %0, ptr noalias nocapture dereferenceable(64) %1, ptr %C) +// CHECK-32-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:16]]) %0, ptr noalias captures(none) dereferenceable(32) %1, ptr %C) +// CHECK-64-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:32]]) %0, ptr noalias captures(none) dereferenceable(64) %1, ptr %C) sil [ossa] @test_simple_guaranteed : $@yield_once (@in_guaranteed BigWrapper) -> (@yields @guaranteed Big) { entry(%arg : $*BigWrapper): // Allocate space for the return value of make_big. diff --git a/test/IRGen/yield_once_indirect.sil b/test/IRGen/yield_once_indirect.sil index e45ed9b15a985..1ee9e6871a96d 100644 --- a/test/IRGen/yield_once_indirect.sil +++ b/test/IRGen/yield_once_indirect.sil @@ -42,7 +42,7 @@ entry: // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 {{.*}}, ptr [[TEMP]]) %temp = alloc_stack $Indirect - // CHECK-NEXT: call swiftcc void @make_indirect(ptr noalias nocapture sret({{.*}}) [[TEMP]], ptr %C) + // CHECK-NEXT: call swiftcc void @make_indirect(ptr noalias captures(none) sret({{.*}}) [[TEMP]], ptr %C) %make = function_ref @make_indirect : $@convention(thin) () -> (@out Indirect) apply %make(%temp) : $@convention(thin) () -> (@out Indirect) diff --git a/test/Inputs/conditional_conformance_basic_conformances.swift b/test/Inputs/conditional_conformance_basic_conformances.swift index 40e8cc66b3c40..20138a7168a92 100644 --- a/test/Inputs/conditional_conformance_basic_conformances.swift +++ b/test/Inputs/conditional_conformance_basic_conformances.swift @@ -18,7 +18,7 @@ extension Single: P1 where A: P2 { // witness method for Single.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2_i8star:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -30,7 +30,7 @@ extension Single: P1 where A: P2 { // witness method for Single.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2_i8star:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -188,7 +188,7 @@ extension Double: P1 where B: P2, C: P3 { // witness method for Double.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[B_P2_i8star:%.*]] = load ptr, ptr [[B_P2_PTR]], align 8 @@ -208,7 +208,7 @@ extension Double: P1 where B: P2, C: P3 { // witness method for Double.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP7genericyyqd__AaGRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP7genericyyqd__AaGRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 diff --git a/test/Inputs/conditional_conformance_basic_conformances_future.swift b/test/Inputs/conditional_conformance_basic_conformances_future.swift index e867a340524c7..3b43a5e305c75 100644 --- a/test/Inputs/conditional_conformance_basic_conformances_future.swift +++ b/test/Inputs/conditional_conformance_basic_conformances_future.swift @@ -18,7 +18,7 @@ extension Single: P1 where A: P2 { // witness method for Single.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2_i8star:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -30,7 +30,7 @@ extension Single: P1 where A: P2 { // witness method for Single.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2_i8star:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -167,7 +167,7 @@ extension Double: P1 where B: P2, C: P3 { // witness method for Double.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[B_P2_i8star:%.*]] = load ptr, ptr [[B_P2_PTR]], align 8 @@ -187,7 +187,7 @@ extension Double: P1 where B: P2, C: P3 { // witness method for Double.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP7genericyyqd__AaGRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP7genericyyqd__AaGRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 diff --git a/test/Inputs/conditional_conformance_subclass.swift b/test/Inputs/conditional_conformance_subclass.swift index de35a0d82cc72..5775374b33107 100644 --- a/test/Inputs/conditional_conformance_subclass.swift +++ b/test/Inputs/conditional_conformance_subclass.swift @@ -16,7 +16,7 @@ extension Base: P1 where A: P2 { // witness method for Base.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias nocapture swiftself dereferenceable(8) %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself dereferenceable(8) %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -27,7 +27,7 @@ extension Base: P1 where A: P2 { // witness method for Base.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 diff --git a/test/Inputs/conditional_conformance_subclass_future.swift b/test/Inputs/conditional_conformance_subclass_future.swift index 4f1a59e28b3f4..c88fb733e0672 100644 --- a/test/Inputs/conditional_conformance_subclass_future.swift +++ b/test/Inputs/conditional_conformance_subclass_future.swift @@ -16,7 +16,7 @@ extension Base: P1 where A: P2 { // witness method for Base.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias nocapture swiftself dereferenceable(8) %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself dereferenceable(8) %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -27,7 +27,7 @@ extension Base: P1 where A: P2 { // witness method for Base.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 diff --git a/test/Inputs/conditional_conformance_with_assoc.swift b/test/Inputs/conditional_conformance_with_assoc.swift index 1aeffe8f2cf56..84258108a350f 100644 --- a/test/Inputs/conditional_conformance_with_assoc.swift +++ b/test/Inputs/conditional_conformance_with_assoc.swift @@ -41,7 +41,7 @@ extension Double: P1 where B.AT2: P2, C: P3, B.AT2.AT2.AT3: P3 { // witness method for Double.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[C_P3:%.*]] = load ptr, ptr [[C_P3_PTR]], align 8 @@ -67,7 +67,7 @@ extension Double: P1 where B.AT2: P2, C: P3, B.AT2.AT2.AT3: P3 { // witness method for Double.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP7genericyyqd__AaFRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP7genericyyqd__AaFRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[C_P3:%.*]] = load ptr, ptr [[C_P3_PTR]], align 8 diff --git a/test/Inputs/conditional_conformance_with_assoc_future.swift b/test/Inputs/conditional_conformance_with_assoc_future.swift index 5dee20e72d072..229ede617538f 100644 --- a/test/Inputs/conditional_conformance_with_assoc_future.swift +++ b/test/Inputs/conditional_conformance_with_assoc_future.swift @@ -41,7 +41,7 @@ extension Double: P1 where B.AT2: P2, C: P3, B.AT2.AT2.AT3: P3 { // witness method for Double.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[C_P3:%.*]] = load ptr, ptr [[C_P3_PTR]], align 8 @@ -67,7 +67,7 @@ extension Double: P1 where B.AT2: P2, C: P3, B.AT2.AT2.AT3: P3 { // witness method for Double.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP7genericyyqd__AaFRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP7genericyyqd__AaFRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[C_P3:%.*]] = load ptr, ptr [[C_P3_PTR]], align 8 diff --git a/test/Interop/Cxx/class/method/inreg-sret.swift b/test/Interop/Cxx/class/method/inreg-sret.swift index b11bc95fe3c68..c5258b6a1c863 100644 --- a/test/Interop/Cxx/class/method/inreg-sret.swift +++ b/test/Interop/Cxx/class/method/inreg-sret.swift @@ -21,8 +21,8 @@ final public class Function { // Check that inreg on the sret isn't missing -// CHECK-x86_64: call void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}}, ptr noalias nocapture sret(%TSo25OptionalBridgedBasicBlockV) {{.*}}) -// CHECK-aarch64: call void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}}, ptr inreg noalias nocapture sret(%TSo25OptionalBridgedBasicBlockV) {{.*}}) +// CHECK-x86_64: call void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}}, ptr noalias captures(none) sret(%TSo25OptionalBridgedBasicBlockV) {{.*}}) +// CHECK-aarch64: call void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}}, ptr inreg noalias captures(none) sret(%TSo25OptionalBridgedBasicBlockV) {{.*}}) // CHECK-x86_64: define {{.*}} void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}} %{{.*}}, ptr {{.*}} sret(%struct.OptionalBridgedBasicBlock) {{.*}} %{{.*}}) // CHECK-aarch64: define {{.*}} void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}} %{{.*}}, ptr inreg {{.*}} sret(%struct.OptionalBridgedBasicBlock) {{.*}} %{{.*}}) diff --git a/test/Interop/Cxx/class/protocol-conformance-irgen.swift b/test/Interop/Cxx/class/protocol-conformance-irgen.swift index d5dbbe435add5..db017b4910b1c 100644 --- a/test/Interop/Cxx/class/protocol-conformance-irgen.swift +++ b/test/Interop/Cxx/class/protocol-conformance-irgen.swift @@ -7,7 +7,7 @@ protocol HasReturn42 { } -// CHECK: define {{.*}}i32 @"$sSo18ConformsToProtocolV4main11HasReturn42A2cDP8return42s5Int32VyFTW"(ptr nocapture swiftself dereferenceable(1) %{{.*}}, ptr %{{.*}}, ptr %{{.*}}) +// CHECK: define {{.*}}i32 @"$sSo18ConformsToProtocolV4main11HasReturn42A2cDP8return42s5Int32VyFTW"(ptr captures(none) swiftself dereferenceable(1) %{{.*}}, ptr %{{.*}}, ptr %{{.*}}) // CHECK: [[OUT:%.*]] = call i32 @{{_ZN18ConformsToProtocol8return42Ev|"\?return42@ConformsToProtocol@@QEAAHXZ"}}(ptr // CHECK: ret i32 [[OUT]] diff --git a/test/Interop/Cxx/class/returns-large-class-irgen.swift b/test/Interop/Cxx/class/returns-large-class-irgen.swift index d9e6f3af56c7a..f45dde04337da 100644 --- a/test/Interop/Cxx/class/returns-large-class-irgen.swift +++ b/test/Interop/Cxx/class/returns-large-class-irgen.swift @@ -14,7 +14,7 @@ func foo() -> LargeClass { foo() -// CHECK: call swiftcc void @"$s4main3fooSo10LargeClassVyF"(ptr noalias nocapture sret(%TSo10LargeClassV) %{{.*}}) +// CHECK: call swiftcc void @"$s4main3fooSo10LargeClassVyF"(ptr noalias captures(none) sret(%TSo10LargeClassV) %{{.*}}) // The C++ function: // CHECK: define{{( dso_local)?}} void @{{_Z21funcReturnsLargeClassv|"\?funcReturnsLargeClass@@YA\?AULargeClass@@XZ"}}({{%struct.LargeClass\*|ptr}}{{.*}} sret(%struct.LargeClass){{( align .*)?}} %{{.*}}) diff --git a/test/Interop/Cxx/extern-var/extern-var-irgen.swift b/test/Interop/Cxx/extern-var/extern-var-irgen.swift index cbec5e8e26828..57a3d0a416542 100644 --- a/test/Interop/Cxx/extern-var/extern-var-irgen.swift +++ b/test/Interop/Cxx/extern-var/extern-var-irgen.swift @@ -44,4 +44,4 @@ public func passingVarAsInout() { } // CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main17passingVarAsInoutyyF"() #0 -// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr nocapture dereferenceable(4) @{{counter|"\?counter@@3HA"}}) +// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr captures(none) dereferenceable(4) @{{counter|"\?counter@@3HA"}}) diff --git a/test/Interop/Cxx/static/inline-static-member-var-irgen.swift b/test/Interop/Cxx/static/inline-static-member-var-irgen.swift index f5409c05e9864..edde6d6c0617b 100644 --- a/test/Interop/Cxx/static/inline-static-member-var-irgen.swift +++ b/test/Interop/Cxx/static/inline-static-member-var-irgen.swift @@ -28,4 +28,4 @@ public func passingVarAsInout() { } // CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main17passingVarAsInoutyyF"() -// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr nocapture dereferenceable(4) @{{_ZN22WithInlineStaticMember12staticMemberE|"\?staticMember@WithInlineStaticMember@@2HA"}}) +// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr captures(none) dereferenceable(4) @{{_ZN22WithInlineStaticMember12staticMemberE|"\?staticMember@WithInlineStaticMember@@2HA"}}) diff --git a/test/Interop/Cxx/static/static-var-irgen.swift b/test/Interop/Cxx/static/static-var-irgen.swift index f8d920ebd8cef..f7b44647fb031 100644 --- a/test/Interop/Cxx/static/static-var-irgen.swift +++ b/test/Interop/Cxx/static/static-var-irgen.swift @@ -85,7 +85,7 @@ public func passingVarAsInout() { modifyInout(&staticVar) } // CHECK: define {{.*}}void @"$s4main17passingVarAsInoutyyF"() -// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr nocapture dereferenceable(4) @{{_ZL9staticVar|staticVar}}) +// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr captures(none) dereferenceable(4) @{{_ZL9staticVar|staticVar}}) // CHECK: define internal void @_GLOBAL__sub_I__swift_imported_modules_() // CHECK: call void @{{__cxx_global_var_init|"\?\?__EstaticVarInit@@YAXXZ"}}() diff --git a/test/Interop/Cxx/stdlib/msvc-abi-use-vector-iterator.swift b/test/Interop/Cxx/stdlib/msvc-abi-use-vector-iterator.swift index daa43eeb78a59..d3a26f5b65b9a 100644 --- a/test/Interop/Cxx/stdlib/msvc-abi-use-vector-iterator.swift +++ b/test/Interop/Cxx/stdlib/msvc-abi-use-vector-iterator.swift @@ -5,7 +5,7 @@ import MsvcUseVecIt -// CHECK: call void @"?begin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEBA?AV?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@@2@XZ"(ptr {{.*}}, ptr noalias nocapture sret +// CHECK: call void @"?begin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEBA?AV?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@@2@XZ"(ptr {{.*}}, ptr noalias captures(none) sret func test() -> Bool { let result = f() diff --git a/test/Interop/Cxx/templates/mangling-irgen.swift b/test/Interop/Cxx/templates/mangling-irgen.swift index 3a5f1e8f349ef..d5d714652159d 100644 --- a/test/Interop/Cxx/templates/mangling-irgen.swift +++ b/test/Interop/Cxx/templates/mangling-irgen.swift @@ -4,12 +4,12 @@ import Mangling public func receiveInstantiation(_ i: inout WrappedMagicBool) {} -// CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main20receiveInstantiationyySo0025MagicWrapperCBool_lsFCfibVzF"(ptr nocapture dereferenceable(1) %0) +// CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main20receiveInstantiationyySo0025MagicWrapperCBool_lsFCfibVzF"(ptr captures(none) dereferenceable(1) %0) public func receiveInstantiation(_ i: inout WrappedMagicInt) {} // Don't forget to update manglings.txt when changing s4main20receiveInstantiationyySo34__CxxTemplateInst12MagicWrapperIiEVzF -// CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main20receiveInstantiationyySo0024MagicWrapperCInt_npAIefbVzF"(ptr nocapture dereferenceable(1) %0) +// CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main20receiveInstantiationyySo0024MagicWrapperCInt_npAIefbVzF"(ptr captures(none) dereferenceable(1) %0) public func returnInstantiation() -> WrappedMagicInt { return WrappedMagicInt() diff --git a/test/LLVMPasses/allocation-deletion.ll b/test/LLVMPasses/allocation-deletion.ll index 81d9b181dc576..c9db70bf7a6db 100644 --- a/test/LLVMPasses/allocation-deletion.ll +++ b/test/LLVMPasses/allocation-deletion.ll @@ -59,7 +59,7 @@ entry: ; trivial_alloc_eliminate2 - Show that we can eliminate an allocation with a ; destructor that does a retain on the 'self' object. @trivial_dtor_metadata2 = internal constant %swift.heapmetadata { ptr @trivial_dtor2, ptr null } -define internal i64 @trivial_dtor2(ptr nocapture %this) nounwind readonly { +define internal i64 @trivial_dtor2(ptr captures(none) %this) nounwind readonly { entry: %0 = getelementptr inbounds %swift.refcounted, ptr %this, i64 1, i32 0 store ptr inttoptr (i64 4 to ptr), ptr %0, align 8 diff --git a/test/SILOptimizer/devirt_witness_method_empty_conformance.swift b/test/SILOptimizer/devirt_witness_method_empty_conformance.swift index e8ea8e7959487..047493fcebc18 100644 --- a/test/SILOptimizer/devirt_witness_method_empty_conformance.swift +++ b/test/SILOptimizer/devirt_witness_method_empty_conformance.swift @@ -76,7 +76,7 @@ extension ApplyRegStruct { from space: PublicEnum, transform: RegStruct ) { transform.funcInStructAndProtAndExt(.case2, space: space) { -// CHECK-LABEL: define hidden swiftcc void @"$sSa39devirt_witness_method_empty_conformanceAA12PublicStructVRszlE14applyTransformyyF"(ptr nocapture {{.*}}swiftself dereferenceable +// CHECK-LABEL: define hidden swiftcc void @"$sSa39devirt_witness_method_empty_conformanceAA12PublicStructVRszlE14applyTransformyyF"(ptr captures(none) {{.*}}swiftself dereferenceable // CHECK-NEXT: entry // CHECK-NEXT: ret void applyTransform() diff --git a/test/SILOptimizer/eager_specialize.sil b/test/SILOptimizer/eager_specialize.sil index 3f4a290d927f6..71cd25f905b11 100644 --- a/test/SILOptimizer/eager_specialize.sil +++ b/test/SILOptimizer/eager_specialize.sil @@ -698,7 +698,7 @@ bb0(%0 : $*Self, %1 : $*Self, %2 : $@thick Self.Type): // Check that a specialization for _Trivial(32) uses direct loads and stores // instead of value witness functions to load and store the value of a generic type. -// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze31_lIetilr_Tp5"(ptr noalias nocapture sret(i32) %0, ptr noalias nocapture dereferenceable(4) %1, ptr nocapture dereferenceable(4) %2, ptr %S +// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze31_lIetilr_Tp5"(ptr noalias captures(none) sret(i32) %0, ptr noalias captures(none) dereferenceable(4) %1, ptr captures(none) dereferenceable(4) %2, ptr %S // CHECK-IRGEN: entry: // CHECK-IRGEN: %3 = load i32, ptr %2 // CHECK-IRGEN-NEXT: store i32 %3, ptr %0 @@ -707,7 +707,7 @@ bb0(%0 : $*Self, %1 : $*Self, %2 : $@thick Self.Type): // Check that a specialization for _Trivial(64) uses direct loads and stores // instead of value witness functions to load and store the value of a generic type. -// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze63_lIetilr_Tp5"(ptr noalias nocapture sret(i64) %0, ptr noalias nocapture dereferenceable(8) %1, ptr nocapture dereferenceable(8) %2, ptr %S +// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze63_lIetilr_Tp5"(ptr noalias captures(none) sret(i64) %0, ptr noalias captures(none) dereferenceable(8) %1, ptr captures(none) dereferenceable(8) %2, ptr %S // CHECK-IRGEN: entry: // CHECK-IRGEN: %3 = load i64, ptr %2 // CHECK-IRGEN-NEXT: store i64 %3, ptr %0 diff --git a/test/SILOptimizer/eager_specialize_ossa.sil b/test/SILOptimizer/eager_specialize_ossa.sil index 2ac721d8a6d96..03aa594364e83 100644 --- a/test/SILOptimizer/eager_specialize_ossa.sil +++ b/test/SILOptimizer/eager_specialize_ossa.sil @@ -886,7 +886,7 @@ bb0(%0 : $*Self, %1 : $*Self, %2 : $@thick Self.Type): // Check that a specialization for _Trivial(32) uses direct loads and stores // instead of value witness functions to load and store the value of a generic type. -// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze31_lIetilr_Tp5"(ptr noalias nocapture sret(i32) %0, ptr noalias nocapture dereferenceable(4) %1, ptr nocapture dereferenceable(4) %2, ptr %S +// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze31_lIetilr_Tp5"(ptr noalias captures(none) sret(i32) %0, ptr noalias captures(none) dereferenceable(4) %1, ptr captures(none) dereferenceable(4) %2, ptr %S // CHECK-IRGEN: entry: // CHECK-IRGEN: %3 = load i32, ptr %2 // CHECK-IRGEN-NEXT: store i32 %3, ptr %0 @@ -895,7 +895,7 @@ bb0(%0 : $*Self, %1 : $*Self, %2 : $@thick Self.Type): // Check that a specialization for _Trivial(64) uses direct loads and stores // instead of value witness functions to load and store the value of a generic type. -// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze63_lIetilr_Tp5"(ptr noalias nocapture sret(i64) %0, ptr noalias nocapture dereferenceable(8) %1, ptr nocapture dereferenceable(8) %2, ptr %S +// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze63_lIetilr_Tp5"(ptr noalias captures(none) sret(i64) %0, ptr noalias captures(none) dereferenceable(8) %1, ptr captures(none) dereferenceable(8) %2, ptr %S // CHECK-IRGEN: entry: // CHECK-IRGEN: %3 = load i64, ptr %2 // CHECK-IRGEN-NEXT: store i64 %3, ptr %0 From bb9fb7286e6ad06fa29cf494a38df1008e00a0e5 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 20:12:45 +0100 Subject: [PATCH 003/100] LLVMPasses: Switch from obsoleted `llvm::IRHash` to `llvm::stable_hash` Per 1941c5180b91d792200d5e868d45c96e99bda35e (llvm-project). --- lib/LLVMPasses/LLVMMergeFunctions.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/LLVMPasses/LLVMMergeFunctions.cpp b/lib/LLVMPasses/LLVMMergeFunctions.cpp index 122c947df19d2..7f33a935d5676 100644 --- a/lib/LLVMPasses/LLVMMergeFunctions.cpp +++ b/lib/LLVMPasses/LLVMMergeFunctions.cpp @@ -258,7 +258,7 @@ class SwiftMergeFunctions { FunctionEntry *First; /// A very cheap hash, used to early exit if functions do not match. - llvm::IRHash Hash; + llvm::stable_hash Hash; public: // Note the hash is recalculated potentially multiple times, but it is cheap. @@ -714,7 +714,7 @@ bool SwiftMergeFunctions::runOnModule(Module &M) { // All functions in the module, ordered by hash. Functions with a unique // hash value are easily eliminated. - std::vector> HashedFuncs; + std::vector> HashedFuncs; for (Function &Func : M) { if (isEligibleFunction(&Func)) { @@ -722,10 +722,11 @@ bool SwiftMergeFunctions::runOnModule(Module &M) { } } - std::stable_sort( - HashedFuncs.begin(), HashedFuncs.end(), - [](const std::pair &a, - const std::pair &b) { return a.first < b.first; }); + std::stable_sort(HashedFuncs.begin(), HashedFuncs.end(), + [](const std::pair &a, + const std::pair &b) { + return a.first < b.first; + }); std::vector FuncEntryStorage; FuncEntryStorage.reserve(HashedFuncs.size()); From 3ef981621369588c9ff6c73fb124175862d8ca2a Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 20:34:08 +0100 Subject: [PATCH 004/100] Adjust includes of moved LLVM header Per 2ae968a0d9fb61606b020e898d884c82dd0ed8b5 (llvm-project). --- include/swift/AST/IRGenOptions.h | 4 ++-- include/swift/Option/SanitizerOptions.h | 2 +- lib/IRGen/IRGen.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/swift/AST/IRGenOptions.h b/include/swift/AST/IRGenOptions.h index d05d7c96e51d8..998af7e62e88e 100644 --- a/include/swift/AST/IRGenOptions.h +++ b/include/swift/AST/IRGenOptions.h @@ -29,9 +29,9 @@ #include "llvm/IR/CallingConv.h" // FIXME: This include is just for llvm::SanitizerCoverageOptions. We should // split the header upstream so we don't include so much. -#include "llvm/Transforms/Instrumentation.h" -#include "llvm/Support/raw_ostream.h" #include "llvm/Support/VersionTuple.h" +#include "llvm/Support/raw_ostream.h" +#include "llvm/Transforms/Utils/Instrumentation.h" #include #include #include diff --git a/include/swift/Option/SanitizerOptions.h b/include/swift/Option/SanitizerOptions.h index faa394f39b072..ab7f3bbdb8776 100644 --- a/include/swift/Option/SanitizerOptions.h +++ b/include/swift/Option/SanitizerOptions.h @@ -20,7 +20,7 @@ #include "llvm/Option/ArgList.h" // FIXME: This include is just for llvm::SanitizerCoverageOptions. We should // split the header upstream so we don't include so much. -#include "llvm/Transforms/Instrumentation.h" +#include "llvm/Transforms/Utils/Instrumentation.h" namespace swift { class DiagnosticEngine; diff --git a/lib/IRGen/IRGen.cpp b/lib/IRGen/IRGen.cpp index 79de76923f69a..35b9dba2614cc 100644 --- a/lib/IRGen/IRGen.cpp +++ b/lib/IRGen/IRGen.cpp @@ -85,7 +85,6 @@ #include "llvm/Transforms/IPO.h" #include "llvm/Transforms/IPO/AlwaysInliner.h" #include "llvm/Transforms/IPO/ThinLTOBitcodeWriter.h" -#include "llvm/Transforms/Instrumentation.h" #include "llvm/Transforms/Instrumentation/AddressSanitizer.h" #include "llvm/Transforms/Instrumentation/InstrProfiling.h" #include "llvm/Transforms/Instrumentation/SanitizerCoverage.h" @@ -93,6 +92,7 @@ #include "llvm/Transforms/ObjCARC.h" #include "llvm/Transforms/Scalar.h" #include "llvm/Transforms/Scalar/DCE.h" +#include "llvm/Transforms/Utils/Instrumentation.h" #include "llvm/CodeGen/MachineOptimizationRemarkEmitter.h" #include "llvm/IR/DiagnosticInfo.h" From b71e689138e76451499c7c6e6a2be9388a3fab80 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Sun, 20 Apr 2025 04:57:27 +0100 Subject: [PATCH 005/100] Adjust includes of moved Clang headers Per 0d150db214e2aa13a825b563c7238e1243d61db1 (llvm-project). --- include/swift/Migrator/FixitApplyDiagnosticConsumer.h | 4 ++-- include/swift/Migrator/RewriteBufferEditsReceiver.h | 7 ++++--- lib/IDE/Utils.cpp | 6 +++--- lib/Migrator/APIDiffMigratorPass.cpp | 2 +- lib/Migrator/Migrator.cpp | 2 +- tools/SourceKit/lib/Support/ImmutableTextBuffer.cpp | 4 ++-- tools/swift-ide-test/swift-ide-test.cpp | 4 ++-- 7 files changed, 15 insertions(+), 14 deletions(-) diff --git a/include/swift/Migrator/FixitApplyDiagnosticConsumer.h b/include/swift/Migrator/FixitApplyDiagnosticConsumer.h index 4937a881b827d..ce5aebf58f5e9 100644 --- a/include/swift/Migrator/FixitApplyDiagnosticConsumer.h +++ b/include/swift/Migrator/FixitApplyDiagnosticConsumer.h @@ -21,7 +21,7 @@ #include "swift/Migrator/FixitFilter.h" #include "swift/Migrator/Migrator.h" #include "swift/Migrator/Replacement.h" -#include "clang/Rewrite/Core/RewriteBuffer.h" +#include "llvm/ADT/RewriteBuffer.h" #include "llvm/ADT/SmallSet.h" namespace swift { @@ -37,7 +37,7 @@ struct Replacement; class FixitApplyDiagnosticConsumer final : public DiagnosticConsumer, public FixitFilter { - clang::RewriteBuffer RewriteBuf; + llvm::RewriteBuffer RewriteBuf; /// The entire text of the input file. const StringRef Text; diff --git a/include/swift/Migrator/RewriteBufferEditsReceiver.h b/include/swift/Migrator/RewriteBufferEditsReceiver.h index 91c86d893bc6d..e9366ead711f5 100644 --- a/include/swift/Migrator/RewriteBufferEditsReceiver.h +++ b/include/swift/Migrator/RewriteBufferEditsReceiver.h @@ -16,7 +16,7 @@ #include "clang/Basic/SourceManager.h" #include "clang/Basic/SourceLocation.h" #include "clang/Edit/EditsReceiver.h" -#include "clang/Rewrite/Core/RewriteBuffer.h" +#include "llvm/ADT/RewriteBuffer.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/raw_ostream.h" @@ -26,12 +26,13 @@ namespace swift { namespace migrator { /// An EditsReceiver that collects edits from an EditedSource and directly -/// applies it to a clang::RewriteBuffer. +/// applies it to a llvm::RewriteBuffer. class RewriteBufferEditsReceiver final : public clang::edit::EditsReceiver { const clang::SourceManager &ClangSourceManager; const clang::FileID InputFileID; const StringRef InputText; - clang::RewriteBuffer RewriteBuf; + llvm::RewriteBuffer RewriteBuf; + public: RewriteBufferEditsReceiver(const clang::SourceManager &ClangSourceManager, const clang::FileID InputFileID, diff --git a/lib/IDE/Utils.cpp b/lib/IDE/Utils.cpp index 6dbb2fb7aa320..1b338aa62d593 100644 --- a/lib/IDE/Utils.cpp +++ b/lib/IDE/Utils.cpp @@ -20,7 +20,7 @@ #include "swift/Parse/Parser.h" #include "swift/Subsystems.h" #include "clang/AST/ASTContext.h" -#include "clang/Rewrite/Core/RewriteBuffer.h" +#include "llvm/ADT/RewriteBuffer.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/MemoryBuffer.h" @@ -782,11 +782,11 @@ accept(SourceManager &SM, RegionType Type, ArrayRef Replacements) { namespace { class ClangFileRewriterHelper { unsigned InterestedId; - clang::RewriteBuffer RewriteBuf; + llvm::RewriteBuffer RewriteBuf; bool HasChange; llvm::raw_ostream &OS; - void removeCommentLines(clang::RewriteBuffer &Buffer, StringRef Input, + void removeCommentLines(llvm::RewriteBuffer &Buffer, StringRef Input, StringRef LineHeader) { size_t Pos = 0; while (true) { diff --git a/lib/Migrator/APIDiffMigratorPass.cpp b/lib/Migrator/APIDiffMigratorPass.cpp index 627f5fb5c1367..b5626e6fad5bb 100644 --- a/lib/Migrator/APIDiffMigratorPass.cpp +++ b/lib/Migrator/APIDiffMigratorPass.cpp @@ -29,7 +29,7 @@ #include "clang/Basic/FileManager.h" #include "clang/Basic/SourceManager.h" #include "clang/Edit/EditedSource.h" -#include "clang/Rewrite/Core/RewriteBuffer.h" +#include "llvm/ADT/RewriteBuffer.h" #include "llvm/Support/FileSystem.h" using namespace swift; diff --git a/lib/Migrator/Migrator.cpp b/lib/Migrator/Migrator.cpp index 7549d14200480..034c056dc370a 100644 --- a/lib/Migrator/Migrator.cpp +++ b/lib/Migrator/Migrator.cpp @@ -21,7 +21,7 @@ #include "clang/Basic/FileManager.h" #include "clang/Basic/SourceManager.h" #include "clang/Edit/EditedSource.h" -#include "clang/Rewrite/Core/RewriteBuffer.h" +#include "llvm/ADT/RewriteBuffer.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/FileSystem.h" diff --git a/tools/SourceKit/lib/Support/ImmutableTextBuffer.cpp b/tools/SourceKit/lib/Support/ImmutableTextBuffer.cpp index 81a4623b1a93b..0ebf2619ba200 100644 --- a/tools/SourceKit/lib/Support/ImmutableTextBuffer.cpp +++ b/tools/SourceKit/lib/Support/ImmutableTextBuffer.cpp @@ -11,13 +11,13 @@ //===----------------------------------------------------------------------===// #include "SourceKit/Support/ImmutableTextBuffer.h" -#include "clang/Rewrite/Core/RewriteRope.h" +#include "llvm/ADT/RewriteRope.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/SourceMgr.h" using namespace SourceKit; using namespace llvm; -using clang::RewriteRope; +using llvm::RewriteRope; void ImmutableTextUpdate::anchor() {} diff --git a/tools/swift-ide-test/swift-ide-test.cpp b/tools/swift-ide-test/swift-ide-test.cpp index 8ddd310faba80..d7292c4f80149 100644 --- a/tools/swift-ide-test/swift-ide-test.cpp +++ b/tools/swift-ide-test/swift-ide-test.cpp @@ -53,7 +53,7 @@ #include "swift/Markup/Markup.h" #include "swift/Parse/ParseVersion.h" #include "swift/Sema/IDETypeChecking.h" -#include "clang/Rewrite/Core/RewriteBuffer.h" +#include "llvm/ADT/RewriteBuffer.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/CommandLine.h" @@ -2082,7 +2082,7 @@ static int doDumpImporterLookupTables(const CompilerInvocation &InitInvok, class StructureAnnotator : public ide::SyntaxModelWalker { SourceManager &SM; unsigned BufferID; - clang::RewriteBuffer RewriteBuf; + llvm::RewriteBuffer RewriteBuf; std::vector NodeStack; CharSourceRange LastPoppedNodeRange; From da47b58586f2b8006cdddbadec148b55f5377d6d Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 21:30:59 +0100 Subject: [PATCH 006/100] Refactor `llvm::opt::GenericOptTable` subclasses after changes to LLVM Option library Per dd647e3e608ed0b2bac7c588d5859b80ef4a5976 (llvm-project). --- lib/DriverTool/swift_cache_tool_main.cpp | 14 ++++++++------ lib/Option/Options.cpp | 18 ++++++++++-------- .../tools/sourcekitd-test/TestOptions.cpp | 15 ++++++++------- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/lib/DriverTool/swift_cache_tool_main.cpp b/lib/DriverTool/swift_cache_tool_main.cpp index be1fe4ce157b3..5855bc3d9de26 100644 --- a/lib/DriverTool/swift_cache_tool_main.cpp +++ b/lib/DriverTool/swift_cache_tool_main.cpp @@ -65,12 +65,13 @@ enum ID { #undef OPTION }; -#define PREFIX(NAME, VALUE) \ - constexpr llvm::StringLiteral NAME##_init[] = VALUE; \ - constexpr llvm::ArrayRef NAME( \ - NAME##_init, std::size(NAME##_init) - 1); +#define OPTTABLE_STR_TABLE_CODE #include "SwiftCacheToolOptions.inc" -#undef PREFIX +#undef OPTTABLE_STR_TABLE_CODE + +#define OPTTABLE_PREFIXES_TABLE_CODE +#include "SwiftCacheToolOptions.inc" +#undef OPTTABLE_PREFIXES_TABLE_CODE static const OptTable::Info InfoTable[] = { #define OPTION(...) LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__), @@ -80,7 +81,8 @@ static const OptTable::Info InfoTable[] = { class CacheToolOptTable : public llvm::opt::GenericOptTable { public: - CacheToolOptTable() : GenericOptTable(InfoTable) {} + CacheToolOptTable() + : GenericOptTable(OptionStrTable, OptionPrefixesTable, InfoTable) {} }; class SwiftCacheToolInvocation { diff --git a/lib/Option/Options.cpp b/lib/Option/Options.cpp index 6a159de3150ba..5a334e131bcc1 100644 --- a/lib/Option/Options.cpp +++ b/lib/Option/Options.cpp @@ -16,15 +16,16 @@ #include "llvm/Option/OptTable.h" #include "llvm/Option/Option.h" -using namespace swift::options; -using namespace llvm::opt; +#define OPTTABLE_STR_TABLE_CODE +#include "swift/Option/Options.inc" +#undef OPTTABLE_STR_TABLE_CODE -#define PREFIX(NAME, VALUE) \ - constexpr llvm::StringLiteral NAME##_init[] = VALUE; \ - constexpr llvm::ArrayRef NAME( \ - NAME##_init, std::size(NAME##_init) - 1); +#define OPTTABLE_PREFIXES_TABLE_CODE #include "swift/Option/Options.inc" -#undef PREFIX +#undef OPTTABLE_PREFIXES_TABLE_CODE + +using namespace swift::options; +using namespace llvm::opt; static const llvm::opt::GenericOptTable::Info InfoTable[] = { #define OPTION(...) LLVM_CONSTRUCT_OPT_INFO(__VA_ARGS__), @@ -36,7 +37,8 @@ namespace { class SwiftOptTable : public llvm::opt::GenericOptTable { public: - SwiftOptTable() : GenericOptTable(InfoTable) {} + SwiftOptTable() + : GenericOptTable(OptionStrTable, OptionPrefixesTable, InfoTable) {} }; } // end anonymous namespace diff --git a/tools/SourceKit/tools/sourcekitd-test/TestOptions.cpp b/tools/SourceKit/tools/sourcekitd-test/TestOptions.cpp index 14345dfbb40f6..90a696db11c73 100644 --- a/tools/SourceKit/tools/sourcekitd-test/TestOptions.cpp +++ b/tools/SourceKit/tools/sourcekitd-test/TestOptions.cpp @@ -35,13 +35,13 @@ enum Opt { #undef OPTION }; -// Create prefix string literals used in Options.td. -#define PREFIX(NAME, VALUE) \ - constexpr llvm::StringLiteral NAME##_init[] = VALUE; \ - constexpr llvm::ArrayRef NAME( \ - NAME##_init, std::size(NAME##_init) - 1); +#define OPTTABLE_STR_TABLE_CODE #include "Options.inc" -#undef PREFIX +#undef OPTTABLE_STR_TABLE_CODE + +#define OPTTABLE_PREFIXES_TABLE_CODE +#include "Options.inc" +#undef OPTTABLE_PREFIXES_TABLE_CODE // Create table mapping all options defined in Options.td. static const llvm::opt::OptTable::Info InfoTable[] = { @@ -53,7 +53,8 @@ static const llvm::opt::OptTable::Info InfoTable[] = { // Create OptTable class for parsing actual command line arguments class TestOptTable : public llvm::opt::GenericOptTable { public: - TestOptTable() : GenericOptTable(InfoTable) {} + TestOptTable() + : GenericOptTable(OptionStrTable, OptionPrefixesTable, InfoTable) {} }; } // end anonymous namespace From 7b9318fa848c1fcddb4a385db4758dcf8428e1f1 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 22:11:01 +0100 Subject: [PATCH 007/100] Refactor uses of obsoleted `llvm::DenseMap::{FindAndConstruct,getOrInsertDefault}` Per 390b82dd4c485ec64cf8a6c52fb73e391792262e (llvm-project). --- include/swift/SILOptimizer/Analysis/Analysis.h | 14 +++++++------- lib/AST/RequirementMachine/RequirementLowering.cpp | 3 +-- lib/SILOptimizer/Analysis/ColdBlockInfo.cpp | 4 ++-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/include/swift/SILOptimizer/Analysis/Analysis.h b/include/swift/SILOptimizer/Analysis/Analysis.h index a0647818b0418..ec6c729117198 100644 --- a/include/swift/SILOptimizer/Analysis/Analysis.h +++ b/include/swift/SILOptimizer/Analysis/Analysis.h @@ -231,19 +231,19 @@ class FunctionAnalysisBase : public SILAnalysis { // Check that the analysis can handle this function. verifyFunction(f); - auto &it = storage.FindAndConstruct(f); - if (!it.second) - it.second = newFunctionAnalysis(f); - return it.second.get(); + auto &value = storage[f]; + if (!value) + value = newFunctionAnalysis(f); + return value.get(); } virtual void forcePrecompute(SILFunction *f) override { // Check that the analysis can handle this function. verifyFunction(f); - auto &it = storage.FindAndConstruct(f); - if (!it.second) - it.second = newFunctionAnalysis(f); + auto &value = storage[f]; + if (!value) + value = newFunctionAnalysis(f); } /// Invalidate all information in this analysis. diff --git a/lib/AST/RequirementMachine/RequirementLowering.cpp b/lib/AST/RequirementMachine/RequirementLowering.cpp index 46319d3c338f3..a446a6d491fb3 100644 --- a/lib/AST/RequirementMachine/RequirementLowering.cpp +++ b/lib/AST/RequirementMachine/RequirementLowering.cpp @@ -856,7 +856,7 @@ void swift::rewriting::applyInverses( continue; } - auto state = inverses.getOrInsertDefault(canSubject); + auto &state = inverses[canSubject]; // Check if this inverse has already been seen. auto inverseKind = inverse.getKind(); @@ -864,7 +864,6 @@ void swift::rewriting::applyInverses( continue; state.insert(inverseKind); - inverses[canSubject] = state; } // Fast-path: if there are no valid inverses, then there are no requirements diff --git a/lib/SILOptimizer/Analysis/ColdBlockInfo.cpp b/lib/SILOptimizer/Analysis/ColdBlockInfo.cpp index f42fe7b60d449..9fde5f1ea0431 100644 --- a/lib/SILOptimizer/Analysis/ColdBlockInfo.cpp +++ b/lib/SILOptimizer/Analysis/ColdBlockInfo.cpp @@ -441,7 +441,7 @@ bool ColdBlockInfo::isCold(const SILBasicBlock *BB) const { } void ColdBlockInfo::resetToCold(const SILBasicBlock *BB) { - auto &entry = EnergyMap.getOrInsertDefault(BB); + auto &entry = EnergyMap[BB]; if (isColdEnergy(entry)) return; @@ -451,7 +451,7 @@ void ColdBlockInfo::resetToCold(const SILBasicBlock *BB) { } void ColdBlockInfo::set(const SILBasicBlock *BB, State::Temperature temp) { - auto &entry = EnergyMap.getOrInsertDefault(BB); + auto &entry = EnergyMap[BB]; if (entry.contains(temp)) return; From b301dfe2636d80b4b582bc5809e9d76ec8c5a7c9 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 22:12:48 +0100 Subject: [PATCH 008/100] Basic: Rename symbol in bitfield macro to not collide with Clang Per 131acb07d814fabcc969dcaa63f4f352cd529267 (llvm-project). --- include/swift/AST/Expr.h | 8 ++++---- include/swift/Basic/InlineBitfield.h | 18 +++++++++--------- include/swift/SIL/MemAccessUtils.h | 20 +++++++++----------- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/include/swift/AST/Expr.h b/include/swift/AST/Expr.h index 2d052da7ce819..7da99d35fef2c 100644 --- a/include/swift/AST/Expr.h +++ b/include/swift/AST/Expr.h @@ -154,12 +154,12 @@ class alignas(8) Expr : public ASTAllocated { Implicit : 1 ); - SWIFT_INLINE_BITFIELD_FULL(CollectionExpr, Expr, 64-NumExprBits, + SWIFT_INLINE_BITFIELD_FULL(CollectionExpr, Expr, 64-NumberOfExprBits, /// True if the type of this collection expr was inferred by the collection /// fallback type, like [Any]. IsTypeDefaulted : 1, /// Number of comma source locations. - NumCommas : 32 - 1 - NumExprBits, + NumCommas : 32 - 1 - NumberOfExprBits, /// Number of entries in the collection. If this is a DictionaryExpr, /// each entry is a Tuple with the key and value pair. NumSubExprs : 32 @@ -256,8 +256,8 @@ class alignas(8) Expr : public ASTAllocated { LitKind : 3 ); - SWIFT_INLINE_BITFIELD(AbstractClosureExpr, Expr, (16-NumExprBits)+16, - : 16 - NumExprBits, // Align and leave room for subclasses + SWIFT_INLINE_BITFIELD(AbstractClosureExpr, Expr, (16-NumberOfExprBits)+16, + : 16 - NumberOfExprBits, // Align and leave room for subclasses Discriminator : 16 ); diff --git a/include/swift/Basic/InlineBitfield.h b/include/swift/Basic/InlineBitfield.h index b41ae018d4edf..1378115aee012 100644 --- a/include/swift/Basic/InlineBitfield.h +++ b/include/swift/Basic/InlineBitfield.h @@ -41,7 +41,7 @@ namespace swift { uint64_t : 64 - (C); /* Better code gen */ \ } T; \ LLVM_PACKED_END \ - enum { Num##T##Bits = (C) }; \ + enum { NumberOf##T##Bits = (C) }; \ static_assert(sizeof(T##Bitfield) <= 8, "Bitfield overflow") /// Define an bitfield for type 'T' with parent class 'U' and 'C' bits used. @@ -49,11 +49,11 @@ namespace swift { LLVM_PACKED_START \ class T##Bitfield { \ friend class T; \ - uint64_t : Num##U##Bits, __VA_ARGS__; \ - uint64_t : 64 - (Num##U##Bits + (HC) + (C)); /* Better code gen */ \ + uint64_t : NumberOf##U##Bits, __VA_ARGS__; \ + uint64_t : 64 - (NumberOf##U##Bits + (HC) + (C)); /* Better code gen */ \ } T; \ LLVM_PACKED_END \ - enum { Num##T##Bits = Num##U##Bits + (C) }; \ + enum { NumberOf##T##Bits = NumberOf##U##Bits + (C) }; \ static_assert(sizeof(T##Bitfield) <= 8, "Bitfield overflow") #define SWIFT_INLINE_BITFIELD(T, U, C, ...) \ @@ -75,8 +75,8 @@ namespace swift { LLVM_PACKED_START \ class T##Bitfield { \ friend class T; \ - enum { NumPadBits = 64 - (Num##U##Bits + (C)) }; \ - uint64_t : Num##U##Bits, __VA_ARGS__; \ + enum { NumPadBits = 64 - (NumberOf##U##Bits + (C)) }; \ + uint64_t : NumberOf##U##Bits, __VA_ARGS__; \ } T; \ LLVM_PACKED_END \ static_assert(sizeof(T##Bitfield) <= 8, "Bitfield overflow") @@ -101,15 +101,15 @@ namespace swift { class T##Bitfield { \ template \ friend class T; \ - enum { NumPadBits = 64 - (Num##U##Bits + (C)) }; \ - uint64_t : Num##U##Bits, __VA_ARGS__; \ + enum { NumPadBits = 64 - (NumberOf##U##Bits + (C)) }; \ + uint64_t : NumberOf##U##Bits, __VA_ARGS__; \ } T; \ LLVM_PACKED_END \ static_assert(sizeof(T##Bitfield) <= 8, "Bitfield overflow") /// Define an empty bitfield for type 'T'. #define SWIFT_INLINE_BITFIELD_EMPTY(T, U) \ - enum { Num##T##Bits = Num##U##Bits } + enum { NumberOf##T##Bits = NumberOf##U##Bits } // XXX/HACK: templated max() doesn't seem to work in a bitfield size context. constexpr unsigned bitmax(unsigned a, unsigned b) { diff --git a/include/swift/SIL/MemAccessUtils.h b/include/swift/SIL/MemAccessUtils.h index 07a0002e37559..b16f5a21f02af 100644 --- a/include/swift/SIL/MemAccessUtils.h +++ b/include/swift/SIL/MemAccessUtils.h @@ -375,12 +375,12 @@ class AccessRepresentation { // Define bits for use in AccessStorageAnalysis. Each identified storage // object is mapped to one instance of this subclass. SWIFT_INLINE_BITFIELD_FULL(StorageAccessInfo, AccessRepresentation, - 64 - NumAccessRepresentationBits, + 64 - NumberOfAccessRepresentationBits, accessKind : NumSILAccessKindBits, noNestedConflict : 1, - storageIndex : 64 - (NumAccessRepresentationBits - + NumSILAccessKindBits - + 1)); + storageIndex : 64 - + (NumberOfAccessRepresentationBits + + NumSILAccessKindBits + 1)); // Define bits for use in the AccessEnforcementOpts pass. Each begin_access // in the function is mapped to one instance of this subclass. Reserve a @@ -390,13 +390,11 @@ class AccessRepresentation { // // `AccessRepresentation` refers to the AccessRepresentationBitfield defined // above, setting aside enough bits for common data. - SWIFT_INLINE_BITFIELD_FULL(AccessEnforcementOptsInfo, - AccessRepresentation, - 64 - NumAccessRepresentationBits, - seenNestedConflict : 1, - seenIdenticalStorage : 1, - beginAccessIndex : - 62 - NumAccessRepresentationBits); + SWIFT_INLINE_BITFIELD_FULL(AccessEnforcementOptsInfo, AccessRepresentation, + 64 - NumberOfAccessRepresentationBits, + seenNestedConflict : 1, seenIdenticalStorage : 1, + beginAccessIndex : 62 - + NumberOfAccessRepresentationBits); // Define data flow bits for use in the AccessEnforcementDom pass. Each // begin_access in the function is mapped to one instance of this subclass. From 661d087b281d23f751d55802cf7d9b7deca9a6c1 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 23:03:44 +0100 Subject: [PATCH 009/100] AST: Refactor use of obsoleted `llvm::Intrinsic::lookupLLVMIntrinsicByName` Per f0297ae552e1e5aacafc1ed43968041994dc8a6e (llvm-project). --- lib/AST/Builtins.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/lib/AST/Builtins.cpp b/lib/AST/Builtins.cpp index 3b6c17bebbc76..da15f06f3fc74 100644 --- a/lib/AST/Builtins.cpp +++ b/lib/AST/Builtins.cpp @@ -2343,18 +2343,6 @@ bool swift::canBuiltinBeOverloadedForType(BuiltinValueKind ID, Type Ty) { return isBuiltinTypeOverloaded(Ty, OverloadedBuiltinKinds[unsigned(ID)]); } -/// Table of string intrinsic names indexed by enum value. -static const char *const IntrinsicNameTable[] = { - "not_intrinsic", -#define GET_INTRINSIC_NAME_TABLE -#include "llvm/IR/IntrinsicImpl.inc" -#undef GET_INTRINSIC_NAME_TABLE -}; - -#define GET_INTRINSIC_TARGET_DATA -#include "llvm/IR/IntrinsicImpl.inc" -#undef GET_INTRINSIC_TARGET_DATA - llvm::Intrinsic::ID swift::getLLVMIntrinsicID(StringRef InName) { using namespace llvm; @@ -2370,10 +2358,8 @@ llvm::Intrinsic::ID swift::getLLVMIntrinsicID(StringRef InName) { NameS.push_back(C == '_' ? '.' : C); const char *Name = NameS.c_str(); - ArrayRef NameTable(&IntrinsicNameTable[1], - TargetInfos[1].Offset); - int Idx = Intrinsic::lookupLLVMIntrinsicByName(NameTable, Name); - return static_cast(Idx + 1); + + return Intrinsic::lookupIntrinsicID(Name); } llvm::Intrinsic::ID From 81d194abaf9a0cc193b38926c9888f0dad346104 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 23:05:55 +0100 Subject: [PATCH 010/100] AST: Conservatively handle new `llvm::Intrinsic::IITDescriptor::IITDescriptorKind` enum cases Per 5a1e16f6de26c21cdfae1de05bd075d57029a3e1 (llvm-project). --- lib/AST/Builtins.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/AST/Builtins.cpp b/lib/AST/Builtins.cpp index da15f06f3fc74..12a2bd26fe688 100644 --- a/lib/AST/Builtins.cpp +++ b/lib/AST/Builtins.cpp @@ -2454,6 +2454,9 @@ Type IntrinsicTypeDecoder::decodeImmediate() { case IITDescriptor::Subdivide4Argument: case IITDescriptor::PPCQuad: case IITDescriptor::AArch64Svcount: + case IITDescriptor::OneThirdVecArgument: + case IITDescriptor::OneFifthVecArgument: + case IITDescriptor::OneSeventhVecArgument: // These types cannot be expressed in swift yet. return Type(); From 547a8910c27416e21935f0fcd19965529eed1dc7 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 23:29:55 +0100 Subject: [PATCH 011/100] AST, ClangImporter, IRGen: Conservatively handle new HLSL `clang::BuiltinType::Kind` enum case Per 52956b0f705499ae4a268d3629b402ecdc2cbbab (llvm-project). --- lib/AST/ClangTypeConverter.cpp | 4 ++++ lib/ClangImporter/ClangAdapter.cpp | 5 +++++ lib/ClangImporter/ImportType.cpp | 4 ++++ lib/IRGen/GenCall.cpp | 5 +++++ 4 files changed, 18 insertions(+) diff --git a/lib/AST/ClangTypeConverter.cpp b/lib/AST/ClangTypeConverter.cpp index 1b1848da354b0..7981fddfd6ebf 100644 --- a/lib/AST/ClangTypeConverter.cpp +++ b/lib/AST/ClangTypeConverter.cpp @@ -87,6 +87,10 @@ getClangBuiltinTypeFromKind(const clang::ASTContext &context, case clang::BuiltinType::Id: \ return context.SingletonId; #include "clang/Basic/AMDGPUTypes.def" +#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) \ + case clang::BuiltinType::Id: \ + return context.SingletonId; +#include "clang/Basic/HLSLIntangibleTypes.def" } // Not a valid BuiltinType. diff --git a/lib/ClangImporter/ClangAdapter.cpp b/lib/ClangImporter/ClangAdapter.cpp index f832a5af21f05..691eef5ae1d43 100644 --- a/lib/ClangImporter/ClangAdapter.cpp +++ b/lib/ClangImporter/ClangAdapter.cpp @@ -450,6 +450,11 @@ OmissionTypeName importer::getClangTypeNameForOmission(clang::ASTContext &ctx, #define AMDGPU_TYPE(Name, Id, ...) case clang::BuiltinType::Id: #include "clang/Basic/AMDGPUTypes.def" return OmissionTypeName(); + + // HLSL intangible builtin types that don't have Swift equivalents. +#define HLSL_INTANGIBLE_TYPE(Name, Id, ...) case clang::BuiltinType::Id: +#include "clang/Basic/HLSLIntangibleTypes.def" + return OmissionTypeName(); } } diff --git a/lib/ClangImporter/ImportType.cpp b/lib/ClangImporter/ImportType.cpp index 89921480a0a6a..58adbd18c9582 100644 --- a/lib/ClangImporter/ImportType.cpp +++ b/lib/ClangImporter/ImportType.cpp @@ -372,6 +372,10 @@ namespace { #include "clang/Basic/AMDGPUTypes.def" return Type(); + // HLSL intangible builtin types that don't have Swift equivalents. +#define HLSL_INTANGIBLE_TYPE(Name, Id, ...) case clang::BuiltinType::Id: +#include "clang/Basic/HLSLIntangibleTypes.def" + return Type(); } llvm_unreachable("Invalid BuiltinType."); diff --git a/lib/IRGen/GenCall.cpp b/lib/IRGen/GenCall.cpp index be7ada6d0ee73..eb046de34f752 100644 --- a/lib/IRGen/GenCall.cpp +++ b/lib/IRGen/GenCall.cpp @@ -1343,6 +1343,11 @@ namespace { #include "clang/Basic/AMDGPUTypes.def" llvm_unreachable("AMDGPU type in ABI lowering"); + // We should never see HLSL intangible types at all. +#define HLSL_INTANGIBLE_TYPE(Name, Id, ...) case clang::BuiltinType::Id: +#include "clang/Basic/HLSLIntangibleTypes.def" + llvm_unreachable("HLSL intangible type in ABI lowering"); + // Handle all the integer types as opaque values. #define BUILTIN_TYPE(Id, SingletonId) #define SIGNED_TYPE(Id, SingletonId) \ From 51648473af0fc71072ef63fdd1d910868f06a6e5 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 17 Apr 2025 23:31:46 +0100 Subject: [PATCH 012/100] AST, ClangImporter: Fix `AMDGPU_TYPE` clang macro definitions Per fe61dbf1d3350d11ab975e45f805f3bfe885b8b7 (llvm-project). --- lib/AST/ClangTypeConverter.cpp | 2 +- lib/ClangImporter/ImportType.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/AST/ClangTypeConverter.cpp b/lib/AST/ClangTypeConverter.cpp index 7981fddfd6ebf..c47d498dfe409 100644 --- a/lib/AST/ClangTypeConverter.cpp +++ b/lib/AST/ClangTypeConverter.cpp @@ -83,7 +83,7 @@ getClangBuiltinTypeFromKind(const clang::ASTContext &context, case clang::BuiltinType::Id: \ return context.SingletonId; #include "clang/Basic/WebAssemblyReferenceTypes.def" -#define AMDGPU_TYPE(Name, Id, SingletonId) \ +#define AMDGPU_TYPE(Name, Id, SingletonId, Width, Align) \ case clang::BuiltinType::Id: \ return context.SingletonId; #include "clang/Basic/AMDGPUTypes.def" diff --git a/lib/ClangImporter/ImportType.cpp b/lib/ClangImporter/ImportType.cpp index 58adbd18c9582..b1646367f6683 100644 --- a/lib/ClangImporter/ImportType.cpp +++ b/lib/ClangImporter/ImportType.cpp @@ -368,7 +368,8 @@ namespace { return Type(); // AMDGPU builtin types that don't have Swift equivalents. -#define AMDGPU_TYPE(Name, Id, SingletonId) case clang::BuiltinType::Id: +#define AMDGPU_TYPE(Name, Id, SingletonId, Width, Align) \ + case clang::BuiltinType::Id: #include "clang/Basic/AMDGPUTypes.def" return Type(); From 8d7066b6be6b6865661cdb522387838d33137602 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Fri, 18 Apr 2025 14:58:14 +0100 Subject: [PATCH 013/100] ClangImporter: Conservatively handle new `clang::TargetInfo::BuiltinVaListKind` enum case Per 2d6e7c2b359d4cafca8eaca4c9ed308a3a8fa6c1 (llvm-project). --- lib/ClangImporter/ImportDecl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ClangImporter/ImportDecl.cpp b/lib/ClangImporter/ImportDecl.cpp index 2b33b78852599..a51ed15d43f56 100644 --- a/lib/ClangImporter/ImportDecl.cpp +++ b/lib/ClangImporter/ImportDecl.cpp @@ -380,6 +380,7 @@ getSwiftStdlibType(const clang::TypedefNameDecl *D, case clang::TargetInfo::PNaClABIBuiltinVaList: case clang::TargetInfo::SystemZBuiltinVaList: case clang::TargetInfo::X86_64ABIBuiltinVaList: + case clang::TargetInfo::XtensaABIBuiltinVaList: return std::make_pair(Type(), ""); } break; From 17d4c1991a9b6d89973b01552ed6574c1c616f54 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Fri, 18 Apr 2025 15:15:01 +0100 Subject: [PATCH 014/100] ClangImporter: Conservatively adjust uses of some Clang APIs (parameter added) Per 08bda1cc6b0d2f1d31a89a76b5c154a11086c420 (llvm-project). --- lib/ClangImporter/ClangImporter.cpp | 3 ++- lib/ClangImporter/ImportDecl.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index 564dfbbdbf1fb..e25679a4cfcdd 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -7149,7 +7149,8 @@ ClangImporter::instantiateCXXClassTemplate( ctsd = clang::ClassTemplateSpecializationDecl::Create( decl->getASTContext(), decl->getTemplatedDecl()->getTagKind(), decl->getDeclContext(), decl->getTemplatedDecl()->getBeginLoc(), - decl->getLocation(), decl, arguments, nullptr); + decl->getLocation(), decl, arguments, /*StrictPackMatch*/ false, + nullptr); decl->AddSpecialization(ctsd, InsertPos); } diff --git a/lib/ClangImporter/ImportDecl.cpp b/lib/ClangImporter/ImportDecl.cpp index a51ed15d43f56..544edd9071be5 100644 --- a/lib/ClangImporter/ImportDecl.cpp +++ b/lib/ClangImporter/ImportDecl.cpp @@ -3302,7 +3302,7 @@ namespace { decl->getLocation(), const_cast(decl), clang::TemplateSpecializationKind::TSK_ImplicitInstantiation, - /*Complain*/ false); + /*Complain*/ false, /*PrimaryStrictPackMatch*/ false); // If the template can't be instantiated, bail. if (notInstantiated) return nullptr; From 5e0912508c98fa0b3d1b000cd3bed7d95681079a Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Fri, 18 Apr 2025 15:37:42 +0100 Subject: [PATCH 015/100] ClangImporter: Adjust use of `clang::tooling::dependencies::ModuleDeps::CASFileSystemRootID` (type changed) Per c3f10e5f166bb10afc091f21f549f0b1047701d0 (llvm-project). --- lib/ClangImporter/ClangModuleDependencyScanner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ClangImporter/ClangModuleDependencyScanner.cpp b/lib/ClangImporter/ClangModuleDependencyScanner.cpp index 650473f7e5299..13a1a0913dcaf 100644 --- a/lib/ClangImporter/ClangModuleDependencyScanner.cpp +++ b/lib/ClangImporter/ClangModuleDependencyScanner.cpp @@ -256,7 +256,7 @@ ModuleDependencyVector ClangImporter::bridgeClangModuleDependencies( // CASFileSystemRootID. std::string RootID = clangModuleDep.CASFileSystemRootID - ? clangModuleDep.CASFileSystemRootID->toString() + ? clangModuleDep.CASFileSystemRootID.value() : ""; std::string IncludeTree = From 36b92178dbbf5bfb9c8bc000db30c8b13a5d2e04 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Fri, 18 Apr 2025 19:28:31 +0100 Subject: [PATCH 016/100] ClangImporter, Index: Refactor uses of obsoleted `clang::FileManager::getFile` Per 99b1a2ac078fe52300d270b3e77ddbababa8f951 (llvm-project). --- lib/ClangImporter/ClangImporter.cpp | 14 +++++++------- lib/Index/IndexRecord.cpp | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index e25679a4cfcdd..973630a3cf548 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -1815,14 +1815,14 @@ bool ClangImporter::importHeader(StringRef header, ModuleDecl *adapter, off_t expectedSize, time_t expectedModTime, StringRef cachedContents, SourceLoc diagLoc) { clang::FileManager &fileManager = Impl.Instance->getFileManager(); - auto headerFile = fileManager.getFile(header, /*OpenFile=*/true); + auto headerFile = fileManager.getOptionalFileRef(header, /*OpenFile=*/true); // Prefer importing the header directly if the header content matches by // checking size and mod time. This allows correct import if some no-modular // headers are already imported into clang importer. If mod time is zero, then // the module should be built from CAS and there is no mod time to verify. - if (headerFile && (*headerFile)->getSize() == expectedSize && + if (headerFile && headerFile->getSize() == expectedSize && (expectedModTime == 0 || - (*headerFile)->getModificationTime() == expectedModTime)) { + headerFile->getModificationTime() == expectedModTime)) { return importBridgingHeader(header, adapter, diagLoc, false, true); } @@ -1849,7 +1849,7 @@ bool ClangImporter::importBridgingHeader(StringRef header, ModuleDecl *adapter, } clang::FileManager &fileManager = Impl.Instance->getFileManager(); - auto headerFile = fileManager.getFile(header, /*OpenFile=*/true); + auto headerFile = fileManager.getOptionalFileRef(header, /*OpenFile=*/true); if (!headerFile) { Impl.diagnose(diagLoc, diag::bridging_header_missing, header); return true; @@ -1998,9 +1998,9 @@ std::string ClangImporter::getBridgingHeaderContents( return ""; } - if (auto fileInfo = fileManager.getFile(headerPath)) { - fileSize = (*fileInfo)->getSize(); - fileModTime = (*fileInfo)->getModificationTime(); + if (auto fileInfo = fileManager.getOptionalFileRef(headerPath)) { + fileSize = fileInfo->getSize(); + fileModTime = fileInfo->getModificationTime(); } return result; } diff --git a/lib/Index/IndexRecord.cpp b/lib/Index/IndexRecord.cpp index 559cfb72546b0..93b1059a20b67 100644 --- a/lib/Index/IndexRecord.cpp +++ b/lib/Index/IndexRecord.cpp @@ -602,7 +602,7 @@ static void emitTransitiveClangSymbolicInterfacesForSwiftModuleImports( case FileUnitKind::DWARFModule: case FileUnitKind::ClangModule: { auto *LFU = cast(FU); - if (auto F = fileMgr.getFile(LFU->getFilename())) { + if (fileMgr.getOptionalFileRef(LFU->getFilename())) { if (FU->getKind() == FileUnitKind::ClangModule) { auto clangModUnit = cast(LFU); if (auto clangMod = clangModUnit->getUnderlyingClangModule()) { From c8ea55c1004a746ab9455350abf1864d3f348b86 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Fri, 18 Apr 2025 23:33:56 +0100 Subject: [PATCH 017/100] ClangImporter, IDETool: Conservatively adjust uses of `clang::CompilerInstance::createDiagnostics` (parameter added) Per df9a14d7bbf1180e4f1474254c9d7ed6bcb4ce55 (llvm-project). --- lib/ClangImporter/ClangImporter.cpp | 22 ++++++++++++---------- lib/ClangImporter/ClangIncludePaths.cpp | 2 +- lib/IDETool/CompilerInvocation.cpp | 6 ++++-- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index 973630a3cf548..788372c64fa52 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -977,8 +977,8 @@ bool ClangImporter::canReadPCH(StringRef PCHFilename) { CI.setInvocation(std::move(invocation)); CI.setTarget(&Impl.Instance->getTarget()); - CI.setDiagnostics( - &*clang::CompilerInstance::createDiagnostics(new clang::DiagnosticOptions())); + CI.setDiagnostics(&*clang::CompilerInstance::createDiagnostics( + Impl.Instance->getVirtualFileSystem(), new clang::DiagnosticOptions())); // Note: Reusing the file manager is safe; this is a component that's already // reused when building PCM files for the module cache. @@ -1155,7 +1155,7 @@ std::optional> ClangImporter::getClangCC1Arguments( new ClangDiagnosticConsumer(Impl, *tempDiagOpts, ctx.ClangImporterOpts.DumpClangDiagnostics); auto clangDiags = clang::CompilerInstance::createDiagnostics( - tempDiagOpts.get(), tempDiagClient, + *VFS, tempDiagOpts.get(), tempDiagClient, /*owned*/ true); // If using direct cc1 module build, use extra args to setup ClangImporter. @@ -1430,7 +1430,7 @@ ClangImporter::create(ASTContext &ctx, auto actualDiagClient = std::make_unique( importer->Impl, instance.getDiagnosticOpts(), importerOpts.DumpClangDiagnostics); - instance.createDiagnostics(actualDiagClient.release()); + instance.createDiagnostics(*VFS, actualDiagClient.release()); } // Set up the file manager. @@ -1942,13 +1942,14 @@ std::string ClangImporter::getBridgingHeaderContents( invocation->getPreprocessorOpts().resetNonModularOptions(); + clang::FileManager &fileManager = Impl.Instance->getFileManager(); + clang::CompilerInstance rewriteInstance( Impl.Instance->getPCHContainerOperations(), &Impl.Instance->getModuleCache()); rewriteInstance.setInvocation(invocation); - rewriteInstance.createDiagnostics(new clang::IgnoringDiagConsumer); - - clang::FileManager &fileManager = Impl.Instance->getFileManager(); + rewriteInstance.createDiagnostics(fileManager.getVirtualFileSystem(), + new clang::IgnoringDiagConsumer); rewriteInstance.setFileManager(&fileManager); rewriteInstance.createSourceManager(fileManager); rewriteInstance.setTarget(&Impl.Instance->getTarget()); @@ -2047,14 +2048,15 @@ ClangImporter::cloneCompilerInstanceForPrecompiling() { // Share the CASOption and the underlying CAS. invocation->setCASOption(Impl.Invocation->getCASOptsPtr()); + clang::FileManager &fileManager = Impl.Instance->getFileManager(); + auto clonedInstance = std::make_unique( Impl.Instance->getPCHContainerOperations(), &Impl.Instance->getModuleCache()); clonedInstance->setInvocation(std::move(invocation)); - clonedInstance->createDiagnostics(&Impl.Instance->getDiagnosticClient(), + clonedInstance->createDiagnostics(fileManager.getVirtualFileSystem(), + &Impl.Instance->getDiagnosticClient(), /*ShouldOwnClient=*/false); - - clang::FileManager &fileManager = Impl.Instance->getFileManager(); clonedInstance->setFileManager(&fileManager); clonedInstance->createSourceManager(fileManager); clonedInstance->setTarget(&Impl.Instance->getTarget()); diff --git a/lib/ClangImporter/ClangIncludePaths.cpp b/lib/ClangImporter/ClangIncludePaths.cpp index d2185fd152ded..82bdb353fa777 100644 --- a/lib/ClangImporter/ClangIncludePaths.cpp +++ b/lib/ClangImporter/ClangIncludePaths.cpp @@ -129,7 +129,7 @@ ClangImporter::createClangDriver( llvm::IntrusiveRefCntPtr vfs) { auto *silentDiagConsumer = new clang::DiagnosticConsumer(); auto clangDiags = clang::CompilerInstance::createDiagnostics( - new clang::DiagnosticOptions(), silentDiagConsumer); + *vfs, new clang::DiagnosticOptions(), silentDiagConsumer); clang::driver::Driver clangDriver(ClangImporterOpts.clangPath, LangOpts.Target.str(), *clangDiags, "clang LLVM compiler", vfs); diff --git a/lib/IDETool/CompilerInvocation.cpp b/lib/IDETool/CompilerInvocation.cpp index da49990804c78..986fb92a2f564 100644 --- a/lib/IDETool/CompilerInvocation.cpp +++ b/lib/IDETool/CompilerInvocation.cpp @@ -276,9 +276,11 @@ bool ide::initInvocationByClangArguments(ArrayRef ArgList, new clang::DiagnosticOptions() }; + const auto VFS = llvm::vfs::getRealFileSystem(); + clang::TextDiagnosticBuffer DiagBuf; llvm::IntrusiveRefCntPtr ClangDiags = - clang::CompilerInstance::createDiagnostics(DiagOpts.get(), &DiagBuf, + clang::CompilerInstance::createDiagnostics(*VFS, DiagOpts.get(), &DiagBuf, /*ShouldOwnClient=*/false); // Clang expects this to be like an actual command line. So we need to pass in @@ -356,7 +358,7 @@ bool ide::initInvocationByClangArguments(ArrayRef ArgList, if (!PPOpts.ImplicitPCHInclude.empty()) { clang::FileSystemOptions FileSysOpts; - clang::FileManager FileMgr(FileSysOpts); + clang::FileManager FileMgr(FileSysOpts, VFS); auto PCHContainerOperations = std::make_shared(); std::string HeaderFile = clang::ASTReader::getOriginalSourceFile( From 3eda91e51190146abd95b5adc61b33ecafe30be3 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 05:40:33 +0100 Subject: [PATCH 018/100] ClangImporter, IRGen: Conservatively handle new `clang::HLSLAttributedResourceType` Per e00e9a3f8294c9b96cb0328bf136fab72aeec749 (llvm-project). --- lib/ClangImporter/ImportType.cpp | 10 ++++++++++ lib/IRGen/GenCall.cpp | 1 + 2 files changed, 11 insertions(+) diff --git a/lib/ClangImporter/ImportType.cpp b/lib/ClangImporter/ImportType.cpp index b1646367f6683..e6b65bf1431ac 100644 --- a/lib/ClangImporter/ImportType.cpp +++ b/lib/ClangImporter/ImportType.cpp @@ -422,6 +422,16 @@ namespace { return Type(); } + ImportResult VisitHLSLAttributedResourceType( + const clang::HLSLAttributedResourceType *type) { + Impl.addImportDiagnostic( + type, + Diagnostic(diag::unsupported_builtin_type, type->getTypeClassName()), + clang::SourceLocation()); + // FIXME: (?) HLSL types are not supported in Swift. + return Type(); + } + ImportResult VisitCountAttributedType(const clang::CountAttributedType *type) { return Visit(type->desugar()); diff --git a/lib/IRGen/GenCall.cpp b/lib/IRGen/GenCall.cpp index eb046de34f752..ad39c5d4bae2b 100644 --- a/lib/IRGen/GenCall.cpp +++ b/lib/IRGen/GenCall.cpp @@ -1213,6 +1213,7 @@ namespace { } case clang::Type::ArrayParameter: + case clang::Type::HLSLAttributedResource: llvm_unreachable("HLSL type in ABI lowering"); From 124608b481bed2aa075937b0c9215047b5f9bd6c Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 05:48:43 +0100 Subject: [PATCH 019/100] IRGen: Conservatively handle new HLSL `clang::ParameterABI` enum cases Per 89fb8490a99e612f7a574e8678b21a90f689f5b4 (llvm-project). --- lib/IRGen/GenCall.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/IRGen/GenCall.cpp b/lib/IRGen/GenCall.cpp index ad39c5d4bae2b..56ba198bc3371 100644 --- a/lib/IRGen/GenCall.cpp +++ b/lib/IRGen/GenCall.cpp @@ -1690,6 +1690,9 @@ void SignatureExpansion::expandExternalSignatureTypes() { paramTI.getStorageType(), paramTI); break; } + case clang::ParameterABI::HLSLOut: + case clang::ParameterABI::HLSLInOut: + llvm_unreachable("not implemented"); } // If the coercion type is a struct which can be flattened, we need to From a090bfed1babdb7aa8ab1d017e0f14b3f99c5b9c Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 06:14:45 +0100 Subject: [PATCH 020/100] ClangImporter: Refactor call to obsoleted `clang::ASTWriter::getMacroID` Per 5d62a79bb79fee20f92f26dc55fd78440b9945ca (llvm-project). --- lib/ClangImporter/SwiftLookupTable.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ClangImporter/SwiftLookupTable.cpp b/lib/ClangImporter/SwiftLookupTable.cpp index a367e6c487723..a5fd89a07329f 100644 --- a/lib/ClangImporter/SwiftLookupTable.cpp +++ b/lib/ClangImporter/SwiftLookupTable.cpp @@ -1107,7 +1107,8 @@ namespace { ids = StoredSingleEntry::forSerializedDecl( astWriter.getDeclID(decl).getRawValue()); } else if (auto *macro = mappedEntry.dyn_cast()) { - ids = StoredSingleEntry::forSerializedMacro(astWriter.getMacroID(macro)); + ids = StoredSingleEntry::forSerializedMacro( + astWriter.getMacroRef(macro, /*Name=*/nullptr)); } else { auto *moduleMacro = mappedEntry.get(); StoredSingleEntry::SerializationID nameID = From 5996a95c21149f0dab5840c452bb04d35bfa489c Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 06:46:59 +0100 Subject: [PATCH 021/100] IRGen: Adjust uses of `clang::FieldDecl::getBitWidthValue` (parameter removed) Per cfe26358e3051755961fb1f3b46328dc2c326895 (llvm-project). --- lib/IRGen/GenStruct.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/IRGen/GenStruct.cpp b/lib/IRGen/GenStruct.cpp index f6b6647cfc6aa..2d1589f9c38da 100644 --- a/lib/IRGen/GenStruct.cpp +++ b/lib/IRGen/GenStruct.cpp @@ -1396,7 +1396,7 @@ class ClangRecordLowering { // Collect all of the following bitfields. unsigned bitStart = layout.getFieldOffset(clangField->getFieldIndex()); - unsigned bitEnd = bitStart + clangField->getBitWidthValue(ClangContext); + unsigned bitEnd = bitStart + clangField->getBitWidthValue(); while (cfi != cfe && (*cfi)->isBitField()) { clangField = *cfi++; @@ -1412,7 +1412,7 @@ class ClangRecordLowering { bitStart = nextStart; } - bitEnd = nextStart + clangField->getBitWidthValue(ClangContext); + bitEnd = nextStart + clangField->getBitWidthValue(); } addOpaqueBitField(bitStart, bitEnd); From 66a6df9a4445434bf54faf6d2c845bbc6d82e270 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 07:12:47 +0100 Subject: [PATCH 022/100] IRGen: Conservatively adjust use of `llvm::DIBuilder::createObjectPointerType` (parameter added) Per a5fb2bbb2ad8488482843e2298fbe6f6a1d45bbd (llvm-project). --- lib/IRGen/IRGenDebugInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index 7dbfeca194219..da8089ba56fec 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -1942,7 +1942,7 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo { nullptr, PtrSize, 0, /* DWARFAddressSpace */ std::nullopt, MangledName); - return DBuilder.createObjectPointerType(PTy); + return DBuilder.createObjectPointerType(PTy, /*Implicit=*/false); } case TypeKind::BuiltinExecutor: { return createDoublePointerSizedStruct( From f0236c262f3692a7d216e8f265722613ccebb716 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 07:27:38 +0100 Subject: [PATCH 023/100] DriverTool, IRGen: Adjust uses of `llvm::Module::setTargetTriple` (parameter type changed) Per 979c275097a642e9b96c6b0a12f013c831af3a6e (llvm-project). --- lib/DriverTool/swift_llvm_opt_main.cpp | 3 ++- lib/IRGen/IRGen.cpp | 4 ++-- lib/IRGen/IRGenModule.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/DriverTool/swift_llvm_opt_main.cpp b/lib/DriverTool/swift_llvm_opt_main.cpp index 00b97178dee56..37b757b82a0fb 100644 --- a/lib/DriverTool/swift_llvm_opt_main.cpp +++ b/lib/DriverTool/swift_llvm_opt_main.cpp @@ -174,7 +174,8 @@ int swift_llvm_opt_main(ArrayRef argv, void *MainAddr) { // If we are supposed to override the target triple, do so now. if (!options.TargetTriple.empty()) - M->setTargetTriple(llvm::Triple::normalize(options.TargetTriple)); + M->setTargetTriple( + llvm::Triple(llvm::Triple::normalize(options.TargetTriple))); // Figure out what stream we are supposed to write to... std::unique_ptr Out; diff --git a/lib/IRGen/IRGen.cpp b/lib/IRGen/IRGen.cpp index 35b9dba2614cc..723725a29f7e7 100644 --- a/lib/IRGen/IRGen.cpp +++ b/lib/IRGen/IRGen.cpp @@ -1169,8 +1169,8 @@ static void embedBitcode(llvm::Module *M, const IRGenOptions &Opts) static void initLLVMModule(const IRGenModule &IGM, SILModule &SIL) { auto *Module = IGM.getModule(); assert(Module && "Expected llvm:Module for IR generation!"); - - Module->setTargetTriple(IGM.Triple.str()); + + Module->setTargetTriple(IGM.Triple); if (IGM.Context.LangOpts.SDKVersion) { if (Module->getSDKVersion().empty()) diff --git a/lib/IRGen/IRGenModule.cpp b/lib/IRGen/IRGenModule.cpp index 5a00d2ecbb492..c0078f2024b27 100644 --- a/lib/IRGen/IRGenModule.cpp +++ b/lib/IRGen/IRGenModule.cpp @@ -2438,7 +2438,7 @@ bool swift::writeEmptyOutputFilesFor( auto *clangImporter = static_cast( Context.getClangModuleLoader()); llvmModule->setTargetTriple( - clangImporter->getTargetInfo().getTargetOpts().Triple); + llvm::Triple(clangImporter->getTargetInfo().getTargetOpts().Triple)); // Add LLVM module flags. auto &clangASTContext = clangImporter->getClangASTContext(); From 4e972c0e75906f3f03dfacdaffbe87941dc8e547 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 08:07:43 +0100 Subject: [PATCH 024/100] IRGen: Adjust uses of `llvm::BasicBlock::getFirstNonPHIOrDbg` (return type changed) Per 81d18ad86419fc612c7071e888d11aa923eaeb8a (llvm-project). --- lib/IRGen/IRGenDebugInfo.cpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index da8089ba56fec..b872a8d859726 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -3853,19 +3853,23 @@ void IRGenDebugInfoImpl::emitDbgIntrinsic( } // Insert a dbg.value at the current insertion point. - if (isa(Storage) && !Var->getArg() && - ParentBlock->getFirstNonPHIOrDbg()) - // SelectionDAGISel only generates debug info for a dbg.value - // that is associated with a llvm::Argument if either its !DIVariable - // is marked as argument or there is no non-debug intrinsic instruction - // before it. So In the case of associating a llvm::Argument with a - // non-argument debug variable -- usually via a !DIExpression -- we - // need to make sure that dbg.value is before any non-phi / no-dbg - // instruction. - DBuilder.insertDbgValueIntrinsic(Storage, Var, Expr, DL, - ParentBlock->getFirstNonPHIOrDbg()); - else - DBuilder.insertDbgValueIntrinsic(Storage, Var, Expr, DL, ParentBlock); + if (isa(Storage) && !Var->getArg()) { + const auto InsertPt = ParentBlock->getFirstNonPHIOrDbg(); + if (InsertPt != ParentBlock->end()) { + // SelectionDAGISel only generates debug info for a dbg.value + // that is associated with a llvm::Argument if either its !DIVariable + // is marked as argument or there is no non-debug intrinsic instruction + // before it. So In the case of associating a llvm::Argument with a + // non-argument debug variable -- usually via a !DIExpression -- we + // need to make sure that dbg.value is before any non-phi / no-dbg + // instruction. + DBuilder.insertDbgValueIntrinsic(Storage, Var, Expr, DL, &*InsertPt); + + return; + } + } + + DBuilder.insertDbgValueIntrinsic(Storage, Var, Expr, DL, ParentBlock); } void IRGenDebugInfoImpl::emitGlobalVariableDeclaration( From e124bca3e11edc3154b52e095dcbc4269730aabe Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 08:12:00 +0100 Subject: [PATCH 025/100] IRGen: Adjust uses of `llvm::DIBuilder::insertDbgValueIntrinsic` (parameter type changed) Per 1083ec647f16314bcc9af8c4d6b11f50d288bca6 (llvm-project). --- lib/IRGen/IRGenDebugInfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index b872a8d859726..8553bddf7b7dd 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -3863,13 +3863,13 @@ void IRGenDebugInfoImpl::emitDbgIntrinsic( // non-argument debug variable -- usually via a !DIExpression -- we // need to make sure that dbg.value is before any non-phi / no-dbg // instruction. - DBuilder.insertDbgValueIntrinsic(Storage, Var, Expr, DL, &*InsertPt); + DBuilder.insertDbgValueIntrinsic(Storage, Var, Expr, DL, InsertPt); return; } } - DBuilder.insertDbgValueIntrinsic(Storage, Var, Expr, DL, ParentBlock); + DBuilder.insertDbgValueIntrinsic(Storage, Var, Expr, DL, ParentBlock->end()); } void IRGenDebugInfoImpl::emitGlobalVariableDeclaration( From d15a148d097bd5cf8da91f7b031b0eb0fd2547e4 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 20:03:28 +0100 Subject: [PATCH 026/100] IRGen: Conservatively adjust uses of `llvm::PassBuilder::registerOptimizerLastEPCallback` (lambda parameter added) Per 390300d9f41df6ad71f0f4196ef4885d4bd5dc48 (llvm-project). --- lib/IRGen/IRGen.cpp | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/lib/IRGen/IRGen.cpp b/lib/IRGen/IRGen.cpp index 723725a29f7e7..e57c08d2db75f 100644 --- a/lib/IRGen/IRGen.cpp +++ b/lib/IRGen/IRGen.cpp @@ -342,7 +342,8 @@ void swift::performLLVMOptimizations(const IRGenOptions &Opts, FPM.addPass(SwiftARCOptPass()); }); PB.registerOptimizerLastEPCallback([&](ModulePassManager &MPM, - OptimizationLevel Level) { + OptimizationLevel Level, + llvm::ThinOrFullLTOPhase) { if (Level != OptimizationLevel::O0) MPM.addPass(createModuleToFunctionPassAdaptor(SwiftARCContractPass())); if (Level == OptimizationLevel::O0) @@ -357,7 +358,8 @@ void swift::performLLVMOptimizations(const IRGenOptions &Opts, if (Opts.Sanitizers & SanitizerKind::Address) { PB.registerOptimizerLastEPCallback([&](ModulePassManager &MPM, - OptimizationLevel Level) { + OptimizationLevel Level, + llvm::ThinOrFullLTOPhase) { AddressSanitizerOptions ASOpts; ASOpts.CompileKernel = false; ASOpts.Recover = bool(Opts.SanitizersWithRecoveryInstrumentation & @@ -376,17 +378,19 @@ void swift::performLLVMOptimizations(const IRGenOptions &Opts, } if (Opts.Sanitizers & SanitizerKind::Thread) { - PB.registerOptimizerLastEPCallback( - [&](ModulePassManager &MPM, OptimizationLevel Level) { - MPM.addPass(ModuleThreadSanitizerPass()); - MPM.addPass(createModuleToFunctionPassAdaptor(ThreadSanitizerPass())); - }); + PB.registerOptimizerLastEPCallback([&](ModulePassManager &MPM, + OptimizationLevel Level, + llvm::ThinOrFullLTOPhase) { + MPM.addPass(ModuleThreadSanitizerPass()); + MPM.addPass(createModuleToFunctionPassAdaptor(ThreadSanitizerPass())); + }); } if (Opts.SanitizeCoverage.CoverageType != llvm::SanitizerCoverageOptions::SCK_None) { PB.registerOptimizerLastEPCallback([&](ModulePassManager &MPM, - OptimizationLevel Level) { + OptimizationLevel Level, + llvm::ThinOrFullLTOPhase) { std::vector allowlistFiles; std::vector ignorelistFiles; MPM.addPass(SanitizerCoveragePass(Opts.SanitizeCoverage, @@ -395,14 +399,15 @@ void swift::performLLVMOptimizations(const IRGenOptions &Opts, } if (RunSwiftSpecificLLVMOptzns && !Opts.DisableLLVMMergeFunctions) { - PB.registerOptimizerLastEPCallback( - [&](ModulePassManager &MPM, OptimizationLevel Level) { - if (Level != OptimizationLevel::O0) { - const PointerAuthSchema &schema = Opts.PointerAuth.FunctionPointers; - unsigned key = (schema.isEnabled() ? schema.getKey() : 0); - MPM.addPass(SwiftMergeFunctionsPass(schema.isEnabled(), key)); - } - }); + PB.registerOptimizerLastEPCallback([&](ModulePassManager &MPM, + OptimizationLevel Level, + llvm::ThinOrFullLTOPhase) { + if (Level != OptimizationLevel::O0) { + const PointerAuthSchema &schema = Opts.PointerAuth.FunctionPointers; + unsigned key = (schema.isEnabled() ? schema.getKey() : 0); + MPM.addPass(SwiftMergeFunctionsPass(schema.isEnabled(), key)); + } + }); } if (Opts.GenerateProfile) { From c950146889760d6eca3682fabb3492f5d0f19d19 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 20:43:37 +0100 Subject: [PATCH 027/100] IRGen: Adjust use of `llvm::PassBuilder::buildO0DefaultPipeline` (parameter type changed) Per 5445edb5d6667333f829f03932c2fc6a607e8306 (llvm-project). --- lib/IRGen/IRGen.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/IRGen/IRGen.cpp b/lib/IRGen/IRGen.cpp index e57c08d2db75f..b9580fba1f112 100644 --- a/lib/IRGen/IRGen.cpp +++ b/lib/IRGen/IRGen.cpp @@ -429,7 +429,13 @@ void swift::performLLVMOptimizations(const IRGenOptions &Opts, bool isThinLTO = Opts.LLVMLTOKind == IRGenLLVMLTOKind::Thin; bool isFullLTO = Opts.LLVMLTOKind == IRGenLLVMLTOKind::Full; if (!Opts.shouldOptimize() || Opts.DisableLLVMOptzns) { - MPM = PB.buildO0DefaultPipeline(level, isFullLTO || isThinLTO); + auto phase = llvm::ThinOrFullLTOPhase::None; + if (isFullLTO) { + phase = llvm::ThinOrFullLTOPhase::FullLTOPreLink; + } else if (isThinLTO) { + phase = llvm::ThinOrFullLTOPhase::ThinLTOPreLink; + } + MPM = PB.buildO0DefaultPipeline(level, phase); } else if (isThinLTO) { MPM = PB.buildThinLTOPreLinkDefaultPipeline(level); } else if (isFullLTO) { From 0c509f6891cc35a2892cc7a7d13de80617a403aa Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Apr 2025 22:09:03 +0100 Subject: [PATCH 028/100] Immediate: Adjust uses of `llvm::jitlink::Symbol::{get,set}Name` (type signature changed) Per 2ccf7ed277df28651b94bbee9fccefdf22fb074f (llvm-project). --- lib/Immediate/SwiftMaterializationUnit.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Immediate/SwiftMaterializationUnit.cpp b/lib/Immediate/SwiftMaterializationUnit.cpp index 7203a8ab141c8..0465188f2b270 100644 --- a/lib/Immediate/SwiftMaterializationUnit.cpp +++ b/lib/Immediate/SwiftMaterializationUnit.cpp @@ -197,11 +197,11 @@ renameFunctionBodies(llvm::orc::MaterializationResponsibility &MR, if (!Sym->hasName() || !Sym->isCallable()) continue; - if (ToRename.count(Sym->getName())) { - // FIXME: Get rid of the temporary when Swift's llvm-project is - // updated to LLVM 17. - auto NewName = G.allocateCString(Twine(mangle(Sym->getName()))); - Sym->setName({NewName.data(), NewName.size() - 1}); + const StringRef Name = *Sym->getName(); + + if (ToRename.count(Name)) { + auto NewName = G.intern(mangle(Name)); + Sym->setName(NewName); } } } From 657f5028fb45991569d6f58770e3edb0196ec500 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 24 Apr 2025 18:20:41 +0100 Subject: [PATCH 029/100] SILGen, SILOptimizer: Fix assertion failures in `llvm::APInt` ctor Constructing an unsigned 1-bit `APInt` with a value of -1 now hits an assertion. Previously, the value would just be masked to become 1. Fix this by constructing 1-bit `BuiltinIntegerType` literals with a value of 1 instead of -1. --- lib/SILGen/SILGenDecl.cpp | 9 ++++----- lib/SILOptimizer/LoopTransforms/BoundsCheckOpts.cpp | 6 +++--- lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp | 2 +- lib/SILOptimizer/Transforms/SimplifyCFG.cpp | 4 ++-- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/SILGen/SILGenDecl.cpp b/lib/SILGen/SILGenDecl.cpp index cde0970462de2..ad708d95c2491 100644 --- a/lib/SILGen/SILGenDecl.cpp +++ b/lib/SILGen/SILGenDecl.cpp @@ -1995,12 +1995,11 @@ void SILGenFunction::emitStmtCondition(StmtCondition Cond, JumpDest FalseDest, emitOSVersionRangeCheck(loc, versionRange.value(), isMacCatalyst); if (availability->isUnavailability()) { // If this is an unavailability check, invert the result - // by emitting a call to Builtin.xor_Int1(lhs, -1). + // by emitting a call to Builtin.xor_Int1(lhs, 1). SILType i1 = SILType::getBuiltinIntegerType(1, getASTContext()); - SILValue minusOne = B.createIntegerLiteral(loc, i1, -1); - booleanTestValue = - B.createBuiltinBinaryFunction(loc, "xor", i1, i1, - {booleanTestValue, minusOne}); + SILValue one = B.createIntegerLiteral(loc, i1, 1); + booleanTestValue = B.createBuiltinBinaryFunction( + loc, "xor", i1, i1, {booleanTestValue, one}); } } break; diff --git a/lib/SILOptimizer/LoopTransforms/BoundsCheckOpts.cpp b/lib/SILOptimizer/LoopTransforms/BoundsCheckOpts.cpp index 0e6802be83382..46e8c289f18b0 100644 --- a/lib/SILOptimizer/LoopTransforms/BoundsCheckOpts.cpp +++ b/lib/SILOptimizer/LoopTransforms/BoundsCheckOpts.cpp @@ -558,7 +558,7 @@ static SILValue getSub(SILLocation Loc, SILValue Val, unsigned SubVal, SmallVector Args(1, Val); Args.push_back(B.createIntegerLiteral(Loc, Val->getType(), SubVal)); Args.push_back(B.createIntegerLiteral( - Loc, SILType::getBuiltinIntegerType(1, B.getASTContext()), -1)); + Loc, SILType::getBuiltinIntegerType(1, B.getASTContext()), 1)); auto *AI = B.createBuiltinBinaryFunctionWithOverflow( Loc, "ssub_with_overflow", Args); @@ -570,7 +570,7 @@ static SILValue getAdd(SILLocation Loc, SILValue Val, unsigned AddVal, SmallVector Args(1, Val); Args.push_back(B.createIntegerLiteral(Loc, Val->getType(), AddVal)); Args.push_back(B.createIntegerLiteral( - Loc, SILType::getBuiltinIntegerType(1, B.getASTContext()), -1)); + Loc, SILType::getBuiltinIntegerType(1, B.getASTContext()), 1)); auto *AI = B.createBuiltinBinaryFunctionWithOverflow( Loc, "sadd_with_overflow", Args); @@ -1342,7 +1342,7 @@ BoundsCheckOpts::findAndOptimizeInductionVariables(SILLoop *loop) { if (isComparisonKnownTrue(builtin, *ivar)) { if (!trueVal) trueVal = builder.createIntegerLiteral(builtin->getLoc(), - builtin->getType(), -1); + builtin->getType(), 1); builtin->replaceAllUsesWith(trueVal); changed = true; continue; diff --git a/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp b/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp index a385a2475d442..65cfe2b47537d 100644 --- a/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp +++ b/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp @@ -2976,7 +2976,7 @@ static SILValue testAllControlVariableBits(SILLocation Loc, if (IVType->getFixedWidth() == 1) return CondVal; - SILValue AllBitsSet = B.createIntegerLiteral(Loc, CondVal->getType(), -1); + SILValue AllBitsSet = B.createIntegerLiteral(Loc, CondVal->getType(), 1); if (!CmpEqFn.get()) CmpEqFn = getBinaryFunction("cmp_eq", CondVal->getType(), B.getASTContext()); diff --git a/lib/SILOptimizer/Transforms/SimplifyCFG.cpp b/lib/SILOptimizer/Transforms/SimplifyCFG.cpp index 95a835cb07a14..0ce619a37ef84 100644 --- a/lib/SILOptimizer/Transforms/SimplifyCFG.cpp +++ b/lib/SILOptimizer/Transforms/SimplifyCFG.cpp @@ -304,7 +304,7 @@ static SILValue createValueForEdge(SILInstruction *UserInst, if (auto *CBI = dyn_cast(DominatingTerminator)) return Builder.createIntegerLiteral( - CBI->getLoc(), CBI->getCondition()->getType(), EdgeIdx == 0 ? -1 : 0); + CBI->getLoc(), CBI->getCondition()->getType(), EdgeIdx == 0 ? 1 : 0); auto *SEI = cast(DominatingTerminator); auto *DstBlock = SEI->getSuccessors()[EdgeIdx].getBB(); @@ -1480,7 +1480,7 @@ static SILValue invertExpectAndApplyTo(SILBuilder &Builder, if (!IL) return V; SILValue NegatedExpectedValue = Builder.createIntegerLiteral( - IL->getLoc(), Args[1]->getType(), IL->getValue() == 0 ? -1 : 0); + IL->getLoc(), Args[1]->getType(), IL->getValue() == 0 ? 1 : 0); return Builder.createBuiltin(BI->getLoc(), BI->getName(), BI->getType(), {}, {V, NegatedExpectedValue}); } From 906a2fa6f4dd5b2d37aa40f8e5090acd2538adcf Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Fri, 25 Apr 2025 20:43:18 +0100 Subject: [PATCH 030/100] ClangImporter: Fix potential null deref of file system --- lib/ClangImporter/ClangImporter.cpp | 6 +++--- lib/ClangImporter/ClangIncludePaths.cpp | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index 788372c64fa52..44d55ab9a0826 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -1139,6 +1139,8 @@ ClangImporter::getClangDriverArguments(ASTContext &ctx, bool ignoreClangTarget) std::optional> ClangImporter::getClangCC1Arguments( ASTContext &ctx, llvm::IntrusiveRefCntPtr VFS, bool ignoreClangTarget) { + ASSERT(VFS && "Expected non-null file system"); + std::unique_ptr CI; // Set up a temporary diagnostic client to report errors from parsing the @@ -1240,9 +1242,7 @@ std::optional> ClangImporter::getClangCC1Arguments( // to missing files and report the error that clang would throw manually. // rdar://77516546 is tracking that the clang importer should be more // resilient and provide a module even if there were building it. - auto TempVFS = clang::createVFSFromCompilerInvocation( - *CI, *clangDiags, - VFS ? VFS : Impl.SwiftContext.SourceMgr.getFileSystem()); + auto TempVFS = clang::createVFSFromCompilerInvocation(*CI, *clangDiags, VFS); std::vector FilteredModuleMapFiles; for (auto ModuleMapFile : CI->getFrontendOpts().ModuleMapFiles) { diff --git a/lib/ClangImporter/ClangIncludePaths.cpp b/lib/ClangImporter/ClangIncludePaths.cpp index 82bdb353fa777..0bcb3e4e88e7b 100644 --- a/lib/ClangImporter/ClangIncludePaths.cpp +++ b/lib/ClangImporter/ClangIncludePaths.cpp @@ -127,9 +127,12 @@ std::pair vfs) { + + auto diagVFS = vfs ? vfs : llvm::vfs::getRealFileSystem(); + auto *silentDiagConsumer = new clang::DiagnosticConsumer(); auto clangDiags = clang::CompilerInstance::createDiagnostics( - *vfs, new clang::DiagnosticOptions(), silentDiagConsumer); + *diagVFS, new clang::DiagnosticOptions(), silentDiagConsumer); clang::driver::Driver clangDriver(ClangImporterOpts.clangPath, LangOpts.Target.str(), *clangDiags, "clang LLVM compiler", vfs); From 442825d9de10037931006cd5ddc54118cd101b30 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 30 Apr 2025 21:45:43 +0100 Subject: [PATCH 031/100] [rebranch] IRGen: Fix omission in hash computation after switching API Issue introduced by 0d2d6cb8a06d90bbb1567222ce87d566e62e1fd3. `llvm::getPointerAuthStableSipHash` produces the combined result of the obsoleted `clang::CodeGen::computeStableStringHash` and our `getDiscriminatorForHash`, so we no longer need to call both. --- lib/IRGen/GenPointerAuth.cpp | 40 +++++++++++++++--------------------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/lib/IRGen/GenPointerAuth.cpp b/lib/IRGen/GenPointerAuth.cpp index 42b78ecc01bbe..b28db161be422 100644 --- a/lib/IRGen/GenPointerAuth.cpp +++ b/lib/IRGen/GenPointerAuth.cpp @@ -325,16 +325,10 @@ PointerAuthInfo::getOtherDiscriminator(IRGenModule &IGM, llvm_unreachable("bad kind"); } -static llvm::ConstantInt *getDiscriminatorForHash(IRGenModule &IGM, - uint64_t rawHash) { - uint16_t reducedHash = (rawHash % 0xFFFF) + 1; - return llvm::ConstantInt::get(IGM.Int64Ty, reducedHash); -} - static llvm::ConstantInt *getDiscriminatorForString(IRGenModule &IGM, StringRef string) { - uint64_t rawHash = llvm::getPointerAuthStableSipHash(string); - return getDiscriminatorForHash(IGM, rawHash); + return llvm::ConstantInt::get(IGM.Int64Ty, + llvm::getPointerAuthStableSipHash(string)); } static std::string mangle(AssociatedTypeDecl *assocType) { @@ -571,7 +565,8 @@ static void hashStringForFunctionType(IRGenModule &IGM, CanSILFunctionType type, } } -static uint64_t getTypeHash(IRGenModule &IGM, CanSILFunctionType type) { +static llvm::ConstantInt *getTypeDiscriminator(IRGenModule &IGM, + CanSILFunctionType type) { // The hash we need to do here ignores: // - thickness, so that we can promote thin-to-thick without rehashing; // - error results, so that we can promote nonthrowing-to-throwing @@ -591,10 +586,11 @@ static uint64_t getTypeHash(IRGenModule &IGM, CanSILFunctionType type) { hashStringForFunctionType( IGM, type, Out, genericSig.getCanonicalSignature().getGenericEnvironment()); - return llvm::getPointerAuthStableSipHash(Out.str()); + return getDiscriminatorForString(IGM, Out.str()); } -static uint64_t getYieldTypesHash(IRGenModule &IGM, CanSILFunctionType type) { +static llvm::ConstantInt * +getCoroutineYieldTypesDiscriminator(IRGenModule &IGM, CanSILFunctionType type) { SmallString<32> buffer; llvm::raw_svector_ostream out(buffer); auto genericSig = type->getInvocationGenericSignature(); @@ -630,7 +626,7 @@ static uint64_t getYieldTypesHash(IRGenModule &IGM, CanSILFunctionType type) { out << ":"; } - return llvm::getPointerAuthStableSipHash(out.str()); + return getDiscriminatorForString(IGM, out.str()); } llvm::ConstantInt * @@ -650,8 +646,7 @@ PointerAuthEntity::getTypeDiscriminator(IRGenModule &IGM) const { llvm::ConstantInt *&cache = IGM.getPointerAuthCaches().Types[fnType]; if (cache) return cache; - auto hash = getTypeHash(IGM, fnType); - cache = getDiscriminatorForHash(IGM, hash); + cache = ::getTypeDiscriminator(IGM, fnType); return cache; } @@ -668,15 +663,6 @@ PointerAuthEntity::getTypeDiscriminator(IRGenModule &IGM) const { llvm_unreachable("invalid representation"); }; - auto getCoroutineYieldTypesDiscriminator = [&](CanSILFunctionType fnType) { - llvm::ConstantInt *&cache = IGM.getPointerAuthCaches().Types[fnType]; - if (cache) return cache; - - auto hash = getYieldTypesHash(IGM, fnType); - cache = getDiscriminatorForHash(IGM, hash); - return cache; - }; - switch (StoredKind) { case Kind::None: case Kind::Special: @@ -688,7 +674,13 @@ PointerAuthEntity::getTypeDiscriminator(IRGenModule &IGM) const { case Kind::CoroutineYieldTypes: { auto fnType = Storage.get(StoredKind); - return getCoroutineYieldTypesDiscriminator(fnType); + + llvm::ConstantInt *&cache = IGM.getPointerAuthCaches().Types[fnType]; + if (cache) + return cache; + + cache = getCoroutineYieldTypesDiscriminator(IGM, fnType); + return cache; } case Kind::CanSILFunctionType: { From df229ca665e1ead3ae0449c41cdbb11b6bd0ccd4 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Tue, 29 Apr 2025 21:09:50 +0100 Subject: [PATCH 032/100] [rebranch][test] IRGen: Adjust `icmp` check that is now marked `samesign` Per b7db403e701029c801fd990dceeb219de9fb800c (llvm-project). --- test/IRGen/annotated_cond_fail.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/IRGen/annotated_cond_fail.swift b/test/IRGen/annotated_cond_fail.swift index bb754384aa3c9..ef50e578426da 100644 --- a/test/IRGen/annotated_cond_fail.swift +++ b/test/IRGen/annotated_cond_fail.swift @@ -19,7 +19,7 @@ public func test(_ a: [Int], _ i: Int) -> Int { // CHECK: [[SIZE_ADDR:%.*]] = getelementptr // CHECK: [[SIZE:%.*]] = load i64, ptr [[SIZE_ADDR]] -// CHECK: [[C1:%.*]] = icmp ult i64 [[IDX]], [[SIZE]] +// CHECK: [[C1:%.*]] = icmp samesign ult i64 [[IDX]], [[SIZE]] // CHECK: br i1 [[C1]], {{.*}}!annotation ![[ARRAY_INDEX_OUT_OF_BOUNDS]] From b7b60b760ec470bb00fbc730a45e104c60bc6019 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Tue, 29 Apr 2025 21:53:35 +0100 Subject: [PATCH 033/100] [rebranch][test] IRGen: Adjust some `icmp` checks that swapped arguments --- test/IRGen/integer-comparison.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/IRGen/integer-comparison.swift b/test/IRGen/integer-comparison.swift index ac7d4677ce13a..d5052c461cf4c 100644 --- a/test/IRGen/integer-comparison.swift +++ b/test/IRGen/integer-comparison.swift @@ -4,11 +4,11 @@ func f(_ x: Int, _ y: UInt32) -> Bool { x < y } // CHECK-LABEL: define {{.*}} @"$s4main1fySbSi_s6UInt32VtF"(i64 %0, i32 %1) // CHECK: %2 = zext i32 %1 to i64 -// CHECK-NEXT: %3 = icmp sgt i64 %2, %0 +// CHECK-NEXT: %3 = icmp slt i64 %0, %2 // CHECK-NEXT: ret i1 %3 func g(_ x: UInt32, _ y: Int) -> Bool { x < y } // CHECK-LABEL: define {{.*}} @"$s4main1gySbs6UInt32V_SitF"(i32 %0, i64 %1) // CHECK: %2 = zext i32 %0 to i64 -// CHECK-NEXT: %3 = icmp slt i64 %2, %1 +// CHECK-NEXT: %3 = icmp sgt i64 %1, %2 // CHECK-NEXT: ret i1 %3 From b6b1b067be366b3f115e9f65cceaa2e7985a0b81 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 8 May 2025 09:56:58 +0100 Subject: [PATCH 034/100] [rebranch][test] LLVMPasses, IRGen: Switch some remaining tests from `nocapture` to `captures(none)` Per 29441e4f5fa5f5c7709f7cf180815ba97f611297 (llvm-project). --- test/IRGen/argument_attrs.sil | 6 +++--- test/LLVMPasses/allocation-deletion.ll | 4 ++-- test/LLVMPasses/basic.ll | 2 +- test/LLVMPasses/contract.ll | 4 ++-- test/LLVMPasses/crash.ll | 2 +- test/LLVMPasses/disable_llvm_optzns.ll | 2 +- test/LLVMPasses/missing_runtime_declarations.ll | 6 +++--- test/LLVMPasses/release_motion_landingpad.ll | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/test/IRGen/argument_attrs.sil b/test/IRGen/argument_attrs.sil index 905842f443816..bba5ed69b1869 100644 --- a/test/IRGen/argument_attrs.sil +++ b/test/IRGen/argument_attrs.sil @@ -16,7 +16,7 @@ entry(%1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*Builtin.Int32, %4 : $Hu return undef : $() } -// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl(ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) +// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl(ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias captures(none), ptr) sil @arguments_in_decl : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_out(ptr noalias captures(none) sret({{.*}}) %0, ptr captures(none) dereferenceable(4) %1, ptr noalias captures(none) dereferenceable(4) %2, ptr noalias captures(none) dereferenceable(4) %3, ptr noalias captures(none) dereferenceable(40) %4, ptr noalias %5, ptr noalias captures(none) %6, ptr %T) @@ -31,7 +31,7 @@ entry(%0 : $*Builtin.Int32, %1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*B return undef : $() } -// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_out(ptr noalias captures(none) sret({{.*}}), ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) +// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_out(ptr noalias captures(none) sret({{.*}}), ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias captures(none), ptr) sil @arguments_in_decl_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_huge_ret(ptr noalias captures(none) sret({{.*}}V) %0, ptr captures(none) dereferenceable(4) %1, ptr noalias captures(none) dereferenceable(4) %2, ptr noalias captures(none) dereferenceable(4) %3, ptr noalias captures(none) dereferenceable(40) %4, ptr noalias %5, ptr noalias captures(none) %6, ptr %T) @@ -46,7 +46,7 @@ entry(%1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*Builtin.Int32, %4 : $Hu return %y : $Huge } -// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_huge_ret(ptr noalias captures(none) sret({{.*}}), ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) +// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_huge_ret(ptr noalias captures(none) sret({{.*}}), ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias captures(none), ptr) sil @arguments_in_decl_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge diff --git a/test/LLVMPasses/allocation-deletion.ll b/test/LLVMPasses/allocation-deletion.ll index c9db70bf7a6db..3dc2ebb2ad3f7 100644 --- a/test/LLVMPasses/allocation-deletion.ll +++ b/test/LLVMPasses/allocation-deletion.ll @@ -7,7 +7,7 @@ target triple = "x86_64-apple-macosx10.9" %swift.heapmetadata = type { ptr, ptr } declare ptr @swift_allocObject(ptr , i64, i64) nounwind -declare void @swift_release(ptr nocapture) +declare void @swift_release(ptr captures(none)) declare void @swift_retain(ptr ) nounwind declare { i64, i64, i64 } @swift_retainAndReturnThree(ptr , i64, i64 , i64 ) @@ -36,7 +36,7 @@ entry: ; trivial_alloc_eliminate1 - Show that we can eliminate an allocation with a ; trivial destructor. @trivial_dtor_metadata = internal constant %swift.heapmetadata { ptr @trivial_dtor, ptr null } -define internal i64 @trivial_dtor(ptr nocapture) nounwind readonly { +define internal i64 @trivial_dtor(ptr captures(none)) nounwind readonly { entry: %1 = getelementptr inbounds %swift.refcounted, ptr %0, i64 1 %length = load i64, ptr %1, align 8 diff --git a/test/LLVMPasses/basic.ll b/test/LLVMPasses/basic.ll index be8b54b3e16dc..f53e1f9fc66a1 100644 --- a/test/LLVMPasses/basic.ll +++ b/test/LLVMPasses/basic.ll @@ -16,7 +16,7 @@ declare void @swift_unknownObjectRelease(ptr) declare ptr @llvm.objc.retain(ptr) declare void @llvm.objc.release(ptr) declare ptr @swift_allocObject(ptr , i64, i64) nounwind -declare void @swift_release(ptr nocapture) +declare void @swift_release(ptr captures(none)) declare ptr @swift_retain(ptr returned) nounwind declare ptr @swift_bridgeObjectRetain(ptr) declare void @swift_bridgeObjectRelease(ptr) diff --git a/test/LLVMPasses/contract.ll b/test/LLVMPasses/contract.ll index d5081e5c9e3f9..23c05a02096b3 100644 --- a/test/LLVMPasses/contract.ll +++ b/test/LLVMPasses/contract.ll @@ -10,9 +10,9 @@ target triple = "x86_64-apple-macosx10.9" declare ptr @swift_allocObject(ptr , i64, i64) nounwind declare ptr @swift_bridgeObjectRetain(ptr) declare void @swift_bridgeObjectRelease(ptr ) -declare void @swift_release(ptr nocapture) +declare void @swift_release(ptr captures(none)) declare ptr @swift_retain(ptr ) nounwind -declare void @swift_unknownObjectRelease(ptr nocapture) +declare void @swift_unknownObjectRelease(ptr captures(none)) declare ptr @swift_unknownObjectRetain(ptr ) nounwind declare void @__swift_fixLifetime(ptr) declare void @noread_user(ptr) readnone diff --git a/test/LLVMPasses/crash.ll b/test/LLVMPasses/crash.ll index 020ce65262495..1aa748c1a9254 100644 --- a/test/LLVMPasses/crash.ll +++ b/test/LLVMPasses/crash.ll @@ -8,7 +8,7 @@ target triple = "x86_64-apple-macosx10.9" declare { ptr, i64, ptr } @_Tsop1pFT3lhsNs6String3rhsS__S_(ptr, i64, ptr, ptr, i64, ptr) declare { ptr, i64, ptr } @_TNs6String24convertFromStringLiteralFT3valp_S_(ptr) -declare void @swift_release(ptr nocapture) +declare void @swift_release(ptr captures(none)) @0 = private unnamed_addr constant [3 x i8] c"So\00" diff --git a/test/LLVMPasses/disable_llvm_optzns.ll b/test/LLVMPasses/disable_llvm_optzns.ll index e71f22ae88a5f..c0a4ba020c4bd 100644 --- a/test/LLVMPasses/disable_llvm_optzns.ll +++ b/test/LLVMPasses/disable_llvm_optzns.ll @@ -16,7 +16,7 @@ declare void @swift_unknownObjectRelease(ptr) declare ptr @llvm.objc.retain(ptr) declare void @llvm.objc.release(ptr) declare ptr @swift_allocObject(ptr , i64, i64) nounwind -declare void @swift_release(ptr nocapture) +declare void @swift_release(ptr captures(none)) declare ptr @swift_retain(ptr returned) nounwind declare ptr @swift_bridgeObjectRetain(ptr) declare void @swift_bridgeObjectRelease(ptr) diff --git a/test/LLVMPasses/missing_runtime_declarations.ll b/test/LLVMPasses/missing_runtime_declarations.ll index 3b5c20414afc0..f20263bc8472f 100644 --- a/test/LLVMPasses/missing_runtime_declarations.ll +++ b/test/LLVMPasses/missing_runtime_declarations.ll @@ -3,11 +3,11 @@ target datalayout = "e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" target triple = "x86_64-apple-macosx10.9" -; CHECK: declare void @swift_bridgeObjectRelease(ptr nocapture) +; CHECK: declare void @swift_bridgeObjectRelease(ptr captures(none)) %a = type opaque -declare void @swift_bridgeObjectRelease(ptr nocapture) -declare ptr @swift_bridgeObjectRetain(ptr nocapture) +declare void @swift_bridgeObjectRelease(ptr captures(none)) +declare ptr @swift_bridgeObjectRetain(ptr captures(none)) ; CHECK-LABEL: define void @testcase1(ptr %0) { ; CHECK: entry: diff --git a/test/LLVMPasses/release_motion_landingpad.ll b/test/LLVMPasses/release_motion_landingpad.ll index 3a3c5ae4045f9..f6bee19d82dc5 100644 --- a/test/LLVMPasses/release_motion_landingpad.ll +++ b/test/LLVMPasses/release_motion_landingpad.ll @@ -3,7 +3,7 @@ target datalayout = "e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" target triple = "x86_64-apple-macosx10.9" -declare void @swift_release(ptr nocapture) +declare void @swift_release(ptr captures(none)) declare void @swift_retain(ptr) nounwind declare ptr @_Znwm(i64) declare i32 @__gxx_personality_v0(...) From 00c93349ca5279f4c2bea222c411119531cf6a08 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 8 May 2025 14:28:12 +0100 Subject: [PATCH 035/100] [rebranch] Partially revert "IRGen, LLVMPasses: Switch from obsoleted `nocapture` to `captures(none)`" This reverts most test changes in commit f93aba0770e7ff73997d3afed2c1c50a765b2e05. These changes will be done a bit differenty on main instead: https://github.com/swiftlang/swift/pull/81375. --- .../IRGen/differentiable_function.sil | 4 +- test/DebugInfo/ErrorVar.swift | 2 +- ...tributed_actor_accessor_thunks_32bit.swift | 14 +- ...tributed_actor_accessor_thunks_64bit.swift | 2 +- test/IRGen/abi_v7k.swift | 4 +- test/IRGen/abitypes_objc.swift | 34 ++-- test/IRGen/access_markers.sil | 4 +- test/IRGen/async_dynamic_replacement.swift | 2 +- test/IRGen/big_types_corner_cases.sil | 28 +-- test/IRGen/big_types_corner_cases.swift | 38 ++-- test/IRGen/big_types_corner_cases_tiny.swift | 2 +- test/IRGen/big_types_tests.sil | 2 +- test/IRGen/builtin_pack_length.swift | 2 +- test/IRGen/builtins.swift | 18 +- test/IRGen/c_layout.sil | 8 +- test/IRGen/casts.sil | 2 +- test/IRGen/class_field_other_module.swift | 4 +- ...ormances_class_with_defaulted_method.swift | 2 +- test/IRGen/coroutine_accessors.swift | 4 +- ...outine_accessors_backdeploy_async_56.swift | 2 +- ...outine_accessors_backdeploy_async_57.swift | 2 +- test/IRGen/dependent_reabstraction.swift | 2 +- test/IRGen/enum.sil | 42 ++-- test/IRGen/enum_derived.swift | 4 +- test/IRGen/enum_future.sil | 42 ++-- test/IRGen/enum_resilience.swift | 2 +- test/IRGen/errors.sil | 6 +- test/IRGen/existentials_objc.sil | 4 +- test/IRGen/extern_c_abitypes.swift | 12 +- test/IRGen/fixlifetime.sil | 4 +- test/IRGen/function_param_convention.sil | 2 +- test/IRGen/function_types.sil | 4 +- test/IRGen/generic_casts.swift | 4 +- test/IRGen/generic_metatypes.swift | 2 +- test/IRGen/generic_metatypes_future.swift | 2 +- test/IRGen/generic_ternary.swift | 2 +- test/IRGen/indexing.sil | 6 +- test/IRGen/indirect_argument.sil | 36 ++-- test/IRGen/indirect_return.swift | 2 +- test/IRGen/inout_noalias.sil | 2 +- test/IRGen/lazy_multi_file.swift | 2 +- test/IRGen/lifetime.sil | 2 +- .../moveonly_split_module_source_deinit.swift | 2 +- test/IRGen/moveonly_value_functions.swift | 6 +- .../moveonly_value_functions_onone.swift | 8 +- test/IRGen/objc_block_storage.sil | 10 +- test/IRGen/objc_class_export.swift | 4 +- .../objc_generic_protocol_conformance.swift | 2 +- test/IRGen/objc_simd.sil | 6 +- test/IRGen/objc_structs.swift | 10 +- test/IRGen/objc_super.swift | 2 +- test/IRGen/partial_apply.sil | 20 +- test/IRGen/partial_apply_coro.sil | 56 ++--- test/IRGen/partial_apply_generic.swift | 2 +- test/IRGen/pre_specialize.swift | 9 +- test/IRGen/protocol_accessor_multifile.swift | 2 +- test/IRGen/protocol_resilience.sil | 10 +- test/IRGen/protocol_resilience_thunks.swift | 4 +- test/IRGen/same_type_constraints.swift | 2 +- test/IRGen/select_enum.sil | 2 +- test/IRGen/sil_generic_witness_methods.swift | 2 +- test/IRGen/sil_witness_methods.sil | 8 +- test/IRGen/sil_witness_tables.swift | 4 +- test/IRGen/struct_resilience.swift | 8 +- test/IRGen/struct_with_resilient_type.swift | 2 +- test/IRGen/typed_throws.sil | 24 +-- test/IRGen/typed_throws.swift | 8 +- test/IRGen/typed_throws_abi.swift | 192 +++++++++--------- test/IRGen/typed_throws_thunks.swift | 16 +- .../typelayout_based_value_witness.swift | 4 +- test/IRGen/unconditional_checked_cast.sil | 2 +- test/IRGen/witness_method.sil | 4 +- test/IRGen/yield_once_big.sil | 6 +- test/IRGen/yield_once_indirect.sil | 2 +- ...ional_conformance_basic_conformances.swift | 8 +- ...onformance_basic_conformances_future.swift | 8 +- .../conditional_conformance_subclass.swift | 4 +- ...ditional_conformance_subclass_future.swift | 4 +- .../conditional_conformance_with_assoc.swift | 4 +- ...tional_conformance_with_assoc_future.swift | 4 +- .../Interop/Cxx/class/method/inreg-sret.swift | 4 +- .../class/protocol-conformance-irgen.swift | 2 +- .../Cxx/class/returns-large-class-irgen.swift | 2 +- .../Cxx/extern-var/extern-var-irgen.swift | 2 +- .../inline-static-member-var-irgen.swift | 2 +- .../Interop/Cxx/static/static-var-irgen.swift | 2 +- .../stdlib/msvc-abi-use-vector-iterator.swift | 2 +- .../Cxx/templates/mangling-irgen.swift | 4 +- ...irt_witness_method_empty_conformance.swift | 2 +- test/SILOptimizer/eager_specialize.sil | 4 +- test/SILOptimizer/eager_specialize_ossa.sil | 4 +- 91 files changed, 432 insertions(+), 433 deletions(-) diff --git a/test/AutoDiff/IRGen/differentiable_function.sil b/test/AutoDiff/IRGen/differentiable_function.sil index d347d801b5112..9acbeef82cd5a 100644 --- a/test/AutoDiff/IRGen/differentiable_function.sil +++ b/test/AutoDiff/IRGen/differentiable_function.sil @@ -33,7 +33,7 @@ bb0: return %result : $@differentiable(reverse) @callee_guaranteed (Float) -> Float } -// CHECK-LABEL: define{{.*}}test_form_diff_func(ptr noalias captures(none) sret(<{ %swift.function, %swift.function, %swift.function }>) +// CHECK-LABEL: define{{.*}}test_form_diff_func(ptr noalias nocapture sret(<{ %swift.function, %swift.function, %swift.function }>) // CHECK-SAME: [[OUT:%.*]]) // CHECK: [[OUT_ORIG:%.*]] = getelementptr{{.*}}[[OUT]], i32 0, i32 0 // CHECK: [[OUT_ORIG_FN:%.*]] = getelementptr{{.*}}[[OUT_ORIG]], i32 0, i32 0 @@ -60,7 +60,7 @@ bb0(%0 : $@differentiable(reverse) @callee_guaranteed (Float) -> Float): return %result : $(@callee_guaranteed (Float) -> Float, @callee_guaranteed (Float) -> (Float, @owned @callee_guaranteed (Float) -> Float), @callee_guaranteed (Float) -> (Float, @owned @callee_guaranteed (Float) -> Float)) } -// CHECK-LABEL: define{{.*}}@test_extract_components(ptr noalias captures(none) sret(<{ %swift.function, %swift.function, %swift.function }>) +// CHECK-LABEL: define{{.*}}@test_extract_components(ptr noalias nocapture sret(<{ %swift.function, %swift.function, %swift.function }>) // CHECK-SAME: [[OUT:%.*]], ptr{{.*}}[[IN:%.*]]) // CHECK: [[ORIG:%.*]] = getelementptr{{.*}}[[IN]], i32 0, i32 0 // CHECK: [[ORIG_FN_ADDR:%.*]] = getelementptr{{.*}}[[ORIG]], i32 0, i32 0 diff --git a/test/DebugInfo/ErrorVar.swift b/test/DebugInfo/ErrorVar.swift index 3025b9931ed43..75c7fccf7a13f 100644 --- a/test/DebugInfo/ErrorVar.swift +++ b/test/DebugInfo/ErrorVar.swift @@ -14,7 +14,7 @@ func simple(_ placeholder: Int64) throws -> () { // CHECK: define {{.*}}void @"$s8ErrorVar6simpleyys5Int64VKF"( // CHECK-SAME: i64 // CHECK-SAME: %swift.refcounted* {{.*}}swiftself - // CHECK-SAME: %swift.error** noalias captures(none) dereferenceable(4) + // CHECK-SAME: %swift.error** noalias nocapture dereferenceable(4) // CHECK: #dbg_declare // CHECK: #dbg_declare({{.*}}, ![[ERROR:[0-9]+]], !DIExpression(DW_OP_deref) // CHECK-DAG: ![[ERRTY:.*]] = !DICompositeType({{.*}}identifier: "$ss5Error_pD" diff --git a/test/Distributed/distributed_actor_accessor_thunks_32bit.swift b/test/Distributed/distributed_actor_accessor_thunks_32bit.swift index 3ea45ea4d043d..ce84f48c868ea 100644 --- a/test/Distributed/distributed_actor_accessor_thunks_32bit.swift +++ b/test/Distributed/distributed_actor_accessor_thunks_32bit.swift @@ -94,7 +94,7 @@ public distributed actor MyOtherActor { // CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple1yySiYaKFTE" -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple1yySiYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* captures(none) %1, i8* %2, i8* %3, {{.*}}, %T27distributed_actor_accessors7MyActorC* [[ACTOR:%.*]], %swift.type* [[DECODER_TYPE:%.*]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple1yySiYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* nocapture %1, i8* %2, i8* %3, {{.*}}, %T27distributed_actor_accessors7MyActorC* [[ACTOR:%.*]], %swift.type* [[DECODER_TYPE:%.*]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) /// Read the current offset and cast an element to `Int` @@ -119,7 +119,7 @@ public distributed actor MyOtherActor { // CHECK: missing-witness1: // CHECK-NEXT: call void @llvm.trap() // CHECK-NEXT: unreachable -// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(%swift.opaque* noalias captures(none) sret(%swift.opaque) [[ARG_0_RES_SLOT]], %swift.type* %arg_type, i8** [[ENCODABLE_WITNESS]], i8** [[DECODABLE_WITNESS]], %T27FakeDistributedActorSystems0A17InvocationDecoderC* swiftself [[DECODER]], %swift.error** noalias captures(none) dereferenceable(4) %swifterror) +// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(%swift.opaque* noalias nocapture sret(%swift.opaque) [[ARG_0_RES_SLOT]], %swift.type* %arg_type, i8** [[ENCODABLE_WITNESS]], i8** [[DECODABLE_WITNESS]], %T27FakeDistributedActorSystems0A17InvocationDecoderC* swiftself [[DECODER]], %swift.error** noalias nocapture dereferenceable(4) %swifterror) // CHECK: store %swift.error* null, %swift.error** %swifterror // CHECK-NEXT: [[ARG_0_VAL_ADDR:%.*]] = bitcast i8* [[ARG_0_VALUE_BUF]] to %TSi* @@ -196,7 +196,7 @@ public distributed actor MyOtherActor { // CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple3ySiSSYaKFTE" /// !!! in `simple3` interesting bits are: argument value extraction (because string is exploded into N arguments) and call to distributed thunk -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple3ySiSSYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* captures(none) [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE:%.*]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple3ySiSSYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* nocapture [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE:%.*]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) // CHECK: [[TYPED_RESULT_BUFF:%.*]] = bitcast i8* [[RESULT_BUFF]] to %TSi* @@ -260,7 +260,7 @@ public distributed actor MyOtherActor { // CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC16single_case_enumyAA7SimpleEOAFYaKFTE" -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC16single_case_enumyAA7SimpleEOAFYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* captures(none) [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC16single_case_enumyAA7SimpleEOAFYaKFTETF"(%swift.context* swiftasync %0, %swift.opaque* nocapture [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) /// Let's check that the call doesn't have any arguments and returns nothing. @@ -307,7 +307,7 @@ public distributed actor MyOtherActor { // CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7complexyAA11LargeStructVSaySiG_AA3ObjCSSSgAFtYaKFTE" -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7complexyAA11LargeStructVSaySiG_AA3ObjCSSSgAFtYaKFTETF"(%swift.context* swiftasync {{.*}}, %swift.opaque* captures(none) [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7complexyAA11LargeStructVSaySiG_AA3ObjCSSSgAFtYaKFTETF"(%swift.context* swiftasync {{.*}}, %swift.opaque* nocapture [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR]], %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) /// First, let's check that all of the different argument types here are loaded correctly. @@ -366,7 +366,7 @@ public distributed actor MyOtherActor { /// ---> Accessor for `genericArgs` -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC11genericArgsyyx_Sayq_GtYaKSeRzSERzSeR_SER_r0_lFTETF"(%swift.context* swiftasync %0, %swift.opaque* captures(none) [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUF:%.*]], i8* [[GENERIC_SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR:%.*]], %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC11genericArgsyyx_Sayq_GtYaKSeRzSERzSeR_SER_r0_lFTETF"(%swift.context* swiftasync %0, %swift.opaque* nocapture [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUF:%.*]], i8* [[GENERIC_SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors7MyActorC* [[ACTOR:%.*]], %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) /// ---> Load `T` @@ -422,7 +422,7 @@ public distributed actor MyOtherActor { /// Let's check that there is argument decoding since parameter list is empty -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors12MyOtherActorC5emptyyyYaKFTETF"(%swift.context* swiftasync {{.*}}, %swift.opaque* captures(none) [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors12MyOtherActorC* {{.*}}, %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors12MyOtherActorC5emptyyyYaKFTETF"(%swift.context* swiftasync {{.*}}, %swift.opaque* nocapture [[ARG_DECODER:%.*]], i8* [[ARG_TYPES:%.*]], i8* [[RESULT_BUFF:%.*]], i8* [[SUBS:%.*]], i8* [[WITNESS_TABLES:%.*]], i32 [[NUM_WITNESS_TABLES:%.*]], %T27distributed_actor_accessors12MyOtherActorC* {{.*}}, %swift.type* [[DECODER_TYPE:%.*]], %swift.type* [[ACTOR_TYPE]], i8** [[DECODER_PROTOCOL_WITNESS:%.*]]) // CHECK-NEXT: entry: // CHECK-NEXT: {{.*}} = alloca %swift.context* // CHECK-NEXT: %swifterror = alloca %swift.error* diff --git a/test/Distributed/distributed_actor_accessor_thunks_64bit.swift b/test/Distributed/distributed_actor_accessor_thunks_64bit.swift index 3a79a53f786fa..43a5ad5da4df0 100644 --- a/test/Distributed/distributed_actor_accessor_thunks_64bit.swift +++ b/test/Distributed/distributed_actor_accessor_thunks_64bit.swift @@ -116,7 +116,7 @@ public distributed actor MyOtherActor { // CHECK: missing-witness1: // CHECK-NEXT: call void @llvm.trap() // CHECK-NEXT: unreachable -// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(ptr noalias sret(%swift.opaque) [[ARG_0_VALUE_BUF]], ptr %arg_type, ptr [[ENCODABLE_WITNESS]], ptr [[DECODABLE_WITNESS]], ptr swiftself [[DECODER]], ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(ptr noalias sret(%swift.opaque) [[ARG_0_VALUE_BUF]], ptr %arg_type, ptr [[ENCODABLE_WITNESS]], ptr [[DECODABLE_WITNESS]], ptr swiftself [[DECODER]], ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: store ptr null, ptr %swifterror // CHECK-NEXT: %._value = getelementptr inbounds{{.*}} %TSi, ptr [[ARG_0_VALUE_BUF]], i32 0, i32 0 diff --git a/test/IRGen/abi_v7k.swift b/test/IRGen/abi_v7k.swift index e2e5bd766650e..cec49c0801a88 100644 --- a/test/IRGen/abi_v7k.swift +++ b/test/IRGen/abi_v7k.swift @@ -296,7 +296,7 @@ func testRet3() -> MyRect2 { } // Returning tuple?: (Int x 6)? -// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax2{{.*}}"(ptr noalias captures(none) sret({{.*}}) %0, i32 %1, i32 %2) +// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax2{{.*}}"(ptr noalias nocapture sret({{.*}}) %0, i32 %1, i32 %2) // V7K-LABEL: _$s8test_v7k7minMax2 // We will indirectly return an optional with the address in r0, input parameters will be in r1 and r2 // V7K: str r0, [sp, [[IDX:#[0-9]+]]] @@ -324,7 +324,7 @@ func minMax2(x : Int, y : Int) -> (min: Int, max: Int, min2: Int, max2: Int, min } // Returning struct?: {Int x 6}? -// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax3{{.*}}"(ptr noalias captures(none) sret({{.*}}) %0, i32 %1, i32 %2) +// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax3{{.*}}"(ptr noalias nocapture sret({{.*}}) %0, i32 %1, i32 %2) // V7K-LABEL: _$s8test_v7k7minMax3 struct Ret { var min:Int diff --git a/test/IRGen/abitypes_objc.swift b/test/IRGen/abitypes_objc.swift index 640d8e500e666..698776b4703ac 100644 --- a/test/IRGen/abitypes_objc.swift +++ b/test/IRGen/abitypes_objc.swift @@ -27,20 +27,20 @@ class Foo { // x86_64-macosx: define internal { <2 x float>, <2 x float> } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { // x86_64-ios: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { // x86_64-ios: define internal { <2 x float>, <2 x float> } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { - // i386-ios: define hidden swiftcc void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr noalias captures(none) sret({{.*}}) %0, ptr swiftself %1) {{.*}} { - // i386-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // i386-ios: define hidden swiftcc void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr noalias nocapture sret({{.*}}) %0, ptr swiftself %1) {{.*}} { + // i386-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { // armv7-ios: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { - // armv7-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // armv7-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { // armv7s-ios: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { - // armv7s-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // armv7s-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { // arm64-ios: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { // arm64-ios: define internal [[ARM64_MYRECT]] @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { // x86_64-tvos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { // x86_64-tvos: define internal { <2 x float>, <2 x float> } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { // arm64-tvos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { // arm64-tvos: define internal [[ARM64_MYRECT]] @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { - // i386-watchos: define hidden swiftcc void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr noalias captures(none) sret({{.*}}) %0, ptr swiftself %1) {{.*}} { - // i386-watchos: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // i386-watchos: define hidden swiftcc void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr noalias nocapture sret({{.*}}) %0, ptr swiftself %1) {{.*}} { + // i386-watchos: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { // armv7k-watchos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { // armv7k-watchos: define internal [[ARMV7K_MYRECT]] @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} { // armv64_32-watchos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { @@ -157,7 +157,7 @@ class Foo { // armv7-ios: define hidden swiftcc float @"$s8abitypes3FooC4barc{{[_0-9a-zA-Z]*}}F"(ptr %0, ptr swiftself %1) {{.*}} { // armv7-ios: [[RESULT:%.*]] = alloca [[RECTTYPE:%.*MyRect.*]], align 4 // armv7-ios: load ptr, ptr @"\01L_selector(newRect)", align 4 - // armv7-ios: call void @objc_msgSend_stret(ptr noalias captures(none) sret({{.*}}) %call.aggresult + // armv7-ios: call void @objc_msgSend_stret(ptr noalias nocapture sret({{.*}}) %call.aggresult // armv7-ios: [[GEP1:%.*]] = getelementptr inbounds [[RECTTYPE]], ptr [[RESULT]], i32 0, i32 1 // armv7-ios: [[GEP2:%.*]] = getelementptr inbounds {{.*}}, ptr [[GEP1]], i32 0, i32 0 // armv7-ios: [[RETVAL:%.*]] = load float, ptr [[GEP2]], align 4 @@ -167,7 +167,7 @@ class Foo { // armv7s-ios: define hidden swiftcc float @"$s8abitypes3FooC4barc{{[_0-9a-zA-Z]*}}F"(ptr %0, ptr swiftself %1) {{.*}} { // armv7s-ios: [[RESULT:%.*]] = alloca [[RECTTYPE:%.*MyRect.*]], align 4 // armv7s-ios: load ptr, ptr @"\01L_selector(newRect)", align 4 - // armv7s-ios: call void @objc_msgSend_stret(ptr noalias captures(none) sret({{.*}}) %call.aggresult + // armv7s-ios: call void @objc_msgSend_stret(ptr noalias nocapture sret({{.*}}) %call.aggresult // armv7s-ios: [[GEP1:%.*]] = getelementptr inbounds [[RECTTYPE]], ptr [[RESULT]], i32 0, i32 1 // armv7s-ios: [[GEP2:%.*]] = getelementptr inbounds {{.*}}, ptr [[GEP1]], i32 0, i32 0 // armv7s-ios: [[RETVAL:%.*]] = load float, ptr [[GEP2]], align 4 @@ -185,7 +185,7 @@ class Foo { } // x86_64-macosx: define hidden swiftcc { double, double, double } @"$s8abitypes3FooC3baz{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} { - // x86_64-macosx: define internal void @"$s8abitypes3FooC3baz{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // x86_64-macosx: define internal void @"$s8abitypes3FooC3baz{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { @objc dynamic func baz() -> Trio { return Trio(i: 1.0, j: 2.0, k: 3.0) } @@ -480,17 +480,17 @@ class Foo { return g.invert(b) } - // x86_64-macosx: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) {{.*}} { + // x86_64-macosx: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) {{.*}} { // x86_64-macosx: [[SEL:%[0-9]+]] = load ptr, ptr @"\01L_selector(negateThrowing:error:)", align 8 // x86_64-macosx: call signext i8 @objc_msgSend(ptr {{%[0-9]+}}, ptr [[SEL]], i8 signext {{%[0-9]+}}, ptr {{%[0-9]+}}) // x86_64-macosx: } - // x86_64-ios: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) {{.*}} { + // x86_64-ios: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) {{.*}} { // x86_64-ios: [[SEL:%[0-9]+]] = load ptr, ptr @"\01L_selector(negateThrowing:error:)", align 8 // x86_64-ios: call zeroext i1 @objc_msgSend(ptr {{%[0-9]+}}, ptr [[SEL]], i1 zeroext {{%[0-9]+}}, ptr {{%[0-9]+}}) // x86_64-ios: } - // i386-ios: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) dereferenceable(4) %2) {{.*}} { + // i386-ios: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture dereferenceable(4) %2) {{.*}} { // i386-ios: [[SEL:%[0-9]+]] = load ptr, ptr @"\01L_selector(negateThrowing:error:)", align 4 // i386-ios: call signext i8 @objc_msgSend(ptr {{%[0-9]+}}, ptr [[SEL]], i8 signext {{%[0-9]+}}, ptr {{%[0-9]+}}) // i386-ios: } @@ -547,18 +547,18 @@ class Foo { } // arm64-ios: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} { - // arm64-ios: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { + // arm64-ios: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { // // arm64e-ios: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} { - // arm64e-ios: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{.*}} { + // arm64e-ios: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{.*}} { // // arm64-tvos: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} { - // arm64-tvos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { + // arm64-tvos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { // arm64-macosx: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} { - // arm64-macosx: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{.*}} { + // arm64-macosx: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{.*}} { // // arm64-watchos: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} { - // arm64-watchos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { + // arm64-watchos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} { @objc dynamic func callJustReturn(_ r: StructReturns, with v: BigStruct) -> BigStruct { return r.justReturn(v) } diff --git a/test/IRGen/access_markers.sil b/test/IRGen/access_markers.sil index ceb722b20d264..2d50adbc076fb 100644 --- a/test/IRGen/access_markers.sil +++ b/test/IRGen/access_markers.sil @@ -95,13 +95,13 @@ sil @testPairedBox : $(@guaranteed { var () }) -> () { bb0(%0 : ${ var () }): // CHECK: entry: %2 = project_box %0 : ${ var () }, 0 - // CHECK-NEXT: call {{.*}}void @writeEmptyTuple(ptr captures(none) undef) + // CHECK-NEXT: call {{.*}}void @writeEmptyTuple(ptr nocapture undef) %3 = begin_access [modify] [dynamic] %2 : $*() %write_fn = function_ref @writeEmptyTuple : $@convention(thin) (@inout ()) -> () apply %write_fn(%3) : $@convention(thin) (@inout ()) -> () end_access %3 : $*() - // CHECK-NEXT: call {{.*}}void @readEmptyTuple(ptr noalias captures(none) undef) + // CHECK-NEXT: call {{.*}}void @readEmptyTuple(ptr noalias nocapture undef) %5 = begin_access [read] [dynamic] %2 : $*() %read_fn = function_ref @readEmptyTuple : $@convention(thin) (@in_guaranteed ()) -> () apply %read_fn(%5) : $@convention(thin) (@in_guaranteed ()) -> () diff --git a/test/IRGen/async_dynamic_replacement.swift b/test/IRGen/async_dynamic_replacement.swift index fb0e699ac4d35..bef67f42375f3 100644 --- a/test/IRGen/async_dynamic_replacement.swift +++ b/test/IRGen/async_dynamic_replacement.swift @@ -26,7 +26,7 @@ public func calls_number() async -> Int { // CHECK-LABEL: define {{.*}}swifttailcc void @"$s25async_dynamic_replacement32indirectReturnDynamicReplaceableSi_S6ityYaKF"(ptr {{.*}}%0, ptr swiftasync %1) // CHECK: forward_to_replaced: -// CHECK: musttail call swifttailcc void {{.*}}(ptr noalias captures(none) %0, ptr swiftasync {{.*}}) +// CHECK: musttail call swifttailcc void {{.*}}(ptr noalias nocapture %0, ptr swiftasync {{.*}}) public dynamic func indirectReturnDynamicReplaceable() async throws -> (Int, Int, Int, Int, Int, Int, Int) { return (0, 0, 0, 0, 0, 0, 0) } diff --git a/test/IRGen/big_types_corner_cases.sil b/test/IRGen/big_types_corner_cases.sil index cd1b8a307e5d0..270cd16c66cf1 100644 --- a/test/IRGen/big_types_corner_cases.sil +++ b/test/IRGen/big_types_corner_cases.sil @@ -38,7 +38,7 @@ public struct BigBigStruct { } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testBitfieldInBlock -// CHECK: call void {{%.*}}(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) +// CHECK: call void {{%.*}}(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) sil @testBitfieldInBlock : $@convention(thin) (@owned @convention(block) (BitfieldOne) -> BitfieldOne, BitfieldOne) -> BitfieldOne { entry(%b : $@convention(block) (BitfieldOne) -> BitfieldOne, %x : $BitfieldOne): %r = apply %b(%x) : $@convention(block) (BitfieldOne) -> BitfieldOne @@ -46,7 +46,7 @@ entry(%b : $@convention(block) (BitfieldOne) -> BitfieldOne, %x : $BitfieldOne): } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testTupleExtract -// CHECK: call void {{%.*}}(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) +// CHECK: call void {{%.*}}(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) sil @testTupleExtract : $@convention(thin) (@owned (BitfieldOne, @convention(block) (BitfieldOne) -> BitfieldOne), BitfieldOne) -> BitfieldOne { entry(%b : $(BitfieldOne, @convention(block) (BitfieldOne) -> (BitfieldOne)), %x : $BitfieldOne): %a = tuple_extract %b : $(BitfieldOne, @convention(block) (BitfieldOne) -> (BitfieldOne)), 1 @@ -54,9 +54,9 @@ entry(%b : $(BitfieldOne, @convention(block) (BitfieldOne) -> (BitfieldOne)), %x return %r : $BitfieldOne } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testBigTempStruct(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %Element) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testBigTempStruct(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %Element) // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases13BigTempStructV -// CHECK: call swiftcc void @testBigTempStruct(ptr noalias captures(none) sret({{.*}}) [[ALLOC]], ptr %1, ptr %Element) +// CHECK: call swiftcc void @testBigTempStruct(ptr noalias nocapture sret({{.*}}) [[ALLOC]], ptr %1, ptr %Element) // CHECK: ret void sil @testBigTempStruct : $@convention(method) (@guaranteed _ArrayBuffer) -> @owned BigTempStruct { bb0(%0 : $_ArrayBuffer): @@ -66,9 +66,9 @@ bb0(%0 : $_ArrayBuffer): return %9 : $BigTempStruct } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testTryApply(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr swiftself %3, ptr noalias captures(none) swifterror dereferenceable(8) %4) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testTryApply(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr swiftself %3, ptr noalias nocapture swifterror dereferenceable(8) %4) // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructV -// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) sret({{.*}}) [[ALLOC]] +// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture sret({{.*}}) [[ALLOC]] // CHECK: ret void sil @testTryApply : $@convention(thin)(() -> (@owned BigStruct, @error Error)) -> (@owned BigStruct, @error Error) { bb0(%0 : $() -> (@owned BigStruct, @error Error)): @@ -82,8 +82,8 @@ bb2(%err : $Error): throw %err : $Error } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testFuncWithModBlockStorageApply(ptr captures(none) dereferenceable({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) -// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) dereferenceable({{.*}}) %1 +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testFuncWithModBlockStorageApply(ptr nocapture dereferenceable({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) +// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture dereferenceable({{.*}}) %1 // CHECK: ret void sil @testFuncWithModBlockStorageApply : $@convention(thin) (@inout_aliasable @block_storage @callee_owned (@owned BigStruct) -> (), BigStruct) -> () { // %0 // user: %5 @@ -109,7 +109,7 @@ sil public_external @c_return_func : $@convention(thin) () -> () -> @owned BigSt // CHECK: [[RET:%.*]] = insertvalue { ptr, ptr } { ptr @"$s17part_apply_calleeTA", ptr undef }, ptr // CHECK: ret { ptr, ptr } [[RET]] -// CHECK-LABEL: define internal swiftcc void @"$s17part_apply_calleeTA"(ptr noalias captures(none) sret({{.*}}) %0, i64 %1, ptr swiftself %2) +// CHECK-LABEL: define internal swiftcc void @"$s17part_apply_calleeTA"(ptr noalias nocapture sret({{.*}}) %0, i64 %1, ptr swiftself %2) // CHECK: ret void sil @part_apply_caller : $@convention(thin) () -> @owned @callee_owned (@owned Builtin.Int64) -> @owned BigStruct { @@ -174,12 +174,12 @@ sil @get_optional_none : $@convention(method) <τ_0_0> (@thin Optional<τ_0_0>.T sil @short_circuit_operation : $@convention(thin) <τ_0_0> (@in Optional<τ_0_0>, @owned @callee_owned () -> (@out τ_0_0, @error Error)) -> (@out τ_0_0, @error Error) sil @autoclosure_partialapply : $@convention(thin) (@owned @callee_owned () -> (BigStruct, @error Error)) -> (@out BigStruct, @error Error) -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @closure(ptr noalias captures(none) sret({{.*}}) %0, ptr %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @closure(ptr noalias nocapture sret({{.*}}) %0, ptr %1) // CHECK-64: [[ALLOC1:%.*]] = alloca %T22big_types_corner_cases9BigStructV // CHECK-64: [[ALLOC2:%.*]] = alloca %T22big_types_corner_cases9BigStructV // CHECK-64: [[ALLOC3:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg // CHECK-64: [[ALLOC4:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg -// CHECK-64: call swiftcc void @"$s22big_types_corner_cases8SuperSubC1fyyFAA9BigStructVycfU_AFyKXKfu_TA"(ptr noalias captures(none) sret({{.*}}) [[ALLOC1]], ptr swiftself {{.*}}, ptr captures(none) swifterror %swifterror) +// CHECK-64: call swiftcc void @"$s22big_types_corner_cases8SuperSubC1fyyFAA9BigStructVycfU_AFyKXKfu_TA"(ptr noalias nocapture sret({{.*}}) [[ALLOC1]], ptr swiftself {{.*}}, ptr nocapture swifterror %swifterror) // CHECK: ret void sil @closure : $@convention(thin) (@owned SuperSub) -> BigStruct { bb0(%0 : $SuperSub): @@ -218,7 +218,7 @@ sil @returnBigStruct : $@convention(thin) () -> @owned BigStruct // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @closureToConvert() // CHECK: entry: // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructV -// CHECK: call swiftcc void @returnBigStruct(ptr noalias captures(none) sret({{.*}}) [[ALLOC]]) +// CHECK: call swiftcc void @returnBigStruct(ptr noalias nocapture sret({{.*}}) [[ALLOC]]) // CHECK: ret void // CHECK-LABEL: } sil @closureToConvert : $@convention(thin) () -> () { @@ -246,11 +246,11 @@ bb0: sil @convertToThickHelper : $@convention(thin) (@owned BigStruct) -> () -// CHECK-LABAL: define {{.*}} swiftcc void @convertToThick(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABAL: define {{.*}} swiftcc void @convertToThick(ptr noalias nocapture dereferenceable({{.*}}) %0) // CHECK: entry: // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructV, align 4 // CHECK: call void @llvm.memcpy.p0.p0.i64 -// CHECK: call swiftcc void @convertToThickHelper(ptr noalias captures(none) dereferenceable({{.*}}) [[ALLOC]], ptr swiftself null) +// CHECK: call swiftcc void @convertToThickHelper(ptr noalias nocapture dereferenceable({{.*}}) [[ALLOC]], ptr swiftself null) // CHECK: ret void // CHECK-LABEL: } sil @convertToThick : $@convention(thin) (@in BigStruct) -> () { diff --git a/test/IRGen/big_types_corner_cases.swift b/test/IRGen/big_types_corner_cases.swift index 15201ff63f3bd..d63789ac579ec 100644 --- a/test/IRGen/big_types_corner_cases.swift +++ b/test/IRGen/big_types_corner_cases.swift @@ -46,7 +46,7 @@ let bigStructGlobalArray : [BigStruct] = [ BigStruct() ] -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} internal swiftcc void @"$s22big_types_corner_cases21OptionalInoutFuncTypeC7executeyys5Error_pSgFyyXEfU_"(ptr captures(none) dereferenceable({{.*}}) %0, ptr %1, ptr captures(none) dereferenceable({{.*}}) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} internal swiftcc void @"$s22big_types_corner_cases21OptionalInoutFuncTypeC7executeyys5Error_pSgFyyXEfU_"(ptr nocapture dereferenceable({{.*}}) %0, ptr %1, ptr nocapture dereferenceable({{.*}}) // CHECK: call void @"$s22big_types_corner_cases9BigStructVSgs5Error_pSgIegng_SgWOe // CHECK: call void @"$s22big_types_corner_cases9BigStructVSgs5Error_pSgIegng_SgWOy // CHECK: ret void @@ -66,9 +66,9 @@ public func f3_uses_f2() { } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10f3_uses_f2yyF"() -// CHECK: call swiftcc void @"$s22big_types_corner_cases9BigStructVACycfC"(ptr noalias captures(none) sret({{.*}}) +// CHECK: call swiftcc void @"$s22big_types_corner_cases9BigStructVACycfC"(ptr noalias nocapture sret({{.*}}) // CHECK: call swiftcc { ptr, ptr } @"$s22big_types_corner_cases13f2_returns_f1AA9BigStructVADcyF"() -// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr noalias captures(none) dereferenceable({{.*}}) {{.*}}, ptr swiftself {{.*}}) +// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr noalias nocapture dereferenceable({{.*}}) {{.*}}, ptr swiftself {{.*}}) // CHECK: ret void public func f4_tuple_use_of_f2() { @@ -81,7 +81,7 @@ public func f4_tuple_use_of_f2() { // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases18f4_tuple_use_of_f2yyF"() // CHECK: [[TUPLE:%.*]] = call swiftcc { ptr, ptr } @"$s22big_types_corner_cases13f2_returns_f1AA9BigStructVADcyF"() // CHECK: [[TUPLE_EXTRACT:%.*]] = extractvalue { ptr, ptr } [[TUPLE]], 0 -// CHECK: call swiftcc void [[TUPLE_EXTRACT]](ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr noalias captures(none) dereferenceable({{.*}}) {{.*}}, ptr swiftself %{{.*}}) +// CHECK: call swiftcc void [[TUPLE_EXTRACT]](ptr noalias nocapture sret({{.*}}) {{.*}}, ptr noalias nocapture dereferenceable({{.*}}) {{.*}}, ptr swiftself %{{.*}}) // CHECK: ret void public class BigClass { @@ -95,8 +95,8 @@ public class BigClass { } } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} hidden swiftcc void @"$s22big_types_corner_cases8BigClassC03useE6Struct0aH0yAA0eH0V_tF"(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr swiftself %1) -// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr swiftself +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} hidden swiftcc void @"$s22big_types_corner_cases8BigClassC03useE6Struct0aH0yAA0eH0V_tF"(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr swiftself %1) +// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr swiftself // CHECK: ret void public struct MyStruct { @@ -134,17 +134,17 @@ public func enumCallee(_ x: LargeEnum) { case .Empty2: break } } -// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10enumCalleeyyAA9LargeEnumOF"(ptr noalias captures(none) dereferenceable({{.*}}) %0) #0 { +// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10enumCalleeyyAA9LargeEnumOF"(ptr noalias nocapture dereferenceable({{.*}}) %0) #0 { // CHECK-64: alloca %T22big_types_corner_cases9LargeEnumO05InnerF0O // CHECK-64: alloca %T22big_types_corner_cases9LargeEnumO // CHECK-64: $ss5print_9separator10terminatoryypd_S2StF // CHECK-64: ret void -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} internal swiftcc void @"$s22big_types_corner_cases8SuperSubC1fyyFAA9BigStructVycfU_"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} internal swiftcc void @"$s22big_types_corner_cases8SuperSubC1fyyFAA9BigStructVycfU_"(ptr noalias nocapture sret({{.*}}) %0, ptr %1) // CHECK-64: [[ALLOC1:%.*]] = alloca %T22big_types_corner_cases9BigStructV // CHECK-64: [[ALLOC2:%.*]] = alloca %T22big_types_corner_cases9BigStructV // CHECK-64: [[ALLOC3:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg -// CHECK-64: call swiftcc void @"$s22big_types_corner_cases9SuperBaseC4boomAA9BigStructVyF"(ptr noalias captures(none) sret({{.*}}) [[ALLOC1]], ptr swiftself {{.*}}) +// CHECK-64: call swiftcc void @"$s22big_types_corner_cases9SuperBaseC4boomAA9BigStructVyF"(ptr noalias nocapture sret({{.*}}) [[ALLOC1]], ptr swiftself {{.*}}) // CHECK: ret void class SuperBase { func boom() -> BigStruct { @@ -164,10 +164,10 @@ class SuperSub : SuperBase { } } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10MUseStructV16superclassMirrorAA03BigF0VSgvg"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) swiftself dereferenceable({{.*}}) %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10MUseStructV16superclassMirrorAA03BigF0VSgvg"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture swiftself dereferenceable({{.*}}) %1) // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg // CHECK: [[LOAD:%.*]] = load ptr, ptr %.callInternalLet.data -// CHECK: call swiftcc void %{{[0-9]+}}(ptr noalias captures(none) sret({{.*}}) [[ALLOC]], ptr swiftself [[LOAD]]) +// CHECK: call swiftcc void %{{[0-9]+}}(ptr noalias nocapture sret({{.*}}) [[ALLOC]], ptr swiftself [[LOAD]]) // CHECK: ret void public struct MUseStruct { var x = BigStruct() @@ -296,9 +296,9 @@ public extension QueryHandler { body(query) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_25query8ReturnedQyd___AA9BigStructVSgtqd___tAA0E0Rd__lF"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias %1, ptr noalias %2, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias swiftself %3) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_25query8ReturnedQyd___AA9BigStructVSgtqd___tAA0E0Rd__lF"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias %1, ptr noalias %2, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias swiftself %3) // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg -// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) sret({{.*}}) [[ALLOC]], ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}) +// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture sret({{.*}}) [[ALLOC]], ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}) // CHECK: ret void func forceHandle_2(query: Q) -> (Q.Returned, BigStruct?) { guard let body = handle_2 as? (Q) -> (Q.Returned, BigStruct?) else { @@ -307,11 +307,11 @@ public extension QueryHandler { return body(query) } -// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_35query8ReturnedQyd___SbAA9BigStructVcSgtqd___tAA0E0Rd__lF"(ptr noalias %0, ptr noalias captures(none) %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias captures(none) swiftself %2) +// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_35query8ReturnedQyd___SbAA9BigStructVcSgtqd___tAA0E0Rd__lF"(ptr noalias %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2) // CHECK-64: {{.*}} = call swiftcc { i64, i64 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}) // CHECK-64: ret { i64, i64 } -// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_35query8ReturnedQyd___SbAA9BigStructVcSgtqd___tAA0E0Rd__lF"(ptr noalias %0, ptr noalias captures(none) %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias captures(none) swiftself %2) +// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_35query8ReturnedQyd___SbAA9BigStructVcSgtqd___tAA0E0Rd__lF"(ptr noalias %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2) // CHECK-32: {{.*}} = call swiftcc { i32, i32 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}) // CHECK-32: ret { i32, i32 } func forceHandle_3(query: Q) -> (Q.Returned, Filter?) { @@ -321,12 +321,12 @@ public extension QueryHandler { return body(query) } -// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0E0Rd__lF"(ptr noalias %0, ptr noalias captures(none) %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias captures(none) swiftself %2, ptr swifterror %3) -// CHECK-64: {{.*}} = call swiftcc { i64, i64 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}, ptr noalias captures(none) swifterror {{.*}}) +// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0E0Rd__lF"(ptr noalias %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2, ptr swifterror %3) +// CHECK-64: {{.*}} = call swiftcc { i64, i64 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}, ptr noalias nocapture swifterror {{.*}}) // CHECK-64: ret { i64, i64 } -// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0E0Rd__lF"(ptr noalias %0, ptr noalias captures(none) %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias captures(none) swiftself %2, ptr swifterror %3) -// CHECK-32: {{.*}} = call swiftcc { i32, i32 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}, ptr noalias captures(none) {{.*}}) +// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0E0Rd__lF"(ptr noalias %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2, ptr swifterror %3) +// CHECK-32: {{.*}} = call swiftcc { i32, i32 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}, ptr noalias nocapture {{.*}}) // CHECK-32: ret { i32, i32 } func forceHandle_4(query: Q) throws -> (Q.Returned, Filter?) { guard let body = handle_4 as? (Q) throws -> (Q.Returned, Filter?) else { diff --git a/test/IRGen/big_types_corner_cases_tiny.swift b/test/IRGen/big_types_corner_cases_tiny.swift index 5ac56700330e7..3907e86260804 100644 --- a/test/IRGen/big_types_corner_cases_tiny.swift +++ b/test/IRGen/big_types_corner_cases_tiny.swift @@ -6,6 +6,6 @@ // CHECK-LABEL: define internal void @{{.*}}WZ // CHECK: [[ALLOC:%.*]] = alloca %T27big_types_corner_cases_tiny30LoadableStructWithBiggerStringV -// CHECK: call swiftcc void {{.*}}(ptr noalias captures(none) sret({{.*}}) [[ALLOC]] +// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture sret({{.*}}) [[ALLOC]] let model = ClassWithLoadableStructWithBiggerString().f() diff --git a/test/IRGen/big_types_tests.sil b/test/IRGen/big_types_tests.sil index dfea630d68daa..acd9a7161a75b 100644 --- a/test/IRGen/big_types_tests.sil +++ b/test/IRGen/big_types_tests.sil @@ -19,7 +19,7 @@ public struct BigStruct { var i8 : Int32 = 8 } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testDestroyValue(ptr noalias captures(none) dereferenceable({{.*}}) #0 { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testDestroyValue(ptr noalias nocapture dereferenceable({{.*}}) #0 { // CHECK-NEXT: entry // CHECK-NEXT: ret void sil @testDestroyValue : $@convention(thin) (@owned BigStruct) -> () { diff --git a/test/IRGen/builtin_pack_length.swift b/test/IRGen/builtin_pack_length.swift index 10de5b275c66e..e543df1d4e020 100644 --- a/test/IRGen/builtin_pack_length.swift +++ b/test/IRGen/builtin_pack_length.swift @@ -31,7 +31,7 @@ func weirdPackCountUse1(_ x: repeat each T) -> Builtin.Word { } struct Pack { -// CHECK: define {{.*}} @"$s8builtins4PackV5countBwvgZ"(i64 returned [[PACK_COUNT:%.*]], ptr captures(none) readnone %"each T") +// CHECK: define {{.*}} @"$s8builtins4PackV5countBwvgZ"(i64 returned [[PACK_COUNT:%.*]], ptr nocapture readnone %"each T") // CHECK-NEXT: entry: // CHECK-NEXT: ret i64 [[PACK_COUNT]] static var count: Builtin.Word { diff --git a/test/IRGen/builtins.swift b/test/IRGen/builtins.swift index 9244a3ddd4356..58bb064e21e7a 100644 --- a/test/IRGen/builtins.swift +++ b/test/IRGen/builtins.swift @@ -638,11 +638,11 @@ func zeroInitializerEmpty() { // isUnique variants // ---------------------------------------------------------------------------- -// CHECK: define hidden {{.*}}void @"$s8builtins26acceptsBuiltinNativeObjectyyBoSgzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define hidden {{.*}}void @"$s8builtins26acceptsBuiltinNativeObjectyyBoSgzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { func acceptsBuiltinNativeObject(_ ref: inout Builtin.NativeObject?) {} // native -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BoSgzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BoSgzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: %[[LD_RC:.+]] = load ptr, ptr %0 // CHECK-NEXT: %[[RET:.+]] = call zeroext i1 @swift_isUniquelyReferenced_native(ptr %[[LD_RC]]) @@ -652,7 +652,7 @@ func isUnique(_ ref: inout Builtin.NativeObject?) -> Bool { } // native nonNull -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BozF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BozF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: %[[LD_RC:.+]] = load ptr, ptr %0 // CHECK: %[[RET:.+]] = call zeroext i1 @swift_isUniquelyReferenced_nonNull_native(ptr %[[LD_RC]]) @@ -661,11 +661,11 @@ func isUnique(_ ref: inout Builtin.NativeObject) -> Bool { return Builtin.isUnique(&ref) } -// CHECK: define hidden {{.*}}void @"$s8builtins16acceptsAnyObjectyyyXlSgzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define hidden {{.*}}void @"$s8builtins16acceptsAnyObjectyyyXlSgzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { func acceptsAnyObject(_ ref: inout Builtin.AnyObject?) {} // ObjC -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_yXlSgzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_yXlSgzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: [[ADDR:%.+]] = getelementptr inbounds{{.*}} [[OPTIONAL_ANYOBJECT_TY:%.*]], ptr %0, i32 0, i32 0 // CHECK-NEXT: [[REF:%.+]] = load ptr, ptr [[ADDR]] @@ -678,7 +678,7 @@ func isUnique(_ ref: inout Builtin.AnyObject?) -> Bool { // ObjC nonNull // CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_yXlzF" -// CHECK-SAME: (ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-SAME: (ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: [[ADDR:%.+]] = getelementptr inbounds{{.*}} %AnyObject, ptr %0, i32 0, i32 0 // CHECK: [[REF:%.+]] = load ptr, ptr [[ADDR]] @@ -690,7 +690,7 @@ func isUnique(_ ref: inout Builtin.AnyObject) -> Bool { } // BridgeObject nonNull -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BbzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_BbzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: %[[LD:.+]] = load ptr, ptr %0 // CHECK: %[[RET:.+]] = call zeroext i1 @swift_isUniquelyReferenced{{(NonObjC)?}}_nonNull_bridgeObject(ptr %[[LD]]) @@ -706,7 +706,7 @@ func assumeTrue(_ x: Builtin.Int1) { Builtin.assume_Int1(x) } // BridgeObject nonNull -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins15isUnique_nativeyBi1_BbzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins15isUnique_nativeyBi1_BbzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: %[[LD:.+]] = load ptr, ptr %0 // CHECK-NEXT: %[[RET:.+]] = call zeroext i1 @swift_isUniquelyReferenced_nonNull_native(ptr %[[LD]]) @@ -716,7 +716,7 @@ func isUnique_native(_ ref: inout Builtin.BridgeObject) -> Bool { } // ImplicitlyUnwrappedOptional argument to isUnique. -// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins11isUniqueIUOyBi1_BoSgzF"(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins11isUniqueIUOyBi1_BoSgzF"(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK: call zeroext i1 @swift_isUniquelyReferenced_native(ptr // CHECK: ret i1 diff --git a/test/IRGen/c_layout.sil b/test/IRGen/c_layout.sil index de1bf5c53832d..bf206477193f2 100644 --- a/test/IRGen/c_layout.sil +++ b/test/IRGen/c_layout.sil @@ -32,7 +32,7 @@ bb0: // CHECK-x86_64: [[RESULT:%.*]] = alloca %TSo11BitfieldOneV, align 8 // CHECK-x86_64: [[ARG:%.*]] = alloca %TSo11BitfieldOneV, align 8 // Make the first call and pull all the values out of the indirect result. -// CHECK-x86_64: call void @createBitfieldOne(ptr noalias captures(none) sret({{.*}}) [[RESULT]]) +// CHECK-x86_64: call void @createBitfieldOne(ptr noalias nocapture sret({{.*}}) [[RESULT]]) // CHECK-x86_64: [[ADDR_A:%.*]] = getelementptr inbounds{{.*}} %TSo11BitfieldOneV, ptr [[RESULT]], i32 0, i32 0 // CHECK-x86_64: [[ADDR_A_V:%.*]] = getelementptr inbounds{{.*}} %Ts6UInt32V, ptr [[ADDR_A]], i32 0, i32 0 // CHECK-x86_64: [[A:%.*]] = load i32, ptr [[ADDR_A_V]], align 8 @@ -102,7 +102,7 @@ sil public_external @consumeSIMDStruct : $@convention(c) (SIMDStruct) -> () // CHECK-x86_64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testSIMDStruct() // CHECK-SYSV-x86_64: call <3 x float> @createSIMDStruct -// CHECK-WIN-x86_64: call void @createSIMDStruct(ptr noalias captures(none) sret({{.*}}) % +// CHECK-WIN-x86_64: call void @createSIMDStruct(ptr noalias nocapture sret({{.*}}) % // CHECK-SYSV-x86_64: call void @consumeSIMDStruct(<3 x float> // CHECK-WIN-x86_64: call void @consumeSIMDStruct(ptr % sil @testSIMDStruct : $() -> () { @@ -389,8 +389,8 @@ entry(%b : $@convention(block) (CChar) -> CChar, %c : $CChar): } // CHECK-x86_64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testBitfieldInBlock -// CHECK-SYSV-x86_64: call void {{%.*}}(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) -// CHECK-WIN-x86_64: call void {{%.*}}(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr {{%.*}}) +// CHECK-SYSV-x86_64: call void {{%.*}}(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) +// CHECK-WIN-x86_64: call void {{%.*}}(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr {{%.*}}, ptr {{%.*}}) sil @testBitfieldInBlock : $@convention(thin) (@owned @convention(block) (BitfieldOne) -> BitfieldOne, BitfieldOne) -> BitfieldOne { entry(%b : $@convention(block) (BitfieldOne) -> BitfieldOne, %x : $BitfieldOne): %r = apply %b(%x) : $@convention(block) (BitfieldOne) -> BitfieldOne diff --git a/test/IRGen/casts.sil b/test/IRGen/casts.sil index 64b00ad43cd60..13f0967353f4f 100644 --- a/test/IRGen/casts.sil +++ b/test/IRGen/casts.sil @@ -15,7 +15,7 @@ class B: A {} sil_vtable A {} sil_vtable B {} -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @unchecked_addr_cast(ptr noalias captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @unchecked_addr_cast(ptr noalias nocapture dereferenceable({{.*}}) %0) {{.*}} { sil @unchecked_addr_cast : $(@in A) -> B { entry(%a : $*A): %b = unchecked_addr_cast %a : $*A to $*B diff --git a/test/IRGen/class_field_other_module.swift b/test/IRGen/class_field_other_module.swift index 0b5622885f236..7785283301891 100644 --- a/test/IRGen/class_field_other_module.swift +++ b/test/IRGen/class_field_other_module.swift @@ -7,7 +7,7 @@ import other_class -// CHECK-LABEL: define {{(protected )?}}{{(dllexport )?}}swiftcc i32 @"$s24class_field_other_module12getSubclassXys5Int32V0c1_A00F0CF"(ptr captures(none) readonly %0) +// CHECK-LABEL: define {{(protected )?}}{{(dllexport )?}}swiftcc i32 @"$s24class_field_other_module12getSubclassXys5Int32V0c1_A00F0CF"(ptr nocapture readonly %0) // CHECK-NEXT: entry: // An Int32 after the heap object header // CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} i8, ptr %0, i64 16 @@ -17,7 +17,7 @@ public func getSubclassX(_ o: Subclass) -> Int32 { return o.x } -// CHECK-LABEL: define {{(protected )?}}{{(dllexport )?}}swiftcc i32 @"$s24class_field_other_module12getSubclassYys5Int32V0c1_A00F0CF"(ptr captures(none) readonly %0) +// CHECK-LABEL: define {{(protected )?}}{{(dllexport )?}}swiftcc i32 @"$s24class_field_other_module12getSubclassYys5Int32V0c1_A00F0CF"(ptr nocapture readonly %0) // CHECK-NEXT: entry: // An Int32 after an Int32 after the heap object header // CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} i8, ptr %0, i64 20 diff --git a/test/IRGen/conditional_conformances_class_with_defaulted_method.swift b/test/IRGen/conditional_conformances_class_with_defaulted_method.swift index 05b321bd9b5ca..1118b4ba4803d 100644 --- a/test/IRGen/conditional_conformances_class_with_defaulted_method.swift +++ b/test/IRGen/conditional_conformances_class_with_defaulted_method.swift @@ -12,4 +12,4 @@ extension Foo { } class Box {} extension Box: Foo where T: Foo {} -// CHECK-LABEL: define internal swiftcc void @"$s1x3BoxCyqd__GAA3FooA2aEP3baryyFTW"(ptr noalias captures(none) swiftself dereferenceable({{[48]}}) %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define internal swiftcc void @"$s1x3BoxCyqd__GAA3FooA2aEP3baryyFTW"(ptr noalias nocapture swiftself dereferenceable({{[48]}}) %0, ptr %Self, ptr %SelfWitnessTable) diff --git a/test/IRGen/coroutine_accessors.swift b/test/IRGen/coroutine_accessors.swift index f6700e3843bf1..0b3f586f9f41c 100644 --- a/test/IRGen/coroutine_accessors.swift +++ b/test/IRGen/coroutine_accessors.swift @@ -126,7 +126,7 @@ public var irm: Int { // CHECK-LABEL: define{{.*}} { ptr, ptr } @"$s19coroutine_accessors1SV3irmSivx"( // CHECK-SAME: ptr noalias [[FRAME:%[^,]+]], // CHECK-SAME: ptr swiftcoro [[ALLOCATOR:%[^,]+]], -// CHECK-SAME: ptr captures(none) swiftself dereferenceable({{8|16}}) [[SELF:%[^)]+]] +// CHECK-SAME: ptr nocapture swiftself dereferenceable({{8|16}}) [[SELF:%[^)]+]] // CHECK-SAME: ) // CHECK-SAME: { // CHECK: [[ID:%[^,]+]] = call token @llvm.coro.id.retcon.once.dynamic( @@ -293,7 +293,7 @@ public var force_yield_once_2_convention : () { // CHECK-LABEL: define{{.*}} { ptr, ptr } @increment_irm_yield_once_2( // ptr noalias %0 // CHECK-SAME: ptr swiftcoro [[ALLOCATOR:%[^,]+]] -// ptr captures(none) swiftself dereferenceable(16) %2 +// ptr nocapture swiftself dereferenceable(16) %2 // CHECK-SAME: ) // CHECK-SAME: { // : [[SIZE_32:%[^,]+]] = load i32 diff --git a/test/IRGen/coroutine_accessors_backdeploy_async_56.swift b/test/IRGen/coroutine_accessors_backdeploy_async_56.swift index 327fb4abd943a..5ad8a79ac62d4 100644 --- a/test/IRGen/coroutine_accessors_backdeploy_async_56.swift +++ b/test/IRGen/coroutine_accessors_backdeploy_async_56.swift @@ -126,7 +126,7 @@ public var i: Int { // CHECK-LABEL: define{{.*}} void @increment_i_async( // ptr swiftasync %0 -// CHECK-SAME: ptr captures(none) swiftself dereferenceable({{8|4}}) %1 +// CHECK-SAME: ptr nocapture swiftself dereferenceable({{8|4}}) %1 // CHECK-SAME: ) // CHECK-SAME: { // : [[SIZE_32:%[^,]+]] = load i32 diff --git a/test/IRGen/coroutine_accessors_backdeploy_async_57.swift b/test/IRGen/coroutine_accessors_backdeploy_async_57.swift index 987332e34c1c8..117c310ef3aea 100644 --- a/test/IRGen/coroutine_accessors_backdeploy_async_57.swift +++ b/test/IRGen/coroutine_accessors_backdeploy_async_57.swift @@ -101,7 +101,7 @@ public var i: Int { // CHECK-LABEL: define{{.*}} void @increment_i_async( // ptr swiftasync %0 -// CHECK-SAME: ptr captures(none) swiftself dereferenceable({{8|4}}) %1 +// CHECK-SAME: ptr nocapture swiftself dereferenceable({{8|4}}) %1 // CHECK-SAME: ) // CHECK-SAME: { // : [[SIZE_32:%[^,]+]] = load i32 diff --git a/test/IRGen/dependent_reabstraction.swift b/test/IRGen/dependent_reabstraction.swift index 5eed638512ca9..c0250b8f00b17 100644 --- a/test/IRGen/dependent_reabstraction.swift +++ b/test/IRGen/dependent_reabstraction.swift @@ -8,7 +8,7 @@ protocol A { } struct X : A { - // CHECK-LABEL: define internal swiftcc void @"$s23dependent_reabstraction1XVyxGAA1AA2aEP1byy1BQzFTW"(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) + // CHECK-LABEL: define internal swiftcc void @"$s23dependent_reabstraction1XVyxGAA1AA2aEP1byy1BQzFTW"(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) func b(_ b: X.Type) { let x: Any = b markUsed(b as X.Type) diff --git a/test/IRGen/enum.sil b/test/IRGen/enum.sil index fe7863687dfea..bea3454e41a98 100644 --- a/test/IRGen/enum.sil +++ b/test/IRGen/enum.sil @@ -238,7 +238,7 @@ dest(%u2 : $(Builtin.Int64, Builtin.Int64)): return %x : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: br label %[[DEST:[0-9]+]] // CHECK: [[DEST]]: @@ -274,7 +274,7 @@ entry(%0 : $Builtin.Int64, %1 : $Builtin.Int64): return %u : $Singleton } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_inject_indirect(i64 %0, i64 %1, ptr captures(none) dereferenceable({{.*}}) %2) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_inject_indirect(i64 %0, i64 %1, ptr nocapture dereferenceable({{.*}}) %2) {{.*}} { // CHECK: entry: // CHECK: [[DATA_0_ADDR:%.*]] = getelementptr inbounds{{.*}} <{ i64, i64 }>, ptr %2, i32 0, i32 0 // CHECK: store i64 %0, ptr [[DATA_0_ADDR]] @@ -349,7 +349,7 @@ end: return %x : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { sil @no_payload_switch_indirect : $@convention(thin) (@inout NoPayloads) -> () { entry(%u : $*NoPayloads): // CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T4enum10NoPayloadsO, ptr %0, i32 0, i32 0 @@ -398,7 +398,7 @@ entry: return %u : $NoPayloads } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_inject_z_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_inject_z_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T4enum10NoPayloadsO, ptr %0, i32 0, i32 0 // CHECK: store i8 2, ptr [[TAG_ADDR]] @@ -629,7 +629,7 @@ entry(%0 : $Builtin.Word): return %u : $SinglePayloadNoXI2 } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_x_indirect([[WORD]] %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_x_indirect([[WORD]] %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK: entry: // CHECK: store [[WORD]] %0, ptr %1 // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %T4enum18SinglePayloadNoXI2O, ptr %1, i32 0, i32 1 @@ -655,7 +655,7 @@ entry: return %u : $SinglePayloadNoXI2 } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_y_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_y_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: store [[WORD]] 0, ptr %0 // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %T4enum18SinglePayloadNoXI2O, ptr %0, i32 0, i32 1 @@ -992,7 +992,7 @@ entry(%0 : $Builtin.Int63): return %u : $SinglePayloadSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[T:%.*]] = trunc i64 %0 to i63 // CHECK-64: [[BYTE:%.*]] = zext i63 [[T]] to i64 @@ -1019,7 +1019,7 @@ entry: return %u : $SinglePayloadSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_y_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_y_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0x8000_0000_0000_0000 // CHECK-64: store i64 -9223372036854775808, ptr %0 @@ -1304,7 +1304,7 @@ end(%z : $()): return %z : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc i8 @dynamic_single_payload_empty_payload_load(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc i8 @dynamic_single_payload_empty_payload_load(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: %1 = load i8, ptr %0 // CHECK: ret i8 %1 @@ -1315,7 +1315,7 @@ entry(%p : $*DynamicSinglePayload<()>): return %x : $DynamicSinglePayload<()> } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_empty_payload_store(ptr captures(none) dereferenceable({{.*}}) %0, i8 %1) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_empty_payload_store(ptr nocapture dereferenceable({{.*}}) %0, i8 %1) {{.*}} { // CHECK: entry: // CHECK: store i8 %1, ptr %0 // CHECK: ret void @@ -1440,7 +1440,7 @@ end: return %v : $() } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bits_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bits_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { sil @multi_payload_no_spare_bits_switch_indirect : $(@inout MultiPayloadNoSpareBits) -> () { entry(%u : $*MultiPayloadNoSpareBits): // CHECK-64: [[PAYLOAD:%.*]] = load i64, ptr %0 @@ -1494,7 +1494,7 @@ entry(%0 : $Builtin.Int64): return %u : $MultiPayloadNoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: store i64 %0, ptr %1 // CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T4enum23MultiPayloadNoSpareBitsO, ptr %1, i32 0, i32 1 @@ -1547,7 +1547,7 @@ entry: return %u : $MultiPayloadNoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // CHECK-64: store i64 0, ptr %0 // CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T4enum23MultiPayloadNoSpareBitsO, ptr %0, i32 0, i32 1 @@ -1736,7 +1736,7 @@ entry(%0 : $Builtin.Int62): return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i62 // CHECK-64: [[BYTE:%.*]] = zext i62 [[NATIVECC_TRUNC]] to i64 @@ -1774,7 +1774,7 @@ entry(%0 : $Builtin.Int63): return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_y_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_y_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i63 // CHECK-64: [[BYTE:%.*]] = zext i63 [[NATIVECC_TRUNC]] to i64 @@ -1824,7 +1824,7 @@ entry: return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0x8000_0000_0000_0000 // CHECK-64: store i64 -9223372036854775808, ptr %0 @@ -1968,7 +1968,7 @@ entry(%0 : $Builtin.Int62): return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i62 // CHECK-64: [[BYTE:%.*]] = zext i62 [[NATIVECC_TRUNC]] to i64 @@ -2002,7 +2002,7 @@ entry(%0 : $Builtin.Int60): return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_y_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_y_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i60 // CHECK-64: [[BYTE:%.*]] = zext i60 [[NATIVECC_TRUNC]] to i64 @@ -2049,7 +2049,7 @@ entry: return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0xC000_0000_0000_0000 // CHECK-64: store i64 -4611686018427387904, ptr %0 @@ -2254,7 +2254,7 @@ enum MultiPayloadNestedSpareBits { case B(MultiPayloadInnerSpareBits) } -// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_nested_spare_bits_switch(ptr noalias captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_nested_spare_bits_switch(ptr noalias nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // CHECK-64: %1 = load [[WORD]], ptr %0 // CHECK-64: %2 = lshr [[WORD]] %1, 61 @@ -2326,7 +2326,7 @@ enum MultiPayloadAddressOnlyFixed { case Y(Builtin.Int32) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_address_only_destroy(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_address_only_destroy(ptr noalias nocapture dereferenceable({{.*}}) %0) sil @multi_payload_address_only_destroy : $@convention(thin) (@in MultiPayloadAddressOnlyFixed) -> () { entry(%m : $*MultiPayloadAddressOnlyFixed): destroy_addr %m : $*MultiPayloadAddressOnlyFixed diff --git a/test/IRGen/enum_derived.swift b/test/IRGen/enum_derived.swift index c15b4820f36ee..02f91193ec81d 100644 --- a/test/IRGen/enum_derived.swift +++ b/test/IRGen/enum_derived.swift @@ -48,8 +48,8 @@ extension def_enum.TrafficLight : Error {} extension def_enum.Term : Error {} -// CHECK-NORMAL-LABEL: define hidden {{.*}}i64 @"$s12enum_derived7PhantomO8rawValues5Int64Vvg"(i8 %0, ptr captures(none) readnone %T) local_unnamed_addr -// CHECK-TESTABLE-LABEL: define{{( dllexport)?}}{{( protected)?}} {{.*}}i64 @"$s12enum_derived7PhantomO8rawValues5Int64Vvg"(i8 %0, ptr captures(none) readnone %T) +// CHECK-NORMAL-LABEL: define hidden {{.*}}i64 @"$s12enum_derived7PhantomO8rawValues5Int64Vvg"(i8 %0, ptr nocapture readnone %T) local_unnamed_addr +// CHECK-TESTABLE-LABEL: define{{( dllexport)?}}{{( protected)?}} {{.*}}i64 @"$s12enum_derived7PhantomO8rawValues5Int64Vvg"(i8 %0, ptr nocapture readnone %T) enum Phantom : Int64 { case Up diff --git a/test/IRGen/enum_future.sil b/test/IRGen/enum_future.sil index 8ad6d46bacff7..f9b48420f53ce 100644 --- a/test/IRGen/enum_future.sil +++ b/test/IRGen/enum_future.sil @@ -242,7 +242,7 @@ dest(%u2 : $(Builtin.Int64, Builtin.Int64)): return %x : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: br label %[[DEST:[0-9]+]] // CHECK: [[DEST]]: @@ -278,7 +278,7 @@ entry(%0 : $Builtin.Int64, %1 : $Builtin.Int64): return %u : $Singleton } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_inject_indirect(i64 %0, i64 %1, ptr captures(none) dereferenceable({{.*}}) %2) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_inject_indirect(i64 %0, i64 %1, ptr nocapture dereferenceable({{.*}}) %2) {{.*}} { // CHECK: entry: // CHECK: [[DATA_0_ADDR:%.*]] = getelementptr inbounds{{.*}} <{ i64, i64 }>, ptr %2, i32 0, i32 0 // CHECK: store i64 %0, ptr [[DATA_0_ADDR]] @@ -353,7 +353,7 @@ end: return %x : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { sil @no_payload_switch_indirect : $@convention(thin) (@inout NoPayloads) -> () { entry(%u : $*NoPayloads): // CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T11enum_future10NoPayloadsO, ptr %0, i32 0, i32 0 @@ -402,7 +402,7 @@ entry: return %u : $NoPayloads } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_inject_z_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @no_payload_inject_z_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T11enum_future10NoPayloadsO, ptr %0, i32 0, i32 0 // CHECK: store i8 2, ptr [[TAG_ADDR]] @@ -633,7 +633,7 @@ entry(%0 : $Builtin.Word): return %u : $SinglePayloadNoXI2 } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_x_indirect([[WORD]] %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_x_indirect([[WORD]] %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK: entry: // CHECK: store [[WORD]] %0, ptr %1 // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %T11enum_future18SinglePayloadNoXI2O, ptr %1, i32 0, i32 1 @@ -659,7 +659,7 @@ entry: return %u : $SinglePayloadNoXI2 } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_y_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_no_xi_inject_y_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: store [[WORD]] 0, ptr %0 // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %T11enum_future18SinglePayloadNoXI2O, ptr %0, i32 0, i32 1 @@ -996,7 +996,7 @@ entry(%0 : $Builtin.Int63): return %u : $SinglePayloadSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[T:%.*]] = trunc i64 %0 to i63 // CHECK-64: [[BYTE:%.*]] = zext i63 [[T]] to i64 @@ -1023,7 +1023,7 @@ entry: return %u : $SinglePayloadSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_y_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @single_payload_spare_bit_inject_y_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0x8000_0000_0000_0000 // CHECK-64: store i64 -9223372036854775808, ptr %0 @@ -1308,7 +1308,7 @@ end(%z : $()): return %z : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc i8 @dynamic_single_payload_empty_payload_load(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc i8 @dynamic_single_payload_empty_payload_load(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: entry: // CHECK: %1 = load i8, ptr %0 // CHECK: ret i8 %1 @@ -1319,7 +1319,7 @@ entry(%p : $*DynamicSinglePayload<()>): return %x : $DynamicSinglePayload<()> } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_empty_payload_store(ptr captures(none) dereferenceable({{.*}}) %0, i8 %1) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_empty_payload_store(ptr nocapture dereferenceable({{.*}}) %0, i8 %1) {{.*}} { // CHECK: entry: // CHECK: store i8 %1, ptr %0 // CHECK: ret void @@ -1444,7 +1444,7 @@ end: return %v : $() } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bits_switch_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bits_switch_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { sil @multi_payload_no_spare_bits_switch_indirect : $(@inout MultiPayloadNoSpareBits) -> () { entry(%u : $*MultiPayloadNoSpareBits): // CHECK-64: [[PAYLOAD:%.*]] = load i64, ptr %0 @@ -1498,7 +1498,7 @@ entry(%0 : $Builtin.Int64): return %u : $MultiPayloadNoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: store i64 %0, ptr %1 // CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T11enum_future23MultiPayloadNoSpareBitsO, ptr %1, i32 0, i32 1 @@ -1551,7 +1551,7 @@ entry: return %u : $MultiPayloadNoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_no_spare_bit_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // CHECK-64: store i64 0, ptr %0 // CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T11enum_future23MultiPayloadNoSpareBitsO, ptr %0, i32 0, i32 1 @@ -1740,7 +1740,7 @@ entry(%0 : $Builtin.Int62): return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i62 // CHECK-64: [[VAL:%.*]] = zext i62 [[NATIVECC_TRUNC]] to i64 @@ -1778,7 +1778,7 @@ entry(%0 : $Builtin.Int63): return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_y_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_y_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i63 // CHECK-64: [[VAL:%.*]] = zext i63 [[NATIVECC_TRUNC]] to i64 @@ -1828,7 +1828,7 @@ entry: return %u : $MultiPayloadOneSpareBit } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_one_spare_bit_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0x8000_0000_0000_0000 // CHECK-64: store i64 -9223372036854775808, ptr %0 @@ -1972,7 +1972,7 @@ entry(%0 : $Builtin.Int62): return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_x_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_x_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i62 // CHECK-64: [[VAL:%.*]] = zext i62 [[NATIVECC_TRUNC]] to i64 @@ -2006,7 +2006,7 @@ entry(%0 : $Builtin.Int60): return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_y_indirect(i64 %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_y_indirect(i64 %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK-64: entry: // CHECK-64: [[NATIVECC_TRUNC:%.*]] = trunc i64 %0 to i60 // CHECK-64: [[VAL:%.*]] = zext i60 [[NATIVECC_TRUNC]] to i64 @@ -2053,7 +2053,7 @@ entry: return %u : $MultiPayloadTwoSpareBits } -// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_a_indirect(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_two_spare_bits_inject_a_indirect(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // -- 0xC000_0000_0000_0000 // CHECK-64: store i64 -4611686018427387904, ptr %0 @@ -2258,7 +2258,7 @@ enum MultiPayloadNestedSpareBits { case B(MultiPayloadInnerSpareBits) } -// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_nested_spare_bits_switch(ptr noalias captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_nested_spare_bits_switch(ptr noalias nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-64: entry: // CHECK-64: %1 = load [[WORD]], ptr %0 // CHECK-64: %2 = lshr [[WORD]] %1, 61 @@ -2330,7 +2330,7 @@ enum MultiPayloadAddressOnlyFixed { case Y(Builtin.Int32) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_address_only_destroy(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_address_only_destroy(ptr noalias nocapture dereferenceable({{.*}}) %0) sil @multi_payload_address_only_destroy : $@convention(thin) (@in MultiPayloadAddressOnlyFixed) -> () { entry(%m : $*MultiPayloadAddressOnlyFixed): destroy_addr %m : $*MultiPayloadAddressOnlyFixed diff --git a/test/IRGen/enum_resilience.swift b/test/IRGen/enum_resilience.swift index 0e3aa8c151146..3b73cb7ac1a3f 100644 --- a/test/IRGen/enum_resilience.swift +++ b/test/IRGen/enum_resilience.swift @@ -260,7 +260,7 @@ public func resilientEnumPartialApply(_ f: (Medium) -> Int) { } -// CHECK-LABEL: define internal swiftcc void @"$s14resilient_enum6MediumOSiIgnd_ACSiIegnr_TRTA"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias %1, ptr swiftself %2) +// CHECK-LABEL: define internal swiftcc void @"$s14resilient_enum6MediumOSiIgnd_ACSiIegnr_TRTA"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias %1, ptr swiftself %2) // Enums with resilient payloads from a different resilience domain diff --git a/test/IRGen/errors.sil b/test/IRGen/errors.sil index 217f619b8077c..fbb5d067594a3 100644 --- a/test/IRGen/errors.sil +++ b/test/IRGen/errors.sil @@ -79,8 +79,8 @@ entry(%0 : $AnyObject): // CHECK-wasm32: [[ERRORSLOT:%.*]] = alloca [[SWIFTERROR:.*]] ptr, align // CHECK-NEXT: store ptr null, ptr [[ERRORSLOT]], align - // CHECK-objc-NEXT: [[RESULT:%.*]] = call swiftcc ptr @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias captures(none) [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) [[ERRORSLOT]]) - // CHECK-native-NEXT: [[RESULT:%.*]] = call swiftcc ptr @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias captures(none) [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) [[ERRORSLOT]]) + // CHECK-objc-NEXT: [[RESULT:%.*]] = call swiftcc ptr @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias nocapture [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) [[ERRORSLOT]]) + // CHECK-native-NEXT: [[RESULT:%.*]] = call swiftcc ptr @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias nocapture [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) [[ERRORSLOT]]) // CHECK-NEXT: [[ERR:%.*]] = load ptr, ptr [[ERRORSLOT]], align // CHECK-NEXT: [[T0:%.*]] = icmp ne ptr [[ERR]], null // CHECK-NEXT: ptrtoint ptr [[ERR]] to i @@ -116,7 +116,7 @@ enum ColorError : Error { } // CHECK-LABEL: TestCallToWillThrowCallBack -// CHECK: call swiftcc void @swift_willThrow(ptr swiftself undef, ptr noalias captures(none) readonly [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) %2) +// CHECK: call swiftcc void @swift_willThrow(ptr swiftself undef, ptr noalias nocapture readonly [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) %2) // CHECK: store ptr %0 // CHECK: ret i64 undef sil hidden @TestCallToWillThrowCallBack : $@convention(thin) (@owned Error) -> (Int64, @error Error) { diff --git a/test/IRGen/existentials_objc.sil b/test/IRGen/existentials_objc.sil index 616a7c4b27b53..dc3be933dd6a3 100644 --- a/test/IRGen/existentials_objc.sil +++ b/test/IRGen/existentials_objc.sil @@ -22,7 +22,7 @@ bb0(%0 : $*Any, %1 : $T): return %3 : $() } -// CHECK-DAG: define{{( protected)?}} swiftcc void @init_opaque_existential(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %T) {{.*}} { +// CHECK-DAG: define{{( protected)?}} swiftcc void @init_opaque_existential(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %T) {{.*}} { // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} [[ANY:%Any]], ptr %0, i32 0, i32 1 // CHECK-NEXT: store ptr %T, ptr [[T0]], align 8 // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[ANY]], ptr %0, i32 0, i32 0 @@ -37,7 +37,7 @@ bb0(%0 : $*Any, %1 : $*Any): return %3 : $() } -// CHECK-DAG: define{{( protected)?}} swiftcc void @take_opaque_existential(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-DAG: define{{( protected)?}} swiftcc void @take_opaque_existential(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK: call ptr @"$sypWOb"(ptr %1, ptr %0) // CHECK-NEXT: ret void diff --git a/test/IRGen/extern_c_abitypes.swift b/test/IRGen/extern_c_abitypes.swift index 4a14163612ec4..34a9c818eb092 100644 --- a/test/IRGen/extern_c_abitypes.swift +++ b/test/IRGen/extern_c_abitypes.swift @@ -101,12 +101,12 @@ func test() { // assume %struct.c_struct and %TSo8c_structV have compatible layout // - // CHECK-x86_64: call void @c_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) - // CHECK-x86_64: call void @swift_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) - // CHECK-arm64: call void @c_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) - // CHECK-arm64: call void @swift_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) - // CHECK-wasm32: call void @c_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) - // CHECK-wasm32: call void @swift_roundtrip_c_struct(ptr noalias captures(none) sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) + // CHECK-x86_64: call void @c_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) + // CHECK-x86_64: call void @swift_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) + // CHECK-arm64: call void @c_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) + // CHECK-arm64: call void @swift_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) + // CHECK-wasm32: call void @c_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}}) + // CHECK-wasm32: call void @swift_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}}) // CHECK-armv7k: call [3 x i32] @c_roundtrip_c_struct([3 x i32] {{.*}}) // CHECK-armv7k: call [3 x i32] @swift_roundtrip_c_struct([3 x i32] {{.*}}) var c_struct_val = c_struct(foo: 496, bar: 28, baz: 8) diff --git a/test/IRGen/fixlifetime.sil b/test/IRGen/fixlifetime.sil index df298bfb85831..c6c971758c49e 100644 --- a/test/IRGen/fixlifetime.sil +++ b/test/IRGen/fixlifetime.sil @@ -8,7 +8,7 @@ // unnecessary. // ONONE-NOT: @__swift_fixLifetime -// CHECK-objc-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr noalias captures(none) dereferenceable({{.*}}) %5, {{(i64|i32)}} %6, {{(i64|i32)}} %7) {{.*}} { +// CHECK-objc-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr noalias nocapture dereferenceable({{.*}}) %5, {{(i64|i32)}} %6, {{(i64|i32)}} %7) {{.*}} { // CHECK-objc: entry: // CHECK-objc: call void @__swift_fixLifetime(ptr // CHECK-objc: call void @__swift_fixLifetime(ptr @@ -20,7 +20,7 @@ // CHECK-objc: call void @__swift_fixLifetime(ptr [[TEMP]]) // CHECK-objc: call void @__swift_fixLifetime(ptr -// CHECK-native-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr noalias captures(none) dereferenceable({{.*}}) %5, {{(i64|i32)}} %6, {{(i64|i32)}} %7) {{.*}} { +// CHECK-native-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test(ptr %0, ptr %1, ptr %2, ptr %3, ptr %4, ptr noalias nocapture dereferenceable({{.*}}) %5, {{(i64|i32)}} %6, {{(i64|i32)}} %7) {{.*}} { // CHECK-native: entry: // CHECK-native: call void @__swift_fixLifetime(ptr // CHECK-native: call void @__swift_fixLifetime(ptr diff --git a/test/IRGen/function_param_convention.sil b/test/IRGen/function_param_convention.sil index a3190feccaa4c..124b964fefd72 100644 --- a/test/IRGen/function_param_convention.sil +++ b/test/IRGen/function_param_convention.sil @@ -10,7 +10,7 @@ struct X { // Make sure we can irgen a SIL function with various parameter attributes // without choking. This is just a basic reality check. -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @foo(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1, ptr captures(none) dereferenceable({{.*}}) %2, ptr noalias captures(none) dereferenceable({{.*}}) %3, i32 %4, i32 %5, i32 %6) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @foo(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1, ptr nocapture dereferenceable({{.*}}) %2, ptr noalias nocapture dereferenceable({{.*}}) %3, i32 %4, i32 %5, i32 %6) {{.*}} { sil @foo : $@convention(thin) (@in X, @inout X, @in_guaranteed X, @owned X, X, @guaranteed X) -> @out X { bb0(%0 : $*X, %1 : $*X, %2 : $*X, %3 : $*X, %4 : $X, %5 : $X, %6 : $X): diff --git a/test/IRGen/function_types.sil b/test/IRGen/function_types.sil index d0857262b668b..c2d022bd9ba32 100644 --- a/test/IRGen/function_types.sil +++ b/test/IRGen/function_types.sil @@ -52,9 +52,9 @@ struct X {} sil @out_void_return : $@convention(thin) () -> @out X -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @use_void_return_value(ptr noalias captures(none) sret({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @use_void_return_value(ptr noalias nocapture sret({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: -// CHECK-NEXT: call swiftcc void @out_void_return(ptr noalias captures(none) sret({{.*}}) %0) +// CHECK-NEXT: call swiftcc void @out_void_return(ptr noalias nocapture sret({{.*}}) %0) // CHECK-NEXT: ret void // CHECK-NEXT: } sil @use_void_return_value : $@convention(thin) () -> @out X { diff --git a/test/IRGen/generic_casts.swift b/test/IRGen/generic_casts.swift index 83ce916536feb..4d34360cb01e0 100644 --- a/test/IRGen/generic_casts.swift +++ b/test/IRGen/generic_casts.swift @@ -58,7 +58,7 @@ func intToAll(_ x: Int) -> T { return x as! T } -// CHECK: define hidden swiftcc i64 @"$s13generic_casts8anyToIntySiypF"(ptr noalias captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK: define hidden swiftcc i64 @"$s13generic_casts8anyToIntySiypF"(ptr noalias nocapture dereferenceable({{.*}}) %0) {{.*}} { func anyToInt(_ x: Any) -> Int { return x as! Int } @@ -104,7 +104,7 @@ func classExistentialToOpaqueArchetype(_ x: ObjCProto1) -> T { protocol P {} protocol Q {} -// CHECK: define hidden swiftcc void @"$s13generic_casts19compositionToMemberyAA1P_pAaC_AA1QpF{{.*}}"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK: define hidden swiftcc void @"$s13generic_casts19compositionToMemberyAA1P_pAaC_AA1QpF{{.*}}"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) {{.*}} { func compositionToMember(_ a: P & Q) -> P { return a } diff --git a/test/IRGen/generic_metatypes.swift b/test/IRGen/generic_metatypes.swift index e3c3533f752dc..7a37d2b923e76 100644 --- a/test/IRGen/generic_metatypes.swift +++ b/test/IRGen/generic_metatypes.swift @@ -58,7 +58,7 @@ func genericMetatypes(_ t: T.Type, _ u: U.Type) {} protocol Bas {} -// CHECK: define hidden swiftcc { ptr, ptr } @"$s17generic_metatypes14protocolTypeof{{.*}}"(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK: define hidden swiftcc { ptr, ptr } @"$s17generic_metatypes14protocolTypeof{{.*}}"(ptr noalias nocapture dereferenceable({{.*}}) %0) func protocolTypeof(_ x: Bas) -> Bas.Type { // CHECK: [[METADATA_ADDR:%.*]] = getelementptr inbounds{{.*}} %T17generic_metatypes3BasP, ptr [[X:%.*]], i32 0, i32 1 // CHECK: [[METADATA:%.*]] = load ptr, ptr [[METADATA_ADDR]] diff --git a/test/IRGen/generic_metatypes_future.swift b/test/IRGen/generic_metatypes_future.swift index 6bcdd5e974ed6..f67ec6edcc5b2 100644 --- a/test/IRGen/generic_metatypes_future.swift +++ b/test/IRGen/generic_metatypes_future.swift @@ -59,7 +59,7 @@ func genericMetatypes(_ t: T.Type, _ u: U.Type) {} protocol Bas {} -// CHECK: define hidden swiftcc { ptr, ptr } @"$s17generic_metatypes14protocolTypeof{{.*}}"(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK: define hidden swiftcc { ptr, ptr } @"$s17generic_metatypes14protocolTypeof{{.*}}"(ptr noalias nocapture dereferenceable({{.*}}) %0) func protocolTypeof(_ x: Bas) -> Bas.Type { // CHECK: [[METADATA_ADDR:%.*]] = getelementptr inbounds{{.*}} %T17generic_metatypes3BasP, ptr [[X:%.*]], i32 0, i32 1 // CHECK: [[METADATA:%.*]] = load ptr, ptr [[METADATA_ADDR]] diff --git a/test/IRGen/generic_ternary.swift b/test/IRGen/generic_ternary.swift index 7d679d68a50ef..f44288913f1b2 100644 --- a/test/IRGen/generic_ternary.swift +++ b/test/IRGen/generic_ternary.swift @@ -4,7 +4,7 @@ // struct OptionalStreamAdaptor { - // CHECK: define hidden swiftcc void @"$s15generic_ternary21OptionalStreamAdaptorV4next{{[_0-9a-zA-Z]*}}F"(ptr noalias sret({{.*}}) %0, ptr %"OptionalStreamAdaptor", ptr captures(none) swiftself dereferenceable({{.*}}) %1) + // CHECK: define hidden swiftcc void @"$s15generic_ternary21OptionalStreamAdaptorV4next{{[_0-9a-zA-Z]*}}F"(ptr noalias sret({{.*}}) %0, ptr %"OptionalStreamAdaptor", ptr nocapture swiftself dereferenceable({{.*}}) %1) mutating func next() -> Optional { return x[0].next() diff --git a/test/IRGen/indexing.sil b/test/IRGen/indexing.sil index 336da468b580f..9076f8adab6f3 100644 --- a/test/IRGen/indexing.sil +++ b/test/IRGen/indexing.sil @@ -12,7 +12,7 @@ struct SameSizeStride { var x, y: Builtin.Int32 } // This type has unequal stride and size. struct DifferentSizeStride { var x: Builtin.Int32, y: Builtin.Int16 } -// CHECK: define{{( protected)?}} {{.*}}void @same_size_stride(ptr noalias captures(none) dereferenceable({{.*}}) %0, i64 %1) {{.*}} { +// CHECK: define{{( protected)?}} {{.*}}void @same_size_stride(ptr noalias nocapture dereferenceable({{.*}}) %0, i64 %1) {{.*}} { // CHECK: getelementptr inbounds %T8indexing14SameSizeStrideV, ptr %0, i64 %1 sil @same_size_stride : $@convention(thin) (@in SameSizeStride, Builtin.Word) -> () { entry(%p : $*SameSizeStride, %i: $Builtin.Word): @@ -20,7 +20,7 @@ entry(%p : $*SameSizeStride, %i: $Builtin.Word): return undef : $() } -// CHECK: define{{( protected)?}} {{.*}}void @different_size_stride(ptr noalias captures(none) dereferenceable({{.*}}) %0, i64 %1) {{.*}} { +// CHECK: define{{( protected)?}} {{.*}}void @different_size_stride(ptr noalias nocapture dereferenceable({{.*}}) %0, i64 %1) {{.*}} { // CHECK: %2 = mul nsw i64 %1, 8 // CHECK-NEXT: %3 = getelementptr inbounds i8, ptr %0, i64 %2 sil @different_size_stride : $@convention(thin) (@in DifferentSizeStride, Builtin.Word) -> () { @@ -29,7 +29,7 @@ entry(%p : $*DifferentSizeStride, %i: $Builtin.Word): return undef : $() } -// CHECK: define{{( protected)?}} {{.*}}void @zero_size(ptr noalias captures(none) %0, i64 %1) {{.*}} { +// CHECK: define{{( protected)?}} {{.*}}void @zero_size(ptr noalias nocapture %0, i64 %1) {{.*}} { // CHECK: %2 = mul nsw i64 %1, 1 // CHECK-NEXT: %3 = getelementptr inbounds i8, ptr %0, i64 %2 sil @zero_size : $@convention(thin) (@in (), Builtin.Word) -> () { diff --git a/test/IRGen/indirect_argument.sil b/test/IRGen/indirect_argument.sil index d575de477b611..466fbc81686ac 100644 --- a/test/IRGen/indirect_argument.sil +++ b/test/IRGen/indirect_argument.sil @@ -15,9 +15,9 @@ struct HugeAlignment { } // TODO: could be the context param -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_method(ptr noalias captures(none) swiftself dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_method(ptr noalias nocapture swiftself dereferenceable({{.*}}) %0) // CHECK-NOT: alloca -// CHECK: call swiftcc void @huge_method(ptr noalias captures(none) swiftself dereferenceable({{.*}}) %0) +// CHECK: call swiftcc void @huge_method(ptr noalias nocapture swiftself dereferenceable({{.*}}) %0) sil @huge_method : $@convention(method) (Huge) -> () { entry(%x : $Huge): %f = function_ref @huge_method : $@convention(method) (Huge) -> () @@ -25,9 +25,9 @@ entry(%x : $Huge): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param(ptr noalias nocapture dereferenceable({{.*}}) %0) // CHECK-NOT: alloca -// CHECK: call swiftcc void @huge_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK: call swiftcc void @huge_param(ptr noalias nocapture dereferenceable({{.*}}) %0) sil @huge_param : $@convention(thin) (Huge) -> () { entry(%x : $Huge): %f = function_ref @huge_param : $@convention(thin) (Huge) -> () @@ -35,9 +35,9 @@ entry(%x : $Huge): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_alignment_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_alignment_param(ptr noalias nocapture dereferenceable({{.*}}) %0) // CHECK-NOT: alloca -// CHECK: call swiftcc void @huge_alignment_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK: call swiftcc void @huge_alignment_param(ptr noalias nocapture dereferenceable({{.*}}) %0) sil @huge_alignment_param : $@convention(thin) (HugeAlignment) -> () { entry(%x : $HugeAlignment): %f = function_ref @huge_alignment_param : $@convention(thin) (HugeAlignment) -> () @@ -45,9 +45,9 @@ entry(%x : $HugeAlignment): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param_and_return(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param_and_return(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) // CHECK: [[TMP_RET:%.*]] = alloca -// CHECK: call swiftcc void @huge_param_and_return(ptr noalias captures(none) sret({{.*}}) [[TMP_RET]], ptr noalias captures(none) dereferenceable({{.*}}) %1) +// CHECK: call swiftcc void @huge_param_and_return(ptr noalias nocapture sret({{.*}}) [[TMP_RET]], ptr noalias nocapture dereferenceable({{.*}}) %1) sil @huge_param_and_return : $@convention(thin) (Huge) -> Huge { entry(%x : $Huge): %f = function_ref @huge_param_and_return : $@convention(thin) (Huge) -> Huge @@ -55,9 +55,9 @@ entry(%x : $Huge): return %z : $Huge } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param_and_indirect_return(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_param_and_indirect_return(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) // CHECK-NOT: alloca -// CHECK: call swiftcc void @huge_param_and_indirect_return(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) +// CHECK: call swiftcc void @huge_param_and_indirect_return(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) sil @huge_param_and_indirect_return : $@convention(thin) (Huge) -> @out Huge { entry(%o : $*Huge, %x : $Huge): %f = function_ref @huge_param_and_indirect_return : $@convention(thin) (Huge) -> @out Huge @@ -65,16 +65,16 @@ entry(%o : $*Huge, %x : $Huge): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_partial_application(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_partial_application(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) // CHECK-NOT: alloca // CHECK: [[CLOSURE:%.*]] = call noalias ptr @swift_allocObject -// CHECK: call swiftcc {{.*}} @"$s24huge_partial_applicationTA{{(\.ptrauth)?}}"{{.*}}(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr swiftself [[CLOSURE]]) -// CHECK: define internal swiftcc void @"$s24huge_partial_applicationTA"(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr swiftself %1) +// CHECK: call swiftcc {{.*}} @"$s24huge_partial_applicationTA{{(\.ptrauth)?}}"{{.*}}(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr swiftself [[CLOSURE]]) +// CHECK: define internal swiftcc void @"$s24huge_partial_applicationTA"(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr swiftself %1) // CHECK-NOT: alloca // CHECK: [[GEP:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %T17indirect_argument4HugeV }>, ptr %1, i32 0, i32 1 // CHECK-NOT: alloca // CHECK-NOT: tail -// CHECK: call swiftcc void @huge_partial_application(ptr noalias captures(none) dereferenceable({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) [[GEP]] +// CHECK: call swiftcc void @huge_partial_application(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) [[GEP]] // CHECK: call void @swift_release(ptr %1) sil @huge_partial_application : $@convention(thin) (Huge, Huge) -> () { entry(%x : $Huge, %y : $Huge): @@ -84,16 +84,16 @@ entry(%x : $Huge, %y : $Huge): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_partial_application_stret(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1, ptr noalias captures(none) dereferenceable({{.*}}) %2) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @huge_partial_application_stret(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1, ptr noalias nocapture dereferenceable({{.*}}) %2) // CHECK: [[TMP_RET:%.*]] = alloca // CHECK: [[CLOSURE:%.*]] = call noalias ptr @swift_allocObject -// CHECK: call swiftcc {{.*}} @"$s30huge_partial_application_stretTA{{(\.ptrauth)?}}"{{.*}}(ptr noalias captures(none) sret({{.*}}) [[TMP_RET]], ptr noalias captures(none) dereferenceable({{.*}}) %1, ptr swiftself [[CLOSURE]]) -// CHECK: define internal swiftcc void @"$s30huge_partial_application_stretTA"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1, ptr swiftself %2) +// CHECK: call swiftcc {{.*}} @"$s30huge_partial_application_stretTA{{(\.ptrauth)?}}"{{.*}}(ptr noalias nocapture sret({{.*}}) [[TMP_RET]], ptr noalias nocapture dereferenceable({{.*}}) %1, ptr swiftself [[CLOSURE]]) +// CHECK: define internal swiftcc void @"$s30huge_partial_application_stretTA"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1, ptr swiftself %2) // CHECK-NOT: alloca // CHECK: [[GEP:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %T17indirect_argument4HugeV }>, ptr %2, i32 0, i32 1 // CHECK-NOT: alloca // CHECK-NOT: tail -// CHECK: call swiftcc void @huge_partial_application_stret(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1, ptr noalias captures(none) dereferenceable({{.*}}) [[GEP]]) +// CHECK: call swiftcc void @huge_partial_application_stret(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1, ptr noalias nocapture dereferenceable({{.*}}) [[GEP]]) // CHECK: call void @swift_release(ptr %2) sil @huge_partial_application_stret : $@convention(thin) (Huge, Huge) -> Huge { entry(%x : $Huge, %y : $Huge): diff --git a/test/IRGen/indirect_return.swift b/test/IRGen/indirect_return.swift index 965548eb3a8c9..96b2a9bb02953 100644 --- a/test/IRGen/indirect_return.swift +++ b/test/IRGen/indirect_return.swift @@ -20,6 +20,6 @@ func foo() -> (String, String, String, Number, Number) { } // CHECK-LABEL: define{{.*}}testCall func testCall() { -// CHECK: call swiftcc void @"$s15indirect_return3fooSS_S2SAA6Number_pAaC_ptyF"(ptr noalias captures(none) %{{.*}} +// CHECK: call swiftcc void @"$s15indirect_return3fooSS_S2SAA6Number_pAaC_ptyF"(ptr noalias nocapture %{{.*}} print(foo()) } diff --git a/test/IRGen/inout_noalias.sil b/test/IRGen/inout_noalias.sil index 165db0f297b0c..6a3c4fe86bce6 100644 --- a/test/IRGen/inout_noalias.sil +++ b/test/IRGen/inout_noalias.sil @@ -2,7 +2,7 @@ import Swift -// CHECK: define{{.*}}swiftcc void @takeInoutAliasable(ptr captures(none) dereferenceable({{[0-9]+}}) %0, ptr %T) +// CHECK: define{{.*}}swiftcc void @takeInoutAliasable(ptr nocapture dereferenceable({{[0-9]+}}) %0, ptr %T) sil @takeInoutAliasable : $ (@inout_aliasable UnsafePointer) -> () { entry(%ptr : $*UnsafePointer): %retval = tuple () diff --git a/test/IRGen/lazy_multi_file.swift b/test/IRGen/lazy_multi_file.swift index 293aa232744e2..95444fc142e8d 100644 --- a/test/IRGen/lazy_multi_file.swift +++ b/test/IRGen/lazy_multi_file.swift @@ -14,7 +14,7 @@ class Subclass : LazyContainerClass { // an indirect return value. When it shrinks back, remove the optional // indirect out. // - // CHECK-LABEL: @"$s15lazy_multi_file8SubclassC6getStrSSyF"({{(ptr noalias captures(none) sret, )?}}ptr swiftself %0) {{.*}} { + // CHECK-LABEL: @"$s15lazy_multi_file8SubclassC6getStrSSyF"({{(ptr noalias nocapture sret, )?}}ptr swiftself %0) {{.*}} { func getStr() -> String { // CHECK: = getelementptr inbounds{{.*}} %T15lazy_multi_file8SubclassC, ptr %0, i32 0, i32 3 return str diff --git a/test/IRGen/lifetime.sil b/test/IRGen/lifetime.sil index a1f3c392a448e..84dd8e1d6f9bf 100644 --- a/test/IRGen/lifetime.sil +++ b/test/IRGen/lifetime.sil @@ -99,7 +99,7 @@ bb0(%x : $*Builtin.Int64): %0 = tuple () return %0 : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @fixed_size(ptr noalias captures(none) dereferenceable(8) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @fixed_size(ptr noalias nocapture dereferenceable(8) %0) // CHECK: [[XBUF:%.*]] = alloca i64 // CHECK-NEXT: call void @llvm.lifetime.start.p0({{(i32|i64)}} 8, ptr [[XBUF]]) // CHECK-NEXT: load diff --git a/test/IRGen/moveonly_split_module_source_deinit.swift b/test/IRGen/moveonly_split_module_source_deinit.swift index 24d9e5d5ec440..e9e1035d52683 100644 --- a/test/IRGen/moveonly_split_module_source_deinit.swift +++ b/test/IRGen/moveonly_split_module_source_deinit.swift @@ -7,7 +7,7 @@ // Make sure we call the deinit through the value witness table in the other module. -// REFERRING_MODULE-LABEL: define {{.*}}swiftcc void @"$s6serverAAV4mainyyKFZ"(ptr swiftself %0, ptr noalias captures(none) swifterror dereferenceable({{(8|4)}}) %1) {{.*}}{ +// REFERRING_MODULE-LABEL: define {{.*}}swiftcc void @"$s6serverAAV4mainyyKFZ"(ptr swiftself %0, ptr noalias nocapture swifterror dereferenceable({{(8|4)}}) %1) {{.*}}{ // REFERRING_MODULE: [[SERVER:%.*]] = alloca %T6server8MoveOnlyV // REFERRING_MODULE: [[VALUE_WITNESS_TABLE:%.*]] = getelementptr inbounds ptr, ptr %"$s6server8MoveOnlyVN.valueWitnesses" // REFERRING_MODULE: [[VALUE_WITNESS:%.*]] = load ptr, ptr [[VALUE_WITNESS_TABLE]] diff --git a/test/IRGen/moveonly_value_functions.swift b/test/IRGen/moveonly_value_functions.swift index d1093a5839032..f14abc9f87622 100644 --- a/test/IRGen/moveonly_value_functions.swift +++ b/test/IRGen/moveonly_value_functions.swift @@ -198,7 +198,7 @@ public func takeOuterDeinitingNC_1(_ t: consuming OuterDeinitingNC_1) { // CHECK: [[INNER_DEINITING_RELEASABLE_NC_METADATA:%[^,]+]] = extractvalue %swift.metadata_response [[RESPONSE]] // CHECK: call swiftcc void @"$s24moveonly_value_functions26InnerDeinitingReleasableNCVfD"( // CHECK-SAME: ptr [[INNER_DEINITING_RELEASABLE_NC_METADATA]], -// : ptr noalias captures(none) swiftself dereferenceable(64) %deinit.arg) +// : ptr noalias nocapture swiftself dereferenceable(64) %deinit.arg) // CHECK: } public func takeOuterNC_1(_ o: consuming OuterNC_1) { external_symbol() @@ -295,7 +295,7 @@ public func takeGenericContext_1OuterNC_1(_ e: consuming GenericContext_1 public func takeOuterSinglePayloadNC_1(_ e: consuming OuterSinglePayloadNC_1) {} // CHECK-LABEL: define{{.*}} @"$s24moveonly_value_functions26takeOuterSinglePayloadNC_2yyAA0efgH2_2OyxGnlF"( -// : ptr noalias captures(none) dereferenceable(64) %0, +// : ptr noalias nocapture dereferenceable(64) %0, // CHECK-SAME: ptr %T) // CHECK-SAME: { // CHECK: call{{.*}} @"$s24moveonly_value_functions22OuterSinglePayloadNC_2OyxGlWOh"( @@ -388,7 +388,7 @@ public func takeOuterMultiPayloadNC_1(_ e: consuming OuterMultiPayloadNC_1 // CHECK: } public func takeOuterMultiPayloadNC_2(_ e: consuming OuterMultiPayloadNC_2) {} // CHECK-LABEL: define{{.*}} @"$s24moveonly_value_functions25takeOuterMultiPayloadNC_3yyAA0efgH2_3OyxGnlF"( -// : ptr noalias captures(none) dereferenceable(64) %0, +// : ptr noalias nocapture dereferenceable(64) %0, // CHECK-SAME: ptr %T) // CHECK-SAME: { // CHECK: call{{.*}} @"$s24moveonly_value_functions21OuterMultiPayloadNC_3OyxGlWOh"( diff --git a/test/IRGen/moveonly_value_functions_onone.swift b/test/IRGen/moveonly_value_functions_onone.swift index 1e4f91fc6b11e..9530a4b82bc62 100644 --- a/test/IRGen/moveonly_value_functions_onone.swift +++ b/test/IRGen/moveonly_value_functions_onone.swift @@ -195,7 +195,7 @@ public func takeOuterDeinitingNC_1(_ t: consuming OuterDeinitingNC_1) { // CHECK: [[INNER_DEINITING_RELEASABLE_NC_METADATA:%[^,]+]] = extractvalue %swift.metadata_response [[RESPONSE]] // CHECK: call swiftcc void @"$s30moveonly_value_functions_onone26InnerDeinitingReleasableNCVfD"( // CHECK-SAME: ptr [[INNER_DEINITING_RELEASABLE_NC_METADATA]], -// : ptr noalias captures(none) swiftself dereferenceable(64) %deinit.arg) +// : ptr noalias nocapture swiftself dereferenceable(64) %deinit.arg) // CHECK: } public func takeOuterNC_1(_ o: consuming OuterNC_1) { external_symbol() @@ -288,7 +288,7 @@ public func takeGenericContext_1OuterNC_1(_ e: consuming GenericContext_1 public func takeOuterSinglePayloadNC_1(_ e: consuming OuterSinglePayloadNC_1) {} // CHECK-LABEL: define{{.*}} @"$s30moveonly_value_functions_onone26takeOuterSinglePayloadNC_2yyAA0fghI2_2OyxGnlF"( -// : ptr noalias captures(none) dereferenceable(64) %0, +// : ptr noalias nocapture dereferenceable(64) %0, // CHECK-SAME: ptr %T) // CHECK-SAME: { // CHECK: call{{.*}} @"$s30moveonly_value_functions_onone22OuterSinglePayloadNC_2OyxGlWOh"( @@ -305,7 +305,7 @@ public func takeOuterSinglePayloadNC_1(_ e: consuming OuterSinglePayloadNC_1< // CHECK: [[METADATA:%[^,]+]] = extractvalue %swift.metadata_response [[RESPONSE]], 0 // CHECK: call swiftcc void @"$s30moveonly_value_functions_onone26InnerDeinitingReleasableNCVfD"( // CHECK-SAME: ptr [[METADATA]], -// : ptr noalias captures(none) swiftself dereferenceable(64) %0) +// : ptr noalias nocapture swiftself dereferenceable(64) %0) // CHECK: } public func takeOuterSinglePayloadNC_2(_ e: consuming OuterSinglePayloadNC_2) {} @@ -383,7 +383,7 @@ public func takeOuterMultiPayloadNC_1(_ e: consuming OuterMultiPayloadNC_1 // CHECK: } public func takeOuterMultiPayloadNC_2(_ e: consuming OuterMultiPayloadNC_2) {} // CHECK-LABEL: define{{.*}} @"$s30moveonly_value_functions_onone25takeOuterMultiPayloadNC_3yyAA0fghI2_3OyxGnlF"( -// : ptr noalias captures(none) dereferenceable(64) %0, +// : ptr noalias nocapture dereferenceable(64) %0, // CHECK-SAME: ptr %T) // CHECK-SAME: { // CHECK: call{{.*}} @"$s30moveonly_value_functions_onone21OuterMultiPayloadNC_3OyxGlWOh"( diff --git a/test/IRGen/objc_block_storage.sil b/test/IRGen/objc_block_storage.sil index 4f2d66738dcae..64f23214c4d44 100644 --- a/test/IRGen/objc_block_storage.sil +++ b/test/IRGen/objc_block_storage.sil @@ -38,7 +38,7 @@ import gizmo // CHECK: ptr [[NSRECT_BLOCK_SIGNATURE]] // CHECK: } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @project_block_storage(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @project_block_storage(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK-NEXT: %1 = getelementptr inbounds{{.*}} { %objc_block, ptr }, ptr %0, i32 0, i32 1 // CHECK-NEXT: %2 = load ptr, ptr %1, align 8 @@ -51,7 +51,7 @@ entry(%0 : $*@block_storage Builtin.RawPointer): return %p : $Builtin.RawPointer } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc fp128 @overaligned_project_block_storage(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc fp128 @overaligned_project_block_storage(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: // CHECK-NEXT: %1 = getelementptr inbounds{{.*}} { %objc_block, fp128 }, ptr %0, i32 0, i32 1 // CHECK-NEXT: %2 = load fp128, ptr %1, align 16 @@ -64,7 +64,7 @@ entry(%0 : $*@block_storage Builtin.FPIEEE128): return %p : $Builtin.FPIEEE128 } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_trivial(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_trivial(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: [[HEADER:%.*]] = getelementptr inbounds{{.*}} { %objc_block, ptr }, ptr %0, i32 0, i32 0 // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr [[HEADER]], i32 0, i32 0 // CHECK: store ptr [[BLOCK_ISA]], ptr [[T0]] @@ -109,7 +109,7 @@ entry(%0 : $*@block_storage Builtin.RawPointer, %1 : $Int): return %1 : $Int } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_nontrivial(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_nontrivial(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: [[HEADER:%.*]] = getelementptr inbounds // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr [[HEADER]], i32 0, i32 0 // CHECK: store ptr [[BLOCK_ISA]], ptr [[T0]] @@ -147,7 +147,7 @@ entry(%0 : $*@block_storage Builtin.NativeObject): sil public_external @invoke_nontrivial : $@convention(c) (@inout_aliasable @block_storage Builtin.NativeObject) -> () -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_stret(ptr captures(none) dereferenceable({{.*}}) %0) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @init_block_header_stret(ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK: [[HEADER:%.*]] = getelementptr inbounds // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr [[HEADER]], i32 0, i32 0 // CHECK: store ptr [[BLOCK_ISA]], ptr [[T0]] diff --git a/test/IRGen/objc_class_export.swift b/test/IRGen/objc_class_export.swift index c2b3b29460f34..4f3e467940a27 100644 --- a/test/IRGen/objc_class_export.swift +++ b/test/IRGen/objc_class_export.swift @@ -87,13 +87,13 @@ struct BigStructWithNativeObjects { return NSRect(origin: NSPoint(x: 0, y: 0), size: NSSize(width: 0, height: 0)) } - // CHECK: define internal void @"$s17objc_class_export3FooC6boundsSo6NSRectVyFTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { + // CHECK: define internal void @"$s17objc_class_export3FooC6boundsSo6NSRectVyFTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} { // CHECK: call swiftcc { double, double, double, double } @"$s17objc_class_export3FooC6boundsSo6NSRectVyF"(ptr swiftself %1) @objc func convertRectToBacking(r r: NSRect) -> NSRect { return r } - // CHECK: define internal void @"$s17objc_class_export3FooC20convertRectToBacking1rSo6NSRectVAG_tFTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr byval({{.*}} align 8 %3) {{[#0-9]*}} { + // CHECK: define internal void @"$s17objc_class_export3FooC20convertRectToBacking1rSo6NSRectVAG_tFTo"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %2, ptr byval({{.*}} align 8 %3) {{[#0-9]*}} { // CHECK: call swiftcc { double, double, double, double } @"$s17objc_class_export3FooC20convertRectToBacking1rSo6NSRectVAG_tF"(double {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}, ptr swiftself %1) func doStuffToSwiftSlice(f f: [Int]) { diff --git a/test/IRGen/objc_generic_protocol_conformance.swift b/test/IRGen/objc_generic_protocol_conformance.swift index 7510c614e9658..a87cebe9733e9 100644 --- a/test/IRGen/objc_generic_protocol_conformance.swift +++ b/test/IRGen/objc_generic_protocol_conformance.swift @@ -9,4 +9,4 @@ protocol P { extension Foo: P {} // SIL-LABEL: sil private [transparent] [thunk] [ossa] @$sSo3FooCyxG33objc_generic_protocol_conformance1PA2dEP3fooyyFTW {{.*}} @pseudogeneric -// IR-LABEL: define internal swiftcc void @"$sSo3FooCyxG33objc_generic_protocol_conformance1PA2dEP3fooyyFTW"(ptr noalias captures(none) swiftself dereferenceable({{4|8}}) %0, ptr{{( %Self)?}}, ptr{{( %SelfWitnessTable)?}}) +// IR-LABEL: define internal swiftcc void @"$sSo3FooCyxG33objc_generic_protocol_conformance1PA2dEP3fooyyFTW"(ptr noalias nocapture swiftself dereferenceable({{4|8}}) %0, ptr{{( %Self)?}}, ptr{{( %SelfWitnessTable)?}}) diff --git a/test/IRGen/objc_simd.sil b/test/IRGen/objc_simd.sil index b7803f97ba77c..cdbde09c874bf 100644 --- a/test/IRGen/objc_simd.sil +++ b/test/IRGen/objc_simd.sil @@ -57,15 +57,15 @@ entry(%x : $float3): } // x86_64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) -// i386-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @simd_native_args(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) +// i386-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @simd_native_args(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) // aarch64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // arm64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) -// armv6-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @simd_native_args(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) +// armv6-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @simd_native_args(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) // armv7-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // armv7s-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // armv7k-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // arm64_32-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) -// powerpc64-LABEL: define{{( dllexport)?}}{{( protected)?}} void @simd_native_args(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{.*}}) %1) +// powerpc64-LABEL: define{{( dllexport)?}}{{( protected)?}} void @simd_native_args(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{.*}}) %1) // powerpc64le-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // s390x-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) // wasm32-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { float, float, float, float } @simd_native_args(float %0, float %1, float %2, float %3) diff --git a/test/IRGen/objc_structs.swift b/test/IRGen/objc_structs.swift index d09cd994e3bbc..ab047f8476bfe 100644 --- a/test/IRGen/objc_structs.swift +++ b/test/IRGen/objc_structs.swift @@ -16,7 +16,7 @@ import gizmo // CHECK: define hidden swiftcc { double, double, double, double } @"$s12objc_structs8getFrame{{[_0-9a-zA-Z]*}}F"(ptr %0) {{.*}} { func getFrame(_ g: Gizmo) -> NSRect { // CHECK: load ptr, ptr @"\01L_selector(frame)" - // CHECK: call void @objc_msgSend_stret(ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}) + // CHECK: call void @objc_msgSend_stret(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}) return g.frame() } // CHECK: } @@ -31,7 +31,7 @@ func setFrame(_ g: Gizmo, frame: NSRect) { // CHECK: define hidden swiftcc { double, double, double, double } @"$s12objc_structs8makeRect{{[_0-9a-zA-Z]*}}F"(double %0, double %1, double %2, double %3) func makeRect(_ a: Double, b: Double, c: Double, d: Double) -> NSRect { - // CHECK: call void @NSMakeRect(ptr noalias captures(none) sret({{.*}}) {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}) + // CHECK: call void @NSMakeRect(ptr noalias nocapture sret({{.*}}) {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}, double {{.*}}) return NSMakeRect(a,b,c,d) } // CHECK: } @@ -45,7 +45,7 @@ func stringFromRect(_ r: NSRect) -> String { // CHECK: define hidden swiftcc { double, double, double, double } @"$s12objc_structs9insetRect{{[_0-9a-zA-Z]*}}F"(double %0, double %1, double %2, double %3, double %4, double %5) func insetRect(_ r: NSRect, x: Double, y: Double) -> NSRect { - // CHECK: call void @NSInsetRect(ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr byval({{.*}}) align 8 {{.*}}, double {{.*}}, double {{.*}}) + // CHECK: call void @NSInsetRect(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr byval({{.*}}) align 8 {{.*}}, double {{.*}}, double {{.*}}) return NSInsetRect(r, x, y) } // CHECK: } @@ -53,13 +53,13 @@ func insetRect(_ r: NSRect, x: Double, y: Double) -> NSRect { // CHECK: define hidden swiftcc { double, double, double, double } @"$s12objc_structs19convertRectFromBase{{[_0-9a-zA-Z]*}}F"(ptr %0, double %1, double %2, double %3, double %4) func convertRectFromBase(_ v: NSView, r: NSRect) -> NSRect { // CHECK: load ptr, ptr @"\01L_selector(convertRectFromBase:)", align 8 - // CHECK: call void @objc_msgSend_stret(ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}, ptr byval({{.*}}) align 8 {{.*}}) + // CHECK: call void @objc_msgSend_stret(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}, ptr byval({{.*}}) align 8 {{.*}}) return v.convertRect(fromBase: r) } // CHECK: } // CHECK: define hidden swiftcc { ptr, ptr, ptr, ptr } @"$s12objc_structs20useStructOfNSStringsySo0deF0VADF"(ptr %0, ptr %1, ptr %2, ptr %3) -// CHECK: call void @useStructOfNSStringsInObjC(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) +// CHECK: call void @useStructOfNSStringsInObjC(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr byval({{.*}}) align 8 {{%.*}}) func useStructOfNSStrings(_ s: StructOfNSStrings) -> StructOfNSStrings { return useStructOfNSStringsInObjC(s) } diff --git a/test/IRGen/objc_super.swift b/test/IRGen/objc_super.swift index 2cdbda5da233c..b8a8a2cdea6e0 100644 --- a/test/IRGen/objc_super.swift +++ b/test/IRGen/objc_super.swift @@ -40,7 +40,7 @@ class Hoozit : Gizmo { // CHECK: [[T0:%.*]] = extractvalue %swift.metadata_response [[TMP]], 0 // CHECK: store ptr [[T0]], ptr {{.*}}, align 8 // CHECK: load ptr, ptr @"\01L_selector(frame)" - // CHECK: call void @objc_msgSendSuper2_stret(ptr noalias captures(none) sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}) + // CHECK: call void @objc_msgSendSuper2_stret(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr {{.*}}, ptr {{.*}}) return NSInsetRect(super.frame(), 2.0, 2.0) } // CHECK: } diff --git a/test/IRGen/partial_apply.sil b/test/IRGen/partial_apply.sil index ef9826f9e008a..0c79bfae956a2 100644 --- a/test/IRGen/partial_apply.sil +++ b/test/IRGen/partial_apply.sil @@ -135,7 +135,7 @@ bb0(%x : $SwiftClass): sil public_external @indirect_guaranteed_captured_class_param : $@convention(thin) (Int, @in_guaranteed SwiftClass) -> Int -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_guaranteed_class_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_guaranteed_class_param(ptr noalias nocapture dereferenceable({{.*}}) %0) // CHECK-NOT: {{retain|release}} // CHECK: [[X:%.*]] = load ptr, ptr %0 // CHECK-NOT: {{retain|release}} @@ -148,7 +148,7 @@ sil public_external @indirect_guaranteed_captured_class_param : $@convention(thi // CHECK-NOT: load // CHECK-NOT: retain // CHECK-NOT: release -// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_guaranteed_captured_class_param(i64 %0, ptr noalias captures(none) dereferenceable({{.*}}) [[X_TMP]] +// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_guaranteed_captured_class_param(i64 %0, ptr noalias nocapture dereferenceable({{.*}}) [[X_TMP]] // CHECK-NOT: retain // CHECK: call void @swift_release(ptr %1) // CHECK: ret i64 [[RESULT]] @@ -162,7 +162,7 @@ bb0(%x : $*SwiftClass): sil public_external @indirect_consumed_captured_class_param : $@convention(thin) (Int, @in SwiftClass) -> Int -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_consumed_class_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_consumed_class_param(ptr noalias nocapture dereferenceable({{.*}}) %0) // CHECK-NOT: {{retain|release}} // CHECK: [[CONTEXT_OBJ:%.*]] = load ptr, ptr %0 // CHECK-NOT: {{retain|release}} @@ -175,7 +175,7 @@ sil public_external @indirect_consumed_captured_class_param : $@convention(thin) // CHECK-NOT: load // CHECK-NOT: retain // CHECK-NOT: release -// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_consumed_captured_class_param(i64 %0, ptr noalias captures(none) dereferenceable({{.*}}) [[X_TMP]]) +// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_consumed_captured_class_param(i64 %0, ptr noalias nocapture dereferenceable({{.*}}) [[X_TMP]]) // CHECK-NOT: retain // CHECK-NOT: release // CHECK: ret i64 [[RESULT]] @@ -227,7 +227,7 @@ bb0(%x : $SwiftClassPair): sil public_external @indirect_guaranteed_captured_class_pair_param : $@convention(thin) (Int, @in_guaranteed SwiftClassPair) -> Int -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_guaranteed_class_pair_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_guaranteed_class_pair_param(ptr noalias nocapture dereferenceable({{.*}}) %0) // CHECK: [[CONTEXT_OBJ:%.*]] = call noalias ptr @swift_allocObject // CHECK-NOT: {{retain|release}} // CHECK: [[T0:%.*]] = insertvalue {{.*}} [[PARTIAL_APPLY_FORWARDER:@"\$s[A-Za-z0-9_]+TA"]], {{.*}} [[CONTEXT_OBJ]] @@ -237,7 +237,7 @@ sil public_external @indirect_guaranteed_captured_class_pair_param : $@conventio // CHECK: [[PAIR_ADDR:%.*]] = getelementptr // CHECK-NOT: load // CHECK-NOT: retain -// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_guaranteed_captured_class_pair_param(i64 %0, ptr noalias captures(none) dereferenceable({{.*}}) [[PAIR_ADDR]]) +// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_guaranteed_captured_class_pair_param(i64 %0, ptr noalias nocapture dereferenceable({{.*}}) [[PAIR_ADDR]]) // CHECK: release{{.*}}%1) // CHECK: ret i64 [[RESULT]] @@ -250,7 +250,7 @@ bb0(%x : $*SwiftClassPair): sil public_external @indirect_consumed_captured_class_pair_param : $@convention(thin) (Int, @in SwiftClassPair) -> Int -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_consumed_class_pair_param(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_consumed_class_pair_param(ptr noalias nocapture dereferenceable({{.*}}) %0) // CHECK: [[CONTEXT_OBJ:%.*]] = call noalias ptr @swift_allocObject // CHECK-NOT: {{retain|release}} // CHECK: [[T0:%.*]] = insertvalue {{.*}} [[PARTIAL_APPLY_FORWARDER:@"\$s[A-Za-z0-9_]+TA"]], {{.*}} [[CONTEXT_OBJ]] @@ -260,7 +260,7 @@ sil public_external @indirect_consumed_captured_class_pair_param : $@convention( // CHECK: [[X_TMP:%.*]] = alloca // CHECK: call ptr @"$s13partial_apply14SwiftClassPairVWOc" // CHECK: release{{.*}}%1) -// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_consumed_captured_class_pair_param(i64 %0, ptr noalias captures(none) dereferenceable({{.*}}) [[X_TMP]]) +// CHECK: [[RESULT:%.*]] = call swiftcc i64 @indirect_consumed_captured_class_pair_param(i64 %0, ptr noalias nocapture dereferenceable({{.*}}) [[X_TMP]]) // CHECK: ret i64 [[RESULT]] sil @partial_apply_indirect_consumed_class_pair_param : $@convention(thin) (@in SwiftClassPair) -> @callee_owned (Int) -> Int { @@ -472,7 +472,7 @@ sil public_external @generic_indirect_return : $@convention(thin) (Int) -> @ // CHECK-LABEL: define{{.*}} @partial_apply_generic_indirect_return // CHECK: insertvalue {{.*}}$s23generic_indirect_returnTA -// CHECK-LABEL: define internal swiftcc void @"$s23generic_indirect_returnTA"(ptr noalias captures(none) sret({{.*}}) %0, ptr swiftself +// CHECK-LABEL: define internal swiftcc void @"$s23generic_indirect_returnTA"(ptr noalias nocapture sret({{.*}}) %0, ptr swiftself // CHECK: call swiftcc void @generic_indirect_return({{.*}} %0, // CHECK: ret void sil @partial_apply_generic_indirect_return : $@convention(thin) (Int) -> @callee_owned () -> @owned GenericEnum { @@ -500,7 +500,7 @@ sil public_external @generic_indirect_return2 : $@convention(thin) (Int) -> // CHECK: [[R2:%.*]] = insertvalue { ptr, ptr } [[R1]], ptr [[CTX2]], 1 // CHECK: ret { ptr, ptr } [[R2]] -// CHECK-LABEL: define internal swiftcc void @"$s24generic_indirect_return2TA"(ptr noalias captures(none) sret({{.*}}) %0, ptr swiftself %1) +// CHECK-LABEL: define internal swiftcc void @"$s24generic_indirect_return2TA"(ptr noalias nocapture sret({{.*}}) %0, ptr swiftself %1) // CHECK: call swiftcc void @generic_indirect_return2(ptr noalias sret({{.*}}) %0, // CHECK: ret void sil @partial_apply_generic_indirect_return2 : $@convention(thin) (Int) -> @callee_owned () -> @owned GenericEnum2 { diff --git a/test/IRGen/partial_apply_coro.sil b/test/IRGen/partial_apply_coro.sil index 2a54583da0b75..0d728dbb08645 100644 --- a/test/IRGen/partial_apply_coro.sil +++ b/test/IRGen/partial_apply_coro.sil @@ -1012,7 +1012,7 @@ bb0(%x : $SwiftClass): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @indirect_guaranteed_captured_class_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %0, [[ARGTYPE:i32|i64]] %1, ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE:4|8]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %0, [[ARGTYPE:i32|i64]] %1, ptr noalias nocapture dereferenceable([[ARGPTR_SIZE:4|8]]) %2) sil public @indirect_guaranteed_captured_class_param : $@yield_once @convention(thin) (Int, @in_guaranteed SwiftClass) -> (@yields SwiftClass) { entry(%i : $Int, %c : $*SwiftClass): %0 = builtin "int_trap"() : $Never @@ -1020,7 +1020,7 @@ entry(%i : $Int, %c : $*SwiftClass): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @partial_apply_indirect_guaranteed_class_param -// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE]]) %[[ARGPTR:.*]]) +// CHECK-SAME: (ptr noalias nocapture dereferenceable([[ARGPTR_SIZE]]) %[[ARGPTR:.*]]) // CHECK: entry: // CHECK: %[[ARG:.*]] = load ptr, ptr %[[ARGPTR]] // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s40indirect_guaranteed_captured_class_paramTA{{.*}}", ptr undef }, ptr %[[ARG]], 1 @@ -1037,7 +1037,7 @@ entry(%i : $Int, %c : $*SwiftClass): // CHECK: store ptr %[[PA_CTX_BOX]], ptr %[[SELFPTR]] // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @indirect_guaranteed_captured_class_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE]]) %[[SELFPTR]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @indirect_guaranteed_captured_class_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable([[ARGPTR_SIZE]]) %[[SELFPTR]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s40indirect_guaranteed_captured_class_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -1079,7 +1079,7 @@ bb0(%x : $*SwiftClass): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @indirect_consumed_captured_class_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARGTYPE:(i32|i64)]] %1, ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE:(4|8)]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARGTYPE:(i32|i64)]] %1, ptr noalias nocapture dereferenceable([[ARGPTR_SIZE:(4|8)]]) %2) sil public @indirect_consumed_captured_class_param : $@yield_once @convention(thin) (Int, @in SwiftClass) -> (@yields SwiftClass) { entry(%i : $Int, %c : $*SwiftClass): %0 = builtin "int_trap"() : $Never @@ -1087,7 +1087,7 @@ entry(%i : $Int, %c : $*SwiftClass): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @partial_apply_indirect_consumed_class_param -// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE]]) %[[ARGPTR:.*]]) +// CHECK-SAME: (ptr noalias nocapture dereferenceable([[ARGPTR_SIZE]]) %[[ARGPTR:.*]]) // CHECK: entry: // CHECK: %[[ARG:.*]] = load ptr, ptr %[[ARGPTR]] // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s38indirect_consumed_captured_class_paramTA{{.*}}", ptr undef }, ptr %[[ARG]], 1 @@ -1105,7 +1105,7 @@ entry(%i : $Int, %c : $*SwiftClass): // CHECK: store ptr %[[PA_CTX_BOX]], ptr %[[SELFPTR]] // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @indirect_consumed_captured_class_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable([[ARGPTR_SIZE]]) %[[SELFPTR]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @indirect_consumed_captured_class_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable([[ARGPTR_SIZE]]) %[[SELFPTR]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s38indirect_consumed_captured_class_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -1231,7 +1231,7 @@ bb0(%x : $SwiftClassPair): // CHECK-64-LABEL: define {{.*}} { ptr, i64 } @indirect_guaranteed_captured_class_pair_param // CHECK-32-LABEL: define {{.*}} { ptr, i32 } @indirect_guaranteed_captured_class_pair_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %1, ptr noalias captures(none) dereferenceable([[PAIR_SIZE:(8|16)]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %1, ptr noalias nocapture dereferenceable([[PAIR_SIZE:(8|16)]]) %2) sil public @indirect_guaranteed_captured_class_pair_param : $@yield_once @convention(thin) (Int, @in_guaranteed SwiftClassPair) -> (@yields Int) { entry(%i : $Int, %c : $*SwiftClassPair): %0 = builtin "int_trap"() : $Never @@ -1239,7 +1239,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @partial_apply_indirect_guaranteed_class_pair_param -// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata.{{.*}} // CHECK: %[[BOXPTR:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[BOX]], i32 0, i32 1 @@ -1258,7 +1258,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): // CHECK: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[SPILL1]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %1, ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[PA_CTX]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %1, ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[PA_CTX]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -1301,7 +1301,7 @@ bb0(%x : $*SwiftClassPair): // CHECK-32-LABEL: define {{.*}} { ptr, i32 } @indirect_consumed_captured_class_pair_param // CHECK-64-LABEL: define {{.*}} { ptr, i64 } @indirect_consumed_captured_class_pair_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %0, [[ARG_TYPE]] %1, ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %0, [[ARG_TYPE]] %1, ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %2) sil public @indirect_consumed_captured_class_pair_param : $@yield_once @convention(thin) (Int, @in SwiftClassPair) -> (@yields Int) { entry(%i : $Int, %c : $*SwiftClassPair): %0 = builtin "int_trap"() : $Never @@ -1309,7 +1309,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @partial_apply_indirect_consumed_class_pair_param -// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata.{{.*}} // CHECK: %[[BOXPTR:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[BOX]], i32 0, i32 1 @@ -1331,7 +1331,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): // CHECK: %{{.*}} = call ptr @"$s18partial_apply_coro14SwiftClassPairVWOc"(ptr %[[PA_CTX]], ptr %[[SPILL1]]) // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_consumed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %1, ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[SPILL1]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_consumed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %1, ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[SPILL1]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s43indirect_consumed_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 2 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -2059,7 +2059,7 @@ class A3 {} sil_vtable A3 {} // CHECK-LABEL: define {{.*}} { ptr, ptr, ptr } @amethod -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, ptr noalias captures(none) swiftself dereferenceable([[SELF_SIZE:(4|8)]]) %1, ptr noalias captures(none) swifterror dereferenceable([[ERROR_SIZE:(4|8)]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, ptr noalias nocapture swiftself dereferenceable([[SELF_SIZE:(4|8)]]) %1, ptr noalias nocapture swifterror dereferenceable([[ERROR_SIZE:(4|8)]]) %2) sil @amethod : $@yield_once @convention(method) (@in_guaranteed A2) -> (@yields A1, @error Error) { entry(%a : $*A2): %0 = builtin "int_trap"() : $Never @@ -2067,13 +2067,13 @@ entry(%a : $*A2): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @repo -// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[SELF_SIZE]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias nocapture dereferenceable([[SELF_SIZE]]) %[[ARG:.*]]) // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s7amethodTA{{.*}}", ptr undef }, ptr %{{.*}}, 1 // CHECK: ret { ptr, ptr } %[[RET]] // CHECK: } // // CHECK-LABEL: define {{.*}} { ptr, ptr, ptr } @"$s7amethodTA" -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX:.*]], ptr swiftself %[[SELF:.*]], ptr noalias captures(none) swifterror dereferenceable([[ERROR_SIZE]]) %[[ERRORPTR:.*]]) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX:.*]], ptr swiftself %[[SELF:.*]], ptr noalias nocapture swifterror dereferenceable([[ERROR_SIZE]]) %[[ERRORPTR:.*]]) // CHECK: entry: // CHECK: %[[SELFPTR:.*]] = alloca ptr // CHECK: %[[SPILL:.*]] = call ptr @malloc @@ -2083,7 +2083,7 @@ entry(%a : $*A2): // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) // CHECK: store ptr null, ptr %[[ERRORPTR]] -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr, ptr } @amethod(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], ptr noalias captures(none) swiftself dereferenceable([[SELF_SIZE]]) %[[SELFPTR]], ptr noalias captures(none) swifterror dereferenceable([[ERROR_SIZE]]) %[[ERRORPTR]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr, ptr } @amethod(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], ptr noalias nocapture swiftself dereferenceable([[SELF_SIZE]]) %[[SELFPTR]], ptr noalias nocapture swifterror dereferenceable([[ERROR_SIZE]]) %[[ERRORPTR]]) // CHECK: %[[ERRORVAL:.*]] = load ptr, ptr %[[ERRORPTR]] // CHECK: %[[RESUME0:.*]] = extractvalue { ptr, ptr, ptr } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s7amethodTA.Frame", ptr %[[SPILL]], i32 0, i32 1 @@ -2137,7 +2137,7 @@ bb0(%0 : $*A2): } // CHECK-LABEL: define {{.*}} { ptr, ptr } @partial_apply_callee_guaranteed_indirect_guaranteed_class_pair_param -// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[ARG_SIZE:(8|16)]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias nocapture dereferenceable([[ARG_SIZE:(8|16)]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata // CHECK: %[[BOXPTR:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[BOX]], i32 0, i32 1 @@ -2156,7 +2156,7 @@ bb0(%0 : $*A2): // CHECK: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: %[[PA_ARG:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[PA_ARG]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[PA_ARG]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable({{8|16}}) %[[PA_CTX]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[PA_ARG]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable({{8|16}}) %[[PA_CTX]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.{{[0-9]+}}.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]], @@ -2201,7 +2201,7 @@ bb0(%x : $*SwiftClassPair): sil public_external @use_closure2 : $@yield_once @convention(thin) (@noescape @yield_once @callee_guaranteed (Int) -> (@yields Int)) -> (@yields Int) // CHECK-LABEL: define {{.*}} @partial_apply_stack_callee_guaranteed_indirect_guaranteed_class_pair_param -// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[ARG_SIZE:(8|16)]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias nocapture dereferenceable([[ARG_SIZE:(8|16)]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8] // CHECK: %[[BOX:.*]] = alloca i8 @@ -2228,7 +2228,7 @@ sil public_external @use_closure2 : $@yield_once @convention(thin) (@noescape @y // CHECK: %[[PA_ARG:.*]] = load ptr, ptr %[[PA_CTX]] // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable({{8|16}}) %[[PA_ARG]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable({{8|16}}) %[[PA_ARG]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.{{[0-9]+}}.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -2276,7 +2276,7 @@ bb0(%x : $*SwiftClassPair): // CHECK-32-LABEL: define {{.*}} { ptr, i32 } @indirect_in_captured_class_pair_param // CHECK-64-LABEL: define {{.*}} { ptr, i64 } @indirect_in_captured_class_pair_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %{{.*}}, ptr noalias captures(none) dereferenceable([[PAIR_SIZE:(8|16)]]) %{{.*}}) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %{{.*}}, ptr noalias nocapture dereferenceable([[PAIR_SIZE:(8|16)]]) %{{.*}}) sil public @indirect_in_captured_class_pair_param : $@yield_once @convention(thin) (Int, @in_guaranteed SwiftClassPair) -> (@yields Int) { entry(%i : $Int, %p : $*SwiftClassPair): %0 = builtin "int_trap"() : $Never @@ -2284,7 +2284,7 @@ entry(%i : $Int, %p : $*SwiftClassPair): } // CHECK-LABEL: define {{.*}} void @partial_apply_stack_callee_guaranteed_indirect_in_class_pair_param -// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8], // CHECK: %[[BOX:.*]] = alloca i8 @@ -2312,7 +2312,7 @@ entry(%i : $Int, %p : $*SwiftClassPair): // CHECK: %[[PA_ARG:.*]] = load ptr, ptr %[[PA_CTX]] // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_in_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[PA_ARG]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_in_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[PA_ARG]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s37indirect_in_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -2477,7 +2477,7 @@ entry: // CHECK-32: define {{.*}} { ptr, i32 } @indirect_in_constant_captured_class_pair_param // CHECK-64: define {{.*}} { ptr, i64 } @indirect_in_constant_captured_class_pair_param -// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %1, ptr noalias captures(none) dereferenceable([[PAIR_SIZE:(8|16)]]) %2) +// CHECK-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:(16|32)]]) %0, [[ARG_TYPE:(i32|i64)]] %1, ptr noalias nocapture dereferenceable([[PAIR_SIZE:(8|16)]]) %2) sil public @indirect_in_constant_captured_class_pair_param : $@yield_once @convention(thin) (Int, @in_guaranteed SwiftClassPair) -> (@yields Int) { entry(%i : $Int, %ic : $*SwiftClassPair): %0 = builtin "int_trap"() : $Never @@ -2485,7 +2485,7 @@ entry(%i : $Int, %ic : $*SwiftClassPair): } // CHECK-LABEL: define {{.*}} void @partial_apply_stack_callee_guaranteed_indirect_in_constant_class_pair_param -// CHECK-SAME: (ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) +// CHECK-SAME: (ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8] // CHECK: %[[BOX:.*]] = alloca i8 @@ -2513,7 +2513,7 @@ entry(%i : $Int, %ic : $*SwiftClassPair): // CHECK: %[[PA_ARG:.*]] = load ptr, ptr %[[PA_CTX]] // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_in_constant_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias captures(none) dereferenceable([[PAIR_SIZE]]) %[[PA_ARG]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @indirect_in_constant_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr noalias nocapture dereferenceable([[PAIR_SIZE]]) %[[PA_ARG]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s46indirect_in_constant_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[RESUME]], ptr %[[SPILL2]] @@ -2579,7 +2579,7 @@ bb0(%thick : $@callee_guaranteed @yield_once @convention(thick) (Int64, Int32) - // CHECK: } // // CHECK-LABEL: define {{.*}} ptr @"$s16external_closureTA" -// CHECK-SAME: (ptr noalias {{.*}} %[[CTX:.*]], [[ARG_TYPE]] %[[ARG1:.*]], ptr swiftself %[[PA_CTX_BOX:.*]], ptr noalias captures(none) swifterror {{.*}} %[[ERROR:.*]]) +// CHECK-SAME: (ptr noalias {{.*}} %[[CTX:.*]], [[ARG_TYPE]] %[[ARG1:.*]], ptr swiftself %[[PA_CTX_BOX:.*]], ptr noalias nocapture swifterror {{.*}} %[[ERROR:.*]]) // CHECK: entry: // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] @@ -2590,7 +2590,7 @@ bb0(%thick : $@callee_guaranteed @yield_once @convention(thick) (Int64, Int32) - // CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) // CHECK: store ptr null, ptr %[[ERROR]] -// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc ptr @external_closure(ptr noalias {{.*}} %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG1]], [[ARG_TYPE]] %[[ARG2]], ptr swiftself undef, ptr noalias captures(none) swifterror {{.*}} %[[ERROR]]) +// CHECK: %[[YIELD_PAIR:.*]] = call swiftcc ptr @external_closure(ptr noalias {{.*}} %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG1]], [[ARG_TYPE]] %[[ARG2]], ptr swiftself undef, ptr noalias nocapture swifterror {{.*}} %[[ERROR]]) // CHECK: %[[SPILL1:.*]] = getelementptr inbounds %"$s16external_closureTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: store ptr %[[YIELD_PAIR]], ptr %[[SPILL1]] // CHECK: %[[ERRORVAL:.*]] = load ptr, ptr %[[ERROR]] diff --git a/test/IRGen/partial_apply_generic.swift b/test/IRGen/partial_apply_generic.swift index d8a13172eb81d..20796c87214f0 100644 --- a/test/IRGen/partial_apply_generic.swift +++ b/test/IRGen/partial_apply_generic.swift @@ -37,7 +37,7 @@ var x = seq ~> split // Indirect return // -// CHECK-LABEL: define internal swiftcc { ptr, ptr } @"$s21partial_apply_generic5split{{[_0-9a-zA-Z]*}}FTA"(ptr noalias captures(none) %0, ptr swiftself %1) +// CHECK-LABEL: define internal swiftcc { ptr, ptr } @"$s21partial_apply_generic5split{{[_0-9a-zA-Z]*}}FTA"(ptr noalias nocapture %0, ptr swiftself %1) // CHECK: tail call swiftcc { ptr, ptr } @"$s21partial_apply_generic5split{{[_0-9a-zA-Z]*}}F"(ptr noalias %0, struct HugeStruct { var a, b, c, d: Int } diff --git a/test/IRGen/pre_specialize.swift b/test/IRGen/pre_specialize.swift index a31b3049ab48c..f7456f36753bf 100644 --- a/test/IRGen/pre_specialize.swift +++ b/test/IRGen/pre_specialize.swift @@ -42,12 +42,11 @@ // specialized InternalThing.computedX.getter // CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc [[INT]] @"$s1A13InternalThingV9computedXxvgSi_Ts5"([[INT]]{{( returned)?}} %0) // specialized InternalThing.computedX.setter -// CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingV9computedXxvsSi_Ts5"([[INT]] %0, ptr captures(none) swiftself {{(writeonly )?}}dereferenceable({{(4|8)}}){{.*}} %1) - +// CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingV9computedXxvsSi_Ts5"([[INT]] %0, ptr nocapture swiftself {{(writeonly )?}}dereferenceable({{(4|8)}}){{.*}} %1) // specialized InternalThing.subscript.getter // CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc [[INT]] @"$s1A13InternalThingVyxSicigSi_Ts5"([[INT]] %0, [[INT]]{{( returned)?}} %1) // specialized InternalThing.subscript.setter -// CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingVyxSicisSi_Ts5"([[INT]] %0, [[INT]] %1, ptr captures(none) swiftself {{(writeonly )?}}dereferenceable({{(4|8)}}){{.*}} %2) +// CHECK-A-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingVyxSicisSi_Ts5"([[INT]] %0, [[INT]] %1, ptr nocapture swiftself {{(writeonly )?}}dereferenceable({{(4|8)}}){{.*}} %2) // specialized InternalRef.compute() // CHECK-A-FRAG-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc [[INT:(i64|i32)]] @"$s1A11InternalRefC7computexyFAA09ResilientA10BoxedThingVySiG_Ts5" @@ -76,13 +75,13 @@ // CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @"$s1A13InternalThingV9computedXxvg1B07AnotherB0C_Ts5"(ptr{{( returned)?}} %0) // specialized InternalThing.computedX.setter -// CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingV9computedXxvs1B07AnotherB0C_Ts5"(ptr %0, ptr captures(none) swiftself dereferenceable({{(4|8)}}) %1) +// CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingV9computedXxvs1B07AnotherB0C_Ts5"(ptr %0, ptr nocapture swiftself dereferenceable({{(4|8)}}) %1) // specialized InternalThing.subscript.getter // CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @"$s1A13InternalThingVyxSicig1B07AnotherB0C_Ts5"([[INT:(i64|i32)]] %0, ptr{{( returned)?}} %1) // specialized InternalThing.subscript.setter -// CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingVyxSicis1B07AnotherB0C_Ts5"(ptr %0, [[INT]] %1, ptr captures(none) swiftself dereferenceable({{(4|8)}}) %2) +// CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s1A13InternalThingVyxSicis1B07AnotherB0C_Ts5"(ptr %0, [[INT]] %1, ptr nocapture swiftself dereferenceable({{(4|8)}}) %2) // specialized InternalRef.compute() // CHECK-B-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @"$s1A11InternalRefC7computexyF1B12AnotherThingC_Ts5 diff --git a/test/IRGen/protocol_accessor_multifile.swift b/test/IRGen/protocol_accessor_multifile.swift index 65ccc1c7b0a48..ee4c41e3ecd32 100644 --- a/test/IRGen/protocol_accessor_multifile.swift +++ b/test/IRGen/protocol_accessor_multifile.swift @@ -8,7 +8,7 @@ // CHECK-LABEL: define{{.*}} void @"$s27protocol_accessor_multifile14useExistentialyyF"() func useExistential() { // CHECK: [[BOX:%.+]] = alloca %T27protocol_accessor_multifile5ProtoP, - // CHECK: call swiftcc void @"$s27protocol_accessor_multifile17globalExistentialAA5Proto_pvg"(ptr noalias captures(none) sret({{.*}}) [[BOX]]) + // CHECK: call swiftcc void @"$s27protocol_accessor_multifile17globalExistentialAA5Proto_pvg"(ptr noalias nocapture sret({{.*}}) [[BOX]]) // CHECK: call swiftcc void @"$s27protocol_accessor_multifile5ProtoPAAE6methodyyF" globalExistential.method() // CHECK: call void @__swift_destroy_boxed_opaque_existential_1(ptr [[BOX]]) diff --git a/test/IRGen/protocol_resilience.sil b/test/IRGen/protocol_resilience.sil index 7ce5cfc0a10f7..dcd3871e88bd9 100644 --- a/test/IRGen/protocol_resilience.sil +++ b/test/IRGen/protocol_resilience.sil @@ -262,7 +262,7 @@ struct ConformingStruct : ResilientProtocol { static func defaultF() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @noDefaultA(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @noDefaultA(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: sil @noDefaultA : $@convention(witness_method: ResilientProtocol) (@in_guaranteed ConformingStruct) -> () { @@ -281,7 +281,7 @@ bb0(%0 : $*ConformingStruct): } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @noDefaultB(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @noDefaultB(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: sil @noDefaultB : $@convention(witness_method: ResilientProtocol) (@in_guaranteed ConformingStruct) -> () { @@ -324,7 +324,7 @@ bb0(%0 : $*T): return %result : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingType(ptr noalias captures(none) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingType(ptr noalias nocapture %0) sil @passConformingType : $@convention(thin) (@in ResilientConformingType) -> () { bb0(%0 : $*ResilientConformingType): @@ -381,7 +381,7 @@ bb0(%0 : $*T): return %result : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingTypeRefined(ptr noalias captures(none) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingTypeRefined(ptr noalias nocapture %0) sil @passConformingTypeRefined : $@convention(thin) (@in AnotherConformingStruct) -> () { bb0(%0 : $*AnotherConformingStruct): @@ -424,7 +424,7 @@ bb0(%0 : $*T): return %result : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingTypeAssoc(ptr noalias captures(none) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @passConformingTypeAssoc(ptr noalias nocapture %0) sil @passConformingTypeAssoc : $@convention(thin) (@in ConformsWithResilientAssoc) -> () { bb0(%0 : $*ConformsWithResilientAssoc): diff --git a/test/IRGen/protocol_resilience_thunks.swift b/test/IRGen/protocol_resilience_thunks.swift index 491fec9c2dffe..7317d671b3690 100644 --- a/test/IRGen/protocol_resilience_thunks.swift +++ b/test/IRGen/protocol_resilience_thunks.swift @@ -52,12 +52,12 @@ public protocol MyResilientProtocol { // CHECK-NEXT: [[RESULT:%.*]] = call swiftcc i1 [[WITNESS]](ptr noalias swiftself %0, ptr %1, ptr %2) // CHECK-NEXT: ret i1 [[RESULT]] -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP10returnsAnyypyFTj"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias swiftself %1, ptr %2, ptr %3) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP10returnsAnyypyFTj"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias swiftself %1, ptr %2, ptr %3) // CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds ptr, ptr %3, i32 3 // CHECK-NEXT: [[WITNESS:%.*]] = load ptr, ptr [[WITNESS_ADDR]] // CHECK-arm64e-NEXT: ptrtoint ptr [[WITNESS_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend -// CHECK-NEXT: call swiftcc void [[WITNESS]](ptr noalias captures(none) sret({{.*}}) %0, ptr noalias swiftself %1, ptr %2, ptr %3) +// CHECK-NEXT: call swiftcc void [[WITNESS]](ptr noalias nocapture sret({{.*}}) %0, ptr noalias swiftself %1, ptr %2, ptr %3) // CHECK-NEXT: ret void // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP12throwingFuncyyKFTj"(ptr noalias swiftself %0, ptr{{( noalias nocapture( swifterror)? dereferenceable\(.\))?}} %1, ptr %2, ptr %3) diff --git a/test/IRGen/same_type_constraints.swift b/test/IRGen/same_type_constraints.swift index 0adae5e99a89d..4287f34a4c96f 100644 --- a/test/IRGen/same_type_constraints.swift +++ b/test/IRGen/same_type_constraints.swift @@ -67,7 +67,7 @@ where Self : CodingType, print(Self.ValueType.self) } -// OSIZE: define internal swiftcc ptr @"$s21same_type_constraints12GenericKlazzCyxq_GAA1EAA4DataAaEP_AA0F4TypePWT"(ptr readnone %"GenericKlazz.Data", ptr captures(none) readonly %"GenericKlazz", ptr captures(none) readnone %"GenericKlazz.E") [[ATTRS:#[0-9]+]] { +// OSIZE: define internal swiftcc ptr @"$s21same_type_constraints12GenericKlazzCyxq_GAA1EAA4DataAaEP_AA0F4TypePWT"(ptr readnone %"GenericKlazz.Data", ptr nocapture readonly %"GenericKlazz", ptr nocapture readnone %"GenericKlazz.E") [[ATTRS:#[0-9]+]] { // OSIZE: [[ATTRS]] = {{{.*}}noinline // Check that same-typing two generic parameters together lowers correctly. diff --git a/test/IRGen/select_enum.sil b/test/IRGen/select_enum.sil index 2d9fdeff6bec0..326fc5d7bedaf 100644 --- a/test/IRGen/select_enum.sil +++ b/test/IRGen/select_enum.sil @@ -7,7 +7,7 @@ enum SinglePayloadSingleEmpty { case DataCase(Builtin.Word) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @select_enum_SinglePayloadSingleEmpty(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @select_enum_SinglePayloadSingleEmpty(ptr noalias nocapture dereferenceable({{.*}}) %0) sil @select_enum_SinglePayloadSingleEmpty : $@convention(thin) (@in SinglePayloadSingleEmpty) -> () { bb0(%0 : $*SinglePayloadSingleEmpty): %1 = load %0 : $*SinglePayloadSingleEmpty diff --git a/test/IRGen/sil_generic_witness_methods.swift b/test/IRGen/sil_generic_witness_methods.swift index ddecb7406b058..7a3fa619c093a 100644 --- a/test/IRGen/sil_generic_witness_methods.swift +++ b/test/IRGen/sil_generic_witness_methods.swift @@ -34,7 +34,7 @@ func call_methods(_ x: T, y: S, z: U) { x.generic_method(z) } -// CHECK-LABEL: define hidden swiftcc void @"$s27sil_generic_witness_methods017call_existential_D0{{[_0-9a-zA-Z]*}}F"(ptr noalias captures(none) dereferenceable({{.*}}) %0) +// CHECK-LABEL: define hidden swiftcc void @"$s27sil_generic_witness_methods017call_existential_D0{{[_0-9a-zA-Z]*}}F"(ptr noalias nocapture dereferenceable({{.*}}) %0) func call_existential_methods(_ x: P, y: S) { // CHECK: [[METADATA_ADDR:%.*]] = getelementptr inbounds{{.*}} %T27sil_generic_witness_methods1PP, ptr [[X:%0]], i32 0, i32 1 // CHECK: [[METADATA:%.*]] = load ptr, ptr [[METADATA_ADDR]], align 8 diff --git a/test/IRGen/sil_witness_methods.sil b/test/IRGen/sil_witness_methods.sil index 300d608a30679..e1a6e737bbd0b 100644 --- a/test/IRGen/sil_witness_methods.sil +++ b/test/IRGen/sil_witness_methods.sil @@ -28,14 +28,14 @@ struct X {} struct Y {} struct Z {} -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @concrete_type_concrete_method_witness(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @concrete_type_concrete_method_witness(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) sil @concrete_type_concrete_method_witness : $@convention(witness_method: P) (@in Foo) -> @thick Foo.Type { entry(%x : $*Foo): %m = metatype $@thick Foo.Type return %m : $@thick Foo.Type } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @generic_type_concrete_method_witness(ptr noalias captures(none) swiftself dereferenceable({{.*}}) %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @generic_type_concrete_method_witness(ptr noalias nocapture swiftself dereferenceable({{.*}}) %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-objc: [[T1:%.*]] = getelementptr inbounds ptr, ptr %Self, i64 10 // CHECK-native: [[T1:%.*]] = getelementptr inbounds ptr, ptr %Self, i64 7 // CHECK: %T = load ptr, ptr [[T1]], align 8 @@ -87,14 +87,14 @@ entry(%x : $@thick Bar.Type): // TODO: %Self Type arg is redundant for class method witness -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @concrete_type_generic_method_witness(ptr noalias %0, ptr %Z, ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @concrete_type_generic_method_witness(ptr noalias %0, ptr %Z, ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) sil @concrete_type_generic_method_witness : $@convention(witness_method: P) (@in Z, @in Foo) -> @thick Foo.Type { entry(%z : $*Z, %x : $*Foo): %m = metatype $@thick Foo.Type return %m : $@thick Foo.Type } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @generic_type_generic_method_witness(ptr noalias %0, ptr %Z, ptr noalias captures(none) swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @generic_type_generic_method_witness(ptr noalias %0, ptr %Z, ptr noalias nocapture swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) sil @generic_type_generic_method_witness : $@convention(witness_method: P) (@in Z, @in Bar) -> @thick Bar.Type { entry(%z : $*Z, %x : $*Bar): %t = metatype $@thick T.Type diff --git a/test/IRGen/sil_witness_tables.swift b/test/IRGen/sil_witness_tables.swift index f900a2826a42e..94b5d0bc4e4ea 100644 --- a/test/IRGen/sil_witness_tables.swift +++ b/test/IRGen/sil_witness_tables.swift @@ -57,14 +57,14 @@ struct Conformer2: Q { func qMethod() {} } -// CHECK-LABEL: define hidden swiftcc void @"$s18sil_witness_tables7erasure1cAA2QQ_pAA9ConformerV_tF"(ptr noalias captures(none) sret({{.*}}) %0) +// CHECK-LABEL: define hidden swiftcc void @"$s18sil_witness_tables7erasure1cAA2QQ_pAA9ConformerV_tF"(ptr noalias nocapture sret({{.*}}) %0) // CHECK: [[WITNESS_TABLE_ADDR:%.*]] = getelementptr inbounds{{.*}} %T18sil_witness_tables2QQP, ptr %0, i32 0, i32 2 // CHECK-NEXT: store ptr [[CONFORMER_QQ_WITNESS_TABLE:@"\$s.*WP"]], ptr [[WITNESS_TABLE_ADDR]], align 8 func erasure(c: Conformer) -> QQ { return c } -// CHECK-LABEL: define hidden swiftcc void @"$s18sil_witness_tables15externalErasure1c0a1_b1_c1_D12_conformance9ExternalP_pAD0G9ConformerV_tF"(ptr noalias captures(none) sret({{.*}}) %0) +// CHECK-LABEL: define hidden swiftcc void @"$s18sil_witness_tables15externalErasure1c0a1_b1_c1_D12_conformance9ExternalP_pAD0G9ConformerV_tF"(ptr noalias nocapture sret({{.*}}) %0) // CHECK: [[WITNESS_TABLE_ADDR:%.*]] = getelementptr inbounds{{.*}} %T39sil_witness_tables_external_conformance9ExternalPP, ptr %0, i32 0, i32 2 // CHECK-NEXT: store ptr [[EXTERNAL_CONFORMER_EXTERNAL_P_WITNESS_TABLE]], ptr %2, align 8 func externalErasure(c: ExternalConformer) -> ExternalP { diff --git a/test/IRGen/struct_resilience.swift b/test/IRGen/struct_resilience.swift index 81473ef91ca6c..5871ed78b1c6f 100644 --- a/test/IRGen/struct_resilience.swift +++ b/test/IRGen/struct_resilience.swift @@ -80,7 +80,7 @@ public struct MySize { public let h: Int } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience32functionWithMyResilientTypesSize_1fAA0eH0VAEn_A2EnXEtF"(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{8|(16)}}) %1, ptr %2, ptr %3) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience32functionWithMyResilientTypesSize_1fAA0eH0VAEn_A2EnXEtF"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{8|(16)}}) %1, ptr %2, ptr %3) public func functionWithMyResilientTypesSize(_ s: __owned MySize, f: (__owned MySize) -> MySize) -> MySize { // There's an alloca for debug info? @@ -108,7 +108,7 @@ public func functionWithMyResilientTypesSize(_ s: __owned MySize, f: (__owned My // CHECK: store [[INT]] [[H]], ptr [[H_PTR]] -// CHECK: call swiftcc void %2(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{8|16}}) [[DST]], ptr swiftself %3) +// CHECK: call swiftcc void %2(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{8|16}}) [[DST]], ptr swiftself %3) // CHECK: call void @llvm.lifetime.end.p0({{i32|i64}} {{8|16}}, ptr [[DST]]) // CHECK: ret void @@ -164,7 +164,7 @@ public struct ResilientStructWithMethod { // Corner case -- type is address-only in SIL, but empty in IRGen -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience29partialApplyOfResilientMethod1ryAA0f10StructWithG0V_tF"(ptr noalias captures(none) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience29partialApplyOfResilientMethod1ryAA0f10StructWithG0V_tF"(ptr noalias nocapture %0) public func partialApplyOfResilientMethod(r: ResilientStructWithMethod) { _ = r.method } @@ -190,7 +190,7 @@ public func resilientAny(s : ResilientWeakRef) { // CHECK: [[TYADDR:%.*]] = getelementptr inbounds{{.*}} %Any, ptr [[ANY]], i32 0, i32 1 // CHECK: store ptr [[META2]], ptr [[TYADDR]] // CHECK: call ptr @__swift_allocate_boxed_opaque_existential_0(ptr [[ANY]]) -// CHECK: call swiftcc void @"$s17struct_resilience8wantsAnyyyypF"(ptr noalias captures(none) dereferenceable({{(32|16)}}) [[ANY]]) +// CHECK: call swiftcc void @"$s17struct_resilience8wantsAnyyyypF"(ptr noalias nocapture dereferenceable({{(32|16)}}) [[ANY]]) // CHECK: call void @__swift_destroy_boxed_opaque_existential_0(ptr [[ANY]]) // CHECK: ret void diff --git a/test/IRGen/struct_with_resilient_type.swift b/test/IRGen/struct_with_resilient_type.swift index 47b49edf94261..00c03d270cb57 100644 --- a/test/IRGen/struct_with_resilient_type.swift +++ b/test/IRGen/struct_with_resilient_type.swift @@ -44,7 +44,7 @@ crashCaller() // Don't use the type layout based value witness based generation (i.e we load field offsets below). -// VWT-macosx: define {{.*}} ptr @"$s26struct_with_resilient_type9SomeValueVwta"(ptr noalias returned {{.*}}, ptr noalias {{.*}}, ptr captures(none) readonly [[MT:%.*]]) +// VWT-macosx: define {{.*}} ptr @"$s26struct_with_resilient_type9SomeValueVwta"(ptr noalias returned {{.*}}, ptr noalias {{.*}}, ptr nocapture readonly [[MT:%.*]]) // VWT-macosx: [[VAL1:%.*]] = load i64 // VWT-macosx: store i64 [[VAL1]] // VWT-macosx: [[T1:%.*]] = tail call swiftcc %swift.metadata_response @"$s16resilient_struct13ResilientBoolVMa"(i64 0) diff --git a/test/IRGen/typed_throws.sil b/test/IRGen/typed_throws.sil index e92f0c125dff8..c2f42b8f5c36d 100644 --- a/test/IRGen/typed_throws.sil +++ b/test/IRGen/typed_throws.sil @@ -18,7 +18,7 @@ sil_vtable A {} sil @create_error : $@convention(thin) () -> @owned A -// CHECK: define{{.*}} swiftcc { ptr, ptr } @throw_error(ptr swiftself %0, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %1) +// CHECK: define{{.*}} swiftcc { ptr, ptr } @throw_error(ptr swiftself %0, ptr noalias nocapture swifterror dereferenceable({{.*}}) %1) // CHECK: [[ERR:%.*]] = call swiftcc ptr @create_error() // CHECK: call ptr @swift_retain(ptr returned [[ERR]]) // CHECK: store ptr inttoptr (i64 1 to ptr), ptr %1 @@ -47,7 +47,7 @@ sil @try_apply_helper : $@convention(thin) (@owned AnyObject) -> (@owned AnyObje // CHECK: entry: // CHECK: %swifterror = alloca swifterror ptr // CHECK: store ptr null, ptr %swifterror -// CHECK: [[RES:%.*]] = call swiftcc { ptr, ptr } @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %swifterror) +// CHECK: [[RES:%.*]] = call swiftcc { ptr, ptr } @try_apply_helper(ptr %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable({{.*}}) %swifterror) // CHECK: [[RES_0:%.*]] = extractvalue { ptr, ptr } [[RES]], 0 // CHECK: [[RES_1:%.*]] = extractvalue { ptr, ptr } [[RES]], 1 // CHECK: [[ERRFLAG:%.*]] = load ptr, ptr %swifterror @@ -209,8 +209,8 @@ bb6: return %7 : $() } -// CHECK: define{{.*}} internal swiftcc { ptr, ptr } @"$s16try_apply_helperTA"(ptr swiftself %0, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %1) -// CHECK: tail call swiftcc { ptr, ptr } @try_apply_helper(ptr {{.*}}, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %1) +// CHECK: define{{.*}} internal swiftcc { ptr, ptr } @"$s16try_apply_helperTA"(ptr swiftself %0, ptr noalias nocapture swifterror dereferenceable({{.*}}) %1) +// CHECK: tail call swiftcc { ptr, ptr } @try_apply_helper(ptr {{.*}}, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable({{.*}}) %1) // CHECK: ret { ptr, ptr } sil @partial_apply_test : $@convention(thin) (@owned AnyObject) -> @owned @callee_guaranteed () ->(@owned AnyObject, @error S) { @@ -234,7 +234,7 @@ entry(%0: $AnyObject): // CHECK:entry: // CHECK: %swifterror = alloca swifterror ptr // CHECK: store ptr null, ptr %swifterror -// CHECK: call swiftcc { ptr, ptr } %0(ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable({{[0-9]+}}) %swifterror) +// CHECK: call swiftcc { ptr, ptr } %0(ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable({{[0-9]+}}) %swifterror) sil @apply_closure : $@convention(thin) (@guaranteed @callee_guaranteed () -> (@owned AnyObject, @error S)) -> () { entry(%0 : $@callee_guaranteed () ->(@owned AnyObject, @error S)): @@ -272,7 +272,7 @@ bb6: return %t : $() } -// CHECK: define{{.*}} swiftcc void @throwNoError(i64 %0, ptr noalias %1, ptr %"\CF\84_0_0", ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %3, ptr %4) +// CHECK: define{{.*}} swiftcc void @throwNoError(i64 %0, ptr noalias %1, ptr %"\CF\84_0_0", ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable({{.*}}) %3, ptr %4) // CHECK: ret void sil @throwNoError : $@convention(thin) <τ_0_0> (Builtin.Int64, @in τ_0_0) -> @error_indirect τ_0_0 { @@ -281,14 +281,14 @@ bb0(%0: $*τ_0_0, %1 : $Builtin.Int64, %2 : $*τ_0_0): return %5 : $() } -// CHECK: define{{.*}} swiftcc void @throwNoErrorGenericOut(ptr noalias sret(%swift.opaque) %0, i64 %1, ptr noalias %2, ptr %"\CF\84_0_0", ptr %"\CF\84_0_1", ptr swiftself %3, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %4, ptr %5) +// CHECK: define{{.*}} swiftcc void @throwNoErrorGenericOut(ptr noalias sret(%swift.opaque) %0, i64 %1, ptr noalias %2, ptr %"\CF\84_0_0", ptr %"\CF\84_0_1", ptr swiftself %3, ptr noalias nocapture swifterror dereferenceable({{.*}}) %4, ptr %5) sil @throwNoErrorGenericOut : $@convention(thin) <τ_0_0, τ_0_1> (Builtin.Int64, @in τ_0_0) -> (@error_indirect τ_0_0, @out τ_0_1) { bb0(%0: $*τ_0_1, %1: $*τ_0_0, %2 : $Builtin.Int64, %3 : $*τ_0_0): %5 = tuple () return %5 : $() } -// CHECK: define{{.*}} swiftcc void @throwError(i64 %0, ptr noalias %1, ptr %"\CF\84_0_0", ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable({{.*}}) %3, ptr %4) +// CHECK: define{{.*}} swiftcc void @throwError(i64 %0, ptr noalias %1, ptr %"\CF\84_0_0", ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable({{.*}}) %3, ptr %4) // CHECK: entry: // CHECK: load ptr, ptr // CHECK: [[VW:%.*]] = load ptr, ptr @@ -309,7 +309,7 @@ sil @throwError2 : $@convention(thin) (Builtin.Int64, @in T) -> (@error_i // CHECK: store ptr null, ptr %swifterror // CHECK: [[SIZE:%.*]] = load i64 // CHECK: [[TYPEDERR:%.*]] = alloca i8, i64 [[SIZE]] -// CHECK: call swiftcc void @throwError2(ptr noalias sret(%swift.opaque) %0, i64 0, ptr noalias %1, ptr %T, ptr %V, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr [[TYPEDERR]]) +// CHECK: call swiftcc void @throwError2(ptr noalias sret(%swift.opaque) %0, i64 0, ptr noalias %1, ptr %T, ptr %V, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr [[TYPEDERR]]) // CHECK: [[ERR_FLAG:%.*]] = load ptr, ptr %swifterror // CHECK: [[ISERR:%.*]] = icmp ne ptr [[ERR_FLAG]], null // CHECK: br i1 [[ISERR]] @@ -379,8 +379,8 @@ bb3: sil @try_apply_helper_generic : $@convention(thin) (@in T) -> (@out T, @error_indirect T) -// CHECK: define{{.*}} internal swiftcc void @"$s24try_apply_helper_genericTA"(ptr noalias sret(%swift.opaque) %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3) -// CHECK: call swiftcc void @try_apply_helper_generic(ptr noalias sret(%swift.opaque) %0, ptr noalias {{%.*}}, ptr %T, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3) +// CHECK: define{{.*}} internal swiftcc void @"$s24try_apply_helper_genericTA"(ptr noalias sret(%swift.opaque) %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3) +// CHECK: call swiftcc void @try_apply_helper_generic(ptr noalias sret(%swift.opaque) %0, ptr noalias {{%.*}}, ptr %T, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3) sil @partial_apply_test_generic : $@convention(thin) (@in T) -> @owned @callee_guaranteed () ->(@out T, @error_indirect T) { entry(%0: $*T): @@ -411,7 +411,7 @@ entry(%0: $*T): // CHECK: [[V2:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable{{.*}} // CHECK: [[V3:%.*]] = load i64, ptr [[V2]] // CHECK: [[V4:%.*]] = alloca i8, i64 [[V3]] -// CHECK: call swiftcc void %0(ptr noalias sret(%swift.opaque) [[T4]], ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr [[V4]]) +// CHECK: call swiftcc void %0(ptr noalias sret(%swift.opaque) [[T4]], ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr [[V4]]) sil @apply_closure_generic : $@convention(thin) (@guaranteed @callee_guaranteed () ->(@out T, @error_indirect V)) -> () { entry(%0 : $@callee_guaranteed () ->(@out T, @error_indirect V)): %err = alloc_stack $V diff --git a/test/IRGen/typed_throws.swift b/test/IRGen/typed_throws.swift index dfa5b9fd403bc..69b1c317a126c 100644 --- a/test/IRGen/typed_throws.swift +++ b/test/IRGen/typed_throws.swift @@ -75,7 +75,7 @@ func reabstractAsConcreteThrowing() throws -> Int { try passthroughCall(fiveOrTypedBust) } -// CHECK-LABEL: define {{.*}} swiftcc void @"$sSi12typed_throws10MyBigErrorOIgdzo_SiACIegrzr_TR"(ptr noalias captures(none) sret(%TSi) %0, ptr %1, ptr %2, ptr swiftself %3, ptr noalias captures(none) swifterror dereferenceable(8) %4, ptr %5) +// CHECK-LABEL: define {{.*}} swiftcc void @"$sSi12typed_throws10MyBigErrorOIgdzo_SiACIegrzr_TR"(ptr noalias nocapture sret(%TSi) %0, ptr %1, ptr %2, ptr swiftself %3, ptr noalias nocapture swifterror dereferenceable(8) %4, ptr %5) // CHECK: call swiftcc {{i32|i64}} %1 // CHECK: [[CMP:%.*]] = icmp ne ptr {{%.*}}, null // CHECK: br i1 [[CMP]], label %typed.error.load @@ -107,7 +107,7 @@ func throwsSmallError() throws(SmallError) -> (Float, Int) { } // CHECK: define hidden swiftcc i64 @"$s12typed_throws17catchesSmallErrorSiyF"() -// CHECK: [[RES:%.*]] = call swiftcc { float, i64 } @"$s12typed_throws0B10SmallErrorSf_SityAA0cD0VYKF"(ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[RES:%.*]] = call swiftcc { float, i64 } @"$s12typed_throws0B10SmallErrorSf_SityAA0cD0VYKF"(ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[R0:%.*]] = extractvalue { float, i64 } [[RES]], 0 // CHECK: [[R1:%.*]] = extractvalue { float, i64 } [[RES]], 1 // CHECK: phi i64 [ [[R1]], %typed.error.load ] @@ -316,7 +316,7 @@ func smallResultLargerError() throws(SmallError) -> Int8? { } // CHECK: [[COERCED:%.*]] = alloca { i16 }, align 2 -// CHECK: [[RES:%.*]] = call swiftcc i64 @"$s12typed_throws22smallResultLargerErrors4Int8VSgyAA05SmallF0VYKF"(ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[RES:%.*]] = call swiftcc i64 @"$s12typed_throws22smallResultLargerErrors4Int8VSgyAA05SmallF0VYKF"(ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[TRUNC:%.*]] = trunc i64 [[RES]] to i16 // CHECK: [[COERCED_PTR:%.*]] = getelementptr inbounds{{.*}} { i16 }, ptr [[COERCED]], i32 0, i32 0 // CHECK: store i16 [[TRUNC]], ptr [[COERCED_PTR]], align 2 @@ -335,7 +335,7 @@ func smallErrorLargerResult() throws(UInt8OptSingletonError) -> Int { } // CHECK: [[COERCED:%.*]] = alloca { i16 }, align 2 -// CHECK: [[RES:%.*]] = call swiftcc i64 @"$s12typed_throws22smallErrorLargerResultSiyAA017UInt8OptSingletonD0OYKF"(ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[RES:%.*]] = call swiftcc i64 @"$s12typed_throws22smallErrorLargerResultSiyAA017UInt8OptSingletonD0OYKF"(ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[TRUNC:%.*]] = trunc i64 [[RES]] to i16 // CHECK: [[COERCED_PTR:%.*]] = getelementptr inbounds{{.*}} { i16 }, ptr [[COERCED]], i32 0, i32 0 // CHECK: store i16 [[TRUNC]], ptr [[COERCED_PTR]], align 2 diff --git a/test/IRGen/typed_throws_abi.swift b/test/IRGen/typed_throws_abi.swift index 22ca2ae6c9465..58d6240263382 100644 --- a/test/IRGen/typed_throws_abi.swift +++ b/test/IRGen/typed_throws_abi.swift @@ -21,7 +21,7 @@ struct ThreeWords: Error { } struct Impl: P { - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2f0yySbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2f0yySbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret void @@ -38,7 +38,7 @@ struct Impl: P { } } - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2f1ySiSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2f1ySiSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret i64 1 @@ -56,7 +56,7 @@ struct Impl: P { return 1 } - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2f2ySi_SitSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2f2ySi_SitSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret { i64, i64 } { i64 1, i64 2 } @@ -74,7 +74,7 @@ struct Impl: P { return (1, 2) } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f3ySi_S2itSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f3ySi_S2itSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret { i64, i64, i64 } { i64 1, i64 2, i64 3 } @@ -92,7 +92,7 @@ struct Impl: P { return (1, 2, 3) } - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f4ySi_S3itSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f4ySi_S3itSbAA5EmptyVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret { i64, i64, i64, i64 } { i64 1, i64 2, i64 3, i64 4 } @@ -110,7 +110,7 @@ struct Impl: P { return (1, 2, 3, 4) } - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2f5ySi_S4itSbAA5EmptyVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2f5ySi_S4itSbAA5EmptyVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4) // CHECK: br i1 %1, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: store i64 1, ptr %.elt._value, align 8 @@ -133,7 +133,7 @@ struct Impl: P { return (1, 2, 3, 4, 5) } - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2g0yySbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2g0yySbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -151,7 +151,7 @@ struct Impl: P { } } - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2g1ySiSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi4ImplV2g1ySiSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -170,7 +170,7 @@ struct Impl: P { return 1 } - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2g2ySi_SitSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2g2ySi_SitSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -189,7 +189,7 @@ struct Impl: P { return (1, 2) } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g3ySi_S2itSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g3ySi_S2itSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -208,7 +208,7 @@ struct Impl: P { return (1, 2, 3) } - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g4ySi_S3itSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g4ySi_S3itSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -227,7 +227,7 @@ struct Impl: P { return (1, 2, 3, 4) } - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2g5ySi_S4itSbAA7OneWordVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2g5ySi_S4itSbAA7OneWordVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4) // CHECK: entry: // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV, align 8 // CHECK: br i1 %1, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -252,7 +252,7 @@ struct Impl: P { return (1, 2, 3, 4, 5) } - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h0yySbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h0yySbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -270,7 +270,7 @@ struct Impl: P { } } - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h1ySiSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h1ySiSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -289,7 +289,7 @@ struct Impl: P { return 1 } - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h2ySi_SitSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h2ySi_SitSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -308,7 +308,7 @@ struct Impl: P { return (1, 2) } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h3ySi_S2itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h3ySi_S2itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -327,7 +327,7 @@ struct Impl: P { return (1, 2, 3) } - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h4ySi_S3itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h4ySi_S3itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -346,7 +346,7 @@ struct Impl: P { return (1, 2, 3, 4) } - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2h5ySi_S4itSbAA8TwoWordsVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2h5ySi_S4itSbAA8TwoWordsVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4) // CHECK: entry: // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV, align 8 // CHECK: br i1 %1, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -371,7 +371,7 @@ struct Impl: P { return (1, 2, 3, 4, 5) } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i0yySbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i0yySbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -389,7 +389,7 @@ struct Impl: P { } } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i1ySiSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i1ySiSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -408,7 +408,7 @@ struct Impl: P { return 1 } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i2ySi_SitSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i2ySi_SitSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -427,7 +427,7 @@ struct Impl: P { return (1, 2) } - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i3ySi_S2itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i3ySi_S2itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -446,7 +446,7 @@ struct Impl: P { return (1, 2, 3) } - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i4ySi_S3itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i4ySi_S3itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -465,7 +465,7 @@ struct Impl: P { return (1, 2, 3, 4) } - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2i5ySi_S4itSbAA10ThreeWordsVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi4ImplV2i5ySi_S4itSbAA10ThreeWordsVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4) // CHECK: entry: // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV, align 8 // CHECK: br i1 %1, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -494,7 +494,7 @@ struct Impl: P { // CHECK: define hidden swiftcc i1 @"$s16typed_throws_abi11callImpl_f0ySbAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2f0yySbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2f0yySbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] @@ -521,7 +521,7 @@ func callImpl_f0(_ impl: Impl, _ b: Bool) -> Bool { // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi11callImpl_f1ySiAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2f1ySiSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2f1ySiSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] @@ -548,7 +548,7 @@ func callImpl_f1(_ impl: Impl, _ b: Bool) -> Int { // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi11callImpl_f2ySi_SitAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2f2ySi_SitSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2f2ySi_SitSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 1 // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 @@ -581,7 +581,7 @@ func callImpl_f2(_ impl: Impl, _ b: Bool) -> (Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_f3ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f3ySi_S2itSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f3ySi_S2itSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -618,7 +618,7 @@ func callImpl_f3(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi11callImpl_f4ySi_S3itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f4ySi_S3itSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2f4ySi_S3itSbAA5EmptyVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 2 @@ -656,12 +656,12 @@ func callImpl_f4(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int) { } } -// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_f5ySi_S4itAA0E0V_SbtF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) +// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_f5ySi_S4itAA0E0V_SbtF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 // CHECK: %swifterror1 = alloca ptr, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 -// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2f5ySi_S4itSbAA5EmptyVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr %swifterror1) +// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2f5ySi_S4itSbAA5EmptyVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr %swifterror1) // CHECK: [[CALL_RES0:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES1:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES2:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 @@ -706,7 +706,7 @@ func callImpl_f5(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int, Int) { // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi11callImpl_g0ySiAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2g0yySbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2g0yySbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] @@ -734,7 +734,7 @@ func callImpl_g0(_ impl: Impl, _ b: Bool) -> Int { // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi11callImpl_g1ySiAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2g1ySiSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc i64 @"$s16typed_throws_abi4ImplV2g1ySiSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] @@ -762,7 +762,7 @@ func callImpl_g1(_ impl: Impl, _ b: Bool) -> Int { // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi11callImpl_g2ySi_SitAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2g2ySi_SitSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2g2ySi_SitSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 1 // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 @@ -796,7 +796,7 @@ func callImpl_g2(_ impl: Impl, _ b: Bool) -> (Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_g3ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g3ySi_S2itSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g3ySi_S2itSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -834,7 +834,7 @@ func callImpl_g3(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi11callImpl_g4ySi_S3itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g4ySi_S3itSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2g4ySi_S3itSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 2 @@ -873,12 +873,12 @@ func callImpl_g4(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int) { } } -// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_g5ySi_S4itAA0E0V_SbtF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) +// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_g5ySi_S4itAA0E0V_SbtF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 // CHECK: %swifterror1 = alloca %T16typed_throws_abi7OneWordV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 -// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2g5ySi_S4itSbAA7OneWordVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr %swifterror1) +// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2g5ySi_S4itSbAA7OneWordVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr %swifterror1) // CHECK: [[CALL_RES0:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES1:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES2:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 @@ -927,7 +927,7 @@ func callImpl_g5(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi11callImpl_h0ySi_SitAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h0yySbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h0yySbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 1 // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 @@ -961,7 +961,7 @@ func callImpl_h0(_ impl: Impl, _ b: Bool) -> (Int, Int) { // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi11callImpl_h1ySi_SitAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h1ySiSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h1ySiSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 1 // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 @@ -995,7 +995,7 @@ func callImpl_h1(_ impl: Impl, _ b: Bool) -> (Int, Int) { // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi11callImpl_h2ySi_SitAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h2ySi_SitSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64 } @"$s16typed_throws_abi4ImplV2h2ySi_SitSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64 } [[CALL_RES]], 1 // CHECK: [[ERROR:%.*]] = load ptr, ptr %swifterror, align 8 @@ -1030,7 +1030,7 @@ func callImpl_h2(_ impl: Impl, _ b: Bool) -> (Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_h3ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h3ySi_S2itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h3ySi_S2itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -1069,7 +1069,7 @@ func callImpl_h3(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi11callImpl_h4ySi_S3itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h4ySi_S3itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2h4ySi_S3itSbAA8TwoWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 2 @@ -1109,12 +1109,12 @@ func callImpl_h4(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int) { } } -// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_h5ySi_S4itAA0E0V_SbtF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) +// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_h5ySi_S4itAA0E0V_SbtF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 // CHECK: %swifterror1 = alloca %T16typed_throws_abi8TwoWordsV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 -// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2h5ySi_S4itSbAA8TwoWordsVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr %swifterror1) +// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2h5ySi_S4itSbAA8TwoWordsVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr %swifterror1) // CHECK: [[CALL_RES0:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES1:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES2:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 @@ -1165,7 +1165,7 @@ func callImpl_h5(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_i0ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i0yySbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i0yySbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -1203,7 +1203,7 @@ func callImpl_i0(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_i1ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i1ySiSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i1ySiSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -1241,7 +1241,7 @@ func callImpl_i1(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_i2ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i2ySi_SitSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i2ySi_SitSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -1281,7 +1281,7 @@ func callImpl_i2(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi11callImpl_i3ySi_S2itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i3ySi_S2itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i3ySi_S2itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64 } [[CALL_RES]], 2 @@ -1321,7 +1321,7 @@ func callImpl_i3(_ impl: Impl, _ b: Bool) -> (Int, Int, Int) { // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi11callImpl_i4ySi_S3itAA0E0V_SbtF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i4ySi_S3itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi4ImplV2i4ySi_S3itSbAA10ThreeWordsVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { i64, i64, i64, i64 } [[CALL_RES]], 2 @@ -1362,12 +1362,12 @@ func callImpl_i4(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int) { } } -// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_i5ySi_S4itAA0E0V_SbtF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) +// CHECK: define hidden swiftcc void @"$s16typed_throws_abi11callImpl_i5ySi_S4itAA0E0V_SbtF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 // CHECK: %swifterror1 = alloca %T16typed_throws_abi10ThreeWordsV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 -// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2i5ySi_S4itSbAA10ThreeWordsVYKF"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror, ptr %swifterror1) +// CHECK: call swiftcc void @"$s16typed_throws_abi4ImplV2i5ySi_S4itSbAA10ThreeWordsVYKF"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %call.aggresult, i1 %1, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror, ptr %swifterror1) // CHECK: [[CALL_RES0:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES1:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 // CHECK: [[CALL_RES2:%.*]] = load i64, ptr {{%call.aggresult.*}}, align 8 @@ -1519,7 +1519,7 @@ struct ImplAsync: PAsync { return (1, 2, 3, 4) } - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2f5ySi_S4itSbYaAA5EmptyVYKF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr %3) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2f5ySi_S4itSbYaAA5EmptyVYKF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr %3) // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: br i1 %2, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: @@ -1648,7 +1648,7 @@ struct ImplAsync: PAsync { return (1, 2, 3, 4) } - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2g5ySi_S4itSbYaAA7OneWordVYKF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr %3) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2g5ySi_S4itSbYaAA7OneWordVYKF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr %3) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi7OneWordV, align 8 // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: br i1 %2, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -1778,7 +1778,7 @@ struct ImplAsync: PAsync { return (1, 2, 3, 4) } - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2h5ySi_S4itSbYaAA8TwoWordsVYKF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr %3) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2h5ySi_S4itSbYaAA8TwoWordsVYKF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr %3) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi8TwoWordsV, align 8 // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: br i1 %2, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -1908,7 +1908,7 @@ struct ImplAsync: PAsync { return (1, 2, 3, 4) } - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2i5ySi_S4itSbYaAA10ThreeWordsVYKF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr %3) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi9ImplAsyncV2i5ySi_S4itSbYaAA10ThreeWordsVYKF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr %3) // CHECK: [[ERROR:%.*]] = alloca %T16typed_throws_abi10ThreeWordsV, align 8 // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: br i1 %2, label %[[SUCCESS:.*]], label %[[FAIL:.*]] @@ -2127,7 +2127,7 @@ func callImplAsync_f4(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int } } -// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_f5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2) +// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_f5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2) // CHECK: %swifterror = alloca ptr, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 // CHECK: %swifterror1 = alloca swifterror ptr, align 8 @@ -2381,7 +2381,7 @@ func callImplAsync_g4(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int } -// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_g5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2) +// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_g5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2) // CHECK: %swifterror = alloca %T16typed_throws_abi7OneWordV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 // CHECK: %swifterror1 = alloca swifterror ptr, align 8 @@ -2647,7 +2647,7 @@ func callImplAsync_h4(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int } -// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_h5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2) +// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_h5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2) // CHECK: %swifterror = alloca %T16typed_throws_abi8TwoWordsV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 // CHECK: %swifterror1 = alloca swifterror ptr, align 8 @@ -2927,7 +2927,7 @@ func callImplAsync_i4(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int } -// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_i5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2) +// CHECK: define hidden swifttailcc void @"$s16typed_throws_abi16callImplAsync_i5ySi_S4itAA0eF0V_SbtYaF"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2) // CHECK: %swifterror = alloca %T16typed_throws_abi10ThreeWordsV, align 8 // CHECK: %call.aggresult = alloca <{ %TSi, %TSi, %TSi, %TSi, %TSi }>, align 8 // CHECK: %swifterror1 = alloca swifterror ptr, align 8 @@ -2989,7 +2989,7 @@ func callImplAsync_i5(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int } } -// CHECK: define hidden swiftcc { float, float, i64 } @"$s16typed_throws_abi14nonMatching_f0ySf_SftSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) +// CHECK: define hidden swiftcc { float, float, i64 } @"$s16typed_throws_abi14nonMatching_f0ySf_SftSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret { float, float, i64 } { float 1.000000e+00, float 2.000000e+00, i64 undef } @@ -3009,7 +3009,7 @@ func nonMatching_f0(_ b: Bool) throws(OneWord) -> (Float, Float) { // CHECK: define hidden swiftcc { i64, float, float } @"$s16typed_throws_abi18callNonMatching_f0ySi_S2ftSbF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 // CHECK: store ptr null, ptr %swifterror, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { float, float, i64 } @"$s16typed_throws_abi14nonMatching_f0ySf_SftSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { float, float, i64 } @"$s16typed_throws_abi14nonMatching_f0ySf_SftSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { float, float, i64 } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { float, float, i64 } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { float, float, i64 } [[CALL_RES]], 2 @@ -3044,7 +3044,7 @@ func callNonMatching_f0(_ b: Bool) -> (Int, Float, Float) { } } -// define hidden swiftcc { float, i64, float } @"$s16typed_throws_abi14nonMatching_f1ySf_SbSftSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) +// define hidden swiftcc { float, i64, float } @"$s16typed_throws_abi14nonMatching_f1ySf_SbSftSbAA7OneWordVYKF"(i1 %0, ptr swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2) // CHECK: br i1 %0, label %[[SUCCESS:.*]], label %[[FAIL:.*]] // CHECK: [[SUCCESS]]: // CHECK: ret { float, i64, float } { float 1.000000e+00, i64 1, float 2.000000e+00 } @@ -3063,7 +3063,7 @@ func nonMatching_f1(_ b: Bool) throws(OneWord) -> (Float, Bool, Float) { // CHECK: define hidden swiftcc { i64, float, i1, float } @"$s16typed_throws_abi18callNonMatching_f1ySi_SfSbSftSbF"(i1 %0) // CHECK: %swifterror = alloca swifterror ptr, align 8 -// CHECK: [[CALL_RES:%.*]] = call swiftcc { float, i64, float } @"$s16typed_throws_abi14nonMatching_f1ySf_SbSftSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias captures(none) swifterror dereferenceable(8) %swifterror) +// CHECK: [[CALL_RES:%.*]] = call swiftcc { float, i64, float } @"$s16typed_throws_abi14nonMatching_f1ySf_SbSftSbAA7OneWordVYKF"(i1 %0, ptr swiftself undef, ptr noalias nocapture swifterror dereferenceable(8) %swifterror) // CHECK: [[CALL_RES0:%.*]] = extractvalue { float, i64, float } [[CALL_RES]], 0 // CHECK: [[CALL_RES1:%.*]] = extractvalue { float, i64, float } [[CALL_RES]], 1 // CHECK: [[CALL_RES2:%.*]] = extractvalue { float, i64, float } [[CALL_RES]], 2 @@ -3225,7 +3225,7 @@ func callNonMatching_f1_async(_ b: Bool) async -> (Int, Float, Bool, Float) { } protocol P { - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2f0yySbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2f0yySbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3236,7 +3236,7 @@ protocol P { // CHECK: } func f0(_ b: Bool) throws(Empty) - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2f1ySiSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2f1ySiSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3247,7 +3247,7 @@ protocol P { // CHECK: } func f1(_ b: Bool) throws(Empty) -> Int - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2f2ySi_SitSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2f2ySi_SitSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3258,7 +3258,7 @@ protocol P { // CHECK: } func f2(_ b: Bool) throws(Empty) -> (Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2f3ySi_S2itSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2f3ySi_S2itSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3269,7 +3269,7 @@ protocol P { // CHECK: } func f3(_ b: Bool) throws(Empty) -> (Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2f4ySi_S3itSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2f4ySi_S3itSbAA5EmptyVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3280,13 +3280,13 @@ protocol P { // CHECK: } func f4(_ b: Bool) throws(Empty) -> (Int, Int, Int, Int) - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2f5ySi_S4itSbAA5EmptyVYKFTj"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) - // CHECK: call swiftcc void {{%.*}}(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2f5ySi_S4itSbAA5EmptyVYKFTj"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: call swiftcc void {{%.*}}(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) // CHECK: ret void // CHECK: } func f5(_ b: Bool) throws(Empty) -> (Int, Int, Int, Int, Int) - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2g0yySbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2g0yySbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3297,7 +3297,7 @@ protocol P { // CHECK: } func g0(_ b: Bool) throws(OneWord) - // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2g1ySiSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc i64 @"$s16typed_throws_abi1PP2g1ySiSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3308,7 +3308,7 @@ protocol P { // CHECK: } func g1(_ b: Bool) throws(OneWord) -> Int - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2g2ySi_SitSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2g2ySi_SitSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3319,7 +3319,7 @@ protocol P { // CHECK: } func g2(_ b: Bool) throws(OneWord) -> (Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2g3ySi_S2itSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2g3ySi_S2itSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3330,7 +3330,7 @@ protocol P { // CHECK: } func g3(_ b: Bool) throws(OneWord) -> (Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2g4ySi_S3itSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2g4ySi_S3itSbAA7OneWordVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3341,13 +3341,13 @@ protocol P { // CHECK: } func g4(_ b: Bool) throws(OneWord) -> (Int, Int, Int, Int) - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2g5ySi_S4itSbAA7OneWordVYKFTj"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) - // CHECK: call swiftcc void {{%.*}}(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2g5ySi_S4itSbAA7OneWordVYKFTj"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: call swiftcc void {{%.*}}(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) // CHECK: ret void // CHECK: } func g5(_ b: Bool) throws(OneWord) -> (Int, Int, Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h0yySbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h0yySbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3358,7 +3358,7 @@ protocol P { // CHECK: } func h0(_ b: Bool) throws(TwoWords) - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h1ySiSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h1ySiSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3369,7 +3369,7 @@ protocol P { // CHECK: } func h1(_ b: Bool) throws(TwoWords) -> Int - // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h2ySi_SitSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64 } @"$s16typed_throws_abi1PP2h2ySi_SitSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3380,7 +3380,7 @@ protocol P { // CHECK: } func h2(_ b: Bool) throws(TwoWords) -> (Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2h3ySi_S2itSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2h3ySi_S2itSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3391,7 +3391,7 @@ protocol P { // CHECK: } func h3(_ b: Bool) throws(TwoWords) -> (Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2h4ySi_S3itSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2h4ySi_S3itSbAA8TwoWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3402,13 +3402,13 @@ protocol P { // CHECK: } func h4(_ b: Bool) throws(TwoWords) -> (Int, Int, Int, Int) - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2h5ySi_S4itSbAA8TwoWordsVYKFTj"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) - // CHECK: call swiftcc void {{%.*}}(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2h5ySi_S4itSbAA8TwoWordsVYKFTj"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: call swiftcc void {{%.*}}(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) // CHECK: ret void // CHECK: } func h5(_ b: Bool) throws(TwoWords) -> (Int, Int, Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i0yySbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i0yySbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3419,7 +3419,7 @@ protocol P { // CHECK: } func i0(_ b: Bool) throws(ThreeWords) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i1ySiSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i1ySiSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3430,7 +3430,7 @@ protocol P { // CHECK: } func i1(_ b: Bool) throws(ThreeWords) -> Int - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i2ySi_SitSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i2ySi_SitSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3441,7 +3441,7 @@ protocol P { // CHECK: } func i2(_ b: Bool) throws(ThreeWords) -> (Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i3ySi_S2itSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64 } @"$s16typed_throws_abi1PP2i3ySi_S2itSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3452,7 +3452,7 @@ protocol P { // CHECK: } func i3(_ b: Bool) throws(ThreeWords) -> (Int, Int, Int) - // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2i4ySi_S3itSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2, ptr %3, ptr %4) + // CHECK: define hidden swiftcc { i64, i64, i64, i64 } @"$s16typed_throws_abi1PP2i4ySi_S3itSbAA10ThreeWordsVYKFTj"(i1 %0, ptr noalias swiftself %1, ptr noalias nocapture swifterror dereferenceable(8) %2, ptr %3, ptr %4) // CHECK: [[ERROR:%.*]] = load ptr, ptr %2 // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %failure, label %success @@ -3463,8 +3463,8 @@ protocol P { // CHECK: } func i4(_ b: Bool) throws(ThreeWords) -> (Int, Int, Int, Int) - // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2i5ySi_S4itSbAA10ThreeWordsVYKFTj"(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) - // CHECK: call swiftcc void {{%.*}}(ptr noalias captures(none) sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swiftcc void @"$s16typed_throws_abi1PP2i5ySi_S4itSbAA10ThreeWordsVYKFTj"(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: call swiftcc void {{%.*}}(ptr noalias nocapture sret(<{ %TSi, %TSi, %TSi, %TSi, %TSi }>) %0, i1 %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) // CHECK: ret void // CHECK: } func i5(_ b: Bool) throws(ThreeWords) -> (Int, Int, Int, Int, Int) @@ -3542,7 +3542,7 @@ protocol PAsync { // CHECK: } func f4(_ b: Bool) async throws(Empty) -> (Int, Int, Int, Int) - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2f5ySi_S4itSbYaAA5EmptyVYKFTj"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2f5ySi_S4itSbYaAA5EmptyVYKFTj"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) // CHECK: %swifterror = alloca swifterror ptr // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: store ptr null, ptr %swifterror @@ -3621,7 +3621,7 @@ protocol PAsync { // CHECK: } func g4(_ b: Bool) async throws(OneWord) -> (Int, Int, Int, Int) - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2g5ySi_S4itSbYaAA7OneWordVYKFTj"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2g5ySi_S4itSbYaAA7OneWordVYKFTj"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) // CHECK: %swifterror = alloca swifterror ptr // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: store ptr null, ptr %swifterror @@ -3700,7 +3700,7 @@ protocol PAsync { // CHECK: } func h4(_ b: Bool) async throws(TwoWords) -> (Int, Int, Int, Int) - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2h5ySi_S4itSbYaAA8TwoWordsVYKFTj"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2h5ySi_S4itSbYaAA8TwoWordsVYKFTj"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) // CHECK: %swifterror = alloca swifterror ptr // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: store ptr null, ptr %swifterror @@ -3779,7 +3779,7 @@ protocol PAsync { // CHECK: } func i4(_ b: Bool) async throws(ThreeWords) -> (Int, Int, Int, Int) - // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2i5ySi_S4itSbYaAA10ThreeWordsVYKFTj"(ptr noalias captures(none) %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) + // CHECK: define hidden swifttailcc void @"$s16typed_throws_abi6PAsyncP2i5ySi_S4itSbYaAA10ThreeWordsVYKFTj"(ptr noalias nocapture %0, ptr swiftasync %1, i1 %2, ptr noalias swiftself %3, ptr %4, ptr %5, ptr %6) // CHECK: %swifterror = alloca swifterror ptr // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK: store ptr null, ptr %swifterror diff --git a/test/IRGen/typed_throws_thunks.swift b/test/IRGen/typed_throws_thunks.swift index d72b00f349b79..4535cb4681f80 100644 --- a/test/IRGen/typed_throws_thunks.swift +++ b/test/IRGen/typed_throws_thunks.swift @@ -45,9 +45,9 @@ extension P { } } - // CHECK-LABEL: define{{.*}} swiftcc void @"$s19typed_throws_thunks1PP2g24bodyyyy7FailureQzYKXE_tAGYKFTj"(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK-LABEL: define{{.*}} swiftcc void @"$s19typed_throws_thunks1PP2g24bodyyyy7FailureQzYKXE_tAGYKFTj"(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) // CHECK-NOT: ret - // CHECK: call swiftcc void {{.*}}(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) + // CHECK: call swiftcc void {{.*}}(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5, ptr %6) public func g2(body: () throws(Failure) -> Void) throws(Failure) { do { @@ -57,9 +57,9 @@ extension P { } } - // CHECK-LABEL: define{{.*}} swiftcc { i64, i64 } @"$s19typed_throws_thunks1PP2g34bodyyyyAA9FixedSizeVYKXE_tAGYKFTj"(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5) + // CHECK-LABEL: define{{.*}} swiftcc { i64, i64 } @"$s19typed_throws_thunks1PP2g34bodyyyyAA9FixedSizeVYKXE_tAGYKFTj"(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5) // CHECK-NOT: ret - // CHECK: call swiftcc { i64, i64 } {{.*}}(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias captures(none) swifterror dereferenceable(8) %3, ptr %4, ptr %5) + // CHECK: call swiftcc { i64, i64 } {{.*}}(ptr %0, ptr %1, ptr noalias swiftself %2, ptr noalias nocapture swifterror dereferenceable(8) %3, ptr %4, ptr %5) public func g3(body: () throws(FixedSize) -> Void) throws(FixedSize) { @@ -69,7 +69,7 @@ extension P { protocol P2 { // CHECK-LABEL: define{{.*}} swiftcc void @"$s19typed_throws_thunks2P2P1fyyAA1EOYKFTj"( // CHECK-SAME: ptr noalias swiftself %0, -// CHECK-SAME: ptr noalias captures(none) swifterror dereferenceable(8) %1, +// CHECK-SAME: ptr noalias nocapture swifterror dereferenceable(8) %1, // CHECK-SAME: ptr %2, ptr %3 // CHECK-SAME: ) // CHECK-SAME: { @@ -81,7 +81,7 @@ protocol P2 { func f() throws(E) // CHECK-LABEL: define{{.*}} swiftcc i8 @"$s19typed_throws_thunks2P2P1gyys4Int8VYKFTj"( // CHECk-SAME: ptr noalias swiftself %0 -// CHECK-SAME: ptr noalias captures(none) swifterror dereferenceable(8) %1 +// CHECK-SAME: ptr noalias nocapture swifterror dereferenceable(8) %1 // CHECK-SAME: ptr %2 // CHECK-SAME: ptr %3 // CHECK-SAME: ) @@ -93,7 +93,7 @@ protocol P2 { func g() throws(Int8) // CHECK-LABEL: define{{.*}} swiftcc i8 @"$s19typed_throws_thunks2P2P1hs4Int8VyAA1EOYKFTj"( // CHECK-SAME: ptr noalias swiftself %0 -// CHECK-SAME: ptr noalias captures(none) swifterror dereferenceable(8) %1 +// CHECK-SAME: ptr noalias nocapture swifterror dereferenceable(8) %1 // CHECK-SAME: ptr %2 // CHECK-SAME: ptr %3 // CHECK-SAME: ) @@ -105,7 +105,7 @@ protocol P2 { func h() throws(E) -> Int8 // CHECK-LABEL: define{{.*}} swiftcc i8 @"$s19typed_throws_thunks2P2P1is4Int8VyAFYKFTj"( // CHECK-SAME: ptr noalias swiftself %0 -// CHECK-SAME: ptr noalias captures(none) swifterror dereferenceable(8) %1 +// CHECK-SAME: ptr noalias nocapture swifterror dereferenceable(8) %1 // CHECK-SAME: ptr %2 // CHECK-SAME: ptr %3 // CHECK-SAME: ) diff --git a/test/IRGen/typelayout_based_value_witness.swift b/test/IRGen/typelayout_based_value_witness.swift index 02dec241e411b..b0f8c1b207736 100644 --- a/test/IRGen/typelayout_based_value_witness.swift +++ b/test/IRGen/typelayout_based_value_witness.swift @@ -81,7 +81,7 @@ public enum ForwardEnum { // CHECK: } -// OPT: define{{.*}} void @"$s30typelayout_based_value_witness1AVwxx"(ptr noalias %object, ptr captures(none) readonly %"A") +// OPT: define{{.*}} void @"$s30typelayout_based_value_witness1AVwxx"(ptr noalias %object, ptr nocapture readonly %"A") // OPT: [[T_PARAM:%.*]] = getelementptr inbounds{{.*}} i8, ptr %"A", i64 16 // OPT: [[T:%.*]] = load ptr, ptr [[T_PARAM]] // OPT: [[VWT_ADDR:%.*]] = getelementptr inbounds i8, ptr [[T]], {{(i64|i32)}} -8 @@ -127,7 +127,7 @@ public enum ForwardEnum { // OPT: ret void // CHECK: } -// OPT: define internal void @"$s30typelayout_based_value_witness2E3Owui"(ptr noalias captures(none) writeonly %value, i32 %tag, ptr captures(none) readonly %"E3") +// OPT: define internal void @"$s30typelayout_based_value_witness2E3Owui"(ptr noalias nocapture writeonly %value, i32 %tag, ptr nocapture readonly %"E3") // OPT: [[IS_EMPTY:%.*]] = icmp eq i32 {{%.*}}, 0 // OPT: br i1 [[IS_EMPTY]], label %empty-payload, label %non-empty-payload // OPT: } diff --git a/test/IRGen/unconditional_checked_cast.sil b/test/IRGen/unconditional_checked_cast.sil index b4f9198282b61..adb01d83790f0 100644 --- a/test/IRGen/unconditional_checked_cast.sil +++ b/test/IRGen/unconditional_checked_cast.sil @@ -10,7 +10,7 @@ sil_vtable C {} class D : C {} sil_vtable D {} -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @downcast_test(ptr noalias captures(none) sret({{.*}}) %0, ptr captures(none) dereferenceable({{.*}}) %1) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @downcast_test(ptr noalias nocapture sret({{.*}}) %0, ptr nocapture dereferenceable({{.*}}) %1) {{.*}} { // CHECK: entry: // CHECK-NEXT: [[INPUTPTR:%[0-9]+]] = load ptr, ptr [[INPUTPTRPTR:%[0-9]+]], align 8 // CHECK-NEXT: [[TMP:%.*]] = call swiftcc %swift.metadata_response @"$s26unconditional_checked_cast1DCMa"(i64 0) diff --git a/test/IRGen/witness_method.sil b/test/IRGen/witness_method.sil index c59e41bde9b0d..83158ff57addc 100644 --- a/test/IRGen/witness_method.sil +++ b/test/IRGen/witness_method.sil @@ -110,7 +110,7 @@ class TPSReport : Strategy { func disrupt() -> GrowthHack } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @classArchetypeWitnessMethod(ptr noalias captures(none) swiftself dereferenceable({{4|8}}) %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @classArchetypeWitnessMethod(ptr noalias nocapture swiftself dereferenceable({{4|8}}) %0, ptr %Self, ptr %SelfWitnessTable) sil @classArchetypeWitnessMethod : $@convention(witness_method: Strategy) > (@in_guaranteed T) -> () { entry(%self : $*T): @@ -118,7 +118,7 @@ entry(%self : $*T): return %z : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testClassArchetypeWitnessMethod(ptr noalias captures(none) sret({{.*}}) %0, ptr noalias captures(none) dereferenceable({{4|8}}) %1, ptr %T, ptr %CoverSheet) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testClassArchetypeWitnessMethod(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{4|8}}) %1, ptr %T, ptr %CoverSheet) // CHECK: entry: // CHECK: [[WITNESS_FN:%.*]] = load ptr, ptr getelementptr inbounds (ptr, ptr @"$s14witness_method9TPSReportCyxGAA8StrategyAAWP", i32 3) // CHECK: call swiftcc void [[WITNESS_FN]](ptr noalias sret({{.*}}) %0, ptr noalias swiftself %1, ptr %T, ptr @"$s14witness_method9TPSReportCyxGAA8StrategyAAWP") diff --git a/test/IRGen/yield_once_big.sil b/test/IRGen/yield_once_big.sil index ca39dbeb85392..efafc5bffbea7 100644 --- a/test/IRGen/yield_once_big.sil +++ b/test/IRGen/yield_once_big.sil @@ -57,7 +57,7 @@ entry: %1000 = integer_literal $Builtin.Int32, 1000 apply %marker(%1000) : $@convention(thin) (Builtin.Int32) -> () - // CHECK-NEXT: call swiftcc void @make_big(ptr noalias captures(none) sret({{.*}}) [[TEMP]], ptr %C) + // CHECK-NEXT: call swiftcc void @make_big(ptr noalias nocapture sret({{.*}}) [[TEMP]], ptr %C) %make = function_ref @make_big : $@convention(thin) () -> (@owned Big) %value = apply %make() : $@convention(thin) () -> (@owned Big) @@ -171,8 +171,8 @@ cont: } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @test_simple_guaranteed -// CHECK-32-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:16]]) %0, ptr noalias captures(none) dereferenceable(32) %1, ptr %C) -// CHECK-64-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:32]]) %0, ptr noalias captures(none) dereferenceable(64) %1, ptr %C) +// CHECK-32-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:16]]) %0, ptr noalias nocapture dereferenceable(32) %1, ptr %C) +// CHECK-64-SAME: (ptr noalias dereferenceable([[BUFFER_SIZE:32]]) %0, ptr noalias nocapture dereferenceable(64) %1, ptr %C) sil [ossa] @test_simple_guaranteed : $@yield_once (@in_guaranteed BigWrapper) -> (@yields @guaranteed Big) { entry(%arg : $*BigWrapper): // Allocate space for the return value of make_big. diff --git a/test/IRGen/yield_once_indirect.sil b/test/IRGen/yield_once_indirect.sil index 84daf565e4296..f4d48b3db74c6 100644 --- a/test/IRGen/yield_once_indirect.sil +++ b/test/IRGen/yield_once_indirect.sil @@ -42,7 +42,7 @@ entry: // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 {{.*}}, ptr [[TEMP]]) %temp = alloc_stack $Indirect - // CHECK-NEXT: call swiftcc void @make_indirect(ptr noalias captures(none) sret({{.*}}) [[TEMP]], ptr %C) + // CHECK-NEXT: call swiftcc void @make_indirect(ptr noalias nocapture sret({{.*}}) [[TEMP]], ptr %C) %make = function_ref @make_indirect : $@convention(thin) () -> (@out Indirect) apply %make(%temp) : $@convention(thin) () -> (@out Indirect) diff --git a/test/Inputs/conditional_conformance_basic_conformances.swift b/test/Inputs/conditional_conformance_basic_conformances.swift index 94d17cef537e9..9b8bf6bc52667 100644 --- a/test/Inputs/conditional_conformance_basic_conformances.swift +++ b/test/Inputs/conditional_conformance_basic_conformances.swift @@ -18,7 +18,7 @@ extension Single: P1 where A: P2 { // witness method for Single.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2_i8star:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -30,7 +30,7 @@ extension Single: P1 where A: P2 { // witness method for Single.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2_i8star:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -188,7 +188,7 @@ extension Double: P1 where B: P2, C: P3 { // witness method for Double.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[B_P2_i8star:%.*]] = load ptr, ptr [[B_P2_PTR]], align 8 @@ -208,7 +208,7 @@ extension Double: P1 where B: P2, C: P3 { // witness method for Double.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP7genericyyqd__AaGRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP7genericyyqd__AaGRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 diff --git a/test/Inputs/conditional_conformance_basic_conformances_future.swift b/test/Inputs/conditional_conformance_basic_conformances_future.swift index b6a4578a4f6d9..a5e4289658656 100644 --- a/test/Inputs/conditional_conformance_basic_conformances_future.swift +++ b/test/Inputs/conditional_conformance_basic_conformances_future.swift @@ -18,7 +18,7 @@ extension Single: P1 where A: P2 { // witness method for Single.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2_i8star:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -30,7 +30,7 @@ extension Single: P1 where A: P2 { // witness method for Single.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2_i8star:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -167,7 +167,7 @@ extension Double: P1 where B: P2, C: P3 { // witness method for Double.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[B_P2_i8star:%.*]] = load ptr, ptr [[B_P2_PTR]], align 8 @@ -187,7 +187,7 @@ extension Double: P1 where B: P2, C: P3 { // witness method for Double.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP7genericyyqd__AaGRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP7genericyyqd__AaGRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 diff --git a/test/Inputs/conditional_conformance_subclass.swift b/test/Inputs/conditional_conformance_subclass.swift index 9901f262e219b..a91dcb3dfb281 100644 --- a/test/Inputs/conditional_conformance_subclass.swift +++ b/test/Inputs/conditional_conformance_subclass.swift @@ -16,7 +16,7 @@ extension Base: P1 where A: P2 { // witness method for Base.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself dereferenceable(8) %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias nocapture swiftself dereferenceable(8) %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -27,7 +27,7 @@ extension Base: P1 where A: P2 { // witness method for Base.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 diff --git a/test/Inputs/conditional_conformance_subclass_future.swift b/test/Inputs/conditional_conformance_subclass_future.swift index d444136959fad..efe653ebc65b8 100644 --- a/test/Inputs/conditional_conformance_subclass_future.swift +++ b/test/Inputs/conditional_conformance_subclass_future.swift @@ -16,7 +16,7 @@ extension Base: P1 where A: P2 { // witness method for Base.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself dereferenceable(8) %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP6normalyyFTW"(ptr noalias nocapture swiftself dereferenceable(8) %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 @@ -27,7 +27,7 @@ extension Base: P1 where A: P2 { // witness method for Base.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 diff --git a/test/Inputs/conditional_conformance_with_assoc.swift b/test/Inputs/conditional_conformance_with_assoc.swift index a1f5618538196..adc6aa0de2c97 100644 --- a/test/Inputs/conditional_conformance_with_assoc.swift +++ b/test/Inputs/conditional_conformance_with_assoc.swift @@ -41,7 +41,7 @@ extension Double: P1 where B.AT2: P2, C: P3, B.AT2.AT2.AT3: P3 { // witness method for Double.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[C_P3:%.*]] = load ptr, ptr [[C_P3_PTR]], align 8 @@ -67,7 +67,7 @@ extension Double: P1 where B.AT2: P2, C: P3, B.AT2.AT2.AT3: P3 { // witness method for Double.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP7genericyyqd__AaFRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP7genericyyqd__AaFRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[C_P3:%.*]] = load ptr, ptr [[C_P3_PTR]], align 8 diff --git a/test/Inputs/conditional_conformance_with_assoc_future.swift b/test/Inputs/conditional_conformance_with_assoc_future.swift index 1845b3e6b3404..f264b742db309 100644 --- a/test/Inputs/conditional_conformance_with_assoc_future.swift +++ b/test/Inputs/conditional_conformance_with_assoc_future.swift @@ -41,7 +41,7 @@ extension Double: P1 where B.AT2: P2, C: P3, B.AT2.AT2.AT3: P3 { // witness method for Double.normal -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP6normalyyFTW"(ptr noalias captures(none) swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP6normalyyFTW"(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[C_P3:%.*]] = load ptr, ptr [[C_P3_PTR]], align 8 @@ -67,7 +67,7 @@ extension Double: P1 where B.AT2: P2, C: P3, B.AT2.AT2.AT3: P3 { // witness method for Double.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP7genericyyqd__AaFRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias captures(none) swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP7genericyyqd__AaFRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[C_P3:%.*]] = load ptr, ptr [[C_P3_PTR]], align 8 diff --git a/test/Interop/Cxx/class/method/inreg-sret.swift b/test/Interop/Cxx/class/method/inreg-sret.swift index c5258b6a1c863..b11bc95fe3c68 100644 --- a/test/Interop/Cxx/class/method/inreg-sret.swift +++ b/test/Interop/Cxx/class/method/inreg-sret.swift @@ -21,8 +21,8 @@ final public class Function { // Check that inreg on the sret isn't missing -// CHECK-x86_64: call void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}}, ptr noalias captures(none) sret(%TSo25OptionalBridgedBasicBlockV) {{.*}}) -// CHECK-aarch64: call void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}}, ptr inreg noalias captures(none) sret(%TSo25OptionalBridgedBasicBlockV) {{.*}}) +// CHECK-x86_64: call void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}}, ptr noalias nocapture sret(%TSo25OptionalBridgedBasicBlockV) {{.*}}) +// CHECK-aarch64: call void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}}, ptr inreg noalias nocapture sret(%TSo25OptionalBridgedBasicBlockV) {{.*}}) // CHECK-x86_64: define {{.*}} void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}} %{{.*}}, ptr {{.*}} sret(%struct.OptionalBridgedBasicBlock) {{.*}} %{{.*}}) // CHECK-aarch64: define {{.*}} void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}} %{{.*}}, ptr inreg {{.*}} sret(%struct.OptionalBridgedBasicBlock) {{.*}} %{{.*}}) diff --git a/test/Interop/Cxx/class/protocol-conformance-irgen.swift b/test/Interop/Cxx/class/protocol-conformance-irgen.swift index db017b4910b1c..d5dbbe435add5 100644 --- a/test/Interop/Cxx/class/protocol-conformance-irgen.swift +++ b/test/Interop/Cxx/class/protocol-conformance-irgen.swift @@ -7,7 +7,7 @@ protocol HasReturn42 { } -// CHECK: define {{.*}}i32 @"$sSo18ConformsToProtocolV4main11HasReturn42A2cDP8return42s5Int32VyFTW"(ptr captures(none) swiftself dereferenceable(1) %{{.*}}, ptr %{{.*}}, ptr %{{.*}}) +// CHECK: define {{.*}}i32 @"$sSo18ConformsToProtocolV4main11HasReturn42A2cDP8return42s5Int32VyFTW"(ptr nocapture swiftself dereferenceable(1) %{{.*}}, ptr %{{.*}}, ptr %{{.*}}) // CHECK: [[OUT:%.*]] = call i32 @{{_ZN18ConformsToProtocol8return42Ev|"\?return42@ConformsToProtocol@@QEAAHXZ"}}(ptr // CHECK: ret i32 [[OUT]] diff --git a/test/Interop/Cxx/class/returns-large-class-irgen.swift b/test/Interop/Cxx/class/returns-large-class-irgen.swift index f45dde04337da..d9e6f3af56c7a 100644 --- a/test/Interop/Cxx/class/returns-large-class-irgen.swift +++ b/test/Interop/Cxx/class/returns-large-class-irgen.swift @@ -14,7 +14,7 @@ func foo() -> LargeClass { foo() -// CHECK: call swiftcc void @"$s4main3fooSo10LargeClassVyF"(ptr noalias captures(none) sret(%TSo10LargeClassV) %{{.*}}) +// CHECK: call swiftcc void @"$s4main3fooSo10LargeClassVyF"(ptr noalias nocapture sret(%TSo10LargeClassV) %{{.*}}) // The C++ function: // CHECK: define{{( dso_local)?}} void @{{_Z21funcReturnsLargeClassv|"\?funcReturnsLargeClass@@YA\?AULargeClass@@XZ"}}({{%struct.LargeClass\*|ptr}}{{.*}} sret(%struct.LargeClass){{( align .*)?}} %{{.*}}) diff --git a/test/Interop/Cxx/extern-var/extern-var-irgen.swift b/test/Interop/Cxx/extern-var/extern-var-irgen.swift index 57a3d0a416542..cbec5e8e26828 100644 --- a/test/Interop/Cxx/extern-var/extern-var-irgen.swift +++ b/test/Interop/Cxx/extern-var/extern-var-irgen.swift @@ -44,4 +44,4 @@ public func passingVarAsInout() { } // CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main17passingVarAsInoutyyF"() #0 -// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr captures(none) dereferenceable(4) @{{counter|"\?counter@@3HA"}}) +// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr nocapture dereferenceable(4) @{{counter|"\?counter@@3HA"}}) diff --git a/test/Interop/Cxx/static/inline-static-member-var-irgen.swift b/test/Interop/Cxx/static/inline-static-member-var-irgen.swift index edde6d6c0617b..f5409c05e9864 100644 --- a/test/Interop/Cxx/static/inline-static-member-var-irgen.swift +++ b/test/Interop/Cxx/static/inline-static-member-var-irgen.swift @@ -28,4 +28,4 @@ public func passingVarAsInout() { } // CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main17passingVarAsInoutyyF"() -// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr captures(none) dereferenceable(4) @{{_ZN22WithInlineStaticMember12staticMemberE|"\?staticMember@WithInlineStaticMember@@2HA"}}) +// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr nocapture dereferenceable(4) @{{_ZN22WithInlineStaticMember12staticMemberE|"\?staticMember@WithInlineStaticMember@@2HA"}}) diff --git a/test/Interop/Cxx/static/static-var-irgen.swift b/test/Interop/Cxx/static/static-var-irgen.swift index f7b44647fb031..f8d920ebd8cef 100644 --- a/test/Interop/Cxx/static/static-var-irgen.swift +++ b/test/Interop/Cxx/static/static-var-irgen.swift @@ -85,7 +85,7 @@ public func passingVarAsInout() { modifyInout(&staticVar) } // CHECK: define {{.*}}void @"$s4main17passingVarAsInoutyyF"() -// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr captures(none) dereferenceable(4) @{{_ZL9staticVar|staticVar}}) +// CHECK: call swiftcc void @"$s4main11modifyInoutyys5Int32VzF"(ptr nocapture dereferenceable(4) @{{_ZL9staticVar|staticVar}}) // CHECK: define internal void @_GLOBAL__sub_I__swift_imported_modules_() // CHECK: call void @{{__cxx_global_var_init|"\?\?__EstaticVarInit@@YAXXZ"}}() diff --git a/test/Interop/Cxx/stdlib/msvc-abi-use-vector-iterator.swift b/test/Interop/Cxx/stdlib/msvc-abi-use-vector-iterator.swift index d3a26f5b65b9a..daa43eeb78a59 100644 --- a/test/Interop/Cxx/stdlib/msvc-abi-use-vector-iterator.swift +++ b/test/Interop/Cxx/stdlib/msvc-abi-use-vector-iterator.swift @@ -5,7 +5,7 @@ import MsvcUseVecIt -// CHECK: call void @"?begin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEBA?AV?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@@2@XZ"(ptr {{.*}}, ptr noalias captures(none) sret +// CHECK: call void @"?begin@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QEBA?AV?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@std@@@std@@@2@XZ"(ptr {{.*}}, ptr noalias nocapture sret func test() -> Bool { let result = f() diff --git a/test/Interop/Cxx/templates/mangling-irgen.swift b/test/Interop/Cxx/templates/mangling-irgen.swift index d5d714652159d..3a5f1e8f349ef 100644 --- a/test/Interop/Cxx/templates/mangling-irgen.swift +++ b/test/Interop/Cxx/templates/mangling-irgen.swift @@ -4,12 +4,12 @@ import Mangling public func receiveInstantiation(_ i: inout WrappedMagicBool) {} -// CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main20receiveInstantiationyySo0025MagicWrapperCBool_lsFCfibVzF"(ptr captures(none) dereferenceable(1) %0) +// CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main20receiveInstantiationyySo0025MagicWrapperCBool_lsFCfibVzF"(ptr nocapture dereferenceable(1) %0) public func receiveInstantiation(_ i: inout WrappedMagicInt) {} // Don't forget to update manglings.txt when changing s4main20receiveInstantiationyySo34__CxxTemplateInst12MagicWrapperIiEVzF -// CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main20receiveInstantiationyySo0024MagicWrapperCInt_npAIefbVzF"(ptr captures(none) dereferenceable(1) %0) +// CHECK: define {{(protected |dllexport )?}}swiftcc void @"$s4main20receiveInstantiationyySo0024MagicWrapperCInt_npAIefbVzF"(ptr nocapture dereferenceable(1) %0) public func returnInstantiation() -> WrappedMagicInt { return WrappedMagicInt() diff --git a/test/SILOptimizer/devirt_witness_method_empty_conformance.swift b/test/SILOptimizer/devirt_witness_method_empty_conformance.swift index 047493fcebc18..e8ea8e7959487 100644 --- a/test/SILOptimizer/devirt_witness_method_empty_conformance.swift +++ b/test/SILOptimizer/devirt_witness_method_empty_conformance.swift @@ -76,7 +76,7 @@ extension ApplyRegStruct { from space: PublicEnum, transform: RegStruct ) { transform.funcInStructAndProtAndExt(.case2, space: space) { -// CHECK-LABEL: define hidden swiftcc void @"$sSa39devirt_witness_method_empty_conformanceAA12PublicStructVRszlE14applyTransformyyF"(ptr captures(none) {{.*}}swiftself dereferenceable +// CHECK-LABEL: define hidden swiftcc void @"$sSa39devirt_witness_method_empty_conformanceAA12PublicStructVRszlE14applyTransformyyF"(ptr nocapture {{.*}}swiftself dereferenceable // CHECK-NEXT: entry // CHECK-NEXT: ret void applyTransform() diff --git a/test/SILOptimizer/eager_specialize.sil b/test/SILOptimizer/eager_specialize.sil index 71cd25f905b11..3f4a290d927f6 100644 --- a/test/SILOptimizer/eager_specialize.sil +++ b/test/SILOptimizer/eager_specialize.sil @@ -698,7 +698,7 @@ bb0(%0 : $*Self, %1 : $*Self, %2 : $@thick Self.Type): // Check that a specialization for _Trivial(32) uses direct loads and stores // instead of value witness functions to load and store the value of a generic type. -// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze31_lIetilr_Tp5"(ptr noalias captures(none) sret(i32) %0, ptr noalias captures(none) dereferenceable(4) %1, ptr captures(none) dereferenceable(4) %2, ptr %S +// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze31_lIetilr_Tp5"(ptr noalias nocapture sret(i32) %0, ptr noalias nocapture dereferenceable(4) %1, ptr nocapture dereferenceable(4) %2, ptr %S // CHECK-IRGEN: entry: // CHECK-IRGEN: %3 = load i32, ptr %2 // CHECK-IRGEN-NEXT: store i32 %3, ptr %0 @@ -707,7 +707,7 @@ bb0(%0 : $*Self, %1 : $*Self, %2 : $@thick Self.Type): // Check that a specialization for _Trivial(64) uses direct loads and stores // instead of value witness functions to load and store the value of a generic type. -// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze63_lIetilr_Tp5"(ptr noalias captures(none) sret(i64) %0, ptr noalias captures(none) dereferenceable(8) %1, ptr captures(none) dereferenceable(8) %2, ptr %S +// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze63_lIetilr_Tp5"(ptr noalias nocapture sret(i64) %0, ptr noalias nocapture dereferenceable(8) %1, ptr nocapture dereferenceable(8) %2, ptr %S // CHECK-IRGEN: entry: // CHECK-IRGEN: %3 = load i64, ptr %2 // CHECK-IRGEN-NEXT: store i64 %3, ptr %0 diff --git a/test/SILOptimizer/eager_specialize_ossa.sil b/test/SILOptimizer/eager_specialize_ossa.sil index 03aa594364e83..2ac721d8a6d96 100644 --- a/test/SILOptimizer/eager_specialize_ossa.sil +++ b/test/SILOptimizer/eager_specialize_ossa.sil @@ -886,7 +886,7 @@ bb0(%0 : $*Self, %1 : $*Self, %2 : $@thick Self.Type): // Check that a specialization for _Trivial(32) uses direct loads and stores // instead of value witness functions to load and store the value of a generic type. -// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze31_lIetilr_Tp5"(ptr noalias captures(none) sret(i32) %0, ptr noalias captures(none) dereferenceable(4) %1, ptr captures(none) dereferenceable(4) %2, ptr %S +// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze31_lIetilr_Tp5"(ptr noalias nocapture sret(i32) %0, ptr noalias nocapture dereferenceable(4) %1, ptr nocapture dereferenceable(4) %2, ptr %S // CHECK-IRGEN: entry: // CHECK-IRGEN: %3 = load i32, ptr %2 // CHECK-IRGEN-NEXT: store i32 %3, ptr %0 @@ -895,7 +895,7 @@ bb0(%0 : $*Self, %1 : $*Self, %2 : $@thick Self.Type): // Check that a specialization for _Trivial(64) uses direct loads and stores // instead of value witness functions to load and store the value of a generic type. -// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze63_lIetilr_Tp5"(ptr noalias captures(none) sret(i64) %0, ptr noalias captures(none) dereferenceable(8) %1, ptr captures(none) dereferenceable(8) %2, ptr %S +// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize18copyValueAndReturn_1sxx_xztlFxxxRlze63_lIetilr_Tp5"(ptr noalias nocapture sret(i64) %0, ptr noalias nocapture dereferenceable(8) %1, ptr nocapture dereferenceable(8) %2, ptr %S // CHECK-IRGEN: entry: // CHECK-IRGEN: %3 = load i64, ptr %2 // CHECK-IRGEN-NEXT: store i64 %3, ptr %0 From ff8fbf1b4b970108a7a79200c2212dc0fde30ab3 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Tue, 13 May 2025 01:05:21 +0100 Subject: [PATCH 036/100] Revert "SILGen, SILOptimizer: Fix assertion failures in `llvm::APInt` ctor" The approach taken in the reverted commit is causing tests to fail, and I am not positive that all instances of the -1 to 1 switch are correct. A subsequent commit will restore the old behavior by tweaking the ctor call instead. This reverts commit 657f5028fb45991569d6f58770e3edb0196ec500. --- lib/SILGen/SILGenDecl.cpp | 9 +++++---- lib/SILOptimizer/LoopTransforms/BoundsCheckOpts.cpp | 6 +++--- lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp | 2 +- lib/SILOptimizer/Transforms/SimplifyCFG.cpp | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/SILGen/SILGenDecl.cpp b/lib/SILGen/SILGenDecl.cpp index ad708d95c2491..cde0970462de2 100644 --- a/lib/SILGen/SILGenDecl.cpp +++ b/lib/SILGen/SILGenDecl.cpp @@ -1995,11 +1995,12 @@ void SILGenFunction::emitStmtCondition(StmtCondition Cond, JumpDest FalseDest, emitOSVersionRangeCheck(loc, versionRange.value(), isMacCatalyst); if (availability->isUnavailability()) { // If this is an unavailability check, invert the result - // by emitting a call to Builtin.xor_Int1(lhs, 1). + // by emitting a call to Builtin.xor_Int1(lhs, -1). SILType i1 = SILType::getBuiltinIntegerType(1, getASTContext()); - SILValue one = B.createIntegerLiteral(loc, i1, 1); - booleanTestValue = B.createBuiltinBinaryFunction( - loc, "xor", i1, i1, {booleanTestValue, one}); + SILValue minusOne = B.createIntegerLiteral(loc, i1, -1); + booleanTestValue = + B.createBuiltinBinaryFunction(loc, "xor", i1, i1, + {booleanTestValue, minusOne}); } } break; diff --git a/lib/SILOptimizer/LoopTransforms/BoundsCheckOpts.cpp b/lib/SILOptimizer/LoopTransforms/BoundsCheckOpts.cpp index 46e8c289f18b0..0e6802be83382 100644 --- a/lib/SILOptimizer/LoopTransforms/BoundsCheckOpts.cpp +++ b/lib/SILOptimizer/LoopTransforms/BoundsCheckOpts.cpp @@ -558,7 +558,7 @@ static SILValue getSub(SILLocation Loc, SILValue Val, unsigned SubVal, SmallVector Args(1, Val); Args.push_back(B.createIntegerLiteral(Loc, Val->getType(), SubVal)); Args.push_back(B.createIntegerLiteral( - Loc, SILType::getBuiltinIntegerType(1, B.getASTContext()), 1)); + Loc, SILType::getBuiltinIntegerType(1, B.getASTContext()), -1)); auto *AI = B.createBuiltinBinaryFunctionWithOverflow( Loc, "ssub_with_overflow", Args); @@ -570,7 +570,7 @@ static SILValue getAdd(SILLocation Loc, SILValue Val, unsigned AddVal, SmallVector Args(1, Val); Args.push_back(B.createIntegerLiteral(Loc, Val->getType(), AddVal)); Args.push_back(B.createIntegerLiteral( - Loc, SILType::getBuiltinIntegerType(1, B.getASTContext()), 1)); + Loc, SILType::getBuiltinIntegerType(1, B.getASTContext()), -1)); auto *AI = B.createBuiltinBinaryFunctionWithOverflow( Loc, "sadd_with_overflow", Args); @@ -1342,7 +1342,7 @@ BoundsCheckOpts::findAndOptimizeInductionVariables(SILLoop *loop) { if (isComparisonKnownTrue(builtin, *ivar)) { if (!trueVal) trueVal = builder.createIntegerLiteral(builtin->getLoc(), - builtin->getType(), 1); + builtin->getType(), -1); builtin->replaceAllUsesWith(trueVal); changed = true; continue; diff --git a/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp b/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp index 65cfe2b47537d..a385a2475d442 100644 --- a/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp +++ b/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp @@ -2976,7 +2976,7 @@ static SILValue testAllControlVariableBits(SILLocation Loc, if (IVType->getFixedWidth() == 1) return CondVal; - SILValue AllBitsSet = B.createIntegerLiteral(Loc, CondVal->getType(), 1); + SILValue AllBitsSet = B.createIntegerLiteral(Loc, CondVal->getType(), -1); if (!CmpEqFn.get()) CmpEqFn = getBinaryFunction("cmp_eq", CondVal->getType(), B.getASTContext()); diff --git a/lib/SILOptimizer/Transforms/SimplifyCFG.cpp b/lib/SILOptimizer/Transforms/SimplifyCFG.cpp index 0ce619a37ef84..95a835cb07a14 100644 --- a/lib/SILOptimizer/Transforms/SimplifyCFG.cpp +++ b/lib/SILOptimizer/Transforms/SimplifyCFG.cpp @@ -304,7 +304,7 @@ static SILValue createValueForEdge(SILInstruction *UserInst, if (auto *CBI = dyn_cast(DominatingTerminator)) return Builder.createIntegerLiteral( - CBI->getLoc(), CBI->getCondition()->getType(), EdgeIdx == 0 ? 1 : 0); + CBI->getLoc(), CBI->getCondition()->getType(), EdgeIdx == 0 ? -1 : 0); auto *SEI = cast(DominatingTerminator); auto *DstBlock = SEI->getSuccessors()[EdgeIdx].getBB(); @@ -1480,7 +1480,7 @@ static SILValue invertExpectAndApplyTo(SILBuilder &Builder, if (!IL) return V; SILValue NegatedExpectedValue = Builder.createIntegerLiteral( - IL->getLoc(), Args[1]->getType(), IL->getValue() == 0 ? 1 : 0); + IL->getLoc(), Args[1]->getType(), IL->getValue() == 0 ? -1 : 0); return Builder.createBuiltin(BI->getLoc(), BI->getName(), BI->getType(), {}, {V, NegatedExpectedValue}); } From 73c70ee338c515fba37baf3faff93c6389558a5c Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Tue, 13 May 2025 01:19:48 +0100 Subject: [PATCH 037/100] [rebranch] SIL: Restore old behavior in `llvm::APInt` ctor call See https://github.com/llvm/llvm-project/pull/114539. --- lib/SIL/IR/SILInstructions.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/SIL/IR/SILInstructions.cpp b/lib/SIL/IR/SILInstructions.cpp index 5d4fdee039af2..812397d0f20bb 100644 --- a/lib/SIL/IR/SILInstructions.cpp +++ b/lib/SIL/IR/SILInstructions.cpp @@ -1145,7 +1145,9 @@ IntegerLiteralInst *IntegerLiteralInst::create(SILDebugLocation Loc, static APInt getAPInt(AnyBuiltinIntegerType *anyIntTy, intmax_t value) { // If we're forming a fixed-width type, build using the greatest width. if (auto intTy = dyn_cast(anyIntTy)) - return APInt(intTy->getGreatestWidth(), value); + // TODO: Avoid implicit trunc? + return APInt(intTy->getGreatestWidth(), value, /*isSigned=*/false, + /*implicitTrunc=*/true); // Otherwise, build using the size of the type and then truncate to the // minimum width necessary. From 48650ccba4dbee5d9a00535e21913fcfe6352236 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Tue, 20 May 2025 11:39:43 +0100 Subject: [PATCH 038/100] [test] IRGen: Adjust FileCheck patterns for new attribute order The relative order of the LLVM `nocapture` parameter attribute changed upstream in https://github.com/llvm/llvm-project/pull/123181. --- test/IRGen/argument_attrs.sil | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/IRGen/argument_attrs.sil b/test/IRGen/argument_attrs.sil index bba5ed69b1869..4e2a98d6b732f 100644 --- a/test/IRGen/argument_attrs.sil +++ b/test/IRGen/argument_attrs.sil @@ -19,34 +19,34 @@ entry(%1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*Builtin.Int32, %4 : $Hu // CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl(ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias captures(none), ptr) sil @arguments_in_decl : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_out(ptr noalias captures(none) sret({{.*}}) %0, ptr captures(none) dereferenceable(4) %1, ptr noalias captures(none) dereferenceable(4) %2, ptr noalias captures(none) dereferenceable(4) %3, ptr noalias captures(none) dereferenceable(40) %4, ptr noalias %5, ptr noalias captures(none) %6, ptr %T) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_out(ptr noalias sret({{.*}}) captures(none) %0, ptr captures(none) dereferenceable(4) %1, ptr noalias captures(none) dereferenceable(4) %2, ptr noalias captures(none) dereferenceable(4) %3, ptr noalias captures(none) dereferenceable(40) %4, ptr noalias %5, ptr noalias captures(none) %6, ptr %T) sil @arguments_in_def_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 { entry(%0 : $*Builtin.Int32, %1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*Builtin.Int32, %4 : $Huge, %5 : $*T, %6 : $*()): - // CHECK: call swiftcc void @arguments_in_decl_out(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) + // CHECK: call swiftcc void @arguments_in_decl_out(ptr noalias sret({{.*}}) captures(none) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) %f = function_ref @arguments_in_decl_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 %x = apply %f(%0, %1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 - // CHECK: call swiftcc void @arguments_in_def_out(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) + // CHECK: call swiftcc void @arguments_in_def_out(ptr noalias sret({{.*}}) captures(none) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) %g = function_ref @arguments_in_def_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 %y = apply %g(%0, %1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 return undef : $() } -// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_out(ptr noalias captures(none) sret({{.*}}), ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias captures(none), ptr) +// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_out(ptr noalias sret({{.*}}) captures(none), ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias captures(none), ptr) sil @arguments_in_decl_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_huge_ret(ptr noalias captures(none) sret({{.*}}V) %0, ptr captures(none) dereferenceable(4) %1, ptr noalias captures(none) dereferenceable(4) %2, ptr noalias captures(none) dereferenceable(4) %3, ptr noalias captures(none) dereferenceable(40) %4, ptr noalias %5, ptr noalias captures(none) %6, ptr %T) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_huge_ret(ptr noalias sret({{.*}}V) captures(none) %0, ptr captures(none) dereferenceable(4) %1, ptr noalias captures(none) dereferenceable(4) %2, ptr noalias captures(none) dereferenceable(4) %3, ptr noalias captures(none) dereferenceable(40) %4, ptr noalias %5, ptr noalias captures(none) %6, ptr %T) sil @arguments_in_def_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge { entry(%1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*Builtin.Int32, %4 : $Huge, %5 : $*T, %6 : $*()): %f = function_ref @arguments_in_decl_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge - // CHECK: call swiftcc void @arguments_in_decl_huge_ret(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) + // CHECK: call swiftcc void @arguments_in_decl_huge_ret(ptr noalias sret({{.*}}) captures(none) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) %x = apply %f(%1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge - // CHECK: call swiftcc void @arguments_in_def_huge_ret(ptr noalias captures(none) sret({{.*}}) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) + // CHECK: call swiftcc void @arguments_in_def_huge_ret(ptr noalias sret({{.*}}) captures(none) {{%.*}}, ptr captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(4) {{%.*}}, ptr noalias captures(none) dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias captures(none) {{%.*}}, ptr {{%.*}}) %g = function_ref @arguments_in_def_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge %y = apply %g(%1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge return %y : $Huge } -// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_huge_ret(ptr noalias captures(none) sret({{.*}}), ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias captures(none), ptr) +// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_huge_ret(ptr noalias sret({{.*}}) captures(none), ptr captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(4), ptr noalias captures(none) dereferenceable(40), ptr noalias, ptr noalias captures(none), ptr) sil @arguments_in_decl_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge From ff64fc79afc724c72ae5c7a2314d6c9f84b73b4a Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 21 May 2025 05:44:04 +0100 Subject: [PATCH 039/100] DebugInfo: Restore old behavior in call to `llvm::DIBuilder::createObjectPointerType` Fix my mistake in 66a6df9a4445434bf54faf6d2c845bbc6d82e270. `false` is the wrong value for the new `Implicit` parameter because it causes the `FlagArtificial` flag to not be set as before that change. The flag itself looks appropriate because the entry is constructed for a built-in type. --- lib/IRGen/IRGenDebugInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index 811b6ba5cec70..56b190dc89f50 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -1942,7 +1942,7 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo { nullptr, PtrSize, 0, /* DWARFAddressSpace */ std::nullopt, MangledName); - return DBuilder.createObjectPointerType(PTy, /*Implicit=*/false); + return DBuilder.createObjectPointerType(PTy, /*Implicit=*/true); } case TypeKind::BuiltinExecutor: { return createDoublePointerSizedStruct( From 086688c21390b0b4428b9731da91cd86cfa0a796 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Fri, 6 Jun 2025 14:14:21 +0100 Subject: [PATCH 040/100] IRGen: Disable indirect symbol replacement with GOTPCREL for AArch64/ELF The linkers in our Linux environments do not support this option and fail to link the standard library. See: - https://github.com/swiftlang/llvm-project/pull/9339 - https://github.com/llvm/llvm-project/pull/78003 --- lib/IRGen/IRGen.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/IRGen/IRGen.cpp b/lib/IRGen/IRGen.cpp index b9580fba1f112..bdb1c456260cb 100644 --- a/lib/IRGen/IRGen.cpp +++ b/lib/IRGen/IRGen.cpp @@ -132,6 +132,9 @@ swift::getIRTargetOptions(const IRGenOptions &Opts, ASTContext &Ctx) { // FIXME: We should do this entirely through Clang, for consistency. TargetOptions TargetOpts; + // Linker support for this is not widespread enough. + TargetOpts.SupportIndirectSymViaGOTPCRel_AArch64_ELF = false; + // Explicitly request debugger tuning for LLDB which is the default // on Darwin platforms but not on others. TargetOpts.DebuggerTuning = llvm::DebuggerKind::LLDB; From dcb905bddd4c9a794a7b3b7c0b8cb4c0a40c94d1 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 11 Jun 2025 15:38:12 +0100 Subject: [PATCH 041/100] Basic: Conservatively handle new `llvm::Triple` case Added in https://github.com/llvm/llvm-project/pull/87845 --- lib/Basic/Platform.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Basic/Platform.cpp b/lib/Basic/Platform.cpp index 107159f9dab37..d6e592d8e995c 100644 --- a/lib/Basic/Platform.cpp +++ b/lib/Basic/Platform.cpp @@ -273,6 +273,7 @@ StringRef swift::getPlatformNameForTriple(const llvm::Triple &triple) { return "none"; case llvm::Triple::UEFI: case llvm::Triple::LiteOS: + case llvm::Triple::Managarm: llvm_unreachable("unsupported OS"); } llvm_unreachable("unsupported OS"); From 9322c9f9924025e86a9d7724e5f9b25fc96e8c4b Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 11 Jun 2025 15:50:09 +0100 Subject: [PATCH 042/100] Adjust calls to `clang::TargetInfo::CreateTargetInfo` (now takes ref vs. ptr) See https://github.com/llvm/llvm-project/pull/106271 --- lib/Basic/TargetInfo.cpp | 8 ++++---- lib/ClangImporter/ClangImporter.cpp | 9 ++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/Basic/TargetInfo.cpp b/lib/Basic/TargetInfo.cpp index 0a80a98d6b0de..111bba9d30d6f 100644 --- a/lib/Basic/TargetInfo.cpp +++ b/lib/Basic/TargetInfo.cpp @@ -148,10 +148,10 @@ void printTripleInfo(const CompilerInvocation &invocation, clang::DiagnosticsEngine DE{new clang::DiagnosticIDs(), new clang::DiagnosticOptions(), new clang::IgnoringDiagConsumer()}; - std::shared_ptr TO = - std::make_shared(); - TO->Triple = triple.str(); - clang::TargetInfo *TI = clang::TargetInfo::CreateTargetInfo(DE, TO); + + clang::TargetOptions targetOpts; + targetOpts.Triple = triple.str(); + clang::TargetInfo *TI = clang::TargetInfo::CreateTargetInfo(DE, targetOpts); out << " \"pointerWidthInBits\": " << TI->getPointerWidth(clang::LangAS::Default) << ",\n"; out << " \"pointerWidthInBytes\": " diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index deca1a9112629..12b5f536ac924 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -1414,7 +1414,7 @@ ClangImporter::create(ASTContext &ctx, if (!swiftTargetClangInvocation) return nullptr; auto targetInfo = clang::TargetInfo::CreateTargetInfo( - clangDiags, swiftTargetClangInvocation->TargetOpts); + clangDiags, swiftTargetClangInvocation->getTargetOpts()); // Ensure the target info has configured target-specific defines std::string defineBuffer; llvm::raw_string_ostream predefines(defineBuffer); @@ -1426,7 +1426,7 @@ ClangImporter::create(ASTContext &ctx, } else { // Just use the existing Invocation's directly importer->Impl.setSwiftTargetInfo(clang::TargetInfo::CreateTargetInfo( - clangDiags, importer->Impl.Invocation->TargetOpts)); + clangDiags, importer->Impl.Invocation->getTargetOpts())); importer->Impl.setSwiftCodeGenOptions( new clang::CodeGenOptions(importer->Impl.Invocation->getCodeGenOpts())); } @@ -1445,9 +1445,8 @@ ClangImporter::create(ASTContext &ctx, // things here. // Create the target instance. - instance.setTarget( - clang::TargetInfo::CreateTargetInfo(clangDiags, - instance.getInvocation().TargetOpts)); + instance.setTarget(clang::TargetInfo::CreateTargetInfo( + clangDiags, instance.getInvocation().getTargetOpts())); if (!instance.hasTarget()) return nullptr; From 0981b71090622100019bcd857a62262e2f96bda9 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 11 Jun 2025 15:50:42 +0100 Subject: [PATCH 043/100] Adjust calls to `clang::DiagnosticsEngine` ctor (now takes ref vs. ptr) See https://github.com/llvm/llvm-project/pull/139584 --- lib/Basic/TargetInfo.cpp | 4 ++-- lib/ClangImporter/ClangDiagnosticConsumer.cpp | 15 ++++++------- lib/ClangImporter/ClangImporter.cpp | 21 +++++++++---------- lib/ClangImporter/ClangIncludePaths.cpp | 3 ++- .../ClangModuleDependencyScanner.cpp | 4 ++-- lib/IDETool/CompilerInvocation.cpp | 7 ++----- lib/Migrator/Migrator.cpp | 10 ++++----- 7 files changed, 29 insertions(+), 35 deletions(-) diff --git a/lib/Basic/TargetInfo.cpp b/lib/Basic/TargetInfo.cpp index 111bba9d30d6f..36e1512d1d103 100644 --- a/lib/Basic/TargetInfo.cpp +++ b/lib/Basic/TargetInfo.cpp @@ -145,8 +145,8 @@ void printTripleInfo(const CompilerInvocation &invocation, out << " \"arch\": \"" << swift::getMajorArchitectureName(triple) << "\",\n"; - clang::DiagnosticsEngine DE{new clang::DiagnosticIDs(), - new clang::DiagnosticOptions(), + clang::DiagnosticOptions diagOpts; + clang::DiagnosticsEngine DE{new clang::DiagnosticIDs(), diagOpts, new clang::IgnoringDiagConsumer()}; clang::TargetOptions targetOpts; diff --git a/lib/ClangImporter/ClangDiagnosticConsumer.cpp b/lib/ClangImporter/ClangDiagnosticConsumer.cpp index d682ae6dd5dab..dfd91c13e6469 100644 --- a/lib/ClangImporter/ClangDiagnosticConsumer.cpp +++ b/lib/ClangImporter/ClangDiagnosticConsumer.cpp @@ -34,10 +34,8 @@ namespace { public: ClangDiagRenderer(const clang::LangOptions &langOpts, - clang::DiagnosticOptions *diagOpts, - decltype(callback) fn) - : DiagnosticNoteRenderer(langOpts, diagOpts), - callback(fn) {} + clang::DiagnosticOptions &diagOpts, decltype(callback) fn) + : DiagnosticNoteRenderer(langOpts, diagOpts), callback(fn) {} private: /// Is this a diagnostic that doesn't do the user any good to show if it @@ -107,10 +105,9 @@ namespace { ClangDiagnosticConsumer::ClangDiagnosticConsumer( ClangImporter::Implementation &impl, - clang::DiagnosticOptions &clangDiagOptions, - bool dumpToStderr) - : TextDiagnosticPrinter(llvm::errs(), &clangDiagOptions), - ImporterImpl(impl), DumpToStderr(dumpToStderr) {} + clang::DiagnosticOptions &clangDiagOptions, bool dumpToStderr) + : TextDiagnosticPrinter(llvm::errs(), clangDiagOptions), ImporterImpl(impl), + DumpToStderr(dumpToStderr) {} void ClangDiagnosticConsumer::HandleDiagnostic( clang::DiagnosticsEngine::Level clangDiagLevel, @@ -179,7 +176,7 @@ void ClangDiagnosticConsumer::HandleDiagnostic( assert(clangDiag.hasSourceManager()); auto clangCI = ImporterImpl.getClangInstance(); ClangDiagRenderer renderer(clangCI->getLangOpts(), - &clangCI->getDiagnosticOpts(), emitDiag); + clangCI->getDiagnosticOpts(), emitDiag); clang::FullSourceLoc clangDiagLoc(clangDiag.getLocation(), clangDiag.getSourceManager()); renderer.emitDiagnostic(clangDiagLoc, clangDiagLevel, message, diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index 12b5f536ac924..a90cd5716d6de 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -984,10 +984,11 @@ bool ClangImporter::canReadPCH(StringRef PCHFilename) { // will try to free it. invocation->getPreprocessorOpts().RemappedFileBuffers.clear(); + clang::DiagnosticOptions diagOpts; CI.setInvocation(std::move(invocation)); CI.setTarget(&Impl.Instance->getTarget()); CI.setDiagnostics(&*clang::CompilerInstance::createDiagnostics( - Impl.Instance->getVirtualFileSystem(), new clang::DiagnosticOptions())); + Impl.Instance->getVirtualFileSystem(), diagOpts)); // Note: Reusing the file manager is safe; this is a component that's already // reused when building PCM files for the module cache. @@ -1139,13 +1140,11 @@ std::optional> ClangImporter::getClangCC1Arguments( // // The long-term client for Clang diagnostics is set up afterwards, after the // clang::CompilerInstance is created. - llvm::IntrusiveRefCntPtr tempDiagOpts{ - new clang::DiagnosticOptions}; - auto *tempDiagClient = - new ClangDiagnosticConsumer(Impl, *tempDiagOpts, - ctx.ClangImporterOpts.DumpClangDiagnostics); + clang::DiagnosticOptions tempDiagOpts; + auto *tempDiagClient = new ClangDiagnosticConsumer( + Impl, tempDiagOpts, ctx.ClangImporterOpts.DumpClangDiagnostics); auto clangDiags = clang::CompilerInstance::createDiagnostics( - *VFS, tempDiagOpts.get(), tempDiagClient, + *VFS, tempDiagOpts, tempDiagClient, /*owned*/ true); // If using direct cc1 module build, use extra args to setup ClangImporter. @@ -1265,10 +1264,10 @@ std::unique_ptr ClangImporter::createClangInvocation( // option here is either generated by dependency scanner or just round tripped // from `getClangCC1Arguments` so we don't expect it to fail. Use a simple // printing diagnostics consumer for debugging any unexpected error. - auto diagOpts = llvm::makeIntrusiveRefCnt(); + clang::DiagnosticOptions diagOpts; clang::DiagnosticsEngine clangDiags( new clang::DiagnosticIDs(), diagOpts, - new clang::TextDiagnosticPrinter(llvm::errs(), diagOpts.get())); + new clang::TextDiagnosticPrinter(llvm::errs(), diagOpts)); // Finally, use the CC1 command-line and the diagnostic engine // to instantiate our Invocation. @@ -4161,8 +4160,8 @@ ClangImporter::getSwiftExplicitModuleDirectCC1Args() const { }); clang::CompilerInvocation instance; - clang::DiagnosticsEngine clangDiags(new clang::DiagnosticIDs(), - new clang::DiagnosticOptions(), + clang::DiagnosticOptions diagOpts; + clang::DiagnosticsEngine clangDiags(new clang::DiagnosticIDs(), diagOpts, new clang::IgnoringDiagConsumer()); bool success = clang::CompilerInvocation::CreateFromArgs(instance, clangArgs, clangDiags); diff --git a/lib/ClangImporter/ClangIncludePaths.cpp b/lib/ClangImporter/ClangIncludePaths.cpp index 9939333443443..f976707de874d 100644 --- a/lib/ClangImporter/ClangIncludePaths.cpp +++ b/lib/ClangImporter/ClangIncludePaths.cpp @@ -130,9 +130,10 @@ ClangImporter::createClangDriver( auto diagVFS = vfs ? vfs : llvm::vfs::getRealFileSystem(); + clang::DiagnosticOptions diagOpts; auto *silentDiagConsumer = new clang::DiagnosticConsumer(); auto clangDiags = clang::CompilerInstance::createDiagnostics( - *diagVFS, new clang::DiagnosticOptions(), silentDiagConsumer); + *diagVFS, diagOpts, silentDiagConsumer); clang::driver::Driver clangDriver(ClangImporterOpts.clangPath, LangOpts.Target.str(), *clangDiags, "clang LLVM compiler", vfs); diff --git a/lib/ClangImporter/ClangModuleDependencyScanner.cpp b/lib/ClangImporter/ClangModuleDependencyScanner.cpp index aad5dbc8c0a1a..a0afe28da89e9 100644 --- a/lib/ClangImporter/ClangModuleDependencyScanner.cpp +++ b/lib/ClangImporter/ClangModuleDependencyScanner.cpp @@ -228,8 +228,8 @@ void ClangImporter::getBridgingHeaderOptions( // Round-trip clang args to canonicalize and clear the options that swift // compiler doesn't need. clang::CompilerInvocation depsInvocation; - clang::DiagnosticsEngine clangDiags(new clang::DiagnosticIDs(), - new clang::DiagnosticOptions(), + clang::DiagnosticOptions diagOpts; + clang::DiagnosticsEngine clangDiags(new clang::DiagnosticIDs(), diagOpts, new clang::IgnoringDiagConsumer()); llvm::SmallVector clangArgs; diff --git a/lib/IDETool/CompilerInvocation.cpp b/lib/IDETool/CompilerInvocation.cpp index f16c441b4f12a..1e1dfa05ace27 100644 --- a/lib/IDETool/CompilerInvocation.cpp +++ b/lib/IDETool/CompilerInvocation.cpp @@ -267,15 +267,12 @@ bool ide::initCompilerInvocation( bool ide::initInvocationByClangArguments(ArrayRef ArgList, CompilerInvocation &Invok, std::string &Error) { - llvm::IntrusiveRefCntPtr DiagOpts{ - new clang::DiagnosticOptions() - }; - const auto VFS = llvm::vfs::getRealFileSystem(); clang::TextDiagnosticBuffer DiagBuf; + clang::DiagnosticOptions DiagOpts; llvm::IntrusiveRefCntPtr ClangDiags = - clang::CompilerInstance::createDiagnostics(*VFS, DiagOpts.get(), &DiagBuf, + clang::CompilerInstance::createDiagnostics(*VFS, DiagOpts, &DiagBuf, /*ShouldOwnClient=*/false); // Clang expects this to be like an actual command line. So we need to pass in diff --git a/lib/Migrator/Migrator.cpp b/lib/Migrator/Migrator.cpp index 034c056dc370a..857e30eb3dead 100644 --- a/lib/Migrator/Migrator.cpp +++ b/lib/Migrator/Migrator.cpp @@ -191,11 +191,11 @@ bool Migrator::performSyntacticPasses(SyntacticPassOptions Opts) { llvm::IntrusiveRefCntPtr DummyClangDiagIDs { new clang::DiagnosticIDs() }; - auto ClangDiags = - std::make_unique(DummyClangDiagIDs, - new clang::DiagnosticOptions, - new clang::DiagnosticConsumer(), - /*ShouldOwnClient=*/true); + + clang::DiagnosticOptions diagOpts; + auto ClangDiags = std::make_unique( + DummyClangDiagIDs, diagOpts, new clang::DiagnosticConsumer(), + /*ShouldOwnClient=*/true); clang::SourceManager ClangSourceManager { *ClangDiags, ClangFileManager }; clang::LangOptions ClangLangOpts; From b8b60f159ab0436f9b18d9157fa359a605510baa Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 11 Jun 2025 16:08:32 +0100 Subject: [PATCH 044/100] AST: Adjust for renamed/removed `llvm::Intrinsic::IITDescriptor` cases See https://github.com/llvm/llvm-project/pull/141492 --- lib/AST/Builtins.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/AST/Builtins.cpp b/lib/AST/Builtins.cpp index 216f3a6cdb83c..73b7b3587c2ae 100644 --- a/lib/AST/Builtins.cpp +++ b/lib/AST/Builtins.cpp @@ -2497,7 +2497,6 @@ Type IntrinsicTypeDecoder::decodeImmediate() { case IITDescriptor::Metadata: case IITDescriptor::ExtendArgument: case IITDescriptor::TruncArgument: - case IITDescriptor::HalfVecArgument: case IITDescriptor::VarArg: case IITDescriptor::Token: case IITDescriptor::VecOfAnyPtrsToElt: @@ -2506,9 +2505,7 @@ Type IntrinsicTypeDecoder::decodeImmediate() { case IITDescriptor::Subdivide4Argument: case IITDescriptor::PPCQuad: case IITDescriptor::AArch64Svcount: - case IITDescriptor::OneThirdVecArgument: - case IITDescriptor::OneFifthVecArgument: - case IITDescriptor::OneSeventhVecArgument: + case IITDescriptor::OneNthEltsVecArgument: // These types cannot be expressed in swift yet. return Type(); From 6cbd6024cd1864cd28bd89ee2a395bb897a9cd9a Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 11 Jun 2025 16:09:29 +0100 Subject: [PATCH 045/100] Adjust includes of renamed Clang file See https://github.com/llvm/llvm-project/commit/3a42cbd47d3e92b8794378d2a0e8ec7ae81950d7 (No PR?!) --- lib/AST/ClangTypeConverter.cpp | 2 +- lib/ClangImporter/ClangAdapter.cpp | 2 +- lib/ClangImporter/ImportType.cpp | 2 +- lib/IRGen/GenCall.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/AST/ClangTypeConverter.cpp b/lib/AST/ClangTypeConverter.cpp index 89f9cb8cd234a..d8ee705acabe2 100644 --- a/lib/AST/ClangTypeConverter.cpp +++ b/lib/AST/ClangTypeConverter.cpp @@ -71,7 +71,7 @@ getClangBuiltinTypeFromKind(const clang::ASTContext &context, #define SVE_TYPE(Name, Id, SingletonId) \ case clang::BuiltinType::Id: \ return context.SingletonId; -#include "clang/Basic/AArch64SVEACLETypes.def" +#include "clang/Basic/AArch64ACLETypes.def" #define PPC_VECTOR_TYPE(Name, Id, Size) \ case clang::BuiltinType::Id: \ return context.Id##Ty; diff --git a/lib/ClangImporter/ClangAdapter.cpp b/lib/ClangImporter/ClangAdapter.cpp index 691eef5ae1d43..363425226914e 100644 --- a/lib/ClangImporter/ClangAdapter.cpp +++ b/lib/ClangImporter/ClangAdapter.cpp @@ -428,7 +428,7 @@ OmissionTypeName importer::getClangTypeNameForOmission(clang::ASTContext &ctx, // ARM SVE builtin types that don't have Swift equivalents. #define SVE_TYPE(Name, Id, ...) case clang::BuiltinType::Id: -#include "clang/Basic/AArch64SVEACLETypes.def" +#include "clang/Basic/AArch64ACLETypes.def" return OmissionTypeName(); // PPC MMA builtin types that don't have Swift equivalents. diff --git a/lib/ClangImporter/ImportType.cpp b/lib/ClangImporter/ImportType.cpp index b919d223316cf..cdf6a647b4f1a 100644 --- a/lib/ClangImporter/ImportType.cpp +++ b/lib/ClangImporter/ImportType.cpp @@ -347,7 +347,7 @@ namespace { // ARM SVE builtin types that don't have Swift equivalents. #define SVE_TYPE(Name, Id, ...) case clang::BuiltinType::Id: -#include "clang/Basic/AArch64SVEACLETypes.def" +#include "clang/Basic/AArch64ACLETypes.def" return Type(); // PPC SVE builtin types that don't have Swift equivalents. diff --git a/lib/IRGen/GenCall.cpp b/lib/IRGen/GenCall.cpp index 79e0a9b3f6ca2..1abb69aa4857a 100644 --- a/lib/IRGen/GenCall.cpp +++ b/lib/IRGen/GenCall.cpp @@ -1322,7 +1322,7 @@ namespace { // We should never see ARM SVE types at all. #define SVE_TYPE(Name, Id, ...) case clang::BuiltinType::Id: -#include "clang/Basic/AArch64SVEACLETypes.def" +#include "clang/Basic/AArch64ACLETypes.def" llvm_unreachable("ARM SVE type in ABI lowering"); // We should never see PPC MMA types at all. From 0a72c3921a6762948c19dae3642f725318e5a1ec Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 11 Jun 2025 17:19:50 +0100 Subject: [PATCH 046/100] ClangImporter: Adjust code after removal of `clang::CompilerInstance::setInvocation` See https://github.com/llvm/llvm-project/pull/137668 --- lib/ClangImporter/ClangImporter.cpp | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index a90cd5716d6de..ec904816aed3f 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -966,10 +966,8 @@ bool ClangImporter::canReadPCH(StringRef PCHFilename) { // FIXME: The following attempts to do an initial ReadAST invocation to verify // the PCH, without causing trouble for the existing CompilerInstance. // Look into combining creating the ASTReader along with verification + update - // if necessary, so that we can create and use one ASTReader in the common case - // when there is no need for update. - clang::CompilerInstance CI(Impl.Instance->getPCHContainerOperations(), - &Impl.Instance->getModuleCache()); + // if necessary, so that we can create and use one ASTReader in the common + // case when there is no need for update. auto invocation = std::make_shared(*Impl.Invocation); invocation->getPreprocessorOpts().DisablePCHOrModuleValidation = @@ -985,7 +983,9 @@ bool ClangImporter::canReadPCH(StringRef PCHFilename) { invocation->getPreprocessorOpts().RemappedFileBuffers.clear(); clang::DiagnosticOptions diagOpts; - CI.setInvocation(std::move(invocation)); + clang::CompilerInstance CI(std::move(invocation), + Impl.Instance->getPCHContainerOperations(), + &Impl.Instance->getModuleCache()); CI.setTarget(&Impl.Instance->getTarget()); CI.setDiagnostics(&*clang::CompilerInstance::createDiagnostics( Impl.Instance->getVirtualFileSystem(), diagOpts)); @@ -1363,12 +1363,10 @@ ClangImporter::create(ASTContext &ctx, std::make_unique()); PCHContainerOperations->registerReader( std::make_unique()); - importer->Impl.Instance.reset( - new clang::CompilerInstance(std::move(PCHContainerOperations))); + importer->Impl.Instance.reset(new clang::CompilerInstance( + importer->Impl.Invocation, std::move(PCHContainerOperations))); } auto &instance = *importer->Impl.Instance; - instance.setInvocation(importer->Impl.Invocation); - if (tracker) instance.addDependencyCollector(tracker->getClangCollector()); @@ -1898,9 +1896,8 @@ std::string ClangImporter::getBridgingHeaderContents( clang::FileManager &fileManager = Impl.Instance->getFileManager(); clang::CompilerInstance rewriteInstance( - Impl.Instance->getPCHContainerOperations(), - &Impl.Instance->getModuleCache()); - rewriteInstance.setInvocation(invocation); + std::move(invocation), Impl.Instance->getPCHContainerOperations(), + &Impl.Instance->getModuleCache()); rewriteInstance.createDiagnostics(fileManager.getVirtualFileSystem(), new clang::IgnoringDiagConsumer); rewriteInstance.setFileManager(&fileManager); @@ -2004,9 +2001,8 @@ ClangImporter::cloneCompilerInstanceForPrecompiling() { clang::FileManager &fileManager = Impl.Instance->getFileManager(); auto clonedInstance = std::make_unique( - Impl.Instance->getPCHContainerOperations(), - &Impl.Instance->getModuleCache()); - clonedInstance->setInvocation(std::move(invocation)); + std::move(invocation), Impl.Instance->getPCHContainerOperations(), + &Impl.Instance->getModuleCache()); clonedInstance->createDiagnostics(fileManager.getVirtualFileSystem(), &Impl.Instance->getDiagnosticClient(), /*ShouldOwnClient=*/false); From 1a0e390f5aaebe40b5043d5de7e425f7fda119b4 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 11 Jun 2025 17:26:25 +0100 Subject: [PATCH 047/100] ClangImporter: Adjust references to cases of moved enum `clang::Sema::AllocationFunctionScope` See https://github.com/llvm/llvm-project/commit/461255e0c17265141009437ba3887f49f9838a40 --- lib/ClangImporter/SwiftDeclSynthesizer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ClangImporter/SwiftDeclSynthesizer.cpp b/lib/ClangImporter/SwiftDeclSynthesizer.cpp index 24e1a8d94e565..ecb631d5749ce 100644 --- a/lib/ClangImporter/SwiftDeclSynthesizer.cpp +++ b/lib/ClangImporter/SwiftDeclSynthesizer.cpp @@ -2563,9 +2563,10 @@ SwiftDeclSynthesizer::synthesizeStaticFactoryForCXXForeignRef( bool passAlignment = false; clang::Sema::SFINAETrap trap(clangSema); bool findingAllocFuncFailed = clangSema.FindAllocationFunctions( - cxxRecordDeclLoc, clang::SourceRange(), clang::Sema::AFS_Both, - clang::Sema::AFS_Both, cxxRecordTy, /*IsArray=*/false, passAlignment, - clang::MultiExprArg(), operatorNew, operatorDelete, + cxxRecordDeclLoc, clang::SourceRange(), + clang::AllocationFunctionScope::Both, + clang::AllocationFunctionScope::Both, cxxRecordTy, /*IsArray=*/false, + passAlignment, clang::MultiExprArg(), operatorNew, operatorDelete, /*Diagnose=*/false); if (trap.hasErrorOccurred() || findingAllocFuncFailed || !operatorNew || operatorNew->isDeleted() || From 85c344b8e0030155445602bee36b8386b4e05e08 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 11 Jun 2025 17:34:55 +0100 Subject: [PATCH 048/100] ClangImporter: Adjust references to renamed `clang::LifetimeCaptureByAttr` cases See https://github.com/llvm/llvm-project/pull/142195 --- lib/ClangImporter/ImportDecl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ClangImporter/ImportDecl.cpp b/lib/ClangImporter/ImportDecl.cpp index c51160348cb60..1433dbcbbe6b9 100644 --- a/lib/ClangImporter/ImportDecl.cpp +++ b/lib/ClangImporter/ImportDecl.cpp @@ -4219,14 +4219,14 @@ namespace { for (auto param : attr->params()) { // FIXME: Swift assumes no escaping to globals. We should diagnose // this. - if (param == clang::LifetimeCaptureByAttr::GLOBAL || - param == clang::LifetimeCaptureByAttr::UNKNOWN || - param == clang::LifetimeCaptureByAttr::INVALID) + if (param == clang::LifetimeCaptureByAttr::Global || + param == clang::LifetimeCaptureByAttr::Unknown || + param == clang::LifetimeCaptureByAttr::Invalid) continue; paramHasAnnotation[idx] = true; if (isa(decl) && - param == clang::LifetimeCaptureByAttr::THIS) { + param == clang::LifetimeCaptureByAttr::This) { auto [it, inserted] = inheritedArgDependences.try_emplace( result->getSelfIndex(), SmallBitVector(dependencyVecSize)); it->second[idx] = true; From 01296faed80fc940408ab569f542a42613985a63 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 11 Jun 2025 17:40:46 +0100 Subject: [PATCH 049/100] ClangImporter: Adjust references to moved enum `clang::LookupResult::LookupResultKind` See https://github.com/llvm/llvm-project/commit/ee29afe1e56d911f2fde54f5de141f4c4a0a1feb --- lib/ClangImporter/ImportMacro.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ClangImporter/ImportMacro.cpp b/lib/ClangImporter/ImportMacro.cpp index b11d6de5d8295..d8e1b48cd07d8 100644 --- a/lib/ClangImporter/ImportMacro.cpp +++ b/lib/ClangImporter/ImportMacro.cpp @@ -620,7 +620,7 @@ static ValueDecl *importMacro(ClangImporter::Implementation &impl, clang::LookupResult R(S, {{tok.getIdentifierInfo()}, {}}, clang::Sema::LookupAnyName); if (S.LookupName(R, S.TUScope)) - if (R.getResultKind() == clang::LookupResult::LookupResultKind::Found) + if (R.getResultKind() == clang::LookupResultKind::Found) if (const auto *VD = dyn_cast(R.getFoundDecl())) return importDeclAlias(impl, DC, VD, name); } From 70948738823e9f2384c44647aa8978d9ce35ff45 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 11 Jun 2025 17:52:58 +0100 Subject: [PATCH 050/100] ClangImporter: Adjust call to refactored `clangSema.FindAllocationFunctions` See https://github.com/llvm/llvm-project/pull/113510 --- lib/ClangImporter/SwiftDeclSynthesizer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ClangImporter/SwiftDeclSynthesizer.cpp b/lib/ClangImporter/SwiftDeclSynthesizer.cpp index ecb631d5749ce..ab2d679f4a80e 100644 --- a/lib/ClangImporter/SwiftDeclSynthesizer.cpp +++ b/lib/ClangImporter/SwiftDeclSynthesizer.cpp @@ -2560,13 +2560,13 @@ SwiftDeclSynthesizer::synthesizeStaticFactoryForCXXForeignRef( clang::FunctionDecl *operatorNew = nullptr; clang::FunctionDecl *operatorDelete = nullptr; - bool passAlignment = false; + clang::ImplicitAllocationParameters IAP(clang::AlignedAllocationMode::No); clang::Sema::SFINAETrap trap(clangSema); bool findingAllocFuncFailed = clangSema.FindAllocationFunctions( cxxRecordDeclLoc, clang::SourceRange(), clang::AllocationFunctionScope::Both, - clang::AllocationFunctionScope::Both, cxxRecordTy, /*IsArray=*/false, - passAlignment, clang::MultiExprArg(), operatorNew, operatorDelete, + clang::AllocationFunctionScope::Both, cxxRecordTy, /*IsArray=*/false, IAP, + clang::MultiExprArg(), operatorNew, operatorDelete, /*Diagnose=*/false); if (trap.hasErrorOccurred() || findingAllocFuncFailed || !operatorNew || operatorNew->isDeleted() || From 6e9d9e175ddd1a5d24bfe6d65bc900534887fc29 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 11 Jun 2025 18:17:09 +0100 Subject: [PATCH 051/100] ClangImporter: Conservatively handle new `clang::HLSLInlineSpirvType` type See https://github.com/llvm/llvm-project/pull/134034 --- lib/ClangImporter/ImportType.cpp | 10 ++++++++++ lib/ClangImporter/Serializability.cpp | 3 +++ lib/IRGen/GenCall.cpp | 1 + lib/Serialization/Deserialization.cpp | 3 +++ lib/Serialization/Serialization.cpp | 3 +++ 5 files changed, 20 insertions(+) diff --git a/lib/ClangImporter/ImportType.cpp b/lib/ClangImporter/ImportType.cpp index cdf6a647b4f1a..968a77dc2c0eb 100644 --- a/lib/ClangImporter/ImportType.cpp +++ b/lib/ClangImporter/ImportType.cpp @@ -429,6 +429,16 @@ namespace { return Type(); } + ImportResult + VisitHLSLInlineSpirvType(const clang::HLSLInlineSpirvType *type) { + Impl.addImportDiagnostic( + type, + Diagnostic(diag::unsupported_builtin_type, type->getTypeClassName()), + clang::SourceLocation()); + // FIXME: (?) HLSL types are not supported in Swift. + return Type(); + } + ImportResult VisitCountAttributedType(const clang::CountAttributedType *type) { return Visit(type->desugar()); diff --git a/lib/ClangImporter/Serializability.cpp b/lib/ClangImporter/Serializability.cpp index b57c47dce21c9..4802ea506f3d3 100644 --- a/lib/ClangImporter/Serializability.cpp +++ b/lib/ClangImporter/Serializability.cpp @@ -330,6 +330,9 @@ namespace { void writeTypeCoupledDeclRefInfo(clang::TypeCoupledDeclRefInfo info) { llvm_unreachable("TypeCoupledDeclRefInfo shouldn't be reached from swift"); } + void writeHLSLSpirvOperand(clang::SpirvOperand) { + llvm_unreachable("SpirvOperand shouldn't be reached from swift"); + } }; } diff --git a/lib/IRGen/GenCall.cpp b/lib/IRGen/GenCall.cpp index 1abb69aa4857a..110ea0ebcbe94 100644 --- a/lib/IRGen/GenCall.cpp +++ b/lib/IRGen/GenCall.cpp @@ -1214,6 +1214,7 @@ namespace { case clang::Type::ArrayParameter: case clang::Type::HLSLAttributedResource: + case clang::Type::HLSLInlineSpirv: llvm_unreachable("HLSL type in ABI lowering"); diff --git a/lib/Serialization/Deserialization.cpp b/lib/Serialization/Deserialization.cpp index 8758ea056e1b5..5f68689c40820 100644 --- a/lib/Serialization/Deserialization.cpp +++ b/lib/Serialization/Deserialization.cpp @@ -8478,6 +8478,9 @@ class SwiftToClangBasicReader : clang::TypeCoupledDeclRefInfo readTypeCoupledDeclRefInfo() { llvm_unreachable("TypeCoupledDeclRefInfo shouldn't be reached from swift"); } + clang::SpirvOperand readHLSLSpirvOperand() { + llvm_unreachable("SpirvOperand shouldn't be reached from swift"); + } }; } // end anonymous namespace diff --git a/lib/Serialization/Serialization.cpp b/lib/Serialization/Serialization.cpp index 4d357ec9f2842..d2e378f8ffe35 100644 --- a/lib/Serialization/Serialization.cpp +++ b/lib/Serialization/Serialization.cpp @@ -6286,6 +6286,9 @@ class ClangToSwiftBasicWriter : void writeTypeCoupledDeclRefInfo(clang::TypeCoupledDeclRefInfo info) { llvm_unreachable("TypeCoupledDeclRefInfo shouldn't be reached from swift"); } + void writeHLSLSpirvOperand(clang::SpirvOperand) { + llvm_unreachable("SpirvOperand shouldn't be reached from swift"); + } }; } From 50ee3f421c086bc1b90017e2181c14404218dd3d Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 11 Jun 2025 18:40:01 +0100 Subject: [PATCH 052/100] ClangImporter: Adjust code after transition to `clang::IdentifierLoc` See https://github.com/llvm/llvm-project/pull/136077 --- lib/ClangImporter/ClangImporter.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index ec904816aed3f..644ae6aa6d185 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -328,7 +328,7 @@ class BridgingPPTracker : public clang::PPCallbacks { return; SmallVector IdLocs; for (auto &P : Path) - IdLocs.push_back(P.second); + IdLocs.push_back(P.getLoc()); handleImport(ImportLoc, IdLocs, Imported); } @@ -2291,17 +2291,15 @@ ModuleDecl *ClangImporter::Implementation::loadModuleClang( auto realModuleName = SwiftContext.getRealModuleName(path.front().Item).str(); // Convert the Swift import path over to a Clang import path. - SmallVector, 4> - clangPath; + SmallVector clangPath; bool isTopModuleComponent = true; for (auto component : path) { StringRef item = isTopModuleComponent? realModuleName: component.Item.str(); isTopModuleComponent = false; - clangPath.emplace_back( - getClangPreprocessor().getIdentifierInfo(item), - exportSourceLoc(component.Loc)); + clangPath.emplace_back(exportSourceLoc(component.Loc), + getClangPreprocessor().getIdentifierInfo(item)); } auto &diagEngine = Instance->getDiagnostics(); @@ -2311,14 +2309,13 @@ ModuleDecl *ClangImporter::Implementation::loadModuleClang( auto loadModule = [&](clang::ModuleIdPath path, clang::Module::NameVisibilityKind visibility) -> clang::ModuleLoadResult { - auto importRAII = - diagClient.handleImport(clangPath.front().first, diagEngine, - importLoc); + auto importRAII = diagClient.handleImport( + clangPath.front().getIdentifierInfo(), diagEngine, importLoc); std::string preservedIndexStorePathOption; auto &clangFEOpts = Instance->getFrontendOpts(); if (!clangFEOpts.IndexStorePath.empty()) { - StringRef moduleName = path[0].first->getName(); + StringRef moduleName = path[0].getIdentifierInfo()->getName(); // Ignore the SwiftShims module for the index data. if (moduleName == SwiftContext.SwiftShimsModuleName.str()) { preservedIndexStorePathOption = clangFEOpts.IndexStorePath; From 7f8415bd363d309aec6d3cbd5a39747257f91e2b Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 11 Jun 2025 20:04:34 +0100 Subject: [PATCH 053/100] ClangImporter: Refactor Clang invocation path remapping after change to... ...`clang::tooling::dependencies::DepscanPrefixMapping::configurePrefixMapper` See https://github.com/swiftlang/llvm-project/pull/10723 --- lib/ClangImporter/ClangImporter.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index 644ae6aa6d185..f16f6d4eb3fe9 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -26,6 +26,7 @@ #include "swift/AST/ConcreteDeclRef.h" #include "swift/AST/DiagnosticEngine.h" #include "swift/AST/DiagnosticsClangImporter.h" +#include "swift/AST/DiagnosticsFrontend.h" #include "swift/AST/DiagnosticsSema.h" #include "swift/AST/Evaluator.h" #include "swift/AST/IRGenOptions.h" @@ -4207,8 +4208,19 @@ ClangImporter::getSwiftExplicitModuleDirectCC1Args() const { if (!Impl.SwiftContext.SearchPathOpts.ScannerPrefixMapper.empty()) { // Remap all the paths if requested. llvm::PrefixMapper Mapper; - clang::tooling::dependencies::DepscanPrefixMapping::configurePrefixMapper( - Impl.SwiftContext.SearchPathOpts.ScannerPrefixMapper, Mapper); + SmallVector Prefixes; + if (auto E = llvm::MappedPrefix::transformJoined( + Impl.SwiftContext.SearchPathOpts.ScannerPrefixMapper, Prefixes)) { + // Take permanent ownership of this string. In general the diagnostic + // might outlive this function. + auto errorMessage = + Impl.SwiftContext.AllocateCopy(llvm::toString(std::move(E))); + Impl.SwiftContext.Diags.diagnose(SourceLoc(), diag::error_prefix_mapping, + errorMessage); + } + Mapper.addRange(Prefixes); + Mapper.sort(); + clang::tooling::dependencies::DepscanPrefixMapping::remapInvocationPaths( instance, Mapper); instance.getFrontendOpts().PathPrefixMappings.clear(); From b58d10c6828817adeffc7470a1e9ab3b9e5bffec Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 12 Jun 2025 03:33:13 +0100 Subject: [PATCH 054/100] Add missing new method to `clang::serialization::DataStreamBasic{Reader,Writer}` subclasses See https://github.com/llvm/llvm-project/pull/134142 --- include/swift/ClangImporter/SwiftAbstractBasicReader.h | 5 +++++ include/swift/ClangImporter/SwiftAbstractBasicWriter.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/include/swift/ClangImporter/SwiftAbstractBasicReader.h b/include/swift/ClangImporter/SwiftAbstractBasicReader.h index b5063c1c43493..8e31db659d2c1 100644 --- a/include/swift/ClangImporter/SwiftAbstractBasicReader.h +++ b/include/swift/ClangImporter/SwiftAbstractBasicReader.h @@ -64,6 +64,11 @@ class DataStreamBasicReader return uint32_t(asImpl().readUInt64()); } + clang::UnsignedOrNone readUnsignedOrNone() { + return clang::UnsignedOrNone::fromInternalRepresentation( + unsigned(asImpl().readUInt64())); + } + clang::Selector readSelector() { uint64_t numArgsPlusOne = asImpl().readUInt64(); diff --git a/include/swift/ClangImporter/SwiftAbstractBasicWriter.h b/include/swift/ClangImporter/SwiftAbstractBasicWriter.h index be8e2bf3c0e57..f636cba5907ba 100644 --- a/include/swift/ClangImporter/SwiftAbstractBasicWriter.h +++ b/include/swift/ClangImporter/SwiftAbstractBasicWriter.h @@ -61,6 +61,10 @@ class DataStreamBasicWriter asImpl().writeUInt64(uint64_t(value)); } + void writeUnsignedOrNone(clang::UnsignedOrNone value) { + asImpl().writeUInt64(uint64_t(value.toInternalRepresentation())); + } + void writeSelector(clang::Selector selector) { if (selector.isNull()) { asImpl().writeUInt64(0); From 5b5f50ebdcb75bd46795e4effc7729be821a71fd Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 25 Jun 2025 14:53:47 +0100 Subject: [PATCH 055/100] IntrinsicInfo: Adjust call to `llvm::Intrinsic::getAttributes` after LLVM change See https://github.com/llvm/llvm-project/pull/135642 --- include/swift/AST/Builtins.h | 7 ++++--- lib/AST/Builtins.cpp | 17 +++++++++-------- lib/SIL/IR/SILInstruction.cpp | 6 +++--- lib/SIL/IR/SILModule.cpp | 4 ++-- lib/SILOptimizer/Analysis/ARCAnalysis.cpp | 2 +- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/include/swift/AST/Builtins.h b/include/swift/AST/Builtins.h index 799fd3514feec..213a61ff50a70 100644 --- a/include/swift/AST/Builtins.h +++ b/include/swift/AST/Builtins.h @@ -121,12 +121,13 @@ class BuiltinInfo { /// The information identifying the llvm intrinsic - its id and types. class IntrinsicInfo { - mutable llvm::AttributeList Attrs = - llvm::DenseMapInfo::getEmptyKey(); + mutable llvm::AttributeSet FnAttrs = + llvm::DenseMapInfo::getEmptyKey(); + public: llvm::Intrinsic::ID ID; SmallVector Types; - const llvm::AttributeList &getOrCreateAttributes(ASTContext &Ctx) const; + const llvm::AttributeSet &getOrCreateFnAttributes(ASTContext &Ctx) const; }; /// Turn a string like "release" into the LLVM enum. diff --git a/lib/AST/Builtins.cpp b/lib/AST/Builtins.cpp index 73b7b3587c2ae..28cc77f2fbad2 100644 --- a/lib/AST/Builtins.cpp +++ b/lib/AST/Builtins.cpp @@ -49,13 +49,14 @@ bool BuiltinInfo::isReadNone() const { return strchr(BuiltinExtraInfo[(unsigned)ID].Attributes, 'n') != nullptr; } -const llvm::AttributeList & -IntrinsicInfo::getOrCreateAttributes(ASTContext &Ctx) const { - using DenseMapInfo = llvm::DenseMapInfo; - if (DenseMapInfo::isEqual(Attrs, DenseMapInfo::getEmptyKey())) { - Attrs = llvm::Intrinsic::getAttributes(Ctx.getIntrinsicScratchContext(), ID); +const llvm::AttributeSet & +IntrinsicInfo::getOrCreateFnAttributes(ASTContext &Ctx) const { + using DenseMapInfo = llvm::DenseMapInfo; + if (DenseMapInfo::isEqual(FnAttrs, DenseMapInfo::getEmptyKey())) { + FnAttrs = + llvm::Intrinsic::getFnAttributes(Ctx.getIntrinsicScratchContext(), ID); } - return Attrs; + return FnAttrs; } Type swift::getBuiltinType(ASTContext &Context, StringRef Name) { @@ -2603,8 +2604,8 @@ getSwiftFunctionTypeForIntrinsic(llvm::Intrinsic::ID ID, // Translate LLVM function attributes to Swift function attributes. IntrinsicInfo II; II.ID = ID; - auto attrs = II.getOrCreateAttributes(Context); - if (attrs.hasFnAttr(llvm::Attribute::NoReturn)) { + auto &attrs = II.getOrCreateFnAttributes(Context); + if (attrs.hasAttribute(llvm::Attribute::NoReturn)) { ResultTy = Context.getNeverType(); if (!ResultTy) return false; diff --git a/lib/SIL/IR/SILInstruction.cpp b/lib/SIL/IR/SILInstruction.cpp index b60c11cdb75e0..584d801961df2 100644 --- a/lib/SIL/IR/SILInstruction.cpp +++ b/lib/SIL/IR/SILInstruction.cpp @@ -1026,15 +1026,15 @@ MemoryBehavior SILInstruction::getMemoryBehavior() const { // Handle LLVM intrinsic functions. const IntrinsicInfo &IInfo = BI->getIntrinsicInfo(); if (IInfo.ID != llvm::Intrinsic::not_intrinsic) { - auto IAttrs = IInfo.getOrCreateAttributes(getModule().getASTContext()); + auto &IAttrs = IInfo.getOrCreateFnAttributes(getModule().getASTContext()); auto MemEffects = IAttrs.getMemoryEffects(); // Read-only. if (MemEffects.onlyReadsMemory() && - IAttrs.hasFnAttr(llvm::Attribute::NoUnwind)) + IAttrs.hasAttribute(llvm::Attribute::NoUnwind)) return MemoryBehavior::MayRead; // Read-none? return MemEffects.doesNotAccessMemory() && - IAttrs.hasFnAttr(llvm::Attribute::NoUnwind) + IAttrs.hasAttribute(llvm::Attribute::NoUnwind) ? MemoryBehavior::None : MemoryBehavior::MayHaveSideEffects; } diff --git a/lib/SIL/IR/SILModule.cpp b/lib/SIL/IR/SILModule.cpp index efdc86ad94346..ec5c1b72a8add 100644 --- a/lib/SIL/IR/SILModule.cpp +++ b/lib/SIL/IR/SILModule.cpp @@ -885,8 +885,8 @@ void SILModule::notifyMovedInstruction(SILInstruction *inst, bool SILModule::isNoReturnBuiltinOrIntrinsic(Identifier Name) { const auto &IntrinsicInfo = getIntrinsicInfo(Name); if (IntrinsicInfo.ID != llvm::Intrinsic::not_intrinsic) { - return IntrinsicInfo.getOrCreateAttributes(getASTContext()) - .hasFnAttr(llvm::Attribute::NoReturn); + return IntrinsicInfo.getOrCreateFnAttributes(getASTContext()) + .hasAttribute(llvm::Attribute::NoReturn); } const auto &BuiltinInfo = getBuiltinInfo(Name); switch (BuiltinInfo.ID) { diff --git a/lib/SILOptimizer/Analysis/ARCAnalysis.cpp b/lib/SILOptimizer/Analysis/ARCAnalysis.cpp index 4740b4b3090f4..702029bac29d3 100644 --- a/lib/SILOptimizer/Analysis/ARCAnalysis.cpp +++ b/lib/SILOptimizer/Analysis/ARCAnalysis.cpp @@ -104,7 +104,7 @@ static bool canApplyOfBuiltinUseNonTrivialValues(BuiltinInst *BInst) { auto &II = BInst->getIntrinsicInfo(); if (II.ID != llvm::Intrinsic::not_intrinsic) { - auto attrs = II.getOrCreateAttributes(F->getASTContext()); + auto &attrs = II.getOrCreateFnAttributes(F->getASTContext()); if (attrs.getMemoryEffects().doesNotAccessMemory()) { for (auto &Op : BInst->getAllOperands()) { if (!Op.get()->getType().isTrivial(*F)) { From a7ccf93f36c2ba16155544b572b2415d31048c9e Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 26 Jun 2025 02:50:24 +0100 Subject: [PATCH 056/100] Revert "ClangImporter: Refactor Clang invocation path remapping after change to..." This reverts commit 7f8415bd363d309aec6d3cbd5a39747257f91e2b. The LLVM change this was intended for has since been cherry-picked to the current stable branch and dealt with differently on Swift main in https://github.com/swiftlang/swift/pull/81792. --- lib/ClangImporter/ClangImporter.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index cfcee4082834d..a4fa4f39943fe 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -27,7 +27,6 @@ #include "swift/AST/Decl.h" #include "swift/AST/DiagnosticEngine.h" #include "swift/AST/DiagnosticsClangImporter.h" -#include "swift/AST/DiagnosticsFrontend.h" #include "swift/AST/DiagnosticsSema.h" #include "swift/AST/Evaluator.h" #include "swift/AST/IRGenOptions.h" @@ -4236,19 +4235,8 @@ ClangImporter::getSwiftExplicitModuleDirectCC1Args() const { if (!Impl.SwiftContext.SearchPathOpts.ScannerPrefixMapper.empty()) { // Remap all the paths if requested. llvm::PrefixMapper Mapper; - SmallVector Prefixes; - if (auto E = llvm::MappedPrefix::transformJoined( - Impl.SwiftContext.SearchPathOpts.ScannerPrefixMapper, Prefixes)) { - // Take permanent ownership of this string. In general the diagnostic - // might outlive this function. - auto errorMessage = - Impl.SwiftContext.AllocateCopy(llvm::toString(std::move(E))); - Impl.SwiftContext.Diags.diagnose(SourceLoc(), diag::error_prefix_mapping, - errorMessage); - } - Mapper.addRange(Prefixes); - Mapper.sort(); - + clang::tooling::dependencies::DepscanPrefixMapping::configurePrefixMapper( + Impl.SwiftContext.SearchPathOpts.ScannerPrefixMapper, Mapper); clang::tooling::dependencies::DepscanPrefixMapping::remapInvocationPaths( instance, Mapper); instance.getFrontendOpts().PathPrefixMappings.clear(); From 1422bbd9c0d4119482035d4a1c6f91ec06fc82d2 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 9 Jul 2025 13:14:06 +0100 Subject: [PATCH 057/100] ClangImporter: Take ownership of `clang::TargetOptions` used for code generation Since https://github.com/llvm/llvm-project/pull/106271, `clang::TargetInfo` does not co-own target options, so there is no longer anything to keep them alive after we discard the throwaway Clang invocation they originate from. Make the importer take ownership of a copy of code generation target options to avoid a use after free. --- lib/ClangImporter/ClangImporter.cpp | 55 ++++++++++++++++++++--------- lib/ClangImporter/ImporterImpl.h | 26 +++++++------- 2 files changed, 51 insertions(+), 30 deletions(-) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index 8e43b21a10413..1a6a9779ad3a9 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -1427,22 +1427,12 @@ ClangImporter::create(ASTContext &ctx, importer.get(), importerOpts, VFS, *swiftTargetClangArgs); if (!swiftTargetClangInvocation) return nullptr; - auto targetInfo = clang::TargetInfo::CreateTargetInfo( - clangDiags, swiftTargetClangInvocation->getTargetOpts()); - // Ensure the target info has configured target-specific defines - std::string defineBuffer; - llvm::raw_string_ostream predefines(defineBuffer); - clang::MacroBuilder builder(predefines); - targetInfo->getTargetDefines(instance.getLangOpts(), builder); - importer->Impl.setSwiftTargetInfo(targetInfo); - importer->Impl.setSwiftCodeGenOptions(new clang::CodeGenOptions( - swiftTargetClangInvocation->getCodeGenOpts())); + + importer->Impl.configureOptionsForCodeGen(clangDiags, + swiftTargetClangInvocation.get()); } else { - // Just use the existing Invocation's directly - importer->Impl.setSwiftTargetInfo(clang::TargetInfo::CreateTargetInfo( - clangDiags, importer->Impl.Invocation->getTargetOpts())); - importer->Impl.setSwiftCodeGenOptions( - new clang::CodeGenOptions(importer->Impl.Invocation->getCodeGenOpts())); + // Set using the existing invocation. + importer->Impl.configureOptionsForCodeGen(clangDiags); } // Create the associated action. @@ -4132,7 +4122,7 @@ clang::TargetInfo &ClangImporter::getModuleAvailabilityTarget() const { } clang::TargetInfo &ClangImporter::getTargetInfo() const { - return *Impl.getSwiftTargetInfo(); + return Impl.getCodeGenTargetInfo(); } clang::ASTContext &ClangImporter::getClangASTContext() const { @@ -4165,7 +4155,7 @@ clang::Sema &ClangImporter::getClangSema() const { } clang::CodeGenOptions &ClangImporter::getCodeGenOpts() const { - return *Impl.getSwiftCodeGenOptions(); + return Impl.getCodeGenOptions(); } std::string ClangImporter::getClangModuleHash() const { @@ -4612,6 +4602,37 @@ void ClangImporter::Implementation::getMangledName( } } +void ClangImporter::Implementation::configureOptionsForCodeGen( + clang::DiagnosticsEngine &Diags, clang::CompilerInvocation *CI) { + clang::TargetInfo *targetInfo = nullptr; + if (CI) { + TargetOpts.reset(new clang::TargetOptions(std::move(CI->getTargetOpts()))); + CodeGenOpts.reset( + new clang::CodeGenOptions(std::move(CI->getCodeGenOpts()))); + targetInfo = clang::TargetInfo::CreateTargetInfo(Diags, *TargetOpts); + + // Ensure the target info has configured target-specific defines + std::string defineBuffer; + llvm::raw_string_ostream predefines(defineBuffer); + clang::MacroBuilder builder(predefines); + targetInfo->getTargetDefines(Instance->getLangOpts(), builder); + } else { + targetInfo = + clang::TargetInfo::CreateTargetInfo(Diags, Invocation->getTargetOpts()); + } + + CodeGenTargetInfo.reset(targetInfo); +} + +clang::CodeGenOptions & +ClangImporter::Implementation::getCodeGenOptions() const { + if (CodeGenOpts) { + return *CodeGenOpts.get(); + } + + return Invocation->getCodeGenOpts(); +} + // --------------------------------------------------------------------------- // Swift lookup tables // --------------------------------------------------------------------------- diff --git a/lib/ClangImporter/ImporterImpl.h b/lib/ClangImporter/ImporterImpl.h index a9645a9aff202..dded99b19ee8f 100644 --- a/lib/ClangImporter/ImporterImpl.h +++ b/lib/ClangImporter/ImporterImpl.h @@ -634,22 +634,22 @@ class LLVM_LIBRARY_VISIBILITY ClangImporter::Implementation /// corresponding to the instantiating Swift compilation's triple. These are /// to be used by all IRGen/CodeGen clients of `ClangImporter`. std::unique_ptr CodeGenTargetInfo; + /// - Important: Do not access directly. This field exists only to make sure + /// we own the target options stored in `CodeGenTargetInfo` because + /// `clang::TargetOptions` no longer co-owns them: + /// https://github.com/llvm/llvm-project/pull/106271. + std::unique_ptr TargetOpts; std::unique_ptr CodeGenOpts; -public: - void setSwiftTargetInfo(clang::TargetInfo *SwiftTargetInfo) { - CodeGenTargetInfo.reset(SwiftTargetInfo); - } - clang::TargetInfo *getSwiftTargetInfo() const { - return CodeGenTargetInfo.get(); - } + /// Sets the target & code generation options for use by IRGen/CodeGen + /// clients of `ClangImporter`. If `CI` is null, the data is drawn from the + /// importer's invocation. + void configureOptionsForCodeGen(clang::DiagnosticsEngine &Diags, + clang::CompilerInvocation *CI = nullptr); - void setSwiftCodeGenOptions(clang::CodeGenOptions *SwiftCodeGenOpts) { - CodeGenOpts.reset(SwiftCodeGenOpts); - } - clang::CodeGenOptions *getSwiftCodeGenOptions() const { - return CodeGenOpts.get(); - } + clang::TargetInfo &getCodeGenTargetInfo() const { return *CodeGenTargetInfo; } + + clang::CodeGenOptions &getCodeGenOptions() const; private: /// Generation number that is used for crude versioning. From 4ad7cb646a3dce3614c6cb1163e9e3572f69afc1 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 9 Jul 2025 22:58:51 +0100 Subject: [PATCH 058/100] [test] Fix test failure due to C attribute position The `stable/20250601` Clang apparently wants an attributed parameter to have a name, and that the attributes follow the name: ``` /Users/alatsis/Desktop/rebranch/swift/test/Interop/C/swiftify-import/Inputs/counted-by-lifetimebound.h:7:76: error: 'lifetimebound' attribute only applies to parameters and implicit object parameters int * __counted_by(len) simple(int len, int len2, int * __counted_by(len2) __lifetimebound p); ^ /Users/alatsis/Desktop/rebranch/swift/test/Interop/C/swiftify-import/Inputs/counted-by-lifetimebound.h:5:40: note: expanded from macro '__lifetimebound' ^ ``` Also humor the compiler here: ``` 3 | #define __counted_by(x) __attribute__((__counted_by__(x))) | `- note: expanded from macro '__counted_by' 4 | #define __counted_by_or_null(x) __attribute__((__counted_by_or_null__(x))) 5 | #define __lifetimebound __attribute__((lifetimebound)) : 22 | int * __counted_by(len) noncountedLifetime(int len, int * p __lifetimebound); 23 | 24 | int * __counted_by(13) _Nullable constant(int * _Nullable p __counted_by(13) __lifetimebound); | `- error: combining '__counted_by' with non-zero count (which cannot be null) and '_Nullable'; did you mean '__counted_by_or_null' instead? ``` --- .../Inputs/counted-by-lifetimebound.h | 19 ++++++++-------- .../Inputs/sized-by-lifetimebound.h | 22 +++++++++---------- .../sized-by-lifetimebound.swift | 10 ++++----- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/test/Interop/C/swiftify-import/Inputs/counted-by-lifetimebound.h b/test/Interop/C/swiftify-import/Inputs/counted-by-lifetimebound.h index 574bcccd0d57f..6a5bbf2ee5534 100644 --- a/test/Interop/C/swiftify-import/Inputs/counted-by-lifetimebound.h +++ b/test/Interop/C/swiftify-import/Inputs/counted-by-lifetimebound.h @@ -1,23 +1,24 @@ #pragma once #define __counted_by(x) __attribute__((__counted_by__(x))) +#define __counted_by_or_null(x) __attribute__((__counted_by_or_null__(x))) #define __lifetimebound __attribute__((lifetimebound)) -int * __counted_by(len) simple(int len, int len2, int * __counted_by(len2) __lifetimebound p); +int * __counted_by(len) simple(int len, int len2, int * p __counted_by(len2) __lifetimebound); -int * __counted_by(len) shared(int len, int * __counted_by(len) __lifetimebound p); +int * __counted_by(len) shared(int len, int * p __counted_by(len) __lifetimebound); -int * __counted_by(len - offset) complexExpr(int len, int offset, int len2, int * __counted_by(len2) __lifetimebound p); +int * __counted_by(len - offset) complexExpr(int len, int offset, int len2, int * p __counted_by(len2) __lifetimebound); -int * __counted_by(len) _Null_unspecified nullUnspecified(int len, int len2, int * __counted_by(len2) __lifetimebound _Null_unspecified p); +int * __counted_by(len) _Null_unspecified nullUnspecified(int len, int len2, int * _Null_unspecified p __counted_by(len2) __lifetimebound); -int * __counted_by(len) _Nonnull nonnull(int len, int len2, int * __counted_by(len2) __lifetimebound _Nonnull p); +int * __counted_by(len) _Nonnull nonnull(int len, int len2, int * _Nonnull p __counted_by(len2) __lifetimebound); -int * __counted_by(len) _Nullable nullable(int len, int len2, int * __counted_by(len2) __lifetimebound _Nullable p); +int * __counted_by(len) _Nullable nullable(int len, int len2, int * _Nullable p __counted_by(len2) __lifetimebound); typedef struct foo opaque_t; -opaque_t * __counted_by(len) opaque(int len, int len2, opaque_t * __counted_by(len2) __lifetimebound p); +opaque_t * __counted_by(len) opaque(int len, int len2, opaque_t * p __counted_by(len2) __lifetimebound); -int * __counted_by(len) noncountedLifetime(int len, int * __lifetimebound p); +int * __counted_by(len) noncountedLifetime(int len, int * p __lifetimebound); -int * __counted_by(13) _Nullable constant(int * __counted_by(13) __lifetimebound _Nullable p); +int * __counted_by(13) _Nullable constant(int * _Nullable p __counted_by_or_null(13) __lifetimebound); diff --git a/test/Interop/C/swiftify-import/Inputs/sized-by-lifetimebound.h b/test/Interop/C/swiftify-import/Inputs/sized-by-lifetimebound.h index e158071e9c954..e66f2fa1ee80c 100644 --- a/test/Interop/C/swiftify-import/Inputs/sized-by-lifetimebound.h +++ b/test/Interop/C/swiftify-import/Inputs/sized-by-lifetimebound.h @@ -7,25 +7,25 @@ #endif #define __lifetimebound __attribute__((lifetimebound)) -const void * __sized_by(len) simple(int len, int len2, const void * __sized_by(len2) __lifetimebound p); +const void * __sized_by(len) simple(int len, int len2, const void * p __sized_by(len2) __lifetimebound); -const void * __sized_by(len) shared(int len, const void * __sized_by(len) __lifetimebound p); +const void * __sized_by(len) shared(int len, const void * p __sized_by(len) __lifetimebound); -const void * __sized_by(len - offset) complexExpr(int len, int offset, int len2, const void * __sized_by(len2) __lifetimebound p); +const void * __sized_by(len - offset) complexExpr(int len, int offset, int len2, const void * p __sized_by(len2) __lifetimebound); -const void * __sized_by(len) _Null_unspecified nullUnspecified(int len, int len2, const void * __sized_by(len2) __lifetimebound _Null_unspecified p); +const void * __sized_by(len) _Null_unspecified nullUnspecified(int len, int len2, const void * _Null_unspecified p __sized_by(len2) __lifetimebound); -const void * __sized_by(len) _Nonnull nonnull(int len, int len2, const void * __sized_by(len2) __lifetimebound _Nonnull p); +const void * __sized_by(len) _Nonnull nonnull(int len, int len2, const void * _Nonnull p __sized_by(len2) __lifetimebound); -const void * __sized_by(len) _Nullable nullable(int len, int len2, const void * __sized_by(len2) __lifetimebound _Nullable p); +const void * __sized_by(len) _Nullable nullable(int len, int len2, const void * _Nullable p __sized_by(len2) __lifetimebound); typedef struct foo opaque_t; -opaque_t * __sized_by(len) opaque(int len, int len2, opaque_t * __sized_by(len2) __lifetimebound p); +opaque_t * __sized_by(len) opaque(int len, int len2, opaque_t * p __sized_by(len2) __lifetimebound); -const void * __sized_by(len) nonsizedLifetime(int len, const void * __lifetimebound p); +const void * __sized_by(len) nonsizedLifetime(int len, const void * p __lifetimebound); -uint8_t *__sized_by(size) bytesized(int size, const uint8_t *__sized_by(size) __lifetimebound); +uint8_t *__sized_by(size) bytesized(int size, const uint8_t * p __sized_by(size) __lifetimebound); -char *__sized_by(size) charsized(char *__sized_by(size) __lifetimebound, int size); +char *__sized_by(size) charsized(char * p __sized_by(size) __lifetimebound, int size); -const uint16_t *__sized_by(size) doublebytesized(uint16_t *__sized_by(size) __lifetimebound, int size); +const uint16_t *__sized_by(size) doublebytesized(uint16_t * p __sized_by(size) __lifetimebound, int size); diff --git a/test/Interop/C/swiftify-import/sized-by-lifetimebound.swift b/test/Interop/C/swiftify-import/sized-by-lifetimebound.swift index 27250d41af53b..83ae29fd82920 100644 --- a/test/Interop/C/swiftify-import/sized-by-lifetimebound.swift +++ b/test/Interop/C/swiftify-import/sized-by-lifetimebound.swift @@ -13,14 +13,14 @@ import SizedByLifetimeboundClang // CHECK: /// This is an auto-generated wrapper for safer interop // CHECK-NEXT: @available(visionOS 1.0, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) -// CHECK-NEXT: @_lifetime(copy _bytesized_param1) -// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func bytesized(_ _bytesized_param1: RawSpan) -> MutableRawSpan +// CHECK-NEXT: @_lifetime(copy p) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func bytesized(_ p: RawSpan) -> MutableRawSpan // CHECK-NEXT: /// This is an auto-generated wrapper for safer interop // CHECK-NEXT: @available(visionOS 1.0, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) -// CHECK-NEXT: @_lifetime(copy _charsized_param0) -// CHECK-NEXT: @_lifetime(_charsized_param0: copy _charsized_param0) -// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func charsized(_ _charsized_param0: inout MutableRawSpan) -> MutableRawSpan +// CHECK-NEXT: @_lifetime(copy p) +// CHECK-NEXT: @_lifetime(p: copy p) +// CHECK-NEXT: @_alwaysEmitIntoClient @_disfavoredOverload public func charsized(_ p: inout MutableRawSpan) -> MutableRawSpan // CHECK-NEXT: /// This is an auto-generated wrapper for safer interop // CHECK-NEXT: @available(visionOS 1.0, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) From c1d794364b85fab4356f24dcebbb3bd10315d5a5 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Fri, 18 Jul 2025 23:16:22 +0100 Subject: [PATCH 059/100] Adjust code after changes to `llvm::TrailingObjects` API See: - https://github.com/llvm/llvm-project/pull/138970 - https://github.com/llvm/llvm-project/pull/144930 --- include/swift/AST/Attr.h | 31 +++++------ .../swift/AST/AvailabilityContextStorage.h | 2 +- include/swift/AST/Decl.h | 26 ++++----- include/swift/AST/Expr.h | 31 ++++++----- include/swift/AST/GenericParamList.h | 8 +-- include/swift/AST/Identifier.h | 4 +- include/swift/AST/ImportCache.h | 13 ++--- include/swift/AST/LifetimeDependence.h | 4 +- include/swift/AST/ParameterList.h | 4 +- include/swift/AST/Pattern.h | 4 +- include/swift/AST/SILLayout.h | 6 +- include/swift/AST/Stmt.h | 21 ++++--- include/swift/AST/TypeRepr.h | 23 +++----- include/swift/AST/Types.h | 51 +++++++++-------- include/swift/Basic/EncodedSequence.h | 8 +-- include/swift/IDE/CodeCompletionString.h | 4 +- include/swift/Markup/AST.h | 55 +++++++++---------- include/swift/SIL/SILConstants.h | 2 +- include/swift/SIL/SILInstruction.h | 28 +++++----- include/swift/SIL/SILVTable.h | 6 +- .../swift/SILOptimizer/Utils/PartitionUtils.h | 2 +- include/swift/Sema/CSFix.h | 24 ++++---- include/swift/Sema/PreparedOverload.h | 6 +- lib/AST/ASTContext.cpp | 10 ++-- lib/AST/Attr.cpp | 17 +++--- lib/AST/Decl.cpp | 10 ++-- lib/AST/Expr.cpp | 2 +- lib/AST/GenericParamList.cpp | 5 +- lib/AST/ImportCache.cpp | 2 +- lib/AST/PackConformance.cpp | 5 +- lib/AST/Pattern.cpp | 2 +- lib/AST/RequirementMachine/Term.cpp | 8 +-- lib/AST/SILLayout.cpp | 2 +- lib/AST/Stmt.cpp | 5 +- lib/AST/Type.cpp | 4 +- lib/AST/TypeRepr.cpp | 4 +- lib/IDE/CodeCompletionString.cpp | 3 +- lib/IRGen/GenExistential.cpp | 5 +- lib/IRGen/GenRecord.h | 4 +- lib/IRGen/ProtocolInfo.h | 5 +- lib/Markup/AST.cpp | 27 ++++----- lib/SIL/IR/SILConstants.cpp | 21 ++++--- lib/SIL/IR/SILInstructions.cpp | 26 ++++----- lib/SIL/IR/SILVTable.cpp | 3 +- lib/Serialization/Deserialization.cpp | 5 +- 45 files changed, 244 insertions(+), 294 deletions(-) diff --git a/include/swift/AST/Attr.h b/include/swift/AST/Attr.h index 3d8ba605c490c..71d482f33511d 100644 --- a/include/swift/AST/Attr.h +++ b/include/swift/AST/Attr.h @@ -1098,7 +1098,7 @@ class ObjCAttr final : public DeclAttribute, unsigned length = 2; if (auto name = getName()) length += name->getNumSelectorPieces(); - return {getTrailingObjects(), length}; + return getTrailingObjects(length); } /// Retrieve the trailing location information. @@ -1107,7 +1107,7 @@ class ObjCAttr final : public DeclAttribute, unsigned length = 2; if (auto name = getName()) length += name->getNumSelectorPieces(); - return {getTrailingObjects(), length}; + return getTrailingObjects(length); } public: @@ -1283,14 +1283,14 @@ class DynamicReplacementAttr final MutableArrayRef getTrailingLocations() { assert(Bits.DynamicReplacementAttr.HasTrailingLocationInfo); unsigned length = 2; - return {getTrailingObjects(), length}; + return getTrailingObjects(length); } /// Retrieve the trailing location information. ArrayRef getTrailingLocations() const { assert(Bits.DynamicReplacementAttr.HasTrailingLocationInfo); unsigned length = 2; // lParens, rParens - return {getTrailingObjects(), length}; + return getTrailingObjects(length); } public: @@ -1480,8 +1480,7 @@ class SPIAccessControlAttr final : public DeclAttribute, /// Note: A single SPI name per attribute is currently supported but this /// may change with the syntax change. ArrayRef getSPIGroups() const { - return { this->template getTrailingObjects(), - numSPIGroups }; + return getTrailingObjects(numSPIGroups); } static bool classof(const DeclAttribute *DA) { @@ -2059,11 +2058,11 @@ class StorageRestrictionsAttr final unsigned getNumAccessesProperties() const { return NumAccesses; } ArrayRef getInitializesNames() const { - return {getTrailingObjects(), NumInitializes}; + return getTrailingObjects(NumInitializes); } ArrayRef getAccessesNames() const { - return {getTrailingObjects() + NumInitializes, NumAccesses}; + return {getTrailingObjects() + NumInitializes, NumAccesses}; } ArrayRef getInitializesProperties(AccessorDecl *attachedTo) const; @@ -2560,10 +2559,10 @@ class DifferentiableAttr final /// The parsed differentiability parameters, i.e. the list of parameters /// specified in 'wrt:'. ArrayRef getParsedParameters() const { - return {getTrailingObjects(), NumParsedParameters}; + return getTrailingObjects(NumParsedParameters); } MutableArrayRef getParsedParameters() { - return {getTrailingObjects(), NumParsedParameters}; + return getTrailingObjects(NumParsedParameters); } size_t numTrailingObjects(OverloadToken) const { return NumParsedParameters; @@ -2745,10 +2744,10 @@ class DerivativeAttr final /// The parsed differentiability parameters, i.e. the list of parameters /// specified in 'wrt:'. ArrayRef getParsedParameters() const { - return {getTrailingObjects(), NumParsedParameters}; + return getTrailingObjects(NumParsedParameters); } MutableArrayRef getParsedParameters() { - return {getTrailingObjects(), NumParsedParameters}; + return getTrailingObjects(NumParsedParameters); } size_t numTrailingObjects(OverloadToken) const { return NumParsedParameters; @@ -2836,10 +2835,10 @@ class TransposeAttr final /// The parsed linearity parameters, i.e. the list of parameters specified in /// 'wrt:'. ArrayRef getParsedParameters() const { - return {getTrailingObjects(), NumParsedParameters}; + return getTrailingObjects(NumParsedParameters); } MutableArrayRef getParsedParameters() { - return {getTrailingObjects(), NumParsedParameters}; + return getTrailingObjects(NumParsedParameters); } size_t numTrailingObjects(OverloadToken) const { return NumParsedParameters; @@ -3490,8 +3489,8 @@ class AllowFeatureSuppressionAttr final bool getInverted() const { return Bits.AllowFeatureSuppressionAttr.Inverted; } ArrayRef getSuppressedFeatures() const { - return {getTrailingObjects(), - static_cast(Bits.AllowFeatureSuppressionAttr.NumFeatures)}; + return getTrailingObjects( + static_cast(Bits.AllowFeatureSuppressionAttr.NumFeatures)); } static bool classof(const DeclAttribute *DA) { diff --git a/include/swift/AST/AvailabilityContextStorage.h b/include/swift/AST/AvailabilityContextStorage.h index a110d8ccdce1d..beae4a6df6ba1 100644 --- a/include/swift/AST/AvailabilityContextStorage.h +++ b/include/swift/AST/AvailabilityContextStorage.h @@ -82,7 +82,7 @@ class AvailabilityContext::Storage final const ASTContext &ctx); llvm::ArrayRef getDomainInfos() const { - return llvm::ArrayRef(getTrailingObjects(), domainInfoCount); + return getTrailingObjects(domainInfoCount); } llvm::SmallVector copyDomainInfos() const { diff --git a/include/swift/AST/Decl.h b/include/swift/AST/Decl.h index 7251b61f32f8f..c909d25306350 100644 --- a/include/swift/AST/Decl.h +++ b/include/swift/AST/Decl.h @@ -1739,8 +1739,8 @@ class ImportDecl final : public Decl, /// path will include 'Foo'. This return value is always owned by \c ImportDecl /// (which is owned by the AST context), so it can be persisted. ImportPath getImportPath() const { - return ImportPath({ getTrailingObjects(), - static_cast(Bits.ImportDecl.NumPathElements) }); + return ImportPath(getTrailingObjects( + static_cast(Bits.ImportDecl.NumPathElements))); } /// Retrieves the import path, replacing any module aliases with real names. @@ -2784,7 +2784,7 @@ class PatternBindingDecl final : public Decl, private: MutableArrayRef getMutablePatternList() { // Pattern entries are tail allocated. - return {getTrailingObjects(), getNumPatternEntries()}; + return getTrailingObjects(getNumPatternEntries()); } }; @@ -3623,10 +3623,7 @@ class OpaqueTypeDecl final : /// Retrieve the buffer containing the opaque return type /// representations that correspond to the opaque generic parameters. ArrayRef getOpaqueReturnTypeReprs() const { - return { - getTrailingObjects(), - getNumOpaqueReturnTypeReprs() - }; + return getTrailingObjects(getNumOpaqueReturnTypeReprs()); } /// Should the underlying type be visible to clients outside of the module? @@ -3694,13 +3691,12 @@ class OpaqueTypeDecl final : Substitutions(substitutions) { assert(!availabilityContext.empty()); std::uninitialized_copy(availabilityContext.begin(), - availabilityContext.end(), - getTrailingObjects()); + availabilityContext.end(), getTrailingObjects()); } public: ArrayRef getAvailability() const { - return {getTrailingObjects(), NumAvailabilityConditions}; + return getTrailingObjects(NumAvailabilityConditions); } SubstitutionMap getSubstitutions() const { return Substitutions; } @@ -5884,7 +5880,7 @@ class AbstractStorageDecl : public ValueDecl { inline AccessorDecl *getAccessor(AccessorKind kind) const; ArrayRef getAllAccessors() const { - return { getTrailingObjects(), NumAccessors }; + return getTrailingObjects(NumAccessors); } void addOpaqueAccessor(AccessorDecl *accessor); @@ -5893,7 +5889,7 @@ class AbstractStorageDecl : public ValueDecl { private: MutableArrayRef getAccessorsBuffer() { - return { getTrailingObjects(), NumAccessors }; + return getTrailingObjects(NumAccessors); } bool registerAccessor(AccessorDecl *accessor, AccessorIndex index); @@ -8735,7 +8731,7 @@ class EnumCaseDecl final : public Decl, { Bits.EnumCaseDecl.NumElements = Elements.size(); std::uninitialized_copy(Elements.begin(), Elements.end(), - getTrailingObjects()); + getTrailingObjects()); } SourceLoc getLocFromSource() const { return CaseLoc; } @@ -8746,8 +8742,8 @@ class EnumCaseDecl final : public Decl, /// Get the list of elements declared in this case. ArrayRef getElements() const { - return {getTrailingObjects(), - static_cast(Bits.EnumCaseDecl.NumElements)}; + return getTrailingObjects( + static_cast(Bits.EnumCaseDecl.NumElements)); } SourceRange getSourceRange() const; diff --git a/include/swift/AST/Expr.h b/include/swift/AST/Expr.h index b37d27de308ca..7d331fdc71a01 100644 --- a/include/swift/AST/Expr.h +++ b/include/swift/AST/Expr.h @@ -3292,8 +3292,7 @@ class DestructureTupleExpr final : public ImplicitConversionExpr, DstExpr(dstExpr) { Bits.DestructureTupleExpr.NumElements = destructuredElements.size(); std::uninitialized_copy(destructuredElements.begin(), - destructuredElements.end(), - getTrailingObjects()); + destructuredElements.end(), getTrailingObjects()); } public: @@ -3305,8 +3304,8 @@ class DestructureTupleExpr final : public ImplicitConversionExpr, Expr *srcExpr, Expr *dstExpr, Type ty); ArrayRef getDestructuredElements() const { - return {getTrailingObjects(), - static_cast(Bits.DestructureTupleExpr.NumElements)}; + return getTrailingObjects( + static_cast(Bits.DestructureTupleExpr.NumElements)); } Expr *getResultExpr() const { @@ -3726,7 +3725,7 @@ class UnresolvedSpecializeExpr final : public Expr, SubExpr(SubExpr), LAngleLoc(LAngleLoc), RAngleLoc(RAngleLoc) { Bits.UnresolvedSpecializeExpr.NumUnresolvedParams = UnresolvedParams.size(); std::uninitialized_copy(UnresolvedParams.begin(), UnresolvedParams.end(), - getTrailingObjects()); + getTrailingObjects()); } public: @@ -3740,8 +3739,8 @@ class UnresolvedSpecializeExpr final : public Expr, /// Retrieve the list of type parameters. These parameters have not yet /// been bound to archetypes of the entity to be specialized. ArrayRef getUnresolvedParams() const { - return {getTrailingObjects(), - static_cast(Bits.UnresolvedSpecializeExpr.NumUnresolvedParams)}; + return getTrailingObjects( + static_cast(Bits.UnresolvedSpecializeExpr.NumUnresolvedParams)); } SourceLoc getLoc() const { return LAngleLoc; } @@ -3998,7 +3997,7 @@ class SequenceExpr final : public Expr, Bits.SequenceExpr.NumElements = elements.size(); assert(Bits.SequenceExpr.NumElements > 0 && "zero-length sequence!"); std::uninitialized_copy(elements.begin(), elements.end(), - getTrailingObjects()); + getTrailingObjects()); } public: @@ -4014,11 +4013,13 @@ class SequenceExpr final : public Expr, unsigned getNumElements() const { return Bits.SequenceExpr.NumElements; } MutableArrayRef getElements() { - return {getTrailingObjects(), static_cast(Bits.SequenceExpr.NumElements)}; + return getTrailingObjects( + static_cast(Bits.SequenceExpr.NumElements)); } ArrayRef getElements() const { - return {getTrailingObjects(), static_cast(Bits.SequenceExpr.NumElements)}; + return getTrailingObjects( + static_cast(Bits.SequenceExpr.NumElements)); } Expr *getElement(unsigned i) const { @@ -4655,7 +4656,7 @@ class CaptureListExpr final : public Expr, assert(closureBody); Bits.CaptureListExpr.NumCaptures = captureList.size(); std::uninitialized_copy(captureList.begin(), captureList.end(), - getTrailingObjects()); + getTrailingObjects()); } public: @@ -4664,8 +4665,8 @@ class CaptureListExpr final : public Expr, AbstractClosureExpr *closureBody); ArrayRef getCaptureList() { - return {getTrailingObjects(), - static_cast(Bits.CaptureListExpr.NumCaptures)}; + return getTrailingObjects( + static_cast(Bits.CaptureListExpr.NumCaptures)); } AbstractClosureExpr *getClosureBody() { return closureBody; } const AbstractClosureExpr *getClosureBody() const { return closureBody; } @@ -6605,7 +6606,7 @@ class TypeJoinExpr final : public Expr, } MutableArrayRef getMutableElements() { - return { getTrailingObjects(), getNumElements() }; + return getTrailingObjects(getNumElements()); } TypeJoinExpr(llvm::PointerUnion result, @@ -6648,7 +6649,7 @@ class TypeJoinExpr final : public Expr, } ArrayRef getElements() const { - return { getTrailingObjects(), getNumElements() }; + return getTrailingObjects(getNumElements()); } Expr *getElement(unsigned i) const { diff --git a/include/swift/AST/GenericParamList.h b/include/swift/AST/GenericParamList.h index fc3ebe33941cf..3c29a0793a453 100644 --- a/include/swift/AST/GenericParamList.h +++ b/include/swift/AST/GenericParamList.h @@ -277,11 +277,11 @@ class GenericParamList final : SourceLoc RAngleLoc); MutableArrayRef getParams() { - return {getTrailingObjects(), NumParams}; + return getTrailingObjects(NumParams); } ArrayRef getParams() const { - return {getTrailingObjects(), NumParams}; + return getTrailingObjects(NumParams); } using iterator = GenericTypeParamDecl **; @@ -387,12 +387,12 @@ class alignas(RequirementRepr) TrailingWhereClause final : /// Retrieve the set of requirements. MutableArrayRef getRequirements() { - return {getTrailingObjects(), NumRequirements}; + return getTrailingObjects(NumRequirements); } /// Retrieve the set of requirements. ArrayRef getRequirements() const { - return {getTrailingObjects(), NumRequirements}; + return getTrailingObjects(NumRequirements); } /// Compute the source range containing this trailing where clause. diff --git a/include/swift/AST/Identifier.h b/include/swift/AST/Identifier.h index 0ac4fe542918b..ae9ce7ba2f133 100644 --- a/include/swift/AST/Identifier.h +++ b/include/swift/AST/Identifier.h @@ -518,10 +518,10 @@ class DeclName { : BaseName(BaseName), NumArgs(NumArgs) { } ArrayRef getArgumentNames() const { - return {getTrailingObjects(), NumArgs}; + return getTrailingObjects(NumArgs); } MutableArrayRef getArgumentNames() { - return {getTrailingObjects(), NumArgs}; + return getTrailingObjects(NumArgs); } /// Uniquing for the ASTContext. diff --git a/include/swift/AST/ImportCache.h b/include/swift/AST/ImportCache.h index 7c573d94b5ef8..8c9059f14d5fe 100644 --- a/include/swift/AST/ImportCache.h +++ b/include/swift/AST/ImportCache.h @@ -87,25 +87,20 @@ class ImportSet final : } ArrayRef getTopLevelImports() const { - return {getTrailingObjects(), - NumTopLevelImports}; + return getTrailingObjects(NumTopLevelImports); } ArrayRef getTransitiveImports() const { - return {getTrailingObjects() + - NumTopLevelImports, - NumTransitiveImports}; + return {getTrailingObjects() + NumTopLevelImports, NumTransitiveImports}; } ArrayRef getTransitiveSwiftOnlyImports() const { - return {getTrailingObjects() + - NumTopLevelImports + NumTransitiveImports, + return {getTrailingObjects() + NumTopLevelImports + NumTransitiveImports, NumTransitiveSwiftOnlyImports}; } ArrayRef getAllImports() const { - return {getTrailingObjects(), - NumTopLevelImports + NumTransitiveImports}; + return getTrailingObjects(NumTopLevelImports + NumTransitiveImports); } SWIFT_DEBUG_DUMP; diff --git a/include/swift/AST/LifetimeDependence.h b/include/swift/AST/LifetimeDependence.h index ada4f9d54b4c6..5692bec9dbf2f 100644 --- a/include/swift/AST/LifetimeDependence.h +++ b/include/swift/AST/LifetimeDependence.h @@ -170,7 +170,7 @@ class LifetimeEntry final : startLoc(startLoc), endLoc(endLoc), numSources(sources.size()), targetDescriptor(targetDescriptor) { std::uninitialized_copy(sources.begin(), sources.end(), - getTrailingObjects()); + getTrailingObjects()); } size_t numTrailingObjects(OverloadToken) const { @@ -189,7 +189,7 @@ class LifetimeEntry final SourceLoc getEndLoc() const { return endLoc; } ArrayRef getSources() const { - return {getTrailingObjects(), numSources}; + return getTrailingObjects(numSources); } std::optional getTargetDescriptor() const { diff --git a/include/swift/AST/ParameterList.h b/include/swift/AST/ParameterList.h index 344db0c3f045d..0ed8c758d5a6f 100644 --- a/include/swift/AST/ParameterList.h +++ b/include/swift/AST/ParameterList.h @@ -87,10 +87,10 @@ class alignas(ParamDecl *) ParameterList final : ParamDecl *back() const { return getArray().back(); } MutableArrayRef getArray() { - return {getTrailingObjects(), numParameters}; + return getTrailingObjects(numParameters); } ArrayRef getArray() const { - return {getTrailingObjects(), numParameters}; + return getTrailingObjects(numParameters); } size_t size() const { diff --git a/include/swift/AST/Pattern.h b/include/swift/AST/Pattern.h index 4d827607c85c9..29298d63528eb 100644 --- a/include/swift/AST/Pattern.h +++ b/include/swift/AST/Pattern.h @@ -349,10 +349,10 @@ class TuplePattern final : public Pattern, } MutableArrayRef getElements() { - return {getTrailingObjects(), getNumElements()}; + return getTrailingObjects(getNumElements()); } ArrayRef getElements() const { - return {getTrailingObjects(), getNumElements()}; + return getTrailingObjects(getNumElements()); } const TuplePatternElt &getElement(unsigned i) const {return getElements()[i];} diff --git a/include/swift/AST/SILLayout.h b/include/swift/AST/SILLayout.h index 1b5267bd7b33d..63c486e579263 100644 --- a/include/swift/AST/SILLayout.h +++ b/include/swift/AST/SILLayout.h @@ -141,10 +141,8 @@ class SILLayout final : public llvm::FoldingSetNode, } /// Get the fields inside the layout. - ArrayRef getFields() const { - return llvm::ArrayRef(getTrailingObjects(), NumFields); - } - + ArrayRef getFields() const { return getTrailingObjects(NumFields); } + /// Produce a profile of this layout, for use in a folding set. static void Profile(llvm::FoldingSetNodeID &id, CanGenericSignature Generics, diff --git a/include/swift/AST/Stmt.h b/include/swift/AST/Stmt.h index aca917c75e776..1437a04790cee 100644 --- a/include/swift/AST/Stmt.h +++ b/include/swift/AST/Stmt.h @@ -214,12 +214,12 @@ class BraceStmt final : public Stmt, /// The elements contained within the BraceStmt. MutableArrayRef getElements() { - return {getTrailingObjects(), static_cast(Bits.BraceStmt.NumElements)}; + return getTrailingObjects(static_cast(Bits.BraceStmt.NumElements)); } /// The elements contained within the BraceStmt (const version). ArrayRef getElements() const { - return {getTrailingObjects(), static_cast(Bits.BraceStmt.NumElements)}; + return getTrailingObjects(static_cast(Bits.BraceStmt.NumElements)); } ASTNode findAsyncNode(); @@ -332,10 +332,10 @@ class YieldStmt final SourceLoc getEndLoc() const; ArrayRef getYields() const { - return {getTrailingObjects(), static_cast(Bits.YieldStmt.NumYields)}; + return getTrailingObjects(static_cast(Bits.YieldStmt.NumYields)); } MutableArrayRef getMutableYields() { - return {getTrailingObjects(), static_cast(Bits.YieldStmt.NumYields)}; + return getTrailingObjects(static_cast(Bits.YieldStmt.NumYields)); } static bool classof(const Stmt *S) { return S->getKind() == StmtKind::Yield; } @@ -500,7 +500,7 @@ class alignas(8) PoundAvailableInfo final : Flags.isInvalid = false; Flags.isUnavailability = isUnavailability; std::uninitialized_copy(queries.begin(), queries.end(), - getTrailingObjects()); + getTrailingObjects()); } public: @@ -514,7 +514,7 @@ class alignas(8) PoundAvailableInfo final : void setInvalid() { Flags.isInvalid = true; } ArrayRef getQueries() const { - return llvm::ArrayRef(getTrailingObjects(), NumQueries); + return getTrailingObjects(NumQueries); } /// Returns an iterator for the statement's type-checked availability specs. @@ -1444,8 +1444,7 @@ class SwitchStmt final : public LabeledStmt, /// Get the list of case clauses. ArrayRef getCases() const { - return {getTrailingObjects(), - static_cast(Bits.SwitchStmt.CaseCount)}; + return getTrailingObjects(static_cast(Bits.SwitchStmt.CaseCount)); } /// Retrieve the complete set of branches for this switch statement. @@ -1485,7 +1484,7 @@ class DoCatchStmt final Body(body) { Bits.DoCatchStmt.NumCatches = catches.size(); std::uninitialized_copy(catches.begin(), catches.end(), - getTrailingObjects()); + getTrailingObjects()); for (auto *catchStmt : getCatches()) catchStmt->setParentStmt(this); } @@ -1519,10 +1518,10 @@ class DoCatchStmt final void setBody(Stmt *s) { Body = s; } ArrayRef getCatches() const { - return {getTrailingObjects(), static_cast(Bits.DoCatchStmt.NumCatches)}; + return getTrailingObjects(static_cast(Bits.DoCatchStmt.NumCatches)); } MutableArrayRef getMutableCatches() { - return {getTrailingObjects(), static_cast(Bits.DoCatchStmt.NumCatches)}; + return getTrailingObjects(static_cast(Bits.DoCatchStmt.NumCatches)); } /// Retrieve the complete set of branches for this do-catch statement. diff --git a/include/swift/AST/TypeRepr.h b/include/swift/AST/TypeRepr.h index c3b615be0171c..d11ab604ae4f1 100644 --- a/include/swift/AST/TypeRepr.h +++ b/include/swift/AST/TypeRepr.h @@ -272,9 +272,7 @@ class AttributedTypeRepr final : TypeRepr(TypeReprKind::Attributed), Ty(Ty) { assert(!attrs.empty()); Bits.AttributedTypeRepr.NumAttributes = attrs.size(); - std::uninitialized_copy(attrs.begin(), attrs.end(), - getTrailingObjects()); - + std::uninitialized_copy(attrs.begin(), attrs.end(), getTrailingObjects()); } friend TrailingObjects; @@ -285,8 +283,7 @@ class AttributedTypeRepr final TypeRepr *ty); ArrayRef getAttrs() const { - return llvm::ArrayRef(getTrailingObjects(), - Bits.AttributedTypeRepr.NumAttributes); + return getTrailingObjects(Bits.AttributedTypeRepr.NumAttributes); } TypeAttribute *get(TypeAttrKind kind) const; @@ -876,12 +873,10 @@ class PackTypeRepr final SourceRange getBracesRange() const { return BraceLocs; } MutableArrayRef getMutableElements() { - return llvm::MutableArrayRef(getTrailingObjects(), - Bits.PackTypeRepr.NumElements); + return getTrailingObjects(Bits.PackTypeRepr.NumElements); } ArrayRef getElements() const { - return llvm::ArrayRef(getTrailingObjects(), - Bits.PackTypeRepr.NumElements); + return getTrailingObjects(Bits.PackTypeRepr.NumElements); } static bool classof(const TypeRepr *T) { @@ -964,8 +959,8 @@ class TupleTypeRepr final : public TypeRepr, } ArrayRef getElements() const { - return { getTrailingObjects(), - static_cast(Bits.TupleTypeRepr.NumElements) }; + return getTrailingObjects( + static_cast(Bits.TupleTypeRepr.NumElements)); } void getElementTypes(SmallVectorImpl &Types) const { @@ -1046,13 +1041,13 @@ class CompositionTypeRepr final : public TypeRepr, : TypeRepr(TypeReprKind::Composition), FirstTypeLoc(FirstTypeLoc), CompositionRange(CompositionRange) { Bits.CompositionTypeRepr.NumTypes = Types.size(); - std::uninitialized_copy(Types.begin(), Types.end(), - getTrailingObjects()); + std::uninitialized_copy(Types.begin(), Types.end(), getTrailingObjects()); } public: ArrayRef getTypes() const { - return {getTrailingObjects(), static_cast(Bits.CompositionTypeRepr.NumTypes)}; + return getTrailingObjects( + static_cast(Bits.CompositionTypeRepr.NumTypes)); } SourceLoc getSourceLoc() const { return FirstTypeLoc; } SourceRange getCompositionRange() const { return CompositionRange; } diff --git a/include/swift/AST/Types.h b/include/swift/AST/Types.h index 2c5128b961961..9e720c3bcf65b 100644 --- a/include/swift/AST/Types.h +++ b/include/swift/AST/Types.h @@ -2332,8 +2332,7 @@ class TypeAliasType final /// Retrieve the parent of this type as written, e.g., the part that was /// written before ".", if provided. Type getParent() const { - return Bits.TypeAliasType.HasParent ? *getTrailingObjects() - : Type(); + return Bits.TypeAliasType.HasParent ? *getTrailingObjects() : Type(); } /// Retrieve the substitution map applied to the declaration's underlying @@ -2344,10 +2343,9 @@ class TypeAliasType final /// arguments that are directly applied to the typealias declaration /// this type references. ArrayRef getDirectGenericArgs() const { - return ArrayRef( - getTrailingObjects() + - (Bits.TypeAliasType.HasParent ? 1 : 0), - Bits.TypeAliasType.GenericArgCount); + return ArrayRef(getTrailingObjects() + + (Bits.TypeAliasType.HasParent ? 1 : 0), + Bits.TypeAliasType.GenericArgCount); } SmallVector getExpandedGenericArgs(); @@ -2738,16 +2736,16 @@ class TupleType final : public TypeBase, public llvm::FoldingSetNode, /// getElements - Return the elements of this tuple. ArrayRef getElements() const { - return {getTrailingObjects(), getNumElements()}; + return getTrailingObjects(getNumElements()); } const TupleTypeElt &getElement(unsigned i) const { - return getTrailingObjects()[i]; + return getTrailingObjects()[i]; } /// getElementType - Return the type of the specified element. Type getElementType(unsigned ElementNo) const { - return getTrailingObjects()[ElementNo].getType(); + return getTrailingObjects()[ElementNo].getType(); } TupleEltTypeArrayRef getElementTypes() const { @@ -2777,7 +2775,7 @@ class TupleType final : public TypeBase, public llvm::FoldingSetNode, : TypeBase(TypeKind::Tuple, CanCtx, properties) { Bits.TupleType.Count = elements.size(); std::uninitialized_copy(elements.begin(), elements.end(), - getTrailingObjects()); + getTrailingObjects()); } }; BEGIN_CAN_TYPE_WRAPPER(TupleType, Type) @@ -6191,7 +6189,7 @@ class SILPackType final : public TypeBase, public llvm::FoldingSetNode, : TypeBase(TypeKind::SILPack, &ctx, properties) { Bits.SILPackType.Count = elements.size(); Bits.SILPackType.ElementIsAddress = info.ElementIsAddress; - memcpy(getTrailingObjects(), elements.data(), + memcpy(getTrailingObjects(), elements.data(), elements.size() * sizeof(CanType)); } @@ -6213,13 +6211,13 @@ class SILPackType final : public TypeBase, public llvm::FoldingSetNode, /// Retrieves the type of the elements in the pack. ArrayRef getElementTypes() const { - return {getTrailingObjects(), getNumElements()}; + return getTrailingObjects(getNumElements()); } /// Returns the type of the element at the given \p index. /// This is a lowered SIL type. CanType getElementType(unsigned index) const { - return getTrailingObjects()[index]; + return getTrailingObjects()[index]; } SILType getSILElementType(unsigned index) const; // in SILType.h @@ -6514,7 +6512,8 @@ class ProtocolCompositionType final : public TypeBase, /// a protocol composition type; you also have to look at /// hasExplicitAnyObject(). ArrayRef getMembers() const { - return {getTrailingObjects(), static_cast(Bits.ProtocolCompositionType.Count)}; + return getTrailingObjects( + static_cast(Bits.ProtocolCompositionType.Count)); } InvertibleProtocolSet getInverses() const { return Inverses; } @@ -6562,7 +6561,7 @@ class ProtocolCompositionType final : public TypeBase, Bits.ProtocolCompositionType.HasExplicitAnyObject = hasExplicitAnyObject; Bits.ProtocolCompositionType.Count = members.size(); std::uninitialized_copy(members.begin(), members.end(), - getTrailingObjects()); + getTrailingObjects()); } }; BEGIN_CAN_TYPE_WRAPPER(ProtocolCompositionType, Type) @@ -6611,8 +6610,8 @@ class ParameterizedProtocolType final : public TypeBase, } ArrayRef getArgs() const { - return {getTrailingObjects(), - static_cast(Bits.ParameterizedProtocolType.ArgCount)}; + return getTrailingObjects( + static_cast(Bits.ParameterizedProtocolType.ArgCount)); } bool requiresClass() const { @@ -7703,8 +7702,7 @@ class ErrorUnionType final RecursiveTypeProperties properties) : TypeBase(TypeKind::ErrorUnion, /*Context=*/ctx, properties) { Bits.ErrorUnionType.NumTerms = terms.size(); - std::uninitialized_copy(terms.begin(), terms.end(), - getTrailingObjects()); + std::uninitialized_copy(terms.begin(), terms.end(), getTrailingObjects()); } public: @@ -7712,7 +7710,8 @@ class ErrorUnionType final static Type get(const ASTContext &ctx, ArrayRef terms); ArrayRef getTerms() const { - return { getTrailingObjects(), static_cast(Bits.ErrorUnionType.NumTerms) }; + return getTrailingObjects( + static_cast(Bits.ErrorUnionType.NumTerms)); }; // Support for FoldingSet. @@ -7804,12 +7803,12 @@ class PackType final : public TypeBase, public llvm::FoldingSetNode, /// Retrieves the type of the elements in the pack. ArrayRef getElementTypes() const { - return {getTrailingObjects(), getNumElements()}; + return getTrailingObjects(getNumElements()); } /// Returns the type of the element at the given \p index. Type getElementType(unsigned index) const { - return getTrailingObjects()[index]; + return getTrailingObjects()[index]; } bool containsPackExpansionType() const; @@ -7835,7 +7834,7 @@ class PackType final : public TypeBase, public llvm::FoldingSetNode, : TypeBase(TypeKind::Pack, CanCtx, properties) { Bits.PackType.Count = elements.size(); std::uninitialized_copy(elements.begin(), elements.end(), - getTrailingObjects()); + getTrailingObjects()); } }; BEGIN_CAN_TYPE_WRAPPER(PackType, Type) @@ -8323,11 +8322,11 @@ inline ParameterTypeFlags ParameterTypeFlags::fromParameterType( inline const Type *BoundGenericType::getTrailingObjectsPointer() const { if (auto ty = dyn_cast(this)) - return ty->getTrailingObjects(); + return ty->getTrailingObjects(); if (auto ty = dyn_cast(this)) - return ty->getTrailingObjects(); + return ty->getTrailingObjects(); if (auto ty = dyn_cast(this)) - return ty->getTrailingObjects(); + return ty->getTrailingObjects(); llvm_unreachable("Unhandled BoundGenericType!"); } diff --git a/include/swift/Basic/EncodedSequence.h b/include/swift/Basic/EncodedSequence.h index 8b041731d5de3..81b5bc5ad32ec 100644 --- a/include/swift/Basic/EncodedSequence.h +++ b/include/swift/Basic/EncodedSequence.h @@ -102,14 +102,12 @@ class EncodedSequenceBase { } MutableArrayRef chunkStorage() { - return {getTrailingObjects(), Capacity}; + return getTrailingObjects(Capacity); } ArrayRef chunkStorage() const { - return {getTrailingObjects(), Capacity}; - } - ArrayRef chunks() const { - return {getTrailingObjects(), Size}; + return getTrailingObjects(Capacity); } + ArrayRef chunks() const { return getTrailingObjects(Size); } }; OutOfLineStorage *getOutOfLineStorage() { assert(hasOutOfLineStorage()); diff --git a/include/swift/IDE/CodeCompletionString.h b/include/swift/IDE/CodeCompletionString.h index bfb9e4fa08762..8645123f7c6b6 100644 --- a/include/swift/IDE/CodeCompletionString.h +++ b/include/swift/IDE/CodeCompletionString.h @@ -348,9 +348,7 @@ class alignas(detail::CodeCompletionStringChunk) CodeCompletionString final static CodeCompletionString *create(llvm::BumpPtrAllocator &Allocator, ArrayRef Chunks); - ArrayRef getChunks() const { - return {getTrailingObjects(), NumChunks}; - } + ArrayRef getChunks() const { return getTrailingObjects(NumChunks); } StringRef getFirstTextChunk(bool includeLeadingPunctuation = false) const; std::optional diff --git a/include/swift/Markup/AST.h b/include/swift/Markup/AST.h index c48e8fa624989..d1cfbb813053c 100644 --- a/include/swift/Markup/AST.h +++ b/include/swift/Markup/AST.h @@ -112,11 +112,11 @@ class Document final : public MarkupASTNode, ArrayRef Children); ArrayRef getChildren() { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } ArrayRef getChildren() const { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } static bool classof(const MarkupASTNode *N) { @@ -136,11 +136,11 @@ class BlockQuote final : public MarkupASTNode, static BlockQuote *create(MarkupContext &MC, ArrayRef Children); ArrayRef getChildren() { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } ArrayRef getChildren() const { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } static bool classof(const MarkupASTNode *N) { @@ -162,17 +162,16 @@ class List final : public MarkupASTNode, bool IsOrdered); ArrayRef getChildren() { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } ArrayRef getChildren() const { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } void setChildren(ArrayRef NewChildren) { assert(NewChildren.size() <= NumChildren); - std::copy(NewChildren.begin(), NewChildren.end(), - getTrailingObjects()); + std::copy(NewChildren.begin(), NewChildren.end(), getTrailingObjects()); NumChildren = NewChildren.size(); } @@ -197,11 +196,11 @@ class Item final : public MarkupASTNode, static Item *create(MarkupContext &MC, ArrayRef Children); ArrayRef getChildren() { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } ArrayRef getChildren() const { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } static bool classof(const MarkupASTNode *N) { @@ -265,11 +264,11 @@ class Paragraph final : public MarkupASTNode, ArrayRef Children); ArrayRef getChildren() { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } ArrayRef getChildren() const { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } static bool classof(const MarkupASTNode *N) { @@ -291,11 +290,11 @@ class Header final : public MarkupASTNode, ArrayRef Children); ArrayRef getChildren() { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } ArrayRef getChildren() const { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } unsigned getLevel() const { @@ -482,11 +481,11 @@ class Emphasis final : public InlineContent, ArrayRef Children); ArrayRef getChildren() { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } ArrayRef getChildren() const { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } static bool classof(const MarkupASTNode *N) { @@ -506,11 +505,11 @@ class Strong final : public InlineContent, ArrayRef Children); ArrayRef getChildren() { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } ArrayRef getChildren() const { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } static bool classof(const MarkupASTNode *N) { @@ -536,11 +535,11 @@ class Link final : public InlineContent, StringRef getDestination() const { return Destination; } ArrayRef getChildren() { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } ArrayRef getChildren() const { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } static bool classof(const MarkupASTNode *N) { @@ -577,11 +576,11 @@ class Image final : public InlineContent, } ArrayRef getChildren() { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } ArrayRef getChildren() const { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } static bool classof(const MarkupASTNode *N) { @@ -607,11 +606,11 @@ class InlineAttributes final : public InlineContent, private llvm::TrailingObjec StringRef getAttributes() const { return Attributes; } ArrayRef getChildren() { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } ArrayRef getChildren() const { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } static bool classof(const MarkupASTNode *N) { @@ -678,11 +677,11 @@ class ParamField final : public PrivateExtension, } ArrayRef getChildren() { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } ArrayRef getChildren() const { - return {getTrailingObjects(), NumChildren}; + return getTrailingObjects(NumChildren); } static bool classof(const MarkupASTNode *N) { @@ -703,11 +702,11 @@ public: \ static Id *create(MarkupContext &MC, ArrayRef Children); \ \ ArrayRef getChildren() { \ - return {getTrailingObjects(), NumChildren}; \ + return getTrailingObjects(NumChildren); \ } \ \ ArrayRef getChildren() const { \ - return {getTrailingObjects(), NumChildren}; \ + return getTrailingObjects(NumChildren); \ } \ \ static bool classof(const MarkupASTNode *N) { \ diff --git a/include/swift/SIL/SILConstants.h b/include/swift/SIL/SILConstants.h index 9c829ac42322a..51cc6e3b495e9 100644 --- a/include/swift/SIL/SILConstants.h +++ b/include/swift/SIL/SILConstants.h @@ -737,7 +737,7 @@ struct SymbolicClosure final SymbolicValueAllocator &allocator); ArrayRef getCaptures() const { - return {getTrailingObjects(), numCaptures}; + return getTrailingObjects(numCaptures); } // This is used by the llvm::TrailingObjects base class. diff --git a/include/swift/SIL/SILInstruction.h b/include/swift/SIL/SILInstruction.h index 5cc1b87bf63c7..31316cd283214 100644 --- a/include/swift/SIL/SILInstruction.h +++ b/include/swift/SIL/SILInstruction.h @@ -1725,7 +1725,7 @@ class InstructionBaseWithTrailingOperands // Destruct tail allocated objects. ~InstructionBaseWithTrailingOperands() { - Operand *Operands = TrailingObjects::template getTrailingObjects(); + Operand *Operands = this->template getTrailingObjectsNonStrict(); auto end = sharedUInt32().InstructionBaseWithTrailingOperands.numOperands; for (unsigned i = 0; i < end; ++i) { Operands[i].~Operand(); @@ -1738,13 +1738,13 @@ class InstructionBaseWithTrailingOperands } ArrayRef getAllOperands() const { - return {TrailingObjects::template getTrailingObjects(), - sharedUInt32().InstructionBaseWithTrailingOperands.numOperands}; + return this->template getTrailingObjectsNonStrict( + sharedUInt32().InstructionBaseWithTrailingOperands.numOperands); } MutableArrayRef getAllOperands() { - return {TrailingObjects::template getTrailingObjects(), - sharedUInt32().InstructionBaseWithTrailingOperands.numOperands}; + return this->template getTrailingObjectsNonStrict( + sharedUInt32().InstructionBaseWithTrailingOperands.numOperands); } }; @@ -2827,13 +2827,13 @@ class ApplyInstBase : public Base { /// - the formal arguments /// - the type-dependency arguments MutableArrayRef getAllOperands() { - return { asImpl().template getTrailingObjects(), - getNumAllOperands() }; + return asImpl().template getTrailingObjectsNonStrict( + getNumAllOperands()); } ArrayRef getAllOperands() const { - return { asImpl().template getTrailingObjects(), - getNumAllOperands() }; + return asImpl().template getTrailingObjectsNonStrict( + getNumAllOperands()); } /// Check whether the given operand index is a call-argument index @@ -4317,7 +4317,7 @@ class IncrementProfilerCounterInst final /// The PGO function name for the function in which the counter resides. StringRef getPGOFuncName() const { - return StringRef(getTrailingObjects(), PGOFuncNameLength); + return StringRef(getTrailingObjects(), PGOFuncNameLength); } /// The total number of counters within the function. @@ -4539,7 +4539,7 @@ class StringLiteralInst final public: /// getValue - Return the string data for the literal, in UTF-8. StringRef getValue() const { - return {getTrailingObjects(), sharedUInt32().StringLiteralInst.length}; + return {getTrailingObjects(), sharedUInt32().StringLiteralInst.length}; } /// getEncoding - Return the desired encoding of the text. @@ -5633,7 +5633,7 @@ class SpecifyTestInst final void setValueForName(StringRef name, SILValue value) { values[name] = value; } llvm::StringMap const &getValues() { return values; } StringRef getArgumentsSpecification() const { - return StringRef(getTrailingObjects(), ArgumentsSpecificationLength); + return StringRef(getTrailingObjects(), ArgumentsSpecificationLength); } ArrayRef getAllOperands() const { return {}; } @@ -9896,9 +9896,7 @@ class CondFailInst final StringRef Message, SILModule &M); public: - StringRef getMessage() const { - return {getTrailingObjects(), MessageSize}; - } + StringRef getMessage() const { return {getTrailingObjects(), MessageSize}; } }; //===----------------------------------------------------------------------===// diff --git a/include/swift/SIL/SILVTable.h b/include/swift/SIL/SILVTable.h index 0285c87e332c0..21ad8294bbc77 100644 --- a/include/swift/SIL/SILVTable.h +++ b/include/swift/SIL/SILVTable.h @@ -173,15 +173,13 @@ class SILVTable final : public SILAllocated, } /// Return all of the method entries. - ArrayRef getEntries() const { - return {getTrailingObjects(), NumEntries}; - } + ArrayRef getEntries() const { return getTrailingObjects(NumEntries); } /// Return all of the method entries mutably. /// If you do modify entries, make sure to invoke `updateVTableCache` to update the /// SILModule's cache entry. MutableArrayRef getMutableEntries() { - return {getTrailingObjects(), NumEntries}; + return getTrailingObjects(NumEntries); } void updateVTableCache(const Entry &entry); diff --git a/include/swift/SILOptimizer/Utils/PartitionUtils.h b/include/swift/SILOptimizer/Utils/PartitionUtils.h index 6414e74285f7a..4596e02ba84a7 100644 --- a/include/swift/SILOptimizer/Utils/PartitionUtils.h +++ b/include/swift/SILOptimizer/Utils/PartitionUtils.h @@ -282,7 +282,7 @@ class IsolationHistory::Node final /// Access the tail allocated buffer of additional element arguments. MutableArrayRef getAdditionalElementArgs() { - return {getTrailingObjects(), numAdditionalElements}; + return getTrailingObjects(numAdditionalElements); } Node(Kind kind, Node *parent) diff --git a/include/swift/Sema/CSFix.h b/include/swift/Sema/CSFix.h index cc53faa9ab1f2..bcd80b0d58cf4 100644 --- a/include/swift/Sema/CSFix.h +++ b/include/swift/Sema/CSFix.h @@ -660,7 +660,7 @@ class RelabelArguments final std::string getName() const override { return "re-label argument(s)"; } ArrayRef getLabels() const { - return {getTrailingObjects(), NumLabels}; + return getTrailingObjects(NumLabels); } bool diagnose(const Solution &solution, bool asNote = false) const override; @@ -677,7 +677,7 @@ class RelabelArguments final private: MutableArrayRef getLabelsBuffer() { - return {getTrailingObjects(), NumLabels}; + return getTrailingObjects(NumLabels); } }; @@ -1198,7 +1198,7 @@ class GenericArgumentsMismatch final } ArrayRef getMismatches() const { - return {getTrailingObjects(), NumMismatches}; + return getTrailingObjects(NumMismatches); } bool coalesceAndDiagnose(const Solution &solution, @@ -1221,7 +1221,7 @@ class GenericArgumentsMismatch final bool asNote = false) const; MutableArrayRef getMismatchesBuf() { - return {getTrailingObjects(), NumMismatches}; + return getTrailingObjects(NumMismatches); } }; @@ -1791,7 +1791,7 @@ class AddMissingArguments final std::string getName() const override { return "synthesize missing argument(s)"; } ArrayRef getSynthesizedArguments() const { - return {getTrailingObjects(), NumSynthesized}; + return getTrailingObjects(NumSynthesized); } bool diagnose(const Solution &solution, bool asNote = false) const override; @@ -1810,7 +1810,7 @@ class AddMissingArguments final private: MutableArrayRef getSynthesizedArgumentsBuf() { - return {getTrailingObjects(), NumSynthesized}; + return getTrailingObjects(NumSynthesized); } }; @@ -1839,7 +1839,7 @@ class RemoveExtraneousArguments final std::string getName() const override { return "remove extraneous argument(s)"; } ArrayRef getExtraArguments() const { - return {getTrailingObjects(), NumExtraneous}; + return getTrailingObjects(NumExtraneous); } bool diagnose(const Solution &solution, bool asNote = false) const override; @@ -1867,7 +1867,7 @@ class RemoveExtraneousArguments final private: MutableArrayRef getExtraArgumentsBuf() { - return {getTrailingObjects(), NumExtraneous}; + return getTrailingObjects(NumExtraneous); } }; @@ -2267,7 +2267,7 @@ class CollectionElementContextualMismatch final } ArrayRef getElements() const { - return {getTrailingObjects(), NumElements}; + return getTrailingObjects(NumElements); } bool diagnose(const Solution &solution, bool asNote = false) const override; @@ -2282,7 +2282,7 @@ class CollectionElementContextualMismatch final private: MutableArrayRef getElementBuffer() { - return {getTrailingObjects(), NumElements}; + return getTrailingObjects(NumElements); } }; @@ -3521,14 +3521,14 @@ class RenameConflictingPatternVariables final } MutableArrayRef getConflictingBuffer() { - return {getTrailingObjects(), NumConflicts}; + return getTrailingObjects(NumConflicts); } public: std::string getName() const override { return "rename pattern variables"; } ArrayRef getConflictingVars() const { - return {getTrailingObjects(), NumConflicts}; + return getTrailingObjects(NumConflicts); } bool diagnose(const Solution &solution, bool asNote = false) const override; diff --git a/include/swift/Sema/PreparedOverload.h b/include/swift/Sema/PreparedOverload.h index a3253fbc351c9..83956a902cad1 100644 --- a/include/swift/Sema/PreparedOverload.h +++ b/include/swift/Sema/PreparedOverload.h @@ -155,7 +155,7 @@ class PreparedOverload final : PreparedOverload(const DeclReferenceType &declType, ArrayRef changes) : Count(changes.size()), DeclType(declType) { std::uninitialized_copy(changes.begin(), changes.end(), - getTrailingObjects()); + getTrailingObjects()); } Type getOpenedType() const { @@ -178,9 +178,7 @@ class PreparedOverload final : return DeclType.thrownErrorTypeOnAccess; } - ArrayRef getChanges() const { - return ArrayRef(getTrailingObjects(), Count); - } + ArrayRef getChanges() const { return getTrailingObjects(Count); } }; struct PreparedOverloadBuilder { diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 9bcd931dabf01..5135a6fcc64a7 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -3453,7 +3453,7 @@ TypeAliasType::TypeAliasType(TypeAliasDecl *typealias, Type parent, // Record the parent (or absence of a parent). if (parent) { Bits.TypeAliasType.HasParent = true; - *getTrailingObjects() = parent; + *getTrailingObjects() = parent; } else { Bits.TypeAliasType.HasParent = false; } @@ -3466,8 +3466,7 @@ TypeAliasType::TypeAliasType(TypeAliasDecl *typealias, Type parent, ASSERT(params->size() == count); Bits.TypeAliasType.GenericArgCount = count; std::uninitialized_copy(genericArgs.begin(), genericArgs.end(), - getTrailingObjects() + - (parent ? 1 : 0)); + getTrailingObjects() + (parent ? 1 : 0)); } else { ASSERT(params == nullptr); Bits.TypeAliasType.GenericArgCount = 0; @@ -5895,9 +5894,8 @@ const AvailabilityContext::Storage *AvailabilityContext::Storage::get( ctx.Allocate(storageToAlloc, alignof(AvailabilityContext::Storage)); auto *newNode = ::new (mem) AvailabilityContext::Storage( platformRange, isDeprecated, domainInfos.size()); - std::uninitialized_copy( - domainInfos.begin(), domainInfos.end(), - newNode->getTrailingObjects()); + std::uninitialized_copy(domainInfos.begin(), domainInfos.end(), + newNode->getTrailingObjects()); foldingSet.InsertNode(newNode, insertPos); return newNode; diff --git a/lib/AST/Attr.cpp b/lib/AST/Attr.cpp index f1cb089d72b92..65aed9f03646c 100644 --- a/lib/AST/Attr.cpp +++ b/lib/AST/Attr.cpp @@ -2715,7 +2715,7 @@ SPIAccessControlAttr::SPIAccessControlAttr(SourceLoc atLoc, SourceRange range, /*Implicit=*/false), numSPIGroups(spiGroups.size()) { std::uninitialized_copy(spiGroups.begin(), spiGroups.end(), - getTrailingObjects()); + getTrailingObjects()); } SPIAccessControlAttr * @@ -2753,8 +2753,7 @@ DifferentiableAttr::DifferentiableAttr(bool implicit, SourceLoc atLoc, assert((diffKind != DifferentiabilityKind::Normal && diffKind != DifferentiabilityKind::Forward) && "'Normal' and 'Forward' are not supported"); - std::copy(params.begin(), params.end(), - getTrailingObjects()); + std::copy(params.begin(), params.end(), getTrailingObjects()); } DifferentiableAttr::DifferentiableAttr(Decl *original, bool implicit, @@ -2856,8 +2855,7 @@ DerivativeAttr::DerivativeAttr(bool implicit, SourceLoc atLoc, : DeclAttribute(DeclAttrKind::Derivative, atLoc, baseRange, implicit), BaseTypeRepr(baseTypeRepr), OriginalFunctionName(std::move(originalName)), NumParsedParameters(params.size()) { - std::copy(params.begin(), params.end(), - getTrailingObjects()); + std::copy(params.begin(), params.end(), getTrailingObjects()); } DerivativeAttr::DerivativeAttr(bool implicit, SourceLoc atLoc, @@ -2923,8 +2921,7 @@ TransposeAttr::TransposeAttr(bool implicit, SourceLoc atLoc, : DeclAttribute(DeclAttrKind::Transpose, atLoc, baseRange, implicit), BaseTypeRepr(baseTypeRepr), OriginalFunctionName(std::move(originalName)), NumParsedParameters(params.size()) { - std::uninitialized_copy(params.begin(), params.end(), - getTrailingObjects()); + std::uninitialized_copy(params.begin(), params.end(), getTrailingObjects()); } TransposeAttr::TransposeAttr(bool implicit, SourceLoc atLoc, @@ -2962,9 +2959,9 @@ StorageRestrictionsAttr::StorageRestrictionsAttr( : DeclAttribute(DeclAttrKind::StorageRestrictions, AtLoc, Range, Implicit), NumInitializes(initializes.size()), NumAccesses(accesses.size()) { std::uninitialized_copy(initializes.begin(), initializes.end(), - getTrailingObjects()); + getTrailingObjects()); std::uninitialized_copy(accesses.begin(), accesses.end(), - getTrailingObjects() + NumInitializes); + getTrailingObjects() + NumInitializes); } StorageRestrictionsAttr * @@ -3224,7 +3221,7 @@ AllowFeatureSuppressionAttr::AllowFeatureSuppressionAttr( Bits.AllowFeatureSuppressionAttr.Inverted = inverted; Bits.AllowFeatureSuppressionAttr.NumFeatures = features.size(); std::uninitialized_copy(features.begin(), features.end(), - getTrailingObjects()); + getTrailingObjects()); } AllowFeatureSuppressionAttr *AllowFeatureSuppressionAttr::create( diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 16fddbd916901..cd3b9a144699e 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -1709,8 +1709,7 @@ ImportDecl::ImportDecl(DeclContext *DC, SourceLoc ImportLoc, ImportKind K, assert(Bits.ImportDecl.NumPathElements == Path.size() && "Truncation error"); Bits.ImportDecl.ImportKind = static_cast(K); assert(getImportKind() == K && "not enough bits for ImportKind"); - std::uninitialized_copy(Path.begin(), Path.end(), - getTrailingObjects()); + std::uninitialized_copy(Path.begin(), Path.end(), getTrailingObjects()); } ImportKind ImportDecl::getBestImportKind(const ValueDecl *VD) { @@ -2324,7 +2323,7 @@ PatternBindingDecl::create(ASTContext &Ctx, SourceLoc StaticLoc, PatternList.size(), Parent); // Set up the patterns. std::uninitialized_copy(PatternList.begin(), PatternList.end(), - PBD->getTrailingObjects()); + PBD->getTrailingObjects()); for (auto idx : range(PBD->getNumPatternEntries())) { auto *initContext = PBD->getInitContext(idx); @@ -10754,9 +10753,8 @@ OpaqueTypeDecl::OpaqueTypeDecl(ValueDecl *NamingDecl, assert(OpaqueReturnTypeReprs.empty() || OpaqueReturnTypeReprs.size() == OpaqueInterfaceGenericSignature.getInnermostGenericParams().size()); - std::uninitialized_copy( - OpaqueReturnTypeReprs.begin(), OpaqueReturnTypeReprs.end(), - getTrailingObjects()); + std::uninitialized_copy(OpaqueReturnTypeReprs.begin(), + OpaqueReturnTypeReprs.end(), getTrailingObjects()); } OpaqueTypeDecl *OpaqueTypeDecl::get( diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 8ea959c2e94d8..835c1625099f2 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -2915,7 +2915,7 @@ TypeJoinExpr::TypeJoinExpr(llvm::PointerUnion result, Bits.TypeJoinExpr.NumElements = elements.size(); // Copy elements. std::uninitialized_copy(elements.begin(), elements.end(), - getTrailingObjects()); + getTrailingObjects()); } TypeJoinExpr *TypeJoinExpr::createImpl( diff --git a/lib/AST/GenericParamList.cpp b/lib/AST/GenericParamList.cpp index 7ca5ffbb42f36..3dbfe884992d5 100644 --- a/lib/AST/GenericParamList.cpp +++ b/lib/AST/GenericParamList.cpp @@ -39,8 +39,7 @@ GenericParamList::GenericParamList(SourceLoc LAngleLoc, WhereLoc(WhereLoc), Requirements(Requirements), OuterParameters(nullptr) { - std::uninitialized_copy(Params.begin(), Params.end(), - getTrailingObjects()); + std::uninitialized_copy(Params.begin(), Params.end(), getTrailingObjects()); } GenericParamList * @@ -123,7 +122,7 @@ TrailingWhereClause::TrailingWhereClause( NumRequirements(requirements.size()) { std::uninitialized_copy(requirements.begin(), requirements.end(), - getTrailingObjects()); + getTrailingObjects()); } TrailingWhereClause *TrailingWhereClause::create( diff --git a/lib/AST/ImportCache.cpp b/lib/AST/ImportCache.cpp index 0567151a37dac..3a8db740179c9 100644 --- a/lib/AST/ImportCache.cpp +++ b/lib/AST/ImportCache.cpp @@ -35,7 +35,7 @@ ImportSet::ImportSet(bool hasHeaderImportModule, NumTopLevelImports(topLevelImports.size()), NumTransitiveImports(transitiveImports.size()), NumTransitiveSwiftOnlyImports(transitiveSwiftOnlyImports.size()) { - auto buffer = getTrailingObjects(); + auto *buffer = getTrailingObjects(); std::uninitialized_copy(topLevelImports.begin(), topLevelImports.end(), buffer); std::uninitialized_copy(transitiveImports.begin(), transitiveImports.end(), diff --git a/lib/AST/PackConformance.cpp b/lib/AST/PackConformance.cpp index c6d3bdfec01c3..e2f6250b1e71d 100644 --- a/lib/AST/PackConformance.cpp +++ b/lib/AST/PackConformance.cpp @@ -48,7 +48,7 @@ PackConformance::PackConformance(PackType *conformingType, assert(ConformingType->getNumElements() == conformances.size()); std::uninitialized_copy(conformances.begin(), conformances.end(), - getTrailingObjects()); + getTrailingObjects()); } size_t PackConformance::numTrailingObjects( @@ -63,8 +63,7 @@ bool PackConformance::isInvalid() const { ArrayRef PackConformance::getPatternConformances() const { - return {getTrailingObjects(), - ConformingType->getNumElements()}; + return getTrailingObjects(ConformingType->getNumElements()); } bool PackConformance::isCanonical() const { diff --git a/lib/AST/Pattern.cpp b/lib/AST/Pattern.cpp index d6f6eb4874422..1d4b194562a0e 100644 --- a/lib/AST/Pattern.cpp +++ b/lib/AST/Pattern.cpp @@ -460,7 +460,7 @@ TuplePattern *TuplePattern::create(ASTContext &C, SourceLoc lp, alignof(TuplePattern)); TuplePattern *pattern = ::new (buffer) TuplePattern(lp, n, rp); std::uninitialized_copy(elts.begin(), elts.end(), - pattern->getTrailingObjects()); + pattern->getTrailingObjects()); return pattern; } diff --git a/lib/AST/RequirementMachine/Term.cpp b/lib/AST/RequirementMachine/Term.cpp index 5455fb348fa56..62cd07e6bd201 100644 --- a/lib/AST/RequirementMachine/Term.cpp +++ b/lib/AST/RequirementMachine/Term.cpp @@ -39,13 +39,9 @@ struct Term::Storage final return Size; } - MutableArrayRef getElements() { - return {getTrailingObjects(), Size}; - } + MutableArrayRef getElements() { return getTrailingObjects(Size); } - ArrayRef getElements() const { - return {getTrailingObjects(), Size}; - } + ArrayRef getElements() const { return getTrailingObjects(Size); } void Profile(llvm::FoldingSetNodeID &id) const; }; diff --git a/lib/AST/SILLayout.cpp b/lib/AST/SILLayout.cpp index 2a4599b7baf6d..efcf5ac734934 100644 --- a/lib/AST/SILLayout.cpp +++ b/lib/AST/SILLayout.cpp @@ -82,7 +82,7 @@ SILLayout::SILLayout(CanGenericSignature Sig, #ifndef NDEBUG verifyFields(Sig, Fields); #endif - auto FieldsMem = getTrailingObjects(); + auto *FieldsMem = getTrailingObjects(); for (unsigned i : indices(Fields)) { new (FieldsMem + i) SILField(Fields[i]); } diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index d2a7289d2ee8d..a796b8091292f 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -184,8 +184,7 @@ BraceStmt::BraceStmt(SourceLoc lbloc, ArrayRef elts, SourceLoc rbloc, : Stmt(StmtKind::Brace, getDefaultImplicitFlag(implicit, lbloc)), LBLoc(lbloc), RBLoc(rbloc) { Bits.BraceStmt.NumElements = elts.size(); - std::uninitialized_copy(elts.begin(), elts.end(), - getTrailingObjects()); + std::uninitialized_copy(elts.begin(), elts.end(), getTrailingObjects()); #ifndef NDEBUG for (auto elt : elts) @@ -940,7 +939,7 @@ SwitchStmt *SwitchStmt::create(LabeledStmtInfo LabelInfo, SourceLoc SwitchLoc, EndLoc); std::uninitialized_copy(Cases.begin(), Cases.end(), - theSwitch->getTrailingObjects()); + theSwitch->getTrailingObjects()); for (auto *caseStmt : theSwitch->getCases()) caseStmt->setParentStmt(theSwitch); diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index e60800f154fc9..9bdd35c6ad4df 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -3571,7 +3571,7 @@ bool TypeBase::matchesFunctionType(Type other, TypeMatchOptions matchMode, /// return the field index, otherwise return -1. int TupleType::getNamedElementId(Identifier I) const { for (unsigned i = 0, e = Bits.TupleType.Count; i != e; ++i) { - if (getTrailingObjects()[i].getName() == I) + if (getTrailingObjects()[i].getName() == I) return i; } @@ -3907,7 +3907,7 @@ ParameterizedProtocolType::ParameterizedProtocolType( assert(args.size() > 0); Bits.ParameterizedProtocolType.ArgCount = args.size(); for (unsigned i : indices(args)) - getTrailingObjects()[i] = args[i]; + getTrailingObjects()[i] = args[i]; } void ParameterizedProtocolType::Profile(llvm::FoldingSetNodeID &ID, diff --git a/lib/AST/TypeRepr.cpp b/lib/AST/TypeRepr.cpp index 8b24e90097ddf..11f75634fae70 100644 --- a/lib/AST/TypeRepr.cpp +++ b/lib/AST/TypeRepr.cpp @@ -538,7 +538,7 @@ TupleTypeRepr::TupleTypeRepr(ArrayRef Elements, Bits.TupleTypeRepr.NumElements = Elements.size(); std::uninitialized_copy(Elements.begin(), Elements.end(), - getTrailingObjects()); + getTrailingObjects()); } TupleTypeRepr *TupleTypeRepr::create(const ASTContext &C, @@ -695,7 +695,7 @@ PackTypeRepr::PackTypeRepr(SourceLoc keywordLoc, SourceRange braceLocs, : TypeRepr(TypeReprKind::Pack), KeywordLoc(keywordLoc), BraceLocs(braceLocs) { Bits.PackTypeRepr.NumElements = elements.size(); - memcpy(getTrailingObjects(), elements.data(), + memcpy(getTrailingObjects(), elements.data(), elements.size() * sizeof(TypeRepr*)); } diff --git a/lib/IDE/CodeCompletionString.cpp b/lib/IDE/CodeCompletionString.cpp index cc7d57bcc6108..6479b3a1e87df 100644 --- a/lib/IDE/CodeCompletionString.cpp +++ b/lib/IDE/CodeCompletionString.cpp @@ -18,8 +18,7 @@ using namespace swift; using namespace swift::ide; CodeCompletionString::CodeCompletionString(ArrayRef Chunks) { - std::uninitialized_copy(Chunks.begin(), Chunks.end(), - getTrailingObjects()); + std::uninitialized_copy(Chunks.begin(), Chunks.end(), getTrailingObjects()); NumChunks = Chunks.size(); } diff --git a/lib/IRGen/GenExistential.cpp b/lib/IRGen/GenExistential.cpp index b1333fd611d89..e3aa7abd8c144 100644 --- a/lib/IRGen/GenExistential.cpp +++ b/lib/IRGen/GenExistential.cpp @@ -148,7 +148,7 @@ namespace { : Base(std::forward(args)...), NumStoredProtocols(protocols.size()) { std::uninitialized_copy(protocols.begin(), protocols.end(), - this->template getTrailingObjects()); + this->getTrailingObjects()); } public: @@ -172,8 +172,7 @@ namespace { /// type are not know to implement any protocols, although we do /// still know how to manipulate them. ArrayRef getStoredProtocols() const { - return {this->template getTrailingObjects(), - NumStoredProtocols}; + return this->getTrailingObjects(NumStoredProtocols); } /// Given the address of an existential object, find the witness diff --git a/lib/IRGen/GenRecord.h b/lib/IRGen/GenRecord.h index eaee3f2f94894..51b1748f1e396 100644 --- a/lib/IRGen/GenRecord.h +++ b/lib/IRGen/GenRecord.h @@ -138,7 +138,7 @@ class RecordTypeInfoImpl : public Base, NumFields(fields.size()), AreFieldsABIAccessible(fieldsABIAccessible) { std::uninitialized_copy(fields.begin(), fields.end(), - this->template getTrailingObjects()); + this->getTrailingObjects()); } void fillWithZerosIfSensitive(IRGenFunction &IGF, Address address, SILType T) const { @@ -162,7 +162,7 @@ class RecordTypeInfoImpl : public Base, } ArrayRef getFields() const { - return {this->template getTrailingObjects(), NumFields}; + return this->getTrailingObjects(NumFields); } /// The standard schema is just all the fields jumbled together. diff --git a/lib/IRGen/ProtocolInfo.h b/lib/IRGen/ProtocolInfo.h index 44de7cf7ec7f1..3147e0fd5b282 100644 --- a/lib/IRGen/ProtocolInfo.h +++ b/lib/IRGen/ProtocolInfo.h @@ -222,8 +222,7 @@ class ProtocolInfo final : ProtocolInfo(ArrayRef table, ProtocolInfoKind kind) : NumTableEntries(table.size()), Kind(kind) { - std::uninitialized_copy(table.begin(), table.end(), - getTrailingObjects()); + std::uninitialized_copy(table.begin(), table.end(), getTrailingObjects()); } static std::unique_ptr create(ArrayRef table, @@ -242,7 +241,7 @@ class ProtocolInfo final : /// The addresses of the entries in this array can be passed to /// getBaseWitnessIndex/getNonBaseWitnessIndex, below. ArrayRef getWitnessEntries() const { - return {getTrailingObjects(), NumTableEntries}; + return getTrailingObjects(NumTableEntries); } /// Given the address of a witness entry from this PI for a base protocol diff --git a/lib/Markup/AST.cpp b/lib/Markup/AST.cpp index 2c94e1d49306e..92994f9ccc181 100644 --- a/lib/Markup/AST.cpp +++ b/lib/Markup/AST.cpp @@ -25,7 +25,7 @@ using namespace markup; Document::Document(ArrayRef Children) : MarkupASTNode(ASTNodeKind::Document), NumChildren(Children.size()) { std::uninitialized_copy(Children.begin(), Children.end(), - getTrailingObjects()); + getTrailingObjects()); } Document *Document::create(MarkupContext &MC, @@ -38,7 +38,7 @@ Document *Document::create(MarkupContext &MC, BlockQuote::BlockQuote(ArrayRef Children) : MarkupASTNode(ASTNodeKind::BlockQuote), NumChildren(Children.size()) { std::uninitialized_copy(Children.begin(), Children.end(), - getTrailingObjects()); + getTrailingObjects()); } BlockQuote *BlockQuote::create(MarkupContext &MC, ArrayRef Children) { @@ -72,7 +72,7 @@ List::List(ArrayRef Children, bool IsOrdered) : MarkupASTNode(ASTNodeKind::List), NumChildren(Children.size()), Ordered(IsOrdered) { std::uninitialized_copy(Children.begin(), Children.end(), - getTrailingObjects()); + getTrailingObjects()); } List *List::create(MarkupContext &MC, ArrayRef Children, @@ -85,7 +85,7 @@ List *List::create(MarkupContext &MC, ArrayRef Children, Item::Item(ArrayRef Children) : MarkupASTNode(ASTNodeKind::Item), NumChildren(Children.size()) { std::uninitialized_copy(Children.begin(), Children.end(), - getTrailingObjects()); + getTrailingObjects()); } Item *Item::create(MarkupContext &MC, ArrayRef Children) { @@ -98,7 +98,7 @@ Link::Link(StringRef Destination, ArrayRef Children) : InlineContent(ASTNodeKind::Link), NumChildren(Children.size()), Destination(Destination) { std::uninitialized_copy(Children.begin(), Children.end(), - getTrailingObjects()); + getTrailingObjects()); } Link *Link::create(MarkupContext &MC, StringRef Destination, @@ -114,7 +114,7 @@ Image::Image(StringRef Destination, std::optional Title, : InlineContent(ASTNodeKind::Image), NumChildren(Children.size()), Destination(Destination), Title(Title) { std::uninitialized_copy(Children.begin(), Children.end(), - getTrailingObjects()); + getTrailingObjects()); } Image *Image::create(MarkupContext &MC, StringRef Destination, @@ -133,7 +133,7 @@ Header::Header(unsigned Level, ArrayRef Children) : MarkupASTNode(ASTNodeKind::Header), NumChildren(Children.size()), Level(Level) { std::uninitialized_copy(Children.begin(), Children.end(), - getTrailingObjects()); + getTrailingObjects()); } Header *Header::create(MarkupContext &MC, unsigned Level, @@ -147,7 +147,7 @@ Paragraph::Paragraph(ArrayRef Children) : MarkupASTNode(ASTNodeKind::Paragraph), NumChildren(Children.size()) { std::uninitialized_copy(Children.begin(), Children.end(), - getTrailingObjects()); + getTrailingObjects()); } Paragraph *Paragraph::create(MarkupContext &MC, @@ -158,7 +158,8 @@ Paragraph *Paragraph::create(MarkupContext &MC, } InlineAttributes::InlineAttributes(StringRef Attributes, ArrayRef Children) : InlineContent(ASTNodeKind::InlineAttributes), NumChildren(Children.size()), Attributes(Attributes) { - std::uninitialized_copy(Children.begin(), Children.end(), getTrailingObjects()); + std::uninitialized_copy(Children.begin(), Children.end(), + getTrailingObjects()); } InlineAttributes *InlineAttributes::create(MarkupContext &MC, StringRef Attributes, ArrayRef Children) { @@ -190,7 +191,7 @@ LineBreak *LineBreak::create(MarkupContext &MC) { Emphasis::Emphasis(ArrayRef Children) : InlineContent(ASTNodeKind::Emphasis), NumChildren(Children.size()) { std::uninitialized_copy(Children.begin(), Children.end(), - getTrailingObjects()); + getTrailingObjects()); } Emphasis *Emphasis::create(MarkupContext &MC, @@ -203,7 +204,7 @@ Emphasis *Emphasis::create(MarkupContext &MC, Strong::Strong(ArrayRef Children) : InlineContent(ASTNodeKind::Strong), NumChildren(Children.size()) { std::uninitialized_copy(Children.begin(), Children.end(), - getTrailingObjects()); + getTrailingObjects()); } Strong *Strong::create(MarkupContext &MC, @@ -217,7 +218,7 @@ ParamField::ParamField(StringRef Name, ArrayRef Children) : PrivateExtension(ASTNodeKind::ParamField), NumChildren(Children.size()), Name(Name), Parts(std::nullopt) { std::uninitialized_copy(Children.begin(), Children.end(), - getTrailingObjects()); + getTrailingObjects()); } ParamField *ParamField::create(MarkupContext &MC, StringRef Name, @@ -237,7 +238,7 @@ Id *Id::create(MarkupContext &MC, ArrayRef Children) { \ Id::Id(ArrayRef Children) \ : PrivateExtension(ASTNodeKind::Id), NumChildren(Children.size()) { \ std::uninitialized_copy(Children.begin(), Children.end(), \ - getTrailingObjects()); \ + getTrailingObjects()); \ } #include "swift/Markup/SimpleFields.def" diff --git a/lib/SIL/IR/SILConstants.cpp b/lib/SIL/IR/SILConstants.cpp index 3996a1c3694c4..7005fd7e2965b 100644 --- a/lib/SIL/IR/SILConstants.cpp +++ b/lib/SIL/IR/SILConstants.cpp @@ -455,7 +455,7 @@ struct AggregateSymbolicValue final auto *aggregate = ::new (rawMem) AggregateSymbolicValue(aggregateType, members.size()); std::uninitialized_copy(members.begin(), members.end(), - aggregate->getTrailingObjects()); + aggregate->getTrailingObjects()); return aggregate; } @@ -464,7 +464,7 @@ struct AggregateSymbolicValue final /// Return the symbolic values of members. ArrayRef getMemberValues() const { - return {getTrailingObjects(), numElements}; + return getTrailingObjects(numElements); } // This is used by the llvm::TrailingObjects base class. @@ -531,12 +531,12 @@ struct alignas(SourceLoc) UnknownSymbolicValue final auto value = ::new (rawMem) UnknownSymbolicValue( node, reason, static_cast(elements.size())); std::uninitialized_copy(elements.begin(), elements.end(), - value->getTrailingObjects()); + value->getTrailingObjects()); return value; } ArrayRef getCallStack() const { - return {getTrailingObjects(), callStackSize}; + return getTrailingObjects(callStackSize); } // This is used by the llvm::TrailingObjects base class. @@ -657,14 +657,14 @@ struct DerivedAddressValue final auto dav = ::new (rawMem) DerivedAddressValue(memoryObject, elements.size()); std::uninitialized_copy(elements.begin(), elements.end(), - dav->getTrailingObjects()); + dav->getTrailingObjects()); return dav; } /// Return the access path for this derived address, which is an array of /// indices drilling into the memory object. ArrayRef getElements() const { - return {getTrailingObjects(), numElements}; + return getTrailingObjects(numElements); } // This is used by the llvm::TrailingObjects base class. @@ -749,13 +749,13 @@ struct SymbolicArrayStorage final auto *storage = ::new (rawMem) SymbolicArrayStorage(elementType, elements.size()); std::uninitialized_copy(elements.begin(), elements.end(), - storage->getTrailingObjects()); + storage->getTrailingObjects()); return storage; } /// Return the stored elements. ArrayRef getElements() const { - return {getTrailingObjects(), numElements}; + return getTrailingObjects(numElements); } // This is used by the llvm::TrailingObjects base class. @@ -872,9 +872,8 @@ SymbolicClosure *SymbolicClosure::create(SILFunction *target, // Placement initialize the object. auto closure = ::new (rawMem) SymbolicClosure( target, args.size(), substMap, closureInst, hasNonConstantCapture); - std::uninitialized_copy( - args.begin(), args.end(), - closure->getTrailingObjects()); + std::uninitialized_copy(args.begin(), args.end(), + closure->getTrailingObjects()); return closure; } diff --git a/lib/SIL/IR/SILInstructions.cpp b/lib/SIL/IR/SILInstructions.cpp index eb7bbe82bfc59..54658ea4ddd8a 100644 --- a/lib/SIL/IR/SILInstructions.cpp +++ b/lib/SIL/IR/SILInstructions.cpp @@ -539,7 +539,7 @@ IncrementProfilerCounterInst *IncrementProfilerCounterInst::create( Loc, CounterIdx, PGOFuncNameLength, NumCounters, PGOFuncHash); std::uninitialized_copy(PGOFuncName.begin(), PGOFuncName.end(), - Inst->getTrailingObjects()); + Inst->getTrailingObjects()); return Inst; } @@ -554,7 +554,7 @@ SpecifyTestInst *SpecifyTestInst::create(SILDebugLocation Loc, ::new (Buffer) SpecifyTestInst(Loc, ArgumentsSpecificationLength); std::uninitialized_copy(ArgumentsSpecification.begin(), ArgumentsSpecification.end(), - Inst->getTrailingObjects()); + Inst->getTrailingObjects()); return Inst; } @@ -1121,7 +1121,7 @@ IntegerLiteralInst::IntegerLiteralInst(SILDebugLocation Loc, SILType Ty, : InstructionBase(Loc, Ty) { sharedUInt32().IntegerLiteralInst.numBits = Value.getBitWidth(); std::uninitialized_copy_n(Value.getRawData(), Value.getNumWords(), - getTrailingObjects()); + getTrailingObjects()); } IntegerLiteralInst *IntegerLiteralInst::create(SILDebugLocation Loc, @@ -1182,8 +1182,7 @@ IntegerLiteralInst *IntegerLiteralInst::create(IntegerLiteralExpr *E, /// getValue - Return the APInt for the underlying integer literal. APInt IntegerLiteralInst::getValue() const { auto numBits = sharedUInt32().IntegerLiteralInst.numBits; - return APInt(numBits, {getTrailingObjects(), - getWordsForBitWidth(numBits)}); + return APInt(numBits, getTrailingObjects(getWordsForBitWidth(numBits))); } FloatLiteralInst::FloatLiteralInst(SILDebugLocation Loc, SILType Ty, @@ -1191,7 +1190,7 @@ FloatLiteralInst::FloatLiteralInst(SILDebugLocation Loc, SILType Ty, : InstructionBase(Loc, Ty) { sharedUInt32().FloatLiteralInst.numBits = Bits.getBitWidth(); std::uninitialized_copy_n(Bits.getRawData(), Bits.getNumWords(), - getTrailingObjects()); + getTrailingObjects()); } FloatLiteralInst *FloatLiteralInst::create(SILDebugLocation Loc, SILType Ty, @@ -1222,8 +1221,7 @@ FloatLiteralInst *FloatLiteralInst::create(FloatLiteralExpr *E, APInt FloatLiteralInst::getBits() const { auto numBits = sharedUInt32().FloatLiteralInst.numBits; - return APInt(numBits, {getTrailingObjects(), - getWordsForBitWidth(numBits)}); + return APInt(numBits, getTrailingObjects(getWordsForBitWidth(numBits))); } APFloat FloatLiteralInst::getValue() const { @@ -1236,7 +1234,7 @@ StringLiteralInst::StringLiteralInst(SILDebugLocation Loc, StringRef Text, : InstructionBase(Loc, Ty) { sharedUInt8().StringLiteralInst.encoding = uint8_t(encoding); sharedUInt32().StringLiteralInst.length = Text.size(); - memcpy(getTrailingObjects(), Text.data(), Text.size()); + memcpy(getTrailingObjects(), Text.data(), Text.size()); // It is undefined behavior to feed ill-formed UTF-8 into `Swift.String`; // however, the compiler creates string literals in many places, so there's a @@ -1262,7 +1260,7 @@ CondFailInst::CondFailInst(SILDebugLocation DebugLoc, SILValue Operand, StringRef Message) : UnaryInstructionBase(DebugLoc, Operand), MessageSize(Message.size()) { - memcpy(getTrailingObjects(), Message.data(), Message.size()); + memcpy(getTrailingObjects(), Message.data(), Message.size()); } CondFailInst *CondFailInst::create(SILDebugLocation DebugLoc, SILValue Operand, @@ -3067,14 +3065,14 @@ KeyPathPattern::KeyPathPattern(CanGenericSignature signature, Signature(signature), RootType(rootType), ValueType(valueType), ObjCString(objcString) { - auto *componentsBuf = getTrailingObjects(); + auto *componentsBuf = getTrailingObjects(); std::uninitialized_copy(components.begin(), components.end(), componentsBuf); } ArrayRef KeyPathPattern::getComponents() const { - return {getTrailingObjects(), NumComponents}; + return getTrailingObjects(NumComponents); } void KeyPathPattern::Profile(llvm::FoldingSetNodeID &ID, @@ -3178,7 +3176,7 @@ KeyPathInst::KeyPathInst(SILDebugLocation Loc, Substitutions(Subs) { assert(allOperands.size() >= numPatternOperands); - auto *operandsBuf = getTrailingObjects(); + auto *operandsBuf = getTrailingObjects(); for (unsigned i = 0; i < allOperands.size(); ++i) { ::new ((void*)&operandsBuf[i]) Operand(this, allOperands[i]); } @@ -3191,7 +3189,7 @@ KeyPathInst::KeyPathInst(SILDebugLocation Loc, MutableArrayRef KeyPathInst::getAllOperands() { - return {getTrailingObjects(), numPatternOperands + numTypeDependentOperands}; + return getTrailingObjects(numPatternOperands + numTypeDependentOperands); } KeyPathInst::~KeyPathInst() { diff --git a/lib/SIL/IR/SILVTable.cpp b/lib/SIL/IR/SILVTable.cpp index c62e6d4764d00..241e127fb3ba8 100644 --- a/lib/SIL/IR/SILVTable.cpp +++ b/lib/SIL/IR/SILVTable.cpp @@ -95,8 +95,7 @@ SILVTable::SILVTable(ClassDecl *c, SILType classType, SerializedKind_t serialized, ArrayRef entries) : Class(c), classType(classType), SerializedKind(serialized), NumEntries(entries.size()) { - std::uninitialized_copy(entries.begin(), entries.end(), - getTrailingObjects()); + std::uninitialized_copy(entries.begin(), entries.end(), getTrailingObjects()); // Bump the reference count of functions referenced by this table. for (const Entry &entry : getEntries()) { diff --git a/lib/Serialization/Deserialization.cpp b/lib/Serialization/Deserialization.cpp index 3a8d673f69c13..38a006ef3bcad 100644 --- a/lib/Serialization/Deserialization.cpp +++ b/lib/Serialization/Deserialization.cpp @@ -8755,7 +8755,7 @@ class LazyConformanceLoaderInfo final LazyConformanceLoaderInfo(ArrayRef ids) : NumConformances(ids.size()) { - auto buffer = getTrailingObjects(); + auto *buffer = getTrailingObjects(); for (unsigned i = 0, e = ids.size(); i != e; ++i) buffer[i] = ProtocolConformanceID(ids[i]); } @@ -8773,8 +8773,7 @@ class LazyConformanceLoaderInfo final ArrayRef claim() { // TODO: free the memory here (if it's not used in multiple places?) - return llvm::ArrayRef(getTrailingObjects(), - NumConformances); + return getTrailingObjects(NumConformances); } }; } // end anonymous namespace From 08e02af30d6f29dac086e8552aeb87175ae0dab5 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Fri, 18 Jul 2025 23:42:49 +0100 Subject: [PATCH 060/100] LLVMPasses: Remove no longer needed call to removed LLVM method See https://github.com/llvm/llvm-project/pull/143746. --- lib/LLVMPasses/LLVMMergeFunctions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/LLVMPasses/LLVMMergeFunctions.cpp b/lib/LLVMPasses/LLVMMergeFunctions.cpp index 7f33a935d5676..d5bb941837d32 100644 --- a/lib/LLVMPasses/LLVMMergeFunctions.cpp +++ b/lib/LLVMPasses/LLVMMergeFunctions.cpp @@ -1081,7 +1081,6 @@ void SwiftMergeFunctions::mergeWithParams(const FunctionInfos &FInfos, Function *NewFunction = Function::Create(funcType, FirstF->getLinkage(), FirstF->getName() + "Tm"); - NewFunction->setIsNewDbgInfoFormat(FirstF->IsNewDbgInfoFormat); NewFunction->copyAttributesFrom(FirstF); // NOTE: this function is not externally available, do ensure that we reset // the DLL storage From 15f534deb1d4402c9150ea7f82519c82f2b39674 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Sat, 19 Jul 2025 00:16:44 +0100 Subject: [PATCH 061/100] AST: Adjust `llvm::TinyPtrVector` -> `llvm::ArrayRef` conversion after API change See https://github.com/llvm/llvm-project/commit/8b3e345002f39e288109e0d0c1a54d76a1e0bc9d. --- lib/AST/ASTContext.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 5135a6fcc64a7..87318c2d4a685 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -2499,8 +2499,7 @@ void OverriddenDeclsRequest::cacheResult( // Record the overrides in the context. auto &ctx = decl->getASTContext(); - auto overriddenCopy = - ctx.AllocateCopy(value.operator ArrayRef()); + auto overriddenCopy = ctx.AllocateCopy(ArrayRef(value)); (void)ctx.getImpl().Overrides.insert({decl, overriddenCopy}); } From 59957f5bbf9cc2735dadda7902ce8a8c5aa6b336 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Sat, 19 Jul 2025 00:22:45 +0100 Subject: [PATCH 062/100] Serialization: Adjust call to `clang::AttributeCommonInfo` ctor See https://github.com/llvm/llvm-project/pull/141305. --- lib/Serialization/Deserialization.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Serialization/Deserialization.cpp b/lib/Serialization/Deserialization.cpp index 38a006ef3bcad..be8b91578f3e6 100644 --- a/lib/Serialization/Deserialization.cpp +++ b/lib/Serialization/Deserialization.cpp @@ -8468,7 +8468,8 @@ class SwiftToClangBasicReader : bool isRegularKeywordAttribute = readBool(); clang::AttributeCommonInfo info( - name, scopeName, {rangeStart, rangeEnd}, scopeLoc, parsedKind, + name, clang::AttributeScopeInfo(scopeName, scopeLoc), + {rangeStart, rangeEnd}, parsedKind, {syntax, spellingListIndex, /*IsAlignas=*/false, isRegularKeywordAttribute}); From fe450f6447c675bbd89b9d274ec2c579deb7d6cd Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Sat, 19 Jul 2025 01:31:45 +0100 Subject: [PATCH 063/100] DependencyScan: Adjust call argument after change to `clang::DependencyScanningTool::getModuleDependencies` result type See https://github.com/llvm/llvm-project/pull/147969. --- lib/DependencyScan/ModuleDependencyScanner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/DependencyScan/ModuleDependencyScanner.cpp b/lib/DependencyScan/ModuleDependencyScanner.cpp index 238217c83ca7d..a91afb2268d74 100644 --- a/lib/DependencyScan/ModuleDependencyScanner.cpp +++ b/lib/DependencyScan/ModuleDependencyScanner.cpp @@ -335,8 +335,8 @@ ModuleDependencyScanningWorker::scanFilesystemForClangModuleDependency( } return ClangImporter::bridgeClangModuleDependencies( - *workerASTContext, clangScanningTool, *clangModuleDependencies, - lookupModuleOutput, + *workerASTContext, clangScanningTool, + clangModuleDependencies->ModuleGraph, lookupModuleOutput, [&](StringRef path) { return remapPath(PrefixMapper, path); }); } From 6132f529c8b8e55de11a0370c4de48bd98555853 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Sat, 19 Jul 2025 01:32:17 +0100 Subject: [PATCH 064/100] IRBuilder: Resolve ambiguous call It looks like the addition of a defaulted parameter to `llvm::IRBuilderBase::CreateOr` in https://github.com/llvm/llvm-project/pull/146350 caused it to conflict with our own version of the method. Sync up their signatures. --- lib/IRGen/IRBuilder.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/IRGen/IRBuilder.h b/lib/IRGen/IRBuilder.h index 8885a761debe1..d80ff56a62d14 100644 --- a/lib/IRGen/IRBuilder.h +++ b/lib/IRGen/IRBuilder.h @@ -139,11 +139,11 @@ class IRBuilder : public IRBuilderBase { using IRBuilderBase::CreateOr; llvm::Value *CreateOr(llvm::Value *LHS, llvm::Value *RHS, - const Twine &Name = "") { + const Twine &Name = "", bool IsDisjoint = false) { if (auto *RC = dyn_cast(RHS)) if (RC->isNullValue()) return LHS; // LHS | 0 -> LHS - return IRBuilderBase::CreateOr(LHS, RHS, Name); + return IRBuilderBase::CreateOr(LHS, RHS, Name, IsDisjoint); } llvm::Value *CreateOr(llvm::Value *LHS, const APInt &RHS, const Twine &Name = "") { From 7ce7fe5efa2e2a1367cf0b91f2fbf2807bb4f4dc Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Sat, 19 Jul 2025 01:47:23 +0100 Subject: [PATCH 065/100] ClangImporter: Fix missing argument in call to `clang::TargetInfo::adjust` Optimistic fix, see https://github.com/llvm/llvm-project/pull/146620/files#diff-1f27da5469f5eded641d3d39b00bf4021e420520e9876bfe3434b71b812553d8. --- lib/ClangImporter/ClangImporter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index 56af62f4b0ba1..3faa403540817 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -1458,7 +1458,8 @@ ClangImporter::create(ASTContext &ctx, // // FIXME: We shouldn't need to do this, the target should be immutable once // created. This complexity should be lifted elsewhere. - instance.getTarget().adjust(clangDiags, instance.getLangOpts()); + instance.getTarget().adjust(clangDiags, instance.getLangOpts(), + /*AuxTarget=*/nullptr); if (importerOpts.Mode == ClangImporterOptions::Modes::EmbedBitcode) return importer; From 3ba8ab409486f24fefd2dc213baa9916d21f8971 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Jul 2025 11:48:57 +0100 Subject: [PATCH 066/100] IRGen: Address `llvm::Instruction::{move,insert}Before` deprecations See https://github.com/llvm/llvm-project/commit/79499f010d2bfe809187a9a5f042d4e4ee1f1bcc. --- lib/IRGen/IRGenSIL.cpp | 4 ++-- lib/LLVMPasses/LLVMARCOpts.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/IRGen/IRGenSIL.cpp b/lib/IRGen/IRGenSIL.cpp index 34bdb94ff7a8a..9368e66262e1a 100644 --- a/lib/IRGen/IRGenSIL.cpp +++ b/lib/IRGen/IRGenSIL.cpp @@ -907,7 +907,7 @@ class IRGenSILFunction : llvm::Instruction *Cloned = Orig->clone(); Cloned->setOperand(0, Inner); - Cloned->insertBefore(Orig); + Cloned->insertBefore(Orig->getIterator()); return static_cast(Cloned); }; if (auto *LdInst = dyn_cast(Storage)) @@ -5762,7 +5762,7 @@ static Address isSafeForMemCpyPeephole(const TypeInfo &TI, SILArgument *arg, return Address(); } - lifetimeBegin->moveBefore(load); + lifetimeBegin->moveBefore(load->getIterator()); // Set insertPt to the first load such that we are within the lifetime of the // alloca marked by the lifetime intrinsic. diff --git a/lib/LLVMPasses/LLVMARCOpts.cpp b/lib/LLVMPasses/LLVMARCOpts.cpp index e66650b1bfb1b..16d9d2874ff3c 100644 --- a/lib/LLVMPasses/LLVMARCOpts.cpp +++ b/lib/LLVMPasses/LLVMARCOpts.cpp @@ -398,7 +398,7 @@ static bool performLocalReleaseMotion(CallInst &Release, BasicBlock &BB, // there) move the release to the top of the block. // TODO: This is where we'd plug in some global algorithms someday. if (&*BBI != &Release) { - Release.moveBefore(&*BBI); + Release.moveBefore(BBI); return true; } @@ -520,7 +520,7 @@ static bool performLocalRetainMotion(CallInst &Retain, BasicBlock &BB, // If we were able to move the retain down, move it now. // TODO: This is where we'd plug in some global algorithms someday. if (MadeProgress) { - Retain.moveBefore(&*BBI); + Retain.moveBefore(BBI); return true; } From db58043b4076bb561823aad5516a09803490f95c Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Jul 2025 11:07:57 +0100 Subject: [PATCH 067/100] IRGen: Address `llvm::Intrinsic::getDeclaration` deprecation See https://github.com/llvm/llvm-project/pull/112242. --- lib/IRGen/GenBuiltin.cpp | 8 ++++---- lib/IRGen/IRBuilder.h | 10 +++++----- lib/IRGen/IRGenFunction.cpp | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/IRGen/GenBuiltin.cpp b/lib/IRGen/GenBuiltin.cpp index 8ea91091de335..b220d4e0d8719 100644 --- a/lib/IRGen/GenBuiltin.cpp +++ b/lib/IRGen/GenBuiltin.cpp @@ -444,9 +444,9 @@ void irgen::emitBuiltinCall(IRGenFunction &IGF, const BuiltinInfo &Builtin, SmallVector ArgTys; for (auto T : IInfo.Types) ArgTys.push_back(IGF.IGM.getStorageTypeForLowered(T->getCanonicalType())); - - auto F = llvm::Intrinsic::getDeclaration(&IGF.IGM.Module, - (llvm::Intrinsic::ID)IID, ArgTys); + + auto F = llvm::Intrinsic::getOrInsertDeclaration( + &IGF.IGM.Module, (llvm::Intrinsic::ID)IID, ArgTys); llvm::FunctionType *FT = F->getFunctionType(); SmallVector IRArgs; for (unsigned i = 0, e = FT->getNumParams(); i != e; ++i) @@ -512,7 +512,7 @@ void irgen::emitBuiltinCall(IRGenFunction &IGF, const BuiltinInfo &Builtin, SmallVector ArgTys; \ auto opType = Builtin.Types[0]->getCanonicalType(); \ ArgTys.push_back(IGF.IGM.getStorageTypeForLowered(opType)); \ - auto F = llvm::Intrinsic::getDeclaration( \ + auto F = llvm::Intrinsic::getOrInsertDeclaration( \ &IGF.IGM.Module, getLLVMIntrinsicIDForBuiltinWithOverflow(Builtin.ID), \ ArgTys); \ SmallVector IRArgs; \ diff --git a/lib/IRGen/IRBuilder.h b/lib/IRGen/IRBuilder.h index d80ff56a62d14..31cb1dfbb4919 100644 --- a/lib/IRGen/IRBuilder.h +++ b/lib/IRGen/IRBuilder.h @@ -310,8 +310,8 @@ class IRBuilder : public IRBuilderBase { // FunctionPointer. bool isTrapIntrinsic(llvm::Value *Callee) { - return Callee == - llvm::Intrinsic::getDeclaration(getModule(), llvm::Intrinsic::trap); + return Callee == llvm::Intrinsic::getOrInsertDeclaration( + getModule(), llvm::Intrinsic::trap); } bool isTrapIntrinsic(llvm::Intrinsic::ID intrinsicID) { return intrinsicID == llvm::Intrinsic::trap; @@ -381,7 +381,7 @@ class IRBuilder : public IRBuilderBase { const Twine &name = "") { assert(!isTrapIntrinsic(intrinsicID) && "Use CreateNonMergeableTrap"); auto intrinsicFn = - llvm::Intrinsic::getDeclaration(getModule(), intrinsicID); + llvm::Intrinsic::getOrInsertDeclaration(getModule(), intrinsicID); return CreateCallWithoutDbgLoc( cast(intrinsicFn->getValueType()), intrinsicFn, args, name); @@ -393,8 +393,8 @@ class IRBuilder : public IRBuilderBase { ArrayRef args, const Twine &name = "") { assert(!isTrapIntrinsic(intrinsicID) && "Use CreateNonMergeableTrap"); - auto intrinsicFn = - llvm::Intrinsic::getDeclaration(getModule(), intrinsicID, typeArgs); + auto intrinsicFn = llvm::Intrinsic::getOrInsertDeclaration( + getModule(), intrinsicID, typeArgs); return CreateCallWithoutDbgLoc( cast(intrinsicFn->getValueType()), intrinsicFn, args, name); diff --git a/lib/IRGen/IRGenFunction.cpp b/lib/IRGen/IRGenFunction.cpp index 3b02f89d4d09f..aaa681d8b3faa 100644 --- a/lib/IRGen/IRGenFunction.cpp +++ b/lib/IRGen/IRGenFunction.cpp @@ -525,8 +525,8 @@ llvm::CallInst *IRBuilder::CreateNonMergeableTrap(IRGenModule &IGM, } // Emit the trap instruction. - llvm::Function *trapIntrinsic = - llvm::Intrinsic::getDeclaration(&IGM.Module, llvm::Intrinsic::trap); + llvm::Function *trapIntrinsic = llvm::Intrinsic::getOrInsertDeclaration( + &IGM.Module, llvm::Intrinsic::trap); if (EnableTrapDebugInfo && IGM.DebugInfo && !failureMsg.empty()) { IGM.DebugInfo->addFailureMessageToCurrentLoc(*this, failureMsg); } From b66a1aa8c5618cc28114320c26a7f954ec20fc32 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Jul 2025 12:14:27 +0100 Subject: [PATCH 068/100] DriverTool,IRGen: Address `llvm::Target::createTargetMachine` overload deprecation See https://github.com/llvm/llvm-project/pull/130940. --- lib/DriverTool/swift_llvm_opt_main.cpp | 2 +- lib/IRGen/IRGen.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/DriverTool/swift_llvm_opt_main.cpp b/lib/DriverTool/swift_llvm_opt_main.cpp index 37b757b82a0fb..6620418f3ddc9 100644 --- a/lib/DriverTool/swift_llvm_opt_main.cpp +++ b/lib/DriverTool/swift_llvm_opt_main.cpp @@ -135,7 +135,7 @@ getTargetMachine(llvm::Triple TheTriple, StringRef CPUStr, } return TheTarget->createTargetMachine( - TheTriple.getTriple(), CPUStr, FeaturesStr, targetOptions, + TheTriple, CPUStr, FeaturesStr, targetOptions, std::optional(llvm::codegen::getExplicitRelocModel()), llvm::codegen::getExplicitCodeModel(), GetCodeGenOptLevel(options)); } diff --git a/lib/IRGen/IRGen.cpp b/lib/IRGen/IRGen.cpp index 44d077cc20dff..7b9c1ee50e5e5 100644 --- a/lib/IRGen/IRGen.cpp +++ b/lib/IRGen/IRGen.cpp @@ -1061,7 +1061,7 @@ swift::createTargetMachine(const IRGenOptions &Opts, ASTContext &Ctx) { // Create a target machine. llvm::TargetMachine *TargetMachine = Target->createTargetMachine( - EffectiveTriple.str(), CPU, targetFeatures, TargetOpts, Reloc::PIC_, + EffectiveTriple, CPU, targetFeatures, TargetOpts, Reloc::PIC_, cmodel, OptLevel); if (!TargetMachine) { Ctx.Diags.diagnose(SourceLoc(), diag::no_llvm_target, From b04d6085f3911849e4b04d1b9bbb065f66b644a1 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 21 Jul 2025 12:08:53 +0100 Subject: [PATCH 069/100] IRGen: Address `llvm::InsertPosition` ctor deprecation See https://github.com/llvm/llvm-project/pull/102608. --- lib/IRGen/GenDecl.cpp | 12 ++++++------ lib/IRGen/IRGenDebugInfo.cpp | 5 +++-- lib/IRGen/IRGenSIL.cpp | 2 +- lib/LLVMPasses/LLVMMergeFunctions.cpp | 5 +++-- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/IRGen/GenDecl.cpp b/lib/IRGen/GenDecl.cpp index e0569dbaa238e..d7d3790534604 100644 --- a/lib/IRGen/GenDecl.cpp +++ b/lib/IRGen/GenDecl.cpp @@ -5933,9 +5933,8 @@ void IRGenModule::emitExtension(ExtensionDecl *ext) { Address IRGenFunction::createAlloca(llvm::Type *type, Alignment alignment, const llvm::Twine &name) { - llvm::AllocaInst *alloca = - new llvm::AllocaInst(type, IGM.DataLayout.getAllocaAddrSpace(), name, - AllocaIP); + llvm::AllocaInst *alloca = new llvm::AllocaInst( + type, IGM.DataLayout.getAllocaAddrSpace(), name, AllocaIP->getIterator()); alloca->setAlignment(llvm::MaybeAlign(alignment.getValue()).valueOrOne()); return Address(alloca, type, alignment); } @@ -5945,9 +5944,10 @@ Address IRGenFunction::createAlloca(llvm::Type *type, llvm::Value *ArraySize, Alignment alignment, const llvm::Twine &name) { - llvm::AllocaInst *alloca = new llvm::AllocaInst( - type, IGM.DataLayout.getAllocaAddrSpace(), ArraySize, - llvm::MaybeAlign(alignment.getValue()).valueOrOne(), name, AllocaIP); + llvm::AllocaInst *alloca = + new llvm::AllocaInst(type, IGM.DataLayout.getAllocaAddrSpace(), ArraySize, + llvm::MaybeAlign(alignment.getValue()).valueOrOne(), + name, AllocaIP->getIterator()); return Address(alloca, type, alignment); } diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index 0e8e2c0ecd88e..3599c5903e1e7 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -3706,10 +3706,11 @@ struct DbgIntrinsicEmitter { const llvm::DILocation *DL, llvm::Instruction *InsertBefore) { if (ForceDbgDeclare == AddrDbgInstrKind::DbgDeclare) - return DIBuilder.insertDeclare(Addr, VarInfo, Expr, DL, InsertBefore); + return DIBuilder.insertDeclare(Addr, VarInfo, Expr, DL, + InsertBefore->getIterator()); Expr = llvm::DIExpression::append(Expr, llvm::dwarf::DW_OP_deref); return DIBuilder.insertDbgValueIntrinsic(Addr, VarInfo, Expr, DL, - InsertBefore); + InsertBefore->getIterator()); } llvm::DbgInstPtr insert(llvm::Value *Addr, llvm::DILocalVariable *VarInfo, diff --git a/lib/IRGen/IRGenSIL.cpp b/lib/IRGen/IRGenSIL.cpp index 9368e66262e1a..9bfcacfaf760d 100644 --- a/lib/IRGen/IRGenSIL.cpp +++ b/lib/IRGen/IRGenSIL.cpp @@ -823,7 +823,7 @@ class IRGenSILFunction : if (DVI->getParent() == BB) IGM.DebugInfo->getBuilder().insertDbgValueIntrinsic( DVI->getValue(), DVI->getVariable(), DVI->getExpression(), - DVI->getDebugLoc(), &*CurBB->getFirstInsertionPt()); + DVI->getDebugLoc(), CurBB->getFirstInsertionPt()); } } } diff --git a/lib/LLVMPasses/LLVMMergeFunctions.cpp b/lib/LLVMPasses/LLVMMergeFunctions.cpp index d5bb941837d32..e028792d4dbf0 100644 --- a/lib/LLVMPasses/LLVMMergeFunctions.cpp +++ b/lib/LLVMPasses/LLVMMergeFunctions.cpp @@ -1046,8 +1046,9 @@ void SwiftMergeFunctions::replaceCallWithAddedPtrAuth(CallInst *origCall, copiedArgs.push_back(op); } - auto *newCall = CallInst::Create(origCall->getFunctionType(), - newCallee, copiedArgs, bundles, origCall->getName(), origCall); + auto *newCall = + CallInst::Create(origCall->getFunctionType(), newCallee, copiedArgs, + bundles, origCall->getName(), origCall->getIterator()); newCall->setAttributes(origCall->getAttributes()); newCall->setTailCallKind(origCall->getTailCallKind()); newCall->setCallingConv(origCall->getCallingConv()); From 58f957c99eda7d7ac8fff840eb6d530bc00282a5 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Fri, 18 Jul 2025 23:16:22 +0100 Subject: [PATCH 070/100] unittests: Adjust code after changes to `llvm::TrailingObjects` API See: - https://github.com/llvm/llvm-project/pull/138970 - https://github.com/llvm/llvm-project/pull/144930 --- include/swift/Basic/OwnedString.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/swift/Basic/OwnedString.h b/include/swift/Basic/OwnedString.h index 109eb003e6819..c37370d18c052 100644 --- a/include/swift/Basic/OwnedString.h +++ b/include/swift/Basic/OwnedString.h @@ -35,8 +35,7 @@ class OwnedString { class TextOwner final : public llvm::ThreadSafeRefCountedBase, public llvm::TrailingObjects { TextOwner(StringRef Text) { - std::uninitialized_copy(Text.begin(), Text.end(), - getTrailingObjects()); + std::uninitialized_copy(Text.begin(), Text.end(), getTrailingObjects()); } public: @@ -50,7 +49,7 @@ class OwnedString { /// data. void operator delete(void *p) { ::operator delete(p); } - const char *getText() const { return getTrailingObjects(); } + const char *getText() const { return getTrailingObjects(); } }; /// The text this owned string represents From e246f0de591423694b7bed3f1e7d6e6f0d73b084 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 24 Jul 2025 07:38:27 +0100 Subject: [PATCH 071/100] DebugInfo: Stop setting `FlagObjectPointer` without being certain that the parameter is `self` The stable/21.x branch is not happy with us setting the object pointer flag here because it now asserts that this flag is set for at most one function parameter. We should add a dedicated routine for instance method parameters. For now, stop setting the flag altogether to unblock the stdlib build on rebranch. --- lib/IRGen/IRGenDebugInfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index 3599c5903e1e7..b292f93129f01 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -1941,7 +1941,8 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo { nullptr, PtrSize, 0, /* DWARFAddressSpace */ std::nullopt, MangledName); - return DBuilder.createObjectPointerType(PTy, /*Implicit=*/true); + // FIXME: Set DIFlagObjectPointer and make sure it is only set for `self`. + return PTy; } case TypeKind::BuiltinExecutor: { return createDoublePointerSizedStruct( From 7568436079eb1399005d9f68bda4f09103e30a00 Mon Sep 17 00:00:00 2001 From: Ben Barham Date: Tue, 29 Jul 2025 17:56:43 -0700 Subject: [PATCH 072/100] Bump clang to 21.0.0 to match 21.x --- utils/build_swift/build_swift/defaults.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/build_swift/build_swift/defaults.py b/utils/build_swift/build_swift/defaults.py index 3a155f679913d..23669facd4058 100644 --- a/utils/build_swift/build_swift/defaults.py +++ b/utils/build_swift/build_swift/defaults.py @@ -48,7 +48,7 @@ COMPILER_VENDOR = 'none' SWIFT_USER_VISIBLE_VERSION = Version('6.2') -CLANG_USER_VISIBLE_VERSION = Version('17.0.0') +CLANG_USER_VISIBLE_VERSION = Version('21.0.0') SWIFT_ANALYZE_CODE_COVERAGE = 'false' DARWIN_XCRUN_TOOLCHAIN = 'default' From 1b105d5685cd2c7e37ddc320bbf413c5b5305154 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 30 Jul 2025 23:00:57 +0100 Subject: [PATCH 073/100] [test] DebugInfo: Adjust test to pass after e246f0de591423694b7bed3f1e7d6e6f0d73b084 --- test/DebugInfo/EagerTypeMetadata.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/DebugInfo/EagerTypeMetadata.swift b/test/DebugInfo/EagerTypeMetadata.swift index 1f53cb5cae90e..e216d788fc7de 100644 --- a/test/DebugInfo/EagerTypeMetadata.swift +++ b/test/DebugInfo/EagerTypeMetadata.swift @@ -13,6 +13,6 @@ public class C } // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "T", // CHECK-SAME: baseType: ![[PTRTY:[0-9]+]] -// CHECK: ![[PTRTY]] = !DIDerivedType(tag: DW_TAG_pointer_type, name: "$sBpD", baseType: null, size: {{64|32}}, flags: DIFlagArtificial | DIFlagObjectPointer) +// CHECK: ![[PTRTY]] = !DIDerivedType(tag: DW_TAG_pointer_type, name: "$sBpD", baseType: null, size: {{64|32}}) // CHECK: ![[LOC]] = !DILocation(line: 0, From 5a456c5c3ffc80297787e276f16649002091f3ae Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 30 Jul 2025 23:27:50 +0100 Subject: [PATCH 074/100] DebugInfo: Bring back accidentally dropped `DIFlagArtificial` flag Patches up https://github.com/swiftlang/swift/pull/83283. --- lib/IRGen/IRGenDebugInfo.cpp | 2 +- test/DebugInfo/EagerTypeMetadata.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index 23f40eabbfafb..2dd698b3ff362 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -1946,7 +1946,7 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo { /* DWARFAddressSpace */ std::nullopt, MangledName); // FIXME: Set DIFlagObjectPointer and make sure it is only set for `self`. - return PTy; + return DBuilder.createArtificialType(PTy); } case TypeKind::BuiltinExecutor: { return createDoublePointerSizedStruct( diff --git a/test/DebugInfo/EagerTypeMetadata.swift b/test/DebugInfo/EagerTypeMetadata.swift index e216d788fc7de..a0541bd076a4a 100644 --- a/test/DebugInfo/EagerTypeMetadata.swift +++ b/test/DebugInfo/EagerTypeMetadata.swift @@ -13,6 +13,6 @@ public class C } // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "T", // CHECK-SAME: baseType: ![[PTRTY:[0-9]+]] -// CHECK: ![[PTRTY]] = !DIDerivedType(tag: DW_TAG_pointer_type, name: "$sBpD", baseType: null, size: {{64|32}}) +// CHECK: ![[PTRTY]] = !DIDerivedType(tag: DW_TAG_pointer_type, name: "$sBpD", baseType: null, size: {{64|32}}, flags: DIFlagArtificial) // CHECK: ![[LOC]] = !DILocation(line: 0, From 1de3e1425293b373d57b7105f4df76a33136a107 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 31 Jul 2025 11:43:26 +0100 Subject: [PATCH 075/100] Revert "DebugInfo: Bring back accidentally dropped `DIFlagArtificial` flag" This reverts commit 5a456c5c3ffc80297787e276f16649002091f3ae. --- lib/IRGen/IRGenDebugInfo.cpp | 2 +- test/DebugInfo/EagerTypeMetadata.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index 2dd698b3ff362..23f40eabbfafb 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -1946,7 +1946,7 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo { /* DWARFAddressSpace */ std::nullopt, MangledName); // FIXME: Set DIFlagObjectPointer and make sure it is only set for `self`. - return DBuilder.createArtificialType(PTy); + return PTy; } case TypeKind::BuiltinExecutor: { return createDoublePointerSizedStruct( diff --git a/test/DebugInfo/EagerTypeMetadata.swift b/test/DebugInfo/EagerTypeMetadata.swift index a0541bd076a4a..e216d788fc7de 100644 --- a/test/DebugInfo/EagerTypeMetadata.swift +++ b/test/DebugInfo/EagerTypeMetadata.swift @@ -13,6 +13,6 @@ public class C } // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "T", // CHECK-SAME: baseType: ![[PTRTY:[0-9]+]] -// CHECK: ![[PTRTY]] = !DIDerivedType(tag: DW_TAG_pointer_type, name: "$sBpD", baseType: null, size: {{64|32}}, flags: DIFlagArtificial) +// CHECK: ![[PTRTY]] = !DIDerivedType(tag: DW_TAG_pointer_type, name: "$sBpD", baseType: null, size: {{64|32}}) // CHECK: ![[LOC]] = !DILocation(line: 0, From 5b74382f486b9fbf7f61185af2c5d389ec1234e8 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 31 Jul 2025 20:02:58 +0100 Subject: [PATCH 076/100] [test] ClangImporter: Add missing header search path `ImportsMissingHeaderIndirect` is in `custom-modules\more-custom-modules`, which is not on the header search path. Clang no longer recurses into subdirectories to find modules. --- test/ClangImporter/broken-modules.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/ClangImporter/broken-modules.swift b/test/ClangImporter/broken-modules.swift index 7ca1bda9e8ca6..288d59791787b 100644 --- a/test/ClangImporter/broken-modules.swift +++ b/test/ClangImporter/broken-modules.swift @@ -1,6 +1,6 @@ // RUN: not %target-swift-frontend -typecheck %s -I %S/Inputs/custom-modules/ -enable-objc-interop -show-diagnostics-after-fatal -D MISSING_FROM_MODULE -o /dev/null 2>&1 | %FileCheck -check-prefix CHECK-MODULE-MAP %s // RUN: not %target-swift-frontend -typecheck %s -I %S/Inputs/custom-modules/ -enable-objc-interop -show-diagnostics-after-fatal -o /dev/null 2>&1 | %FileCheck -check-prefix CHECK -check-prefix CHECK-DIRECT %s -// RUN: not %target-swift-frontend -typecheck %s -I %S/Inputs/custom-modules/ -enable-objc-interop -show-diagnostics-after-fatal -D INDIRECT -o /dev/null 2>&1 | %FileCheck -check-prefix CHECK -check-prefix CHECK-INDIRECT %s +// RUN: not %target-swift-frontend -typecheck %s -I %S/Inputs/custom-modules/ -I %S/Inputs/custom-modules/more-custom-modules -enable-objc-interop -show-diagnostics-after-fatal -D INDIRECT -o /dev/null 2>&1 | %FileCheck -check-prefix CHECK -check-prefix CHECK-INDIRECT %s // FIXME: not every test here depends on Objective-C syntax, this test can be split. From d510e471d6970fda12f0d40e9b6fe811fd69adb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= Date: Thu, 17 Oct 2024 14:40:33 +0200 Subject: [PATCH 077/100] Reapply "Drop references to clang-pseudo-gen after removal" pseudo was removed from clang-tools-extra in upstream PR https://github.com/llvm/llvm-project/pull/109154 Drop two explicit references in swift and unblock Windows CI --- utils/build.ps1 | 2 +- utils/swift_build_support/swift_build_support/products/llvm.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/utils/build.ps1 b/utils/build.ps1 index c81cd74982691..7e10e441a6f6f 100644 --- a/utils/build.ps1 +++ b/utils/build.ps1 @@ -1854,7 +1854,7 @@ function Build-BuildTools([Hashtable] $Platform) { -Bin (Get-ProjectBinaryCache $Platform BuildTools) ` -Platform $Platform ` -UseMSVCCompilers ASM_MASM,C,CXX ` - -BuildTargets llvm-tblgen,clang-tblgen,clang-pseudo-gen,clang-tidy-confusable-chars-gen,lldb-tblgen,llvm-config,swift-def-to-strings-converter,swift-serialize-diagnostics,swift-compatibility-symbols ` + -BuildTargets llvm-tblgen,clang-tblgen,clang-tidy-confusable-chars-gen,lldb-tblgen,llvm-config,swift-def-to-strings-converter,swift-serialize-diagnostics,swift-compatibility-symbols ` -Defines @{ CMAKE_CROSSCOMPILING = "NO"; CLANG_ENABLE_LIBXML2 = "NO"; diff --git a/utils/swift_build_support/swift_build_support/products/llvm.py b/utils/swift_build_support/swift_build_support/products/llvm.py index 8b137df5b2fed..49049e211cac3 100644 --- a/utils/swift_build_support/swift_build_support/products/llvm.py +++ b/utils/swift_build_support/swift_build_support/products/llvm.py @@ -443,8 +443,6 @@ def build(self, host_target): 'clang-tidy-confusable-chars-gen') llvm_cmake_options.define('CLANG_TIDY_CONFUSABLE_CHARS_GEN', confusable_chars_gen) - pseudo_gen = os.path.join(host_build_dir, 'bin', 'clang-pseudo-gen') - llvm_cmake_options.define('CLANG_PSEUDO_GEN', pseudo_gen) llvm = os.path.join(host_build_dir, 'llvm') llvm_cmake_options.define('LLVM_NATIVE_BUILD', llvm) From b103f31a3d7cc7cfd2e4570276e5c92f838af5de Mon Sep 17 00:00:00 2001 From: Steven Wu Date: Tue, 5 Aug 2025 13:38:58 -0700 Subject: [PATCH 078/100] [TEST-ONLY] Check swift generated PCM has correct dwo path This is a testcase for rdar://156759645 --- test/CAS/debug_info_pcm.swift | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 test/CAS/debug_info_pcm.swift diff --git a/test/CAS/debug_info_pcm.swift b/test/CAS/debug_info_pcm.swift new file mode 100644 index 0000000000000..2bd1f56b8eb43 --- /dev/null +++ b/test/CAS/debug_info_pcm.swift @@ -0,0 +1,43 @@ +// REQUIRES: OS=macosx +// RUN: %empty-directory(%t) +// RUN: split-file %s %t + +// RUN: %target-swift-frontend -scan-dependencies -module-name Test -module-cache-path %t/clang-module-cache -O \ +// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ +// RUN: %t/test.swift -o %t/deps.json -cache-compile-job -cas-path %t/cas -I %t/include + +// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json clang:SwiftShims > %t/shim.cmd +// RUN: %swift_frontend_plain @%t/shim.cmd +// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json clang:B > %t/B.cmd +// RUN: %swift_frontend_plain @%t/B.cmd +// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json clang:A > %t/A.cmd +// RUN: %swift_frontend_plain @%t/A.cmd +// RUN: %{python} %S/Inputs/SwiftDepsExtractor.py %t/deps.json clang:A modulePath > %t/A.path + +// RUN: dwarfdump --debug-info @%t/A.path | %FileCheck %s + +// CHECK: DW_AT_GNU_dwo_name +// CHECK-SAME: BUILD_DIR + +//--- test.swift +import A + +//--- include/a.h +#include "b.h" +struct A { + int a; +}; + +//--- include/b.h +void b(void); + +//--- include/module.modulemap +module A { + header "a.h" + export * +} + +module B { + header "b.h" + export * +} From 8d763321c125290ca31114850c24f0f534d6b016 Mon Sep 17 00:00:00 2001 From: Ben Barham Date: Wed, 13 Aug 2025 15:36:02 -0700 Subject: [PATCH 079/100] Temporarily disable debug info generation for async functions Temporary workaround for a compiler crash in rebranch: ``` location of #dbg_declare must be a pointer or int ``` --- lib/IRGen/IRGenDebugInfo.cpp | 5 +++++ test/DebugInfo/DynamicSelfLocation.swift | 1 + test/DebugInfo/async-args.swift | 1 + .../async-await-no-debug-info-after-split-point.swift | 1 + test/DebugInfo/async-boxed-arg.swift | 1 + test/DebugInfo/async-direct-arg.swift | 1 + test/DebugInfo/async-let-await.swift | 1 + test/DebugInfo/async-let.swift | 1 + test/DebugInfo/async-lifetime-extension.swift | 1 + test/DebugInfo/async-local-var.swift | 1 + test/DebugInfo/async-task-alloc.swift | 1 + test/DebugInfo/debug_fragment_merge.swift | 1 + test/DebugInfo/move_function_dbginfo_async.swift | 1 + test/DebugInfo/nonisolated_nonsending.swift | 1 + test/DebugInfo/sending_params_and_results.swift | 1 + 15 files changed, 19 insertions(+) diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index 23f40eabbfafb..e26d558358403 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -3741,6 +3741,11 @@ void IRGenDebugInfoImpl::emitDbgIntrinsic( llvm::DIExpression *Expr, unsigned Line, unsigned Col, llvm::DILocalScope *Scope, const SILDebugScope *DS, bool InCoroContext, AddrDbgInstrKind AddrDInstKind) { + // Workaround for debug info assertion in Verifier.cpp where the #dbg_declares + // have references to non ints and ptrs. + if (InCoroContext) + return; + Storage = Storage->stripPointerCasts(); // Set the location/scope of the intrinsic. auto *InlinedAt = createInlinedAt(DS); diff --git a/test/DebugInfo/DynamicSelfLocation.swift b/test/DebugInfo/DynamicSelfLocation.swift index 5226f3d096239..fd1de3bf745f0 100644 --- a/test/DebugInfo/DynamicSelfLocation.swift +++ b/test/DebugInfo/DynamicSelfLocation.swift @@ -1,5 +1,6 @@ // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-irgen -g -o - | %FileCheck %s // REQUIRES: concurrency +// REQUIRES: rdar157299589 func some_func(_: () -> Void) async {} diff --git a/test/DebugInfo/async-args.swift b/test/DebugInfo/async-args.swift index 9277378592534..2b7f57b01acc9 100644 --- a/test/DebugInfo/async-args.swift +++ b/test/DebugInfo/async-args.swift @@ -3,6 +3,7 @@ // RUN: -parse-as-library | %FileCheck %s // REQUIRES: concurrency +// REQUIRES: rdar157299589 func use(_ t: T) {} func forceSplit() async { diff --git a/test/DebugInfo/async-await-no-debug-info-after-split-point.swift b/test/DebugInfo/async-await-no-debug-info-after-split-point.swift index c85fa8b4c5157..27f5c393d4507 100644 --- a/test/DebugInfo/async-await-no-debug-info-after-split-point.swift +++ b/test/DebugInfo/async-await-no-debug-info-after-split-point.swift @@ -3,6 +3,7 @@ // RUN: -parse-as-library | %FileCheck %s --check-prefix=CHECK // REQUIRES: concurrency +// REQUIRES: rdar157299589 func ASYNC___1___() async -> Int { diff --git a/test/DebugInfo/async-boxed-arg.swift b/test/DebugInfo/async-boxed-arg.swift index d9aaf58faafa5..917a6e21ff354 100644 --- a/test/DebugInfo/async-boxed-arg.swift +++ b/test/DebugInfo/async-boxed-arg.swift @@ -1,6 +1,7 @@ // RUN: %target-swift-frontend %s -emit-ir -g -o - -parse-as-library \ // RUN: -module-name M -target %target-swift-5.1-abi-triple | %FileCheck %s // REQUIRES: concurrency +// REQUIRES: rdar157299589 @available(SwiftStdlib 5.1, *) extension Collection where Element: Sendable { diff --git a/test/DebugInfo/async-direct-arg.swift b/test/DebugInfo/async-direct-arg.swift index 60dbd21f3bec0..51a2dde8a8e23 100644 --- a/test/DebugInfo/async-direct-arg.swift +++ b/test/DebugInfo/async-direct-arg.swift @@ -3,6 +3,7 @@ // RUN: -parse-as-library | %FileCheck %s --check-prefix=CHECK // REQUIRES: concurrency // REQUIRES: CPU=x86_64 || CPU=arm64 +// REQUIRES: rdar157299589 // Test that x is described as a direct dbg.declare of the incoming function diff --git a/test/DebugInfo/async-let-await.swift b/test/DebugInfo/async-let-await.swift index 92de05a6a1486..8eccb9d11abac 100644 --- a/test/DebugInfo/async-let-await.swift +++ b/test/DebugInfo/async-let-await.swift @@ -4,6 +4,7 @@ // REQUIRES: concurrency // REQUIRES: CPU=x86_64 || CPU=arm64 +// REQUIRES: rdar157299589 public func getVegetables() async -> [String] { return ["leek", "carrot"] diff --git a/test/DebugInfo/async-let.swift b/test/DebugInfo/async-let.swift index 71cf35bc52235..2a63d12640e72 100644 --- a/test/DebugInfo/async-let.swift +++ b/test/DebugInfo/async-let.swift @@ -4,6 +4,7 @@ // REQUIRES: concurrency // REQUIRES: CPU=x86_64 || CPU=arm64 +// REQUIRES: rdar157299589 public actor Alice { let bob = Bob() diff --git a/test/DebugInfo/async-lifetime-extension.swift b/test/DebugInfo/async-lifetime-extension.swift index df69a88717b55..e9153179d694c 100644 --- a/test/DebugInfo/async-lifetime-extension.swift +++ b/test/DebugInfo/async-lifetime-extension.swift @@ -2,6 +2,7 @@ // RUN: -module-name a -target %target-swift-5.1-abi-triple \ // RUN: | %FileCheck %s --check-prefix=CHECK // REQUIRES: concurrency +// REQUIRES: rdar157299589 // Test that lifetime extension preserves a dbg.declare for "n" in the resume // funclet. diff --git a/test/DebugInfo/async-local-var.swift b/test/DebugInfo/async-local-var.swift index 4be2a024c0816..487d70d471ab6 100644 --- a/test/DebugInfo/async-local-var.swift +++ b/test/DebugInfo/async-local-var.swift @@ -3,6 +3,7 @@ // RUN: | %FileCheck %s --check-prefix=CHECK // REQUIRES: concurrency // REQUIRES: CPU=x86_64 || CPU=arm64 +// REQUIRES: rdar157299589 func getString() async -> String { return "" diff --git a/test/DebugInfo/async-task-alloc.swift b/test/DebugInfo/async-task-alloc.swift index 998337bc27a4a..59f4292fe2336 100644 --- a/test/DebugInfo/async-task-alloc.swift +++ b/test/DebugInfo/async-task-alloc.swift @@ -2,6 +2,7 @@ // RUN: -module-name a -target %target-swift-5.1-abi-triple \ // RUN: | %FileCheck %s --check-prefix=CHECK // REQUIRES: concurrency +// REQUIRES: rdar157299589 // Test dynamically allocated local variables in async functions. diff --git a/test/DebugInfo/debug_fragment_merge.swift b/test/DebugInfo/debug_fragment_merge.swift index 9824862905503..4d02d04b4e7ff 100644 --- a/test/DebugInfo/debug_fragment_merge.swift +++ b/test/DebugInfo/debug_fragment_merge.swift @@ -2,6 +2,7 @@ // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple -primary-file %s -Xllvm -sil-disable-pass=temp-lvalue-elimination -emit-irgen -O -g | %FileCheck %s // REQUIRES: CPU=arm64 || CPU=x86_64 || CPU=arm64e +// REQUIRES: rdar157299589 protocol External { func use(str: String); diff --git a/test/DebugInfo/move_function_dbginfo_async.swift b/test/DebugInfo/move_function_dbginfo_async.swift index f1811b3672edf..5e1196111ecc7 100644 --- a/test/DebugInfo/move_function_dbginfo_async.swift +++ b/test/DebugInfo/move_function_dbginfo_async.swift @@ -14,6 +14,7 @@ // slightly differently on other platforms. // REQUIRES: OS=macosx // REQUIRES: CPU=x86_64 || CPU=arm64 +// REQUIRES: rdar157299589 ////////////////// // Declarations // diff --git a/test/DebugInfo/nonisolated_nonsending.swift b/test/DebugInfo/nonisolated_nonsending.swift index fab39905c3b88..8376a1395b17e 100644 --- a/test/DebugInfo/nonisolated_nonsending.swift +++ b/test/DebugInfo/nonisolated_nonsending.swift @@ -1,5 +1,6 @@ // RUN: %target-swift-frontend -emit-ir -g %s -swift-version 6 -enable-upcoming-feature NonisolatedNonsendingByDefault // REQUIRES: swift_feature_NonisolatedNonsendingByDefault +// REQUIRES: rdar157299589 public protocol P: Sendable { func f(_: Int) async diff --git a/test/DebugInfo/sending_params_and_results.swift b/test/DebugInfo/sending_params_and_results.swift index 0e4c97dadabd2..ac827e5d35fa1 100644 --- a/test/DebugInfo/sending_params_and_results.swift +++ b/test/DebugInfo/sending_params_and_results.swift @@ -1,6 +1,7 @@ // RUN: %target-swift-frontend -emit-ir -g -o - -module-name test -strict-concurrency=complete -swift-version 5 -enable-upcoming-feature SendingArgsAndResults -target %target-swift-5.1-abi-triple %s | %FileCheck %s // REQUIRES: swift_feature_SendingArgsAndResults +// REQUIRES: rdar157299589 // Test that we can properly reconstruct sending from various tests when // emitting debug info. Only place examples in here that have already failed. From 35ed2080ba21fe003063fc05a52de5f478c3e5e4 Mon Sep 17 00:00:00 2001 From: Shubham Sandeep Rastogi Date: Fri, 22 Aug 2025 15:31:17 -0700 Subject: [PATCH 080/100] Revert "Temporarily disable debug info generation for async functions" This reverts commit 8d763321c125290ca31114850c24f0f534d6b016. --- lib/IRGen/IRGenDebugInfo.cpp | 5 ----- test/DebugInfo/DynamicSelfLocation.swift | 1 - test/DebugInfo/async-args.swift | 1 - .../async-await-no-debug-info-after-split-point.swift | 1 - test/DebugInfo/async-boxed-arg.swift | 1 - test/DebugInfo/async-direct-arg.swift | 1 - test/DebugInfo/async-let-await.swift | 1 - test/DebugInfo/async-let.swift | 1 - test/DebugInfo/async-lifetime-extension.swift | 1 - test/DebugInfo/async-local-var.swift | 1 - test/DebugInfo/async-task-alloc.swift | 1 - test/DebugInfo/debug_fragment_merge.swift | 1 - test/DebugInfo/move_function_dbginfo_async.swift | 1 - test/DebugInfo/nonisolated_nonsending.swift | 1 - test/DebugInfo/sending_params_and_results.swift | 1 - 15 files changed, 19 deletions(-) diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index e26d558358403..23f40eabbfafb 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -3741,11 +3741,6 @@ void IRGenDebugInfoImpl::emitDbgIntrinsic( llvm::DIExpression *Expr, unsigned Line, unsigned Col, llvm::DILocalScope *Scope, const SILDebugScope *DS, bool InCoroContext, AddrDbgInstrKind AddrDInstKind) { - // Workaround for debug info assertion in Verifier.cpp where the #dbg_declares - // have references to non ints and ptrs. - if (InCoroContext) - return; - Storage = Storage->stripPointerCasts(); // Set the location/scope of the intrinsic. auto *InlinedAt = createInlinedAt(DS); diff --git a/test/DebugInfo/DynamicSelfLocation.swift b/test/DebugInfo/DynamicSelfLocation.swift index fd1de3bf745f0..5226f3d096239 100644 --- a/test/DebugInfo/DynamicSelfLocation.swift +++ b/test/DebugInfo/DynamicSelfLocation.swift @@ -1,6 +1,5 @@ // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-irgen -g -o - | %FileCheck %s // REQUIRES: concurrency -// REQUIRES: rdar157299589 func some_func(_: () -> Void) async {} diff --git a/test/DebugInfo/async-args.swift b/test/DebugInfo/async-args.swift index 2b7f57b01acc9..9277378592534 100644 --- a/test/DebugInfo/async-args.swift +++ b/test/DebugInfo/async-args.swift @@ -3,7 +3,6 @@ // RUN: -parse-as-library | %FileCheck %s // REQUIRES: concurrency -// REQUIRES: rdar157299589 func use(_ t: T) {} func forceSplit() async { diff --git a/test/DebugInfo/async-await-no-debug-info-after-split-point.swift b/test/DebugInfo/async-await-no-debug-info-after-split-point.swift index 27f5c393d4507..c85fa8b4c5157 100644 --- a/test/DebugInfo/async-await-no-debug-info-after-split-point.swift +++ b/test/DebugInfo/async-await-no-debug-info-after-split-point.swift @@ -3,7 +3,6 @@ // RUN: -parse-as-library | %FileCheck %s --check-prefix=CHECK // REQUIRES: concurrency -// REQUIRES: rdar157299589 func ASYNC___1___() async -> Int { diff --git a/test/DebugInfo/async-boxed-arg.swift b/test/DebugInfo/async-boxed-arg.swift index 917a6e21ff354..d9aaf58faafa5 100644 --- a/test/DebugInfo/async-boxed-arg.swift +++ b/test/DebugInfo/async-boxed-arg.swift @@ -1,7 +1,6 @@ // RUN: %target-swift-frontend %s -emit-ir -g -o - -parse-as-library \ // RUN: -module-name M -target %target-swift-5.1-abi-triple | %FileCheck %s // REQUIRES: concurrency -// REQUIRES: rdar157299589 @available(SwiftStdlib 5.1, *) extension Collection where Element: Sendable { diff --git a/test/DebugInfo/async-direct-arg.swift b/test/DebugInfo/async-direct-arg.swift index 51a2dde8a8e23..60dbd21f3bec0 100644 --- a/test/DebugInfo/async-direct-arg.swift +++ b/test/DebugInfo/async-direct-arg.swift @@ -3,7 +3,6 @@ // RUN: -parse-as-library | %FileCheck %s --check-prefix=CHECK // REQUIRES: concurrency // REQUIRES: CPU=x86_64 || CPU=arm64 -// REQUIRES: rdar157299589 // Test that x is described as a direct dbg.declare of the incoming function diff --git a/test/DebugInfo/async-let-await.swift b/test/DebugInfo/async-let-await.swift index 8eccb9d11abac..92de05a6a1486 100644 --- a/test/DebugInfo/async-let-await.swift +++ b/test/DebugInfo/async-let-await.swift @@ -4,7 +4,6 @@ // REQUIRES: concurrency // REQUIRES: CPU=x86_64 || CPU=arm64 -// REQUIRES: rdar157299589 public func getVegetables() async -> [String] { return ["leek", "carrot"] diff --git a/test/DebugInfo/async-let.swift b/test/DebugInfo/async-let.swift index 2a63d12640e72..71cf35bc52235 100644 --- a/test/DebugInfo/async-let.swift +++ b/test/DebugInfo/async-let.swift @@ -4,7 +4,6 @@ // REQUIRES: concurrency // REQUIRES: CPU=x86_64 || CPU=arm64 -// REQUIRES: rdar157299589 public actor Alice { let bob = Bob() diff --git a/test/DebugInfo/async-lifetime-extension.swift b/test/DebugInfo/async-lifetime-extension.swift index e9153179d694c..df69a88717b55 100644 --- a/test/DebugInfo/async-lifetime-extension.swift +++ b/test/DebugInfo/async-lifetime-extension.swift @@ -2,7 +2,6 @@ // RUN: -module-name a -target %target-swift-5.1-abi-triple \ // RUN: | %FileCheck %s --check-prefix=CHECK // REQUIRES: concurrency -// REQUIRES: rdar157299589 // Test that lifetime extension preserves a dbg.declare for "n" in the resume // funclet. diff --git a/test/DebugInfo/async-local-var.swift b/test/DebugInfo/async-local-var.swift index 487d70d471ab6..4be2a024c0816 100644 --- a/test/DebugInfo/async-local-var.swift +++ b/test/DebugInfo/async-local-var.swift @@ -3,7 +3,6 @@ // RUN: | %FileCheck %s --check-prefix=CHECK // REQUIRES: concurrency // REQUIRES: CPU=x86_64 || CPU=arm64 -// REQUIRES: rdar157299589 func getString() async -> String { return "" diff --git a/test/DebugInfo/async-task-alloc.swift b/test/DebugInfo/async-task-alloc.swift index 59f4292fe2336..998337bc27a4a 100644 --- a/test/DebugInfo/async-task-alloc.swift +++ b/test/DebugInfo/async-task-alloc.swift @@ -2,7 +2,6 @@ // RUN: -module-name a -target %target-swift-5.1-abi-triple \ // RUN: | %FileCheck %s --check-prefix=CHECK // REQUIRES: concurrency -// REQUIRES: rdar157299589 // Test dynamically allocated local variables in async functions. diff --git a/test/DebugInfo/debug_fragment_merge.swift b/test/DebugInfo/debug_fragment_merge.swift index 4d02d04b4e7ff..9824862905503 100644 --- a/test/DebugInfo/debug_fragment_merge.swift +++ b/test/DebugInfo/debug_fragment_merge.swift @@ -2,7 +2,6 @@ // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple -primary-file %s -Xllvm -sil-disable-pass=temp-lvalue-elimination -emit-irgen -O -g | %FileCheck %s // REQUIRES: CPU=arm64 || CPU=x86_64 || CPU=arm64e -// REQUIRES: rdar157299589 protocol External { func use(str: String); diff --git a/test/DebugInfo/move_function_dbginfo_async.swift b/test/DebugInfo/move_function_dbginfo_async.swift index 5e1196111ecc7..f1811b3672edf 100644 --- a/test/DebugInfo/move_function_dbginfo_async.swift +++ b/test/DebugInfo/move_function_dbginfo_async.swift @@ -14,7 +14,6 @@ // slightly differently on other platforms. // REQUIRES: OS=macosx // REQUIRES: CPU=x86_64 || CPU=arm64 -// REQUIRES: rdar157299589 ////////////////// // Declarations // diff --git a/test/DebugInfo/nonisolated_nonsending.swift b/test/DebugInfo/nonisolated_nonsending.swift index 8376a1395b17e..fab39905c3b88 100644 --- a/test/DebugInfo/nonisolated_nonsending.swift +++ b/test/DebugInfo/nonisolated_nonsending.swift @@ -1,6 +1,5 @@ // RUN: %target-swift-frontend -emit-ir -g %s -swift-version 6 -enable-upcoming-feature NonisolatedNonsendingByDefault // REQUIRES: swift_feature_NonisolatedNonsendingByDefault -// REQUIRES: rdar157299589 public protocol P: Sendable { func f(_: Int) async diff --git a/test/DebugInfo/sending_params_and_results.swift b/test/DebugInfo/sending_params_and_results.swift index ac827e5d35fa1..0e4c97dadabd2 100644 --- a/test/DebugInfo/sending_params_and_results.swift +++ b/test/DebugInfo/sending_params_and_results.swift @@ -1,7 +1,6 @@ // RUN: %target-swift-frontend -emit-ir -g -o - -module-name test -strict-concurrency=complete -swift-version 5 -enable-upcoming-feature SendingArgsAndResults -target %target-swift-5.1-abi-triple %s | %FileCheck %s // REQUIRES: swift_feature_SendingArgsAndResults -// REQUIRES: rdar157299589 // Test that we can properly reconstruct sending from various tests when // emitting debug info. Only place examples in here that have already failed. From 3eb40fc19c015432710b9a8dbfe1157ead4e4e02 Mon Sep 17 00:00:00 2001 From: Shubham Sandeep Rastogi Date: Fri, 15 Aug 2025 10:50:56 -0700 Subject: [PATCH 081/100] Emit llvm.dbg.coroframe_entry instead of llvm.dbg.declare for async code. For swift async debug info, we create llvm.dbg.declare that contain locations which may not be a pointer or int. This is fine, because the CoroSplitter pass fixes up those llvm.dbg.declares later. However, with a recent change to the LLVM Verifier, there is a check that asserts if there is a llvm.dbg.declare with a location other than a pointer or an int. To workaround the problem, we created a new llvm.dbg.coroframe_entry intrinsic that doesn't have the same restriction as llvm.dbg.declare. This patch ensures that in async code, we now emit the new llvm.dbg.coroframe_entry intrinsic, instead of llvm.dbg.declare intrinsic rdar://157299589 rdar://157509307 --- lib/IRGen/IRGenDebugInfo.cpp | 28 +++++++++++++++++++++------- lib/IRGen/IRGenDebugInfo.h | 3 ++- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index 23f40eabbfafb..8bd99a812efa1 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -3679,16 +3679,16 @@ struct DbgIntrinsicEmitter { PointerUnion InsertPt; irgen::IRBuilder &IRBuilder; llvm::DIBuilder &DIBuilder; - AddrDbgInstrKind ForceDbgDeclare; + AddrDbgInstrKind ForceDbgDeclareOrCoro; /// Initialize the emitter and initialize the emitter to assume that it is /// going to insert an llvm.dbg.declare or an llvm.dbg.addr either at the /// current "generalized insertion point" of the IRBuilder. The "generalized /// insertion point" is DbgIntrinsicEmitter(irgen::IRBuilder &IRBuilder, llvm::DIBuilder &DIBuilder, - AddrDbgInstrKind ForceDebugDeclare) + AddrDbgInstrKind AddrDInstrKind) : InsertPt(), IRBuilder(IRBuilder), DIBuilder(DIBuilder), - ForceDbgDeclare(ForceDebugDeclare) { + ForceDbgDeclareOrCoro(AddrDInstrKind) { auto *ParentBB = IRBuilder.GetInsertBlock(); auto InsertBefore = IRBuilder.GetInsertPoint(); @@ -3715,9 +3715,14 @@ struct DbgIntrinsicEmitter { llvm::DIExpression *Expr, const llvm::DILocation *DL, llvm::Instruction *InsertBefore) { - if (ForceDbgDeclare == AddrDbgInstrKind::DbgDeclare) + if (ForceDbgDeclareOrCoro == AddrDbgInstrKind::DbgDeclare) return DIBuilder.insertDeclare(Addr, VarInfo, Expr, DL, InsertBefore->getIterator()); + + if (ForceDbgDeclareOrCoro == AddrDbgInstrKind::DbgCoroFrameEntry) + return DIBuilder.insertCoroFrameEntry(Addr, VarInfo, Expr, DL, + InsertBefore->getIterator()); + Expr = llvm::DIExpression::append(Expr, llvm::dwarf::DW_OP_deref); return DIBuilder.insertDbgValueIntrinsic(Addr, VarInfo, Expr, DL, InsertBefore->getIterator()); @@ -3727,8 +3732,12 @@ struct DbgIntrinsicEmitter { llvm::DIExpression *Expr, const llvm::DILocation *DL, llvm::BasicBlock *Block) { - if (ForceDbgDeclare == AddrDbgInstrKind::DbgDeclare) + if (ForceDbgDeclareOrCoro == AddrDbgInstrKind::DbgDeclare) return DIBuilder.insertDeclare(Addr, VarInfo, Expr, DL, Block); + + if (ForceDbgDeclareOrCoro == AddrDbgInstrKind::DbgCoroFrameEntry) + return DIBuilder.insertCoroFrameEntry(Addr, VarInfo, Expr, DL, Block); + Expr = llvm::DIExpression::append(Expr, llvm::dwarf::DW_OP_deref); return DIBuilder.insertDbgValueIntrinsic(Addr, VarInfo, Expr, DL, Block); } @@ -3788,13 +3797,17 @@ void IRGenDebugInfoImpl::emitDbgIntrinsic( if (optimized && (!InCoroContext || !Var->isParameter())) AddrDInstKind = AddrDbgInstrKind::DbgValueDeref; + if (InCoroContext && AddrDInstKind != AddrDbgInstrKind::DbgValueDeref) + AddrDInstKind = AddrDbgInstrKind::DbgCoroFrameEntry; + DbgIntrinsicEmitter inserter{Builder, DBuilder, AddrDInstKind}; // If we have a single alloca... if (auto *Alloca = dyn_cast(Storage)) { auto InsertBefore = Builder.GetInsertPoint(); - if (AddrDInstKind == AddrDbgInstrKind::DbgDeclare) { + if (AddrDInstKind == AddrDbgInstrKind::DbgDeclare || + AddrDInstKind == AddrDbgInstrKind::DbgCoroFrameEntry) { ParentBlock = Alloca->getParent(); InsertBefore = std::next(Alloca->getIterator()); } @@ -3821,7 +3834,8 @@ void IRGenDebugInfoImpl::emitDbgIntrinsic( // splitter that in split coroutines we always create debug info for values // in the coroutine context by creating a llvm.dbg.declare for the variable // in the entry block of each funclet. - if (AddrDInstKind == AddrDbgInstrKind::DbgDeclare) { + if (AddrDInstKind == AddrDbgInstrKind::DbgDeclare || + AddrDInstKind == AddrDbgInstrKind::DbgCoroFrameEntry) { // Function arguments in async functions are emitted without a shadow copy // (that would interfere with coroutine splitting) but with a // llvm.dbg.declare to give CoroSplit.cpp license to emit a shadow copy diff --git a/lib/IRGen/IRGenDebugInfo.h b/lib/IRGen/IRGenDebugInfo.h index 4007bf3178a25..364f357deb3a3 100644 --- a/lib/IRGen/IRGenDebugInfo.h +++ b/lib/IRGen/IRGenDebugInfo.h @@ -50,9 +50,10 @@ enum ArtificialKind : bool { RealValue = false, ArtificialValue = true }; /// instead of dbg.value + op_deref. By default, we now emit dbg.value instead of /// dbg.declare for normal variables. This is not true for metadata which /// truly are function wide and should be llvm.dbg.declare. -enum class AddrDbgInstrKind : bool { +enum class AddrDbgInstrKind : uint8_t { DbgDeclare, DbgValueDeref, + DbgCoroFrameEntry, }; /// Helper object that keeps track of the current CompileUnit, File, From 75bee892becff1a79349de1e08e25b4883089537 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Thu, 14 Aug 2025 19:37:25 -0700 Subject: [PATCH 082/100] Add LLDB and swift-reflection-dump support for WebAssembly This patch adds parsing and extracting of the Swift reflection metadata data segments from within the WebAssembly DATA section and tests it using swift-reflection-dump. This is needed to allow LLDB to acces Swift reflection metadata when attached to WebAssembly processes. rdar://159217213 --- include/swift/ABI/ObjectFile.h | 25 +- .../RemoteInspection/ReflectionContext.h | 312 +++++++++- .../RuntimeHeaders/llvm/BinaryFormat/Wasm.h | 581 ++++++++++++++++++ .../llvm/BinaryFormat/WasmRelocs.def | 31 + .../swift/StaticMirror/ObjectFileContext.h | 2 + lib/Demangling/NodePrinter.cpp | 22 +- lib/StaticMirror/ObjectFileContext.cpp | 35 ++ test/Reflection/Inputs/wasm.yaml | 443 +++++++++++++ test/Reflection/wasm.test | 28 + test/lit.cfg | 2 + .../swift-reflection-dump.cpp | 6 +- 11 files changed, 1477 insertions(+), 10 deletions(-) create mode 100644 include/swift/RemoteInspection/RuntimeHeaders/llvm/BinaryFormat/Wasm.h create mode 100644 include/swift/RemoteInspection/RuntimeHeaders/llvm/BinaryFormat/WasmRelocs.def create mode 100644 test/Reflection/Inputs/wasm.yaml create mode 100644 test/Reflection/wasm.test diff --git a/include/swift/ABI/ObjectFile.h b/include/swift/ABI/ObjectFile.h index 2158215c4862f..fddf9c7e064e2 100644 --- a/include/swift/ABI/ObjectFile.h +++ b/include/swift/ABI/ObjectFile.h @@ -83,7 +83,7 @@ class SwiftObjectFileFormatELF : public SwiftObjectFileFormat { } }; -/// Responsible for providing the COFF reflection section identifiers +/// Responsible for providing the COFF reflection section identifiers. class SwiftObjectFileFormatCOFF : public SwiftObjectFileFormat { public: llvm::StringRef getSectionName(ReflectionSectionKind section) override { @@ -101,5 +101,28 @@ class SwiftObjectFileFormatCOFF : public SwiftObjectFileFormat { return sectionName.starts_with(".sw5"); } }; + +/// Responsible for providing the WebAssembly reflection section identifiers. +/// WebAssembly binaries store all reflection metadata in the DATA +/// section. There are symbols for each reflection section kind in the "name" +/// section that point to the corresponding offset inside DATA. +class SwiftObjectFileFormatWasm : public SwiftObjectFileFormat { +public: + llvm::StringRef getSectionName(ReflectionSectionKind section) override { + switch (section) { +#define HANDLE_SWIFT_SECTION(KIND, MACHO, ELF, COFF) \ + case KIND: \ + return ELF; +#include "llvm/BinaryFormat/Swift.def" +#undef HANDLE_SWIFT_SECTION + } + llvm_unreachable("Section not found."); + } + + bool sectionContainsReflectionData(llvm::StringRef sectionName) override { + return sectionName.starts_with("swift5_"); + } +}; + } // namespace swift #endif // SWIFT_ABI_OBJECTFILE_H diff --git a/include/swift/RemoteInspection/ReflectionContext.h b/include/swift/RemoteInspection/ReflectionContext.h index c7526d41c6b23..3077980f3b53f 100644 --- a/include/swift/RemoteInspection/ReflectionContext.h +++ b/include/swift/RemoteInspection/ReflectionContext.h @@ -18,13 +18,14 @@ #ifndef SWIFT_REFLECTION_REFLECTIONCONTEXT_H #define SWIFT_REFLECTION_REFLECTIONCONTEXT_H +#include "llvm/ADT/STLExtras.h" #include "llvm/BinaryFormat/COFF.h" -#include "llvm/BinaryFormat/MachO.h" #include "llvm/BinaryFormat/ELF.h" +#include "llvm/BinaryFormat/MachO.h" +#include "llvm/BinaryFormat/Wasm.h" #include "llvm/Object/COFF.h" #include "llvm/Support/Error.h" #include "llvm/Support/Memory.h" -#include "llvm/ADT/STLExtras.h" #include "swift/ABI/Enum.h" #include "swift/ABI/ObjectFile.h" @@ -40,6 +41,8 @@ #include "swift/RemoteInspection/TypeRefBuilder.h" #include "swift/Basic/Unreachable.h" +#include +#include #include #include #include @@ -72,6 +75,11 @@ #define HAS_DISPATCH_LOCK_IS_LOCKED 1 #endif +#define DEBUG_TYPE "reflection" +#ifdef SWIFT_RUNTIME +#undef LLVM_DEBUG +#define LLVM_DEBUG(IGNORE) +#endif namespace { template struct MachOTraits; @@ -799,6 +807,297 @@ class ReflectionContext } } + /// Parses metadata information from a WebAssembly image. + /// + /// + /// \param[in] ImageStart + /// A remote address pointing to the start of the image in the running + /// process. + /// + /// \param[in] FileBuffer + /// A buffer which contains the contents of the image's file + /// in disk. If missing, all the information will be read using the + /// instance's memory reader. + /// + /// \return The newly added reflection info ID if successful, \b std::nullopt + /// otherwise. + std::optional + readWasm(RemoteAddress ImageStart, + std::optional FileBuffer, + llvm::SmallVector PotentialModuleNames) { + /// A WASM data segment. The reflection metadata "sections" are DATA + /// segments. + struct Segment { + RemoteAddress remoteAddr; + uint64_t offset; + uint64_t size; + }; + std::map sections; + std::vector segments; + auto &reader = getReader(); + RemoteAddress cursor = ImageStart; + cursor += sizeof(llvm::wasm::WasmMagic) + sizeof(llvm::wasm::WasmVersion); + + /// Decode one byte and move the cursor. + auto decodeU8 = [&reader, &cursor](uint8_t &b) -> bool { + if (!reader.readInteger(cursor, 1, &b)) + return false; + cursor += 1; + return true; + }; + + /// Decode 32-bit ULEB constants. + auto decodeULEB32 = [&](uint32_t &val) -> bool { + uint64_t result = 0; + uint8_t b; + for (uint8_t n = 0; n < 5; ++n) { + if (!decodeU8(b)) + return false; + result |= (b & ~(1 << 7)) << 7 * n; + if ((b & (1 << 7)) == 0) + break; + } + if (result > std::numeric_limits::max()) + return false; + memcpy(&val, &result, 4); + return true; + }; + + /// Decode a string. + auto decodeString = [&](std::string &str) -> bool { + uint32_t len; + if (!decodeULEB32(len)) + return false; + auto chars = reader.readBytes(cursor, len); + if (!chars) + return false; + str = std::string((const char *)chars.get(), len); + cursor += len; + chars.release(); + return true; + }; + + /// Decode one section header. + auto decodeSection = [&]() -> bool { + uint8_t sectionID; + if (!decodeU8(sectionID)) + return false; + + if (sectionID > llvm::wasm::WASM_SEC_LAST_KNOWN) + return false; + + uint32_t payloadLen; + if (!decodeULEB32(payloadLen)) + return false; + RemoteAddress payloadStart = cursor; + std::string sectName; + if (sectionID == llvm::wasm::WASM_SEC_CUSTOM) { + if (!decodeString(sectName)) + return false; + RemoteAddress sectionStart = cursor; + sections.insert( + {sectName, {cursor, 0, payloadLen - (sectionStart - cursor)}}); + } else { + sectName = llvm::wasm::sectionTypeToString(sectionID); + sections.insert({sectName, {cursor, 0, payloadLen}}); + } + LLVM_DEBUG(llvm::dbgs() + << "section " << sectName << " size=" << payloadLen << "\n"); + + cursor = payloadStart + payloadLen; + return true; + }; + + // Decode the DATA segments. + auto decodeData = [&](uint64_t sectLength) -> bool { + RemoteAddress start = cursor; + RemoteAddress end = start + sectLength; + uint32_t count; + + auto decodeActiveSegmentOffset = [&]() -> std::optional { + uint32_t offset = 0; + while (true) { + uint8_t b; + if (!decodeU8(b)) + return {}; + + if (b == llvm::wasm::WASM_OPCODE_I32_CONST) { + if (!decodeULEB32(offset)) // FIXME: Actually an SLEB. + return {}; + } else if (b == llvm::wasm::WASM_OPCODE_END) { + break; + } else { + // Unhandled opcode. + return {}; + } + } + return offset; + }; + + if (!decodeULEB32(count)) + return false; + // Parse the segment header. + for (uint32_t i = 0; i < count && cursor < end; ++i) { + uint32_t flags; + uint32_t offset = 0; + if (!decodeULEB32(flags)) + return false; + if ((flags & 2) == 2) { + uint32_t memidx; + if (!decodeULEB32(memidx)) + return false; + } + if ((flags & 1) == 0) { + auto offsOrErr = decodeActiveSegmentOffset(); + if (!offsOrErr) + return false; + offset = *offsOrErr; + } + uint32_t size; + if (!decodeULEB32(size)) + return false; + LLVM_DEBUG(llvm::dbgs() + << "Segment[" << i << "]: flags=" << flags + << " offset=" << offset << " size=" << size << "\n"); + segments.push_back({cursor, offset, size}); + cursor += size; + } + return true; + }; + // Decode the NAMES table pointing to the DATA segments. + auto decodeNames = [&](uint64_t sectLength) -> bool { + RemoteAddress start = cursor; + RemoteAddress end = start + sectLength; + while (cursor < end) { + uint8_t type; + if (!decodeU8(type)) + return false; + uint32_t len; + if (!decodeULEB32(len)) + return false; + if (type == llvm::wasm::WASM_NAMES_DATA_SEGMENT) { + uint32_t count; + if (!decodeULEB32(count)) + return false; + for (uint32_t i = 0; i < count; ++i) { + uint32_t idx; + if (!decodeULEB32(idx)) + return false; + std::string sectName; + if (!decodeString(sectName)) + return false; + if (idx >= segments.size()) + return false; + LLVM_DEBUG(llvm::dbgs() << sectName << ": " << idx << "\n"); + sections[sectName] = segments[idx]; + } + } + cursor += len; + } + return true; + }; + // Decode the LINK section of object files. + auto decodeLinking = [&](RemoteAddress dataStart, + uint64_t sectLength) -> bool { + RemoteAddress start = cursor; + RemoteAddress end = start + sectLength; + + uint32_t version; + if (!decodeULEB32(version) || version != 2) + return false; + while (cursor < end) { + uint8_t type; + if (!decodeU8(type)) + return false; + uint32_t len; + if (!decodeULEB32(len)) + return false; + if (type == llvm::wasm::WASM_SEGMENT_INFO) { + uint32_t count; + if (!decodeULEB32(count)) + return false; + for (uint32_t idx = 0; idx < count; ++idx) { + std::string sectName; + if (!decodeString(sectName)) + return false; + uint32_t align; + if (!decodeULEB32(align)) + return false; + uint32_t flags; + if (!decodeULEB32(flags)) + return false; + LLVM_DEBUG(llvm::dbgs() << sectName << ": " << idx << "\n"); + sections[sectName] = segments[idx]; + } + } + cursor += len; + } + return true; + }; + + while (decodeSection()) { + }; + auto dataSect = sections.find("DATA"); + if (dataSect == sections.end()) + return false; + + auto [dataStart, _, dataLength] = dataSect->second; + cursor = dataStart; + if (!decodeData(dataLength)) + return false; + + auto nameSect = sections.find("name"); + if (nameSect != sections.end()) { + cursor = nameSect->second.remoteAddr; + if (!decodeNames(nameSect->second.size)) + return false; + } else { + // This may be an object file? + auto linkingSect = sections.find("linking"); + if (linkingSect == sections.end()) + return false; + cursor = linkingSect->second.remoteAddr; + if (!decodeLinking(dataStart, linkingSect->second.size)) + return false; + } + + // Find reflection sections within the data section segments. + auto lookup = + [&](const std::string &name) -> std::pair, uint64_t> { + auto sectionIt = sections.find(name); + if (sectionIt == sections.end()) + return {{}, 0}; + auto §ion = sectionIt->second; + RemoteAddress mappedSectionStart(0 + section.offset, + RemoteAddress::DefaultAddressSpace); + auto secBuf = reader.readBytes(section.remoteAddr, section.size); + auto secContents = RemoteRef(mappedSectionStart, secBuf.get()); + savedBuffers.push_back(std::move(secBuf)); + LLVM_DEBUG(llvm::dbgs() << name << " @ " << section.offset << "\n"); + return {secContents, section.size}; + }; + + auto FieldMdSec = lookup("swift5_fieldmd"); + auto AssocTySec = lookup("swift5_assocty"); + auto BuiltinTySec = lookup("swift5_builtin"); + auto CaptureSec = lookup("swift5_capture"); + auto TypeRefMdSec = lookup("swift5_typeref"); + auto ReflStrMdSec = lookup("swift5_reflstr"); + auto ConformMdSec = lookup("swift5_protocol_conformances"); + auto MPEnumMdSec = lookup("swift5_mpenum"); + + ReflectionInfo info = {{FieldMdSec.first, FieldMdSec.second}, + {AssocTySec.first, AssocTySec.second}, + {BuiltinTySec.first, BuiltinTySec.second}, + {CaptureSec.first, CaptureSec.second}, + {TypeRefMdSec.first, TypeRefMdSec.second}, + {ReflStrMdSec.first, ReflStrMdSec.second}, + {ConformMdSec.first, ConformMdSec.second}, + {MPEnumMdSec.first, MPEnumMdSec.second}, + PotentialModuleNames}; + return addReflectionInfo(info); + } + /// On success returns the ID of the newly registered Reflection Info. std::optional addImage(RemoteAddress ImageStart, @@ -827,7 +1126,6 @@ class ReflectionContext return readPECOFF(ImageStart, PotentialModuleNames); } - // ELF. if (MagicBytes[0] == llvm::ELF::ElfMagic[0] && MagicBytes[1] == llvm::ELF::ElfMagic[1] @@ -837,6 +1135,14 @@ class ReflectionContext PotentialModuleNames); } + // WASM. + if (MagicBytes[0] == llvm::wasm::WasmMagic[0] && + MagicBytes[1] == llvm::wasm::WasmMagic[1] && + MagicBytes[2] == llvm::wasm::WasmMagic[2] && + MagicBytes[3] == llvm::wasm::WasmMagic[3]) { + return readWasm(ImageStart, std::optional(), + PotentialModuleNames); + } // We don't recognize the format. return std::nullopt; } diff --git a/include/swift/RemoteInspection/RuntimeHeaders/llvm/BinaryFormat/Wasm.h b/include/swift/RemoteInspection/RuntimeHeaders/llvm/BinaryFormat/Wasm.h new file mode 100644 index 0000000000000..7c6e6494500bf --- /dev/null +++ b/include/swift/RemoteInspection/RuntimeHeaders/llvm/BinaryFormat/Wasm.h @@ -0,0 +1,581 @@ +//===- Wasm.h - Wasm object file format -------------------------*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// This file defines manifest constants for the wasm object file format. +// See: https://github.com/WebAssembly/design/blob/main/BinaryEncoding.md +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_BINARYFORMAT_WASM_H +#define LLVM_BINARYFORMAT_WASM_H + +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/Compiler.h" +#include + +namespace llvm { +namespace wasm { + +// Object file magic string. +const char WasmMagic[] = {'\0', 'a', 's', 'm'}; +// Wasm binary format version +const uint32_t WasmVersion = 0x1; +// Wasm linking metadata version +const uint32_t WasmMetadataVersion = 0x2; +// Wasm uses a 64k page size by default (but the custom-page-sizes proposal +// allows changing it) +const uint32_t WasmDefaultPageSize = 65536; + +enum : unsigned { + WASM_SEC_CUSTOM = 0, // Custom / User-defined section + WASM_SEC_TYPE = 1, // Function signature declarations + WASM_SEC_IMPORT = 2, // Import declarations + WASM_SEC_FUNCTION = 3, // Function declarations + WASM_SEC_TABLE = 4, // Indirect function table and other tables + WASM_SEC_MEMORY = 5, // Memory attributes + WASM_SEC_GLOBAL = 6, // Global declarations + WASM_SEC_EXPORT = 7, // Exports + WASM_SEC_START = 8, // Start function declaration + WASM_SEC_ELEM = 9, // Elements section + WASM_SEC_CODE = 10, // Function bodies (code) + WASM_SEC_DATA = 11, // Data segments + WASM_SEC_DATACOUNT = 12, // Data segment count + WASM_SEC_TAG = 13, // Tag declarations + WASM_SEC_LAST_KNOWN = WASM_SEC_TAG, +}; + +// Type immediate encodings used in various contexts. +enum : unsigned { + WASM_TYPE_I32 = 0x7F, + WASM_TYPE_I64 = 0x7E, + WASM_TYPE_F32 = 0x7D, + WASM_TYPE_F64 = 0x7C, + WASM_TYPE_V128 = 0x7B, + WASM_TYPE_NULLFUNCREF = 0x73, + WASM_TYPE_NULLEXTERNREF = 0x72, + WASM_TYPE_NULLEXNREF = 0x74, + WASM_TYPE_NULLREF = 0x71, + WASM_TYPE_FUNCREF = 0x70, + WASM_TYPE_EXTERNREF = 0x6F, + WASM_TYPE_EXNREF = 0x69, + WASM_TYPE_ANYREF = 0x6E, + WASM_TYPE_EQREF = 0x6D, + WASM_TYPE_I31REF = 0x6C, + WASM_TYPE_STRUCTREF = 0x6B, + WASM_TYPE_ARRAYREF = 0x6A, + WASM_TYPE_NONNULLABLE = 0x64, + WASM_TYPE_NULLABLE = 0x63, + WASM_TYPE_FUNC = 0x60, + WASM_TYPE_ARRAY = 0x5E, + WASM_TYPE_STRUCT = 0x5F, + WASM_TYPE_SUB = 0x50, + WASM_TYPE_SUB_FINAL = 0x4F, + WASM_TYPE_REC = 0x4E, + WASM_TYPE_NORESULT = 0x40, // for blocks with no result values +}; + +// Kinds of externals (for imports and exports). +enum : unsigned { + WASM_EXTERNAL_FUNCTION = 0x0, + WASM_EXTERNAL_TABLE = 0x1, + WASM_EXTERNAL_MEMORY = 0x2, + WASM_EXTERNAL_GLOBAL = 0x3, + WASM_EXTERNAL_TAG = 0x4, +}; + +// Opcodes used in initializer expressions. +enum : unsigned { + WASM_OPCODE_END = 0x0b, + WASM_OPCODE_CALL = 0x10, + WASM_OPCODE_LOCAL_GET = 0x20, + WASM_OPCODE_LOCAL_SET = 0x21, + WASM_OPCODE_LOCAL_TEE = 0x22, + WASM_OPCODE_GLOBAL_GET = 0x23, + WASM_OPCODE_GLOBAL_SET = 0x24, + WASM_OPCODE_I32_STORE = 0x36, + WASM_OPCODE_I64_STORE = 0x37, + WASM_OPCODE_I32_CONST = 0x41, + WASM_OPCODE_I64_CONST = 0x42, + WASM_OPCODE_F32_CONST = 0x43, + WASM_OPCODE_F64_CONST = 0x44, + WASM_OPCODE_I32_ADD = 0x6a, + WASM_OPCODE_I32_SUB = 0x6b, + WASM_OPCODE_I32_MUL = 0x6c, + WASM_OPCODE_I64_ADD = 0x7c, + WASM_OPCODE_I64_SUB = 0x7d, + WASM_OPCODE_I64_MUL = 0x7e, + WASM_OPCODE_REF_NULL = 0xd0, + WASM_OPCODE_REF_FUNC = 0xd2, + WASM_OPCODE_GC_PREFIX = 0xfb, +}; + +// Opcodes in the GC-prefixed space (0xfb) +enum : unsigned { + WASM_OPCODE_STRUCT_NEW = 0x00, + WASM_OPCODE_STRUCT_NEW_DEFAULT = 0x01, + WASM_OPCODE_ARRAY_NEW = 0x06, + WASM_OPCODE_ARRAY_NEW_DEFAULT = 0x07, + WASM_OPCODE_ARRAY_NEW_FIXED = 0x08, + WASM_OPCODE_REF_I31 = 0x1c, + // any.convert_extern and extern.convert_any don't seem to be supported by + // Binaryen. +}; + +// Opcodes used in synthetic functions. +enum : unsigned { + WASM_OPCODE_BLOCK = 0x02, + WASM_OPCODE_BR = 0x0c, + WASM_OPCODE_BR_TABLE = 0x0e, + WASM_OPCODE_RETURN = 0x0f, + WASM_OPCODE_DROP = 0x1a, + WASM_OPCODE_MISC_PREFIX = 0xfc, + WASM_OPCODE_MEMORY_INIT = 0x08, + WASM_OPCODE_MEMORY_FILL = 0x0b, + WASM_OPCODE_DATA_DROP = 0x09, + WASM_OPCODE_ATOMICS_PREFIX = 0xfe, + WASM_OPCODE_ATOMIC_NOTIFY = 0x00, + WASM_OPCODE_I32_ATOMIC_WAIT = 0x01, + WASM_OPCODE_I32_ATOMIC_STORE = 0x17, + WASM_OPCODE_I32_RMW_CMPXCHG = 0x48, +}; + +// Sub-opcodes for catch clauses in a try_table instruction +enum : unsigned { + WASM_OPCODE_CATCH = 0x00, + WASM_OPCODE_CATCH_REF = 0x01, + WASM_OPCODE_CATCH_ALL = 0x02, + WASM_OPCODE_CATCH_ALL_REF = 0x03, +}; + +enum : unsigned { + WASM_LIMITS_FLAG_NONE = 0x0, + WASM_LIMITS_FLAG_HAS_MAX = 0x1, + WASM_LIMITS_FLAG_IS_SHARED = 0x2, + WASM_LIMITS_FLAG_IS_64 = 0x4, + WASM_LIMITS_FLAG_HAS_PAGE_SIZE = 0x8, +}; + +enum : unsigned { + WASM_DATA_SEGMENT_IS_PASSIVE = 0x01, + WASM_DATA_SEGMENT_HAS_MEMINDEX = 0x02, +}; + +enum : unsigned { + WASM_ELEM_SEGMENT_IS_PASSIVE = 0x01, + WASM_ELEM_SEGMENT_IS_DECLARATIVE = 0x02, // if passive == 1 + WASM_ELEM_SEGMENT_HAS_TABLE_NUMBER = 0x02, // if passive == 0 + WASM_ELEM_SEGMENT_HAS_INIT_EXPRS = 0x04, +}; +const unsigned WASM_ELEM_SEGMENT_MASK_HAS_ELEM_DESC = 0x3; + +// Feature policy prefixes used in the custom "target_features" section +enum : uint8_t { + WASM_FEATURE_PREFIX_USED = '+', + WASM_FEATURE_PREFIX_DISALLOWED = '-', +}; + +// Kind codes used in the custom "name" section +enum : unsigned { + WASM_NAMES_MODULE = 0, + WASM_NAMES_FUNCTION = 1, + WASM_NAMES_LOCAL = 2, + WASM_NAMES_GLOBAL = 7, + WASM_NAMES_DATA_SEGMENT = 9, +}; + +// Kind codes used in the custom "linking" section +enum : unsigned { + WASM_SEGMENT_INFO = 0x5, + WASM_INIT_FUNCS = 0x6, + WASM_COMDAT_INFO = 0x7, + WASM_SYMBOL_TABLE = 0x8, +}; + +// Kind codes used in the custom "dylink" section +enum : unsigned { + WASM_DYLINK_MEM_INFO = 0x1, + WASM_DYLINK_NEEDED = 0x2, + WASM_DYLINK_EXPORT_INFO = 0x3, + WASM_DYLINK_IMPORT_INFO = 0x4, + WASM_DYLINK_RUNTIME_PATH = 0x5, +}; + +// Kind codes used in the custom "linking" section in the WASM_COMDAT_INFO +enum : unsigned { + WASM_COMDAT_DATA = 0x0, + WASM_COMDAT_FUNCTION = 0x1, + // GLOBAL, TAG, and TABLE are in here but LLVM doesn't use them yet. + WASM_COMDAT_SECTION = 0x5, +}; + +// Kind codes used in the custom "linking" section in the WASM_SYMBOL_TABLE +enum WasmSymbolType : unsigned { + WASM_SYMBOL_TYPE_FUNCTION = 0x0, + WASM_SYMBOL_TYPE_DATA = 0x1, + WASM_SYMBOL_TYPE_GLOBAL = 0x2, + WASM_SYMBOL_TYPE_SECTION = 0x3, + WASM_SYMBOL_TYPE_TAG = 0x4, + WASM_SYMBOL_TYPE_TABLE = 0x5, +}; + +enum WasmSegmentFlag : unsigned { + WASM_SEG_FLAG_STRINGS = 0x1, + WASM_SEG_FLAG_TLS = 0x2, + WASM_SEG_FLAG_RETAIN = 0x4, +}; + +// Kinds of tag attributes. +enum WasmTagAttribute : uint8_t { + WASM_TAG_ATTRIBUTE_EXCEPTION = 0x0, +}; + +const unsigned WASM_SYMBOL_BINDING_MASK = 0x3; +const unsigned WASM_SYMBOL_VISIBILITY_MASK = 0xc; + +const unsigned WASM_SYMBOL_BINDING_GLOBAL = 0x0; +const unsigned WASM_SYMBOL_BINDING_WEAK = 0x1; +const unsigned WASM_SYMBOL_BINDING_LOCAL = 0x2; +const unsigned WASM_SYMBOL_VISIBILITY_DEFAULT = 0x0; +const unsigned WASM_SYMBOL_VISIBILITY_HIDDEN = 0x4; +const unsigned WASM_SYMBOL_UNDEFINED = 0x10; +const unsigned WASM_SYMBOL_EXPORTED = 0x20; +const unsigned WASM_SYMBOL_EXPLICIT_NAME = 0x40; +const unsigned WASM_SYMBOL_NO_STRIP = 0x80; +const unsigned WASM_SYMBOL_TLS = 0x100; +const unsigned WASM_SYMBOL_ABSOLUTE = 0x200; + +#define WASM_RELOC(name, value) name = value, + +enum WasmRelocType : unsigned { +#include "WasmRelocs.def" +}; + +#undef WASM_RELOC + +struct WasmObjectHeader { + StringRef Magic; + uint32_t Version; +}; + +// Subset of types that a value can have +enum class ValType { + I32 = WASM_TYPE_I32, + I64 = WASM_TYPE_I64, + F32 = WASM_TYPE_F32, + F64 = WASM_TYPE_F64, + V128 = WASM_TYPE_V128, + FUNCREF = WASM_TYPE_FUNCREF, + EXTERNREF = WASM_TYPE_EXTERNREF, + EXNREF = WASM_TYPE_EXNREF, + // Unmodeled value types include ref types with heap types other than + // func, extern or exn, and type-specialized funcrefs + OTHERREF = 0xff, +}; + +struct WasmDylinkImportInfo { + StringRef Module; + StringRef Field; + uint32_t Flags; +}; + +struct WasmDylinkExportInfo { + StringRef Name; + uint32_t Flags; +}; + +struct WasmDylinkInfo { + uint32_t MemorySize; // Memory size in bytes + uint32_t MemoryAlignment; // P2 alignment of memory + uint32_t TableSize; // Table size in elements + uint32_t TableAlignment; // P2 alignment of table + std::vector Needed; // Shared library dependencies + std::vector ImportInfo; + std::vector ExportInfo; + std::vector RuntimePath; +}; + +struct WasmProducerInfo { + std::vector> Languages; + std::vector> Tools; + std::vector> SDKs; +}; + +struct WasmFeatureEntry { + uint8_t Prefix; + std::string Name; +}; + +struct WasmExport { + StringRef Name; + uint8_t Kind; + uint32_t Index; +}; + +struct WasmLimits { + uint8_t Flags; + uint64_t Minimum; + uint64_t Maximum; + uint32_t PageSize; +}; + +struct WasmTableType { + ValType ElemType; + WasmLimits Limits; +}; + +struct WasmTable { + uint32_t Index; + WasmTableType Type; + StringRef SymbolName; // from the "linking" section +}; + +struct WasmInitExprMVP { + uint8_t Opcode; + union { + int32_t Int32; + int64_t Int64; + uint32_t Float32; + uint64_t Float64; + uint32_t Global; + } Value; +}; + +// Extended-const init exprs and exprs with GC types are not explicitly +// modeled, but the raw body of the expr is attached. +struct WasmInitExpr { + uint8_t Extended; // Set to non-zero if extended const is used (i.e. more than + // one instruction) + WasmInitExprMVP Inst; + ArrayRef Body; +}; + +struct WasmGlobalType { + uint8_t Type; // TODO: make this a ValType? + bool Mutable; +}; + +struct WasmGlobal { + uint32_t Index; + WasmGlobalType Type; + WasmInitExpr InitExpr; + StringRef SymbolName; // from the "linking" section + uint32_t Offset; // Offset of the definition in the binary's Global section + uint32_t Size; // Size of the definition in the binary's Global section +}; + +struct WasmTag { + uint32_t Index; + uint32_t SigIndex; + StringRef SymbolName; // from the "linking" section +}; + +struct WasmImport { + StringRef Module; + StringRef Field; + uint8_t Kind; + union { + uint32_t SigIndex; + WasmGlobalType Global; + WasmTableType Table; + WasmLimits Memory; + }; +}; + +struct WasmLocalDecl { + uint8_t Type; + uint32_t Count; +}; + +struct WasmFunction { + uint32_t Index; + uint32_t SigIndex; + std::vector Locals; + ArrayRef Body; + uint32_t CodeSectionOffset; + uint32_t Size; + uint32_t CodeOffset; // start of Locals and Body + std::optional ExportName; // from the "export" section + StringRef SymbolName; // from the "linking" section + StringRef DebugName; // from the "name" section + uint32_t Comdat; // from the "comdat info" section +}; + +struct WasmDataSegment { + uint32_t InitFlags; + // Present if InitFlags & WASM_DATA_SEGMENT_HAS_MEMINDEX. + uint32_t MemoryIndex; + // Present if InitFlags & WASM_DATA_SEGMENT_IS_PASSIVE == 0. + WasmInitExpr Offset; + + ArrayRef Content; + StringRef Name; // from the "segment info" section + uint32_t Alignment; + uint32_t LinkingFlags; + uint32_t Comdat; // from the "comdat info" section +}; + +// 3 different element segment modes are encodable. This class is currently +// only used during decoding (see WasmElemSegment below). +enum class ElemSegmentMode { Active, Passive, Declarative }; + +// Represents a Wasm element segment, with some limitations compared the spec: +// 1) Does not model passive or declarative segments (Segment will end up with +// an Offset field of i32.const 0) +// 2) Does not model init exprs (Segment will get an empty Functions list) +// 3) Does not model types other than basic funcref/externref/exnref (see +// ValType) +struct WasmElemSegment { + uint32_t Flags; + uint32_t TableNumber; + ValType ElemKind; + WasmInitExpr Offset; + std::vector Functions; +}; + +// Represents the location of a Wasm data symbol within a WasmDataSegment, as +// the index of the segment, and the offset and size within the segment. +struct WasmDataReference { + uint32_t Segment; + uint64_t Offset; + uint64_t Size; +}; + +struct WasmRelocation { + uint8_t Type; // The type of the relocation. + uint32_t Index; // Index into either symbol or type index space. + uint64_t Offset; // Offset from the start of the section. + int64_t Addend; // A value to add to the symbol. + + WasmRelocType getType() const { return static_cast(Type); } +}; + +struct WasmInitFunc { + uint32_t Priority; + uint32_t Symbol; +}; + +struct WasmSymbolInfo { + StringRef Name; + uint8_t Kind; + uint32_t Flags; + // For undefined symbols the module of the import + std::optional ImportModule; + // For undefined symbols the name of the import + std::optional ImportName; + // For symbols to be exported from the final module + std::optional ExportName; + union { + // For function, table, or global symbols, the index in function, table, or + // global index space. + uint32_t ElementIndex; + // For a data symbols, the address of the data relative to segment. + WasmDataReference DataRef; + }; +}; + +enum class NameType { + FUNCTION, + GLOBAL, + DATA_SEGMENT, +}; + +struct WasmDebugName { + NameType Type; + uint32_t Index; + StringRef Name; +}; + +// Info from the linking metadata section of a wasm object file. +struct WasmLinkingData { + uint32_t Version; + std::vector InitFunctions; + std::vector Comdats; + // The linking section also contains a symbol table. This info (represented + // in a WasmSymbolInfo struct) is stored inside the WasmSymbol object instead + // of in this structure; this allows vectors of WasmSymbols and + // WasmLinkingDatas to be reallocated. +}; + +struct WasmSignature { + SmallVector Returns; + SmallVector Params; + // LLVM can parse types other than functions encoded in the type section, + // but does not actually model them. Instead a placeholder signature is + // created in the Object's signature list. + enum { Function, Tag, Placeholder } Kind = Function; + // Support empty and tombstone instances, needed by DenseMap. + enum { Plain, Empty, Tombstone } State = Plain; + + WasmSignature(SmallVector &&InReturns, + SmallVector &&InParams) + : Returns(InReturns), Params(InParams) {} + WasmSignature() = default; +}; + +// Useful comparison operators +inline bool operator==(const WasmSignature &LHS, const WasmSignature &RHS) { + return LHS.State == RHS.State && LHS.Returns == RHS.Returns && + LHS.Params == RHS.Params; +} + +inline bool operator!=(const WasmSignature &LHS, const WasmSignature &RHS) { + return !(LHS == RHS); +} + +inline bool operator==(const WasmGlobalType &LHS, const WasmGlobalType &RHS) { + return LHS.Type == RHS.Type && LHS.Mutable == RHS.Mutable; +} + +inline bool operator!=(const WasmGlobalType &LHS, const WasmGlobalType &RHS) { + return !(LHS == RHS); +} + +inline bool operator==(const WasmLimits &LHS, const WasmLimits &RHS) { + return LHS.Flags == RHS.Flags && LHS.Minimum == RHS.Minimum && + (LHS.Flags & WASM_LIMITS_FLAG_HAS_MAX ? LHS.Maximum == RHS.Maximum + : true) && + (LHS.Flags & WASM_LIMITS_FLAG_HAS_PAGE_SIZE + ? LHS.PageSize == RHS.PageSize + : true); +} + +inline bool operator==(const WasmTableType &LHS, const WasmTableType &RHS) { + return LHS.ElemType == RHS.ElemType && LHS.Limits == RHS.Limits; +} + +inline llvm::StringRef sectionTypeToString(uint32_t type) { +#define ECase(X) \ + case wasm::WASM_SEC_##X: \ + return #X; + switch (type) { + ECase(CUSTOM); + ECase(TYPE); + ECase(IMPORT); + ECase(FUNCTION); + ECase(TABLE); + ECase(MEMORY); + ECase(GLOBAL); + ECase(EXPORT); + ECase(START); + ECase(ELEM); + ECase(CODE); + ECase(DATA); + ECase(DATACOUNT); + ECase(TAG); + default: + llvm_unreachable("unknown section type"); + } +#undef ECase +} + +} // end namespace wasm +} // end namespace llvm + +#endif diff --git a/include/swift/RemoteInspection/RuntimeHeaders/llvm/BinaryFormat/WasmRelocs.def b/include/swift/RemoteInspection/RuntimeHeaders/llvm/BinaryFormat/WasmRelocs.def new file mode 100644 index 0000000000000..6f5a946b1c63d --- /dev/null +++ b/include/swift/RemoteInspection/RuntimeHeaders/llvm/BinaryFormat/WasmRelocs.def @@ -0,0 +1,31 @@ +#ifndef WASM_RELOC +#error "WASM_RELOC must be defined" +#endif + +WASM_RELOC(R_WASM_FUNCTION_INDEX_LEB, 0) +WASM_RELOC(R_WASM_TABLE_INDEX_SLEB, 1) +WASM_RELOC(R_WASM_TABLE_INDEX_I32, 2) +WASM_RELOC(R_WASM_MEMORY_ADDR_LEB, 3) +WASM_RELOC(R_WASM_MEMORY_ADDR_SLEB, 4) +WASM_RELOC(R_WASM_MEMORY_ADDR_I32, 5) +WASM_RELOC(R_WASM_TYPE_INDEX_LEB, 6) +WASM_RELOC(R_WASM_GLOBAL_INDEX_LEB, 7) +WASM_RELOC(R_WASM_FUNCTION_OFFSET_I32, 8) +WASM_RELOC(R_WASM_SECTION_OFFSET_I32, 9) +WASM_RELOC(R_WASM_TAG_INDEX_LEB, 10) +WASM_RELOC(R_WASM_MEMORY_ADDR_REL_SLEB, 11) +WASM_RELOC(R_WASM_TABLE_INDEX_REL_SLEB, 12) +WASM_RELOC(R_WASM_GLOBAL_INDEX_I32, 13) +WASM_RELOC(R_WASM_MEMORY_ADDR_LEB64, 14) +WASM_RELOC(R_WASM_MEMORY_ADDR_SLEB64, 15) +WASM_RELOC(R_WASM_MEMORY_ADDR_I64, 16) +WASM_RELOC(R_WASM_MEMORY_ADDR_REL_SLEB64, 17) +WASM_RELOC(R_WASM_TABLE_INDEX_SLEB64, 18) +WASM_RELOC(R_WASM_TABLE_INDEX_I64, 19) +WASM_RELOC(R_WASM_TABLE_NUMBER_LEB, 20) +WASM_RELOC(R_WASM_MEMORY_ADDR_TLS_SLEB, 21) +WASM_RELOC(R_WASM_FUNCTION_OFFSET_I64, 22) +WASM_RELOC(R_WASM_MEMORY_ADDR_LOCREL_I32, 23) +WASM_RELOC(R_WASM_TABLE_INDEX_REL_SLEB64, 24) +WASM_RELOC(R_WASM_MEMORY_ADDR_TLS_SLEB64, 25) +WASM_RELOC(R_WASM_FUNCTION_INDEX_I32, 26) diff --git a/include/swift/StaticMirror/ObjectFileContext.h b/include/swift/StaticMirror/ObjectFileContext.h index 927418cf5b7c7..5b53b3670aa82 100644 --- a/include/swift/StaticMirror/ObjectFileContext.h +++ b/include/swift/StaticMirror/ObjectFileContext.h @@ -57,6 +57,8 @@ class Image { void scanCOFF(const llvm::object::COFFObjectFile *O); + void scanWasm(const llvm::object::WasmObjectFile *O); + bool isMachOWithPtrAuth() const; public: diff --git a/lib/Demangling/NodePrinter.cpp b/lib/Demangling/NodePrinter.cpp index 476425c5e3a92..18f6d2858c1f9 100644 --- a/lib/Demangling/NodePrinter.cpp +++ b/lib/Demangling/NodePrinter.cpp @@ -2311,14 +2311,28 @@ NodePointer NodePrinter::print(NodePointer Node, unsigned depth, Printer << "merged "; } return nullptr; - case Node::Kind::TypeSymbolicReference: + case Node::Kind::TypeSymbolicReference: { Printer << "type symbolic reference 0x"; - Printer.writeHex(Node->getIndex()); + if (Node->hasRemoteAddress()) { + auto ra = Node->getRemoteAddress(); + Printer.writeHex(ra.first); + Printer << " (" << ra.second << ")"; + } else if (Node->hasIndex()) { + Printer.writeHex(Node->getIndex()); + } return nullptr; - case Node::Kind::OpaqueTypeDescriptorSymbolicReference: + } + case Node::Kind::OpaqueTypeDescriptorSymbolicReference: { Printer << "opaque type symbolic reference 0x"; - Printer.writeHex(Node->getIndex()); + if (Node->hasRemoteAddress()) { + auto ra = Node->getRemoteAddress(); + Printer.writeHex(ra.first); + Printer << " (" << ra.second << ")"; + } else if (Node->hasIndex()) { + Printer.writeHex(Node->getIndex()); + } return nullptr; + } case Node::Kind::DistributedThunk: if (!Options.ShortenThunk) { Printer << "distributed thunk "; diff --git a/lib/StaticMirror/ObjectFileContext.cpp b/lib/StaticMirror/ObjectFileContext.cpp index 4ad8d5c3ce3e5..ed8239ebb183d 100644 --- a/lib/StaticMirror/ObjectFileContext.cpp +++ b/lib/StaticMirror/ObjectFileContext.cpp @@ -29,6 +29,7 @@ #include "llvm/Object/ELFTypes.h" #include "llvm/Object/MachOUniversal.h" #include "llvm/Object/RelocationResolver.h" +#include "llvm/Object/Wasm.h" #include "llvm/Support/Error.h" #include "llvm/Support/StringSaver.h" @@ -266,6 +267,38 @@ void Image::scanCOFF(const llvm::object::COFFObjectFile *O) { Segments.push_back({HeaderAddress, O->getData()}); } +void Image::scanWasm(const llvm::object::WasmObjectFile *O) { + HeaderAddress = 0; + + auto resolver = getRelocationResolver(*O); + auto resolverSupports = resolver.first; + auto resolve = resolver.second; + + if (!resolverSupports || !resolve) + return; + + for (auto SectionRef : O->sections()) { + auto Section = O->getWasmSection(SectionRef); + for (auto &r : Section.Relocations) { + auto sym = O->symbol_begin(); + for (unsigned i = 0; sym != O->symbol_end() && i < r.Index; ++i) + ++sym; + if (sym == O->symbol_end()) + continue; + auto &wsym = O->getWasmSymbol(*sym); + if (!resolverSupports(r.Type)) { + llvm::errs() << "Unsupported +" << r.Offset << " " << wsym.Info.Name + << " +" << r.Addend << "\n"; + continue; + } + uint64_t offset = resolve(r.Type, r.Offset, 0, 0, r.Addend); + DynamicRelocations.insert({r.Offset, {wsym.Info.Name, offset}}); + } + } + + Segments.push_back({HeaderAddress, O->getData()}); +} + bool Image::isMachOWithPtrAuth() const { auto macho = dyn_cast(O); if (!macho) @@ -286,6 +319,8 @@ Image::Image(const llvm::object::ObjectFile *O) : O(O) { scanELF(elf); } else if (auto coff = dyn_cast(O)) { scanCOFF(coff); + } else if (auto wasm = dyn_cast(O)) { + scanWasm(wasm); } else { fputs("unsupported image format\n", stderr); abort(); diff --git a/test/Reflection/Inputs/wasm.yaml b/test/Reflection/Inputs/wasm.yaml new file mode 100644 index 0000000000000..4a5338b309acf --- /dev/null +++ b/test/Reflection/Inputs/wasm.yaml @@ -0,0 +1,443 @@ +--- !WASM +FileHeader: + Version: 0x1 +Sections: + - Type: TYPE + Signatures: + - Index: 0 + ParamTypes: + - I32 + - I32 + ReturnTypes: + - I32 + - Index: 1 + ParamTypes: + - I32 + ReturnTypes: [] + - Index: 2 + ParamTypes: [] + ReturnTypes: [] + - Index: 3 + ParamTypes: + - I32 + - I32 + ReturnTypes: [] + - Index: 4 + ParamTypes: + - I32 + - I32 + - I32 + - I32 + ReturnTypes: [] + - Index: 5 + ParamTypes: + - I32 + ReturnTypes: + - I32 + - Index: 6 + ParamTypes: + - I32 + - I32 + - I32 + ReturnTypes: + - I32 + - Index: 7 + ParamTypes: [] + ReturnTypes: + - I32 + - Type: IMPORT + Imports: + - Module: wasi_snapshot_preview1 + Field: args_get + Kind: FUNCTION + SigIndex: 0 + - Module: wasi_snapshot_preview1 + Field: args_sizes_get + Kind: FUNCTION + SigIndex: 0 + - Module: wasi_snapshot_preview1 + Field: proc_exit + Kind: FUNCTION + SigIndex: 1 + - Type: FUNCTION + FunctionTypes: [ 2, 1, 2, 2, 0, 3, 4, 4, 5, 5, 6, 1, 1, 0, 1, 7, + 0, 0, 1, 2, 5, 2, 2, 6 ] + - Type: TABLE + Tables: + - Index: 0 + ElemType: FUNCREF + Limits: + Flags: [ HAS_MAX ] + Minimum: 0x4 + Maximum: 0x4 + - Type: MEMORY + Memories: + - Minimum: 0x2 + - Type: GLOBAL + Globals: + - Index: 0 + Type: I32 + Mutable: true + InitExpr: + Opcode: I32_CONST + Value: 70624 + - Index: 1 + Type: I32 + Mutable: false + InitExpr: + Opcode: I32_CONST + Value: 0 + - Type: EXPORT + Exports: + - Name: memory + Kind: MEMORY + Index: 0 + - Name: _start + Kind: FUNCTION + Index: 5 + - Type: ELEM + Segments: + - Offset: + Opcode: I32_CONST + Value: 1 + Functions: [ 9, 10, 7 ] + - Type: CODE + Functions: + - Index: 3 + Locals: [] + Body: 10060B + - Index: 4 + Locals: [] + Body: 000B + - Index: 5 + Locals: + - Type: I32 + Count: 1 + Body: 0240024023818080800041D4A28080006A2802000D0023818080800041D4A28080006A4101360200108380808000109280808000210010998080800020000D010F0B000B2000109580808000000B + - Index: 6 + Locals: [] + Body: 410041BCA28080003602D8A3808000410041BCA28080003602D0A3808000410041BCA28080003602C8A3808000410041BCA28080003602C0A380800041004198A28080003602B8A380800041004180A28080003602B0A3808000410041BCA28080003602A8A3808000410041BCA28080003602A0A380800041004180A2808000360298A3808000410041C4A1808000360290A380800041004198A2808000360288A38080004100419CA2808000360280A3808000410041BCA18080003602F8A2808000410041B8A18080003602F0A2808000410041B4A18080003602E8A2808000410042003702E0A2808000410042043702D8A2808000410041BCA280800041BCA28080006B3602DCA3808000410041BCA280800041BCA28080006B3602D4A3808000410041BCA280800041BCA28080006B3602CCA3808000410041BCA280800041BCA28080006B3602C4A380800041004198A28080004198A28080006B3602BCA380800041004180A28080004180A28080006B3602B4A3808000410041BCA280800041BCA28080006B3602ACA3808000410041BCA280800041BCA28080006B3602A4A380800041004198A28080004180A28080006B36029CA380800041004180A280800041C4A18080006B360294A38080004100419CA28080004198A28080006B36028CA3808000410041BCA2808000419CA28080006B360284A3808000410041C4A180800041BCA18080006B3602FCA2808000410041BCA180800041B8A18080006B3602F4A2808000410041B8A180800041B4A18080006B3602ECA280800041D8A28080001084808080000B + - Index: 7 + Locals: + - Type: I32 + Count: 1 + Body: 4100210220020F0B + - Index: 8 + Locals: [] + Body: 0F0B + - Index: 9 + Locals: + - Type: I32 + Count: 6 + Body: 41002104200020043602044190A180800021052381808080002106200620056A210741082108200720086A2109200020093602000F0B + - Index: 10 + Locals: + - Type: I32 + Count: 6 + Body: 410021042000200436020441A0A180800021052381808080002106200620056A210741082108200720086A2109200020093602000F0B + - Index: 11 + Locals: [] + Body: 2000108C808080000B + - Index: 12 + Locals: + - Type: I32 + Count: 11 + Body: 23808080800041106B2201248080808000024002400240024002400240024002400240024002400240024041002802FCA380800022020D00024041002802BCA780800022030D004100427F3702C8A7808000410042808084808080C0003702C0A78080004100200141086A41707141D8AAD5AA057322033602BCA7808000410041003602D0A7808000410041003602A0A78080000B41808088800041E0A7848000490D014100210241808088800041E0A78480006B41D900490D0041002104410041E0A78480003602A4A7808000410041E0A78480003602F4A380800041002003360288A48080004100417F360284A4808000410041808088800041E0A78480006B22033602A8A780800041002003360298A780800041002003360294A78080000340200441A0A48080006A20044194A48080006A220336020020032004418CA48080006A220536020020044198A48080006A2005360200200441A8A48080006A2004419CA48080006A220536020020052003360200200441B0A48080006A200441A4A48080006A220336020020032005360200200441ACA48080006A2003360200200441206A2204418002470D000B418080888000414C6A4138360200410041002802CCA7808000360280A4808000410041E0A7848000417841E0A78480006B410F7122046A22023602FCA3808000410041808088800041E0A78480006B20046B41486A22043602F0A3808000200220044101723602040B02400240200041EC014B0D00024041002802E4A380800022064110200041136A41F003712000410B491B22054103762203762204410371450D0002400240200441017120037241017322054103742203418CA48080006A220420034194A48080006A28020022032802082200470D0041002006417E200577713602E4A38080000C010B200420003602082000200436020C0B200341086A2104200320054103742205410372360204200320056A220320032802044101723602040C0E0B200541002802ECA380800022074D0D0102402004450D0002400240200420037441022003742204410020046B72716822034103742204418CA48080006A220020044194A48080006A28020022042802082208470D0041002006417E2003777122063602E4A38080000C010B200020083602082008200036020C0B200420054103723602042004200341037422036A200320056B2200360200200420056A2208200041017236020402402007450D002007417871418CA48080006A210541002802F8A3808000210302400240200641012007410376742209710D00410020062009723602E4A3808000200521090C010B200528020821090B2009200336020C200520033602082003200536020C200320093602080B200441086A2104410020083602F8A3808000410020003602ECA38080000C0E0B41002802E8A3808000220A450D01200A684102744194A68080006A280200220828020441787120056B210320082100024003400240200028021022040D0020002802142204450D020B200428020441787120056B22002003200020034922001B21032004200820001B2108200421000C000B0B200828021821020240200828020C22042008460D0020082802082200200436020C200420003602080C0D0B0240024020082802142200450D00200841146A21090C010B20082802102200450D04200841106A21090B03402009210B2000220441146A2109200428021422000D00200441106A2109200428021022000D000B200B41003602000C0C0B417F2105200041BF7F4B0D00200041136A2204417071210541002802E8A3808000220A450D00411F21070240200041ECFFFF074B0D002005412620044108766722046B7641017120044101746B413E6A21070B410020056B2103024002400240024020074102744194A68080006A28020022000D0041002104410021090C010B4100210420054100411920074101766B2007411F461B7421084100210903400240200028020441787120056B220620034F0D00200621032000210920060D004100210320002109200021040C030B200420002802142206200620002008411D764104716A41106A280200220B461B200420061B210420084101742108200B2100200B0D000B0B024020042009720D004100210941022007742204410020046B72200A712204450D032004684102744194A68080006A28020021040B2004450D010B0340200428020441787120056B220620034921080240200428021022000D00200428021421000B2006200320081B21032004200920081B21092000210420000D000B0B2009450D00200341002802ECA380800020056B4F0D002009280218210B0240200928020C22042009460D0020092802082200200436020C200420003602080C0B0B0240024020092802142200450D00200941146A21080C010B20092802102200450D04200941106A21080B0340200821062000220441146A2108200428021422000D00200441106A2108200428021022000D000B200641003602000C0A0B024041002802ECA380800022042005490D0041002802F8A3808000210302400240200420056B22004110490D00200320056A22082000410172360204200320046A2000360200200320054103723602040C010B20032004410372360204200320046A2204200428020441017236020441002108410021000B410020003602ECA3808000410020083602F8A3808000200341086A21040C0C0B024041002802F0A3808000220020054D0D00200220056A2204200020056B2203410172360204410020043602FCA3808000410020033602F0A380800020022005410372360204200241086A21040C0C0B0240024041002802BCA7808000450D0041002802C4A780800021030C010B4100427F3702C8A7808000410042808084808080C0003702C0A780800041002001410C6A41707141D8AAD5AA05733602BCA7808000410041003602D0A7808000410041003602A0A78080004180800421030B4100210402402003200541C7006A220B6A2208410020036B220671220920054B0D00410041303602E0A38080000C0C0B0240410028029CA78080002204450D0002404100280294A7808000220320096A220720034D0D00200720044D0D010B41002104410041303602E0A38080000C0C0B41002D00A0A78080004104710D050240024002402002450D0041A4A78080002104034002402004280200220320024B0D00200320042802046A20024B0D030B200428020822040D000B0B41001097808080002208417F460D0620092106024041002802C0A78080002204417F6A2203200871450D00200920086B200320086A410020046B716A21060B200620054D0D06200641FEFFFFFF074B0D060240410028029CA78080002204450D004100280294A7808000220320066A220020034D0D07200020044B0D070B200610978080800022042008470D010C080B200820006B200671220641FEFFFFFF074B0D0520061097808080002208200428020020042802046A460D04200821040B02402006200541C8006A4F0D002004417F460D000240200B20066B41002802C4A780800022036A410020036B71220341FEFFFFFF074D0D00200421080C080B02402003109780808000417F460D00200320066A2106200421080C080B410020066B1097808080001A0C050B200421082004417F470D060C040B000B410021040C080B410021040C060B2008417F470D020B410041002802A0A78080004104723602A0A78080000B200941FEFFFFFF074B0D0120091097808080002108410010978080800021042008417F460D012004417F460D01200820044F0D01200420086B2206200541386A4D0D010B41004100280294A780800020066A2204360294A7808000024020044100280298A78080004D0D0041002004360298A78080000B024002400240024041002802FCA38080002203450D0041A4A780800021040340200820042802002200200428020422096A460D02200428020822040D000C030B0B0240024041002802F4A38080002204450D00200820044F0D010B410020083602F4A38080000B41002104410020063602A8A7808000410020083602A4A78080004100417F360284A4808000410041002802BCA7808000360288A4808000410041003602B0A78080000340200441A0A48080006A20044194A48080006A220336020020032004418CA48080006A220036020020044198A48080006A2000360200200441A8A48080006A2004419CA48080006A220036020020002003360200200441B0A48080006A200441A4A48080006A220336020020032000360200200441ACA48080006A2003360200200441206A2204418002470D000B2008417820086B410F7122046A2203200641486A220020046B2204410172360204410041002802CCA7808000360280A4808000410020043602F0A3808000410020033602FCA3808000200820006A41383602040C020B200320084F0D0020032000490D00200428020C4108710D002003417820036B410F7122006A220841002802F0A380800020066A220B20006B22004101723602042004200920066A360204410041002802CCA7808000360280A4808000410020003602F0A3808000410020083602FCA38080002003200B6A41383602040C010B0240200841002802F4A38080004F0D00410020083602F4A38080000B200820066A210041A4A78080002104024002400340200428020022092000460D01200428020822040D000C020B0B20042D000C410871450D030B41A4A780800021040240034002402004280200220020034B0D00200020042802046A220020034B0D020B200428020821040C000B0B2008417820086B410F7122046A220B200641486A220920046B2204410172360204200820096A413836020420032000413720006B410F716A41416A22092009200341106A491B22094123360204410041002802CCA7808000360280A4808000410020043602F0A38080004100200B3602FCA3808000200941106A41002902ACA7808000370200200941002902A4A78080003702084100200941086A3602ACA7808000410020063602A8A7808000410020083602A4A7808000410041003602B0A7808000200941246A2104034020044107360200200441046A22042000490D000B20092003460D0020092009280204417E713602042009200920036B22083602002003200841017236020402400240200841FF014B0D002008417871418CA48080006A21040240024041002802E4A3808000220041012008410376742208710D00410020002008723602E4A3808000200421000C010B200428020821000B2000200336020C20042003360208410C2108410821090C010B411F21040240200841FFFFFF074B0D002008412620084108766722046B7641017120044101746B413E6A21040B2003200436021C2003420037021020044102744194A68080006A210002400240024041002802E8A3808000220941012004742206710D0020002003360200410020092006723602E8A3808000200320003602180C010B20084100411920044101766B2004411F461B742104200028020021090340200922002802044178712008460D022004411D76210920044101742104200020094104716A41106A220628020022090D000B20062003360200200320003602180B41082108410C210920032100200321040C010B20002802082104200020033602082004200336020C200320043602084100210441182108410C21090B200320096A2000360200200320086A20043602000B41002802F0A3808000220420054D0D0041002802FCA3808000220320056A2200200420056B2204410172360204410020043602F0A3808000410020003602FCA380800020032005410372360204200341086A21040C040B41002104410041303602E0A38080000C030B200420083602002004200428020420066A360204200820092005108D8080800021040C020B0240200B450D00024002402009200928021C22084102744194A68080006A2200280200470D002000200436020020040D014100200A417E20087771220A3602E8A38080000C020B200B41104114200B2802102009461B6A20043602002004450D010B2004200B360218024020092802102200450D0020042000360210200020043602180B20092802142200450D0020042000360214200020043602180B024002402003410F4B0D00200920032005722204410372360204200920046A220420042802044101723602040C010B200920056A2208200341017236020420092005410372360204200820036A20033602000240200341FF014B0D002003417871418CA48080006A21040240024041002802E4A3808000220541012003410376742203710D00410020052003723602E4A3808000200421030C010B200428020821030B2003200836020C200420083602082008200436020C200820033602080C010B411F21040240200341FFFFFF074B0D002003412620034108766722046B7641017120044101746B413E6A21040B2008200436021C2008420037021020044102744194A68080006A21050240200A41012004742200710D00200520083602004100200A2000723602E8A380800020082005360218200820083602082008200836020C0C010B20034100411920044101766B2004411F461B7421042005280200210002400340200022052802044178712003460D012004411D76210020044101742104200520004104716A41106A220628020022000D000B20062008360200200820053602182008200836020C200820083602080C010B20052802082204200836020C20052008360208200841003602182008200536020C200820043602080B200941086A21040C010B02402002450D00024002402008200828021C22094102744194A68080006A2200280200470D002000200436020020040D014100200A417E200977713602E8A38080000C020B20024110411420022802102008461B6A20043602002004450D010B20042002360218024020082802102200450D0020042000360210200020043602180B20082802142200450D0020042000360214200020043602180B024002402003410F4B0D00200820032005722204410372360204200820046A220420042802044101723602040C010B200820056A2200200341017236020420082005410372360204200020036A200336020002402007450D002007417871418CA48080006A210541002802F8A3808000210402400240410120074103767422092006710D00410020092006723602E4A3808000200521090C010B200528020821090B2009200436020C200520043602082004200536020C200420093602080B410020003602F8A3808000410020033602ECA38080000B200841086A21040B200141106A24808080800020040B + - Index: 13 + Locals: + - Type: I32 + Count: 7 + Body: 2000417820006B410F716A220320024103723602042001417820016B410F716A2204200320026A22056B210002400240200441002802FCA3808000470D00410020053602FCA3808000410041002802F0A380800020006A22023602F0A3808000200520024101723602040C010B0240200441002802F8A3808000470D00410020053602F8A3808000410041002802ECA380800020006A22023602ECA380800020052002410172360204200520026A20023602000C010B0240200428020422014103714101470D0020014178712106200428020C210202400240200141FF014B0D000240200220042802082207470D00410041002802E4A3808000417E200141037677713602E4A38080000C020B200220073602082007200236020C0C010B200428021821080240024020022004460D0020042802082201200236020C200220013602080C010B02400240024020042802142201450D00200441146A21070C010B20042802102201450D01200441106A21070B0340200721092001220241146A2107200228021422010D00200241106A2107200228021022010D000B200941003602000C010B410021020B2008450D00024002402004200428021C22074102744194A68080006A2201280200470D002001200236020020020D01410041002802E8A3808000417E200777713602E8A38080000C020B20084110411420082802102004461B6A20023602002002450D010B20022008360218024020042802102201450D0020022001360210200120023602180B20042802142201450D0020022001360214200120023602180B200620006A2100200420066A220428020421010B20042001417E71360204200520006A2000360200200520004101723602040240200041FF014B0D002000417871418CA48080006A21020240024041002802E4A3808000220141012000410376742200710D00410020012000723602E4A3808000200221000C010B200228020821000B2000200536020C200220053602082005200236020C200520003602080C010B411F21020240200041FFFFFF074B0D002000412620004108766722026B7641017120024101746B413E6A21020B2005200236021C2005420037021020024102744194A68080006A2101024041002802E8A3808000220741012002742204710D0020012005360200410020072004723602E8A380800020052001360218200520053602082005200536020C0C010B20004100411920024101766B2002411F461B7421022001280200210702400340200722012802044178712000460D012002411D76210720024101742102200120074104716A41106A220428020022070D000B20042005360200200520013602182005200536020C200520053602080C010B20012802082202200536020C20012005360208200541003602182005200136020C200520023602080B200341086A0B + - Index: 14 + Locals: [] + Body: 2000108F808080000B + - Index: 15 + Locals: + - Type: I32 + Count: 7 + Body: 02402000450D00200041786A22012000417C6A280200220241787122006A2103024020024101710D002002410271450D012001200128020022046B220141002802F4A3808000490D01200420006A21000240024002400240200141002802F8A3808000460D00200128020C21020240200441FF014B0D00200220012802082205470D02410041002802E4A3808000417E200441037677713602E4A38080000C050B20012802182106024020022001460D0020012802082204200236020C200220043602080C040B0240024020012802142204450D00200141146A21050C010B20012802102204450D03200141106A21050B0340200521072004220241146A2105200228021422040D00200241106A2105200228021022040D000B200741003602000C030B200328020422024103714103470D0320032002417E71360204410020003602ECA380800020032000360200200120004101723602040F0B200220053602082005200236020C0C020B410021020B2006450D00024002402001200128021C22054102744194A68080006A2204280200470D002004200236020020020D01410041002802E8A3808000417E200577713602E8A38080000C020B20064110411420062802102001461B6A20023602002002450D010B20022006360218024020012802102204450D0020022004360210200420023602180B20012802142204450D0020022004360214200420023602180B200120034F0D0020032802042204410171450D000240024002400240024020044102710D000240200341002802FCA3808000470D00410020013602FCA3808000410041002802F0A380800020006A22003602F0A380800020012000410172360204200141002802F8A3808000470D06410041003602ECA3808000410041003602F8A38080000F0B0240200341002802F8A3808000470D00410020013602F8A3808000410041002802ECA380800020006A22003602ECA380800020012000410172360204200120006A20003602000F0B200441787120006A2100200328020C21020240200441FF014B0D000240200220032802082205470D00410041002802E4A3808000417E200441037677713602E4A38080000C050B200220053602082005200236020C0C040B20032802182106024020022003460D0020032802082204200236020C200220043602080C030B0240024020032802142204450D00200341146A21050C010B20032802102204450D02200341106A21050B0340200521072004220241146A2105200228021422040D00200241106A2105200228021022040D000B200741003602000C020B20032004417E71360204200120006A2000360200200120004101723602040C030B410021020B2006450D00024002402003200328021C22054102744194A68080006A2204280200470D002004200236020020020D01410041002802E8A3808000417E200577713602E8A38080000C020B20064110411420062802102003461B6A20023602002002450D010B20022006360218024020032802102204450D0020022004360210200420023602180B20032802142204450D0020022004360214200420023602180B200120006A200036020020012000410172360204200141002802F8A3808000470D00410020003602ECA38080000F0B0240200041FF014B0D002000417871418CA48080006A21020240024041002802E4A3808000220441012000410376742200710D00410020042000723602E4A3808000200221000C010B200228020821000B2000200136020C200220013602082001200236020C200120003602080F0B411F21020240200041FFFFFF074B0D002000412620004108766722026B7641017120024101746B413E6A21020B2001200236021C2001420037021020024102744194A68080006A2103024002400240024041002802E8A3808000220441012002742205710D00410020042005723602E8A38080004108210041182102200321050C010B20004100411920024101766B2002411F461B742102200328020021050340200522042802044178712000460D022002411D76210520024101742102200420054104716A41106A220328020022050D000B4108210041182102200421050B20012104200121070C010B20042802082205200136020C41082102200441086A210341002107411821000B20032001360200200120026A20053602002001200436020C200120006A200736020041004100280284A4808000417F6A2201417F20011B360284A48080000B0B + - Index: 16 + Locals: + - Type: I32 + Count: 1 + - Type: I64 + Count: 1 + Body: 0240024020000D00410021020C010B2000AD2001AD7E2203A72102200120007241808004490D00417F20022003422088A74100471B21020B02402002108C808080002200450D002000417C6A2D0000410371450D00200041002002109A808080001A0B20000B + - Index: 17 + Locals: [] + Body: 2000109580808000000B + - Index: 18 + Locals: + - Type: I32 + Count: 3 + Body: 23808080800041106B220024808080800002400240024002400240200041086A2000410C6A1094808080000D00200028020841016A2201450D01200028020C108B808080002202450D02200141041090808080002201450D03200120021093808080000D04200028020820011087808080002101200041106A24808080800020010F0B41C700109180808000000B41C600109180808000000B41C600109180808000000B2002108E8080800041C600109180808000000B2002108E808080002001108E8080800041C700109180808000000B + - Index: 19 + Locals: [] + Body: 2000200110808080800041FFFF03710B + - Index: 20 + Locals: [] + Body: 2000200110818080800041FFFF03710B + - Index: 21 + Locals: [] + Body: 2000108280808000000B + - Index: 22 + Locals: [] + Body: 000B + - Index: 23 + Locals: [] + Body: 024020000D003F004110740F0B0240200041FFFF03710D002000417F4C0D000240200041107640002200417F470D00410041303602E0A3808000417F0F0B20004110740F0B109680808000000B + - Index: 24 + Locals: [] + Body: 0B + - Index: 25 + Locals: [] + Body: 1098808080001098808080000B + - Index: 26 + Locals: + - Type: I32 + Count: 3 + - Type: I64 + Count: 1 + Body: 024020024121490D00200020012002FC0B0020000F0B02402002450D00200020013A0000200020026A2203417F6A20013A000020024103490D00200020013A0002200020013A00012003417D6A20013A00002003417E6A20013A000020024107490D00200020013A00032003417C6A20013A000020024109490D002000410020006B41037122046A2205200141FF017141818284086C22033602002005200220046B413C7122016A2202417C6A200336020020014109490D002005200336020820052003360204200241786A2003360200200241746A200336020020014119490D002005200336021820052003360214200520033602102005200336020C200241706A20033602002002416C6A2003360200200241686A2003360200200241646A20033602002001200541047141187222026B22014120490D002003AD4281808080107E2106200520026A2102034020022006370318200220063703102002200637030820022006370300200241206A2102200141606A2201411F4B0D000B0B20000B + - Type: DATA + Segments: + - SectionOffset: 8 + InitFlags: 0 + Offset: + Opcode: I32_CONST + Value: 4096 + Content: 10000000480000008000000000000000430001005C0000006400000000000000010000005A0000000700000000000000510000003C000000480000000100000094000000000000000200000051000000200000002E0000000200000088000000010000000200000073696D706C6500000000000000000000F0FFFFFF50004100540053000300 + - SectionOffset: 148 + InitFlags: 0 + Offset: + Opcode: I32_CONST + Value: 4232 + Content: 001000001D110000000000000010000000020000301000000000000000100000000200004C10000000000000 + - SectionOffset: 198 + InitFlags: 0 + Offset: + Opcode: I32_CONST + Value: 4276 + Content: 5CFFFFFF + - SectionOffset: 208 + InitFlags: 0 + Offset: + Opcode: I32_CONST + Value: 4280 + Content: 48FFFFFF + - SectionOffset: 218 + InitFlags: 0 + Offset: + Opcode: I32_CONST + Value: 4284 + Content: 74FFFFFF8CFFFFFF + - SectionOffset: 232 + InitFlags: 0 + Offset: + Opcode: I32_CONST + Value: 4292 + Content: 640000000000000004000C0000000000620000000000000000000C00000000003E0000000000000000000C0001000000000000003E0000001E000000 + - SectionOffset: 298 + InitFlags: 0 + Offset: + Opcode: I32_CONST + Value: 4352 + Content: '' + - SectionOffset: 304 + InitFlags: 0 + Offset: + Opcode: I32_CONST + Value: 4352 + Content: '220000002400000001000000080000000800000008000000' + - SectionOffset: 334 + InitFlags: 0 + Offset: + Opcode: I32_CONST + Value: 4376 + Content: '' + - SectionOffset: 340 + InitFlags: 0 + Offset: + Opcode: I32_CONST + Value: 4376 + Content: '41007400' + - SectionOffset: 350 + InitFlags: 0 + Offset: + Opcode: I32_CONST + Value: 4380 + Content: 426933325F000129FFFFFF0024733673696D706C65315050000001F9FEFFFF00 + - SectionOffset: 388 + InitFlags: 0 + Offset: + Opcode: I32_CONST + Value: 4412 + Content: '' + - SectionOffset: 394 + InitFlags: 0 + Offset: + Opcode: I32_CONST + Value: 4412 + Content: '' + - SectionOffset: 400 + InitFlags: 0 + Offset: + Opcode: I32_CONST + Value: 4412 + Content: '' + - SectionOffset: 406 + InitFlags: 0 + Offset: + Opcode: I32_CONST + Value: 4412 + Content: '' + - SectionOffset: 412 + InitFlags: 0 + Offset: + Opcode: I32_CONST + Value: 4412 + Content: '' + - SectionOffset: 418 + InitFlags: 0 + Offset: + Opcode: I32_CONST + Value: 4412 + Content: '' + - SectionOffset: 424 + InitFlags: 0 + Offset: + Opcode: I32_CONST + Value: 4412 + Content: '0300000000000000' + - SectionOffset: 438 + InitFlags: 0 + Offset: + Opcode: I32_CONST + Value: 4420 + Content: F94D3CBDE6014046B3FF38670353FD4E + - Type: CUSTOM + Name: .swift1_autolink_entries + Payload: '' + - Type: CUSTOM + Name: name + FunctionNames: + - Index: 0 + Name: __imported_wasi_snapshot_preview1_args_get + - Index: 1 + Name: __imported_wasi_snapshot_preview1_args_sizes_get + - Index: 2 + Name: __imported_wasi_snapshot_preview1_proc_exit + - Index: 3 + Name: __wasm_call_ctors + - Index: 4 + Name: 'signature_mismatch:swift_addNewDSOImage' + - Index: 5 + Name: _start + - Index: 6 + Name: 'swift_image_constructor()' + - Index: 7 + Name: main + - Index: 8 + Name: '$s6simple1SV1tAA1TVvg' + - Index: 9 + Name: '$s6simple1TVMa' + - Index: 10 + Name: '$s6simple1SVMa' + - Index: 11 + Name: malloc + - Index: 12 + Name: dlmalloc + - Index: 13 + Name: prepend_alloc + - Index: 14 + Name: free + - Index: 15 + Name: dlfree + - Index: 16 + Name: calloc + - Index: 17 + Name: _Exit + - Index: 18 + Name: __main_void + - Index: 19 + Name: __wasi_args_get + - Index: 20 + Name: __wasi_args_sizes_get + - Index: 21 + Name: __wasi_proc_exit + - Index: 22 + Name: abort + - Index: 23 + Name: sbrk + - Index: 24 + Name: dummy + - Index: 25 + Name: __wasm_call_dtors + - Index: 26 + Name: memset + GlobalNames: + - Index: 0 + Name: __stack_pointer + - Index: 1 + Name: GOT.data.internal.__memory_base + DataSegmentNames: + - Index: 0 + Name: .rodata + - Index: 1 + Name: .data + - Index: 2 + Name: swift5_protocols + - Index: 3 + Name: swift5_protocol_conformances + - Index: 4 + Name: swift5_type_metadata + - Index: 5 + Name: swift5_fieldmd + - Index: 6 + Name: swift5_builtin + - Index: 7 + Name: swift5_assocty + - Index: 8 + Name: swift5_capture + - Index: 9 + Name: swift5_reflstr + - Index: 10 + Name: swift5_typeref + - Index: 11 + Name: swift5_mpenum + - Index: 12 + Name: swift5_replace + - Index: 13 + Name: swift5_replac2 + - Index: 14 + Name: swift5_accessible_functions + - Index: 15 + Name: swift5_runtime_attributes + - Index: 16 + Name: swift5_tests + - Index: 17 + Name: swift5_entry + - Index: 18 + Name: .swift_modhash + - Type: CUSTOM + Name: producers + Languages: + - Name: C_plus_plus_14 + Version: '' + Tools: + - Name: clang + Version: '17.0.0 (https://github.com/swiftlang/llvm-project.git b9d3d72e441c70ab8c463d615e36db1df685151b)' + - Type: CUSTOM + Name: target_features + Features: + - Prefix: USED + Name: bulk-memory + - Prefix: USED + Name: multivalue + - Prefix: USED + Name: mutable-globals + - Prefix: USED + Name: reference-types + - Prefix: USED + Name: sign-ext +... diff --git a/test/Reflection/wasm.test b/test/Reflection/wasm.test new file mode 100644 index 0000000000000..98c904795dcc6 --- /dev/null +++ b/test/Reflection/wasm.test @@ -0,0 +1,28 @@ +# RUN: %yaml2obj %S/Inputs/wasm.yaml -o %t.wasm +# RUN: %target-swift-reflection-dump --arch=wasi --no-objc-interop %t.wasm | %FileCheck %s +# +# CHECK: FIELDS +# CHECK: t: +# CHECK: ASSOCIATED TYPES +# CHECK: - : simple.P +# CHECK: typealias A = Builtin.Int32 +# CHECK: Builtin.Int32 +# CHECK: (builtin Builtin.Int32) +# +# simple.swift +# protocol P { associatedtype A } +# struct T {} +# struct S : P { +# typealias A = Builtin.Int32 +# let t: T +# } +# sys.c +# void swift_addNewDSOImage() {} +# +# compiled for -target wasm32-unknown-wasip1 +# obj2yaml simple.o -o simple.o.yaml +# (replace UNDEFINED symbol with a definition) +# obj2yaml simple.o.yaml -o simple-mod.o +# swiftc simple-mod.o sys.o -o simple.wasm +# yaml2obj simple.wasm -o simple-mod.o +# diff --git a/test/lit.cfg b/test/lit.cfg index 5ac9eff9d84fa..8d98c98436268 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -345,6 +345,7 @@ config.llvm_dis = inferSwiftBinary('llvm-dis') config.llvm_nm = inferSwiftBinary('llvm-nm') config.llvm_readtapi = inferSwiftBinary('llvm-readtapi') config.llvm_size = inferSwiftBinary('llvm-size') +config.yaml2obj = inferSwiftBinary('yaml2obj') config.sourcekitd_test = inferSwiftBinary('sourcekitd-test') config.complete_test = inferSwiftBinary('complete-test') config.swift_api_digester = inferSwiftBinary('swift-api-digester') @@ -745,6 +746,7 @@ config.substitutions.append( ('%llvm-dis', config.llvm_dis) ) config.substitutions.append( ('%llvm-nm', config.llvm_nm) ) config.substitutions.append( ('%llvm-readtapi', config.llvm_readtapi) ) config.substitutions.append( ('%llvm-size', config.llvm_size) ) +config.substitutions.append( ('%yaml2obj', config.yaml2obj) ) config.substitutions.append( ('%swift-demangle-yamldump', config.swift_demangle_yamldump) ) config.substitutions.append( ('%swift-demangle', config.swift_demangle) ) config.substitutions.append( ('%Benchmark_O', config.benchmark_o) ) diff --git a/tools/swift-reflection-dump/swift-reflection-dump.cpp b/tools/swift-reflection-dump/swift-reflection-dump.cpp index dba4352311f20..100af2eb203c7 100644 --- a/tools/swift-reflection-dump/swift-reflection-dump.cpp +++ b/tools/swift-reflection-dump/swift-reflection-dump.cpp @@ -79,11 +79,13 @@ static llvm::cl::opt llvm::cl::desc("Architecture to inspect in the binary"), llvm::cl::Required); -#if SWIFT_OBJC_INTEROP static llvm::cl::opt DisableObjCInterop( "no-objc-interop", - llvm::cl::desc("Disable Objective-C interoperability support")); + llvm::cl::desc("Disable Objective-C interoperability support" +#if SWIFT_OBJC_INTEROP + " (not supported)" #endif + )); } // end namespace options static int doDumpReflectionSections(ArrayRef BinaryFilenames, From 814f634bd623cb426e42df6d4d7574fdfb096b93 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 28 Aug 2025 12:40:04 +0100 Subject: [PATCH 083/100] Revert "[rebranch] SIL: Restore old behavior in `llvm::APInt` ctor call" This reverts commit 73c70ee338c515fba37baf3faff93c6389558a5c. Reverting to prevent a conflict with https://github.com/swiftlang/swift/pull/83945 in the automergers. --- lib/SIL/IR/SILInstructions.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/SIL/IR/SILInstructions.cpp b/lib/SIL/IR/SILInstructions.cpp index d670e8d5a3cb9..3c8e43e52f1dd 100644 --- a/lib/SIL/IR/SILInstructions.cpp +++ b/lib/SIL/IR/SILInstructions.cpp @@ -1145,9 +1145,7 @@ IntegerLiteralInst *IntegerLiteralInst::create(SILDebugLocation Loc, static APInt getAPInt(AnyBuiltinIntegerType *anyIntTy, intmax_t value) { // If we're forming a fixed-width type, build using the greatest width. if (auto intTy = dyn_cast(anyIntTy)) - // TODO: Avoid implicit trunc? - return APInt(intTy->getGreatestWidth(), value, /*isSigned=*/false, - /*implicitTrunc=*/true); + return APInt(intTy->getGreatestWidth(), value); // Otherwise, build using the size of the type and then truncate to the // minimum width necessary. From 98370c30aea408bdfb496d2d22c22ce5bb574e79 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Fri, 29 Aug 2025 15:12:34 -0700 Subject: [PATCH 084/100] Use std::map::insert to avoid a call to std::piecewise_construct (NFC) --- include/swift/RemoteInspection/ReflectionContext.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/swift/RemoteInspection/ReflectionContext.h b/include/swift/RemoteInspection/ReflectionContext.h index 3077980f3b53f..35ceb24f3bf4f 100644 --- a/include/swift/RemoteInspection/ReflectionContext.h +++ b/include/swift/RemoteInspection/ReflectionContext.h @@ -989,7 +989,7 @@ class ReflectionContext if (idx >= segments.size()) return false; LLVM_DEBUG(llvm::dbgs() << sectName << ": " << idx << "\n"); - sections[sectName] = segments[idx]; + sections.insert({sectName, segments[idx]}); } } cursor += len; @@ -1027,7 +1027,7 @@ class ReflectionContext if (!decodeULEB32(flags)) return false; LLVM_DEBUG(llvm::dbgs() << sectName << ": " << idx << "\n"); - sections[sectName] = segments[idx]; + sections.insert({sectName, segments[idx]}); } } cursor += len; From 301a2e21c3a5bb06106ca7e524db53bdddc6d6dd Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Wed, 3 Sep 2025 15:42:21 -0700 Subject: [PATCH 085/100] Unconditionally enable debug info in ClangImporter when DebuggerSupport is requested --- lib/ClangImporter/ClangImporter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index 9ef3e3debdcc4..bd0bfb5892e92 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -862,6 +862,10 @@ importer::addCommonInvocationArguments( invocationArgStrs.push_back("-mcx16"); } + // REPL and LLDB unconditionally want debug info in pcm files. + if (importerOpts.DebuggerSupport) + invocationArgStrs.push_back("-g"); + if (triple.isOSDarwin()) { if (auto variantTriple = ctx.LangOpts.TargetVariant) { // Passing the -target-variant along to clang causes clang's From 9cf7103d2a27dd4af24ad3b43601b4836305561b Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 4 Sep 2025 01:13:31 +0100 Subject: [PATCH 086/100] [test][Windows] Fix `Reflection/wasm.test` failure on rebranch This test needs `yaml2obj`, which we weren't building on Windows. --- test/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 34eaf125dfc02..98fdb1942b5fe 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -135,7 +135,8 @@ function(get_test_dependencies SDK result_var_name) llvm-strings llvm-readtapi not - split-file) + split-file + yaml2obj) endif() if(("${SDK}" STREQUAL "IOS") OR From 1cdcd0cb794caac457027d7af8601d9f3e9858e5 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Thu, 4 Sep 2025 21:29:44 +0100 Subject: [PATCH 087/100] [test] Temporarily disable 2 C++ interop tests --- test/Interop/Cxx/stdlib/msvcprt-module-interface.swift | 1 + test/Interop/SwiftToCxx/functions/swift-functions-errors.swift | 1 + 2 files changed, 2 insertions(+) diff --git a/test/Interop/Cxx/stdlib/msvcprt-module-interface.swift b/test/Interop/Cxx/stdlib/msvcprt-module-interface.swift index 63dd1a39e515c..c70d46ab9f776 100644 --- a/test/Interop/Cxx/stdlib/msvcprt-module-interface.swift +++ b/test/Interop/Cxx/stdlib/msvcprt-module-interface.swift @@ -4,6 +4,7 @@ // This test is specific to msvcprt and therefore only runs on Windows. // REQUIRES: OS=windows-msvc +// REQUIRES: rdar159879290 // CHECK-STD: import CxxStdlib.iosfwd // CHECK-STD: import CxxStdlib.string diff --git a/test/Interop/SwiftToCxx/functions/swift-functions-errors.swift b/test/Interop/SwiftToCxx/functions/swift-functions-errors.swift index 1b95fc0e2d3be..23eeb0cd32fb5 100644 --- a/test/Interop/SwiftToCxx/functions/swift-functions-errors.swift +++ b/test/Interop/SwiftToCxx/functions/swift-functions-errors.swift @@ -5,6 +5,7 @@ // RUN: %check-interop-cxx-header-in-clang(%t/functions.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY -DSWIFT_CXX_INTEROP_EXPERIMENTAL_SWIFT_ERROR -Wno-unused-function) // REQUIRES: swift_feature_GenerateBindingsForThrowingFunctionsInCXX +// REQUIRES: rdar159879290 // CHECK-LABEL: namespace Functions SWIFT_PRIVATE_ATTR SWIFT_SYMBOL_MODULE("Functions") { From 01dae2eccfa4b649a3cf982a98c3cc01257466aa Mon Sep 17 00:00:00 2001 From: Charles Zablit Date: Tue, 9 Sep 2025 17:29:38 +0100 Subject: [PATCH 088/100] [windows][lldb] deactivate DebugInfo/basic.swift while it's being fixed --- test/DebugInfo/basic.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/test/DebugInfo/basic.swift b/test/DebugInfo/basic.swift index ca64ef87f9bf2..31f0febd0e2af 100644 --- a/test/DebugInfo/basic.swift +++ b/test/DebugInfo/basic.swift @@ -1,4 +1,5 @@ // A (no longer) basic test for debug info. +// XFAIL: OS=windows-msvc // -------------------------------------------------------------------- // Verify that we don't emit any debug info by default. // RUN: %target-swift-frontend %s -emit-ir -o - \ From 5b3a7e563e8b3b8da4c8e6f359fcd45dce873d70 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 10 Sep 2025 04:06:20 +0100 Subject: [PATCH 089/100] [test] Adjust `api-digester/dump-module.swift` for rebranch The API digester queries the top-level declarations for the Swift module `cake`. The first file in that module is a `ClangModuleUnit`, so we proceed to import that file into Swift. The clang importer fetches the lookup table, then looks up and imports everything in it. rebranch: 1. The lookup table ends up containing `__Int64x2_t`, a new "neon vector type". These are not built-in types, but neither are they declared anywhere. You express them using an attribute combined with an integral type, e.g. `__attribute__((neon_vector_type(8))) int8_t`. For whatever reason, these types are for AArch64 only, which explains why we don't see the test failure on x86 runners. 2. The neon vector type is imported via `SwiftTypeConverter::VisitVectorType`, where we use `NominalTypeDecl::lookupConformance` to verify that the vector type's element type (imported as `Int` in this case) conforms to `SIMDScalar`. 3. Conformance lookup triggers extension loading. Because we haven't added any extensions to `Int` yet, and the standard library happens to come before `cake` in the list of module loaders, extensions from `cake` are added last. main: 1. No neon vector types, so we happen not to look up `Int`'s conformances during importation of `cake.h`. 2. The next file is `cake.swift`. In the process of deserializing the AST for that file, we encounter `Int` extensions and add them to the nominal. Eventually, while processing the collected top-level declarations, the API digester calls `getAllConformances` on `Int`, and we see a difference in the index of `P1` between main and rebranch because conformances from extensions are added to the table in the order those extensions were added to the nominal. --- test/api-digester/Outputs/cake-abi.json | 14 +++++++------- test/api-digester/Outputs/cake.json | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/test/api-digester/Outputs/cake-abi.json b/test/api-digester/Outputs/cake-abi.json index a1697144c7a31..58ca05d93ccc1 100644 --- a/test/api-digester/Outputs/cake-abi.json +++ b/test/api-digester/Outputs/cake-abi.json @@ -2154,13 +2154,6 @@ "usr": "s:s9EscapableP", "mangledName": "$ss9EscapableP" }, - { - "kind": "Conformance", - "name": "P1", - "printedName": "P1", - "usr": "s:4cake2P1P", - "mangledName": "$s4cake2P1P" - }, { "kind": "Conformance", "name": "Encodable", @@ -2351,6 +2344,13 @@ "printedName": "BitwiseCopyable", "usr": "s:s15BitwiseCopyableP", "mangledName": "$ss15BitwiseCopyableP" + }, + { + "kind": "Conformance", + "name": "P1", + "printedName": "P1", + "usr": "s:4cake2P1P", + "mangledName": "$s4cake2P1P" } ] } diff --git a/test/api-digester/Outputs/cake.json b/test/api-digester/Outputs/cake.json index 5f1d958671cea..f35d60de53c4b 100644 --- a/test/api-digester/Outputs/cake.json +++ b/test/api-digester/Outputs/cake.json @@ -2048,13 +2048,6 @@ "usr": "s:s9EscapableP", "mangledName": "$ss9EscapableP" }, - { - "kind": "Conformance", - "name": "P1", - "printedName": "P1", - "usr": "s:4cake2P1P", - "mangledName": "$s4cake2P1P" - }, { "kind": "Conformance", "name": "Encodable", @@ -2238,6 +2231,13 @@ "printedName": "BitwiseCopyable", "usr": "s:s15BitwiseCopyableP", "mangledName": "$ss15BitwiseCopyableP" + }, + { + "kind": "Conformance", + "name": "P1", + "printedName": "P1", + "usr": "s:4cake2P1P", + "mangledName": "$s4cake2P1P" } ] } From b36c9f89d532caaa03fdd28d3ab4ca7facd74a10 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Wed, 10 Sep 2025 16:49:05 -0700 Subject: [PATCH 090/100] [ClangImporter] Set the debug info level to full debug info. Upstream clang has introduced a new default level for Linux that sits between no debug info and full debug info. --- lib/ClangImporter/ClangImporter.cpp | 2 ++ lib/Frontend/ModuleInterfaceLoader.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index 9dc2d10594a02..0012f2c04d85a 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -1377,6 +1377,8 @@ std::unique_ptr ClangImporter::create( // The Clang modules produced by ClangImporter are always embedded in an // ObjectFilePCHContainer and contain -gmodules debug info. importer->Impl.Invocation->getCodeGenOpts().DebugTypeExtRefs = true; + importer->Impl.Invocation->getCodeGenOpts().setDebugInfo( + llvm::codegenoptions::FullDebugInfo); auto PCHContainerOperations = std::make_shared(); diff --git a/lib/Frontend/ModuleInterfaceLoader.cpp b/lib/Frontend/ModuleInterfaceLoader.cpp index 2dc62e5d08502..fb4b0289f0cb9 100644 --- a/lib/Frontend/ModuleInterfaceLoader.cpp +++ b/lib/Frontend/ModuleInterfaceLoader.cpp @@ -2089,6 +2089,12 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl( GenericArgs.push_back("-enable-experimental-feature"); GenericArgs.push_back("Embedded"); } + + if (langOpts.DebuggerSupport) { + subClangImporterOpts.ExtraArgs.push_back("-gmodules"); + subClangImporterOpts.ExtraArgs.push_back("-g"); + } + } /// Calculate an output filename in \p genericSubInvocation's cache path that From 566686141476b5a8f788f56138daf2a43743734a Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Fri, 12 Sep 2025 15:02:11 +0100 Subject: [PATCH 091/100] Revert "[test] Adjust `api-digester/dump-module.swift` for rebranch" Reverts https://github.com/swiftlang/swift/pull/84193 in favor of https://github.com/swiftlang/swift/pull/84256. --- test/api-digester/Outputs/cake-abi.json | 14 +++++++------- test/api-digester/Outputs/cake.json | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/test/api-digester/Outputs/cake-abi.json b/test/api-digester/Outputs/cake-abi.json index 58ca05d93ccc1..a1697144c7a31 100644 --- a/test/api-digester/Outputs/cake-abi.json +++ b/test/api-digester/Outputs/cake-abi.json @@ -2154,6 +2154,13 @@ "usr": "s:s9EscapableP", "mangledName": "$ss9EscapableP" }, + { + "kind": "Conformance", + "name": "P1", + "printedName": "P1", + "usr": "s:4cake2P1P", + "mangledName": "$s4cake2P1P" + }, { "kind": "Conformance", "name": "Encodable", @@ -2344,13 +2351,6 @@ "printedName": "BitwiseCopyable", "usr": "s:s15BitwiseCopyableP", "mangledName": "$ss15BitwiseCopyableP" - }, - { - "kind": "Conformance", - "name": "P1", - "printedName": "P1", - "usr": "s:4cake2P1P", - "mangledName": "$s4cake2P1P" } ] } diff --git a/test/api-digester/Outputs/cake.json b/test/api-digester/Outputs/cake.json index f35d60de53c4b..5f1d958671cea 100644 --- a/test/api-digester/Outputs/cake.json +++ b/test/api-digester/Outputs/cake.json @@ -2048,6 +2048,13 @@ "usr": "s:s9EscapableP", "mangledName": "$ss9EscapableP" }, + { + "kind": "Conformance", + "name": "P1", + "printedName": "P1", + "usr": "s:4cake2P1P", + "mangledName": "$s4cake2P1P" + }, { "kind": "Conformance", "name": "Encodable", @@ -2231,13 +2238,6 @@ "printedName": "BitwiseCopyable", "usr": "s:s15BitwiseCopyableP", "mangledName": "$ss15BitwiseCopyableP" - }, - { - "kind": "Conformance", - "name": "P1", - "printedName": "P1", - "usr": "s:4cake2P1P", - "mangledName": "$s4cake2P1P" } ] } From 4663b6625d5b0b8ca736fe69b97e2769c16906b9 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Fri, 12 Sep 2025 10:26:58 -0700 Subject: [PATCH 092/100] [LLDB] Differentiate between CC1 and driver args --- lib/Frontend/ModuleInterfaceLoader.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/Frontend/ModuleInterfaceLoader.cpp b/lib/Frontend/ModuleInterfaceLoader.cpp index fb4b0289f0cb9..7b82c7b8aed98 100644 --- a/lib/Frontend/ModuleInterfaceLoader.cpp +++ b/lib/Frontend/ModuleInterfaceLoader.cpp @@ -2091,10 +2091,15 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl( } if (langOpts.DebuggerSupport) { - subClangImporterOpts.ExtraArgs.push_back("-gmodules"); - subClangImporterOpts.ExtraArgs.push_back("-g"); + if (clangImporterOpts.DirectClangCC1ModuleBuild) { + subClangImporterOpts.ExtraArgs.push_back("-dwarf-ext-refs"); + subClangImporterOpts.ExtraArgs.push_back("-fmodule-format=obj"); + subClangImporterOpts.ExtraArgs.push_back("-debug-info-kind=standalone"); + } else { + subClangImporterOpts.ExtraArgs.push_back("-gmodules"); + subClangImporterOpts.ExtraArgs.push_back("-g"); + } } - } /// Calculate an output filename in \p genericSubInvocation's cache path that From b2fda7ffe60efba8cb139631f4317061522eef76 Mon Sep 17 00:00:00 2001 From: Ebuka Ezike Date: Tue, 16 Sep 2025 14:28:14 +0100 Subject: [PATCH 093/100] [Debug] Renable DebugDescription macro on linux --- stdlib/public/core/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/public/core/CMakeLists.txt b/stdlib/public/core/CMakeLists.txt index 2c9503459735c..44b1d642efbbe 100644 --- a/stdlib/public/core/CMakeLists.txt +++ b/stdlib/public/core/CMakeLists.txt @@ -288,7 +288,7 @@ if(SWIFT_STDLIB_ENABLE_VECTOR_TYPES) endif() # Freestanding and Linux/Android builds both have failures to resolve. -if(NOT BOOTSTRAPPING_MODE STREQUAL "OFF" AND NOT SWIFT_FREESTANDING_FLAVOR AND NOT SWIFT_HOST_VARIANT_SDK STREQUAL "LINUX" AND NOT SWIFT_HOST_VARIANT_SDK STREQUAL "ANDROID") +if(NOT BOOTSTRAPPING_MODE STREQUAL "OFF" AND NOT SWIFT_FREESTANDING_FLAVOR AND NOT SWIFT_HOST_VARIANT_SDK STREQUAL "ANDROID") list(APPEND SWIFTLIB_SOURCES ObjectIdentifier+DebugDescription.swift) endif() From b576aeea3b4e6aacd0679a22d5e4f04db006d894 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Wed, 17 Sep 2025 09:37:50 -0700 Subject: [PATCH 094/100] ClangImporter: Only force full debug info when DebuggerSupport is enabled --- lib/ClangImporter/ClangImporter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index 0012f2c04d85a..4f0c6f0967343 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -1377,8 +1377,9 @@ std::unique_ptr ClangImporter::create( // The Clang modules produced by ClangImporter are always embedded in an // ObjectFilePCHContainer and contain -gmodules debug info. importer->Impl.Invocation->getCodeGenOpts().DebugTypeExtRefs = true; - importer->Impl.Invocation->getCodeGenOpts().setDebugInfo( - llvm::codegenoptions::FullDebugInfo); + if (importerOpts.DebuggerSupport) + importer->Impl.Invocation->getCodeGenOpts().setDebugInfo( + llvm::codegenoptions::FullDebugInfo); auto PCHContainerOperations = std::make_shared(); From 472644e335c9f92792c13125479131335533d8f2 Mon Sep 17 00:00:00 2001 From: "Henrik G. Olsson" Date: Mon, 22 Sep 2025 14:58:47 -0700 Subject: [PATCH 095/100] [Interop] Fix tests relying on transitive module imports (NFC) --- .../Inputs/TransitiveModules/module.modulemap | 24 ----------------- .../C/swiftify-import/Inputs/module.modulemap | 26 +++++++++++++++++++ .../clang-includes-aliasing-imports.swift | 4 +-- ...g-includes-indirect-explicit-modules.swift | 6 ++--- .../clang-includes-redundant-imports.swift | 22 ++++++++-------- 5 files changed, 42 insertions(+), 40 deletions(-) delete mode 100644 test/Interop/C/swiftify-import/Inputs/TransitiveModules/module.modulemap diff --git a/test/Interop/C/swiftify-import/Inputs/TransitiveModules/module.modulemap b/test/Interop/C/swiftify-import/Inputs/TransitiveModules/module.modulemap deleted file mode 100644 index 7c3b96f1111b9..0000000000000 --- a/test/Interop/C/swiftify-import/Inputs/TransitiveModules/module.modulemap +++ /dev/null @@ -1,24 +0,0 @@ -module ModuleA { - header "module-a.h" - export * -} -module ModuleB { - header "module-b.h" -} -module ModuleOuter { - module ModuleC { - header "module-c.h" - export * - } - explicit module ModuleD { - header "module-d.h" - export * - } -} -module ModuleDeep { - module ModuleDeepNested { - module ModuleDeepNestedNested { - header "module-e.h" - } - } -} diff --git a/test/Interop/C/swiftify-import/Inputs/module.modulemap b/test/Interop/C/swiftify-import/Inputs/module.modulemap index 93416d69a4a97..29c1c6b295413 100644 --- a/test/Interop/C/swiftify-import/Inputs/module.modulemap +++ b/test/Interop/C/swiftify-import/Inputs/module.modulemap @@ -33,3 +33,29 @@ module ClangIncludesModule { module ClangIncludesNoExportModule { header "clang-includes.h" } + +// TransitiveModules/ +module ModuleA { + header "TransitiveModules/module-a.h" + export * +} +module ModuleB { + header "TransitiveModules/module-b.h" +} +module ModuleOuter { + module ModuleC { + header "TransitiveModules/module-c.h" + export * + } + explicit module ModuleD { + header "TransitiveModules/module-d.h" + export * + } +} +module ModuleDeep { + module ModuleDeepNested { + module ModuleDeepNestedNested { + header "TransitiveModules/module-e.h" + } + } +} diff --git a/test/Interop/C/swiftify-import/clang-includes-aliasing-imports.swift b/test/Interop/C/swiftify-import/clang-includes-aliasing-imports.swift index 6e4419de54413..13588c6d76abd 100644 --- a/test/Interop/C/swiftify-import/clang-includes-aliasing-imports.swift +++ b/test/Interop/C/swiftify-import/clang-includes-aliasing-imports.swift @@ -6,8 +6,8 @@ // RUN: %target-swift-frontend -dump-source-file-imports -emit-module -plugin-path %swift-plugin-dir -o %t/ClangIncludesExplicit.swiftmodule -I %t/Inputs -enable-experimental-feature SafeInteropWrappers %t/test.swift 2>&1 | %FileCheck %s --check-prefix DUMP // RUN: %target-swift-frontend -dump-source-file-imports -emit-module -plugin-path %swift-plugin-dir -o %t/ClangIncludesExplicit.swiftmodule -I %t/Inputs -enable-experimental-feature SafeInteropWrappers %t/test.swift -cxx-interoperability-mode=default 2>&1 | %FileCheck %s --check-prefix DUMP --check-prefix DUMP-CXX -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-A1 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A2 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-A2 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-A1 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A2 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-A2 --implicit-check-not=import --match-full-lines //--- test.swift import A1 diff --git a/test/Interop/C/swiftify-import/clang-includes-indirect-explicit-modules.swift b/test/Interop/C/swiftify-import/clang-includes-indirect-explicit-modules.swift index e6131d7cee542..35a934ec4d2a8 100644 --- a/test/Interop/C/swiftify-import/clang-includes-indirect-explicit-modules.swift +++ b/test/Interop/C/swiftify-import/clang-includes-indirect-explicit-modules.swift @@ -6,10 +6,10 @@ // RUN: %target-swift-frontend -dump-source-file-imports -emit-module -plugin-path %swift-plugin-dir -o %t/ClangIncludesExplicit.swiftmodule -I %t/Inputs -enable-experimental-feature SafeInteropWrappers %t/test.swift 2>&1 | %FileCheck %s --check-prefix DUMP // RUN: %target-swift-frontend -dump-source-file-imports -emit-module -plugin-path %swift-plugin-dir -o %t/ClangIncludesExplicit.swiftmodule -I %t/Inputs -enable-experimental-feature SafeInteropWrappers %t/test.swift -cxx-interoperability-mode=default 2>&1 | %FileCheck %s --check-prefix DUMP --check-prefix DUMP-CXX -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.B1 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-B1 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.B1.C1 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-C1 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.B1 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-B1 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.B1.C1 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-C1 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A2.B2 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-B2 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A2.B2 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-B2 --implicit-check-not=import --match-full-lines //--- test.swift import A1.B1 diff --git a/test/Interop/C/swiftify-import/clang-includes-redundant-imports.swift b/test/Interop/C/swiftify-import/clang-includes-redundant-imports.swift index 34fec7dfc97e2..0ea13db6ee4c4 100644 --- a/test/Interop/C/swiftify-import/clang-includes-redundant-imports.swift +++ b/test/Interop/C/swiftify-import/clang-includes-redundant-imports.swift @@ -6,17 +6,17 @@ // RUN: %target-swift-frontend -dump-source-file-imports -emit-module -plugin-path %swift-plugin-dir -o %t/ClangIncludesExplicit.swiftmodule -I %t/Inputs -enable-experimental-feature SafeInteropWrappers %t/test.swift 2>&1 | %FileCheck %s --check-prefix DUMP // RUN: %target-swift-frontend -dump-source-file-imports -emit-module -plugin-path %swift-plugin-dir -o %t/ClangIncludesExplicit.swiftmodule -I %t/Inputs -enable-experimental-feature SafeInteropWrappers %t/test.swift -cxx-interoperability-mode=default 2>&1 | %FileCheck %s --check-prefix DUMP --check-prefix DUMP-CXX -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-A1 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.B1 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-B1 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.B1.C1 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-C1 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.B1.C1.D1 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-D1 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.E1 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-E1 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.E1.F1 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-F1 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.E1.G1 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-G1 --implicit-check-not=import --match-full-lines - -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A2.B2 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-B2 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A2.B2.C2 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-C2 --implicit-check-not=import --match-full-lines -// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A2.B2.C2.D2 -plugin-path %swift-plugin-dir -I %t -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-D2 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-A1 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.B1 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-B1 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.B1.C1 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-C1 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.B1.C1.D1 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-D1 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.E1 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-E1 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.E1.F1 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-F1 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A1.E1.G1 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-G1 --implicit-check-not=import --match-full-lines + +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A2.B2 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-B2 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A2.B2.C2 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-C2 --implicit-check-not=import --match-full-lines +// RUN: %target-swift-ide-test -print-module -module-print-hidden -module-to-print=A2.B2.C2.D2 -plugin-path %swift-plugin-dir -I %t/Inputs -source-filename=x -enable-experimental-feature SafeInteropWrappers | %FileCheck %s --check-prefix CHECK-D2 --implicit-check-not=import --match-full-lines //--- test.swift import A1 From a9734830c25c870decc928ba64c3584d1f7d1125 Mon Sep 17 00:00:00 2001 From: Gabor Horvath Date: Thu, 11 Sep 2025 17:20:40 +0100 Subject: [PATCH 096/100] [cxx-interop] Attempt to fix some windows test failures on rebranch Unfortunately, I did not find an easy way to fix the warning so suppressed it for now. But I don't think we care about those symbols being duplicated across different shared libraries. rdar://159879290 --- lib/PrintAsClang/_SwiftStdlibCxxOverlay.h | 5 +++++ test/Interop/Cxx/stdlib/msvcprt-module-interface.swift | 6 +++--- .../SwiftToCxx/functions/swift-functions-errors.swift | 1 - 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/PrintAsClang/_SwiftStdlibCxxOverlay.h b/lib/PrintAsClang/_SwiftStdlibCxxOverlay.h index a29ec356cb9e8..885bbb3773ad8 100644 --- a/lib/PrintAsClang/_SwiftStdlibCxxOverlay.h +++ b/lib/PrintAsClang/_SwiftStdlibCxxOverlay.h @@ -171,8 +171,13 @@ struct SymbolicP { } __attribute__((packed)); SWIFT_INLINE_THUNK const void *_Nullable getErrorMetadata() { +// We do not care about these symbols being duplicated across multiple shared +// libraries for now. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunique-object-duplication" static SymbolicP errorSymbol; static int *_Nonnull got_ss5ErrorMp = &$ss5ErrorMp; +#pragma clang diagnostic pop errorSymbol._1 = 2; errorSymbol._2 = static_cast(reinterpret_cast(&got_ss5ErrorMp) - diff --git a/test/Interop/Cxx/stdlib/msvcprt-module-interface.swift b/test/Interop/Cxx/stdlib/msvcprt-module-interface.swift index c70d46ab9f776..3fbd3be898749 100644 --- a/test/Interop/Cxx/stdlib/msvcprt-module-interface.swift +++ b/test/Interop/Cxx/stdlib/msvcprt-module-interface.swift @@ -4,7 +4,6 @@ // This test is specific to msvcprt and therefore only runs on Windows. // REQUIRES: OS=windows-msvc -// REQUIRES: rdar159879290 // CHECK-STD: import CxxStdlib.iosfwd // CHECK-STD: import CxxStdlib.string @@ -16,8 +15,9 @@ // CHECK-STRING: struct basic_string, std.allocator> : CxxRandomAccessCollection { // CHECK-STRING: typealias value_type = CChar // CHECK-STRING: } -// CHECK-STRING: struct basic_string, std.allocator> : CxxRandomAccessCollection { -// CHECK-STRING: typealias value_type = CWideChar +// CHECK-STRING: struct basic_string, std.allocator> : CxxRandomAccessCollection { +// CHECK-STRING: typealias value_type = UInt16 +// FIXME: why the value type is different from CChar16? // CHECK-STRING: } // CHECK-STRING: typealias string = std.basic_string, std.allocator> // CHECK-STRING: typealias wstring = std.basic_string, std.allocator> diff --git a/test/Interop/SwiftToCxx/functions/swift-functions-errors.swift b/test/Interop/SwiftToCxx/functions/swift-functions-errors.swift index 23eeb0cd32fb5..1b95fc0e2d3be 100644 --- a/test/Interop/SwiftToCxx/functions/swift-functions-errors.swift +++ b/test/Interop/SwiftToCxx/functions/swift-functions-errors.swift @@ -5,7 +5,6 @@ // RUN: %check-interop-cxx-header-in-clang(%t/functions.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY -DSWIFT_CXX_INTEROP_EXPERIMENTAL_SWIFT_ERROR -Wno-unused-function) // REQUIRES: swift_feature_GenerateBindingsForThrowingFunctionsInCXX -// REQUIRES: rdar159879290 // CHECK-LABEL: namespace Functions SWIFT_PRIVATE_ATTR SWIFT_SYMBOL_MODULE("Functions") { From 68b3b53adeb31a76a61a8085155086679e2a90a4 Mon Sep 17 00:00:00 2001 From: Charles Zablit Date: Mon, 29 Sep 2025 19:00:26 +0100 Subject: [PATCH 097/100] [windows] create a Windows specific Debug/basic.swift test --- test/DebugInfo/advanced.swift | 81 ++++++++++++++++++++++++++ test/DebugInfo/basic.swift | 91 +++--------------------------- test/DebugInfo/basic_windows.swift | 17 ++++++ 3 files changed, 106 insertions(+), 83 deletions(-) create mode 100644 test/DebugInfo/advanced.swift create mode 100644 test/DebugInfo/basic_windows.swift diff --git a/test/DebugInfo/advanced.swift b/test/DebugInfo/advanced.swift new file mode 100644 index 0000000000000..7fe50b54106b1 --- /dev/null +++ b/test/DebugInfo/advanced.swift @@ -0,0 +1,81 @@ +// A (no longer) basic test for debug info. +// -------------------------------------------------------------------- +// Verify that we don't emit any type info with -gline-tables-only. +// RUN: %target-swift-frontend %s -emit-ir -gline-tables-only -o - \ +// RUN: | %FileCheck %s --check-prefix CHECK-LINETABLES +// CHECK: !dbg +// CHECK-LINETABLES-NOT: DI{{.*}}Variable +// CHECK-LINETABLES-NOT: DW_TAG_structure_type +// CHECK-LINETABLES-NOT: DIBasicType +// -------------------------------------------------------------------- +// Now check that we do generate line+scope info with -g. +// RUN: %target-swift-frontend %/s -emit-ir -g -o - \ +// RUN: | %FileCheck %s --check-prefixes CHECK,DWARF-CHECK +// -------------------------------------------------------------------- +// Currently -gdwarf-types should give the same results as -g. +// RUN: %target-swift-frontend %/s -emit-ir -gdwarf-types -o - \ +// RUN: | %FileCheck %s --check-prefixes CHECK,DWARF-CHECK +// -------------------------------------------------------------------- +// Verify that -g -debug-info-format=dwarf gives the same results as -g. +// RUN: %target-swift-frontend %/s -emit-ir -g -debug-info-format=dwarf -o - \ +// RUN: | %FileCheck %s --check-prefixes CHECK,DWARF-CHECK +// -------------------------------------------------------------------- +// RUN: %target-swift-frontend %/s -emit-ir -g -debug-info-format=codeview -o - \ +// RUN: | %FileCheck %s --check-prefixes CHECK,CV-CHECK +// -------------------------------------------------------------------- +// +// CHECK: foo +// CHECK-DAG: ret{{.*}}, !dbg ![[RET:[0-9]+]] +// CHECK-DAG: ![[FOO:[0-9]+]] = distinct !DISubprogram(name: "foo",{{.*}} line: [[@LINE+2]],{{.*}} type: ![[FOOTYPE:[0-9]+]] +public +func foo(_ a: Int64, _ b: Int64) -> Int64 { + var a = a + var b = b + // CHECK-DAG: ![[ALOC:.*]] = !DILocation(line: [[@LINE-3]],{{.*}} scope: ![[FOO]]) + // Check that a is the first and b is the second argument. + // CHECK-DAG: store i64 %0, ptr [[AADDR:.*]], align + // CHECK-DAG: store i64 %1, ptr [[BADDR:.*]], align + // CHECK-DAG: [[AVAL:%.*]] = getelementptr inbounds {{.*}}, [[AMEM:.*]], i32 0, i32 0 + // CHECK-DAG: [[BVAL:%.*]] = getelementptr inbounds {{.*}}, [[BMEM:.*]], i32 0, i32 0 + // CHECK-DAG: #dbg_declare(ptr [[AADDR]], ![[AARG:.*]], !DIExpression(), ![[ALOC]] + // CHECK-DAG: #dbg_declare(ptr [[BADDR]], ![[BARG:.*]], !DIExpression() + // CHECK-DAG: ![[AARG]] = !DILocalVariable(name: "a", arg: 1 + // CHECK-DAG: ![[BARG]] = !DILocalVariable(name: "b", arg: 2 + if b != 0 { + // CHECK-DAG: !DILexicalBlock({{.*}} line: [[@LINE-1]] + // Transparent inlined multiply: + // CHECK-DAG: smul{{.*}}, !dbg ![[MUL:[0-9]+]] + // CHECK-DAG: [[MUL]] = !DILocation(line: [[@LINE+1]], + return a*b + } else { + // CHECK-DAG: ![[PARENT:[0-9]+]] = distinct !DILexicalBlock({{.*}} line: [[@LINE-1]] + // CHECK-DAG: ![[VARSCOPE:[0-9]+]] = distinct !DILexicalBlock({{.*}} line: [[@LINE+1]] + var c: Int64 = 42 + // CHECK-DAG: ![[CONDITION:[0-9]+]] = distinct !DILexicalBlock(scope: ![[VARSCOPE]], {{.*}}, line: [[@LINE+1]] + if a == 0 { + // CHECK-DAG: !DILexicalBlock(scope: ![[CONDITION]], {{.*}}, line: [[@LINE-1]] + // What about a nested scope? + return 0 + } + return c + } +} + +// CHECK-DAG: ![[MAINFILE:[0-9]+]] = !DIFile(filename: "{{.*}}DebugInfo/advanced.swift", directory: "{{.*}}") +// CHECK-DAG: !DICompileUnit(language: DW_LANG_Swift, file: ![[MAINFILE]],{{.*}} producer: "{{.*}}Swift version{{.*}},{{.*}} +// CHECK-DAG: !DISubprogram(name: "main", {{.*}}file: ![[MAINFILE]], + +// Function type for foo. +// CHECK-DAG: ![[FOOTYPE]] = !DISubroutineType(types: ![[PARAMTYPES:[0-9]+]]) +// CHECK-DAG: ![[INT64:.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Int64", {{.*}}, identifier: "$ss5Int64VD") +// CHECK-DAG: ![[PARAMTYPES]] = !{![[INT64]], ![[INT64]], ![[INT64]]} +// Import of the main module with the implicit name. +// CHECK-DAG: !DIImportedEntity(tag: DW_TAG_imported_module, scope: ![[MAINFILE]], entity: ![[MAINMODULE:[0-9]+]], file: ![[MAINFILE]]) +// CHECK-DAG: ![[MAINMODULE]] = !DIModule({{.*}}, name: "advanced" + +// DWARF Version +// DWARF-CHECK-DAG: i32 7, !"Dwarf Version", i32 4} +// CV-CHECK-DAG: i32 2, !"CodeView", i32 1} + +// Debug Info Version +// CHECK-DAG: i32 2, !"Debug Info Version", i32 diff --git a/test/DebugInfo/basic.swift b/test/DebugInfo/basic.swift index 31f0febd0e2af..8f2ff92818b67 100644 --- a/test/DebugInfo/basic.swift +++ b/test/DebugInfo/basic.swift @@ -1,7 +1,8 @@ -// A (no longer) basic test for debug info. -// XFAIL: OS=windows-msvc +// A basic test for debug info. +// UNSUPPORTED: OS=windows-msvc // -------------------------------------------------------------------- -// Verify that we don't emit any debug info by default. +// Verify that we don't emit any debug info by default. This test has a +// specific Windows implementation in debug_basic_windows.swift. // RUN: %target-swift-frontend %s -emit-ir -o - \ // RUN: | %FileCheck %s --check-prefix NDEBUG // NDEBUG: source_filename @@ -11,83 +12,7 @@ // Verify that we don't emit any debug info with -gnone. // RUN: %target-swift-frontend %s -emit-ir -gnone -o - \ // RUN: | %FileCheck %s --check-prefix NDEBUG -// -------------------------------------------------------------------- -// Verify that we don't emit any type info with -gline-tables-only. -// RUN: %target-swift-frontend %s -emit-ir -gline-tables-only -o - \ -// RUN: | %FileCheck %s --check-prefix CHECK-LINETABLES -// CHECK: !dbg -// CHECK-LINETABLES-NOT: DI{{.*}}Variable -// CHECK-LINETABLES-NOT: DW_TAG_structure_type -// CHECK-LINETABLES-NOT: DIBasicType -// -------------------------------------------------------------------- -// Now check that we do generate line+scope info with -g. -// RUN: %target-swift-frontend %/s -emit-ir -g -o - \ -// RUN: | %FileCheck %s --check-prefixes CHECK,DWARF-CHECK -// -------------------------------------------------------------------- -// Currently -gdwarf-types should give the same results as -g. -// RUN: %target-swift-frontend %/s -emit-ir -gdwarf-types -o - \ -// RUN: | %FileCheck %s --check-prefixes CHECK,DWARF-CHECK -// -------------------------------------------------------------------- -// Verify that -g -debug-info-format=dwarf gives the same results as -g. -// RUN: %target-swift-frontend %/s -emit-ir -g -debug-info-format=dwarf -o - \ -// RUN: | %FileCheck %s --check-prefixes CHECK,DWARF-CHECK -// -------------------------------------------------------------------- -// RUN: %target-swift-frontend %/s -emit-ir -g -debug-info-format=codeview -o - \ -// RUN: | %FileCheck %s --check-prefixes CHECK,CV-CHECK -// -------------------------------------------------------------------- -// -// CHECK: foo -// CHECK-DAG: ret{{.*}}, !dbg ![[RET:[0-9]+]] -// CHECK-DAG: ![[FOO:[0-9]+]] = distinct !DISubprogram(name: "foo",{{.*}} line: [[@LINE+2]],{{.*}} type: ![[FOOTYPE:[0-9]+]] -public -func foo(_ a: Int64, _ b: Int64) -> Int64 { - var a = a - var b = b - // CHECK-DAG: ![[ALOC:.*]] = !DILocation(line: [[@LINE-3]],{{.*}} scope: ![[FOO]]) - // Check that a is the first and b is the second argument. - // CHECK-DAG: store i64 %0, ptr [[AADDR:.*]], align - // CHECK-DAG: store i64 %1, ptr [[BADDR:.*]], align - // CHECK-DAG: [[AVAL:%.*]] = getelementptr inbounds {{.*}}, [[AMEM:.*]], i32 0, i32 0 - // CHECK-DAG: [[BVAL:%.*]] = getelementptr inbounds {{.*}}, [[BMEM:.*]], i32 0, i32 0 - // CHECK-DAG: #dbg_declare(ptr [[AADDR]], ![[AARG:.*]], !DIExpression(), ![[ALOC]] - // CHECK-DAG: #dbg_declare(ptr [[BADDR]], ![[BARG:.*]], !DIExpression() - // CHECK-DAG: ![[AARG]] = !DILocalVariable(name: "a", arg: 1 - // CHECK-DAG: ![[BARG]] = !DILocalVariable(name: "b", arg: 2 - if b != 0 { - // CHECK-DAG: !DILexicalBlock({{.*}} line: [[@LINE-1]] - // Transparent inlined multiply: - // CHECK-DAG: smul{{.*}}, !dbg ![[MUL:[0-9]+]] - // CHECK-DAG: [[MUL]] = !DILocation(line: [[@LINE+1]], - return a*b - } else { - // CHECK-DAG: ![[PARENT:[0-9]+]] = distinct !DILexicalBlock({{.*}} line: [[@LINE-1]] - // CHECK-DAG: ![[VARSCOPE:[0-9]+]] = distinct !DILexicalBlock({{.*}} line: [[@LINE+1]] - var c: Int64 = 42 - // CHECK-DAG: ![[CONDITION:[0-9]+]] = distinct !DILexicalBlock(scope: ![[VARSCOPE]], {{.*}}, line: [[@LINE+1]] - if a == 0 { - // CHECK-DAG: !DILexicalBlock(scope: ![[CONDITION]], {{.*}}, line: [[@LINE-1]] - // What about a nested scope? - return 0 - } - return c - } -} - -// CHECK-DAG: ![[MAINFILE:[0-9]+]] = !DIFile(filename: "{{.*}}DebugInfo/basic.swift", directory: "{{.*}}") -// CHECK-DAG: !DICompileUnit(language: DW_LANG_Swift, file: ![[MAINFILE]],{{.*}} producer: "{{.*}}Swift version{{.*}},{{.*}} -// CHECK-DAG: !DISubprogram(name: "main", {{.*}}file: ![[MAINFILE]], - -// Function type for foo. -// CHECK-DAG: ![[FOOTYPE]] = !DISubroutineType(types: ![[PARAMTYPES:[0-9]+]]) -// CHECK-DAG: ![[INT64:.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Int64", {{.*}}, identifier: "$ss5Int64VD") -// CHECK-DAG: ![[PARAMTYPES]] = !{![[INT64]], ![[INT64]], ![[INT64]]} -// Import of the main module with the implicit name. -// CHECK-DAG: !DIImportedEntity(tag: DW_TAG_imported_module, scope: ![[MAINFILE]], entity: ![[MAINMODULE:[0-9]+]], file: ![[MAINFILE]]) -// CHECK-DAG: ![[MAINMODULE]] = !DIModule({{.*}}, name: "basic" - -// DWARF Version -// DWARF-CHECK-DAG: i32 7, !"Dwarf Version", i32 4} -// CV-CHECK-DAG: i32 2, !"CodeView", i32 1} - -// Debug Info Version -// CHECK-DAG: i32 2, !"Debug Info Version", i32 +public func foo() -> Int { + let bar = 1 + return bar +} \ No newline at end of file diff --git a/test/DebugInfo/basic_windows.swift b/test/DebugInfo/basic_windows.swift new file mode 100644 index 0000000000000..e2195b08a1c12 --- /dev/null +++ b/test/DebugInfo/basic_windows.swift @@ -0,0 +1,17 @@ +// A basic test for debug info. +// REQUIRES: OS=windows-msvc +// -------------------------------------------------------------------- +// Verify that, by default, we exactly emit 1 DICompileUnit entry without dwoId. +// On Windows, we always emit minimal DebugInfo to match MSVC's behavior: +// See https://github.com/llvm/llvm-project/pull/142970 for more details. +// RUN: %target-swift-frontend %s -emit-ir -o - \ +// RUN: | %FileCheck %s --check-prefix NDEBUG +// NDEBUG: source_filename +// NDEBUG: !DICompileUnit( +// NDEBUG-NOT: dwoId: +// NDEBUG-SAME: ) +// NDEBUG-NOT: !DICompileUnit( +public func foo() -> Int { + let bar = 1 + return bar +} From 5730344cfeb39daabfd3f69a8ede71137c79fa92 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Tue, 30 Sep 2025 21:34:04 +0100 Subject: [PATCH 098/100] IRGen: Fix rebranch build `getTrailingRequiresClause` has a different result type in `stable/21.x`. --- lib/IRGen/GenStruct.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/IRGen/GenStruct.cpp b/lib/IRGen/GenStruct.cpp index 614d92772e122..d870143d153ea 100644 --- a/lib/IRGen/GenStruct.cpp +++ b/lib/IRGen/GenStruct.cpp @@ -657,7 +657,7 @@ namespace { }); bool hasRequiresClause = - copyConstructor->getTrailingRequiresClause() != nullptr; + !copyConstructor->getTrailingRequiresClause().isNull(); if (hasRequiresClause || hasCopyableIfAttr) { ctx.Diags.diagnose(copyConstructorLoc, diag::maybe_missing_annotation, From 6e960d58a0d29b6e7c744357b4970b38cc6da467 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Tue, 30 Sep 2025 20:42:00 -0700 Subject: [PATCH 099/100] Update the main branch scheme to use `stable/21.x` --- utils/update_checkout/update-checkout-config.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/update_checkout/update-checkout-config.json b/utils/update_checkout/update-checkout-config.json index 8e920661871f1..838fe3286e031 100644 --- a/utils/update_checkout/update-checkout-config.json +++ b/utils/update_checkout/update-checkout-config.json @@ -129,10 +129,10 @@ "default-branch-scheme": "main", "branch-schemes": { "main": { - "aliases": ["swift/main", "main", "stable/20240723"], + "aliases": ["swift/main", "main", "stable/21.x"], "repos": { - "llvm-project": "stable/20240723", - "swift-llvm-bindings": "stable/20240723", + "llvm-project": "stable/21.x", + "swift-llvm-bindings": "stable/21.x", "swift": "main", "cmark": "gfm", "llbuild": "main", @@ -557,7 +557,7 @@ } }, "rebranch": { - "aliases": ["rebranch", "stable/21.x", "llvm.org/main"], + "aliases": ["rebranch", "llvm.org/main"], "repos": { "llvm-project": "stable/21.x", "swift-llvm-bindings": "stable/21.x", From d61f71a3d00f9541facc603677c50403e8dd6ef3 Mon Sep 17 00:00:00 2001 From: Charles Zablit Date: Wed, 1 Oct 2025 16:53:25 +0100 Subject: [PATCH 100/100] [windows] fix DebugInfo tests --- test/DebugInfo/Imports.swift | 10 +++++----- test/DebugInfo/ParseableInterfaceImports.swift | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/test/DebugInfo/Imports.swift b/test/DebugInfo/Imports.swift index ce98458c03040..d79a5fe62a37c 100644 --- a/test/DebugInfo/Imports.swift +++ b/test/DebugInfo/Imports.swift @@ -1,5 +1,5 @@ // RUN: %empty-directory(%t) -// RUN: %target-swift-frontend -emit-module-path %t/basic.swiftmodule %S/basic.swift +// RUN: %target-swift-frontend -emit-module-path %t/advanced.swiftmodule %S/advanced.swift // RUN: %target-swift-frontend -emit-ir -module-name Foo %s -I %t -g -o - | %FileCheck %s // RUN: %target-swift-frontend -c -module-name Foo %s -I %t -g -o %t.o @@ -10,13 +10,13 @@ // CHECK-DAG: ![[THISFILE]] = !DIFile(filename: "{{.*}}test{{/|\\\\}}DebugInfo{{/|\\\\}}Imports.swift", // CHECK-DAG: ![[SWIFTMODULE:[0-9]+]] = !DIModule({{.*}}, name: "Swift" // CHECK-DAG: !DIImportedEntity(tag: DW_TAG_imported_module, scope: ![[THISFILE]], entity: ![[SWIFTMODULE]] -// CHECK-DAG: ![[BASICMODULE:[0-9]+]] = !DIModule({{.*}}, name: "basic" +// CHECK-DAG: ![[BASICMODULE:[0-9]+]] = !DIModule({{.*}}, name: "advanced" // CHECK-DAG: !DIImportedEntity(tag: DW_TAG_imported_module, scope: ![[THISFILE]], entity: ![[BASICMODULE]] -import basic +import advanced import typealias Swift.Optional func markUsed(_ t: T) {} -markUsed(basic.foo(1, 2)) +markUsed(advanced.foo(1, 2)) // DWARF: .debug_info // DWARF: DW_TAG_module @@ -26,7 +26,7 @@ markUsed(basic.foo(1, 2)) // DWARF: DW_AT_name ("Swift") // DWARF: DW_AT_LLVM_include_path // DWARF: DW_TAG_module -// DWARF: DW_AT_name ("basic") +// DWARF: DW_AT_name ("advanced") // DWARF-NOT: "Swift.Optional" diff --git a/test/DebugInfo/ParseableInterfaceImports.swift b/test/DebugInfo/ParseableInterfaceImports.swift index e05c0533a8411..1a13c2543d56c 100644 --- a/test/DebugInfo/ParseableInterfaceImports.swift +++ b/test/DebugInfo/ParseableInterfaceImports.swift @@ -1,23 +1,23 @@ // RUN: %empty-directory(%t) -// RUN: %target-swift-frontend-typecheck %S/basic.swift \ -// RUN: -emit-module-interface-path %t/basic.swiftinterface +// RUN: %target-swift-frontend-typecheck %S/advanced.swift \ +// RUN: -emit-module-interface-path %t/advanced.swiftinterface // RUN: %target-swift-frontend -emit-ir -module-name Foo %s -I %t -g -o - \ // RUN: | %FileCheck %s // RUN: %target-swift-frontend -emit-ir -module-name Foo %s -I %t -g -o - \ // RUN: -sdk %t | %FileCheck %s --check-prefix=SDK -import basic +import advanced -// CHECK: !DIModule(scope: null, name: "basic", +// CHECK: !DIModule(scope: null, name: "advanced", // CHECK-SAME: includePath: " -// CHECK-SAME: basic.swiftinterface" +// CHECK-SAME: advanced.swiftinterface" // Even if the module interface is in the SDK, we still return the path // to the swiftinterface. -// SDK: !DIModule(scope: null, name: "basic", +// SDK: !DIModule(scope: null, name: "advanced", // SDK-SAME: includePath: " -// SDK-SAME: basic{{.*}}.swiftinterface" +// SDK-SAME: advanced{{.*}}.swiftinterface" func markUsed(_ t: T) {} -markUsed(basic.foo(1, 2)) +markUsed(advanced.foo(1, 2))