From 96ccca62d5a169b26d193accf02101a01c500185 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Mon, 7 Apr 2025 13:00:00 -0700 Subject: [PATCH 01/51] utils: remove mimalloc workaround Remove a workaround for the ARM64 toolchain when built with mimalloc which would previously have an erroneous reference to the x64 interceptor. --- utils/build.ps1 | 9 --------- utils/update_checkout/update-checkout-config.json | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/utils/build.ps1 b/utils/build.ps1 index 1c5df23fbabd9..523312043e1fb 100644 --- a/utils/build.ps1 +++ b/utils/build.ps1 @@ -1906,12 +1906,6 @@ function Build-mimalloc() { Copy-Item -Path "$BinaryCache\$($Platform.Triple)\mimalloc\bin\$item" -Destination "$($Platform.ToolchainInstallRoot)\usr\bin\" } - # When cross-compiling, bundle the second mimalloc redirect dll as a workaround for - # https://github.com/microsoft/mimalloc/issues/997 - if ($IsCrossCompiling) { - Copy-Item -Path "$BinaryCache\$($Platform.Triple)\mimalloc\bin\mimalloc-redirect$HostSuffix.dll" -Destination "$($Platform.ToolchainInstallRoot)\usr\bin\mimalloc-redirect$BuildSuffix.dll" - } - # TODO: should we split this out into its own function? $Tools = @( "swift.exe", @@ -3139,9 +3133,6 @@ function Build-Installer([Hashtable] $Platform) { $Properties = @{ BundleFlavor = "offline"; ImageRoot = "$(Get-InstallDir $Platform)\"; - # When cross-compiling, bundle the second mimalloc redirect dll as a workaround for - # https://github.com/microsoft/mimalloc/issues/997 - WORKAROUND_MIMALLOC_ISSUE_997 = if ($IsCrossCompiling) { "True" } else { "False" }; INCLUDE_SWIFT_DOCC = $INCLUDE_SWIFT_DOCC; SWIFT_DOCC_BUILD = "$(Get-ProjectBinaryCache $HostPlatform DocC)\release"; SWIFT_DOCC_RENDER_ARTIFACT_ROOT = "${SourceCache}\swift-docc-render-artifact"; diff --git a/utils/update_checkout/update-checkout-config.json b/utils/update_checkout/update-checkout-config.json index fad118e8da457..ebb308d6fbebd 100644 --- a/utils/update_checkout/update-checkout-config.json +++ b/utils/update_checkout/update-checkout-config.json @@ -177,7 +177,7 @@ "curl": "curl-8_9_1", "libxml2": "v2.11.5", "zlib": "v1.3.1", - "mimalloc": "v3.0.1" + "mimalloc": "v3.0.3" } }, "release/6.2": { From e0cfb31fcdb24f6d83f7258040ac00313edd6359 Mon Sep 17 00:00:00 2001 From: Guillaume Lessard Date: Wed, 30 Apr 2025 15:54:41 -0700 Subject: [PATCH 02/51] [stdlib] make `_overrideLifetime` functions public These are discussed in the lifetime annotations pitch: https://github.com/swiftlang/swift-evolution/pull/2750 Addresses rdar://150400414 --- stdlib/public/core/LifetimeManager.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stdlib/public/core/LifetimeManager.swift b/stdlib/public/core/LifetimeManager.swift index eeaeba32b2484..c8c555efb926e 100644 --- a/stdlib/public/core/LifetimeManager.swift +++ b/stdlib/public/core/LifetimeManager.swift @@ -290,7 +290,7 @@ public func _copy(_ value: T) -> T { @_alwaysEmitIntoClient @_transparent @lifetime(borrow source) -internal func _overrideLifetime< +public func _overrideLifetime< T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable >( _ dependent: consuming T, borrowing source: borrowing U @@ -308,7 +308,7 @@ internal func _overrideLifetime< @_alwaysEmitIntoClient @_transparent @lifetime(copy source) -internal func _overrideLifetime< +public func _overrideLifetime< T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable >( _ dependent: consuming T, copying source: borrowing U @@ -326,7 +326,7 @@ internal func _overrideLifetime< @_alwaysEmitIntoClient @_transparent @lifetime(&source) -internal func _overrideLifetime< +public func _overrideLifetime< T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable >( _ dependent: consuming T, From 26764bfadd397fbb473abe611be76346b7c8015a Mon Sep 17 00:00:00 2001 From: Guillaume Lessard Date: Wed, 30 Apr 2025 16:01:46 -0700 Subject: [PATCH 03/51] [test] use the stdlib _overrideLifetime functions --- test/SILOptimizer/Inputs/SpanExtras.swift | 51 ----------------------- 1 file changed, 51 deletions(-) diff --git a/test/SILOptimizer/Inputs/SpanExtras.swift b/test/SILOptimizer/Inputs/SpanExtras.swift index 881ac3d998b26..29ddeb2817d39 100644 --- a/test/SILOptimizer/Inputs/SpanExtras.swift +++ b/test/SILOptimizer/Inputs/SpanExtras.swift @@ -1,56 +1,5 @@ import Builtin -/// Unsafely discard any lifetime dependency on the `dependent` argument. Return -/// a value identical to `dependent` with a lifetime dependency on the caller's -/// borrow scope of the `source` argument. -@unsafe -@_unsafeNonescapableResult -@_alwaysEmitIntoClient -@_transparent -@lifetime(borrow source) -internal func _overrideLifetime< - T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable ->( - _ dependent: consuming T, borrowing source: borrowing U -) -> T { - // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence - // should be expressed by a builtin that is hidden within the function body. - dependent -} - -/// Unsafely discard any lifetime dependency on the `dependent` argument. Return -/// a value identical to `dependent` that inherits all lifetime dependencies from -/// the `source` argument. -@unsafe -@_unsafeNonescapableResult -@_alwaysEmitIntoClient -@_transparent -@lifetime(copy source) -internal func _overrideLifetime< - T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable ->( - _ dependent: consuming T, copying source: borrowing U -) -> T { - // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence - // should be expressed by a builtin that is hidden within the function body. - dependent -} - -@unsafe -@_unsafeNonescapableResult -@_alwaysEmitIntoClient -@_transparent -@lifetime(&source) -internal func _overrideLifetime< - T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable ->( - _ dependent: consuming T, mutating source: inout U -) -> T { - // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence - // should be expressed by a builtin that is hidden within the function body. - dependent -} - // A MutableSpan represents a span of memory which // contains initialized `Element` instances. @frozen From 1bf6ac81189a097d5ad6fb3f736c17df149b8bde Mon Sep 17 00:00:00 2001 From: Eric Miotto Date: Thu, 1 May 2025 15:48:12 -0700 Subject: [PATCH 04/51] compiler-rt: use the current host architecture for the runtime targets This will ensure all the test executables generated by `check-*` targets can run on the current machine. Addresses rdar://150469492 --- utils/swift_build_support/swift_build_support/products/llvm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 6fc15415e40f5..92721fb45c797 100644 --- a/utils/swift_build_support/swift_build_support/products/llvm.py +++ b/utils/swift_build_support/swift_build_support/products/llvm.py @@ -313,7 +313,7 @@ def build(self, host_target): llvm_cmake_options.define( 'SANITIZER_COMMON_LINK_FLAGS:STRING', '-Wl,-z,undefs') - builtins_runtimes_target_for_darwin = 'arm64-apple-darwin' + builtins_runtimes_target_for_darwin = f'{arch}-apple-darwin' if system() == "Darwin": llvm_cmake_options.define( f'BUILTINS_{builtins_runtimes_target_for_darwin}_' From b51cfa5c76568fd893aa99567d51716dd6f87551 Mon Sep 17 00:00:00 2001 From: Egor Zhdan Date: Fri, 2 May 2025 18:43:09 +0100 Subject: [PATCH 05/51] [cxx-interop] Remove symbolic import mode Importing C++ class templates in symbolic mode has proven to be problematic in interaction with other compiler features, and it isn't used widely. This change removes the feature. rdar://150528798 --- include/swift/Basic/Features.def | 5 - include/swift/ClangImporter/ClangImporter.h | 6 - lib/AST/FeatureSet.cpp | 1 - lib/ClangImporter/ClangImporter.cpp | 19 -- lib/ClangImporter/ImportDecl.cpp | 75 ++----- lib/ClangImporter/ImportName.cpp | 5 - lib/ClangImporter/ImportName.h | 8 - lib/ClangImporter/ImportType.cpp | 8 - lib/ClangImporter/ImporterImpl.h | 1 - lib/ClangImporter/SwiftDeclSynthesizer.cpp | 5 - lib/IDE/ModuleInterfacePrinting.cpp | 24 --- lib/Index/IndexRecord.cpp | 201 ------------------ .../libcxx-symbolic-module-interface.swift | 30 --- ...foundation-symbolic-module-interface.swift | 16 -- ...mit-libcxx-symbolic-module-interface.swift | 45 ---- ...dule-interface-no-clang-module-index.swift | 23 -- ...mit-objcxx-symbolic-module-interface.swift | 62 ------ ...symbolic-module-interface-used-decls.swift | 45 ---- ...exing-emit-symbolic-module-interface.swift | 164 -------------- .../print-symbolic-module-interface.swift | 128 ----------- 20 files changed, 14 insertions(+), 857 deletions(-) delete mode 100644 test/Interop/Cxx/stdlib/libcxx-symbolic-module-interface.swift delete mode 100644 test/Interop/Cxx/symbolic-imports/indexing-emit-libcxx-no-foundation-symbolic-module-interface.swift delete mode 100644 test/Interop/Cxx/symbolic-imports/indexing-emit-libcxx-symbolic-module-interface.swift delete mode 100644 test/Interop/Cxx/symbolic-imports/indexing-emit-no-symbolic-module-interface-no-clang-module-index.swift delete mode 100644 test/Interop/Cxx/symbolic-imports/indexing-emit-objcxx-symbolic-module-interface.swift delete mode 100644 test/Interop/Cxx/symbolic-imports/indexing-emit-symbolic-module-interface-used-decls.swift delete mode 100644 test/Interop/Cxx/symbolic-imports/indexing-emit-symbolic-module-interface.swift delete mode 100644 test/Interop/Cxx/symbolic-imports/print-symbolic-module-interface.swift diff --git a/include/swift/Basic/Features.def b/include/swift/Basic/Features.def index f6c731c570b5c..af9f1c219723c 100644 --- a/include/swift/Basic/Features.def +++ b/include/swift/Basic/Features.def @@ -376,11 +376,6 @@ EXPERIMENTAL_FEATURE(ParserASTGen, false) /// corresponding syntax tree. EXPERIMENTAL_FEATURE(BuiltinMacros, false) -/// Import C++ class templates as semantically-meaningless symbolic -/// Swift types and C++ methods as symbolic functions with blank -/// signatures. -EXPERIMENTAL_FEATURE(ImportSymbolicCXXDecls, false) - /// Generate bindings for functions that 'throw' in the C++ section of the generated Clang header. EXPERIMENTAL_FEATURE(GenerateBindingsForThrowingFunctionsInCXX, false) diff --git a/include/swift/ClangImporter/ClangImporter.h b/include/swift/ClangImporter/ClangImporter.h index d08e3791897e0..f3f09dea78952 100644 --- a/include/swift/ClangImporter/ClangImporter.h +++ b/include/swift/ClangImporter/ClangImporter.h @@ -690,12 +690,6 @@ class ClangImporter final : public ClangModuleLoader { /// of the provided baseType. void diagnoseMemberValue(const DeclName &name, const Type &baseType) override; - /// Enable the symbolic import experimental feature for the given callback. - void withSymbolicFeatureEnabled(llvm::function_ref callback); - - /// Returns true when the symbolic import experimental feature is enabled. - bool isSymbolicImportEnabled() const; - const clang::TypedefType *getTypeDefForCXXCFOptionsDefinition( const clang::Decl *candidateDecl) override; diff --git a/lib/AST/FeatureSet.cpp b/lib/AST/FeatureSet.cpp index 19fc29966eb64..3b410786f53bf 100644 --- a/lib/AST/FeatureSet.cpp +++ b/lib/AST/FeatureSet.cpp @@ -109,7 +109,6 @@ UNINTERESTING_FEATURE(UnqualifiedLookupValidation) UNINTERESTING_FEATURE(ImplicitSome) UNINTERESTING_FEATURE(ParserASTGen) UNINTERESTING_FEATURE(BuiltinMacros) -UNINTERESTING_FEATURE(ImportSymbolicCXXDecls) UNINTERESTING_FEATURE(GenerateBindingsForThrowingFunctionsInCXX) UNINTERESTING_FEATURE(ReferenceBindings) UNINTERESTING_FEATURE(BuiltinModule) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index 511e61df06f89..5494b43e5fed8 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -2726,8 +2726,6 @@ ClangImporter::Implementation::Implementation( DisableOverlayModules(ctx.ClangImporterOpts.DisableOverlayModules), EnableClangSPI(ctx.ClangImporterOpts.EnableClangSPI), UseClangIncludeTree(ctx.ClangImporterOpts.UseClangIncludeTree), - importSymbolicCXXDecls( - ctx.LangOpts.hasFeature(Feature::ImportSymbolicCXXDecls)), IsReadingBridgingPCH(false), CurrentVersion(ImportNameVersion::fromOptions(ctx.LangOpts)), Walker(DiagnosticWalker(*this)), BuffersForDiagnostics(ctx.SourceMgr), @@ -8569,23 +8567,6 @@ bool ClangDeclExplicitSafety::isCached() const { return isa(std::get<0>(getStorage()).decl); } -void ClangImporter::withSymbolicFeatureEnabled( - llvm::function_ref callback) { - llvm::SaveAndRestore oldImportSymbolicCXXDecls( - Impl.importSymbolicCXXDecls, true); - Impl.nameImporter->enableSymbolicImportFeature(true); - auto importedDeclsCopy = Impl.ImportedDecls; - Impl.ImportedDecls.clear(); - callback(); - Impl.ImportedDecls = std::move(importedDeclsCopy); - Impl.nameImporter->enableSymbolicImportFeature( - oldImportSymbolicCXXDecls.get()); -} - -bool ClangImporter::isSymbolicImportEnabled() const { - return Impl.importSymbolicCXXDecls; -} - const clang::TypedefType *ClangImporter::getTypeDefForCXXCFOptionsDefinition( const clang::Decl *candidateDecl) { diff --git a/lib/ClangImporter/ImportDecl.cpp b/lib/ClangImporter/ImportDecl.cpp index ffe19e7ecfd95..06c4c044324d9 100644 --- a/lib/ClangImporter/ImportDecl.cpp +++ b/lib/ClangImporter/ImportDecl.cpp @@ -2141,8 +2141,7 @@ namespace { } // TODO(https://github.com/apple/swift/issues/56206): Fix this once we support dependent types. - if (decl->getTypeForDecl()->isDependentType() && - !Impl.importSymbolicCXXDecls) { + if (decl->getTypeForDecl()->isDependentType()) { Impl.addImportDiagnostic( decl, Diagnostic( diag::record_is_dependent, @@ -3068,11 +3067,8 @@ namespace { auto semanticsKind = evaluateOrDefault( Impl.SwiftContext.evaluator, CxxRecordSemantics({decl, Impl.SwiftContext, &Impl}), {}); - if ((semanticsKind == CxxRecordSemanticsKind::MissingLifetimeOperation || - semanticsKind == CxxRecordSemanticsKind::UnavailableConstructors) && - // Let un-specialized class templates through. We'll sort out their - // members once they're instantiated. - !Impl.importSymbolicCXXDecls) { + if (semanticsKind == CxxRecordSemanticsKind::MissingLifetimeOperation || + semanticsKind == CxxRecordSemanticsKind::UnavailableConstructors) { HeaderLoc loc(decl->getLocation()); if (hasUnsafeAPIAttr(decl)) @@ -3267,12 +3263,6 @@ namespace { Decl *VisitClassTemplateSpecializationDecl( const clang::ClassTemplateSpecializationDecl *decl) { - // Treat a specific specialization like the unspecialized class template - // when importing it in symbolic mode. - if (Impl.importSymbolicCXXDecls) - return Impl.importDecl(decl->getSpecializedTemplate(), - Impl.CurrentVersion); - bool isPair = decl->getSpecializedTemplate()->isInStdNamespace() && decl->getSpecializedTemplate()->getName() == "pair"; @@ -3953,8 +3943,6 @@ namespace { Impl.SwiftContext, SourceLoc(), templateParams, SourceLoc()); } - bool importFuncWithoutSignature = - isa(decl) && Impl.importSymbolicCXXDecls; if (!dc->isModuleScopeContext() && !isClangNamespace(dc) && !isa(decl)) { // Handle initializers. @@ -4021,39 +4009,12 @@ namespace { importedType = Impl.importFunctionReturnType(dc, decl, allowNSUIntegerAsInt); } else { - if (importFuncWithoutSignature) { - importedType = ImportedType{Impl.SwiftContext.getVoidType(), false}; - if (decl->param_empty()) - bodyParams = ParameterList::createEmpty(Impl.SwiftContext); - else { - llvm::SmallVector params; - for (const auto ¶m : decl->parameters()) { - - Identifier bodyName = - Impl.importFullName(param, Impl.CurrentVersion) - .getBaseIdentifier(Impl.SwiftContext); - auto paramInfo = Impl.createDeclWithClangNode( - param, AccessLevel::Private, SourceLoc(), SourceLoc(), - Identifier(), Impl.importSourceLoc(param->getLocation()), - bodyName, Impl.ImportedHeaderUnit); - paramInfo->setSpecifier(ParamSpecifier::Default); - paramInfo->setInterfaceType(Impl.SwiftContext.TheAnyType); - if (param->hasDefaultArg()) { - paramInfo->setDefaultArgumentKind(DefaultArgumentKind::Normal); - paramInfo->setDefaultValueStringRepresentation("cxxDefaultArg"); - } - params.push_back(paramInfo); - } - bodyParams = ParameterList::create(Impl.SwiftContext, params); - } - } else { - // Import the function type. If we have parameters, make sure their - // names get into the resulting function type. - importedType = Impl.importFunctionParamsAndReturnType( - dc, decl, {decl->param_begin(), decl->param_size()}, - decl->isVariadic(), isInSystemModule(dc), name, bodyParams, - templateParams); - } + // Import the function type. If we have parameters, make sure their + // names get into the resulting function type. + importedType = Impl.importFunctionParamsAndReturnType( + dc, decl, {decl->param_begin(), decl->param_size()}, + decl->isVariadic(), isInSystemModule(dc), name, bodyParams, + templateParams); if (auto *mdecl = dyn_cast(decl)) { if (mdecl->isStatic()) { @@ -4160,12 +4121,10 @@ namespace { } func->setAccess(importer::convertClangAccess(decl->getAccess())); - if (!importFuncWithoutSignature) { - bool success = processSpecialImportedFunc( - func, importedName, decl->getOverloadedOperator()); - if (!success) - return nullptr; - } + bool success = processSpecialImportedFunc( + func, importedName, decl->getOverloadedOperator()); + if (!success) + return nullptr; } result->setIsObjC(false); @@ -4480,8 +4439,7 @@ namespace { } Decl *VisitFieldDecl(const clang::FieldDecl *decl) { - if (!Impl.importSymbolicCXXDecls && - decl->hasAttr()) { + if (decl->hasAttr()) { if (const auto *rd = decl->getType()->getAsRecordDecl()) { // Clang can store the next field in the padding of this one. Swift // does not support this yet so let's not import the field and @@ -4743,11 +4701,6 @@ namespace { if (name.empty()) return nullptr; - if (Impl.importSymbolicCXXDecls) - // Import an unspecialized C++ class template as a Swift value/class - // type in symbolic mode. - return Impl.importDecl(decl->getTemplatedDecl(), Impl.CurrentVersion); - auto loc = Impl.importSourceLoc(decl->getLocation()); auto dc = Impl.importDeclContextOf( decl, importedName.getEffectiveContext()); diff --git a/lib/ClangImporter/ImportName.cpp b/lib/ClangImporter/ImportName.cpp index 25e044e1274fb..411e5a4589ddc 100644 --- a/lib/ClangImporter/ImportName.cpp +++ b/lib/ClangImporter/ImportName.cpp @@ -2274,11 +2274,6 @@ ImportedName NameImporter::importNameImpl(const clang::NamedDecl *D, if (auto classTemplateSpecDecl = dyn_cast(D)) { - /// Symbolic specializations get imported as the symbolic class template - /// type. - if (importSymbolicCXXDecls) - return importNameImpl(classTemplateSpecDecl->getSpecializedTemplate(), - version, givenName); if (!isa(D)) { auto name = printClassTemplateSpecializationName(classTemplateSpecDecl, swiftCtx, this, version); diff --git a/lib/ClangImporter/ImportName.h b/lib/ClangImporter/ImportName.h index 254a58eb45132..9dde3b56e2631 100644 --- a/lib/ClangImporter/ImportName.h +++ b/lib/ClangImporter/ImportName.h @@ -423,8 +423,6 @@ class NameImporter { llvm::DenseMap, std::unique_ptr> allProperties; - bool importSymbolicCXXDecls; - ClangImporter::Implementation *importerImpl; public: @@ -432,8 +430,6 @@ class NameImporter { clang::Sema &cSema, ClangImporter::Implementation *importerImpl) : swiftCtx(ctx), availability(avail), clangSema(cSema), enumInfos(clangSema.getPreprocessor()), - importSymbolicCXXDecls( - ctx.LangOpts.hasFeature(Feature::ImportSymbolicCXXDecls)), importerImpl(importerImpl) {} /// Determine the Swift name for a Clang decl @@ -498,10 +494,6 @@ class NameImporter { clang::ObjCInterfaceDecl *classDecl, bool forInstance); - inline void enableSymbolicImportFeature(bool isEnabled) { - importSymbolicCXXDecls = isEnabled; - } - /// Retrieve a purported custom name even if it is invalid. static std::optional findCustomName(const clang::Decl *decl, ImportNameVersion version); diff --git a/lib/ClangImporter/ImportType.cpp b/lib/ClangImporter/ImportType.cpp index 89921480a0a6a..3952c7f21799c 100644 --- a/lib/ClangImporter/ImportType.cpp +++ b/lib/ClangImporter/ImportType.cpp @@ -75,10 +75,6 @@ bool ClangImporter::Implementation::isOverAligned(const clang::TypeDecl *decl) { } bool ClangImporter::Implementation::isOverAligned(clang::QualType type) { - // Do not check type layout for a clang type in symbolic mode as the - // type could be a dependent type. - if (importSymbolicCXXDecls) - return false; auto align = getClangASTContext().getTypeAlignInChars(type); return align > clang::CharUnits::fromQuantity(MaximumAlignment); } @@ -2348,10 +2344,6 @@ findGenericTypeInGenericDecls(ClangImporter::Implementation &impl, llvm::find_if(genericParams, [name](GenericTypeParamDecl *generic) { return generic->getName().str() == name; }); - // We sometimes are unable compute the exact Swift type - // of symbolic declarations. Fallback to using `Any` in that case. - if (impl.importSymbolicCXXDecls && genericParamIter == genericParams.end()) - return impl.SwiftContext.TheAnyType; // TODO: once we support generics in class types, replace this with // "return nullptr". Once support for template classes, this will need to // be updated, though. I'm leaving the assert here to make it easier to diff --git a/lib/ClangImporter/ImporterImpl.h b/lib/ClangImporter/ImporterImpl.h index 870e68a2152ed..29f95de7f20b9 100644 --- a/lib/ClangImporter/ImporterImpl.h +++ b/lib/ClangImporter/ImporterImpl.h @@ -475,7 +475,6 @@ class LLVM_LIBRARY_VISIBILITY ClangImporter::Implementation const bool DisableOverlayModules; const bool EnableClangSPI; const bool UseClangIncludeTree; - bool importSymbolicCXXDecls; bool IsReadingBridgingPCH; llvm::SmallVector PCHImportedSubmodules; diff --git a/lib/ClangImporter/SwiftDeclSynthesizer.cpp b/lib/ClangImporter/SwiftDeclSynthesizer.cpp index ab52d01fd7bc6..24e1a8d94e565 100644 --- a/lib/ClangImporter/SwiftDeclSynthesizer.cpp +++ b/lib/ClangImporter/SwiftDeclSynthesizer.cpp @@ -2020,11 +2020,6 @@ clang::CXXMethodDecl *SwiftDeclSynthesizer::synthesizeCXXForwardingMethod( assert(!method->isStatic() || method->getNameInfo().getName().getCXXOverloadedOperator() == clang::OO_Call); - // When emitting symbolic decls, the method might not have a concrete - // record type as this type. - if (ImporterImpl.importSymbolicCXXDecls && !method->isStatic() && - !method->getThisType()->getPointeeCXXRecordDecl()) - return nullptr; // Create a new method in the derived class that calls the base method. clang::DeclarationName name = method->getNameInfo().getName(); diff --git a/lib/IDE/ModuleInterfacePrinting.cpp b/lib/IDE/ModuleInterfacePrinting.cpp index b7a634d88dfc6..90738e84fb1b9 100644 --- a/lib/IDE/ModuleInterfacePrinting.cpp +++ b/lib/IDE/ModuleInterfacePrinting.cpp @@ -836,27 +836,3 @@ void swift::ide::printHeaderInterface( } Printer.forceNewlines(); } - -void swift::ide::printSymbolicSwiftClangModuleInterface( - ModuleDecl *M, ASTPrinter &Printer, const clang::Module *clangModule) { - std::string headerComment; - llvm::raw_string_ostream(headerComment) - << "// Swift interface for " << (clangModule->IsSystem ? "system " : "") - << "module '" << clangModule->Name << "'\n"; - Printer.printText(headerComment); - - ModuleTraversalOptions opts; - opts |= ModuleTraversal::VisitSubmodules; - auto popts = - PrintOptions::printModuleInterface(/*printFullConvention=*/false); - popts.PrintDocumentationComments = false; - popts.SkipInlineCXXNamespace = true; - - auto &SwiftContext = M->getTopLevelModule()->getASTContext(); - auto &Importer = - static_cast(*SwiftContext.getClangModuleLoader()); - Importer.withSymbolicFeatureEnabled([&]() { - printModuleInterface(M, {}, opts, Printer, popts, - /*SynthesizeExtensions=*/false); - }); -} diff --git a/lib/Index/IndexRecord.cpp b/lib/Index/IndexRecord.cpp index 559cfb72546b0..3695d6a138709 100644 --- a/lib/Index/IndexRecord.cpp +++ b/lib/Index/IndexRecord.cpp @@ -426,199 +426,6 @@ emitDataForSwiftSerializedModule(ModuleDecl *module, const PathRemapper &pathRemapper, SourceFile *initialFile); -static void -appendSymbolicInterfaceToIndexStorePath(SmallVectorImpl &resultingPath) { - llvm::sys::path::append(resultingPath, "interfaces"); -} - -static llvm::Error initSymbolicInterfaceStorePath(StringRef storePath) { - SmallString<128> subPath = storePath; - appendSymbolicInterfaceToIndexStorePath(subPath); - std::error_code ec = llvm::sys::fs::create_directories(subPath); - if (ec) - return llvm::errorCodeToError(ec); - return llvm::Error::success(); -} - -static void appendSymbolicInterfaceClangModuleFilename( - StringRef filePath, SmallVectorImpl &resultingPath) { - llvm::sys::path::append(resultingPath, llvm::sys::path::filename(filePath)); - StringRef extension = ".symbolicswiftinterface"; - resultingPath.append(extension.begin(), extension.end()); -} - -// FIXME (Alex): Share code with IndexUnitWriter in LLVM after refactoring it. -static llvm::Expected -isFileUpToDateForOutputFile(StringRef filePath, StringRef timeCompareFilePath) { - auto makeError = [](StringRef path, std::error_code ec) -> llvm::Error { - std::string error; - llvm::raw_string_ostream(error) - << "could not access path '" << path << "': " << ec.message(); - return llvm::createStringError(ec, error.c_str()); - }; - llvm::sys::fs::file_status unitStat; - if (std::error_code ec = llvm::sys::fs::status(filePath, unitStat)) { - if (ec != std::errc::no_such_file_or_directory && ec != llvm::errc::delete_pending) - return makeError(filePath, ec); - return false; - } - - if (timeCompareFilePath.empty()) - return true; - - llvm::sys::fs::file_status compareStat; - if (std::error_code ec = - llvm::sys::fs::status(timeCompareFilePath, compareStat)) { - if (ec != std::errc::no_such_file_or_directory && ec != llvm::errc::delete_pending) - return makeError(timeCompareFilePath, ec); - return true; - } - - // Return true (unit is up-to-date) if the file to compare is older than the - // unit file. - return compareStat.getLastModificationTime() <= - unitStat.getLastModificationTime(); -} - -/// Emit the symbolic swift interface file for an imported Clang module into the -/// index store directory. -/// -/// The swift interface file is emitted only when it doesn't exist yet, or when -/// the PCM for the Clang module has been updated. -/// -/// System modules without the 'cplusplus' requirement are not emitted. -static void emitSymbolicInterfaceForClangModule( - ClangModuleUnit *clangModUnit, ModuleDecl *M, - const clang::Module *clangModule, StringRef indexStorePath, - const clang::CompilerInstance &clangCI, DiagnosticEngine &diags) { - if (!M->getASTContext().LangOpts.EnableCXXInterop) - return; - // Skip system modules without an explicit 'cplusplus' requirement. - bool isSystem = clangModUnit->isSystemModule(); - if (isSystem && !importer::requiresCPlusPlus(clangModule)) - return; - - // Make sure the `interfaces` directory is created. - if (auto err = initSymbolicInterfaceStorePath(indexStorePath)) { - llvm::handleAllErrors(std::move(err), [&](const llvm::ECError &ec) { - diags.diagnose(SourceLoc(), diag::error_create_symbolic_interfaces_dir, - ec.convertToErrorCode().message()); - }); - return; - } - - auto moduleRef = clangModule->getASTFile(); - if (!moduleRef) - return; - - // Determine the output name for the symbolic interface file. - clang::serialization::ModuleFile *ModFile = - clangCI.getASTReader()->getModuleManager().lookup(*moduleRef); - assert(ModFile && "no module file loaded for module ?"); - SmallString<128> interfaceOutputPath = indexStorePath; - appendSymbolicInterfaceToIndexStorePath(interfaceOutputPath); - appendSymbolicInterfaceClangModuleFilename(ModFile->FileName, - interfaceOutputPath); - - // Check if the symbolic interface file is already up to date. - std::string error; - auto upToDate = - isFileUpToDateForOutputFile(interfaceOutputPath, ModFile->FileName); - if (!upToDate) { - llvm::handleAllErrors( - upToDate.takeError(), [&](const llvm::StringError &ec) { - diags.diagnose(SourceLoc(), - diag::error_symbolic_interfaces_failed_status_check, - ec.getMessage()); - }); - return; - } - if (M->getASTContext().LangOpts.EnableIndexingSystemModuleRemarks) { - diags.diagnose(SourceLoc(), diag::remark_emitting_symbolic_interface_module, - interfaceOutputPath, *upToDate); - } - if (*upToDate) - return; - - // Output the interface to a temporary file first. - SmallString<128> tempOutputPath = interfaceOutputPath; - tempOutputPath += "-%%%%%%%%"; - int tempFD; - if (llvm::sys::fs::createUniqueFile(tempOutputPath.str(), tempFD, - tempOutputPath)) { - llvm::raw_string_ostream errOS(error); - errOS << "failed to create temporary file: " << tempOutputPath; - diags.diagnose(SourceLoc(), diag::error_write_symbolic_interface, - errOS.str()); - return; - } - - llvm::raw_fd_ostream os(tempFD, /*shouldClose=*/true); - StreamPrinter printer(os); - ide::printSymbolicSwiftClangModuleInterface(M, printer, clangModule); - os.close(); - - if (os.has_error()) { - llvm::raw_string_ostream errOS(error); - errOS << "failed to write '" << tempOutputPath - << "': " << os.error().message(); - diags.diagnose(SourceLoc(), diag::error_write_symbolic_interface, - errOS.str()); - os.clear_error(); - llvm::sys::fs::remove(tempOutputPath); - return; - } - - // Move the resulting output to the destination symbolic interface file. - std::error_code ec = llvm::sys::fs::rename( - /*from=*/tempOutputPath, /*to=*/interfaceOutputPath); - if (ec) { - llvm::raw_string_ostream errOS(error); - errOS << "failed to rename '" << tempOutputPath << "' to '" - << interfaceOutputPath << "': " << ec.message(); - diags.diagnose(SourceLoc(), diag::error_write_symbolic_interface, - errOS.str()); - llvm::sys::fs::remove(tempOutputPath); - return; - } -} - -static void emitTransitiveClangSymbolicInterfacesForSwiftModuleImports( - ArrayRef imports, StringRef indexStorePath, - const clang::CompilerInstance &clangCI, DiagnosticEngine &diags) { - auto &fileMgr = clangCI.getFileManager(); - for (auto &import : imports) { - ModuleDecl *mod = import.importedModule; - if (mod->isOnoneSupportModule()) - continue; // ignore the Onone support library. - if (mod->isSwiftShimsModule()) - continue; - - for (auto *FU : mod->getFiles()) { - switch (FU->getKind()) { - default: - break; - case FileUnitKind::SerializedAST: - case FileUnitKind::DWARFModule: - case FileUnitKind::ClangModule: { - auto *LFU = cast(FU); - if (auto F = fileMgr.getFile(LFU->getFilename())) { - if (FU->getKind() == FileUnitKind::ClangModule) { - auto clangModUnit = cast(LFU); - if (auto clangMod = clangModUnit->getUnderlyingClangModule()) { - // Emit the symbolic interface file in addition to index data. - emitSymbolicInterfaceForClangModule( - clangModUnit, mod, clangMod, indexStorePath, clangCI, diags); - } - } - // FIXME: We should keep recursing here into other Swift modules. - } - } - } - } - } -} - static void addModuleDependencies(ArrayRef imports, StringRef indexStorePath, bool indexClangModules, @@ -688,11 +495,6 @@ static void addModuleDependencies(ArrayRef imports, if (shouldIndexModule) clang::index::emitIndexDataForModuleFile(clangMod, clangCI, unitWriter); - // Emit the symbolic interface file in addition to index data. - if (indexClangModules) - emitSymbolicInterfaceForClangModule(clangModUnit, mod, clangMod, - indexStorePath, clangCI, - diags); } } else { // Serialized AST file. @@ -727,9 +529,6 @@ static void addModuleDependencies(ArrayRef imports, SmallVector imports; mod->getImportedModules(imports, ModuleDecl::ImportFilterKind::Exported); - if (indexClangModules) - emitTransitiveClangSymbolicInterfacesForSwiftModuleImports( - imports, indexStorePath, clangCI, diags); } } clang::index::writer::OpaqueModule opaqMod = diff --git a/test/Interop/Cxx/stdlib/libcxx-symbolic-module-interface.swift b/test/Interop/Cxx/stdlib/libcxx-symbolic-module-interface.swift deleted file mode 100644 index 7a9b0739c074c..0000000000000 --- a/test/Interop/Cxx/stdlib/libcxx-symbolic-module-interface.swift +++ /dev/null @@ -1,30 +0,0 @@ -// Only run this test with older libc++, before the top-level std module got split into multiple top-level modules. -// RUN: %empty-directory(%t) -// RUN: %target-clangxx %S/Inputs/check-libcxx-version.cpp -o %t/check-libcxx-version -// RUN: %target-codesign %t/check-libcxx-version - -// RUN: %target-swift-ide-test -print-module -module-to-print=CxxStdlib -source-filename=x -enable-experimental-cxx-interop -enable-objc-interop -module-print-submodules -enable-experimental-feature ImportSymbolicCXXDecls > %t/result.txt -// RUN: %target-run %t/check-libcxx-version || %FileCheck %s --check-prefixes=CHECK,VECTOR --input-file=%t/result.txt -// RUN: %target-run %t/check-libcxx-version || %FileCheck %s --check-prefixes=CHECK,STRING --input-file=%t/result.txt -// RUN: %target-run %t/check-libcxx-version || %FileCheck %s --check-prefixes=CHECK,MAP --input-file=%t/result.txt - -// REQUIRES: OS=macosx -// REQUIRES: swift_feature_ImportSymbolicCXXDecls - -// Since this test runs check-libcxx-version, it requires execution. -// REQUIRES: executable_test - -// CHECK: enum std { -// CHECK: enum __1 { - -// STRING: struct basic_string { - -// STRING: typealias string = std.__1.basic_string - -// VECTOR: struct vector { -// VECTOR: mutating func push_back(_ __x: Any) -// VECTOR: } - -// MAP: struct map { - -// CHECK-NOT: enum std diff --git a/test/Interop/Cxx/symbolic-imports/indexing-emit-libcxx-no-foundation-symbolic-module-interface.swift b/test/Interop/Cxx/symbolic-imports/indexing-emit-libcxx-no-foundation-symbolic-module-interface.swift deleted file mode 100644 index eb9ae8d2e37cb..0000000000000 --- a/test/Interop/Cxx/symbolic-imports/indexing-emit-libcxx-no-foundation-symbolic-module-interface.swift +++ /dev/null @@ -1,16 +0,0 @@ -// RUN: %empty-directory(%t) -// RUN: split-file %s %t - -// RUN: %target-swift-frontend %t/test.swift -I %t -c -index-system-modules -index-store-path %t/store -enable-experimental-cxx-interop -// RUN: ls %t/store/interfaces | %FileCheck --check-prefix=FILES %s - -// REQUIRES: OS=macosx -// REQUIRES: cxx-interop-fixed-cf_options - -//--- test.swift - -import CxxStdlib -import Foundation - -// FILES: std-{{.*}}.pcm.symbolicswiftinterface -// FILES-NOT: Foundation* diff --git a/test/Interop/Cxx/symbolic-imports/indexing-emit-libcxx-symbolic-module-interface.swift b/test/Interop/Cxx/symbolic-imports/indexing-emit-libcxx-symbolic-module-interface.swift deleted file mode 100644 index c2cd6835048eb..0000000000000 --- a/test/Interop/Cxx/symbolic-imports/indexing-emit-libcxx-symbolic-module-interface.swift +++ /dev/null @@ -1,45 +0,0 @@ -// RUN: %empty-directory(%t) -// RUN: split-file %s %t - -// Verify that symbolic interfaces are emitted. -// -// RUN: %target-swift-frontend %t/test.swift -I %t/Inputs -c -index-system-modules -index-store-path %t/store -enable-experimental-cxx-interop -Rindexing-system-module 2>%t/remarks -// RUN: echo "EOF" >> %t/remarks -// RUN: cat %t/remarks | %FileCheck --check-prefix=REMARK_NEW %s -// RUN: ls %t/store/interfaces | %FileCheck --check-prefix=FILES %s -// RUN: cat %t/store/interfaces/std* | %FileCheck --check-prefix=CHECK %s - -// Verify that symbolic interfaces are not emitted when PCM doesn't change. -// -// RUN: %target-swift-frontend %t/test.swift -I %t/Inputs -c -index-system-modules -index-store-path %t/store -enable-experimental-cxx-interop -Rindexing-system-module 2>&1 | %FileCheck --check-prefix=REMARK_NO_UPDATE %s -// RUN: ls %t/store/interfaces | %FileCheck --check-prefix=FILES %s - -// REQUIRES: OS=macosx - -//--- Inputs/module.modulemap -module CxxModule { - header "headerA.h" - requires cplusplus -} - -//--- Inputs/headerA.h - -int freeFunction(int x, int y); - -//--- test.swift - -import CxxStdlib -import CxxModule - -// CHECK-NOT: warning: 'import_owned' Swift attribute ignored on type - -// REMARK_NEW: remark: emitting symbolic interface at {{.*}}/interfaces/std-{{.*}}.pcm.symbolicswiftinterface{{$}} -// REMARK_NEW: remark: emitting symbolic interface at {{.*}}/interfaces/CxxModule-{{.*}}.pcm.symbolicswiftinterface{{$}} - -// REMARK_NO_UPDATE-NOT: remark: emitting symbolic interface at {{.*}}/interfaces/std-{{.*}}.pcm.symbolicswiftinterface{{$}} -// REMARK_NO_UPDATE-NOT: remark: emitting symbolic interface at {{.*}}/interfaces/CxxModule-{{.*}}.pcm.symbolicswiftinterface{{$}} - -// FILES: CxxModule-{{.*}}.pcm.symbolicswiftinterface -// FILES: std-{{.*}}.pcm.symbolicswiftinterface - -// CHECK: // Swift interface for system module 'std' diff --git a/test/Interop/Cxx/symbolic-imports/indexing-emit-no-symbolic-module-interface-no-clang-module-index.swift b/test/Interop/Cxx/symbolic-imports/indexing-emit-no-symbolic-module-interface-no-clang-module-index.swift deleted file mode 100644 index d28aced58f84a..0000000000000 --- a/test/Interop/Cxx/symbolic-imports/indexing-emit-no-symbolic-module-interface-no-clang-module-index.swift +++ /dev/null @@ -1,23 +0,0 @@ -// RUN: %empty-directory(%t) -// RUN: split-file %s %t -// -// RUN: %target-swift-frontend %t/test.swift -I %t/Inputs -c -index-system-modules -index-ignore-clang-modules -index-store-path %t/store -enable-experimental-cxx-interop -Rindexing-system-module 2>&1 | %FileCheck %s -// RUN: not ls %t/store/interfaces - -//--- Inputs/module.modulemap -module CxxModule { - header "headerA.h" - requires cplusplus -} - -//--- Inputs/headerA.h - -namespace ns { - int freeFunction(int x, int y); -} - -//--- test.swift - -import CxxModule - -// CHECK-NOT: emitting symbolic interface at diff --git a/test/Interop/Cxx/symbolic-imports/indexing-emit-objcxx-symbolic-module-interface.swift b/test/Interop/Cxx/symbolic-imports/indexing-emit-objcxx-symbolic-module-interface.swift deleted file mode 100644 index b318ca0454fce..0000000000000 --- a/test/Interop/Cxx/symbolic-imports/indexing-emit-objcxx-symbolic-module-interface.swift +++ /dev/null @@ -1,62 +0,0 @@ -// RUN: %empty-directory(%t) -// RUN: split-file %s %t - -// RUN: %target-swift-frontend %t/test.swift -I %t/Inputs -c -index-system-modules -index-store-path %t/store -enable-experimental-cxx-interop -Rindexing-system-module 2>&1 | %FileCheck --check-prefix=REMARK_NEW %s -// RUN: ls %t/store/interfaces | %FileCheck --check-prefix=FILES %s -// RUN: cat %t/store/interfaces/ObjCxxModule* | %FileCheck --check-prefix=CHECK %s - - -// Verify that symbolic interface is not emitted without interop. -// -// RUN: rm -r %t/store/interfaces -// RUN: %target-swift-frontend %t/test.swift -I %t/Inputs -c -index-system-modules -index-store-path %t/store -Rindexing-system-module 2>&1 > %t/out -// RUN: echo "non-empty-file-check" >> %t/out -// RUN: cat %t/out | %FileCheck --check-prefix=REMARK_NONE %s -// RUN: not ls %t/store/interfaces - -// REQUIRES: objc_interop -// REQUIRES: cxx-interop-fixed-cf_options - -//--- Inputs/module.modulemap -module ObjCxxModule { - header "headerA.h" - // NOTE: does not require cplusplus -} - -//--- Inputs/headerA.h - -#include - -#ifdef __cplusplus -namespace ns { - int freeCxxFunction(int x, int y); -} -#endif - -@interface ObjCClass: NSObject - -- (void)myTestMethod; - -@end - -//--- test.swift - -import ObjCxxModule - -// REMARK_NEW: remark: emitting symbolic interface at {{.*}}/interfaces/ObjCxxModule-{{.*}}.pcm.symbolicswiftinterface{{$}} -// REMARK_NONE-NOT: emitting symbolic interface at - -// FILES: ObjCxxModule-{{.*}}.pcm.symbolicswiftinterface - -// CHECK: // Swift interface for module 'ObjCxxModule' -// CHECK-NEXT: import Foundation -// CHECK-EMPTY: -// CHECK-NEXT: public enum ns { -// CHECK-EMPTY: -// CHECK-NEXT: public static func freeCxxFunction(_ x: Int32, _ y: Int32) -> Int32 -// CHECK-NEXT: } -// CHECK-EMPTY: -// CHECK-NEXT: open class ObjCClass : NSObject { -// CHECK-EMPTY: -// CHECK-NEXT: open func myTestMethod() -// CHECK-NEXT: } diff --git a/test/Interop/Cxx/symbolic-imports/indexing-emit-symbolic-module-interface-used-decls.swift b/test/Interop/Cxx/symbolic-imports/indexing-emit-symbolic-module-interface-used-decls.swift deleted file mode 100644 index 4b9021a8e742e..0000000000000 --- a/test/Interop/Cxx/symbolic-imports/indexing-emit-symbolic-module-interface-used-decls.swift +++ /dev/null @@ -1,45 +0,0 @@ -// RUN: %empty-directory(%t) -// RUN: split-file %s %t - -// RUN: %target-swift-frontend %t/test.swift -I %t/Inputs -c -index-system-modules -index-store-path %t/store -enable-experimental-cxx-interop 2>&1 -// RUN: cat %t/store/interfaces/CxxModule* | %FileCheck --check-prefix=CHECK %s - -//--- Inputs/module.modulemap -module CxxModule { - header "header.h" - requires cplusplus -} - -//--- Inputs/header.h - -namespace ns { - template - struct TemplateRecord { - void methodFunc(int x) const; - }; -} - -using TemplateRecordInt = ns::TemplateRecord; - -//--- test.swift - -import CxxModule - -public func useConcreteTemplate() { - let x = TemplateRecordInt() - x.methodFunc(2) -} - -// CHECK: // Swift interface for module 'CxxModule' -// CHECK: public enum ns { -// CHECK-EMPTY: -// CHECK-NEXT: public struct TemplateRecord { -// CHECK-EMPTY: -// CHECK-NEXT: @available(*, deprecated, message: -// CHECK-NEXT: public init() -// CHECK-EMPTY: -// CHECK-NEXT: public func methodFunc(_ x: Any) -// CHECK-NEXT:} -// CHECK-NEXT:} -// CHECK-EMPTY: -// CHECK-NEXT: public typealias TemplateRecordInt = ns.TemplateRecord diff --git a/test/Interop/Cxx/symbolic-imports/indexing-emit-symbolic-module-interface.swift b/test/Interop/Cxx/symbolic-imports/indexing-emit-symbolic-module-interface.swift deleted file mode 100644 index 42f211323fe9a..0000000000000 --- a/test/Interop/Cxx/symbolic-imports/indexing-emit-symbolic-module-interface.swift +++ /dev/null @@ -1,164 +0,0 @@ -// RUN: %empty-directory(%t) -// RUN: split-file %s %t - -// Verify that symbolic interfaces are emitted. -// -// RUN: %target-swift-frontend %t/test.swift -I %t/Inputs -c -index-system-modules -index-store-path %t/store -enable-experimental-cxx-interop -Rindexing-system-module 2>%t/remarks -// RUN: echo "EOF" >> %t/remarks -// RUN: cat %t/remarks | %FileCheck --check-prefixes=REMARK_NEW,REMARK_INITIAL %s -// RUN: ls %t/store/interfaces | %FileCheck --check-prefix=FILES %s -// RUN: cat %t/store/interfaces/CxxModule* | %FileCheck --check-prefix=CHECK %s - -// Verify that symbolic interfaces are not emitted when PCM doesn't change. -// -// RUN: %target-swift-frontend %t/test.swift -I %t/Inputs -c -index-system-modules -index-store-path %t/store -enable-experimental-cxx-interop -Rindexing-system-module 2>&1 | %FileCheck --check-prefix=REMARK_NO_UPDATE %s -// RUN: ls %t/store/interfaces | %FileCheck --check-prefix=FILES %s -// RUN: cat %t/store/interfaces/CxxModule* | %FileCheck --check-prefix=CHECK %s - -// Verify that symbolic interface is re-emitted when the interface is removed. -// -// RUN: rm -r %t/store/interfaces -// RUN: %target-swift-frontend %t/test.swift -I %t/Inputs -c -index-system-modules -index-store-path %t/store -enable-experimental-cxx-interop -Rindexing-system-module 2>&1 | %FileCheck --check-prefix=REMARK_NEW %s -// RUN: ls %t/store/interfaces | %FileCheck --check-prefix=FILES %s -// RUN: cat %t/store/interfaces/CxxModule* | %FileCheck --check-prefixes=CHECK %s - -// Verify that symbolic interface is re-emitted when PCM changes. -// -// RUN: echo "using AdditionalAlias = int;" >> %t/Inputs/headerA.h -// RUN: %target-swift-frontend %t/test.swift -I %t/Inputs -c -index-system-modules -index-store-path %t/store -enable-experimental-cxx-interop -Rindexing-system-module 2>&1 | %FileCheck --check-prefix=REMARK_NEW %s -// RUN: ls %t/store/interfaces | %FileCheck --check-prefix=FILES %s -// RUN: cat %t/store/interfaces/CxxModule* | %FileCheck --check-prefixes=CHECK,CHECK-UPDATED %s - -//--- Inputs/module.modulemap -module CxxModule { - header "headerA.h" - header "headerB.h" - requires cplusplus -} - -module TransitiveCppMod { - header "transitiveHeader.h" - requires cplusplus -} - -//--- Inputs/headerA.h - -namespace ns { - int freeFunction(int x, int y); -} - -//--- Inputs/transitiveHeader.h - -template -struct TransitiveStruct { - T x; - - void test() {} -}; - -//--- Inputs/headerB.h - -#include "headerA.h" -#include "transitiveHeader.h" - -namespace ns { - struct B { - int y; - }; - - template - struct TemplateRecord { - void methodFunc(int x); - - struct InnerRecord { - int innerMethod(int y); - }; - - template - struct InnerTemplate { - void innerTemplateMethod(); - }; - - InnerTemplate returnsTemplateMethod(); - }; - - inline namespace __1 { - struct StructInInlineNamespace { - }; - - using TypealiasInInlineNamespace = TemplateRecord; - } - - using TypealiasOfInlineNamespace = __1::StructInInlineNamespace; -} - -using MyType = ns::TemplateRecord; -using MyType2 = TransitiveStruct; - -//--- test.swift - -import CxxModule - -// REMARK_INITIAL: remark: emitting symbolic interface at {{.*}}{{/|\\}}interfaces{{/|\\}}CxxShim-{{.*}}.pcm.symbolicswiftinterface{{$}} -// REMARK_NEW: remark: emitting symbolic interface at {{.*}}{{/|\\}}interfaces{{/|\\}}CxxModule-{{.*}}.pcm.symbolicswiftinterface{{$}} -// REMARK_INITIAL-NEXT: EOF - -// REMARK_NO_UPDATE: remark: emitting symbolic interface at {{.*}}{{/|\\}}interfaces{{/|\\}}CxxModule-{{.*}}.pcm.symbolicswiftinterface; skipping because it's up to date{{$}} - -// FILES: CxxModule-{{.*}}.pcm.symbolicswiftinterface -// FILES-NOT: TransitiveCppMod - -// CHECK: // Swift interface for module 'CxxModule' -// CHECK-UPDATED: typealias AdditionalAlias = -// CHECK: enum ns { -// CHECK-EMPTY: -// CHECK-NEXT: struct B { -// CHECK-EMPTY: -// CHECK-NEXT: init() -// CHECK-EMPTY: -// CHECK-NEXT: init(y: Int32) -// CHECK-EMPTY: -// CHECK-NEXT: var y: Int32 -// CHECK-NEXT: } -// CHECK-EMPTY: -// CHECK-NEXT: struct TemplateRecord { -// CHECK-EMPTY: -// CHECK-NEXT: @available(*, deprecated, message: -// CHECK-NEXT: public init() -// CHECK-EMPTY: -// CHECK-NEXT: mutating func methodFunc(_ x: Any) -// CHECK-EMPTY: -// CHECK-NEXT: struct InnerRecord { -// CHECK-EMPTY: -// CHECK-NEXT: @available(*, deprecated, message: -// CHECK-NEXT: public init() -// CHECK-EMPTY: -// CHECK-NEXT: mutating func innerMethod(_ y: Any) -// CHECK-NEXT: } -// CHECK-EMPTY: -// CHECK-NEXT: struct InnerTemplate { -// CHECK-EMPTY: -// CHECK-NEXT: @available(*, deprecated, message: -// CHECK-NEXT: public init() -// CHECK-EMPTY: -// CHECK-NEXT: mutating func innerTemplateMethod() -// CHECK-NEXT: } -// CHECK-EMPTY: -// CHECK-NEXT: mutating func returnsTemplateMethod() -// CHECK-NEXT: } -// CHECK: public struct StructInInlineNamespace { -// CHECK-EMPTY: -// CHECK-NEXT: public init() -// CHECK-NEXT: } -// CHECK-EMPTY: -// CHECK-NEXT: public typealias TypealiasInInlineNamespace = ns.TemplateRecord -// CHECK-EMPTY: -// CHECK-EMPTY: -// CHECK-NEXT: public typealias TypealiasOfInlineNamespace = ns.StructInInlineNamespace -// CHECK-EMPTY: -// CHECK-NEXT: static func freeFunction(_ x: Int32, _ y: Int32) -> Int32 -// CHECK-NEXT: } -// CHECK-EMPTY: -// CHECK-NEXT: typealias MyType = ns.TemplateRecord -// CHECK-EMPTY: -// CHECK-NEXT: typealias MyType2 = TransitiveStruct diff --git a/test/Interop/Cxx/symbolic-imports/print-symbolic-module-interface.swift b/test/Interop/Cxx/symbolic-imports/print-symbolic-module-interface.swift deleted file mode 100644 index a52236c518253..0000000000000 --- a/test/Interop/Cxx/symbolic-imports/print-symbolic-module-interface.swift +++ /dev/null @@ -1,128 +0,0 @@ -// RUN: rm -rf %t -// RUN: split-file %s %t -// RUN: %target-swift-ide-test -print-module -module-to-print=CxxModule -I %t/Inputs -source-filename=x -enable-experimental-cxx-interop -enable-experimental-feature ImportSymbolicCXXDecls 2>&1 | %FileCheck %s - -// REQUIRES: swift_feature_ImportSymbolicCXXDecls - -//--- Inputs/module.modulemap -module CxxModule { - header "headerA.h" - header "headerB.h" - requires cplusplus -} - -//--- Inputs/headerA.h - -namespace ns { - int freeFunction(int x, int y); -} - -//--- Inputs/headerB.h - -#include "headerA.h" - -namespace ns { - struct B { - int y; - }; - - template - struct TemplateRecord { - void methodFunc(int x); - - struct InnerRecord { - int innerMethod(int y); - }; - - template - struct InnerTemplate { - void innerTemplateMethod(); - void innerTemplateMethodWithDefaultArg(T2 x = 123); - }; - - InnerTemplate returnsTemplateMethod(); - }; -} - -using MyType = ns::TemplateRecord; - -template -class OuterTemp2 { -public: - template - class InnerTemp2 { - public: - void testMe(const T& p, const X& x); - - X x2; - - using Y = X; - }; -}; - -template -struct __attribute__((swift_attr("import_owned"))) AnnotatedTemplate { - T t; -}; - -#define IMMORTAL_FRT \ - __attribute__((swift_attr("import_reference"))) \ - __attribute__((swift_attr("retain:immortal"))) \ - __attribute__((swift_attr("release:immortal"))) - -struct IMMORTAL_FRT MyImmortal { - virtual void foo() const {}; -}; - -struct NonCopyable { - NonCopyable(const NonCopyable& other) = delete; -}; - -// CHECK-NOT: warning: 'import_owned' Swift attribute ignored on type - -// CHECK: enum ns { -// CHECK-NEXT: struct B { -// CHECK-NEXT: init() -// CHECK-NEXT: init(y: Int32) -// CHECK-NEXT: var y: Int32 -// CHECK-NEXT: } -// CHECK-NEXT: struct TemplateRecord { -// CHECK-NEXT: @available(*, deprecated, message: -// CHECK-NEXT: init() -// CHECK-NEXT: mutating func methodFunc(_ x: Any) -// CHECK-NEXT: struct InnerRecord { -// CHECK-NEXT: @available(*, deprecated, message: -// CHECK-NEXT: init() -// CHECK-NEXT: mutating func innerMethod(_ y: Any) -// CHECK-NEXT: } -// CHECK-NEXT: struct InnerTemplate { -// CHECK-NEXT: @available(*, deprecated, message: -// CHECK-NEXT: init() -// CHECK-NEXT: mutating func innerTemplateMethod() -// CHECK-NEXT: mutating func innerTemplateMethodWithDefaultArg(_ x: Any = cxxDefaultArg) -// CHECK-NEXT: } -// CHECK-NEXT: mutating func returnsTemplateMethod() -// CHECK-NEXT: } -// CHECK-NEXT: static func freeFunction(_ x: Int32, _ y: Int32) -> Int32 -// CHECK-NEXT: } -// CHECK-NEXT: typealias MyType = ns.TemplateRecord -// CHECK-NEXT: struct OuterTemp2 { -// CHECK-NEXT: @available(*, deprecated, message: -// CHECK-NEXT: init() -// CHECK-NEXT: struct InnerTemp2 { -// CHECK-NEXT: @available(*, deprecated, message: -// CHECK-NEXT: init() -// CHECK-NEXT: init(x2: Any) -// CHECK-NEXT: mutating func testMe(_ p: Any, _ x: Any) -// CHECK-NEXT: var x2: Any -// CHECK-NEXT: typealias Y = Any -// CHECK-NEXT: } -// CHECK-NEXT: } -// CHECK: class MyImmortal { -// CHECK-NEXT: init -// CHECK-NEXT: func foo() -// CHECK-NEXT: } -// CHECK-NEXT: struct NonCopyable { -// CHECK-NEXT: @available(*, deprecated, message: -// CHECK-NEXT: init() -// CHECK-NEXT: } From ddddc667c8be2c162550797f431f98d4b8aa013e Mon Sep 17 00:00:00 2001 From: Ben Barham Date: Mon, 21 Apr 2025 11:24:31 -0700 Subject: [PATCH 06/51] Merge exported modules with the same public name in generated interface If a module has the same `public-module-name` as the module being generated and its import is exported, merge it into the same generated interface. Fix various always-imported modules from being printed while here and update all the tests that checked for them. Resolves rdar://137887712. --- include/swift/AST/PrintOptions.h | 7 + include/swift/IDE/ModuleInterfacePrinting.h | 7 +- lib/AST/ASTPrinter.cpp | 5 + lib/IDE/ModuleInterfacePrinting.cpp | 149 +- .../foo_swift_module.printed.comments.txt | 2 - .../print_clang_framework_with_overlay.swift | 2 - .../cursor_generated_interface.swift | 12 +- .../doc_clang_module.swift.sub.response | 147 +- ...mport_common.swift.ClangFramework.response | 31 +- ...mmon.swift.OverlaidClangFramework.response | 34 +- ...mport_common.swift.SwiftFramework.response | 28 +- .../doc_internal_closure_label.swift.response | 30 +- .../doc_swift_module.swift.response | 798 +++-- .../doc_swift_module1.swift.response | 310 +- ...wift_module_class_extension.swift.response | 174 +- ...swift_module_cross_import.swift.A.response | 74 +- ...t_module_cross_import.swift.Other.response | 55 +- ...c_system_module_underscored.swift.response | 428 ++- .../InterfaceGen/gen_clang_module.swift | 6 +- ...lang_module.swift.helper.explicit.response | 27 +- .../gen_clang_module.swift.response | 2583 ++++++++--------- .../gen_clang_module.swift.sub.response | 175 +- .../InterfaceGen/gen_public_module_name.swift | 97 + ..._module.swift.from_swiftinterface.response | 75 +- .../gen_swift_module.swift.response | 90 +- .../gen_swift_module_cross_import.swift | 2 +- ...swift_module_cross_import.swift.A.response | 122 +- ...t_module_cross_import.swift.Other.response | 84 +- ...gen_swift_module_cross_import_common.swift | 6 +- ...mport_common.swift.ClangFramework.response | 52 +- ...mmon.swift.OverlaidClangFramework.response | 63 +- ...mport_common.swift.SwiftFramework.response | 51 +- .../gen_swiftonly_systemmodule.swift.response | 114 +- .../lib/SwiftLang/SwiftEditorInterfaceGen.cpp | 5 +- .../lib/SwiftLang/SwiftSourceDocInfo.cpp | 3 +- 35 files changed, 2854 insertions(+), 2994 deletions(-) create mode 100644 test/SourceKit/InterfaceGen/gen_public_module_name.swift diff --git a/include/swift/AST/PrintOptions.h b/include/swift/AST/PrintOptions.h index 37a643e023133..030ce64fcc57a 100644 --- a/include/swift/AST/PrintOptions.h +++ b/include/swift/AST/PrintOptions.h @@ -241,6 +241,12 @@ struct PrintOptions { /// \see FileUnit::getExportedModuleName bool UseExportedModuleNames = false; + /// If true, printed module names will use the "public" (for documentation) + /// name, which may be different from the regular name. + /// + /// \see FileUnit::getPublicModuleName + bool UsePublicModuleNames = false; + /// Use the original module name to qualify a symbol. bool UseOriginallyDefinedInModuleNames = false; @@ -711,6 +717,7 @@ struct PrintOptions { result.MapCrossImportOverlaysToDeclaringModule = true; result.PrintCurrentMembersOnly = false; result.SuppressExpandedMacros = true; + result.UsePublicModuleNames = true; return result; } diff --git a/include/swift/IDE/ModuleInterfacePrinting.h b/include/swift/IDE/ModuleInterfacePrinting.h index fc51d5e287d83..178f7758944bc 100644 --- a/include/swift/IDE/ModuleInterfacePrinting.h +++ b/include/swift/IDE/ModuleInterfacePrinting.h @@ -38,11 +38,14 @@ namespace ide { /// Flags used when traversing a module for printing. enum class ModuleTraversal : unsigned { /// Visit modules even if their contents wouldn't be visible to name lookup. - VisitHidden = 0x01, + VisitHidden = 0x01, /// Visit submodules. VisitSubmodules = 0x02, /// Skip the declarations in a Swift overlay module. - SkipOverlay = 0x04, + SkipOverlay = 0x04, + /// Visit exported modules where their public module name matches the current + /// module. + VisitMatchingExported = 0x08, }; /// Options used to describe the traversal of a module for printing. diff --git a/lib/AST/ASTPrinter.cpp b/lib/AST/ASTPrinter.cpp index 06f14058ff9eb..5583bbe7ae709 100644 --- a/lib/AST/ASTPrinter.cpp +++ b/lib/AST/ASTPrinter.cpp @@ -6028,6 +6028,11 @@ class TypePrinter : public TypeVisitor { Name = Mod->getASTContext().getIdentifier(ExportedModuleName); } + StringRef PublicModuleName = File->getPublicModuleName(); + if (Options.UsePublicModuleNames && !PublicModuleName.empty()) { + Name = Mod->getASTContext().getIdentifier(PublicModuleName); + } + if (Options.UseOriginallyDefinedInModuleNames) { Decl *D = Ty->getDecl(); for (auto attr: D->getAttrs().getAttributes()) { diff --git a/lib/IDE/ModuleInterfacePrinting.cpp b/lib/IDE/ModuleInterfacePrinting.cpp index b7a634d88dfc6..5f62e42f59753 100644 --- a/lib/IDE/ModuleInterfacePrinting.cpp +++ b/lib/IDE/ModuleInterfacePrinting.cpp @@ -304,6 +304,34 @@ static bool compareSwiftDecls(Decl *LHS, Decl *RHS) { return LHS->getKind() < RHS->getKind(); } +static bool shouldPrintImport(ImportDecl *ImportD, ModuleDecl *OrigMod, + const clang::Module *OrigClangMod) { + if (ImportD->getAttrs().hasAttribute()) + return false; + + auto *ImportedMod = ImportD->getModule(); + if (ImportedMod) { + if (ImportedMod == OrigMod) + return false; + if (ImportedMod->isOnoneSupportModule()) + return false; + if (ImportedMod->getName().hasUnderscoredNaming()) + return false; + } + + if (!OrigClangMod) + return true; + + auto ImportedClangMod = ImportD->getClangModule(); + if (!ImportedClangMod) + return true; + if (!ImportedClangMod->isSubModule()) + return true; + if (ImportedClangMod == OrigClangMod) + return false; + return ImportedClangMod->isSubModuleOf(OrigClangMod); +} + static std::pair, ArrayRef> getDeclsFromCrossImportOverlay(ModuleDecl *Overlay, ModuleDecl *Declaring, SmallVectorImpl &Decls, @@ -329,7 +357,8 @@ getDeclsFromCrossImportOverlay(ModuleDecl *Overlay, ModuleDecl *Declaring, // Ignore imports of the underlying module, or any cross-import // that would map back to it. - if (Imported == Declaring || Imported->isCrossImportOverlayOf(Declaring)) + if (!shouldPrintImport(ID, Declaring, nullptr) || + Imported->isCrossImportOverlayOf(Declaring)) return false; // Ignore an imports of modules also imported by the underlying module. @@ -457,19 +486,40 @@ void swift::ide::printModuleInterface( auto AdjustedOptions = Options; adjustPrintOptions(AdjustedOptions); + llvm::DenseSet SeenImportedDecls; SmallVector ModuleList; ModuleList.push_back(TargetMod); + SeenImportedDecls.insert(TargetMod); - SmallVector ImportDecls; - llvm::DenseSet ClangModulesForImports; - SmallVector SwiftDecls; + SmallVector ImportDecls; + SmallVector SwiftDecls; llvm::DenseMap, 1>> - ClangDecls; + SmallVector, 0>> + ClangDecls; + + // Add exported modules that have the same public module name as this module + // (excluding the underlying clang module if there is one). + if (TraversalOptions & ModuleTraversal::VisitMatchingExported) { + SmallVector Imports; + TargetMod->getImportedModules(Imports, + ModuleDecl::ImportFilterKind::Exported); + for (ImportedModule Import : Imports) { + if (Import.importedModule->getPublicModuleName( + /*onlyIfImported=*/false) != TargetMod->getName()) + continue; + + if (TargetClangMod != nullptr && + Import.importedModule->findUnderlyingClangModule() == TargetClangMod) + continue; + + ModuleList.push_back(Import.importedModule); + SeenImportedDecls.insert(Import.importedModule); + } + } - // If we're printing recursively, find all of the submodules to print. if (TargetClangMod) { - if (TraversalOptions) { + // Add clang submodules if they're being visited + if (TraversalOptions & ModuleTraversal::VisitSubmodules) { SmallVector Worklist; SmallPtrSet Visited; Worklist.push_back(TargetClangMod); @@ -482,16 +532,15 @@ void swift::ide::printModuleInterface( ClangDecls.insert({ CM, {} }); - if (CM != TargetClangMod) - if (auto *OwningModule = Importer.getWrapperForModule(CM)) + if (CM != TargetClangMod) { + if (auto *OwningModule = Importer.getWrapperForModule(CM)) { ModuleList.push_back(OwningModule); + } + } - // If we're supposed to visit submodules, add them now. - if (TraversalOptions & ModuleTraversal::VisitSubmodules) { - for (clang::Module * submodule: CM->submodules()) { - if (Visited.insert(submodule).second) { - Worklist.push_back(submodule); - } + for (clang::Module *submodule : CM->submodules()) { + if (Visited.insert(submodule).second) { + Worklist.push_back(submodule); } } } @@ -500,8 +549,7 @@ void swift::ide::printModuleInterface( } } - SmallVector Decls; - + SmallVector Decls; for (ModuleDecl *M : ModuleList) { swift::getTopLevelDeclsForDisplay(M, Decls); } @@ -527,42 +575,38 @@ void swift::ide::printModuleInterface( continue; } - auto ShouldPrintImport = [&](ImportDecl *ImportD) -> bool { - if (ImportD->getAttrs().hasAttribute()) - return false; + if (auto ID = dyn_cast(D)) { + if (!shouldPrintImport(ID, TargetMod, TargetClangMod)) + continue; - if (!TargetClangMod) - return true; - if (ImportD->getModule() == TargetMod) - return false; + // Erase submodules that are not missing + if (ID->getClangModule()) + NoImportSubModules.erase(ID->getClangModule()); - auto ImportedMod = ImportD->getClangModule(); - if (!ImportedMod) - return true; - if (!ImportedMod->isSubModule()) - return true; - if (ImportedMod == TargetClangMod) - return false; - return ImportedMod->isSubModuleOf(TargetClangMod); - }; + if (ID->getImportKind() == ImportKind::Module) { + // Could have a duplicate import from a clang module's overlay or + // because we're merging modules. Skip them. - if (auto ID = dyn_cast(D)) { - if (ShouldPrintImport(ID)) { - if (ID->getClangModule()) - // Erase those submodules that are not missing. - NoImportSubModules.erase(ID->getClangModule()); - if (ID->getImportKind() == ImportKind::Module) { - // Make sure we don't print duplicate imports, due to getting imports - // for both a clang module and its overlay. - if (auto *ClangMod = getUnderlyingClangModuleForImport(ID)) { - auto P = ClangModulesForImports.insert(ClangMod); - bool IsNew = P.second; - if (!IsNew) - continue; - } + if (auto *ClangMod = getUnderlyingClangModuleForImport(ID)) { + if (!SeenImportedDecls.insert(ClangMod).second) + continue; } - ImportDecls.push_back(ID); + + if (auto *ImportedMod = ID->getModule()) { + if (!SeenImportedDecls.insert(ImportedMod).second) + continue; + } + } else { + bool AnyNewDecls = false; + for (auto *ImportedDecl : ID->getDecls()) { + AnyNewDecls |= SeenImportedDecls.insert(ImportedDecl).second; + } + if (!AnyNewDecls) + continue; } + + ImportDecls.push_back(ID); + continue; } @@ -684,9 +728,12 @@ void swift::ide::printModuleInterface( // Imports from the stdlib are internal details that don't need to be exposed. if (!TargetMod->isStdlibModule()) { - for (auto *D : ImportDecls) + for (auto *D : ImportDecls) { PrintDecl(D); - Printer.printNewline(); + } + if (!ImportDecls.empty()) { + Printer.printNewline(); + } } { diff --git a/test/IDE/Inputs/foo_swift_module.printed.comments.txt b/test/IDE/Inputs/foo_swift_module.printed.comments.txt index 07094ce0d318c..d9b4720778492 100644 --- a/test/IDE/Inputs/foo_swift_module.printed.comments.txt +++ b/test/IDE/Inputs/foo_swift_module.printed.comments.txt @@ -1,5 +1,3 @@ -import SwiftOnoneSupport - func %%% (lhs: Int, rhs: Int) -> Int postfix func =-> (lhs: Int) -> Int postfix func => (lhs: Int) -> Int diff --git a/test/IDE/print_clang_framework_with_overlay.swift b/test/IDE/print_clang_framework_with_overlay.swift index a5be7186f4495..55e61e8025d6a 100644 --- a/test/IDE/print_clang_framework_with_overlay.swift +++ b/test/IDE/print_clang_framework_with_overlay.swift @@ -10,7 +10,5 @@ import FooOverlay // CHECK: @_exported import Foo // CHECK: @_exported import struct Foo.FooStruct1 // CHECK: @_exported import Foo.FooSub -// CHECK: @_exported import func Foo.FooSub.fooSubFunc1 -// FIXME: this duplicate import is silly, but not harmful. // CHECK: @_exported import func Foo.fooSubFunc1 // CHECK: func fooSubOverlayFunc1(x: Int32) -> Int32 diff --git a/test/SourceKit/CursorInfo/cursor_generated_interface.swift b/test/SourceKit/CursorInfo/cursor_generated_interface.swift index 9534fd96c3adc..5795412702e4e 100644 --- a/test/SourceKit/CursorInfo/cursor_generated_interface.swift +++ b/test/SourceKit/CursorInfo/cursor_generated_interface.swift @@ -41,7 +41,7 @@ public class ASwiftType { } // LibA is a mixed framework with no source info and a submodule -// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=12:36 -print-raw-response | %FileCheck %s --check-prefix=CHECKA +// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=11:36 -print-raw-response | %FileCheck %s --check-prefix=CHECKA // CHECKA: key.name: "ASwiftType" // CHECKA: key.modulename: "LibA" // CHECKA: key.decl_lang: source.lang.swift @@ -60,7 +60,7 @@ framework module LibA { @interface AObjcType @end -// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=12:54 -print-raw-response | %FileCheck %s --check-prefix=CHECKAOBJ +// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=11:54 -print-raw-response | %FileCheck %s --check-prefix=CHECKAOBJ // CHECKAOBJ: key.name: "AObjcType" // CHECKAOBJ: key.line: [[@LINE-5]] // CHECKAOBJ: key.column: 12 @@ -72,7 +72,7 @@ framework module LibA { @interface ASubType @end -// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=12:70 -print-raw-response | %FileCheck %s --check-prefix=CHECKASUB +// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=11:70 -print-raw-response | %FileCheck %s --check-prefix=CHECKASUB // CHECKASUB: key.name: "ASubType" // CHECKASUB: key.line: [[@LINE-5]] // CHECKASUB: key.column: 12 @@ -84,7 +84,7 @@ framework module LibA { public class BType {} // LibB has source info -// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=14:32 -print-raw-response | %FileCheck %s --check-prefix=CHECKB +// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=13:32 -print-raw-response | %FileCheck %s --check-prefix=CHECKB // CHECKB: key.name: "BType" // CHECKB: key.line: [[@LINE-5]] // CHECKB: key.column: 14 @@ -96,7 +96,7 @@ public class BType {} public class CType {} // LibC has no source info -// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=14:47 -print-raw-response | %FileCheck %s --check-prefix=CHECKC +// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=13:47 -print-raw-response | %FileCheck %s --check-prefix=CHECKC // CHECKC: key.name: "CType" // CHECKC: key.modulename: "LibC" // CHECKC: key.decl_lang: source.lang.swift @@ -105,7 +105,7 @@ public class CType {} @interface DType @end -// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=14:57 -print-raw-response | %FileCheck %s --check-prefix=CHECKD +// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=13:57 -print-raw-response | %FileCheck %s --check-prefix=CHECKD // CHECKD: key.name: "DType" // CHECKD: key.line: [[@LINE-5]] // CHECKD: key.column: 12 diff --git a/test/SourceKit/DocSupport/doc_clang_module.swift.sub.response b/test/SourceKit/DocSupport/doc_clang_module.swift.sub.response index 23fb8f8a03c47..daaadda51cf4d 100644 --- a/test/SourceKit/DocSupport/doc_clang_module.swift.sub.response +++ b/test/SourceKit/DocSupport/doc_clang_module.swift.sub.response @@ -1,4 +1,3 @@ - func fooSubFunc1(_ a: Int32) -> Int32 struct FooSubEnum1 : Hashable, Equatable, RawRepresentable { @@ -26,314 +25,314 @@ var FooSubUnnamedEnumeratorA1: Int { get } [ { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1, + key.offset: 0, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6, + key.offset: 5, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 18, + key.offset: 17, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 20, + key.offset: 19, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:s5Int32V", - key.offset: 23, + key.offset: 22, key.length: 5 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:s5Int32V", - key.offset: 33, + key.offset: 32, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 40, + key.offset: 39, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 47, + key.offset: 46, key.length: 11 }, { key.kind: source.lang.swift.ref.protocol, key.name: "Hashable", key.usr: "s:SH", - key.offset: 61, + key.offset: 60, key.length: 8 }, { key.kind: source.lang.swift.ref.protocol, key.name: "Equatable", key.usr: "s:SQ", - key.offset: 71, + key.offset: 70, key.length: 9 }, { key.kind: source.lang.swift.ref.protocol, key.name: "RawRepresentable", key.usr: "s:SY", - key.offset: 82, + key.offset: 81, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 106, + key.offset: 105, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 111, + key.offset: 110, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 113, + key.offset: 112, key.length: 8 }, { key.kind: source.lang.swift.ref.struct, key.name: "UInt32", key.usr: "s:s6UInt32V", - key.offset: 123, + key.offset: 122, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 136, + key.offset: 135, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 141, + key.offset: 140, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 150, + key.offset: 149, key.length: 8 }, { key.kind: source.lang.swift.ref.struct, key.name: "UInt32", key.usr: "s:s6UInt32V", - key.offset: 160, + key.offset: 159, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 173, + key.offset: 172, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 177, + key.offset: 176, key.length: 8 }, { key.kind: source.lang.swift.ref.struct, key.name: "UInt32", key.usr: "s:s6UInt32V", - key.offset: 187, + key.offset: 186, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 199, + key.offset: 198, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 210, + key.offset: 209, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 214, + key.offset: 213, key.length: 9 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 225, + key.offset: 224, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 231, + key.offset: 230, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 242, + key.offset: 241, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 253, + key.offset: 252, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 258, + key.offset: 257, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 263, + key.offset: 262, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 268, + key.offset: 267, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 276, + key.offset: 275, key.length: 5 }, { key.kind: source.lang.swift.ref.struct, key.name: "Hasher", key.usr: "s:s6HasherV", - key.offset: 282, + key.offset: 281, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 295, + key.offset: 294, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 302, + key.offset: 301, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.operator, - key.offset: 307, + key.offset: 306, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 311, + key.offset: 310, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 313, + key.offset: 312, key.length: 3 }, { key.kind: source.lang.swift.ref.struct, key.name: "FooSubEnum1", key.usr: "c:@E@FooSubEnum1", - key.offset: 318, + key.offset: 317, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 331, + key.offset: 330, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 333, + key.offset: 332, key.length: 3 }, { key.kind: source.lang.swift.ref.struct, key.name: "FooSubEnum1", key.usr: "c:@E@FooSubEnum1", - key.offset: 338, + key.offset: 337, key.length: 11 }, { key.kind: source.lang.swift.ref.struct, key.name: "Bool", key.usr: "s:Sb", - key.offset: 354, + key.offset: 353, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 362, + key.offset: 361, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 366, + key.offset: 365, key.length: 12 }, { key.kind: source.lang.swift.ref.struct, key.name: "FooSubEnum1", key.usr: "c:@E@FooSubEnum1", - key.offset: 380, + key.offset: 379, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 394, + key.offset: 393, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 401, + key.offset: 400, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 405, + key.offset: 404, key.length: 12 }, { key.kind: source.lang.swift.ref.struct, key.name: "FooSubEnum1", key.usr: "c:@E@FooSubEnum1", - key.offset: 419, + key.offset: 418, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 433, + key.offset: 432, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 440, + key.offset: 439, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 444, + key.offset: 443, key.length: 25 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 471, + key.offset: 470, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 477, + key.offset: 476, key.length: 3 } ] @@ -342,7 +341,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.free, key.name: "fooSubFunc1(_:)", key.usr: "c:@F@fooSubFunc1", - key.offset: 1, + key.offset: 0, key.length: 37, key.fully_annotated_decl: "func fooSubFunc1(_ a: Int32) -> Int32", key.entities: [ @@ -350,7 +349,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "a", - key.offset: 23, + key.offset: 22, key.length: 5 } ], @@ -360,7 +359,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.struct, key.name: "FooSubEnum1", key.usr: "c:@E@FooSubEnum1", - key.offset: 40, + key.offset: 39, key.length: 320, key.fully_annotated_decl: "struct FooSubEnum1 : Hashable, Equatable, RawRepresentable", key.conforms: [ @@ -385,7 +384,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.constructor, key.name: "init(_:)", key.usr: "s:So11FooSubEnum1VyABs6UInt32Vcfc", - key.offset: 106, + key.offset: 105, key.length: 24, key.fully_annotated_decl: "init(_ rawValue: UInt32)", key.entities: [ @@ -393,7 +392,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "rawValue", - key.offset: 123, + key.offset: 122, key.length: 6 } ] @@ -402,7 +401,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.constructor, key.name: "init(rawValue:)", key.usr: "s:So11FooSubEnum1V8rawValueABs6UInt32V_tcfc", - key.offset: 136, + key.offset: 135, key.length: 31, key.fully_annotated_decl: "init(rawValue: UInt32)", key.entities: [ @@ -410,7 +409,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "rawValue", key.name: "rawValue", - key.offset: 160, + key.offset: 159, key.length: 6 } ] @@ -419,7 +418,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "rawValue", key.usr: "s:So11FooSubEnum1V8rawValues6UInt32Vvp", - key.offset: 173, + key.offset: 172, key.length: 20, key.fully_annotated_decl: "var rawValue: UInt32" }, @@ -428,7 +427,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "hashValue", key.usr: "s:SYsSHRzSH8RawValueSYRpzrlE04hashB0Sivp::SYNTHESIZED::c:@E@FooSubEnum1", key.original_usr: "s:SYsSHRzSH8RawValueSYRpzrlE04hashB0Sivp", - key.offset: 199, + key.offset: 198, key.length: 37, key.fully_annotated_decl: "@inlinable var hashValue: Int { get }" }, @@ -437,7 +436,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "hash(into:)", key.usr: "s:SYsSHRzSH8RawValueSYRpzrlE4hash4intoys6HasherVz_tF::SYNTHESIZED::c:@E@FooSubEnum1", key.original_usr: "s:SYsSHRzSH8RawValueSYRpzrlE4hash4intoys6HasherVz_tF", - key.offset: 242, + key.offset: 241, key.length: 47, key.fully_annotated_decl: "@inlinable func hash(into hasher: inout Hasher)", key.entities: [ @@ -445,7 +444,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "into", key.name: "hasher", - key.offset: 282, + key.offset: 281, key.length: 6 } ] @@ -456,7 +455,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:SQsE2neoiySbx_xtFZ::SYNTHESIZED::c:@E@FooSubEnum1", key.original_usr: "s:SQsE2neoiySbx_xtFZ", key.doc.full_as_xml: "!=(_:_:)s:SQsE2neoiySbx_xtFZ::SYNTHESIZED::c:@E@FooSubEnum1static func != (lhs: FooSubEnum1, rhs: FooSubEnum1) -> BoolReturns a Boolean value indicating whether two values are not equal.lhsinA value to compare.rhsinAnother value to compare.Inequality is the inverse of equality. For any values a and b, a != b implies that a == b is false.This is the default implementation of the not-equal-to operator (!=) for any type that conforms to Equatable.", - key.offset: 295, + key.offset: 294, key.length: 63, key.fully_annotated_decl: "static func != (lhs: FooSubEnum1, rhs: FooSubEnum1) -> Bool", key.entities: [ @@ -464,14 +463,14 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "lhs", - key.offset: 318, + key.offset: 317, key.length: 11 }, { key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "rhs", - key.offset: 338, + key.offset: 337, key.length: 11 } ] @@ -483,7 +482,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.global, key.name: "FooSubEnum1X", key.usr: "c:@E@FooSubEnum1@FooSubEnum1X", - key.offset: 362, + key.offset: 361, key.length: 37, key.fully_annotated_decl: "var FooSubEnum1X: FooSubEnum1 { get }", key.modulename: "Foo.FooSub" @@ -492,7 +491,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.global, key.name: "FooSubEnum1Y", key.usr: "c:@E@FooSubEnum1@FooSubEnum1Y", - key.offset: 401, + key.offset: 400, key.length: 37, key.fully_annotated_decl: "var FooSubEnum1Y: FooSubEnum1 { get }", key.modulename: "Foo.FooSub" @@ -501,7 +500,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.global, key.name: "FooSubUnnamedEnumeratorA1", key.usr: "c:@Ea@FooSubUnnamedEnumeratorA1@FooSubUnnamedEnumeratorA1", - key.offset: 440, + key.offset: 439, key.length: 42, key.fully_annotated_decl: "var FooSubUnnamedEnumeratorA1: Int { get }", key.modulename: "Foo.FooSub" diff --git a/test/SourceKit/DocSupport/doc_cross_import_common.swift.ClangFramework.response b/test/SourceKit/DocSupport/doc_cross_import_common.swift.ClangFramework.response index 1a2790da5b052..79a38e1886aaa 100644 --- a/test/SourceKit/DocSupport/doc_cross_import_common.swift.ClangFramework.response +++ b/test/SourceKit/DocSupport/doc_cross_import_common.swift.ClangFramework.response @@ -1,11 +1,8 @@ - func fromClangFramework() // MARK: - BystandingLibrary Additions -import SwiftOnoneSupport - // Available when BystandingLibrary is imported with ClangFramework func fromClangFrameworkCrossImport() @@ -13,47 +10,37 @@ func fromClangFrameworkCrossImport() [ { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1, + key.offset: 0, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6, + key.offset: 5, key.length: 18 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 29, + key.offset: 28, key.length: 39 }, { key.kind: source.lang.swift.syntaxtype.comment.mark, - key.offset: 32, + key.offset: 31, key.length: 35 }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 69, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 76, - key.length: 17 - }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 95, + key.offset: 68, key.length: 68 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 163, + key.offset: 136, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 168, + key.offset: 141, key.length: 29 } ] @@ -62,7 +49,7 @@ func fromClangFrameworkCrossImport() key.kind: source.lang.swift.decl.function.free, key.name: "fromClangFramework()", key.usr: "c:@F@fromClangFramework", - key.offset: 1, + key.offset: 0, key.length: 25, key.fully_annotated_decl: "func fromClangFramework()" }, @@ -70,7 +57,7 @@ func fromClangFrameworkCrossImport() key.kind: source.lang.swift.decl.function.free, key.name: "fromClangFrameworkCrossImport()", key.usr: "s:33_ClangFramework_BystandingLibrary04fromaB11CrossImportyyF", - key.offset: 163, + key.offset: 136, key.length: 36, key.fully_annotated_decl: "func fromClangFrameworkCrossImport()", key.required_bystanders: [ diff --git a/test/SourceKit/DocSupport/doc_cross_import_common.swift.OverlaidClangFramework.response b/test/SourceKit/DocSupport/doc_cross_import_common.swift.OverlaidClangFramework.response index 2bae79e916ff1..32af4c70cb66e 100644 --- a/test/SourceKit/DocSupport/doc_cross_import_common.swift.OverlaidClangFramework.response +++ b/test/SourceKit/DocSupport/doc_cross_import_common.swift.OverlaidClangFramework.response @@ -1,5 +1,3 @@ -import SwiftOnoneSupport - func fromOverlaidClangFramework() func fromOverlaidClangFrameworkOverlay() @@ -15,56 +13,46 @@ func fromOverlaidClangFrameworkCrossImport() { key.kind: source.lang.swift.syntaxtype.keyword, key.offset: 0, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7, - key.length: 17 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 26, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 31, + key.offset: 5, key.length: 26 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 61, + key.offset: 35, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 66, + key.offset: 40, key.length: 33 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 104, + key.offset: 78, key.length: 39 }, { key.kind: source.lang.swift.syntaxtype.comment.mark, - key.offset: 107, + key.offset: 81, key.length: 35 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 144, + key.offset: 118, key.length: 76 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 220, + key.offset: 194, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 225, + key.offset: 199, key.length: 37 } ] @@ -73,7 +61,7 @@ func fromOverlaidClangFrameworkCrossImport() key.kind: source.lang.swift.decl.function.free, key.name: "fromOverlaidClangFramework()", key.usr: "c:@F@fromOverlaidClangFramework", - key.offset: 26, + key.offset: 0, key.length: 33, key.fully_annotated_decl: "func fromOverlaidClangFramework()" }, @@ -81,7 +69,7 @@ func fromOverlaidClangFrameworkCrossImport() key.kind: source.lang.swift.decl.function.free, key.name: "fromOverlaidClangFrameworkOverlay()", key.usr: "s:22OverlaidClangFramework04fromabC7OverlayyyF", - key.offset: 61, + key.offset: 35, key.length: 40, key.fully_annotated_decl: "func fromOverlaidClangFrameworkOverlay()" }, @@ -89,7 +77,7 @@ func fromOverlaidClangFrameworkCrossImport() key.kind: source.lang.swift.decl.function.free, key.name: "fromOverlaidClangFrameworkCrossImport()", key.usr: "s:41_OverlaidClangFramework_BystandingLibrary04fromabC11CrossImportyyF", - key.offset: 220, + key.offset: 194, key.length: 44, key.fully_annotated_decl: "func fromOverlaidClangFrameworkCrossImport()", key.required_bystanders: [ diff --git a/test/SourceKit/DocSupport/doc_cross_import_common.swift.SwiftFramework.response b/test/SourceKit/DocSupport/doc_cross_import_common.swift.SwiftFramework.response index c6cc47cc7d01f..f5bd69c639d96 100644 --- a/test/SourceKit/DocSupport/doc_cross_import_common.swift.SwiftFramework.response +++ b/test/SourceKit/DocSupport/doc_cross_import_common.swift.SwiftFramework.response @@ -1,5 +1,3 @@ -import SwiftOnoneSupport - func fromSwiftFramework() @@ -13,46 +11,36 @@ func fromSwiftFrameworkCrossImport() { key.kind: source.lang.swift.syntaxtype.keyword, key.offset: 0, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7, - key.length: 17 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 26, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 31, + key.offset: 5, key.length: 18 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 54, + key.offset: 28, key.length: 39 }, { key.kind: source.lang.swift.syntaxtype.comment.mark, - key.offset: 57, + key.offset: 31, key.length: 35 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 94, + key.offset: 68, key.length: 68 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 162, + key.offset: 136, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 167, + key.offset: 141, key.length: 29 } ] @@ -61,7 +49,7 @@ func fromSwiftFrameworkCrossImport() key.kind: source.lang.swift.decl.function.free, key.name: "fromSwiftFramework()", key.usr: "s:14SwiftFramework04fromaB0yyF", - key.offset: 26, + key.offset: 0, key.length: 25, key.fully_annotated_decl: "func fromSwiftFramework()" }, @@ -69,7 +57,7 @@ func fromSwiftFrameworkCrossImport() key.kind: source.lang.swift.decl.function.free, key.name: "fromSwiftFrameworkCrossImport()", key.usr: "s:33_SwiftFramework_BystandingLibrary04fromaB11CrossImportyyF", - key.offset: 162, + key.offset: 136, key.length: 36, key.fully_annotated_decl: "func fromSwiftFrameworkCrossImport()", key.required_bystanders: [ diff --git a/test/SourceKit/DocSupport/doc_internal_closure_label.swift.response b/test/SourceKit/DocSupport/doc_internal_closure_label.swift.response index 9366c16616d73..72056cfa9a4c1 100644 --- a/test/SourceKit/DocSupport/doc_internal_closure_label.swift.response +++ b/test/SourceKit/DocSupport/doc_internal_closure_label.swift.response @@ -1,5 +1,3 @@ -import SwiftOnoneSupport - func foo(_ callback: (_ myInternalParam: Int) -> Void) @@ -7,55 +5,45 @@ func foo(_ callback: (_ myInternalParam: Int) -> Void) { key.kind: source.lang.swift.syntaxtype.keyword, key.offset: 0, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7, - key.length: 17 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 26, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 31, + key.offset: 5, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 35, + key.offset: 9, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 37, + key.offset: 11, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 48, + key.offset: 22, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 50, + key.offset: 24, key.length: 15 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 67, + key.offset: 41, key.length: 3 }, { key.kind: source.lang.swift.ref.typealias, key.name: "Void", key.usr: "s:s4Voida", - key.offset: 75, + key.offset: 49, key.length: 4 } ] @@ -64,7 +52,7 @@ func foo(_ callback: (_ myInternalParam: Int) -> Void) key.kind: source.lang.swift.decl.function.free, key.name: "foo(_:)", key.usr: "s:5label3fooyyySiXEF", - key.offset: 26, + key.offset: 0, key.length: 54, key.fully_annotated_decl: "func foo(_ callback: (_ myInternalParam: Int) -> Void)", key.entities: [ @@ -72,7 +60,7 @@ func foo(_ callback: (_ myInternalParam: Int) -> Void) key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "callback", - key.offset: 47, + key.offset: 21, key.length: 32 } ] diff --git a/test/SourceKit/DocSupport/doc_swift_module.swift.response b/test/SourceKit/DocSupport/doc_swift_module.swift.response index e598769642a2a..72de18f4ffced 100644 --- a/test/SourceKit/DocSupport/doc_swift_module.swift.response +++ b/test/SourceKit/DocSupport/doc_swift_module.swift.response @@ -1,5 +1,3 @@ -import SwiftOnoneSupport - struct Box { func boxes() -> [cake.Box] where Wrapped : Sequence @@ -183,1688 +181,1678 @@ func shouldPrintAnyAsKeyword(x x: Any) { key.kind: source.lang.swift.syntaxtype.identifier, key.offset: 7, - key.length: 17 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 26, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 33, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 37, + key.offset: 11, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 53, + key.offset: 27, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 58, + key.offset: 32, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 70, + key.offset: 44, key.length: 4 }, { key.kind: source.lang.swift.ref.struct, key.name: "Box", key.usr: "s:4cake3BoxV", - key.offset: 75, + key.offset: 49, key.length: 3 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Wrapped", key.usr: "s:4cake3BoxV7Wrappedxmfp", - key.offset: 79, + key.offset: 53, key.length: 7 }, { key.kind: source.lang.swift.ref.associatedtype, key.name: "Element", key.usr: "s:ST7ElementQa", - key.offset: 87, + key.offset: 61, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 97, + key.offset: 71, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Wrapped", key.usr: "s:4cake3BoxV7Wrappedxmfp", - key.offset: 103, + key.offset: 77, key.length: 7 }, { key.kind: source.lang.swift.ref.protocol, key.name: "Sequence", key.usr: "s:ST", - key.offset: 113, + key.offset: 87, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 125, + key.offset: 99, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 131, + key.offset: 105, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 136, + key.offset: 110, key.length: 4 }, { key.kind: source.lang.swift.ref.protocol, key.name: "Prot", key.usr: "s:4cake4ProtP", - key.offset: 141, + key.offset: 115, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 153, + key.offset: 127, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 163, + key.offset: 137, key.length: 7 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 173, + key.offset: 147, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 182, + key.offset: 156, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 186, + key.offset: 160, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 189, + key.offset: 163, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 198, + key.offset: 172, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 203, + key.offset: 177, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 214, + key.offset: 188, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 219, + key.offset: 193, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 224, + key.offset: 198, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 227, + key.offset: 201, key.length: 2 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 231, + key.offset: 205, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 236, + key.offset: 210, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 239, + key.offset: 213, key.length: 2 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 243, + key.offset: 217, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 253, + key.offset: 227, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 263, + key.offset: 237, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 265, + key.offset: 239, key.length: 5 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 272, + key.offset: 246, key.length: 3 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 280, + key.offset: 254, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 286, + key.offset: 260, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 297, + key.offset: 271, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 307, + key.offset: 281, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 313, + key.offset: 287, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Float", key.usr: "s:Sf", - key.offset: 316, + key.offset: 290, key.length: 5 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 326, + key.offset: 300, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 332, + key.offset: 306, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 343, + key.offset: 317, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 348, + key.offset: 322, key.length: 7 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 358, + key.offset: 332, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 373, + key.offset: 347, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 378, + key.offset: 352, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 395, + key.offset: 369, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 400, + key.offset: 374, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 414, + key.offset: 388, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 419, + key.offset: 393, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 431, + key.offset: 405, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 441, + key.offset: 415, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 443, + key.offset: 417, key.length: 5 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 450, + key.offset: 424, key.length: 3 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 458, + key.offset: 432, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 464, + key.offset: 438, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 473, + key.offset: 447, key.length: 9 }, { key.kind: source.lang.swift.ref.class, key.name: "C1", key.usr: "s:4cake2C1C", - key.offset: 483, + key.offset: 457, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 493, + key.offset: 467, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 498, + key.offset: 472, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 512, + key.offset: 486, key.length: 9 }, { key.kind: source.lang.swift.ref.class, key.name: "C1", key.usr: "s:4cake2C1C", - key.offset: 522, + key.offset: 496, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 527, + key.offset: 501, key.length: 4 }, { key.kind: source.lang.swift.ref.protocol, key.name: "P4", key.usr: "s:4cake2P4P", - key.offset: 532, + key.offset: 506, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 542, + key.offset: 516, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 547, + key.offset: 521, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 560, + key.offset: 534, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 567, + key.offset: 541, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 583, + key.offset: 557, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 588, + key.offset: 562, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 596, + key.offset: 570, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 598, + key.offset: 572, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 601, + key.offset: 575, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 605, + key.offset: 579, key.length: 4 }, { key.kind: source.lang.swift.ref.protocol, key.name: "P4", key.usr: "s:4cake2P4P", - key.offset: 610, + key.offset: 584, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 623, + key.offset: 597, key.length: 9 }, { key.kind: source.lang.swift.ref.class, key.name: "C1", key.usr: "s:4cake2C1C", - key.offset: 633, + key.offset: 607, key.length: 2 }, { key.kind: source.lang.swift.ref.enum, key.name: "C1Cases", key.usr: "s:4cake2C1C0B5CasesO", - key.offset: 636, + key.offset: 610, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 651, + key.offset: 625, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 662, + key.offset: 636, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 666, + key.offset: 640, key.length: 9 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 677, + key.offset: 651, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 683, + key.offset: 657, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 694, + key.offset: 668, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 705, + key.offset: 679, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 710, + key.offset: 684, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 715, + key.offset: 689, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 720, + key.offset: 694, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 728, + key.offset: 702, key.length: 5 }, { key.kind: source.lang.swift.ref.struct, key.name: "Hasher", key.usr: "s:s6HasherV", - key.offset: 734, + key.offset: 708, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 747, + key.offset: 721, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 754, + key.offset: 728, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.operator, - key.offset: 759, + key.offset: 733, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 763, + key.offset: 737, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 765, + key.offset: 739, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 770, + key.offset: 744, key.length: 4 }, { key.kind: source.lang.swift.ref.class, key.name: "C1", key.usr: "s:4cake2C1C", - key.offset: 775, + key.offset: 749, key.length: 2 }, { key.kind: source.lang.swift.ref.enum, key.name: "C1Cases", key.usr: "s:4cake2C1C0B5CasesO", - key.offset: 778, + key.offset: 752, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 787, + key.offset: 761, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 789, + key.offset: 763, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 794, + key.offset: 768, key.length: 4 }, { key.kind: source.lang.swift.ref.class, key.name: "C1", key.usr: "s:4cake2C1C", - key.offset: 799, + key.offset: 773, key.length: 2 }, { key.kind: source.lang.swift.ref.enum, key.name: "C1Cases", key.usr: "s:4cake2C1C0B5CasesO", - key.offset: 802, + key.offset: 776, key.length: 7 }, { key.kind: source.lang.swift.ref.struct, key.name: "Bool", key.usr: "s:Sb", - key.offset: 814, + key.offset: 788, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 822, + key.offset: 796, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 828, + key.offset: 802, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 833, + key.offset: 807, key.length: 4 }, { key.kind: source.lang.swift.ref.class, key.name: "C1", key.usr: "s:4cake2C1C", - key.offset: 838, + key.offset: 812, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 848, + key.offset: 822, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 853, + key.offset: 827, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 864, + key.offset: 838, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 869, + key.offset: 843, key.length: 6 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 878, + key.offset: 852, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 889, + key.offset: 863, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 894, + key.offset: 868, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 904, + key.offset: 878, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 915, + key.offset: 889, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 919, + key.offset: 893, key.length: 9 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 930, + key.offset: 904, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 936, + key.offset: 910, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 947, + key.offset: 921, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 958, + key.offset: 932, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 963, + key.offset: 937, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 968, + key.offset: 942, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 973, + key.offset: 947, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 981, + key.offset: 955, key.length: 5 }, { key.kind: source.lang.swift.ref.struct, key.name: "Hasher", key.usr: "s:s6HasherV", - key.offset: 987, + key.offset: 961, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1000, + key.offset: 974, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1007, + key.offset: 981, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.operator, - key.offset: 1012, + key.offset: 986, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 1016, + key.offset: 990, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 1018, + key.offset: 992, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1023, + key.offset: 997, key.length: 4 }, { key.kind: source.lang.swift.ref.enum, key.name: "MyEnum", key.usr: "s:4cake6MyEnumO", - key.offset: 1028, + key.offset: 1002, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 1036, + key.offset: 1010, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 1038, + key.offset: 1012, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1043, + key.offset: 1017, key.length: 4 }, { key.kind: source.lang.swift.ref.enum, key.name: "MyEnum", key.usr: "s:4cake6MyEnumO", - key.offset: 1048, + key.offset: 1022, key.length: 6 }, { key.kind: source.lang.swift.ref.struct, key.name: "Bool", key.usr: "s:Sb", - key.offset: 1059, + key.offset: 1033, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1067, + key.offset: 1041, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1076, + key.offset: 1050, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1085, + key.offset: 1059, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1090, + key.offset: 1064, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1099, + key.offset: 1073, key.length: 9 }, { key.kind: source.lang.swift.ref.protocol, key.name: "P", key.usr: "s:4cake1PP", - key.offset: 1109, + key.offset: 1083, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1118, + key.offset: 1092, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1123, + key.offset: 1097, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1129, + key.offset: 1103, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Self", key.usr: "s:4cake1PP4Selfxmfp", - key.offset: 1135, + key.offset: 1109, key.length: 4 }, { key.kind: source.lang.swift.ref.protocol, key.name: "Equatable", key.usr: "s:SQ", - key.offset: 1142, + key.offset: 1116, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1155, + key.offset: 1129, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1161, + key.offset: 1135, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1170, + key.offset: 1144, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1180, + key.offset: 1154, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1186, + key.offset: 1160, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1195, + key.offset: 1169, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1200, + key.offset: 1174, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1210, + key.offset: 1184, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1219, + key.offset: 1193, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1229, + key.offset: 1203, key.length: 14 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1244, + key.offset: 1218, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1249, + key.offset: 1223, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1258, + key.offset: 1232, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1266, + key.offset: 1240, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1275, + key.offset: 1249, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1285, + key.offset: 1259, key.length: 14 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1300, + key.offset: 1274, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1311, + key.offset: 1285, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1320, + key.offset: 1294, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1325, + key.offset: 1299, key.length: 4 }, { key.kind: source.lang.swift.ref.protocol, key.name: "P5", key.usr: "s:4cake2P5P", - key.offset: 1330, + key.offset: 1304, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1338, + key.offset: 1312, key.length: 9 }, { key.kind: source.lang.swift.ref.protocol, key.name: "P6", key.usr: "s:4cake2P6P", - key.offset: 1348, + key.offset: 1322, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1358, + key.offset: 1332, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1362, + key.offset: 1336, key.length: 4 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Self", key.usr: "s:4cake2P6P4Selfxmfp", - key.offset: 1368, + key.offset: 1342, key.length: 4 }, { key.kind: source.lang.swift.ref.associatedtype, key.name: "Element", key.usr: "s:4cake2P5P7ElementQa", - key.offset: 1373, + key.offset: 1347, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1384, + key.offset: 1358, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1393, + key.offset: 1367, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1402, + key.offset: 1376, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1414, + key.offset: 1388, key.length: 14 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1429, + key.offset: 1403, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1442, + key.offset: 1416, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1446, + key.offset: 1420, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 1449, + key.offset: 1423, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1455, + key.offset: 1429, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1466, + key.offset: 1440, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1471, + key.offset: 1445, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1482, + key.offset: 1456, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1487, + key.offset: 1461, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1497, + key.offset: 1471, key.length: 9 }, { key.kind: source.lang.swift.ref.protocol, key.name: "Prot", key.usr: "s:4cake4ProtP", - key.offset: 1507, + key.offset: 1481, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1519, + key.offset: 1493, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1524, + key.offset: 1498, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1536, + key.offset: 1510, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 1546, + key.offset: 1520, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 1548, + key.offset: 1522, key.length: 5 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 1555, + key.offset: 1529, key.length: 3 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 1563, + key.offset: 1537, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1569, + key.offset: 1543, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1578, + key.offset: 1552, key.length: 9 }, { key.kind: source.lang.swift.ref.protocol, key.name: "Prot", key.usr: "s:4cake4ProtP", - key.offset: 1588, + key.offset: 1562, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1593, + key.offset: 1567, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Self", key.usr: "s:4cake4ProtP4Selfxmfp", - key.offset: 1599, + key.offset: 1573, key.length: 4 }, { key.kind: source.lang.swift.ref.associatedtype, key.name: "Element", key.usr: "s:4cake4ProtP7ElementQa", - key.offset: 1604, + key.offset: 1578, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.operator, - key.offset: 1612, + key.offset: 1586, key.length: 2 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 1615, + key.offset: 1589, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1626, + key.offset: 1600, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1631, + key.offset: 1605, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1643, + key.offset: 1617, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1650, + key.offset: 1624, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1660, + key.offset: 1634, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1665, + key.offset: 1639, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1679, + key.offset: 1653, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1684, + key.offset: 1658, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1695, + key.offset: 1669, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1700, + key.offset: 1674, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1711, + key.offset: 1685, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1716, + key.offset: 1690, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1729, + key.offset: 1703, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1734, + key.offset: 1708, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1746, + key.offset: 1720, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1753, + key.offset: 1727, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1767, + key.offset: 1741, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1771, + key.offset: 1745, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 1774, + key.offset: 1748, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1787, + key.offset: 1761, key.length: 9 }, { key.kind: source.lang.swift.ref.struct, key.name: "S1", key.usr: "s:4cake2S1V", - key.offset: 1797, + key.offset: 1771, key.length: 2 }, { key.kind: source.lang.swift.ref.enum, key.name: "SE", key.usr: "s:4cake2S1V2SEO", - key.offset: 1800, + key.offset: 1774, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1810, + key.offset: 1784, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1817, + key.offset: 1791, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.operator, - key.offset: 1822, + key.offset: 1796, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 1826, + key.offset: 1800, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 1828, + key.offset: 1802, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1833, + key.offset: 1807, key.length: 4 }, { key.kind: source.lang.swift.ref.struct, key.name: "S1", key.usr: "s:4cake2S1V", - key.offset: 1838, + key.offset: 1812, key.length: 2 }, { key.kind: source.lang.swift.ref.enum, key.name: "SE", key.usr: "s:4cake2S1V2SEO", - key.offset: 1841, + key.offset: 1815, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 1845, + key.offset: 1819, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 1847, + key.offset: 1821, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1852, + key.offset: 1826, key.length: 4 }, { key.kind: source.lang.swift.ref.struct, key.name: "S1", key.usr: "s:4cake2S1V", - key.offset: 1857, + key.offset: 1831, key.length: 2 }, { key.kind: source.lang.swift.ref.enum, key.name: "SE", key.usr: "s:4cake2S1V2SEO", - key.offset: 1860, + key.offset: 1834, key.length: 2 }, { key.kind: source.lang.swift.ref.struct, key.name: "Bool", key.usr: "s:Sb", - key.offset: 1867, + key.offset: 1841, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1875, + key.offset: 1849, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1882, + key.offset: 1856, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1887, + key.offset: 1861, key.length: 4 }, { key.kind: source.lang.swift.ref.protocol, key.name: "P3", key.usr: "s:4cake2P3P", - key.offset: 1892, + key.offset: 1866, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1902, + key.offset: 1876, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1912, + key.offset: 1886, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1916, + key.offset: 1890, key.length: 4 }, { key.kind: source.lang.swift.ref.struct, key.name: "S2", key.usr: "s:4cake2S2V", - key.offset: 1921, + key.offset: 1895, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1927, + key.offset: 1901, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1934, + key.offset: 1908, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1937, + key.offset: 1911, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1948, + key.offset: 1922, key.length: 4 }, { key.kind: source.lang.swift.ref.protocol, key.name: "P5", key.usr: "s:4cake2P5P", - key.offset: 1953, + key.offset: 1927, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1956, + key.offset: 1930, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Wrapped", key.usr: "s:4cake2S3V7Wrappedxmfp", - key.offset: 1962, + key.offset: 1936, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1972, + key.offset: 1946, key.length: 4 }, { key.kind: source.lang.swift.ref.protocol, key.name: "P5", key.usr: "s:4cake2P5P", - key.offset: 1977, + key.offset: 1951, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1987, + key.offset: 1961, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1997, + key.offset: 1971, key.length: 7 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Wrapped", key.usr: "s:4cake2S3V7Wrappedxmfp", - key.offset: 2007, + key.offset: 1981, key.length: 7 }, { key.kind: source.lang.swift.ref.associatedtype, key.name: "Element", key.usr: "s:4cake2P5P7ElementQa", - key.offset: 2015, + key.offset: 1989, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2026, + key.offset: 2000, key.length: 9 }, { key.kind: source.lang.swift.ref.struct, key.name: "S3", key.usr: "s:4cake2S3V", - key.offset: 2036, + key.offset: 2010, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2039, + key.offset: 2013, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Wrapped", key.usr: "s:4cake2S3V7Wrappedxmfp", - key.offset: 2045, + key.offset: 2019, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 2055, + key.offset: 2029, key.length: 4 }, { key.kind: source.lang.swift.ref.protocol, key.name: "P6", key.usr: "s:4cake2P6P", - key.offset: 2060, + key.offset: 2034, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2070, + key.offset: 2044, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2074, + key.offset: 2048, key.length: 4 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Wrapped", key.usr: "s:4cake2S3V7Wrappedxmfp", - key.offset: 2080, + key.offset: 2054, key.length: 7 }, { key.kind: source.lang.swift.ref.associatedtype, key.name: "Element", key.usr: "s:4cake2P5P7ElementQa", - key.offset: 2088, + key.offset: 2062, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2099, + key.offset: 2073, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2108, + key.offset: 2082, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2113, + key.offset: 2087, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2120, + key.offset: 2094, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2124, + key.offset: 2098, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 2128, + key.offset: 2102, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 2130, + key.offset: 2104, key.length: 2 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "T1", key.usr: "s:4cake6genfoo1x1yyx_q_tAA4ProtRzAA2C1CRb_Si7ElementRtzr0_lF2T1L_xmfp", - key.offset: 2134, + key.offset: 2108, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 2138, + key.offset: 2112, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 2140, + key.offset: 2114, key.length: 2 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "T2", key.usr: "s:4cake6genfoo1x1yyx_q_tAA4ProtRzAA2C1CRb_Si7ElementRtzr0_lF2T2L_q_mfp", - key.offset: 2144, + key.offset: 2118, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2148, + key.offset: 2122, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "T1", key.usr: "s:4cake6genfoo1x1yyx_q_tAA4ProtRzAA2C1CRb_Si7ElementRtzr0_lF2T1L_xmfp", - key.offset: 2154, + key.offset: 2128, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 2159, + key.offset: 2133, key.length: 4 }, { key.kind: source.lang.swift.ref.protocol, key.name: "Prot", key.usr: "s:4cake4ProtP", - key.offset: 2164, + key.offset: 2138, key.length: 4 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "T2", key.usr: "s:4cake6genfoo1x1yyx_q_tAA4ProtRzAA2C1CRb_Si7ElementRtzr0_lF2T2L_q_mfp", - key.offset: 2170, + key.offset: 2144, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 2175, + key.offset: 2149, key.length: 4 }, { key.kind: source.lang.swift.ref.class, key.name: "C1", key.usr: "s:4cake2C1C", - key.offset: 2180, + key.offset: 2154, key.length: 2 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "T1", key.usr: "s:4cake6genfoo1x1yyx_q_tAA4ProtRzAA2C1CRb_Si7ElementRtzr0_lF2T1L_xmfp", - key.offset: 2184, + key.offset: 2158, key.length: 2 }, { key.kind: source.lang.swift.ref.associatedtype, key.name: "Element", key.usr: "s:4cake4ProtP7ElementQa", - key.offset: 2187, + key.offset: 2161, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.operator, - key.offset: 2195, + key.offset: 2169, key.length: 2 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 2198, + key.offset: 2172, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2203, + key.offset: 2177, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2208, + key.offset: 2182, key.length: 23 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 2232, + key.offset: 2206, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 2234, + key.offset: 2208, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2237, + key.offset: 2211, key.length: 3 } ] @@ -1878,7 +1866,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.name: "Wrapped" } ], - key.offset: 26, + key.offset: 0, key.length: 97, key.fully_annotated_decl: "struct Box<Wrapped>", key.entities: [ @@ -1891,7 +1879,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.description: "Wrapped : Sequence" } ], - key.offset: 53, + key.offset: 27, key.length: 68, key.fully_annotated_decl: "func boxes() -> [Box<Wrapped.Element>] where Wrapped : Sequence" } @@ -1901,7 +1889,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.class, key.name: "C1", key.usr: "s:4cake2C1C", - key.offset: 125, + key.offset: 99, key.length: 346, key.fully_annotated_decl: "class C1 : Prot", key.conforms: [ @@ -1916,7 +1904,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.typealias, key.name: "Element", key.usr: "s:4cake2C1C7Elementa", - key.offset: 153, + key.offset: 127, key.length: 23, key.fully_annotated_decl: "typealias C1.Element = Int", key.conforms: [ @@ -1941,7 +1929,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.var.instance, key.name: "p", key.usr: "s:4cake2C1C1pSivp", - key.offset: 182, + key.offset: 156, key.length: 10, key.fully_annotated_decl: "var p: Int", key.conforms: [ @@ -1956,7 +1944,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.function.method.instance, key.name: "foo()", key.usr: "s:4cake2C1C3fooyyF", - key.offset: 198, + key.offset: 172, key.length: 10, key.fully_annotated_decl: "func foo()", key.conforms: [ @@ -1971,7 +1959,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.function.method.instance, key.name: "foo1(i0:i1:)", key.usr: "s:4cake2C1C4foo12i02i1ySin_SihtF", - key.offset: 214, + key.offset: 188, key.length: 33, key.fully_annotated_decl: "func foo1(i0: Int, i1: Int)", key.entities: [ @@ -1979,14 +1967,14 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.var.local, key.keyword: "i0", key.name: "i0", - key.offset: 231, + key.offset: 205, key.length: 3 }, { key.kind: source.lang.swift.decl.var.local, key.keyword: "i1", key.name: "i1", - key.offset: 243, + key.offset: 217, key.length: 3 } ] @@ -1995,7 +1983,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.function.subscript, key.name: "subscript(_:)", key.usr: "s:4cake2C1CyS2icip", - key.offset: 253, + key.offset: 227, key.length: 38, key.fully_annotated_decl: "subscript(index: Int) -> Int { get }", key.entities: [ @@ -2003,7 +1991,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "index", - key.offset: 272, + key.offset: 246, key.length: 3 } ] @@ -2012,7 +2000,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.function.subscript, key.name: "subscript(index:)", key.usr: "s:4cake2C1C5indexSiSf_tcip", - key.offset: 297, + key.offset: 271, key.length: 40, key.fully_annotated_decl: "subscript(index i: Float) -> Int { get }", key.entities: [ @@ -2020,7 +2008,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.var.local, key.keyword: "index", key.name: "i", - key.offset: 316, + key.offset: 290, key.length: 5 } ] @@ -2029,7 +2017,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.enum, key.name: "C1Cases", key.usr: "s:4cake2C1C0B5CasesO", - key.offset: 343, + key.offset: 317, key.length: 46, key.fully_annotated_decl: "enum C1Cases : Int", key.inherits: [ @@ -2044,7 +2032,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.enumelement, key.name: "case1", key.usr: "s:4cake2C1C0B5CasesO5case1yA2EmF", - key.offset: 373, + key.offset: 347, key.length: 10, key.fully_annotated_decl: "case case1" } @@ -2055,7 +2043,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.name: "extfoo()", key.usr: "s:4cake4ProtPAASi7ElementRtzrlE6extfooyyF::SYNTHESIZED::s:4cake2C1C", key.original_usr: "s:4cake4ProtPAASi7ElementRtzrlE6extfooyyF", - key.offset: 395, + key.offset: 369, key.length: 13, key.fully_annotated_decl: "func extfoo()" }, @@ -2064,7 +2052,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.name: "foo1()", key.usr: "s:4cake4ProtPAAE4foo1yyF::SYNTHESIZED::s:4cake2C1C", key.original_usr: "s:4cake4ProtPAAE4foo1yyF", - key.offset: 414, + key.offset: 388, key.length: 11, key.fully_annotated_decl: "func foo1()" }, @@ -2073,7 +2061,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.name: "subscript(_:)", key.usr: "s:4cake4ProtPAAEyS2icip::SYNTHESIZED::s:4cake2C1C", key.original_usr: "s:4cake4ProtPAAEyS2icip", - key.offset: 431, + key.offset: 405, key.length: 38, key.fully_annotated_decl: "subscript(index: Int) -> Int { get }", key.entities: [ @@ -2081,7 +2069,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "index", - key.offset: 450, + key.offset: 424, key.length: 3 } ] @@ -2091,7 +2079,7 @@ func shouldPrintAnyAsKeyword(x x: Any) { key.kind: source.lang.swift.decl.extension.class, key.doc.full_as_xml: "@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)\nextension C1some comments", - key.offset: 473, + key.offset: 447, key.length: 37, key.fully_annotated_decl: "extension C1", key.extends: { @@ -2104,7 +2092,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.function.method.instance, key.name: "addition()", key.usr: "s:4cake2C1C8additionyyF", - key.offset: 493, + key.offset: 467, key.length: 15, key.fully_annotated_decl: "func addition()" } @@ -2134,7 +2122,7 @@ func shouldPrintAnyAsKeyword(x x: Any) }, { key.kind: source.lang.swift.decl.extension.class, - key.offset: 512, + key.offset: 486, key.length: 109, key.fully_annotated_decl: "extension C1 : P4", key.conforms: [ @@ -2154,7 +2142,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.function.method.instance, key.name: "C1foo()", key.usr: "s:4cake2C1C5C1fooyyF", - key.offset: 542, + key.offset: 516, key.length: 12, key.fully_annotated_decl: "func C1foo()" }, @@ -2162,7 +2150,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.struct, key.name: "C1S1", key.usr: "s:4cake2C1C0B2S1V", - key.offset: 560, + key.offset: 534, key.length: 59, key.fully_annotated_decl: "struct C1S1", key.entities: [ @@ -2170,7 +2158,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.function.method.instance, key.name: "C1S1foo(a:)", key.usr: "s:4cake2C1C0B2S1V0B5S1foo1ayAA2P4_p_tF", - key.offset: 583, + key.offset: 557, key.length: 30, key.fully_annotated_decl: "func C1S1foo(a: any P4)", key.entities: [ @@ -2178,7 +2166,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.var.local, key.keyword: "a", key.name: "a", - key.offset: 601, + key.offset: 575, key.length: 11 } ] @@ -2189,7 +2177,7 @@ func shouldPrintAnyAsKeyword(x x: Any) }, { key.kind: source.lang.swift.decl.extension.enum, - key.offset: 623, + key.offset: 597, key.length: 197, key.fully_annotated_decl: "extension C1.C1Cases", key.extends: { @@ -2203,7 +2191,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.name: "hashValue", key.usr: "s:SYsSHRzSH8RawValueSYRpzrlE04hashB0Sivp::SYNTHESIZED::s:4cake2C1C0B5CasesO", key.original_usr: "s:SYsSHRzSH8RawValueSYRpzrlE04hashB0Sivp", - key.offset: 651, + key.offset: 625, key.length: 37, key.fully_annotated_decl: "@inlinable var hashValue: Int { get }" }, @@ -2212,7 +2200,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.name: "hash(into:)", key.usr: "s:SYsSHRzSH8RawValueSYRpzrlE4hash4intoys6HasherVz_tF::SYNTHESIZED::s:4cake2C1C0B5CasesO", key.original_usr: "s:SYsSHRzSH8RawValueSYRpzrlE4hash4intoys6HasherVz_tF", - key.offset: 694, + key.offset: 668, key.length: 47, key.fully_annotated_decl: "@inlinable func hash(into hasher: inout Hasher)", key.entities: [ @@ -2220,7 +2208,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.var.local, key.keyword: "into", key.name: "hasher", - key.offset: 734, + key.offset: 708, key.length: 6 } ] @@ -2231,7 +2219,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.usr: "s:SQsE2neoiySbx_xtFZ::SYNTHESIZED::s:4cake2C1C0B5CasesO", key.original_usr: "s:SQsE2neoiySbx_xtFZ", key.doc.full_as_xml: "!=(_:_:)s:SQsE2neoiySbx_xtFZ::SYNTHESIZED::s:4cake2C1C0B5CasesOstatic func != (lhs: cake.C1.C1Cases, rhs: cake.C1.C1Cases) -> BoolReturns a Boolean value indicating whether two values are not equal.lhsinA value to compare.rhsinAnother value to compare.Inequality is the inverse of equality. For any values a and b, a != b implies that a == b is false.This is the default implementation of the not-equal-to operator (!=) for any type that conforms to Equatable.", - key.offset: 747, + key.offset: 721, key.length: 71, key.fully_annotated_decl: "static func != (lhs: C1.C1Cases, rhs: C1.C1Cases) -> Bool", key.entities: [ @@ -2239,14 +2227,14 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "lhs", - key.offset: 770, + key.offset: 744, key.length: 15 }, { key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "rhs", - key.offset: 794, + key.offset: 768, key.length: 15 } ] @@ -2257,7 +2245,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.class, key.name: "C2", key.usr: "s:4cake2C2C", - key.offset: 822, + key.offset: 796, key.length: 40, key.fully_annotated_decl: "class C2 : C1", key.inherits: [ @@ -2272,7 +2260,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.function.method.instance, key.name: "C2foo()", key.usr: "s:4cake2C2C5C2fooyyF", - key.offset: 848, + key.offset: 822, key.length: 12, key.fully_annotated_decl: "func C2foo()" } @@ -2282,7 +2270,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.enum, key.name: "MyEnum", key.usr: "s:4cake6MyEnumO", - key.offset: 864, + key.offset: 838, key.length: 201, key.fully_annotated_decl: "enum MyEnum : Int", key.inherits: [ @@ -2297,7 +2285,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.enumelement, key.name: "Blah", key.usr: "s:4cake6MyEnumO4BlahyA2CmF", - key.offset: 889, + key.offset: 863, key.length: 9, key.fully_annotated_decl: "case Blah" }, @@ -2306,7 +2294,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.name: "hashValue", key.usr: "s:SYsSHRzSH8RawValueSYRpzrlE04hashB0Sivp::SYNTHESIZED::s:4cake6MyEnumO", key.original_usr: "s:SYsSHRzSH8RawValueSYRpzrlE04hashB0Sivp", - key.offset: 904, + key.offset: 878, key.length: 37, key.fully_annotated_decl: "@inlinable var hashValue: Int { get }" }, @@ -2315,7 +2303,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.name: "hash(into:)", key.usr: "s:SYsSHRzSH8RawValueSYRpzrlE4hash4intoys6HasherVz_tF::SYNTHESIZED::s:4cake6MyEnumO", key.original_usr: "s:SYsSHRzSH8RawValueSYRpzrlE4hash4intoys6HasherVz_tF", - key.offset: 947, + key.offset: 921, key.length: 47, key.fully_annotated_decl: "@inlinable func hash(into hasher: inout Hasher)", key.entities: [ @@ -2323,7 +2311,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.var.local, key.keyword: "into", key.name: "hasher", - key.offset: 987, + key.offset: 961, key.length: 6 } ] @@ -2334,7 +2322,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.usr: "s:SQsE2neoiySbx_xtFZ::SYNTHESIZED::s:4cake6MyEnumO", key.original_usr: "s:SQsE2neoiySbx_xtFZ", key.doc.full_as_xml: "!=(_:_:)s:SQsE2neoiySbx_xtFZ::SYNTHESIZED::s:4cake6MyEnumOstatic func != (lhs: cake.MyEnum, rhs: cake.MyEnum) -> BoolReturns a Boolean value indicating whether two values are not equal.lhsinA value to compare.rhsinAnother value to compare.Inequality is the inverse of equality. For any values a and b, a != b implies that a == b is false.This is the default implementation of the not-equal-to operator (!=) for any type that conforms to Equatable.", - key.offset: 1000, + key.offset: 974, key.length: 63, key.fully_annotated_decl: "static func != (lhs: MyEnum, rhs: MyEnum) -> Bool", key.entities: [ @@ -2342,14 +2330,14 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "lhs", - key.offset: 1023, + key.offset: 997, key.length: 11 }, { key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "rhs", - key.offset: 1043, + key.offset: 1017, key.length: 11 } ] @@ -2360,7 +2348,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.protocol, key.name: "P", key.usr: "s:4cake1PP", - key.offset: 1067, + key.offset: 1041, key.length: 30, key.fully_annotated_decl: "protocol P", key.entities: [ @@ -2368,7 +2356,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.function.method.instance, key.name: "foo()", key.usr: "s:4cake1PP3fooyyF", - key.offset: 1085, + key.offset: 1059, key.length: 10, key.fully_annotated_decl: "func foo()" } @@ -2376,7 +2364,7 @@ func shouldPrintAnyAsKeyword(x x: Any) }, { key.kind: source.lang.swift.decl.extension.protocol, - key.offset: 1099, + key.offset: 1073, key.length: 54, key.fully_annotated_decl: "extension P", key.extends: { @@ -2394,7 +2382,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.description: "Self : Equatable" } ], - key.offset: 1118, + key.offset: 1092, key.length: 33, key.fully_annotated_decl: "func bar() where Self : Equatable" } @@ -2404,7 +2392,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.protocol, key.name: "P2", key.usr: "c:@M@cake@objc(pl)P2", - key.offset: 1155, + key.offset: 1129, key.length: 53, key.fully_annotated_decl: "@objc protocol P2", key.entities: [ @@ -2412,7 +2400,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.function.method.instance, key.name: "foo1()", key.usr: "c:@M@cake@objc(pl)P2(im)foo1", - key.offset: 1180, + key.offset: 1154, key.length: 26, key.fully_annotated_decl: "@objc optional func foo1()", key.is_optional: 1 @@ -2423,7 +2411,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.protocol, key.name: "P3", key.usr: "s:4cake2P3P", - key.offset: 1210, + key.offset: 1184, key.length: 37, key.fully_annotated_decl: "protocol P3", key.entities: [ @@ -2431,7 +2419,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.associatedtype, key.name: "T", key.usr: "s:4cake2P3P1TQa", - key.offset: 1229, + key.offset: 1203, key.length: 16, key.fully_annotated_decl: "associatedtype T" } @@ -2441,7 +2429,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.protocol, key.name: "P4", key.usr: "s:4cake2P4P", - key.offset: 1249, + key.offset: 1223, key.length: 15, key.fully_annotated_decl: "protocol P4" }, @@ -2449,7 +2437,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.protocol, key.name: "P5", key.usr: "s:4cake2P5P", - key.offset: 1266, + key.offset: 1240, key.length: 43, key.fully_annotated_decl: "protocol P5", key.entities: [ @@ -2457,7 +2445,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.associatedtype, key.name: "Element", key.usr: "s:4cake2P5P7ElementQa", - key.offset: 1285, + key.offset: 1259, key.length: 22, key.fully_annotated_decl: "associatedtype Element" } @@ -2467,7 +2455,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.protocol, key.name: "P6", key.usr: "s:4cake2P6P", - key.offset: 1311, + key.offset: 1285, key.length: 25, key.fully_annotated_decl: "protocol P6 : P5", key.conforms: [ @@ -2480,7 +2468,7 @@ func shouldPrintAnyAsKeyword(x x: Any) }, { key.kind: source.lang.swift.decl.extension.protocol, - key.offset: 1338, + key.offset: 1312, key.length: 53, key.fully_annotated_decl: "extension P6", key.extends: { @@ -2493,7 +2481,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.var.instance, key.name: "null", key.usr: "s:4cake2P6PAAE4null7ElementQzSgvp", - key.offset: 1358, + key.offset: 1332, key.length: 31, key.fully_annotated_decl: "var null: Self.Element? { get }" } @@ -2503,7 +2491,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.protocol, key.name: "Prot", key.usr: "s:4cake4ProtP", - key.offset: 1393, + key.offset: 1367, key.length: 102, key.fully_annotated_decl: "protocol Prot", key.entities: [ @@ -2511,7 +2499,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.associatedtype, key.name: "Element", key.usr: "s:4cake4ProtP7ElementQa", - key.offset: 1414, + key.offset: 1388, key.length: 22, key.fully_annotated_decl: "associatedtype Element" }, @@ -2519,7 +2507,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.var.instance, key.name: "p", key.usr: "s:4cake4ProtP1pSivp", - key.offset: 1442, + key.offset: 1416, key.length: 18, key.fully_annotated_decl: "var p: Int { get }" }, @@ -2527,7 +2515,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.function.method.instance, key.name: "foo()", key.usr: "s:4cake4ProtP3fooyyF", - key.offset: 1466, + key.offset: 1440, key.length: 10, key.fully_annotated_decl: "func foo()" }, @@ -2535,7 +2523,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.function.method.instance, key.name: "foo1()", key.usr: "s:4cake4ProtP4foo1yyF", - key.offset: 1482, + key.offset: 1456, key.length: 11, key.fully_annotated_decl: "func foo1()" } @@ -2543,7 +2531,7 @@ func shouldPrintAnyAsKeyword(x x: Any) }, { key.kind: source.lang.swift.decl.extension.protocol, - key.offset: 1497, + key.offset: 1471, key.length: 79, key.fully_annotated_decl: "extension Prot", key.extends: { @@ -2557,7 +2545,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.name: "foo1()", key.usr: "s:4cake4ProtPAAE4foo1yyF", key.default_implementation_of: "s:4cake4ProtP4foo1yyF", - key.offset: 1519, + key.offset: 1493, key.length: 11, key.fully_annotated_decl: "func foo1()" }, @@ -2565,7 +2553,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.function.subscript, key.name: "subscript(_:)", key.usr: "s:4cake4ProtPAAEyS2icip", - key.offset: 1536, + key.offset: 1510, key.length: 38, key.fully_annotated_decl: "subscript(index: Int) -> Int { get }", key.entities: [ @@ -2573,7 +2561,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "index", - key.offset: 1555, + key.offset: 1529, key.length: 3 } ] @@ -2587,7 +2575,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.description: "Self.Element == Int" } ], - key.offset: 1578, + key.offset: 1552, key.length: 63, key.fully_annotated_decl: "extension Prot where Self.Element == Int", key.extends: { @@ -2600,7 +2588,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.function.method.instance, key.name: "extfoo()", key.usr: "s:4cake4ProtPAASi7ElementRtzrlE6extfooyyF", - key.offset: 1626, + key.offset: 1600, key.length: 13, key.fully_annotated_decl: "func extfoo()" } @@ -2610,7 +2598,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.struct, key.name: "S1", key.usr: "s:4cake2S1V", - key.offset: 1643, + key.offset: 1617, key.length: 142, key.fully_annotated_decl: "struct S1", key.entities: [ @@ -2618,7 +2606,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.enum, key.name: "SE", key.usr: "s:4cake2S1V2SEO", - key.offset: 1660, + key.offset: 1634, key.length: 63, key.fully_annotated_decl: "enum S1.SE", key.entities: [ @@ -2626,7 +2614,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.enumelement, key.name: "a", key.usr: "s:4cake2S1V2SEO1ayA2EmF", - key.offset: 1679, + key.offset: 1653, key.length: 6, key.fully_annotated_decl: "case a" }, @@ -2634,7 +2622,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.enumelement, key.name: "b", key.usr: "s:4cake2S1V2SEO1byA2EmF", - key.offset: 1695, + key.offset: 1669, key.length: 6, key.fully_annotated_decl: "case b" }, @@ -2642,7 +2630,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.enumelement, key.name: "c", key.usr: "s:4cake2S1V2SEO1cyA2EmF", - key.offset: 1711, + key.offset: 1685, key.length: 6, key.fully_annotated_decl: "case c" } @@ -2652,7 +2640,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.function.method.instance, key.name: "foo1()", key.usr: "s:4cake2S1V4foo1yyF", - key.offset: 1729, + key.offset: 1703, key.length: 11, key.fully_annotated_decl: "func foo1()" }, @@ -2660,7 +2648,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.struct, key.name: "S2", key.usr: "s:4cake2S1V2S2V", - key.offset: 1746, + key.offset: 1720, key.length: 37, key.fully_annotated_decl: "struct S2", key.entities: [ @@ -2668,7 +2656,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.var.instance, key.name: "b", key.usr: "s:4cake2S1V2S2V1bSivp", - key.offset: 1767, + key.offset: 1741, key.length: 10, key.fully_annotated_decl: "let b: Int" } @@ -2678,7 +2666,7 @@ func shouldPrintAnyAsKeyword(x x: Any) }, { key.kind: source.lang.swift.decl.extension.enum, - key.offset: 1787, + key.offset: 1761, key.length: 86, key.fully_annotated_decl: "extension S1.SE", key.extends: { @@ -2693,7 +2681,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.usr: "s:SQsE2neoiySbx_xtFZ::SYNTHESIZED::s:4cake2S1V2SEO", key.original_usr: "s:SQsE2neoiySbx_xtFZ", key.doc.full_as_xml: "!=(_:_:)s:SQsE2neoiySbx_xtFZ::SYNTHESIZED::s:4cake2S1V2SEOstatic func != (lhs: cake.S1.SE, rhs: cake.S1.SE) -> BoolReturns a Boolean value indicating whether two values are not equal.lhsinA value to compare.rhsinAnother value to compare.Inequality is the inverse of equality. For any values a and b, a != b implies that a == b is false.This is the default implementation of the not-equal-to operator (!=) for any type that conforms to Equatable.", - key.offset: 1810, + key.offset: 1784, key.length: 61, key.fully_annotated_decl: "static func != (lhs: S1.SE, rhs: S1.SE) -> Bool", key.entities: [ @@ -2701,14 +2689,14 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "lhs", - key.offset: 1833, + key.offset: 1807, key.length: 10 }, { key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "rhs", - key.offset: 1852, + key.offset: 1826, key.length: 10 } ] @@ -2719,7 +2707,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.struct, key.name: "S2", key.usr: "s:4cake2S2V", - key.offset: 1875, + key.offset: 1849, key.length: 50, key.fully_annotated_decl: "struct S2 : P3", key.conforms: [ @@ -2734,7 +2722,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.typealias, key.name: "T", key.usr: "s:4cake2S2V1Ta", - key.offset: 1902, + key.offset: 1876, key.length: 21, key.fully_annotated_decl: "typealias S2.T = S2", key.conforms: [ @@ -2761,7 +2749,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.description: "Wrapped : P5" } ], - key.offset: 1927, + key.offset: 1901, key.length: 97, key.fully_annotated_decl: "struct S3<Wrapped> : P5 where Wrapped : P5", key.conforms: [ @@ -2776,7 +2764,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.typealias, key.name: "Element", key.usr: "s:4cake2S3V7Elementa", - key.offset: 1987, + key.offset: 1961, key.length: 35, key.fully_annotated_decl: "typealias S3<Wrapped>.Element = Wrapped.Element", key.conforms: [ @@ -2801,7 +2789,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.description: "Wrapped : P6" } ], - key.offset: 2026, + key.offset: 2000, key.length: 80, key.fully_annotated_decl: "extension S3 where Wrapped : P6", key.extends: { @@ -2815,7 +2803,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.name: "null", key.usr: "s:4cake2P6PAAE4null7ElementQzSgvp::SYNTHESIZED::s:4cake2S3V", key.original_usr: "s:4cake2P6PAAE4null7ElementQzSgvp", - key.offset: 2070, + key.offset: 2044, key.length: 34, key.fully_annotated_decl: "var null: Wrapped.Element? { get }" } @@ -2844,7 +2832,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.description: "T1.Element == Int" } ], - key.offset: 2108, + key.offset: 2082, key.length: 93, key.fully_annotated_decl: "func genfoo<T1, T2>(x ix: T1, y iy: T2) where T1 : Prot, T2 : C1, T1.Element == Int", key.entities: [ @@ -2852,14 +2840,14 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.var.local, key.keyword: "x", key.name: "ix", - key.offset: 2134, + key.offset: 2108, key.length: 2 }, { key.kind: source.lang.swift.decl.var.local, key.keyword: "y", key.name: "iy", - key.offset: 2144, + key.offset: 2118, key.length: 2 } ] @@ -2868,7 +2856,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.function.free, key.name: "shouldPrintAnyAsKeyword(x:)", key.usr: "s:4cake23shouldPrintAnyAsKeyword1xyyp_tF", - key.offset: 2203, + key.offset: 2177, key.length: 38, key.fully_annotated_decl: "func shouldPrintAnyAsKeyword(x: Any)", key.entities: [ @@ -2876,7 +2864,7 @@ func shouldPrintAnyAsKeyword(x x: Any) key.kind: source.lang.swift.decl.var.local, key.keyword: "x", key.name: "x", - key.offset: 2237, + key.offset: 2211, key.length: 3 } ] diff --git a/test/SourceKit/DocSupport/doc_swift_module1.swift.response b/test/SourceKit/DocSupport/doc_swift_module1.swift.response index 0725bd006d587..b625b63f45370 100644 --- a/test/SourceKit/DocSupport/doc_swift_module1.swift.response +++ b/test/SourceKit/DocSupport/doc_swift_module1.swift.response @@ -1,5 +1,3 @@ -import SwiftOnoneSupport - class InitClassImpl : cake1.InitProto { required init(x x: Int) @@ -80,610 +78,600 @@ extension Dictionary.Keys where Key : cake1.P1 { { key.kind: source.lang.swift.syntaxtype.keyword, key.offset: 0, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7, - key.length: 17 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 26, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 32, + key.offset: 6, key.length: 13 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 48, + key.offset: 22, key.length: 5 }, { key.kind: source.lang.swift.ref.protocol, key.name: "InitProto", key.usr: "s:5cake19InitProtoP", - key.offset: 54, + key.offset: 28, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 71, + key.offset: 45, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 80, + key.offset: 54, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 85, + key.offset: 59, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 87, + key.offset: 61, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 90, + key.offset: 64, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 100, + key.offset: 74, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 112, + key.offset: 86, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 122, + key.offset: 96, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 131, + key.offset: 105, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 148, + key.offset: 122, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 153, + key.offset: 127, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 155, + key.offset: 129, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 158, + key.offset: 132, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 166, + key.offset: 140, key.length: 9 }, { key.kind: source.lang.swift.ref.protocol, key.name: "InitProto", key.usr: "s:5cake19InitProtoP", - key.offset: 176, + key.offset: 150, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 193, + key.offset: 167, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 203, + key.offset: 177, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 210, + key.offset: 184, key.length: 14 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 227, + key.offset: 201, key.length: 5 }, { key.kind: source.lang.swift.ref.protocol, key.name: "InitProto", key.usr: "s:5cake19InitProtoP", - key.offset: 233, + key.offset: 207, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 250, + key.offset: 224, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 255, + key.offset: 229, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 257, + key.offset: 231, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 260, + key.offset: 234, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 270, + key.offset: 244, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 280, + key.offset: 254, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 289, + key.offset: 263, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 299, + key.offset: 273, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 304, + key.offset: 278, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 316, + key.offset: 290, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 320, + key.offset: 294, key.length: 3 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 325, + key.offset: 299, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 331, + key.offset: 305, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 335, + key.offset: 309, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 346, + key.offset: 320, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 351, + key.offset: 325, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 356, + key.offset: 330, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 358, + key.offset: 332, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 361, + key.offset: 335, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 366, + key.offset: 340, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 368, + key.offset: 342, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 371, + key.offset: 345, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 381, + key.offset: 355, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 391, + key.offset: 365, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 393, + key.offset: 367, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 396, + key.offset: 370, key.length: 3 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 404, + key.offset: 378, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 410, + key.offset: 384, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 414, + key.offset: 388, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 425, + key.offset: 399, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 430, + key.offset: 404, key.length: 13 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 449, + key.offset: 423, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 458, + key.offset: 432, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 463, + key.offset: 437, key.length: 5 }, { key.kind: source.lang.swift.ref.protocol, key.name: "P1", key.usr: "s:5cake12P1P", - key.offset: 469, + key.offset: 443, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 479, + key.offset: 453, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 484, + key.offset: 458, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 496, + key.offset: 470, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 501, + key.offset: 475, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 511, + key.offset: 485, key.length: 9 }, { key.kind: source.lang.swift.ref.protocol, key.name: "P2", key.usr: "s:5cake12P2P", - key.offset: 521, + key.offset: 495, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 531, + key.offset: 505, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 536, + key.offset: 510, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 548, + key.offset: 522, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 552, + key.offset: 526, key.length: 3 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 557, + key.offset: 531, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 566, + key.offset: 540, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 571, + key.offset: 545, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 576, + key.offset: 550, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 578, + key.offset: 552, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 581, + key.offset: 555, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 586, + key.offset: 560, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 588, + key.offset: 562, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 591, + key.offset: 565, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 601, + key.offset: 575, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 611, + key.offset: 585, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 613, + key.offset: 587, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 616, + key.offset: 590, key.length: 3 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 624, + key.offset: 598, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 631, + key.offset: 605, key.length: 9 }, { key.kind: source.lang.swift.ref.protocol, key.name: "P2", key.usr: "s:5cake12P2P", - key.offset: 641, + key.offset: 615, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 644, + key.offset: 618, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Self", key.usr: "s:5cake12P2P4Selfxmfp", - key.offset: 650, + key.offset: 624, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 657, + key.offset: 631, key.length: 5 }, { key.kind: source.lang.swift.ref.protocol, key.name: "P3", key.usr: "s:5cake12P3P", - key.offset: 663, + key.offset: 637, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 673, + key.offset: 647, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 678, + key.offset: 652, key.length: 13 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 697, + key.offset: 671, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 706, + key.offset: 680, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 716, + key.offset: 690, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 721, + key.offset: 695, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 737, + key.offset: 711, key.length: 9 }, { key.kind: source.lang.swift.ref.struct, key.name: "Dictionary", key.usr: "s:SD", - key.offset: 747, + key.offset: 721, key.length: 10 }, { key.kind: source.lang.swift.ref.struct, key.name: "Keys", key.usr: "s:SD4KeysV", - key.offset: 758, + key.offset: 732, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 770, + key.offset: 744, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 775, + key.offset: 749, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 784, + key.offset: 758, key.length: 9 }, { key.kind: source.lang.swift.ref.struct, key.name: "Dictionary", key.usr: "s:SD", - key.offset: 794, + key.offset: 768, key.length: 10 }, { key.kind: source.lang.swift.ref.struct, key.name: "Keys", key.usr: "s:SD4KeysV", - key.offset: 805, + key.offset: 779, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 810, + key.offset: 784, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Key", key.usr: "s:SD3Keyxmfp", - key.offset: 816, + key.offset: 790, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 822, + key.offset: 796, key.length: 5 }, { key.kind: source.lang.swift.ref.protocol, key.name: "P1", key.usr: "s:5cake12P1P", - key.offset: 828, + key.offset: 802, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 838, + key.offset: 812, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 843, + key.offset: 817, key.length: 3 } ] @@ -692,7 +680,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.class, key.name: "InitClassImpl", key.usr: "s:5cake113InitClassImplC", - key.offset: 26, + key.offset: 0, key.length: 94, key.fully_annotated_decl: "class InitClassImpl : InitProto", key.conforms: [ @@ -707,7 +695,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.function.constructor, key.name: "init(x:)", key.usr: "s:5cake113InitClassImplC1xACSi_tcfc", - key.offset: 71, + key.offset: 45, key.length: 23, key.fully_annotated_decl: "required init(x: Int)", key.conforms: [ @@ -722,7 +710,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "x", key.name: "x", - key.offset: 90, + key.offset: 64, key.length: 3 } ] @@ -732,7 +720,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.name: "init()", key.usr: "s:5cake19InitProtoPAAExycfc::SYNTHESIZED::s:5cake113InitClassImplC", key.original_usr: "s:5cake19InitProtoPAAExycfc", - key.offset: 100, + key.offset: 74, key.length: 18, key.fully_annotated_decl: "convenience init()" } @@ -742,7 +730,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.protocol, key.name: "InitProto", key.usr: "s:5cake19InitProtoP", - key.offset: 122, + key.offset: 96, key.length: 42, key.fully_annotated_decl: "protocol InitProto", key.entities: [ @@ -750,7 +738,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.function.constructor, key.name: "init(x:)", key.usr: "s:5cake19InitProtoP1xxSi_tcfc", - key.offset: 148, + key.offset: 122, key.length: 14, key.fully_annotated_decl: "init(x: Int)", key.entities: [ @@ -758,7 +746,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "x", key.name: "x", - key.offset: 158, + key.offset: 132, key.length: 3 } ] @@ -767,7 +755,7 @@ extension Dictionary.Keys where Key : cake1.P1 { }, { key.kind: source.lang.swift.decl.extension.protocol, - key.offset: 166, + key.offset: 140, key.length: 35, key.fully_annotated_decl: "extension InitProto", key.extends: { @@ -780,7 +768,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.function.constructor, key.name: "init()", key.usr: "s:5cake19InitProtoPAAExycfc", - key.offset: 193, + key.offset: 167, key.length: 6, key.fully_annotated_decl: "init()" } @@ -790,7 +778,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.struct, key.name: "InitStructImpl", key.usr: "s:5cake114InitStructImplV", - key.offset: 203, + key.offset: 177, key.length: 75, key.fully_annotated_decl: "struct InitStructImpl : InitProto", key.conforms: [ @@ -805,7 +793,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.function.constructor, key.name: "init(x:)", key.usr: "s:5cake114InitStructImplV1xACSi_tcfc", - key.offset: 250, + key.offset: 224, key.length: 14, key.fully_annotated_decl: "init(x: Int)", key.conforms: [ @@ -820,7 +808,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "x", key.name: "x", - key.offset: 260, + key.offset: 234, key.length: 3 } ] @@ -830,7 +818,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.name: "init()", key.usr: "s:5cake19InitProtoPAAExycfc::SYNTHESIZED::s:5cake114InitStructImplV", key.original_usr: "s:5cake19InitProtoPAAExycfc", - key.offset: 270, + key.offset: 244, key.length: 6, key.fully_annotated_decl: "init()" } @@ -840,7 +828,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.protocol, key.name: "P1", key.usr: "s:5cake12P1P", - key.offset: 280, + key.offset: 254, key.length: 167, key.fully_annotated_decl: "protocol P1", key.entities: [ @@ -848,7 +836,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.function.method.instance, key.name: "foo1()", key.usr: "s:5cake12P1P4foo1yyF", - key.offset: 299, + key.offset: 273, key.length: 11, key.fully_annotated_decl: "func foo1()" }, @@ -856,7 +844,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.var.instance, key.name: "Ins", key.usr: "s:5cake12P1P3InsSivp", - key.offset: 316, + key.offset: 290, key.length: 24, key.fully_annotated_decl: "var Ins: Int { get set }" }, @@ -864,7 +852,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.function.method.instance, key.name: "foo2(a:b:)", key.usr: "s:5cake12P1P4foo21a1bySi_SitF", - key.offset: 346, + key.offset: 320, key.length: 29, key.fully_annotated_decl: "func foo2(a: Int, b: Int)", key.entities: [ @@ -872,14 +860,14 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "a", key.name: "a", - key.offset: 361, + key.offset: 335, key.length: 3 }, { key.kind: source.lang.swift.decl.var.local, key.keyword: "b", key.name: "b", - key.offset: 371, + key.offset: 345, key.length: 3 } ] @@ -888,7 +876,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.function.subscript, key.name: "subscript(_:)", key.usr: "s:5cake12P1PyS2icip", - key.offset: 381, + key.offset: 355, key.length: 38, key.fully_annotated_decl: "subscript(a: Int) -> Int { get set }", key.entities: [ @@ -896,7 +884,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "a", - key.offset: 396, + key.offset: 370, key.length: 3 } ] @@ -905,7 +893,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.function.method.instance, key.name: "fooConstraint()", key.usr: "s:5cake12P1P13fooConstraintyyF", - key.offset: 425, + key.offset: 399, key.length: 20, key.fully_annotated_decl: "func fooConstraint()" } @@ -915,7 +903,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.protocol, key.name: "P2", key.usr: "s:5cake12P2P", - key.offset: 449, + key.offset: 423, key.length: 60, key.fully_annotated_decl: "protocol P2 : P1", key.conforms: [ @@ -930,7 +918,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.function.method.instance, key.name: "bar1()", key.usr: "s:5cake12P2P4bar1yyF", - key.offset: 479, + key.offset: 453, key.length: 11, key.fully_annotated_decl: "func bar1()" }, @@ -938,7 +926,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.function.method.instance, key.name: "bar2()", key.usr: "s:5cake12P2P4bar2yyF", - key.offset: 496, + key.offset: 470, key.length: 11, key.fully_annotated_decl: "func bar2()" } @@ -946,7 +934,7 @@ extension Dictionary.Keys where Key : cake1.P1 { }, { key.kind: source.lang.swift.decl.extension.protocol, - key.offset: 511, + key.offset: 485, key.length: 118, key.fully_annotated_decl: "extension P2", key.extends: { @@ -960,7 +948,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.name: "foo1()", key.usr: "s:5cake12P2PAAE4foo1yyF", key.default_implementation_of: "s:5cake12P1P4foo1yyF", - key.offset: 531, + key.offset: 505, key.length: 11, key.fully_annotated_decl: "func foo1()" }, @@ -969,7 +957,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.name: "Ins", key.usr: "s:5cake12P2PAAE3InsSivp", key.default_implementation_of: "s:5cake12P1P3InsSivp", - key.offset: 548, + key.offset: 522, key.length: 12, key.fully_annotated_decl: "var Ins: Int { get set }" }, @@ -978,7 +966,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.name: "foo2(a:b:)", key.usr: "s:5cake12P2PAAE4foo21a1bySi_SitF", key.default_implementation_of: "s:5cake12P1P4foo21a1bySi_SitF", - key.offset: 566, + key.offset: 540, key.length: 29, key.fully_annotated_decl: "func foo2(a: Int, b: Int)", key.entities: [ @@ -986,14 +974,14 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "a", key.name: "a", - key.offset: 581, + key.offset: 555, key.length: 3 }, { key.kind: source.lang.swift.decl.var.local, key.keyword: "b", key.name: "b", - key.offset: 591, + key.offset: 565, key.length: 3 } ] @@ -1003,7 +991,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.name: "subscript(_:)", key.usr: "s:5cake12P2PAAEyS2icip", key.default_implementation_of: "s:5cake12P1PyS2icip", - key.offset: 601, + key.offset: 575, key.length: 26, key.fully_annotated_decl: "subscript(a: Int) -> Int { get set }", key.entities: [ @@ -1011,7 +999,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "a", - key.offset: 616, + key.offset: 590, key.length: 3 } ] @@ -1025,7 +1013,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.description: "Self : P3" } ], - key.offset: 631, + key.offset: 605, key.length: 64, key.fully_annotated_decl: "extension P2 where Self : P3", key.extends: { @@ -1039,7 +1027,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.name: "fooConstraint()", key.usr: "s:5cake12P2PA2A2P3RzrlE13fooConstraintyyF", key.default_implementation_of: "s:5cake12P1P13fooConstraintyyF", - key.offset: 673, + key.offset: 647, key.length: 20, key.fully_annotated_decl: "func fooConstraint()" } @@ -1049,7 +1037,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.protocol, key.name: "P3", key.usr: "s:5cake12P3P", - key.offset: 697, + key.offset: 671, key.length: 38, key.fully_annotated_decl: "protocol P3", key.entities: [ @@ -1057,7 +1045,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.function.method.instance, key.name: "p3Required()", key.usr: "s:5cake12P3P10p3RequiredyyF", - key.offset: 716, + key.offset: 690, key.length: 17, key.fully_annotated_decl: "func p3Required()" } @@ -1078,7 +1066,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.description: "Key : Hashable" } ], - key.offset: 737, + key.offset: 711, key.length: 45, key.fully_annotated_decl: "extension Dictionary.Keys", key.extends: { @@ -1091,7 +1079,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.function.method.instance, key.name: "foo()", key.usr: "s:SD4KeysV5cake1E3fooyyF", - key.offset: 770, + key.offset: 744, key.length: 10, key.fully_annotated_decl: "func foo()" } @@ -1115,7 +1103,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.description: "Key : P1" } ], - key.offset: 784, + key.offset: 758, key.length: 66, key.fully_annotated_decl: "extension Dictionary.Keys where Key : P1", key.extends: { @@ -1128,7 +1116,7 @@ extension Dictionary.Keys where Key : cake1.P1 { key.kind: source.lang.swift.decl.function.method.instance, key.name: "bar()", key.usr: "s:SD4KeysV5cake1AC2P1RzrlE3baryyF", - key.offset: 838, + key.offset: 812, key.length: 10, key.fully_annotated_decl: "func bar()" } diff --git a/test/SourceKit/DocSupport/doc_swift_module_class_extension.swift.response b/test/SourceKit/DocSupport/doc_swift_module_class_extension.swift.response index add34c8e2d52e..b7e0a30aa9daf 100644 --- a/test/SourceKit/DocSupport/doc_swift_module_class_extension.swift.response +++ b/test/SourceKit/DocSupport/doc_swift_module_class_extension.swift.response @@ -1,5 +1,3 @@ -import SwiftOnoneSupport - class C { } @@ -52,371 +50,361 @@ extension P8 where Self.T : module_with_class_extension.E { { key.kind: source.lang.swift.syntaxtype.keyword, key.offset: 0, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7, - key.length: 17 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 26, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 32, + key.offset: 6, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 34, + key.offset: 8, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 42, + key.offset: 16, key.length: 9 }, { key.kind: source.lang.swift.ref.class, key.name: "C", key.usr: "s:27module_with_class_extension1CC", - key.offset: 52, + key.offset: 26, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 56, + key.offset: 30, key.length: 27 }, { key.kind: source.lang.swift.ref.protocol, key.name: "P8", key.usr: "s:27module_with_class_extension2P8P", - key.offset: 84, + key.offset: 58, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 92, + key.offset: 66, key.length: 9 }, { key.kind: source.lang.swift.ref.class, key.name: "C", key.usr: "s:27module_with_class_extension1CC", - key.offset: 102, + key.offset: 76, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 104, + key.offset: 78, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "T", key.usr: "s:27module_with_class_extension1CC1Txmfp", - key.offset: 110, + key.offset: 84, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 114, + key.offset: 88, key.length: 27 }, { key.kind: source.lang.swift.ref.class, key.name: "D", key.usr: "s:27module_with_class_extension1DC", - key.offset: 142, + key.offset: 116, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 151, + key.offset: 125, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 156, + key.offset: 130, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 167, + key.offset: 141, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 172, + key.offset: 146, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 181, + key.offset: 155, key.length: 9 }, { key.kind: source.lang.swift.ref.class, key.name: "C", key.usr: "s:27module_with_class_extension1CC", - key.offset: 191, + key.offset: 165, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 193, + key.offset: 167, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "T", key.usr: "s:27module_with_class_extension1CC1Txmfp", - key.offset: 199, + key.offset: 173, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 203, + key.offset: 177, key.length: 27 }, { key.kind: source.lang.swift.ref.class, key.name: "E", key.usr: "s:27module_with_class_extension1EC", - key.offset: 231, + key.offset: 205, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 240, + key.offset: 214, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 245, + key.offset: 219, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 254, + key.offset: 228, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 260, + key.offset: 234, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 267, + key.offset: 241, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 273, + key.offset: 247, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 280, + key.offset: 254, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 286, + key.offset: 260, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 288, + key.offset: 262, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 291, + key.offset: 265, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "T", key.usr: "s:27module_with_class_extension1FC1Txmfp", - key.offset: 297, + key.offset: 271, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 301, + key.offset: 275, key.length: 27 }, { key.kind: source.lang.swift.ref.class, key.name: "D", key.usr: "s:27module_with_class_extension1DC", - key.offset: 329, + key.offset: 303, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 338, + key.offset: 312, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 343, + key.offset: 317, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 352, + key.offset: 326, key.length: 9 }, { key.kind: source.lang.swift.ref.class, key.name: "F", key.usr: "s:27module_with_class_extension1FC", - key.offset: 362, + key.offset: 336, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 366, + key.offset: 340, key.length: 27 }, { key.kind: source.lang.swift.ref.protocol, key.name: "P8", key.usr: "s:27module_with_class_extension2P8P", - key.offset: 394, + key.offset: 368, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 402, + key.offset: 376, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 411, + key.offset: 385, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 421, + key.offset: 395, key.length: 14 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 436, + key.offset: 410, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 441, + key.offset: 415, key.length: 9 }, { key.kind: source.lang.swift.ref.protocol, key.name: "P8", key.usr: "s:27module_with_class_extension2P8P", - key.offset: 451, + key.offset: 425, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 454, + key.offset: 428, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Self", key.usr: "s:27module_with_class_extension2P8P4Selfxmfp", - key.offset: 460, + key.offset: 434, key.length: 4 }, { key.kind: source.lang.swift.ref.associatedtype, key.name: "T", key.usr: "s:27module_with_class_extension2P8P1TQa", - key.offset: 465, + key.offset: 439, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 469, + key.offset: 443, key.length: 27 }, { key.kind: source.lang.swift.ref.class, key.name: "D", key.usr: "s:27module_with_class_extension1DC", - key.offset: 497, + key.offset: 471, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 506, + key.offset: 480, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 511, + key.offset: 485, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 520, + key.offset: 494, key.length: 9 }, { key.kind: source.lang.swift.ref.protocol, key.name: "P8", key.usr: "s:27module_with_class_extension2P8P", - key.offset: 530, + key.offset: 504, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 533, + key.offset: 507, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Self", key.usr: "s:27module_with_class_extension2P8P4Selfxmfp", - key.offset: 539, + key.offset: 513, key.length: 4 }, { key.kind: source.lang.swift.ref.associatedtype, key.name: "T", key.usr: "s:27module_with_class_extension2P8P1TQa", - key.offset: 544, + key.offset: 518, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 548, + key.offset: 522, key.length: 27 }, { key.kind: source.lang.swift.ref.class, key.name: "E", key.usr: "s:27module_with_class_extension1EC", - key.offset: 576, + key.offset: 550, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 585, + key.offset: 559, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 590, + key.offset: 564, key.length: 3 } ] @@ -430,7 +418,7 @@ extension P8 where Self.T : module_with_class_extension.E { key.name: "T" } ], - key.offset: 26, + key.offset: 0, key.length: 14, key.fully_annotated_decl: "class C<T>" }, @@ -441,7 +429,7 @@ extension P8 where Self.T : module_with_class_extension.E { key.name: "T" } ], - key.offset: 42, + key.offset: 16, key.length: 48, key.fully_annotated_decl: "extension C : P8", key.conforms: [ @@ -469,7 +457,7 @@ extension P8 where Self.T : module_with_class_extension.E { key.description: "T : D" } ], - key.offset: 92, + key.offset: 66, key.length: 87, key.fully_annotated_decl: "extension C where T : D", key.extends: { @@ -482,7 +470,7 @@ extension P8 where Self.T : module_with_class_extension.E { key.kind: source.lang.swift.decl.function.method.instance, key.name: "foo()", key.usr: "s:27module_with_class_extension1CCA2A1DCRbzlE3fooyyF", - key.offset: 151, + key.offset: 125, key.length: 10, key.fully_annotated_decl: "func foo()" }, @@ -491,7 +479,7 @@ extension P8 where Self.T : module_with_class_extension.E { key.name: "bar()", key.usr: "s:27module_with_class_extension2P8PA2A1DC1TRczrlE3baryyF::SYNTHESIZED::s:27module_with_class_extension1CC", key.original_usr: "s:27module_with_class_extension2P8PA2A1DC1TRczrlE3baryyF", - key.offset: 167, + key.offset: 141, key.length: 10, key.fully_annotated_decl: "func bar()" } @@ -504,7 +492,7 @@ extension P8 where Self.T : module_with_class_extension.E { key.description: "T : E" } ], - key.offset: 181, + key.offset: 155, key.length: 71, key.fully_annotated_decl: "extension C where T : E", key.extends: { @@ -518,7 +506,7 @@ extension P8 where Self.T : module_with_class_extension.E { key.name: "baz()", key.usr: "s:27module_with_class_extension2P8PA2A1EC1TRczrlE3bazyyF::SYNTHESIZED::s:27module_with_class_extension1CC", key.original_usr: "s:27module_with_class_extension2P8PA2A1EC1TRczrlE3bazyyF", - key.offset: 240, + key.offset: 214, key.length: 10, key.fully_annotated_decl: "func baz()" } @@ -528,7 +516,7 @@ extension P8 where Self.T : module_with_class_extension.E { key.kind: source.lang.swift.decl.class, key.name: "D", key.usr: "s:27module_with_class_extension1DC", - key.offset: 254, + key.offset: 228, key.length: 11, key.fully_annotated_decl: "class D" }, @@ -536,7 +524,7 @@ extension P8 where Self.T : module_with_class_extension.E { key.kind: source.lang.swift.decl.class, key.name: "E", key.usr: "s:27module_with_class_extension1EC", - key.offset: 267, + key.offset: 241, key.length: 11, key.fully_annotated_decl: "class E" }, @@ -554,7 +542,7 @@ extension P8 where Self.T : module_with_class_extension.E { key.description: "T : D" } ], - key.offset: 280, + key.offset: 254, key.length: 70, key.fully_annotated_decl: "class F<T> where T : D", key.entities: [ @@ -563,7 +551,7 @@ extension P8 where Self.T : module_with_class_extension.E { key.name: "bar()", key.usr: "s:27module_with_class_extension2P8PA2A1DC1TRczrlE3baryyF::SYNTHESIZED::s:27module_with_class_extension1FC", key.original_usr: "s:27module_with_class_extension2P8PA2A1DC1TRczrlE3baryyF", - key.offset: 338, + key.offset: 312, key.length: 10, key.fully_annotated_decl: "func bar()" } @@ -581,7 +569,7 @@ extension P8 where Self.T : module_with_class_extension.E { key.description: "T : D" } ], - key.offset: 352, + key.offset: 326, key.length: 48, key.fully_annotated_decl: "extension F : P8", key.conforms: [ @@ -601,7 +589,7 @@ extension P8 where Self.T : module_with_class_extension.E { key.kind: source.lang.swift.decl.protocol, key.name: "P8", key.usr: "s:27module_with_class_extension2P8P", - key.offset: 402, + key.offset: 376, key.length: 37, key.fully_annotated_decl: "protocol P8", key.entities: [ @@ -609,7 +597,7 @@ extension P8 where Self.T : module_with_class_extension.E { key.kind: source.lang.swift.decl.associatedtype, key.name: "T", key.usr: "s:27module_with_class_extension2P8P1TQa", - key.offset: 421, + key.offset: 395, key.length: 16, key.fully_annotated_decl: "associatedtype T" } @@ -622,7 +610,7 @@ extension P8 where Self.T : module_with_class_extension.E { key.description: "Self.T : D" } ], - key.offset: 441, + key.offset: 415, key.length: 77, key.fully_annotated_decl: "extension P8 where Self.T : D", key.extends: { @@ -635,7 +623,7 @@ extension P8 where Self.T : module_with_class_extension.E { key.kind: source.lang.swift.decl.function.method.instance, key.name: "bar()", key.usr: "s:27module_with_class_extension2P8PA2A1DC1TRczrlE3baryyF", - key.offset: 506, + key.offset: 480, key.length: 10, key.fully_annotated_decl: "func bar()" } @@ -648,7 +636,7 @@ extension P8 where Self.T : module_with_class_extension.E { key.description: "Self.T : E" } ], - key.offset: 520, + key.offset: 494, key.length: 77, key.fully_annotated_decl: "extension P8 where Self.T : E", key.extends: { @@ -661,7 +649,7 @@ extension P8 where Self.T : module_with_class_extension.E { key.kind: source.lang.swift.decl.function.method.instance, key.name: "baz()", key.usr: "s:27module_with_class_extension2P8PA2A1EC1TRczrlE3bazyyF", - key.offset: 585, + key.offset: 559, key.length: 10, key.fully_annotated_decl: "func baz()" } diff --git a/test/SourceKit/DocSupport/doc_swift_module_cross_import.swift.A.response b/test/SourceKit/DocSupport/doc_swift_module_cross_import.swift.A.response index 7e9d1ec0efb5c..3be4f1b146ff2 100644 --- a/test/SourceKit/DocSupport/doc_swift_module_cross_import.swift.A.response +++ b/test/SourceKit/DocSupport/doc_swift_module_cross_import.swift.A.response @@ -1,5 +1,3 @@ -import SwiftOnoneSupport - func fromA() @@ -30,143 +28,133 @@ func other(x x: A.From_ABAdditionsType) { key.kind: source.lang.swift.syntaxtype.keyword, key.offset: 0, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7, - key.length: 17 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 26, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 31, + key.offset: 5, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 41, + key.offset: 15, key.length: 23 }, { key.kind: source.lang.swift.syntaxtype.comment.mark, - key.offset: 44, + key.offset: 18, key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 65, + key.offset: 39, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 72, + key.offset: 46, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 75, + key.offset: 49, key.length: 39 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 114, + key.offset: 88, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 121, + key.offset: 95, key.length: 20 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 147, + key.offset: 121, key.length: 39 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 186, + key.offset: 160, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 191, + key.offset: 165, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 212, + key.offset: 186, key.length: 29 }, { key.kind: source.lang.swift.syntaxtype.comment.mark, - key.offset: 215, + key.offset: 189, key.length: 25 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 242, + key.offset: 216, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 249, + key.offset: 223, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 252, + key.offset: 226, key.length: 46 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 298, + key.offset: 272, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 303, + key.offset: 277, key.length: 27 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 334, + key.offset: 308, key.length: 46 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 380, + key.offset: 354, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 385, + key.offset: 359, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 391, + key.offset: 365, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 393, + key.offset: 367, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 396, + key.offset: 370, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "From_ABAdditionsType", key.usr: "s:12_ABAdditions05From_A4TypeV", - key.offset: 398, + key.offset: 372, key.length: 20 } ] @@ -175,7 +163,7 @@ func other(x x: A.From_ABAdditionsType) key.kind: source.lang.swift.decl.function.free, key.name: "fromA()", key.usr: "s:1A5fromAyyF", - key.offset: 26, + key.offset: 0, key.length: 12, key.fully_annotated_decl: "func fromA()" }, @@ -183,7 +171,7 @@ func other(x x: A.From_ABAdditionsType) key.kind: source.lang.swift.decl.struct, key.name: "From_ABAdditionsType", key.usr: "s:12_ABAdditions05From_A4TypeV", - key.offset: 114, + key.offset: 88, key.length: 31, key.fully_annotated_decl: "struct From_ABAdditionsType", key.required_bystanders: [ @@ -194,7 +182,7 @@ func other(x x: A.From_ABAdditionsType) key.kind: source.lang.swift.decl.function.free, key.name: "from_ABAdditions()", key.usr: "s:12_ABAdditions05from_A0yyF", - key.offset: 186, + key.offset: 160, key.length: 23, key.fully_annotated_decl: "func from_ABAdditions()", key.required_bystanders: [ @@ -205,7 +193,7 @@ func other(x x: A.From_ABAdditionsType) key.kind: source.lang.swift.decl.function.free, key.name: "from__ABAdditionsCAdditions()", key.usr: "s:23__ABAdditionsCAdditions06from__aB0yyF", - key.offset: 298, + key.offset: 272, key.length: 34, key.fully_annotated_decl: "func from__ABAdditionsCAdditions()", key.required_bystanders: [ @@ -217,7 +205,7 @@ func other(x x: A.From_ABAdditionsType) key.kind: source.lang.swift.decl.function.free, key.name: "other(x:)", key.usr: "s:23__ABAdditionsCAdditions5other1xy01_A005From_A4TypeV_tF", - key.offset: 380, + key.offset: 354, key.length: 39, key.fully_annotated_decl: "func other(x: From_ABAdditionsType)", key.entities: [ @@ -225,7 +213,7 @@ func other(x x: A.From_ABAdditionsType) key.kind: source.lang.swift.decl.var.local, key.keyword: "x", key.name: "x", - key.offset: 396, + key.offset: 370, key.length: 22 } ], diff --git a/test/SourceKit/DocSupport/doc_swift_module_cross_import.swift.Other.response b/test/SourceKit/DocSupport/doc_swift_module_cross_import.swift.Other.response index 7620ca1c322e0..5299b1ba6ca33 100644 --- a/test/SourceKit/DocSupport/doc_swift_module_cross_import.swift.Other.response +++ b/test/SourceKit/DocSupport/doc_swift_module_cross_import.swift.Other.response @@ -1,5 +1,3 @@ -import SwiftOnoneSupport - func fromOther() @@ -7,7 +5,6 @@ func fromOther() import B import C -import A // Available when C is imported with Other func filtered() @@ -20,91 +17,71 @@ func from_OtherCAdditions() { key.kind: source.lang.swift.syntaxtype.keyword, key.offset: 0, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7, - key.length: 17 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 26, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 31, + key.offset: 5, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 45, + key.offset: 19, key.length: 23 }, { key.kind: source.lang.swift.syntaxtype.comment.mark, - key.offset: 48, + key.offset: 22, key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 69, + key.offset: 43, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 76, + key.offset: 50, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 78, + key.offset: 52, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 85, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 87, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 94, + key.offset: 59, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 97, + key.offset: 62, key.length: 43 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 140, + key.offset: 105, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 145, + key.offset: 110, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 157, + key.offset: 122, key.length: 43 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 200, + key.offset: 165, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 205, + key.offset: 170, key.length: 20 } ] @@ -113,7 +90,7 @@ func from_OtherCAdditions() key.kind: source.lang.swift.decl.function.free, key.name: "fromOther()", key.usr: "s:5Other04fromA0yyF", - key.offset: 26, + key.offset: 0, key.length: 16, key.fully_annotated_decl: "func fromOther()" }, @@ -121,7 +98,7 @@ func from_OtherCAdditions() key.kind: source.lang.swift.decl.function.free, key.name: "filtered()", key.usr: "s:16_OtherCAdditions8filteredyyF", - key.offset: 140, + key.offset: 105, key.length: 15, key.fully_annotated_decl: "func filtered()", key.attributes: [ @@ -140,7 +117,7 @@ func from_OtherCAdditions() key.name: "from_OtherCAdditions()", key.usr: "s:16_OtherCAdditions05from_aB0yyF", key.doc.full_as_xml: "from_OtherCAdditions()s:16_OtherCAdditions05from_aB0yyFfunc from_OtherCAdditions()This has some interesting documentation that shouldn’t be separated from the decl when we print the comment detailing its required bystanders in the generated interface of ‘Other’.", - key.offset: 200, + key.offset: 165, key.length: 27, key.fully_annotated_decl: "func from_OtherCAdditions()", key.required_bystanders: [ diff --git a/test/SourceKit/DocSupport/doc_system_module_underscored.swift.response b/test/SourceKit/DocSupport/doc_system_module_underscored.swift.response index 59246b35fda05..56f9041c160a8 100644 --- a/test/SourceKit/DocSupport/doc_system_module_underscored.swift.response +++ b/test/SourceKit/DocSupport/doc_system_module_underscored.swift.response @@ -1,5 +1,3 @@ -import SwiftOnoneSupport - struct A { func fromA(takesT takesT: T) @@ -96,872 +94,862 @@ protocol Other1 { { key.kind: source.lang.swift.syntaxtype.identifier, key.offset: 7, - key.length: 17 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 26, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 33, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 35, + key.offset: 9, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 45, + key.offset: 19, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 50, + key.offset: 24, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 56, + key.offset: 30, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 63, + key.offset: 37, key.length: 6 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "T", key.usr: "s:16UnderscoredProto1AV1Txmfp", - key.offset: 71, + key.offset: 45, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 79, + key.offset: 53, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 84, + key.offset: 58, key.length: 14 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 99, + key.offset: 73, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 106, + key.offset: 80, key.length: 6 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "T", key.usr: "s:16UnderscoredProto1AV1Txmfp", - key.offset: 114, + key.offset: 88, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 122, + key.offset: 96, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 127, + key.offset: 101, key.length: 18 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 151, + key.offset: 125, key.length: 9 }, { key.kind: source.lang.swift.ref.struct, key.name: "A", key.usr: "s:16UnderscoredProto1AV", - key.offset: 161, + key.offset: 135, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 170, + key.offset: 144, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 175, + key.offset: 149, key.length: 28 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 209, + key.offset: 183, key.length: 9 }, { key.kind: source.lang.swift.ref.struct, key.name: "A", key.usr: "s:16UnderscoredProto1AV", - key.offset: 219, + key.offset: 193, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 221, + key.offset: 195, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "T", key.usr: "s:16UnderscoredProto1AV1Txmfp", - key.offset: 227, + key.offset: 201, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.operator, - key.offset: 229, + key.offset: 203, key.length: 2 }, { key.kind: source.lang.swift.ref.struct, key.name: "String", key.usr: "s:SS", - key.offset: 232, + key.offset: 206, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 246, + key.offset: 220, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 256, + key.offset: 230, key.length: 4 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 263, + key.offset: 237, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 272, + key.offset: 246, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 277, + key.offset: 251, key.length: 25 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 303, + key.offset: 277, key.length: 14 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 318, + key.offset: 292, key.length: 14 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "T", key.usr: "s:16UnderscoredProto1AVAASSRszlE1Txmfp", - key.offset: 334, + key.offset: 308, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 342, + key.offset: 316, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 347, + key.offset: 321, key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 367, + key.offset: 341, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 377, + key.offset: 351, key.length: 9 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 388, + key.offset: 362, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 396, + key.offset: 370, key.length: 9 }, { key.kind: source.lang.swift.ref.struct, key.name: "A", key.usr: "s:16UnderscoredProto1AV", - key.offset: 406, + key.offset: 380, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 415, + key.offset: 389, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 420, + key.offset: 394, key.length: 40 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 461, + key.offset: 435, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 474, + key.offset: 448, key.length: 12 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 488, + key.offset: 462, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 496, + key.offset: 470, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 502, + key.offset: 476, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 504, + key.offset: 478, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 514, + key.offset: 488, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 519, + key.offset: 493, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 525, + key.offset: 499, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 532, + key.offset: 506, key.length: 6 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "T", key.usr: "s:16UnderscoredProto1BC1Txmfp", - key.offset: 540, + key.offset: 514, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 548, + key.offset: 522, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 558, + key.offset: 532, key.length: 4 }, { key.kind: source.lang.swift.ref.struct, key.name: "String", key.usr: "s:SS", - key.offset: 565, + key.offset: 539, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 577, + key.offset: 551, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 582, + key.offset: 556, key.length: 18 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 608, + key.offset: 582, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 613, + key.offset: 587, key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 633, + key.offset: 607, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 643, + key.offset: 617, key.length: 9 }, { key.kind: source.lang.swift.ref.struct, key.name: "String", key.usr: "s:SS", - key.offset: 654, + key.offset: 628, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 667, + key.offset: 641, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 672, + key.offset: 646, key.length: 30 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 703, + key.offset: 677, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 721, + key.offset: 695, key.length: 17 }, { key.kind: source.lang.swift.ref.struct, key.name: "String", key.usr: "s:SS", - key.offset: 740, + key.offset: 714, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 751, + key.offset: 725, key.length: 9 }, { key.kind: source.lang.swift.ref.class, key.name: "B", key.usr: "s:16UnderscoredProto1BC", - key.offset: 761, + key.offset: 735, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 770, + key.offset: 744, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 775, + key.offset: 749, key.length: 28 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 809, + key.offset: 783, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 815, + key.offset: 789, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 817, + key.offset: 791, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 820, + key.offset: 794, key.length: 1 }, { key.kind: source.lang.swift.ref.class, key.name: "B", key.usr: "s:16UnderscoredProto1BC", - key.offset: 825, + key.offset: 799, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "String", key.usr: "s:SS", - key.offset: 827, + key.offset: 801, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 835, + key.offset: 809, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "U", key.usr: "s:16UnderscoredProto1CC1Uxmfp", - key.offset: 841, + key.offset: 815, key.length: 1 }, { key.kind: source.lang.swift.ref.protocol, key.name: "Equatable", key.usr: "s:SQ", - key.offset: 845, + key.offset: 819, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 862, + key.offset: 836, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 867, + key.offset: 841, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 873, + key.offset: 847, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 891, + key.offset: 865, key.length: 17 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "U", key.usr: "s:16UnderscoredProto1CC1Uxmfp", - key.offset: 910, + key.offset: 884, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 918, + key.offset: 892, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 928, + key.offset: 902, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "V", key.usr: "s:16UnderscoredProto1CC1Vq_mfp", - key.offset: 936, + key.offset: 910, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 943, + key.offset: 917, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 953, + key.offset: 927, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "U", key.usr: "s:16UnderscoredProto1CC1Uxmfp", - key.offset: 961, + key.offset: 935, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 968, + key.offset: 942, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 973, + key.offset: 947, key.length: 24 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 998, + key.offset: 972, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 1005, + key.offset: 979, key.length: 6 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "U", key.usr: "s:16UnderscoredProto1CC1Uxmfp", - key.offset: 1013, + key.offset: 987, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1021, + key.offset: 995, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1026, + key.offset: 1000, key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 1046, + key.offset: 1020, key.length: 21 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 1068, + key.offset: 1042, key.length: 21 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "U", key.usr: "s:16UnderscoredProto1CC1Uxmfp", - key.offset: 1091, + key.offset: 1065, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1099, + key.offset: 1073, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1104, + key.offset: 1078, key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 1124, + key.offset: 1098, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 1135, + key.offset: 1109, key.length: 10 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "V", key.usr: "s:16UnderscoredProto1CC1Vq_mfp", - key.offset: 1147, + key.offset: 1121, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1155, + key.offset: 1129, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1160, + key.offset: 1134, key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 1180, + key.offset: 1154, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 1191, + key.offset: 1165, key.length: 10 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "U", key.usr: "s:16UnderscoredProto1CC1Uxmfp", - key.offset: 1203, + key.offset: 1177, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1209, + key.offset: 1183, key.length: 9 }, { key.kind: source.lang.swift.ref.class, key.name: "C", key.usr: "s:16UnderscoredProto1CC", - key.offset: 1219, + key.offset: 1193, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1221, + key.offset: 1195, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "U", key.usr: "s:16UnderscoredProto1CC1Uxmfp", - key.offset: 1227, + key.offset: 1201, key.length: 1 }, { key.kind: source.lang.swift.ref.protocol, key.name: "Hashable", key.usr: "s:SH", - key.offset: 1231, + key.offset: 1205, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1247, + key.offset: 1221, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1252, + key.offset: 1226, key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 1272, + key.offset: 1246, key.length: 20 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 1293, + key.offset: 1267, key.length: 20 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "U", key.usr: "s:16UnderscoredProto1CC1Uxmfp", - key.offset: 1315, + key.offset: 1289, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1321, + key.offset: 1295, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1328, + key.offset: 1302, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1330, + key.offset: 1304, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1333, + key.offset: 1307, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1343, + key.offset: 1317, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1348, + key.offset: 1322, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 1354, + key.offset: 1328, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 1361, + key.offset: 1335, key.length: 6 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "T", key.usr: "s:16UnderscoredProto1DV1Txmfp", - key.offset: 1369, + key.offset: 1343, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 1372, + key.offset: 1346, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 1379, + key.offset: 1353, key.length: 6 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "U", key.usr: "s:16UnderscoredProto1DV1Uq_mfp", - key.offset: 1387, + key.offset: 1361, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1393, + key.offset: 1367, key.length: 9 }, { key.kind: source.lang.swift.ref.struct, key.name: "D", key.usr: "s:16UnderscoredProto1DV", - key.offset: 1403, + key.offset: 1377, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1405, + key.offset: 1379, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "T", key.usr: "s:16UnderscoredProto1DV1Txmfp", - key.offset: 1411, + key.offset: 1385, key.length: 1 }, { key.kind: source.lang.swift.ref.protocol, key.name: "Equatable", key.usr: "s:SQ", - key.offset: 1415, + key.offset: 1389, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1432, + key.offset: 1406, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1442, + key.offset: 1416, key.length: 4 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "T", key.usr: "s:16UnderscoredProto1DVAASQRzrlE1Txmfp", - key.offset: 1449, + key.offset: 1423, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1454, + key.offset: 1428, key.length: 9 }, { key.kind: source.lang.swift.ref.struct, key.name: "D", key.usr: "s:16UnderscoredProto1DV", - key.offset: 1464, + key.offset: 1438, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1466, + key.offset: 1440, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "T", key.usr: "s:16UnderscoredProto1DV1Txmfp", - key.offset: 1472, + key.offset: 1446, key.length: 1 }, { key.kind: source.lang.swift.ref.protocol, key.name: "Other1", key.usr: "s:16UnderscoredProto6Other1P", - key.offset: 1476, + key.offset: 1450, key.length: 6 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "T", key.usr: "s:16UnderscoredProto1DV1Txmfp", - key.offset: 1484, + key.offset: 1458, key.length: 1 }, { key.kind: source.lang.swift.ref.protocol, key.name: "Equatable", key.usr: "s:SQ", - key.offset: 1488, + key.offset: 1462, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1505, + key.offset: 1479, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1510, + key.offset: 1484, key.length: 37 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 1548, + key.offset: 1522, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 1566, + key.offset: 1540, key.length: 17 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "T", key.usr: "s:16UnderscoredProto1DV1Txmfp", - key.offset: 1585, + key.offset: 1559, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1591, + key.offset: 1565, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1600, + key.offset: 1574, key.length: 6 } ] @@ -975,7 +963,7 @@ protocol Other1 { key.name: "T" } ], - key.offset: 26, + key.offset: 0, key.length: 123, key.fully_annotated_decl: "struct A<T>", key.entities: [ @@ -983,7 +971,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.function.method.instance, key.name: "fromA(takesT:)", key.usr: "s:16UnderscoredProto1AV5fromA6takesTyx_tF", - key.offset: 45, + key.offset: 19, key.length: 28, key.fully_annotated_decl: "func fromA(takesT: T)", key.entities: [ @@ -991,7 +979,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "takesT", key.name: "takesT", - key.offset: 71, + key.offset: 45, key.length: 1 } ] @@ -1000,7 +988,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.function.method.instance, key.name: "fromAExtension(takesT:)", key.usr: "s:16UnderscoredProto1AV14fromAExtension6takesTyx_tF", - key.offset: 79, + key.offset: 53, key.length: 37, key.fully_annotated_decl: "func fromAExtension(takesT: T)", key.entities: [ @@ -1008,7 +996,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "takesT", key.name: "takesT", - key.offset: 114, + key.offset: 88, key.length: 1 } ] @@ -1018,7 +1006,7 @@ protocol Other1 { key.name: "fromProtoExtension()", key.usr: "s:16UnderscoredProto01_aB0PAAE04fromB9ExtensionyyF::SYNTHESIZED::s:16UnderscoredProto1AV", key.original_usr: "s:16UnderscoredProto01_aB0PAAE04fromB9ExtensionyyF", - key.offset: 122, + key.offset: 96, key.length: 25, key.fully_annotated_decl: "func fromProtoExtension()" } @@ -1026,7 +1014,7 @@ protocol Other1 { }, { key.kind: source.lang.swift.decl.extension.struct, - key.offset: 151, + key.offset: 125, key.length: 56, key.fully_annotated_decl: "extension A", key.extends: { @@ -1040,7 +1028,7 @@ protocol Other1 { key.name: "fromDeprecatedProtoExtension()", key.usr: "s:16UnderscoredProto01_aB0PAAE014fromDeprecatedB9ExtensionyyF::SYNTHESIZED::s:16UnderscoredProto1AV", key.original_usr: "s:16UnderscoredProto01_aB0PAAE014fromDeprecatedB9ExtensionyyF", - key.offset: 170, + key.offset: 144, key.length: 35, key.fully_annotated_decl: "func fromDeprecatedProtoExtension()" } @@ -1065,7 +1053,7 @@ protocol Other1 { key.description: "T == String" } ], - key.offset: 209, + key.offset: 183, key.length: 185, key.fully_annotated_decl: "extension A : _UnderscoredProto2 where T == String", key.conforms: [ @@ -1085,7 +1073,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.typealias, key.name: "Elem", key.usr: "s:16UnderscoredProto1AVAASSRszlE4Elema", - key.offset: 246, + key.offset: 220, key.length: 20, key.fully_annotated_decl: "typealias Elem = Int", key.conforms: [ @@ -1110,7 +1098,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.function.method.instance, key.name: "fromAConditionalExtension(takesTIfString:)", key.usr: "s:16UnderscoredProto1AVAASSRszlE25fromAConditionalExtension14takesTIfStringySS_tF", - key.offset: 272, + key.offset: 246, key.length: 64, key.fully_annotated_decl: "func fromAConditionalExtension(takesTIfString: T)", key.entities: [ @@ -1118,7 +1106,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "takesTIfString", key.name: "takesTIfString", - key.offset: 334, + key.offset: 308, key.length: 1 } ] @@ -1128,7 +1116,7 @@ protocol Other1 { key.name: "fromProto2Extension(takesElem:)", key.usr: "s:16UnderscoredProto01_A6Proto2PAAE04fromC9Extension9takesElemy0G0Qz_tF::SYNTHESIZED::s:16UnderscoredProto1AV", key.original_usr: "s:16UnderscoredProto01_A6Proto2PAAE04fromC9Extension9takesElemy0G0Qz_tF", - key.offset: 342, + key.offset: 316, key.length: 50, key.fully_annotated_decl: "func fromProto2Extension(takesElem: Int)", key.entities: [ @@ -1136,7 +1124,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "takesElem", key.name: "takesElem", - key.offset: 388, + key.offset: 362, key.length: 3 } ] @@ -1155,7 +1143,7 @@ protocol Other1 { key.description: "T == String" } ], - key.offset: 396, + key.offset: 370, key.length: 98, key.fully_annotated_decl: "extension A", key.extends: { @@ -1169,7 +1157,7 @@ protocol Other1 { key.name: "fromDeprecatedConditionalProto2Extension(takesElemInt:)", key.usr: "s:16UnderscoredProto01_A6Proto2PAASi4ElemRtzrlE025fromDeprecatedConditionalC9Extension05takesD3IntySi_tF::SYNTHESIZED::s:16UnderscoredProto1AV", key.original_usr: "s:16UnderscoredProto01_A6Proto2PAASi4ElemRtzrlE025fromDeprecatedConditionalC9Extension05takesD3IntySi_tF", - key.offset: 415, + key.offset: 389, key.length: 77, key.fully_annotated_decl: "func fromDeprecatedConditionalProto2Extension(takesElemInt: Int)", key.entities: [ @@ -1177,7 +1165,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "takesElemInt", key.name: "takesElemInt", - key.offset: 488, + key.offset: 462, key.length: 3 } ] @@ -1200,7 +1188,7 @@ protocol Other1 { key.name: "T" } ], - key.offset: 496, + key.offset: 470, key.length: 253, key.fully_annotated_decl: "class B<T> : _UnderscoredProto", key.conforms: [ @@ -1215,7 +1203,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.function.method.instance, key.name: "fromB(takesT:)", key.usr: "s:16UnderscoredProto1BC5fromB6takesTyx_tF", - key.offset: 514, + key.offset: 488, key.length: 28, key.fully_annotated_decl: "func fromB(takesT: T)", key.entities: [ @@ -1223,7 +1211,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "takesT", key.name: "takesT", - key.offset: 540, + key.offset: 514, key.length: 1 } ] @@ -1232,7 +1220,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.typealias, key.name: "Elem", key.usr: "s:16UnderscoredProto1BC4Elema", - key.offset: 548, + key.offset: 522, key.length: 23, key.fully_annotated_decl: "typealias Elem = String" }, @@ -1241,7 +1229,7 @@ protocol Other1 { key.name: "fromProtoExtension()", key.usr: "s:16UnderscoredProto01_aB0PAAE04fromB9ExtensionyyF::SYNTHESIZED::s:16UnderscoredProto1BC", key.original_usr: "s:16UnderscoredProto01_aB0PAAE04fromB9ExtensionyyF", - key.offset: 577, + key.offset: 551, key.length: 25, key.fully_annotated_decl: "func fromProtoExtension()" }, @@ -1250,7 +1238,7 @@ protocol Other1 { key.name: "fromProto2Extension(takesElem:)", key.usr: "s:16UnderscoredProto01_A6Proto2PAAE04fromC9Extension9takesElemy0G0Qz_tF::SYNTHESIZED::s:16UnderscoredProto1BC", key.original_usr: "s:16UnderscoredProto01_A6Proto2PAAE04fromC9Extension9takesElemy0G0Qz_tF", - key.offset: 608, + key.offset: 582, key.length: 53, key.fully_annotated_decl: "func fromProto2Extension(takesElem: String)", key.entities: [ @@ -1258,7 +1246,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "takesElem", key.name: "takesElem", - key.offset: 654, + key.offset: 628, key.length: 6 } ] @@ -1268,7 +1256,7 @@ protocol Other1 { key.name: "fromConditionalProto2Extension(takesElemIfString:)", key.usr: "s:16UnderscoredProto01_A6Proto2PAASS4ElemRtzrlE015fromConditionalC9Extension05takesD8IfStringySS_tF::SYNTHESIZED::s:16UnderscoredProto1BC", key.original_usr: "s:16UnderscoredProto01_A6Proto2PAASS4ElemRtzrlE015fromConditionalC9Extension05takesD8IfStringySS_tF", - key.offset: 667, + key.offset: 641, key.length: 80, key.fully_annotated_decl: "func fromConditionalProto2Extension(takesElemIfString: String)", key.entities: [ @@ -1276,7 +1264,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "takesElemIfString", key.name: "takesElemIfString", - key.offset: 740, + key.offset: 714, key.length: 6 } ] @@ -1285,7 +1273,7 @@ protocol Other1 { }, { key.kind: source.lang.swift.decl.extension.class, - key.offset: 751, + key.offset: 725, key.length: 56, key.fully_annotated_decl: "extension B", key.extends: { @@ -1299,7 +1287,7 @@ protocol Other1 { key.name: "fromDeprecatedProtoExtension()", key.usr: "s:16UnderscoredProto01_aB0PAAE014fromDeprecatedB9ExtensionyyF::SYNTHESIZED::s:16UnderscoredProto1BC", key.original_usr: "s:16UnderscoredProto01_aB0PAAE014fromDeprecatedB9ExtensionyyF", - key.offset: 770, + key.offset: 744, key.length: 35, key.fully_annotated_decl: "func fromDeprecatedProtoExtension()" } @@ -1329,7 +1317,7 @@ protocol Other1 { key.description: "U : Equatable" } ], - key.offset: 809, + key.offset: 783, key.length: 398, key.fully_annotated_decl: "class C<U, V> : B<String> where U : Equatable", key.inherits: [ @@ -1344,7 +1332,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.function.method.instance, key.name: "fromC(takesUIfEquatable:)", key.usr: "s:16UnderscoredProto1CC5fromC17takesUIfEquatableyx_tF", - key.offset: 862, + key.offset: 836, key.length: 50, key.fully_annotated_decl: "func fromC(takesUIfEquatable: U)", key.entities: [ @@ -1352,7 +1340,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "takesUIfEquatable", key.name: "takesUIfEquatable", - key.offset: 910, + key.offset: 884, key.length: 1 } ] @@ -1361,7 +1349,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.typealias, key.name: "Elem1", key.usr: "s:16UnderscoredProto1CC5Elem1a", - key.offset: 918, + key.offset: 892, key.length: 19, key.fully_annotated_decl: "typealias Elem1 = V", key.conforms: [ @@ -1376,7 +1364,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.typealias, key.name: "Elem2", key.usr: "s:16UnderscoredProto1CC5Elem2a", - key.offset: 943, + key.offset: 917, key.length: 19, key.fully_annotated_decl: "typealias Elem2 = U", key.conforms: [ @@ -1391,7 +1379,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.function.method.instance, key.name: "fromCConditionlExtension(takesU:)", key.usr: "s:16UnderscoredProto1CC24fromCConditionlExtension6takesUyx_tF", - key.offset: 968, + key.offset: 942, key.length: 47, key.fully_annotated_decl: "func fromCConditionlExtension(takesU: U)", key.entities: [ @@ -1399,7 +1387,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "takesU", key.name: "takesU", - key.offset: 1013, + key.offset: 987, key.length: 1 } ] @@ -1409,7 +1397,7 @@ protocol Other1 { key.name: "fromProto4Extension(takesElem2IfEquatable:)", key.usr: "s:16UnderscoredProto01_A6Proto4PAAE04fromC9Extension21takesElem2IfEquatabley0G0Qz_tF::SYNTHESIZED::s:16UnderscoredProto1CC", key.original_usr: "s:16UnderscoredProto01_A6Proto4PAAE04fromC9Extension21takesElem2IfEquatabley0G0Qz_tF", - key.offset: 1021, + key.offset: 995, key.length: 72, key.fully_annotated_decl: "func fromProto4Extension(takesElem2IfEquatable: U)", key.entities: [ @@ -1417,7 +1405,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "takesElem2IfEquatable", key.name: "takesElem2IfEquatable", - key.offset: 1091, + key.offset: 1065, key.length: 1 } ] @@ -1427,7 +1415,7 @@ protocol Other1 { key.name: "fromProto3Extension(takesElem1:)", key.usr: "s:16UnderscoredProto01_A6Proto3PAAE04fromC9Extension10takesElem1y0G0Qz_tF::SYNTHESIZED::s:16UnderscoredProto1CC", key.original_usr: "s:16UnderscoredProto01_A6Proto3PAAE04fromC9Extension10takesElem1y0G0Qz_tF", - key.offset: 1099, + key.offset: 1073, key.length: 50, key.fully_annotated_decl: "func fromProto3Extension(takesElem1: V)", key.entities: [ @@ -1435,7 +1423,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "takesElem1", key.name: "takesElem1", - key.offset: 1147, + key.offset: 1121, key.length: 1 } ] @@ -1445,7 +1433,7 @@ protocol Other1 { key.name: "fromProto3Extension(takesElem2:)", key.usr: "s:16UnderscoredProto01_A6Proto3PAAE04fromC9Extension10takesElem2y0G0Qz_tF::SYNTHESIZED::s:16UnderscoredProto1CC", key.original_usr: "s:16UnderscoredProto01_A6Proto3PAAE04fromC9Extension10takesElem2y0G0Qz_tF", - key.offset: 1155, + key.offset: 1129, key.length: 50, key.fully_annotated_decl: "func fromProto3Extension(takesElem2: U)", key.entities: [ @@ -1453,7 +1441,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "takesElem2", key.name: "takesElem2", - key.offset: 1203, + key.offset: 1177, key.length: 1 } ] @@ -1467,7 +1455,7 @@ protocol Other1 { key.description: "U : Hashable" } ], - key.offset: 1209, + key.offset: 1183, key.length: 110, key.fully_annotated_decl: "extension C where U : Hashable", key.extends: { @@ -1481,7 +1469,7 @@ protocol Other1 { key.name: "fromProto4Extension(takesElem2IfHashable:)", key.usr: "s:16UnderscoredProto01_A6Proto4PAASH5Elem2RpzrlE04fromC9Extension05takesD10IfHashableyAE_tF::SYNTHESIZED::s:16UnderscoredProto1CC", key.original_usr: "s:16UnderscoredProto01_A6Proto4PAASH5Elem2RpzrlE04fromC9Extension05takesD10IfHashableyAE_tF", - key.offset: 1247, + key.offset: 1221, key.length: 70, key.fully_annotated_decl: "func fromProto4Extension(takesElem2IfHashable: U)", key.entities: [ @@ -1489,7 +1477,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "takesElem2IfHashable", key.name: "takesElem2IfHashable", - key.offset: 1315, + key.offset: 1289, key.length: 1 } ] @@ -1508,7 +1496,7 @@ protocol Other1 { key.name: "U" } ], - key.offset: 1321, + key.offset: 1295, key.length: 70, key.fully_annotated_decl: "struct D<T, U>", key.entities: [ @@ -1516,7 +1504,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.function.method.instance, key.name: "fromD(takesT:takesU:)", key.usr: "s:16UnderscoredProto1DV5fromD6takesT0D1Uyx_q_tF", - key.offset: 1343, + key.offset: 1317, key.length: 46, key.fully_annotated_decl: "func fromD(takesT: T, takesU: U)", key.entities: [ @@ -1524,14 +1512,14 @@ protocol Other1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "takesT", key.name: "takesT", - key.offset: 1369, + key.offset: 1343, key.length: 1 }, { key.kind: source.lang.swift.decl.var.local, key.keyword: "takesU", key.name: "takesU", - key.offset: 1387, + key.offset: 1361, key.length: 1 } ] @@ -1553,7 +1541,7 @@ protocol Other1 { key.description: "T : Equatable" } ], - key.offset: 1393, + key.offset: 1367, key.length: 59, key.fully_annotated_decl: "extension D : _SomeProto where T : Equatable", key.conforms: [ @@ -1573,7 +1561,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.typealias, key.name: "Item", key.usr: "s:16UnderscoredProto1DVAASQRzrlE4Itema", - key.offset: 1432, + key.offset: 1406, key.length: 18, key.fully_annotated_decl: "typealias Item = T", key.conforms: [ @@ -1604,7 +1592,7 @@ protocol Other1 { key.description: "T : Equatable" } ], - key.offset: 1454, + key.offset: 1428, key.length: 135, key.fully_annotated_decl: "extension D where T : Other1, T : Equatable", key.extends: { @@ -1618,7 +1606,7 @@ protocol Other1 { key.name: "fromSomeProtoExtensionSplitConditions(takesItemIfOther1:)", key.usr: "s:16UnderscoredProto05_SomeB0PA2A6Other14ItemRpzrlE04fromcB24ExtensionSplitConditions05takese2IfD0yAF_tF::SYNTHESIZED::s:16UnderscoredProto1DV", key.original_usr: "s:16UnderscoredProto05_SomeB0PA2A6Other14ItemRpzrlE04fromcB24ExtensionSplitConditions05takese2IfD0yAF_tF", - key.offset: 1505, + key.offset: 1479, key.length: 82, key.fully_annotated_decl: "func fromSomeProtoExtensionSplitConditions(takesItemIfOther1: T)", key.entities: [ @@ -1626,7 +1614,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.var.local, key.keyword: "takesItemIfOther1", key.name: "takesItemIfOther1", - key.offset: 1585, + key.offset: 1559, key.length: 1 } ] @@ -1637,7 +1625,7 @@ protocol Other1 { key.kind: source.lang.swift.decl.protocol, key.name: "Other1", key.usr: "s:16UnderscoredProto6Other1P", - key.offset: 1591, + key.offset: 1565, key.length: 19, key.fully_annotated_decl: "protocol Other1" } diff --git a/test/SourceKit/InterfaceGen/gen_clang_module.swift b/test/SourceKit/InterfaceGen/gen_clang_module.swift index f7a0318fdf0fa..1d6239cf32e4b 100644 --- a/test/SourceKit/InterfaceGen/gen_clang_module.swift +++ b/test/SourceKit/InterfaceGen/gen_clang_module.swift @@ -31,7 +31,7 @@ var x: FooClassBase // RUN: %sourcekitd-test -req=interface-gen-open -module Foo -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import -I %t.overlays -F %S/../Inputs/libIDE-mock-sdk \ // RUN: -target %target-triple %clang-importer-sdk-nosource -I %t \ -// RUN: == -req=cursor -pos=191:67 | %FileCheck -check-prefix=CHECK1 %s +// RUN: == -req=cursor -pos=190:57 | %FileCheck -check-prefix=CHECK1 %s // The cursor points to 'FooClassBase' inside the list of base classes, see 'gen_clang_module.swift.response' // RUN: %sourcekitd-test -req=interface-gen-open -module Foo -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import -I %t.overlays -F %S/../Inputs/libIDE-mock-sdk \ @@ -47,7 +47,7 @@ var x: FooClassBase // RUN: %sourcekitd-test -req=interface-gen-open -module Foo -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import -I %t.overlays -F %S/../Inputs/libIDE-mock-sdk \ // RUN: -target %target-triple %clang-importer-sdk-nosource -I %t \ -// RUN: == -req=cursor -pos=211:20 | %FileCheck -check-prefix=CHECK2 %s +// RUN: == -req=cursor -pos=210:15 | %FileCheck -check-prefix=CHECK2 %s // The cursor points inside the interface, see 'gen_clang_module.swift.response' // CHECK2: source.lang.swift.decl.function.method.instance ({{.*}}Foo.framework/Headers/Foo.h:170:10-170:27) @@ -61,7 +61,7 @@ var x: FooClassBase // RUN: == -req=find-usr -usr "c:objc(cs)FooClassDerived(im)fooInstanceFunc0" | %FileCheck -check-prefix=CHECK-USR %s // The returned line:col points inside the interface, see 'gen_clang_module.swift.response' -// CHECK-USR: (211:15-211:33) +// CHECK-USR: (210:15-210:33) // RUN: %sourcekitd-test -req=interface-gen-open -module Foo -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import -I %t.overlays -F %S/../Inputs/libIDE-mock-sdk \ // RUN: -target %target-triple %clang-importer-sdk-nosource -I %t \ diff --git a/test/SourceKit/InterfaceGen/gen_clang_module.swift.helper.explicit.response b/test/SourceKit/InterfaceGen/gen_clang_module.swift.helper.explicit.response index d08ec5d8ba3b2..db2e23f4732d6 100644 --- a/test/SourceKit/InterfaceGen/gen_clang_module.swift.helper.explicit.response +++ b/test/SourceKit/InterfaceGen/gen_clang_module.swift.helper.explicit.response @@ -1,54 +1,53 @@ - public func fooHelperExplicitFrameworkFunc1(_ a: Int32) -> Int32 [ { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1, + key.offset: 0, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 8, + key.offset: 7, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 13, + key.offset: 12, key.length: 31 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 45, + key.offset: 44, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 47, + key.offset: 46, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 50, + key.offset: 49, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 60, + key.offset: 59, key.length: 5 } ] [ { key.kind: source.lang.swift.ref.struct, - key.offset: 50, + key.offset: 49, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 60, + key.offset: 59, key.length: 5, key.is_system: 1 } @@ -58,14 +57,14 @@ public func fooHelperExplicitFrameworkFunc1(_ a: Int32) -> Int32 key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fooHelperExplicitFrameworkFunc1(_:)", - key.offset: 8, + key.offset: 7, key.length: 57, key.typename: "Int32", - key.nameoffset: 13, + key.nameoffset: 12, key.namelength: 43, key.attributes: [ { - key.offset: 1, + key.offset: 0, key.length: 6, key.attribute: source.decl.attribute.public } @@ -74,7 +73,7 @@ public func fooHelperExplicitFrameworkFunc1(_ a: Int32) -> Int32 { key.kind: source.lang.swift.decl.var.parameter, key.name: "a", - key.offset: 45, + key.offset: 44, key.length: 10, key.typename: "Int32" } diff --git a/test/SourceKit/InterfaceGen/gen_clang_module.swift.response b/test/SourceKit/InterfaceGen/gen_clang_module.swift.response index 29c4977c71b2b..69adddd02b49b 100644 --- a/test/SourceKit/InterfaceGen/gen_clang_module.swift.response +++ b/test/SourceKit/InterfaceGen/gen_clang_module.swift.response @@ -1,6 +1,5 @@ import Foo.FooSub import FooHelper -import SwiftOnoneSupport /// Aaa. FooEnum1. Bbb. public struct FooEnum1 : Hashable, Equatable, RawRepresentable { @@ -370,3164 +369,3154 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.offset: 25, key.length: 9 }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 35, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 42, - key.length: 17 - }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 61, + key.offset: 36, key.length: 26 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 87, + key.offset: 62, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 94, + key.offset: 69, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 101, + key.offset: 76, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 112, + key.offset: 87, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 122, + key.offset: 97, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 133, + key.offset: 108, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 157, + key.offset: 132, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 164, + key.offset: 139, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 169, + key.offset: 144, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 171, + key.offset: 146, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 181, + key.offset: 156, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 194, + key.offset: 169, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 201, + key.offset: 176, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 206, + key.offset: 181, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 216, + key.offset: 191, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 229, + key.offset: 204, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 236, + key.offset: 211, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 240, + key.offset: 215, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 250, + key.offset: 225, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 260, + key.offset: 235, key.length: 27 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 287, + key.offset: 262, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 294, + key.offset: 269, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 298, + key.offset: 273, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 309, + key.offset: 284, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 320, + key.offset: 295, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 327, + key.offset: 302, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 334, + key.offset: 309, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 341, + key.offset: 316, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 352, + key.offset: 327, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 362, + key.offset: 337, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 373, + key.offset: 348, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 397, + key.offset: 372, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 404, + key.offset: 379, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 409, + key.offset: 384, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 411, + key.offset: 386, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 421, + key.offset: 396, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 434, + key.offset: 409, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 441, + key.offset: 416, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 446, + key.offset: 421, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 456, + key.offset: 431, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 469, + key.offset: 444, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 476, + key.offset: 451, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 480, + key.offset: 455, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 490, + key.offset: 465, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 500, + key.offset: 475, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 507, + key.offset: 482, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 511, + key.offset: 486, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 522, + key.offset: 497, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 533, + key.offset: 508, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 540, + key.offset: 515, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 547, + key.offset: 522, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 551, + key.offset: 526, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 562, + key.offset: 537, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 573, + key.offset: 548, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 580, + key.offset: 555, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 587, + key.offset: 562, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 594, + key.offset: 569, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 605, + key.offset: 580, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 615, + key.offset: 590, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 626, + key.offset: 601, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 650, + key.offset: 625, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 657, + key.offset: 632, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 662, + key.offset: 637, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 664, + key.offset: 639, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 674, + key.offset: 649, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 687, + key.offset: 662, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 694, + key.offset: 669, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 699, + key.offset: 674, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 709, + key.offset: 684, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 722, + key.offset: 697, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 729, + key.offset: 704, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 733, + key.offset: 708, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 743, + key.offset: 718, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 753, + key.offset: 728, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 760, + key.offset: 735, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 764, + key.offset: 739, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 775, + key.offset: 750, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 786, + key.offset: 761, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 793, + key.offset: 768, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 800, + key.offset: 775, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 804, + key.offset: 779, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 815, + key.offset: 790, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 826, + key.offset: 801, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 833, + key.offset: 808, key.length: 37 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 870, + key.offset: 845, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 877, + key.offset: 852, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 882, + key.offset: 857, key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 904, + key.offset: 879, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 915, + key.offset: 890, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 920, + key.offset: 895, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.number, - key.offset: 939, + key.offset: 914, key.length: 2 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 947, + key.offset: 922, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 952, + key.offset: 927, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.number, - key.offset: 966, + key.offset: 941, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 973, + key.offset: 948, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 978, + key.offset: 953, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.number, - key.offset: 998, + key.offset: 973, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 1003, + key.offset: 978, key.length: 35 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1038, + key.offset: 1013, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1045, + key.offset: 1020, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1052, + key.offset: 1027, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1072, + key.offset: 1047, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1089, + key.offset: 1064, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1096, + key.offset: 1071, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1101, + key.offset: 1076, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1111, + key.offset: 1086, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1121, + key.offset: 1096, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1128, + key.offset: 1103, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1135, + key.offset: 1110, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1139, + key.offset: 1114, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1152, + key.offset: 1127, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1172, + key.offset: 1147, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1183, + key.offset: 1158, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1190, + key.offset: 1165, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1197, + key.offset: 1172, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1201, + key.offset: 1176, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1215, + key.offset: 1190, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1235, + key.offset: 1210, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1244, + key.offset: 1219, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1251, + key.offset: 1226, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1258, + key.offset: 1233, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1276, + key.offset: 1251, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1283, + key.offset: 1258, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1295, + key.offset: 1270, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1302, + key.offset: 1277, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1307, + key.offset: 1282, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1310, + key.offset: 1285, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1317, + key.offset: 1292, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1320, + key.offset: 1295, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1333, + key.offset: 1308, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1340, + key.offset: 1315, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1344, + key.offset: 1319, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1347, + key.offset: 1322, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1358, + key.offset: 1333, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1365, + key.offset: 1340, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1369, + key.offset: 1344, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1372, + key.offset: 1347, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1382, + key.offset: 1357, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1389, + key.offset: 1364, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1399, + key.offset: 1374, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1419, + key.offset: 1394, key.length: 20 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1440, + key.offset: 1415, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1453, + key.offset: 1428, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1460, + key.offset: 1435, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1467, + key.offset: 1442, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1485, + key.offset: 1460, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1492, + key.offset: 1467, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1504, + key.offset: 1479, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1511, + key.offset: 1486, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1516, + key.offset: 1491, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1519, + key.offset: 1494, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1526, + key.offset: 1501, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1529, + key.offset: 1504, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1542, + key.offset: 1517, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1549, + key.offset: 1524, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1553, + key.offset: 1528, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1556, + key.offset: 1531, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1567, + key.offset: 1542, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1574, + key.offset: 1549, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1578, + key.offset: 1553, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1581, + key.offset: 1556, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1591, + key.offset: 1566, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1598, + key.offset: 1573, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1608, + key.offset: 1583, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1628, + key.offset: 1603, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1640, + key.offset: 1615, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1647, + key.offset: 1622, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1654, + key.offset: 1629, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1679, + key.offset: 1654, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1686, + key.offset: 1661, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1698, + key.offset: 1673, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1705, + key.offset: 1680, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1710, + key.offset: 1685, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1713, + key.offset: 1688, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1720, + key.offset: 1695, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1723, + key.offset: 1698, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1736, + key.offset: 1711, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1743, + key.offset: 1718, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1747, + key.offset: 1722, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1750, + key.offset: 1725, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1761, + key.offset: 1736, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1768, + key.offset: 1743, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1772, + key.offset: 1747, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1775, + key.offset: 1750, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 1785, + key.offset: 1760, key.length: 29 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1814, + key.offset: 1789, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1821, + key.offset: 1796, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1831, + key.offset: 1806, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1845, + key.offset: 1820, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 1852, + key.offset: 1827, key.length: 27 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1879, + key.offset: 1854, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1886, + key.offset: 1861, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1890, + key.offset: 1865, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1901, + key.offset: 1876, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 1908, + key.offset: 1883, key.length: 26 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1934, + key.offset: 1909, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1941, + key.offset: 1916, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1946, + key.offset: 1921, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1955, + key.offset: 1930, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1957, + key.offset: 1932, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1960, + key.offset: 1935, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 1970, + key.offset: 1945, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1977, + key.offset: 1952, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1984, + key.offset: 1959, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1989, + key.offset: 1964, key.length: 22 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2012, + key.offset: 1987, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 2015, + key.offset: 1990, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 2025, + key.offset: 2000, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 2032, + key.offset: 2007, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2039, + key.offset: 2014, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2044, + key.offset: 2019, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2053, + key.offset: 2028, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2055, + key.offset: 2030, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 2058, + key.offset: 2033, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2065, + key.offset: 2040, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2067, + key.offset: 2042, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 2070, + key.offset: 2045, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2077, + key.offset: 2052, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2079, + key.offset: 2054, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 2082, + key.offset: 2057, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2090, + key.offset: 2065, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2092, + key.offset: 2067, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 2095, + key.offset: 2070, key.length: 20 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 2116, + key.offset: 2091, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 2128, + key.offset: 2103, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 2135, + key.offset: 2110, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2142, + key.offset: 2117, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2147, + key.offset: 2122, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2164, + key.offset: 2139, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2166, + key.offset: 2141, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 2173, + key.offset: 2148, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 2183, + key.offset: 2158, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 2193, + key.offset: 2168, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2200, + key.offset: 2175, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2205, + key.offset: 2180, key.length: 26 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2232, + key.offset: 2207, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2234, + key.offset: 2209, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 2241, + key.offset: 2216, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2253, + key.offset: 2228, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 2257, + key.offset: 2232, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 2267, + key.offset: 2242, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 2277, + key.offset: 2252, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2284, + key.offset: 2259, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2289, + key.offset: 2264, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 2311, + key.offset: 2286, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 2318, + key.offset: 2293, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2325, + key.offset: 2300, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2330, + key.offset: 2305, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 2352, + key.offset: 2327, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 2359, + key.offset: 2334, key.length: 62 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 2422, + key.offset: 2397, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2429, + key.offset: 2404, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2434, + key.offset: 2409, key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 2457, + key.offset: 2432, key.length: 42 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 2500, + key.offset: 2475, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2507, + key.offset: 2482, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2512, + key.offset: 2487, key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 2535, + key.offset: 2510, key.length: 43 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 2579, + key.offset: 2554, key.length: 15 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 2595, + key.offset: 2570, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2602, + key.offset: 2577, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2607, + key.offset: 2582, key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 2630, + key.offset: 2605, key.length: 43 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 2674, + key.offset: 2649, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 2683, + key.offset: 2658, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2690, + key.offset: 2665, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2695, + key.offset: 2670, key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 2718, + key.offset: 2693, key.length: 37 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 2755, + key.offset: 2730, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 2764, + key.offset: 2739, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 2768, + key.offset: 2743, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 2777, + key.offset: 2752, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2784, + key.offset: 2759, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2789, + key.offset: 2764, key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 2812, + key.offset: 2787, key.length: 50 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 2862, + key.offset: 2837, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2869, + key.offset: 2844, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2874, + key.offset: 2849, key.length: 32 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2907, + key.offset: 2882, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2909, + key.offset: 2884, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 2912, + key.offset: 2887, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 2922, + key.offset: 2897, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 2929, + key.offset: 2904, key.length: 33 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 2962, + key.offset: 2937, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2969, + key.offset: 2944, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2978, + key.offset: 2953, key.length: 15 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 3001, + key.offset: 2976, key.length: 30 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 3035, + key.offset: 3010, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3048, + key.offset: 3023, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3053, + key.offset: 3028, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 3073, + key.offset: 3048, key.length: 51 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 3128, + key.offset: 3103, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3141, + key.offset: 3116, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3146, + key.offset: 3121, key.length: 33 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 3187, + key.offset: 3162, key.length: 77 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3269, + key.offset: 3244, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3274, + key.offset: 3249, key.length: 33 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3315, + key.offset: 3290, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3322, + key.offset: 3297, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3327, + key.offset: 3302, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3352, + key.offset: 3327, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3356, + key.offset: 3331, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 3370, + key.offset: 3345, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3378, + key.offset: 3353, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3382, + key.offset: 3357, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3393, + key.offset: 3368, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3397, + key.offset: 3372, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 3411, + key.offset: 3386, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3419, + key.offset: 3394, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3423, + key.offset: 3398, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3434, + key.offset: 3409, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3438, + key.offset: 3413, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 3452, + key.offset: 3427, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3460, + key.offset: 3435, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 3469, + key.offset: 3444, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3476, + key.offset: 3451, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3485, + key.offset: 3460, key.length: 18 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 3506, + key.offset: 3481, key.length: 15 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 3527, + key.offset: 3502, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3532, + key.offset: 3507, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3538, + key.offset: 3513, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 3558, + key.offset: 3533, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3563, + key.offset: 3538, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3568, + key.offset: 3543, key.length: 20 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 3596, + key.offset: 3571, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3601, + key.offset: 3576, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3606, + key.offset: 3581, key.length: 20 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3627, + key.offset: 3602, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3629, + key.offset: 3604, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3639, + key.offset: 3614, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 3648, + key.offset: 3623, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 3667, + key.offset: 3642, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3674, + key.offset: 3649, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 3687, + key.offset: 3662, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 3694, + key.offset: 3669, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3706, + key.offset: 3681, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3712, + key.offset: 3687, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3718, + key.offset: 3693, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 3721, + key.offset: 3696, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 3733, + key.offset: 3708, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3738, + key.offset: 3713, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3743, + key.offset: 3718, key.length: 29 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 3780, + key.offset: 3755, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3785, + key.offset: 3760, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3791, + key.offset: 3766, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3796, + key.offset: 3771, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 3819, + key.offset: 3794, key.length: 33 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 3852, + key.offset: 3827, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3857, + key.offset: 3832, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3863, + key.offset: 3838, key.length: 15 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 3881, + key.offset: 3856, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 3895, + key.offset: 3870, key.length: 18 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 3921, + key.offset: 3896, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3926, + key.offset: 3901, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3930, + key.offset: 3905, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 3944, + key.offset: 3919, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 3955, + key.offset: 3930, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3960, + key.offset: 3935, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3964, + key.offset: 3939, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 3978, + key.offset: 3953, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 3989, + key.offset: 3964, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3994, + key.offset: 3969, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3998, + key.offset: 3973, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4012, + key.offset: 3987, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4020, + key.offset: 3995, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4031, + key.offset: 4006, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4036, + key.offset: 4011, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4041, + key.offset: 4016, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4065, + key.offset: 4040, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4070, + key.offset: 4045, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4075, + key.offset: 4050, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4092, + key.offset: 4067, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4094, + key.offset: 4069, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4097, + key.offset: 4072, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4109, + key.offset: 4084, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4114, + key.offset: 4089, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4119, + key.offset: 4094, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4136, + key.offset: 4111, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4138, + key.offset: 4113, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4141, + key.offset: 4116, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4148, + key.offset: 4123, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4154, + key.offset: 4129, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4157, + key.offset: 4132, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4169, + key.offset: 4144, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4174, + key.offset: 4149, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4179, + key.offset: 4154, key.length: 29 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4216, + key.offset: 4191, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4221, + key.offset: 4196, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4227, + key.offset: 4202, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4232, + key.offset: 4207, key.length: 13 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4251, + key.offset: 4226, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4258, + key.offset: 4233, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4268, + key.offset: 4243, key.length: 13 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4284, + key.offset: 4259, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4291, + key.offset: 4266, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4298, + key.offset: 4273, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4302, + key.offset: 4277, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4315, + key.offset: 4290, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4323, + key.offset: 4298, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4330, + key.offset: 4305, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4337, + key.offset: 4312, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4341, + key.offset: 4316, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4354, + key.offset: 4329, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4362, + key.offset: 4337, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4369, + key.offset: 4344, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4376, + key.offset: 4351, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4380, + key.offset: 4355, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4393, + key.offset: 4368, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4401, + key.offset: 4376, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4408, + key.offset: 4383, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4415, + key.offset: 4390, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4419, + key.offset: 4394, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4432, + key.offset: 4407, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4441, + key.offset: 4416, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4448, + key.offset: 4423, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4455, + key.offset: 4430, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4459, + key.offset: 4434, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4472, + key.offset: 4447, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4481, + key.offset: 4456, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4488, + key.offset: 4463, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4495, + key.offset: 4470, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4499, + key.offset: 4474, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4512, + key.offset: 4487, key.length: 13 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4528, + key.offset: 4503, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4535, + key.offset: 4510, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4542, + key.offset: 4517, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4546, + key.offset: 4521, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4559, + key.offset: 4534, key.length: 13 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4575, + key.offset: 4550, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4582, + key.offset: 4557, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4589, + key.offset: 4564, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4593, + key.offset: 4568, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4606, + key.offset: 4581, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4614, + key.offset: 4589, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4621, + key.offset: 4596, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4628, + key.offset: 4603, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4632, + key.offset: 4607, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4645, + key.offset: 4620, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4653, + key.offset: 4628, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4660, + key.offset: 4635, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4667, + key.offset: 4642, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4671, + key.offset: 4646, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4685, + key.offset: 4660, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4693, + key.offset: 4668, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4700, + key.offset: 4675, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4707, + key.offset: 4682, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4711, + key.offset: 4686, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4725, + key.offset: 4700, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4731, + key.offset: 4706, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4738, + key.offset: 4713, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4745, + key.offset: 4720, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4749, + key.offset: 4724, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4763, + key.offset: 4738, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4771, + key.offset: 4746, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4778, + key.offset: 4753, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4785, + key.offset: 4760, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4789, + key.offset: 4764, key.length: 13 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4804, + key.offset: 4779, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4812, + key.offset: 4787, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4819, + key.offset: 4794, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4826, + key.offset: 4801, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4830, + key.offset: 4805, key.length: 18 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4850, + key.offset: 4825, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4859, + key.offset: 4834, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4866, + key.offset: 4841, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4873, + key.offset: 4848, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4877, + key.offset: 4852, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4895, + key.offset: 4870, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4904, + key.offset: 4879, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4911, + key.offset: 4886, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4918, + key.offset: 4893, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4922, + key.offset: 4897, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4941, + key.offset: 4916, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4949, + key.offset: 4924, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4956, + key.offset: 4931, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4963, + key.offset: 4938, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4967, + key.offset: 4942, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 4986, + key.offset: 4961, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4994, + key.offset: 4969, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5001, + key.offset: 4976, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5008, + key.offset: 4983, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5013, + key.offset: 4988, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5033, + key.offset: 5008, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5040, + key.offset: 5015, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5045, + key.offset: 5020, key.length: 21 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5070, + key.offset: 5045, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5077, + key.offset: 5052, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5084, + key.offset: 5059, key.length: 15 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5107, + key.offset: 5082, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5114, + key.offset: 5089, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5126, + key.offset: 5101, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5133, + key.offset: 5108, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5138, + key.offset: 5113, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 5141, + key.offset: 5116, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5153, + key.offset: 5128, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5160, + key.offset: 5135, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5164, + key.offset: 5139, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 5167, + key.offset: 5142, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5176, + key.offset: 5151, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 5186, + key.offset: 5161, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5206, + key.offset: 5181, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5211, + key.offset: 5186, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5216, + key.offset: 5191, key.length: 14 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5236, + key.offset: 5211, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5244, + key.offset: 5219, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 5254, + key.offset: 5229, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5274, + key.offset: 5249, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5279, + key.offset: 5254, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5284, + key.offset: 5259, key.length: 14 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5304, + key.offset: 5279, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5314, + key.offset: 5289, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5319, + key.offset: 5294, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5324, + key.offset: 5299, key.length: 15 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5345, + key.offset: 5320, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5353, + key.offset: 5328, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 5363, + key.offset: 5338, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5383, + key.offset: 5358, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5388, + key.offset: 5363, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5393, + key.offset: 5368, key.length: 14 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5413, + key.offset: 5388, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5421, + key.offset: 5396, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5428, + key.offset: 5403, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5437, + key.offset: 5412, key.length: 13 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5456, + key.offset: 5431, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5461, + key.offset: 5436, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5467, + key.offset: 5442, key.length: 21 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 5491, + key.offset: 5466, key.length: 13 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5510, + key.offset: 5485, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5515, + key.offset: 5490, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5521, + key.offset: 5496, key.length: 25 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 5549, + key.offset: 5524, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5569, + key.offset: 5544, key.length: 15 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5585, + key.offset: 5560, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5590, + key.offset: 5565, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5594, + key.offset: 5569, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 5606, + key.offset: 5581, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5622, + key.offset: 5597, key.length: 15 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5638, + key.offset: 5613, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5643, + key.offset: 5618, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5647, + key.offset: 5622, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 5665, + key.offset: 5640, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5681, + key.offset: 5656, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5686, + key.offset: 5661, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5690, + key.offset: 5665, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5702, + key.offset: 5677, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5712, + key.offset: 5687, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5717, + key.offset: 5692, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5721, + key.offset: 5696, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5732, + key.offset: 5707, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5742, + key.offset: 5717, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5747, + key.offset: 5722, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5751, + key.offset: 5726, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5761, + key.offset: 5736, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5771, + key.offset: 5746, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5776, + key.offset: 5751, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5781, + key.offset: 5756, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5785, + key.offset: 5760, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 5794, + key.offset: 5769, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5810, + key.offset: 5785, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5815, + key.offset: 5790, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5819, + key.offset: 5794, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 5827, + key.offset: 5802, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5836, + key.offset: 5811, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5841, + key.offset: 5816, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5847, + key.offset: 5822, key.length: 21 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 5871, + key.offset: 5846, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5891, + key.offset: 5866, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5898, + key.offset: 5873, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5910, + key.offset: 5885, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5916, + key.offset: 5891, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5920, + key.offset: 5895, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 5923, + key.offset: 5898, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5935, + key.offset: 5910, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.operator, - key.offset: 5946, + key.offset: 5921, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5949, + key.offset: 5924, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5961, + key.offset: 5936, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.string, - key.offset: 5970, + key.offset: 5945, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5979, + key.offset: 5954, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5984, + key.offset: 5959, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5989, + key.offset: 5964, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 6007, + key.offset: 5982, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6018, + key.offset: 5993, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.number, - key.offset: 6024, + key.offset: 5999, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.operator, - key.offset: 6030, + key.offset: 6005, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 6037, + key.offset: 6012, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6042, + key.offset: 6017, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6047, + key.offset: 6022, key.length: 22 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 6077, + key.offset: 6052, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6088, + key.offset: 6063, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6095, + key.offset: 6070, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.number, - key.offset: 6107, + key.offset: 6082, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6113, + key.offset: 6088, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.string, - key.offset: 6122, + key.offset: 6097, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 6131, + key.offset: 6106, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6136, + key.offset: 6111, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6141, + key.offset: 6116, key.length: 25 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 6172, + key.offset: 6147, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6179, + key.offset: 6154, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6185, + key.offset: 6160, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 6200, + key.offset: 6175, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.operator, - key.offset: 6211, + key.offset: 6186, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6214, + key.offset: 6189, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6226, + key.offset: 6201, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.string, - key.offset: 6235, + key.offset: 6210, key.length: 27 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 6264, + key.offset: 6239, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6271, + key.offset: 6246, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6276, + key.offset: 6251, key.length: 21 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 6300, + key.offset: 6275, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6311, + key.offset: 6286, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6316, + key.offset: 6291, key.length: 13 }, { key.kind: source.lang.swift.syntaxtype.number, - key.offset: 6332, + key.offset: 6307, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6339, + key.offset: 6314, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6344, + key.offset: 6319, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.number, - key.offset: 6357, + key.offset: 6332, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 6362, + key.offset: 6337, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6369, + key.offset: 6344, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6375, + key.offset: 6350, key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 6402, + key.offset: 6377, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6409, + key.offset: 6384, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6414, + key.offset: 6389, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 6421, + key.offset: 6396, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6428, + key.offset: 6403, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6434, + key.offset: 6409, key.length: 22 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 6459, + key.offset: 6434, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 6463, + key.offset: 6438, key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 6490, + key.offset: 6465, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 6499, + key.offset: 6474, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6506, + key.offset: 6481, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6511, + key.offset: 6486, key.length: 1 } ] @@ -3547,635 +3536,629 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.offset: 25, key.length: 9 }, - { - key.kind: source.lang.swift.ref.module, - key.offset: 42, - key.length: 17, - key.is_system: 1 - }, { key.kind: source.lang.swift.ref.protocol, - key.offset: 112, + key.offset: 87, key.length: 8, key.is_system: 1 }, { key.kind: source.lang.swift.ref.protocol, - key.offset: 122, + key.offset: 97, key.length: 9, key.is_system: 1 }, { key.kind: source.lang.swift.ref.protocol, - key.offset: 133, + key.offset: 108, key.length: 16, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 181, + key.offset: 156, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 216, + key.offset: 191, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 250, + key.offset: 225, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 309, + key.offset: 284, key.length: 8 }, { key.kind: source.lang.swift.ref.protocol, - key.offset: 352, + key.offset: 327, key.length: 8, key.is_system: 1 }, { key.kind: source.lang.swift.ref.protocol, - key.offset: 362, + key.offset: 337, key.length: 9, key.is_system: 1 }, { key.kind: source.lang.swift.ref.protocol, - key.offset: 373, + key.offset: 348, key.length: 16, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 421, + key.offset: 396, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 456, + key.offset: 431, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 490, + key.offset: 465, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 522, + key.offset: 497, key.length: 8 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 562, + key.offset: 537, key.length: 8 }, { key.kind: source.lang.swift.ref.protocol, - key.offset: 605, + key.offset: 580, key.length: 8, key.is_system: 1 }, { key.kind: source.lang.swift.ref.protocol, - key.offset: 615, + key.offset: 590, key.length: 9, key.is_system: 1 }, { key.kind: source.lang.swift.ref.protocol, - key.offset: 626, + key.offset: 601, key.length: 16, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 674, + key.offset: 649, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 709, + key.offset: 684, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 743, + key.offset: 718, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 775, + key.offset: 750, key.length: 8 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 815, + key.offset: 790, key.length: 8 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 904, + key.offset: 879, key.length: 3, key.is_system: 1 }, { key.kind: source.lang.swift.ref.protocol, - key.offset: 1072, + key.offset: 1047, key.length: 9, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1111, + key.offset: 1086, key.length: 3, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1152, + key.offset: 1127, key.length: 17 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1215, + key.offset: 1190, key.length: 17 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1310, + key.offset: 1285, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1320, + key.offset: 1295, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1347, + key.offset: 1322, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1372, + key.offset: 1347, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1419, + key.offset: 1394, key.length: 20, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1440, + key.offset: 1415, key.length: 10 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1519, + key.offset: 1494, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1529, + key.offset: 1504, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1556, + key.offset: 1531, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1581, + key.offset: 1556, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1628, + key.offset: 1603, key.length: 10 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1713, + key.offset: 1688, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1723, + key.offset: 1698, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1750, + key.offset: 1725, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1775, + key.offset: 1750, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1845, + key.offset: 1820, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1901, + key.offset: 1876, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1960, + key.offset: 1935, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 1970, + key.offset: 1945, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 2015, + key.offset: 1990, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 2025, + key.offset: 2000, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 2058, + key.offset: 2033, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 2070, + key.offset: 2045, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 2082, + key.offset: 2057, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 2095, + key.offset: 2070, key.length: 20, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 2116, + key.offset: 2091, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 2128, + key.offset: 2103, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 2173, + key.offset: 2148, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 2183, + key.offset: 2158, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 2257, + key.offset: 2232, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 2267, + key.offset: 2242, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.enum, - key.offset: 2311, + key.offset: 2286, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.enum, - key.offset: 2352, + key.offset: 2327, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 2912, + key.offset: 2887, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 2922, + key.offset: 2897, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 3370, + key.offset: 3345, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 3411, + key.offset: 3386, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 3452, + key.offset: 3427, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.protocol, - key.offset: 3506, + key.offset: 3481, key.length: 15 }, { key.kind: source.lang.swift.ref.class, - key.offset: 3648, + key.offset: 3623, key.length: 12 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 3721, + key.offset: 3696, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.class, - key.offset: 3881, + key.offset: 3856, key.length: 12 }, { key.kind: source.lang.swift.ref.protocol, - key.offset: 3895, + key.offset: 3870, key.length: 18 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 3944, + key.offset: 3919, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 3978, + key.offset: 3953, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 4012, + key.offset: 3987, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 4097, + key.offset: 4072, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 4141, + key.offset: 4116, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 4157, + key.offset: 4132, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 4284, + key.offset: 4259, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 4315, + key.offset: 4290, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 4354, + key.offset: 4329, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 4393, + key.offset: 4368, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 4432, + key.offset: 4407, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 4472, + key.offset: 4447, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.typealias, - key.offset: 4512, + key.offset: 4487, key.length: 13 }, { key.kind: source.lang.swift.ref.typealias, - key.offset: 4559, + key.offset: 4534, key.length: 13 }, { key.kind: source.lang.swift.ref.typealias, - key.offset: 4606, + key.offset: 4581, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 4645, + key.offset: 4620, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 4685, + key.offset: 4660, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 4725, + key.offset: 4700, key.length: 3, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 4763, + key.offset: 4738, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 4804, + key.offset: 4779, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 4850, + key.offset: 4825, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 4895, + key.offset: 4870, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 4941, + key.offset: 4916, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 4986, + key.offset: 4961, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 5141, + key.offset: 5116, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 5167, + key.offset: 5142, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.class, - key.offset: 5186, + key.offset: 5161, key.length: 12 }, { key.kind: source.lang.swift.ref.class, - key.offset: 5254, + key.offset: 5229, key.length: 12 }, { key.kind: source.lang.swift.ref.class, - key.offset: 5363, + key.offset: 5338, key.length: 12 }, { key.kind: source.lang.swift.ref.protocol, - key.offset: 5491, + key.offset: 5466, key.length: 13 }, { key.kind: source.lang.swift.ref.class, - key.offset: 5549, + key.offset: 5524, key.length: 12 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 5827, + key.offset: 5802, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.class, - key.offset: 5871, + key.offset: 5846, key.length: 12 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 5923, + key.offset: 5898, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 6300, + key.offset: 6275, key.length: 3, key.is_system: 1 }, { key.kind: source.lang.swift.ref.module, - key.offset: 6459, + key.offset: 6434, key.length: 3 }, { key.kind: source.lang.swift.ref.class, - key.offset: 6463, + key.offset: 6438, key.length: 19 } ] @@ -4184,13 +4167,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.struct, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooEnum1", - key.offset: 94, + key.offset: 69, key.length: 164, - key.nameoffset: 101, + key.nameoffset: 76, key.namelength: 8, - key.bodyoffset: 151, + key.bodyoffset: 126, key.bodylength: 106, - key.docoffset: 61, + key.docoffset: 36, key.doclength: 26, key.inheritedtypes: [ { @@ -4205,7 +4188,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { ], key.attributes: [ { - key.offset: 87, + key.offset: 62, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4213,17 +4196,17 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.elements: [ { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 112, + key.offset: 87, key.length: 8 }, { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 122, + key.offset: 97, key.length: 9 }, { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 133, + key.offset: 108, key.length: 16 } ], @@ -4232,13 +4215,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init(_:)", - key.offset: 164, + key.offset: 139, key.length: 24, - key.nameoffset: 164, + key.nameoffset: 139, key.namelength: 24, key.attributes: [ { - key.offset: 157, + key.offset: 132, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4247,7 +4230,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "rawValue", - key.offset: 169, + key.offset: 144, key.length: 18, key.typename: "UInt32" } @@ -4257,13 +4240,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init(rawValue:)", - key.offset: 201, + key.offset: 176, key.length: 22, - key.nameoffset: 201, + key.nameoffset: 176, key.namelength: 22, key.attributes: [ { - key.offset: 194, + key.offset: 169, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4272,10 +4255,10 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "rawValue", - key.offset: 206, + key.offset: 181, key.length: 16, key.typename: "UInt32", - key.nameoffset: 206, + key.nameoffset: 181, key.namelength: 8 } ] @@ -4285,14 +4268,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.public, key.setter_accessibility: source.lang.swift.accessibility.public, key.name: "rawValue", - key.offset: 236, + key.offset: 211, key.length: 20, key.typename: "UInt32", - key.nameoffset: 240, + key.nameoffset: 215, key.namelength: 8, key.attributes: [ { - key.offset: 229, + key.offset: 204, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4304,18 +4287,18 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooEnum1X", - key.offset: 294, + key.offset: 269, key.length: 31, key.typename: "FooEnum1", - key.nameoffset: 298, + key.nameoffset: 273, key.namelength: 9, - key.bodyoffset: 319, + key.bodyoffset: 294, key.bodylength: 5, - key.docoffset: 260, + key.docoffset: 235, key.doclength: 27, key.attributes: [ { - key.offset: 287, + key.offset: 262, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4325,11 +4308,11 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.struct, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooEnum2", - key.offset: 334, + key.offset: 309, key.length: 164, - key.nameoffset: 341, + key.nameoffset: 316, key.namelength: 8, - key.bodyoffset: 391, + key.bodyoffset: 366, key.bodylength: 106, key.inheritedtypes: [ { @@ -4344,7 +4327,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { ], key.attributes: [ { - key.offset: 327, + key.offset: 302, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4352,17 +4335,17 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.elements: [ { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 352, + key.offset: 327, key.length: 8 }, { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 362, + key.offset: 337, key.length: 9 }, { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 373, + key.offset: 348, key.length: 16 } ], @@ -4371,13 +4354,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init(_:)", - key.offset: 404, + key.offset: 379, key.length: 24, - key.nameoffset: 404, + key.nameoffset: 379, key.namelength: 24, key.attributes: [ { - key.offset: 397, + key.offset: 372, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4386,7 +4369,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "rawValue", - key.offset: 409, + key.offset: 384, key.length: 18, key.typename: "UInt32" } @@ -4396,13 +4379,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init(rawValue:)", - key.offset: 441, + key.offset: 416, key.length: 22, - key.nameoffset: 441, + key.nameoffset: 416, key.namelength: 22, key.attributes: [ { - key.offset: 434, + key.offset: 409, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4411,10 +4394,10 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "rawValue", - key.offset: 446, + key.offset: 421, key.length: 16, key.typename: "UInt32", - key.nameoffset: 446, + key.nameoffset: 421, key.namelength: 8 } ] @@ -4424,14 +4407,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.public, key.setter_accessibility: source.lang.swift.accessibility.public, key.name: "rawValue", - key.offset: 476, + key.offset: 451, key.length: 20, key.typename: "UInt32", - key.nameoffset: 480, + key.nameoffset: 455, key.namelength: 8, key.attributes: [ { - key.offset: 469, + key.offset: 444, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4443,16 +4426,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooEnum2X", - key.offset: 507, + key.offset: 482, key.length: 31, key.typename: "FooEnum2", - key.nameoffset: 511, + key.nameoffset: 486, key.namelength: 9, - key.bodyoffset: 532, + key.bodyoffset: 507, key.bodylength: 5, key.attributes: [ { - key.offset: 500, + key.offset: 475, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4462,16 +4445,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooEnum2Y", - key.offset: 547, + key.offset: 522, key.length: 31, key.typename: "FooEnum2", - key.nameoffset: 551, + key.nameoffset: 526, key.namelength: 9, - key.bodyoffset: 572, + key.bodyoffset: 547, key.bodylength: 5, key.attributes: [ { - key.offset: 540, + key.offset: 515, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4481,11 +4464,11 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.struct, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooEnum3", - key.offset: 587, + key.offset: 562, key.length: 164, - key.nameoffset: 594, + key.nameoffset: 569, key.namelength: 8, - key.bodyoffset: 644, + key.bodyoffset: 619, key.bodylength: 106, key.inheritedtypes: [ { @@ -4500,7 +4483,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { ], key.attributes: [ { - key.offset: 580, + key.offset: 555, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4508,17 +4491,17 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.elements: [ { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 605, + key.offset: 580, key.length: 8 }, { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 615, + key.offset: 590, key.length: 9 }, { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 626, + key.offset: 601, key.length: 16 } ], @@ -4527,13 +4510,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init(_:)", - key.offset: 657, + key.offset: 632, key.length: 24, - key.nameoffset: 657, + key.nameoffset: 632, key.namelength: 24, key.attributes: [ { - key.offset: 650, + key.offset: 625, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4542,7 +4525,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "rawValue", - key.offset: 662, + key.offset: 637, key.length: 18, key.typename: "UInt32" } @@ -4552,13 +4535,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init(rawValue:)", - key.offset: 694, + key.offset: 669, key.length: 22, - key.nameoffset: 694, + key.nameoffset: 669, key.namelength: 22, key.attributes: [ { - key.offset: 687, + key.offset: 662, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4567,10 +4550,10 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "rawValue", - key.offset: 699, + key.offset: 674, key.length: 16, key.typename: "UInt32", - key.nameoffset: 699, + key.nameoffset: 674, key.namelength: 8 } ] @@ -4580,14 +4563,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.public, key.setter_accessibility: source.lang.swift.accessibility.public, key.name: "rawValue", - key.offset: 729, + key.offset: 704, key.length: 20, key.typename: "UInt32", - key.nameoffset: 733, + key.nameoffset: 708, key.namelength: 8, key.attributes: [ { - key.offset: 722, + key.offset: 697, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4599,16 +4582,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooEnum3X", - key.offset: 760, + key.offset: 735, key.length: 31, key.typename: "FooEnum3", - key.nameoffset: 764, + key.nameoffset: 739, key.namelength: 9, - key.bodyoffset: 785, + key.bodyoffset: 760, key.bodylength: 5, key.attributes: [ { - key.offset: 753, + key.offset: 728, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4618,16 +4601,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooEnum3Y", - key.offset: 800, + key.offset: 775, key.length: 31, key.typename: "FooEnum3", - key.nameoffset: 804, + key.nameoffset: 779, key.namelength: 9, - key.bodyoffset: 825, + key.bodyoffset: 800, key.bodylength: 5, key.attributes: [ { - key.offset: 793, + key.offset: 768, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4637,13 +4620,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.enum, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooComparisonResult", - key.offset: 877, + key.offset: 852, key.length: 124, - key.nameoffset: 882, + key.nameoffset: 857, key.namelength: 19, - key.bodyoffset: 909, + key.bodyoffset: 884, key.bodylength: 91, - key.docoffset: 833, + key.docoffset: 808, key.doclength: 37, key.inheritedtypes: [ { @@ -4652,7 +4635,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { ], key.attributes: [ { - key.offset: 870, + key.offset: 845, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4660,28 +4643,28 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.elements: [ { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 904, + key.offset: 879, key.length: 3 } ], key.substructure: [ { key.kind: source.lang.swift.decl.enumcase, - key.offset: 915, + key.offset: 890, key.length: 26, key.substructure: [ { key.kind: source.lang.swift.decl.enumelement, key.accessibility: source.lang.swift.accessibility.public, key.name: "orderedAscending", - key.offset: 920, + key.offset: 895, key.length: 21, - key.nameoffset: 920, + key.nameoffset: 895, key.namelength: 16, key.elements: [ { key.kind: source.lang.swift.structure.elem.init_expr, - key.offset: 939, + key.offset: 914, key.length: 2 } ] @@ -4690,21 +4673,21 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { }, { key.kind: source.lang.swift.decl.enumcase, - key.offset: 947, + key.offset: 922, key.length: 20, key.substructure: [ { key.kind: source.lang.swift.decl.enumelement, key.accessibility: source.lang.swift.accessibility.public, key.name: "orderedSame", - key.offset: 952, + key.offset: 927, key.length: 15, - key.nameoffset: 952, + key.nameoffset: 927, key.namelength: 11, key.elements: [ { key.kind: source.lang.swift.structure.elem.init_expr, - key.offset: 966, + key.offset: 941, key.length: 1 } ] @@ -4713,21 +4696,21 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { }, { key.kind: source.lang.swift.decl.enumcase, - key.offset: 973, + key.offset: 948, key.length: 26, key.substructure: [ { key.kind: source.lang.swift.decl.enumelement, key.accessibility: source.lang.swift.accessibility.public, key.name: "orderedDescending", - key.offset: 978, + key.offset: 953, key.length: 21, - key.nameoffset: 978, + key.nameoffset: 953, key.namelength: 17, key.elements: [ { key.kind: source.lang.swift.structure.elem.init_expr, - key.offset: 998, + key.offset: 973, key.length: 1 } ] @@ -4740,13 +4723,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.struct, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooRuncingOptions", - key.offset: 1045, + key.offset: 1020, key.length: 197, - key.nameoffset: 1052, + key.nameoffset: 1027, key.namelength: 17, - key.bodyoffset: 1083, + key.bodyoffset: 1058, key.bodylength: 158, - key.docoffset: 1003, + key.docoffset: 978, key.doclength: 35, key.inheritedtypes: [ { @@ -4755,7 +4738,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { ], key.attributes: [ { - key.offset: 1038, + key.offset: 1013, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4763,7 +4746,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.elements: [ { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 1072, + key.offset: 1047, key.length: 9 } ], @@ -4772,13 +4755,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init(rawValue:)", - key.offset: 1096, + key.offset: 1071, key.length: 19, - key.nameoffset: 1096, + key.nameoffset: 1071, key.namelength: 19, key.attributes: [ { - key.offset: 1089, + key.offset: 1064, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4787,10 +4770,10 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "rawValue", - key.offset: 1101, + key.offset: 1076, key.length: 13, key.typename: "Int", - key.nameoffset: 1101, + key.nameoffset: 1076, key.namelength: 8 } ] @@ -4799,16 +4782,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.static, key.accessibility: source.lang.swift.accessibility.public, key.name: "enableMince", - key.offset: 1128, + key.offset: 1103, key.length: 49, key.typename: "FooRuncingOptions", - key.nameoffset: 1139, + key.nameoffset: 1114, key.namelength: 11, - key.bodyoffset: 1171, + key.bodyoffset: 1146, key.bodylength: 5, key.attributes: [ { - key.offset: 1121, + key.offset: 1096, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4818,16 +4801,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.static, key.accessibility: source.lang.swift.accessibility.public, key.name: "enableQuince", - key.offset: 1190, + key.offset: 1165, key.length: 50, key.typename: "FooRuncingOptions", - key.nameoffset: 1201, + key.nameoffset: 1176, key.namelength: 12, - key.bodyoffset: 1234, + key.bodyoffset: 1209, key.bodylength: 5, key.attributes: [ { - key.offset: 1183, + key.offset: 1158, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4839,15 +4822,15 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.struct, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooStruct1", - key.offset: 1251, + key.offset: 1226, key.length: 129, - key.nameoffset: 1258, + key.nameoffset: 1233, key.namelength: 10, - key.bodyoffset: 1270, + key.bodyoffset: 1245, key.bodylength: 109, key.attributes: [ { - key.offset: 1244, + key.offset: 1219, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4857,13 +4840,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init()", - key.offset: 1283, + key.offset: 1258, key.length: 6, - key.nameoffset: 1283, + key.nameoffset: 1258, key.namelength: 6, key.attributes: [ { - key.offset: 1276, + key.offset: 1251, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4873,13 +4856,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init(x:y:)", - key.offset: 1302, + key.offset: 1277, key.length: 25, - key.nameoffset: 1302, + key.nameoffset: 1277, key.namelength: 25, key.attributes: [ { - key.offset: 1295, + key.offset: 1270, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4888,19 +4871,19 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "x", - key.offset: 1307, + key.offset: 1282, key.length: 8, key.typename: "Int32", - key.nameoffset: 1307, + key.nameoffset: 1282, key.namelength: 1 }, { key.kind: source.lang.swift.decl.var.parameter, key.name: "y", - key.offset: 1317, + key.offset: 1292, key.length: 9, key.typename: "Double", - key.nameoffset: 1317, + key.nameoffset: 1292, key.namelength: 1 } ] @@ -4910,14 +4893,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.public, key.setter_accessibility: source.lang.swift.accessibility.public, key.name: "x", - key.offset: 1340, + key.offset: 1315, key.length: 12, key.typename: "Int32", - key.nameoffset: 1344, + key.nameoffset: 1319, key.namelength: 1, key.attributes: [ { - key.offset: 1333, + key.offset: 1308, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4928,14 +4911,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.public, key.setter_accessibility: source.lang.swift.accessibility.public, key.name: "y", - key.offset: 1365, + key.offset: 1340, key.length: 13, key.typename: "Double", - key.nameoffset: 1369, + key.nameoffset: 1344, key.namelength: 1, key.attributes: [ { - key.offset: 1358, + key.offset: 1333, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4947,13 +4930,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.typealias, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooStruct1Pointer", - key.offset: 1389, + key.offset: 1364, key.length: 62, - key.nameoffset: 1399, + key.nameoffset: 1374, key.namelength: 17, key.attributes: [ { - key.offset: 1382, + key.offset: 1357, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4963,15 +4946,15 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.struct, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooStruct2", - key.offset: 1460, + key.offset: 1435, key.length: 129, - key.nameoffset: 1467, + key.nameoffset: 1442, key.namelength: 10, - key.bodyoffset: 1479, + key.bodyoffset: 1454, key.bodylength: 109, key.attributes: [ { - key.offset: 1453, + key.offset: 1428, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4981,13 +4964,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init()", - key.offset: 1492, + key.offset: 1467, key.length: 6, - key.nameoffset: 1492, + key.nameoffset: 1467, key.namelength: 6, key.attributes: [ { - key.offset: 1485, + key.offset: 1460, key.length: 6, key.attribute: source.decl.attribute.public } @@ -4997,13 +4980,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init(x:y:)", - key.offset: 1511, + key.offset: 1486, key.length: 25, - key.nameoffset: 1511, + key.nameoffset: 1486, key.namelength: 25, key.attributes: [ { - key.offset: 1504, + key.offset: 1479, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5012,19 +4995,19 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "x", - key.offset: 1516, + key.offset: 1491, key.length: 8, key.typename: "Int32", - key.nameoffset: 1516, + key.nameoffset: 1491, key.namelength: 1 }, { key.kind: source.lang.swift.decl.var.parameter, key.name: "y", - key.offset: 1526, + key.offset: 1501, key.length: 9, key.typename: "Double", - key.nameoffset: 1526, + key.nameoffset: 1501, key.namelength: 1 } ] @@ -5034,14 +5017,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.public, key.setter_accessibility: source.lang.swift.accessibility.public, key.name: "x", - key.offset: 1549, + key.offset: 1524, key.length: 12, key.typename: "Int32", - key.nameoffset: 1553, + key.nameoffset: 1528, key.namelength: 1, key.attributes: [ { - key.offset: 1542, + key.offset: 1517, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5052,14 +5035,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.public, key.setter_accessibility: source.lang.swift.accessibility.public, key.name: "y", - key.offset: 1574, + key.offset: 1549, key.length: 13, key.typename: "Double", - key.nameoffset: 1578, + key.nameoffset: 1553, key.namelength: 1, key.attributes: [ { - key.offset: 1567, + key.offset: 1542, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5071,13 +5054,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.typealias, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooStructTypedef1", - key.offset: 1598, + key.offset: 1573, key.length: 40, - key.nameoffset: 1608, + key.nameoffset: 1583, key.namelength: 17, key.attributes: [ { - key.offset: 1591, + key.offset: 1566, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5087,15 +5070,15 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.struct, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooStructTypedef2", - key.offset: 1647, + key.offset: 1622, key.length: 136, - key.nameoffset: 1654, + key.nameoffset: 1629, key.namelength: 17, - key.bodyoffset: 1673, + key.bodyoffset: 1648, key.bodylength: 109, key.attributes: [ { - key.offset: 1640, + key.offset: 1615, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5105,13 +5088,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init()", - key.offset: 1686, + key.offset: 1661, key.length: 6, - key.nameoffset: 1686, + key.nameoffset: 1661, key.namelength: 6, key.attributes: [ { - key.offset: 1679, + key.offset: 1654, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5121,13 +5104,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init(x:y:)", - key.offset: 1705, + key.offset: 1680, key.length: 25, - key.nameoffset: 1705, + key.nameoffset: 1680, key.namelength: 25, key.attributes: [ { - key.offset: 1698, + key.offset: 1673, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5136,19 +5119,19 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "x", - key.offset: 1710, + key.offset: 1685, key.length: 8, key.typename: "Int32", - key.nameoffset: 1710, + key.nameoffset: 1685, key.namelength: 1 }, { key.kind: source.lang.swift.decl.var.parameter, key.name: "y", - key.offset: 1720, + key.offset: 1695, key.length: 9, key.typename: "Double", - key.nameoffset: 1720, + key.nameoffset: 1695, key.namelength: 1 } ] @@ -5158,14 +5141,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.public, key.setter_accessibility: source.lang.swift.accessibility.public, key.name: "x", - key.offset: 1743, + key.offset: 1718, key.length: 12, key.typename: "Int32", - key.nameoffset: 1747, + key.nameoffset: 1722, key.namelength: 1, key.attributes: [ { - key.offset: 1736, + key.offset: 1711, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5176,14 +5159,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.public, key.setter_accessibility: source.lang.swift.accessibility.public, key.name: "y", - key.offset: 1768, + key.offset: 1743, key.length: 13, key.typename: "Double", - key.nameoffset: 1772, + key.nameoffset: 1747, key.namelength: 1, key.attributes: [ { - key.offset: 1761, + key.offset: 1736, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5195,15 +5178,15 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.typealias, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooTypedef1", - key.offset: 1821, + key.offset: 1796, key.length: 29, - key.nameoffset: 1831, + key.nameoffset: 1806, key.namelength: 11, - key.docoffset: 1785, + key.docoffset: 1760, key.doclength: 29, key.attributes: [ { - key.offset: 1814, + key.offset: 1789, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5214,16 +5197,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.public, key.setter_accessibility: source.lang.swift.accessibility.public, key.name: "fooIntVar", - key.offset: 1886, + key.offset: 1861, key.length: 20, key.typename: "Int32", - key.nameoffset: 1890, + key.nameoffset: 1865, key.namelength: 9, - key.docoffset: 1852, + key.docoffset: 1827, key.doclength: 27, key.attributes: [ { - key.offset: 1879, + key.offset: 1854, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5233,16 +5216,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fooFunc1(_:)", - key.offset: 1941, + key.offset: 1916, key.length: 34, key.typename: "Int32", - key.nameoffset: 1946, + key.nameoffset: 1921, key.namelength: 20, - key.docoffset: 1908, + key.docoffset: 1883, key.doclength: 26, key.attributes: [ { - key.offset: 1934, + key.offset: 1909, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5251,7 +5234,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "a", - key.offset: 1955, + key.offset: 1930, key.length: 10, key.typename: "Int32" } @@ -5261,14 +5244,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fooFunc1AnonymousParam(_:)", - key.offset: 1984, + key.offset: 1959, key.length: 46, key.typename: "Int32", - key.nameoffset: 1989, + key.nameoffset: 1964, key.namelength: 32, key.attributes: [ { - key.offset: 1977, + key.offset: 1952, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5276,7 +5259,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.substructure: [ { key.kind: source.lang.swift.decl.var.parameter, - key.offset: 2012, + key.offset: 1987, key.length: 8, key.typename: "Int32" } @@ -5286,14 +5269,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fooFunc3(_:_:_:_:)", - key.offset: 2039, + key.offset: 2014, key.length: 94, key.typename: "Int32", - key.nameoffset: 2044, + key.nameoffset: 2019, key.namelength: 80, key.attributes: [ { - key.offset: 2032, + key.offset: 2007, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5302,28 +5285,28 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "a", - key.offset: 2053, + key.offset: 2028, key.length: 10, key.typename: "Int32" }, { key.kind: source.lang.swift.decl.var.parameter, key.name: "b", - key.offset: 2065, + key.offset: 2040, key.length: 10, key.typename: "Float" }, { key.kind: source.lang.swift.decl.var.parameter, key.name: "c", - key.offset: 2077, + key.offset: 2052, key.length: 11, key.typename: "Double" }, { key.kind: source.lang.swift.decl.var.parameter, key.name: "d", - key.offset: 2090, + key.offset: 2065, key.length: 33, key.typename: "UnsafeMutablePointer!" } @@ -5333,13 +5316,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fooFuncWithBlock(_:)", - key.offset: 2142, + key.offset: 2117, key.length: 49, - key.nameoffset: 2147, + key.nameoffset: 2122, key.namelength: 44, key.attributes: [ { - key.offset: 2135, + key.offset: 2110, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5348,7 +5331,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "blk", - key.offset: 2164, + key.offset: 2139, key.length: 26, key.typename: "((Float) -> Int32)!" } @@ -5358,13 +5341,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fooFuncWithFunctionPointer(_:)", - key.offset: 2200, + key.offset: 2175, key.length: 75, - key.nameoffset: 2205, + key.nameoffset: 2180, key.namelength: 70, key.attributes: [ { - key.offset: 2193, + key.offset: 2168, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5373,7 +5356,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "fptr", - key.offset: 2232, + key.offset: 2207, key.length: 42, key.typename: "(@convention(c) (Float) -> Int32)!" } @@ -5383,14 +5366,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fooFuncNoreturn1()", - key.offset: 2284, + key.offset: 2259, key.length: 32, key.typename: "Never", - key.nameoffset: 2289, + key.nameoffset: 2264, key.namelength: 18, key.attributes: [ { - key.offset: 2277, + key.offset: 2252, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5400,14 +5383,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fooFuncNoreturn2()", - key.offset: 2325, + key.offset: 2300, key.length: 32, key.typename: "Never", - key.nameoffset: 2330, + key.nameoffset: 2305, key.namelength: 18, key.attributes: [ { - key.offset: 2318, + key.offset: 2293, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5417,15 +5400,15 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fooFuncWithComment1()", - key.offset: 2429, + key.offset: 2404, key.length: 26, - key.nameoffset: 2434, + key.nameoffset: 2409, key.namelength: 21, - key.docoffset: 2359, + key.docoffset: 2334, key.doclength: 62, key.attributes: [ { - key.offset: 2422, + key.offset: 2397, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5435,15 +5418,15 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fooFuncWithComment2()", - key.offset: 2507, + key.offset: 2482, key.length: 26, - key.nameoffset: 2512, + key.nameoffset: 2487, key.namelength: 21, - key.docoffset: 2457, + key.docoffset: 2432, key.doclength: 42, key.attributes: [ { - key.offset: 2500, + key.offset: 2475, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5453,15 +5436,15 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fooFuncWithComment3()", - key.offset: 2602, + key.offset: 2577, key.length: 26, - key.nameoffset: 2607, + key.nameoffset: 2582, key.namelength: 21, - key.docoffset: 2535, + key.docoffset: 2510, key.doclength: 59, key.attributes: [ { - key.offset: 2595, + key.offset: 2570, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5471,15 +5454,15 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fooFuncWithComment4()", - key.offset: 2690, + key.offset: 2665, key.length: 26, - key.nameoffset: 2695, + key.nameoffset: 2670, key.namelength: 21, - key.docoffset: 2630, + key.docoffset: 2605, key.doclength: 53, key.attributes: [ { - key.offset: 2683, + key.offset: 2658, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5489,15 +5472,15 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fooFuncWithComment5()", - key.offset: 2784, + key.offset: 2759, key.length: 26, - key.nameoffset: 2789, + key.nameoffset: 2764, key.namelength: 21, - key.docoffset: 2718, + key.docoffset: 2693, key.doclength: 59, key.attributes: [ { - key.offset: 2777, + key.offset: 2752, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5507,16 +5490,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "redeclaredInMultipleModulesFunc1(_:)", - key.offset: 2869, + key.offset: 2844, key.length: 58, key.typename: "Int32", - key.nameoffset: 2874, + key.nameoffset: 2849, key.namelength: 44, - key.docoffset: 2812, + key.docoffset: 2787, key.doclength: 50, key.attributes: [ { - key.offset: 2862, + key.offset: 2837, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5525,7 +5508,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "a", - key.offset: 2907, + key.offset: 2882, key.length: 10, key.typename: "Int32" } @@ -5535,17 +5518,17 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.protocol, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooProtocolBase", - key.offset: 2969, + key.offset: 2944, key.length: 498, - key.nameoffset: 2978, + key.nameoffset: 2953, key.namelength: 15, - key.bodyoffset: 2995, + key.bodyoffset: 2970, key.bodylength: 471, - key.docoffset: 2929, + key.docoffset: 2904, key.doclength: 33, key.attributes: [ { - key.offset: 2962, + key.offset: 2937, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5555,42 +5538,42 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "fooProtoFunc()", - key.offset: 3048, + key.offset: 3023, key.length: 19, - key.nameoffset: 3053, + key.nameoffset: 3028, key.namelength: 14, - key.docoffset: 3001, + key.docoffset: 2976, key.doclength: 43 }, { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "fooProtoFuncWithExtraIndentation1()", - key.offset: 3141, + key.offset: 3116, key.length: 40, - key.nameoffset: 3146, + key.nameoffset: 3121, key.namelength: 35, - key.docoffset: 3073, + key.docoffset: 3048, key.doclength: 64 }, { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "fooProtoFuncWithExtraIndentation2()", - key.offset: 3269, + key.offset: 3244, key.length: 40, - key.nameoffset: 3274, + key.nameoffset: 3249, key.namelength: 35, - key.docoffset: 3187, + key.docoffset: 3162, key.doclength: 77 }, { key.kind: source.lang.swift.decl.function.method.static, key.accessibility: source.lang.swift.accessibility.public, key.name: "fooProtoClassFunc()", - key.offset: 3315, + key.offset: 3290, key.length: 31, - key.nameoffset: 3327, + key.nameoffset: 3302, key.namelength: 19 }, { @@ -5598,12 +5581,12 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.public, key.setter_accessibility: source.lang.swift.accessibility.public, key.name: "fooProperty1", - key.offset: 3352, + key.offset: 3327, key.length: 35, key.typename: "Int32", - key.nameoffset: 3356, + key.nameoffset: 3331, key.namelength: 12, - key.bodyoffset: 3377, + key.bodyoffset: 3352, key.bodylength: 9 }, { @@ -5611,24 +5594,24 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.public, key.setter_accessibility: source.lang.swift.accessibility.public, key.name: "fooProperty2", - key.offset: 3393, + key.offset: 3368, key.length: 35, key.typename: "Int32", - key.nameoffset: 3397, + key.nameoffset: 3372, key.namelength: 12, - key.bodyoffset: 3418, + key.bodyoffset: 3393, key.bodylength: 9 }, { key.kind: source.lang.swift.decl.var.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "fooProperty3", - key.offset: 3434, + key.offset: 3409, key.length: 31, key.typename: "Int32", - key.nameoffset: 3438, + key.nameoffset: 3413, key.namelength: 12, - key.bodyoffset: 3459, + key.bodyoffset: 3434, key.bodylength: 5 } ] @@ -5637,11 +5620,11 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.protocol, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooProtocolDerived", - key.offset: 3476, + key.offset: 3451, key.length: 49, - key.nameoffset: 3485, + key.nameoffset: 3460, key.namelength: 18, - key.bodyoffset: 3523, + key.bodyoffset: 3498, key.bodylength: 1, key.inheritedtypes: [ { @@ -5650,7 +5633,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { ], key.attributes: [ { - key.offset: 3469, + key.offset: 3444, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5658,7 +5641,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.elements: [ { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 3506, + key.offset: 3481, key.length: 15 } ] @@ -5667,15 +5650,15 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.class, key.accessibility: source.lang.swift.accessibility.open, key.name: "FooClassBase", - key.offset: 3532, + key.offset: 3507, key.length: 285, - key.nameoffset: 3538, + key.nameoffset: 3513, key.namelength: 12, - key.bodyoffset: 3552, + key.bodyoffset: 3527, key.bodylength: 264, key.attributes: [ { - key.offset: 3527, + key.offset: 3502, key.length: 4, key.attribute: source.decl.attribute.open } @@ -5685,13 +5668,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.open, key.name: "fooBaseInstanceFunc0()", - key.offset: 3563, + key.offset: 3538, key.length: 27, - key.nameoffset: 3568, + key.nameoffset: 3543, key.namelength: 22, key.attributes: [ { - key.offset: 3558, + key.offset: 3533, key.length: 4, key.attribute: source.decl.attribute.open } @@ -5701,14 +5684,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.open, key.name: "fooBaseInstanceFunc1(_:)", - key.offset: 3601, + key.offset: 3576, key.length: 60, key.typename: "FooClassBase!", - key.nameoffset: 3606, + key.nameoffset: 3581, key.namelength: 38, key.attributes: [ { - key.offset: 3596, + key.offset: 3571, key.length: 4, key.attribute: source.decl.attribute.open } @@ -5717,7 +5700,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "anObject", - key.offset: 3627, + key.offset: 3602, key.length: 16, key.typename: "Any!" } @@ -5727,13 +5710,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init()", - key.offset: 3674, + key.offset: 3649, key.length: 7, - key.nameoffset: 3674, + key.nameoffset: 3649, key.namelength: 7, key.attributes: [ { - key.offset: 3667, + key.offset: 3642, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5743,18 +5726,18 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init(float:)", - key.offset: 3706, + key.offset: 3681, key.length: 21, - key.nameoffset: 3706, + key.nameoffset: 3681, key.namelength: 21, key.attributes: [ { - key.offset: 3694, + key.offset: 3669, key.length: 11, key.attribute: source.decl.attribute.convenience }, { - key.offset: 3687, + key.offset: 3662, key.length: 6, key.attribute: source.decl.attribute.public } @@ -5763,10 +5746,10 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "f", - key.offset: 3712, + key.offset: 3687, key.length: 14, key.typename: "Float", - key.nameoffset: 3712, + key.nameoffset: 3687, key.namelength: 5 } ] @@ -5775,13 +5758,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.open, key.name: "fooBaseInstanceFuncOverridden()", - key.offset: 3738, + key.offset: 3713, key.length: 36, - key.nameoffset: 3743, + key.nameoffset: 3718, key.namelength: 31, key.attributes: [ { - key.offset: 3733, + key.offset: 3708, key.length: 4, key.attribute: source.decl.attribute.open } @@ -5791,13 +5774,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.class, key.accessibility: source.lang.swift.accessibility.open, key.name: "fooBaseClassFunc0()", - key.offset: 3785, + key.offset: 3760, key.length: 30, - key.nameoffset: 3796, + key.nameoffset: 3771, key.namelength: 19, key.attributes: [ { - key.offset: 3780, + key.offset: 3755, key.length: 4, key.attribute: source.decl.attribute.open } @@ -5809,13 +5792,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.class, key.accessibility: source.lang.swift.accessibility.open, key.name: "FooClassDerived", - key.offset: 3857, + key.offset: 3832, key.length: 392, - key.nameoffset: 3863, + key.nameoffset: 3838, key.namelength: 15, - key.bodyoffset: 3915, + key.bodyoffset: 3890, key.bodylength: 333, - key.docoffset: 3819, + key.docoffset: 3794, key.doclength: 33, key.inheritedtypes: [ { @@ -5827,7 +5810,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { ], key.attributes: [ { - key.offset: 3852, + key.offset: 3827, key.length: 4, key.attribute: source.decl.attribute.open } @@ -5835,12 +5818,12 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.elements: [ { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 3881, + key.offset: 3856, key.length: 12 }, { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 3895, + key.offset: 3870, key.length: 18 } ], @@ -5850,14 +5833,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.open, key.setter_accessibility: source.lang.swift.accessibility.open, key.name: "fooProperty1", - key.offset: 3926, + key.offset: 3901, key.length: 23, key.typename: "Int32", - key.nameoffset: 3930, + key.nameoffset: 3905, key.namelength: 12, key.attributes: [ { - key.offset: 3921, + key.offset: 3896, key.length: 4, key.attribute: source.decl.attribute.open } @@ -5868,14 +5851,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.open, key.setter_accessibility: source.lang.swift.accessibility.open, key.name: "fooProperty2", - key.offset: 3960, + key.offset: 3935, key.length: 23, key.typename: "Int32", - key.nameoffset: 3964, + key.nameoffset: 3939, key.namelength: 12, key.attributes: [ { - key.offset: 3955, + key.offset: 3930, key.length: 4, key.attribute: source.decl.attribute.open } @@ -5885,16 +5868,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.instance, key.accessibility: source.lang.swift.accessibility.open, key.name: "fooProperty3", - key.offset: 3994, + key.offset: 3969, key.length: 31, key.typename: "Int32", - key.nameoffset: 3998, + key.nameoffset: 3973, key.namelength: 12, - key.bodyoffset: 4019, + key.bodyoffset: 3994, key.bodylength: 5, key.attributes: [ { - key.offset: 3989, + key.offset: 3964, key.length: 4, key.attribute: source.decl.attribute.open } @@ -5904,13 +5887,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.open, key.name: "fooInstanceFunc0()", - key.offset: 4036, + key.offset: 4011, key.length: 23, - key.nameoffset: 4041, + key.nameoffset: 4016, key.namelength: 18, key.attributes: [ { - key.offset: 4031, + key.offset: 4006, key.length: 4, key.attribute: source.decl.attribute.open } @@ -5920,13 +5903,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.open, key.name: "fooInstanceFunc1(_:)", - key.offset: 4070, + key.offset: 4045, key.length: 33, - key.nameoffset: 4075, + key.nameoffset: 4050, key.namelength: 28, key.attributes: [ { - key.offset: 4065, + key.offset: 4040, key.length: 4, key.attribute: source.decl.attribute.open } @@ -5935,7 +5918,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "a", - key.offset: 4092, + key.offset: 4067, key.length: 10, key.typename: "Int32" } @@ -5945,13 +5928,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.open, key.name: "fooInstanceFunc2(_:withB:)", - key.offset: 4114, + key.offset: 4089, key.length: 49, - key.nameoffset: 4119, + key.nameoffset: 4094, key.namelength: 44, key.attributes: [ { - key.offset: 4109, + key.offset: 4084, key.length: 4, key.attribute: source.decl.attribute.open } @@ -5960,17 +5943,17 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "a", - key.offset: 4136, + key.offset: 4111, key.length: 10, key.typename: "Int32" }, { key.kind: source.lang.swift.decl.var.parameter, key.name: "b", - key.offset: 4148, + key.offset: 4123, key.length: 14, key.typename: "Int32", - key.nameoffset: 4148, + key.nameoffset: 4123, key.namelength: 5 } ] @@ -5979,13 +5962,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.open, key.name: "fooBaseInstanceFuncOverridden()", - key.offset: 4174, + key.offset: 4149, key.length: 36, - key.nameoffset: 4179, + key.nameoffset: 4154, key.namelength: 31, key.attributes: [ { - key.offset: 4169, + key.offset: 4144, key.length: 4, key.attribute: source.decl.attribute.open } @@ -5995,13 +5978,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.class, key.accessibility: source.lang.swift.accessibility.open, key.name: "fooClassFunc0()", - key.offset: 4221, + key.offset: 4196, key.length: 26, - key.nameoffset: 4232, + key.nameoffset: 4207, key.namelength: 15, key.attributes: [ { - key.offset: 4216, + key.offset: 4191, key.length: 4, key.attribute: source.decl.attribute.open } @@ -6013,13 +5996,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.typealias, key.accessibility: source.lang.swift.accessibility.public, key.name: "typedef_int_t", - key.offset: 4258, + key.offset: 4233, key.length: 31, - key.nameoffset: 4268, + key.nameoffset: 4243, key.namelength: 13, key.attributes: [ { - key.offset: 4251, + key.offset: 4226, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6029,16 +6012,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FOO_MACRO_1", - key.offset: 4298, + key.offset: 4273, key.length: 30, key.typename: "Int32", - key.nameoffset: 4302, + key.nameoffset: 4277, key.namelength: 11, - key.bodyoffset: 4322, + key.bodyoffset: 4297, key.bodylength: 5, key.attributes: [ { - key.offset: 4291, + key.offset: 4266, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6048,16 +6031,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FOO_MACRO_2", - key.offset: 4337, + key.offset: 4312, key.length: 30, key.typename: "Int32", - key.nameoffset: 4341, + key.nameoffset: 4316, key.namelength: 11, - key.bodyoffset: 4361, + key.bodyoffset: 4336, key.bodylength: 5, key.attributes: [ { - key.offset: 4330, + key.offset: 4305, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6067,16 +6050,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FOO_MACRO_3", - key.offset: 4376, + key.offset: 4351, key.length: 30, key.typename: "Int32", - key.nameoffset: 4380, + key.nameoffset: 4355, key.namelength: 11, - key.bodyoffset: 4400, + key.bodyoffset: 4375, key.bodylength: 5, key.attributes: [ { - key.offset: 4369, + key.offset: 4344, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6086,16 +6069,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FOO_MACRO_4", - key.offset: 4415, + key.offset: 4390, key.length: 31, key.typename: "UInt32", - key.nameoffset: 4419, + key.nameoffset: 4394, key.namelength: 11, - key.bodyoffset: 4440, + key.bodyoffset: 4415, key.bodylength: 5, key.attributes: [ { - key.offset: 4408, + key.offset: 4383, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6105,16 +6088,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FOO_MACRO_5", - key.offset: 4455, + key.offset: 4430, key.length: 31, key.typename: "UInt64", - key.nameoffset: 4459, + key.nameoffset: 4434, key.namelength: 11, - key.bodyoffset: 4480, + key.bodyoffset: 4455, key.bodylength: 5, key.attributes: [ { - key.offset: 4448, + key.offset: 4423, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6124,16 +6107,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FOO_MACRO_6", - key.offset: 4495, + key.offset: 4470, key.length: 38, key.typename: "typedef_int_t", - key.nameoffset: 4499, + key.nameoffset: 4474, key.namelength: 11, - key.bodyoffset: 4527, + key.bodyoffset: 4502, key.bodylength: 5, key.attributes: [ { - key.offset: 4488, + key.offset: 4463, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6143,16 +6126,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FOO_MACRO_7", - key.offset: 4542, + key.offset: 4517, key.length: 38, key.typename: "typedef_int_t", - key.nameoffset: 4546, + key.nameoffset: 4521, key.namelength: 11, - key.bodyoffset: 4574, + key.bodyoffset: 4549, key.bodylength: 5, key.attributes: [ { - key.offset: 4535, + key.offset: 4510, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6162,16 +6145,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FOO_MACRO_8", - key.offset: 4589, + key.offset: 4564, key.length: 30, key.typename: "CChar", - key.nameoffset: 4593, + key.nameoffset: 4568, key.namelength: 11, - key.bodyoffset: 4613, + key.bodyoffset: 4588, key.bodylength: 5, key.attributes: [ { - key.offset: 4582, + key.offset: 4557, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6181,16 +6164,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FOO_MACRO_9", - key.offset: 4628, + key.offset: 4603, key.length: 30, key.typename: "Int32", - key.nameoffset: 4632, + key.nameoffset: 4607, key.namelength: 11, - key.bodyoffset: 4652, + key.bodyoffset: 4627, key.bodylength: 5, key.attributes: [ { - key.offset: 4621, + key.offset: 4596, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6200,16 +6183,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FOO_MACRO_10", - key.offset: 4667, + key.offset: 4642, key.length: 31, key.typename: "Int16", - key.nameoffset: 4671, + key.nameoffset: 4646, key.namelength: 12, - key.bodyoffset: 4692, + key.bodyoffset: 4667, key.bodylength: 5, key.attributes: [ { - key.offset: 4660, + key.offset: 4635, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6219,16 +6202,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FOO_MACRO_11", - key.offset: 4707, + key.offset: 4682, key.length: 29, key.typename: "Int", - key.nameoffset: 4711, + key.nameoffset: 4686, key.namelength: 12, - key.bodyoffset: 4730, + key.bodyoffset: 4705, key.bodylength: 5, key.attributes: [ { - key.offset: 4700, + key.offset: 4675, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6238,16 +6221,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FOO_MACRO_OR", - key.offset: 4745, + key.offset: 4720, key.length: 31, key.typename: "Int32", - key.nameoffset: 4749, + key.nameoffset: 4724, key.namelength: 12, - key.bodyoffset: 4770, + key.bodyoffset: 4745, key.bodylength: 5, key.attributes: [ { - key.offset: 4738, + key.offset: 4713, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6257,16 +6240,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FOO_MACRO_AND", - key.offset: 4785, + key.offset: 4760, key.length: 32, key.typename: "Int32", - key.nameoffset: 4789, + key.nameoffset: 4764, key.namelength: 13, - key.bodyoffset: 4811, + key.bodyoffset: 4786, key.bodylength: 5, key.attributes: [ { - key.offset: 4778, + key.offset: 4753, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6276,16 +6259,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FOO_MACRO_BITWIDTH", - key.offset: 4826, + key.offset: 4801, key.length: 38, key.typename: "UInt64", - key.nameoffset: 4830, + key.nameoffset: 4805, key.namelength: 18, - key.bodyoffset: 4858, + key.bodyoffset: 4833, key.bodylength: 5, key.attributes: [ { - key.offset: 4819, + key.offset: 4794, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6295,16 +6278,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FOO_MACRO_SIGNED", - key.offset: 4873, + key.offset: 4848, key.length: 36, key.typename: "UInt32", - key.nameoffset: 4877, + key.nameoffset: 4852, key.namelength: 16, - key.bodyoffset: 4903, + key.bodyoffset: 4878, key.bodylength: 5, key.attributes: [ { - key.offset: 4866, + key.offset: 4841, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6314,16 +6297,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FOO_MACRO_REDEF_1", - key.offset: 4918, + key.offset: 4893, key.length: 36, key.typename: "Int32", - key.nameoffset: 4922, + key.nameoffset: 4897, key.namelength: 17, - key.bodyoffset: 4948, + key.bodyoffset: 4923, key.bodylength: 5, key.attributes: [ { - key.offset: 4911, + key.offset: 4886, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6333,16 +6316,16 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FOO_MACRO_REDEF_2", - key.offset: 4963, + key.offset: 4938, key.length: 36, key.typename: "Int32", - key.nameoffset: 4967, + key.nameoffset: 4942, key.namelength: 17, - key.bodyoffset: 4993, + key.bodyoffset: 4968, key.bodylength: 5, key.attributes: [ { - key.offset: 4956, + key.offset: 4931, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6352,13 +6335,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "theLastDeclInFoo()", - key.offset: 5008, + key.offset: 4983, key.length: 23, - key.nameoffset: 5013, + key.nameoffset: 4988, key.namelength: 18, key.attributes: [ { - key.offset: 5001, + key.offset: 4976, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6368,13 +6351,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "_internalTopLevelFunc()", - key.offset: 5040, + key.offset: 5015, key.length: 28, - key.nameoffset: 5045, + key.nameoffset: 5020, key.namelength: 23, key.attributes: [ { - key.offset: 5033, + key.offset: 5008, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6384,15 +6367,15 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.struct, key.accessibility: source.lang.swift.accessibility.public, key.name: "_InternalStruct", - key.offset: 5077, + key.offset: 5052, key.length: 97, - key.nameoffset: 5084, + key.nameoffset: 5059, key.namelength: 15, - key.bodyoffset: 5101, + key.bodyoffset: 5076, key.bodylength: 72, key.attributes: [ { - key.offset: 5070, + key.offset: 5045, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6402,13 +6385,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init()", - key.offset: 5114, + key.offset: 5089, key.length: 6, - key.nameoffset: 5114, + key.nameoffset: 5089, key.namelength: 6, key.attributes: [ { - key.offset: 5107, + key.offset: 5082, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6418,13 +6401,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init(x:)", - key.offset: 5133, + key.offset: 5108, key.length: 14, - key.nameoffset: 5133, + key.nameoffset: 5108, key.namelength: 14, key.attributes: [ { - key.offset: 5126, + key.offset: 5101, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6433,10 +6416,10 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "x", - key.offset: 5138, + key.offset: 5113, key.length: 8, key.typename: "Int32", - key.nameoffset: 5138, + key.nameoffset: 5113, key.namelength: 1 } ] @@ -6446,14 +6429,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.public, key.setter_accessibility: source.lang.swift.accessibility.public, key.name: "x", - key.offset: 5160, + key.offset: 5135, key.length: 12, key.typename: "Int32", - key.nameoffset: 5164, + key.nameoffset: 5139, key.namelength: 1, key.attributes: [ { - key.offset: 5153, + key.offset: 5128, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6464,25 +6447,25 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.extension, key.name: "FooClassBase", - key.offset: 5176, + key.offset: 5151, key.length: 66, - key.nameoffset: 5186, + key.nameoffset: 5161, key.namelength: 12, - key.bodyoffset: 5200, + key.bodyoffset: 5175, key.bodylength: 41, key.substructure: [ { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.open, key.name: "_internalMeth1()", - key.offset: 5211, + key.offset: 5186, key.length: 29, key.typename: "Any!", - key.nameoffset: 5216, + key.nameoffset: 5191, key.namelength: 16, key.attributes: [ { - key.offset: 5206, + key.offset: 5181, key.length: 4, key.attribute: source.decl.attribute.open } @@ -6493,25 +6476,25 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.extension, key.name: "FooClassBase", - key.offset: 5244, + key.offset: 5219, key.length: 107, - key.nameoffset: 5254, + key.nameoffset: 5229, key.namelength: 12, - key.bodyoffset: 5268, + key.bodyoffset: 5243, key.bodylength: 82, key.substructure: [ { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.open, key.name: "_internalMeth2()", - key.offset: 5279, + key.offset: 5254, key.length: 29, key.typename: "Any!", - key.nameoffset: 5284, + key.nameoffset: 5259, key.namelength: 16, key.attributes: [ { - key.offset: 5274, + key.offset: 5249, key.length: 4, key.attribute: source.decl.attribute.open } @@ -6521,14 +6504,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.open, key.name: "nonInternalMeth()", - key.offset: 5319, + key.offset: 5294, key.length: 30, key.typename: "Any!", - key.nameoffset: 5324, + key.nameoffset: 5299, key.namelength: 17, key.attributes: [ { - key.offset: 5314, + key.offset: 5289, key.length: 4, key.attribute: source.decl.attribute.open } @@ -6539,25 +6522,25 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.extension, key.name: "FooClassBase", - key.offset: 5353, + key.offset: 5328, key.length: 66, - key.nameoffset: 5363, + key.nameoffset: 5338, key.namelength: 12, - key.bodyoffset: 5377, + key.bodyoffset: 5352, key.bodylength: 41, key.substructure: [ { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.open, key.name: "_internalMeth3()", - key.offset: 5388, + key.offset: 5363, key.length: 29, key.typename: "Any!", - key.nameoffset: 5393, + key.nameoffset: 5368, key.namelength: 16, key.attributes: [ { - key.offset: 5383, + key.offset: 5358, key.length: 4, key.attribute: source.decl.attribute.open } @@ -6569,15 +6552,15 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.protocol, key.accessibility: source.lang.swift.accessibility.public, key.name: "_InternalProt", - key.offset: 5428, + key.offset: 5403, key.length: 26, - key.nameoffset: 5437, + key.nameoffset: 5412, key.namelength: 13, - key.bodyoffset: 5452, + key.bodyoffset: 5427, key.bodylength: 1, key.attributes: [ { - key.offset: 5421, + key.offset: 5396, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6587,11 +6570,11 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.class, key.accessibility: source.lang.swift.accessibility.open, key.name: "ClassWithInternalProt", - key.offset: 5461, + key.offset: 5436, key.length: 47, - key.nameoffset: 5467, + key.nameoffset: 5442, key.namelength: 21, - key.bodyoffset: 5506, + key.bodyoffset: 5481, key.bodylength: 1, key.inheritedtypes: [ { @@ -6600,7 +6583,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { ], key.attributes: [ { - key.offset: 5456, + key.offset: 5431, key.length: 4, key.attribute: source.decl.attribute.open } @@ -6608,7 +6591,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.elements: [ { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 5491, + key.offset: 5466, key.length: 13 } ] @@ -6617,11 +6600,11 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.class, key.accessibility: source.lang.swift.accessibility.open, key.name: "FooClassPropertyOwnership", - key.offset: 5515, + key.offset: 5490, key.length: 319, - key.nameoffset: 5521, + key.nameoffset: 5496, key.namelength: 25, - key.bodyoffset: 5563, + key.bodyoffset: 5538, key.bodylength: 270, key.inheritedtypes: [ { @@ -6630,7 +6613,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { ], key.attributes: [ { - key.offset: 5510, + key.offset: 5485, key.length: 4, key.attribute: source.decl.attribute.open } @@ -6638,7 +6621,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.elements: [ { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 5549, + key.offset: 5524, key.length: 12 } ], @@ -6648,19 +6631,19 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.open, key.setter_accessibility: source.lang.swift.accessibility.open, key.name: "assignable", - key.offset: 5590, + key.offset: 5565, key.length: 26, key.typename: "AnyObject!", - key.nameoffset: 5594, + key.nameoffset: 5569, key.namelength: 10, key.attributes: [ { - key.offset: 5585, + key.offset: 5560, key.length: 4, key.attribute: source.decl.attribute.open }, { - key.offset: 5569, + key.offset: 5544, key.length: 15, key.attribute: source.decl.attribute.weak } @@ -6671,19 +6654,19 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.open, key.setter_accessibility: source.lang.swift.accessibility.open, key.name: "unsafeAssignable", - key.offset: 5643, + key.offset: 5618, key.length: 32, key.typename: "AnyObject!", - key.nameoffset: 5647, + key.nameoffset: 5622, key.namelength: 16, key.attributes: [ { - key.offset: 5638, + key.offset: 5613, key.length: 4, key.attribute: source.decl.attribute.open }, { - key.offset: 5622, + key.offset: 5597, key.length: 15, key.attribute: source.decl.attribute.weak } @@ -6694,14 +6677,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.open, key.setter_accessibility: source.lang.swift.accessibility.open, key.name: "retainable", - key.offset: 5686, + key.offset: 5661, key.length: 20, key.typename: "Any!", - key.nameoffset: 5690, + key.nameoffset: 5665, key.namelength: 10, key.attributes: [ { - key.offset: 5681, + key.offset: 5656, key.length: 4, key.attribute: source.decl.attribute.open } @@ -6712,14 +6695,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.open, key.setter_accessibility: source.lang.swift.accessibility.open, key.name: "strongRef", - key.offset: 5717, + key.offset: 5692, key.length: 19, key.typename: "Any!", - key.nameoffset: 5721, + key.nameoffset: 5696, key.namelength: 9, key.attributes: [ { - key.offset: 5712, + key.offset: 5687, key.length: 4, key.attribute: source.decl.attribute.open } @@ -6730,14 +6713,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.open, key.setter_accessibility: source.lang.swift.accessibility.open, key.name: "copyable", - key.offset: 5747, + key.offset: 5722, key.length: 18, key.typename: "Any!", - key.nameoffset: 5751, + key.nameoffset: 5726, key.namelength: 8, key.attributes: [ { - key.offset: 5742, + key.offset: 5717, key.length: 4, key.attribute: source.decl.attribute.open } @@ -6748,19 +6731,19 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.open, key.setter_accessibility: source.lang.swift.accessibility.open, key.name: "weakRef", - key.offset: 5781, + key.offset: 5756, key.length: 23, key.typename: "AnyObject!", - key.nameoffset: 5785, + key.nameoffset: 5760, key.namelength: 7, key.attributes: [ { - key.offset: 5776, + key.offset: 5751, key.length: 4, key.attribute: source.decl.attribute.open }, { - key.offset: 5771, + key.offset: 5746, key.length: 4, key.attribute: source.decl.attribute.weak } @@ -6771,14 +6754,14 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.accessibility: source.lang.swift.accessibility.open, key.setter_accessibility: source.lang.swift.accessibility.open, key.name: "scalar", - key.offset: 5815, + key.offset: 5790, key.length: 17, key.typename: "Int32", - key.nameoffset: 5819, + key.nameoffset: 5794, key.namelength: 6, key.attributes: [ { - key.offset: 5810, + key.offset: 5785, key.length: 4, key.attribute: source.decl.attribute.open } @@ -6790,11 +6773,11 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.class, key.accessibility: source.lang.swift.accessibility.open, key.name: "FooUnavailableMembers", - key.offset: 5841, + key.offset: 5816, key.length: 329, - key.nameoffset: 5847, + key.nameoffset: 5822, key.namelength: 21, - key.bodyoffset: 5885, + key.bodyoffset: 5860, key.bodylength: 284, key.inheritedtypes: [ { @@ -6803,7 +6786,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { ], key.attributes: [ { - key.offset: 5836, + key.offset: 5811, key.length: 4, key.attribute: source.decl.attribute.open } @@ -6811,7 +6794,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.elements: [ { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 5871, + key.offset: 5846, key.length: 12 } ], @@ -6820,18 +6803,18 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init(int:)", - key.offset: 5910, + key.offset: 5885, key.length: 19, - key.nameoffset: 5910, + key.nameoffset: 5885, key.namelength: 19, key.attributes: [ { - key.offset: 5898, + key.offset: 5873, key.length: 11, key.attribute: source.decl.attribute.convenience }, { - key.offset: 5891, + key.offset: 5866, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6840,10 +6823,10 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { { key.kind: source.lang.swift.decl.var.parameter, key.name: "i", - key.offset: 5916, + key.offset: 5891, key.length: 12, key.typename: "Int32", - key.nameoffset: 5916, + key.nameoffset: 5891, key.namelength: 3 } ] @@ -6852,18 +6835,18 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.open, key.name: "deprecated()", - key.offset: 5984, + key.offset: 5959, key.length: 17, - key.nameoffset: 5989, + key.nameoffset: 5964, key.namelength: 12, key.attributes: [ { - key.offset: 5979, + key.offset: 5954, key.length: 4, key.attribute: source.decl.attribute.open }, { - key.offset: 5935, + key.offset: 5910, key.length: 39, key.attribute: source.decl.attribute.available } @@ -6873,18 +6856,18 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.open, key.name: "availabilityIntroduced()", - key.offset: 6042, + key.offset: 6017, key.length: 29, - key.nameoffset: 6047, + key.nameoffset: 6022, key.namelength: 24, key.attributes: [ { - key.offset: 6037, + key.offset: 6012, key.length: 4, key.attribute: source.decl.attribute.open }, { - key.offset: 6007, + key.offset: 5982, key.length: 25, key.attribute: source.decl.attribute.available } @@ -6894,18 +6877,18 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.open, key.name: "availabilityIntroducedMsg()", - key.offset: 6136, + key.offset: 6111, key.length: 32, - key.nameoffset: 6141, + key.nameoffset: 6116, key.namelength: 27, key.attributes: [ { - key.offset: 6131, + key.offset: 6106, key.length: 4, key.attribute: source.decl.attribute.open }, { - key.offset: 6077, + key.offset: 6052, key.length: 49, key.attribute: source.decl.attribute.available } @@ -6917,15 +6900,15 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.class, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooCFType", - key.offset: 6179, + key.offset: 6154, key.length: 19, - key.nameoffset: 6185, + key.nameoffset: 6160, key.namelength: 9, - key.bodyoffset: 6196, + key.bodyoffset: 6171, key.bodylength: 1, key.attributes: [ { - key.offset: 6172, + key.offset: 6147, key.length: 6, key.attribute: source.decl.attribute.public } @@ -6935,11 +6918,11 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.enum, key.accessibility: source.lang.swift.accessibility.public, key.name: "ABAuthorizationStatus", - key.offset: 6271, + key.offset: 6246, key.length: 89, - key.nameoffset: 6276, + key.nameoffset: 6251, key.namelength: 21, - key.bodyoffset: 6305, + key.bodyoffset: 6280, key.bodylength: 54, key.inheritedtypes: [ { @@ -6948,12 +6931,12 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { ], key.attributes: [ { - key.offset: 6264, + key.offset: 6239, key.length: 6, key.attribute: source.decl.attribute.public }, { - key.offset: 6200, + key.offset: 6175, key.length: 63, key.attribute: source.decl.attribute.available } @@ -6961,28 +6944,28 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.elements: [ { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 6300, + key.offset: 6275, key.length: 3 } ], key.substructure: [ { key.kind: source.lang.swift.decl.enumcase, - key.offset: 6311, + key.offset: 6286, key.length: 22, key.substructure: [ { key.kind: source.lang.swift.decl.enumelement, key.accessibility: source.lang.swift.accessibility.public, key.name: "notDetermined", - key.offset: 6316, + key.offset: 6291, key.length: 17, - key.nameoffset: 6316, + key.nameoffset: 6291, key.namelength: 13, key.elements: [ { key.kind: source.lang.swift.structure.elem.init_expr, - key.offset: 6332, + key.offset: 6307, key.length: 1 } ] @@ -6991,21 +6974,21 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { }, { key.kind: source.lang.swift.decl.enumcase, - key.offset: 6339, + key.offset: 6314, key.length: 19, key.substructure: [ { key.kind: source.lang.swift.decl.enumelement, key.accessibility: source.lang.swift.accessibility.public, key.name: "restricted", - key.offset: 6344, + key.offset: 6319, key.length: 14, - key.nameoffset: 6344, + key.nameoffset: 6319, key.namelength: 10, key.elements: [ { key.kind: source.lang.swift.structure.elem.init_expr, - key.offset: 6357, + key.offset: 6332, key.length: 1 } ] @@ -7018,15 +7001,15 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.class, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooOverlayClassBase", - key.offset: 6369, + key.offset: 6344, key.length: 50, - key.nameoffset: 6375, + key.nameoffset: 6350, key.namelength: 19, - key.bodyoffset: 6396, + key.bodyoffset: 6371, key.bodylength: 22, key.attributes: [ { - key.offset: 6362, + key.offset: 6337, key.length: 6, key.attribute: source.decl.attribute.public } @@ -7036,13 +7019,13 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "f()", - key.offset: 6409, + key.offset: 6384, key.length: 8, - key.nameoffset: 6414, + key.nameoffset: 6389, key.namelength: 3, key.attributes: [ { - key.offset: 6402, + key.offset: 6377, key.length: 6, key.attribute: source.decl.attribute.public } @@ -7054,11 +7037,11 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.class, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooOverlayClassDerived", - key.offset: 6428, + key.offset: 6403, key.length: 88, - key.nameoffset: 6434, + key.nameoffset: 6409, key.namelength: 22, - key.bodyoffset: 6484, + key.bodyoffset: 6459, key.bodylength: 31, key.inheritedtypes: [ { @@ -7067,7 +7050,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { ], key.attributes: [ { - key.offset: 6421, + key.offset: 6396, key.length: 6, key.attribute: source.decl.attribute.public } @@ -7075,7 +7058,7 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.elements: [ { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 6459, + key.offset: 6434, key.length: 23 } ], @@ -7084,18 +7067,18 @@ public class FooOverlayClassDerived : Foo.FooOverlayClassBase { key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "f()", - key.offset: 6506, + key.offset: 6481, key.length: 8, - key.nameoffset: 6511, + key.nameoffset: 6486, key.namelength: 3, key.attributes: [ { - key.offset: 6499, + key.offset: 6474, key.length: 6, key.attribute: source.decl.attribute.public }, { - key.offset: 6490, + key.offset: 6465, key.length: 8, key.attribute: source.decl.attribute.override } diff --git a/test/SourceKit/InterfaceGen/gen_clang_module.swift.sub.response b/test/SourceKit/InterfaceGen/gen_clang_module.swift.sub.response index a96f020da080a..be6aad83e56ee 100644 --- a/test/SourceKit/InterfaceGen/gen_clang_module.swift.sub.response +++ b/test/SourceKit/InterfaceGen/gen_clang_module.swift.sub.response @@ -1,4 +1,3 @@ - public func fooSubFunc1(_ a: Int32) -> Int32 public struct FooSubEnum1 : Hashable, Equatable, RawRepresentable { @@ -20,272 +19,272 @@ public var FooSubUnnamedEnumeratorA1: Int { get } [ { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1, + key.offset: 0, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 8, + key.offset: 7, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 13, + key.offset: 12, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 25, + key.offset: 24, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 27, + key.offset: 26, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 30, + key.offset: 29, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 40, + key.offset: 39, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 47, + key.offset: 46, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 54, + key.offset: 53, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 61, + key.offset: 60, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 75, + key.offset: 74, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 85, + key.offset: 84, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 96, + key.offset: 95, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 120, + key.offset: 119, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 127, + key.offset: 126, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 132, + key.offset: 131, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 134, + key.offset: 133, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 144, + key.offset: 143, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 157, + key.offset: 156, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 164, + key.offset: 163, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 169, + key.offset: 168, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 179, + key.offset: 178, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 192, + key.offset: 191, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 199, + key.offset: 198, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 203, + key.offset: 202, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 213, + key.offset: 212, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 223, + key.offset: 222, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 230, + key.offset: 229, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 234, + key.offset: 233, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 248, + key.offset: 247, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 262, + key.offset: 261, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 269, + key.offset: 268, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 276, + key.offset: 275, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 280, + key.offset: 279, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 294, + key.offset: 293, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 308, + key.offset: 307, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 315, + key.offset: 314, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 322, + key.offset: 321, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 326, + key.offset: 325, key.length: 25 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 353, + key.offset: 352, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 359, + key.offset: 358, key.length: 3 } ] [ { key.kind: source.lang.swift.ref.struct, - key.offset: 30, + key.offset: 29, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 40, + key.offset: 39, key.length: 5, key.is_system: 1 }, { key.kind: source.lang.swift.ref.protocol, - key.offset: 75, + key.offset: 74, key.length: 8, key.is_system: 1 }, { key.kind: source.lang.swift.ref.protocol, - key.offset: 85, + key.offset: 84, key.length: 9, key.is_system: 1 }, { key.kind: source.lang.swift.ref.protocol, - key.offset: 96, + key.offset: 95, key.length: 16, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 144, + key.offset: 143, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 179, + key.offset: 178, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 213, + key.offset: 212, key.length: 6, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 248, + key.offset: 247, key.length: 11 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 294, + key.offset: 293, key.length: 11 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 353, + key.offset: 352, key.length: 3, key.is_system: 1 } @@ -295,14 +294,14 @@ public var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fooSubFunc1(_:)", - key.offset: 8, + key.offset: 7, key.length: 37, key.typename: "Int32", - key.nameoffset: 13, + key.nameoffset: 12, key.namelength: 23, key.attributes: [ { - key.offset: 1, + key.offset: 0, key.length: 6, key.attribute: source.decl.attribute.public } @@ -311,7 +310,7 @@ public var FooSubUnnamedEnumeratorA1: Int { get } { key.kind: source.lang.swift.decl.var.parameter, key.name: "a", - key.offset: 25, + key.offset: 24, key.length: 10, key.typename: "Int32" } @@ -321,11 +320,11 @@ public var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.struct, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooSubEnum1", - key.offset: 54, + key.offset: 53, key.length: 167, - key.nameoffset: 61, + key.nameoffset: 60, key.namelength: 11, - key.bodyoffset: 114, + key.bodyoffset: 113, key.bodylength: 106, key.inheritedtypes: [ { @@ -340,7 +339,7 @@ public var FooSubUnnamedEnumeratorA1: Int { get } ], key.attributes: [ { - key.offset: 47, + key.offset: 46, key.length: 6, key.attribute: source.decl.attribute.public } @@ -348,17 +347,17 @@ public var FooSubUnnamedEnumeratorA1: Int { get } key.elements: [ { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 75, + key.offset: 74, key.length: 8 }, { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 85, + key.offset: 84, key.length: 9 }, { key.kind: source.lang.swift.structure.elem.typeref, - key.offset: 96, + key.offset: 95, key.length: 16 } ], @@ -367,13 +366,13 @@ public var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init(_:)", - key.offset: 127, + key.offset: 126, key.length: 24, - key.nameoffset: 127, + key.nameoffset: 126, key.namelength: 24, key.attributes: [ { - key.offset: 120, + key.offset: 119, key.length: 6, key.attribute: source.decl.attribute.public } @@ -382,7 +381,7 @@ public var FooSubUnnamedEnumeratorA1: Int { get } { key.kind: source.lang.swift.decl.var.parameter, key.name: "rawValue", - key.offset: 132, + key.offset: 131, key.length: 18, key.typename: "UInt32" } @@ -392,13 +391,13 @@ public var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init(rawValue:)", - key.offset: 164, + key.offset: 163, key.length: 22, - key.nameoffset: 164, + key.nameoffset: 163, key.namelength: 22, key.attributes: [ { - key.offset: 157, + key.offset: 156, key.length: 6, key.attribute: source.decl.attribute.public } @@ -407,10 +406,10 @@ public var FooSubUnnamedEnumeratorA1: Int { get } { key.kind: source.lang.swift.decl.var.parameter, key.name: "rawValue", - key.offset: 169, + key.offset: 168, key.length: 16, key.typename: "UInt32", - key.nameoffset: 169, + key.nameoffset: 168, key.namelength: 8 } ] @@ -420,14 +419,14 @@ public var FooSubUnnamedEnumeratorA1: Int { get } key.accessibility: source.lang.swift.accessibility.public, key.setter_accessibility: source.lang.swift.accessibility.public, key.name: "rawValue", - key.offset: 199, + key.offset: 198, key.length: 20, key.typename: "UInt32", - key.nameoffset: 203, + key.nameoffset: 202, key.namelength: 8, key.attributes: [ { - key.offset: 192, + key.offset: 191, key.length: 6, key.attribute: source.decl.attribute.public } @@ -439,16 +438,16 @@ public var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooSubEnum1X", - key.offset: 230, + key.offset: 229, key.length: 37, key.typename: "FooSubEnum1", - key.nameoffset: 234, + key.nameoffset: 233, key.namelength: 12, - key.bodyoffset: 261, + key.bodyoffset: 260, key.bodylength: 5, key.attributes: [ { - key.offset: 223, + key.offset: 222, key.length: 6, key.attribute: source.decl.attribute.public } @@ -458,16 +457,16 @@ public var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooSubEnum1Y", - key.offset: 276, + key.offset: 275, key.length: 37, key.typename: "FooSubEnum1", - key.nameoffset: 280, + key.nameoffset: 279, key.namelength: 12, - key.bodyoffset: 307, + key.bodyoffset: 306, key.bodylength: 5, key.attributes: [ { - key.offset: 269, + key.offset: 268, key.length: 6, key.attribute: source.decl.attribute.public } @@ -477,16 +476,16 @@ public var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.global, key.accessibility: source.lang.swift.accessibility.public, key.name: "FooSubUnnamedEnumeratorA1", - key.offset: 322, + key.offset: 321, key.length: 42, key.typename: "Int", - key.nameoffset: 326, + key.nameoffset: 325, key.namelength: 25, - key.bodyoffset: 358, + key.bodyoffset: 357, key.bodylength: 5, key.attributes: [ { - key.offset: 315, + key.offset: 314, key.length: 6, key.attribute: source.decl.attribute.public } diff --git a/test/SourceKit/InterfaceGen/gen_public_module_name.swift b/test/SourceKit/InterfaceGen/gen_public_module_name.swift new file mode 100644 index 0000000000000..13a3dac005775 --- /dev/null +++ b/test/SourceKit/InterfaceGen/gen_public_module_name.swift @@ -0,0 +1,97 @@ +// RUN: %empty-directory(%t) +// RUN: split-file %s %t --leading-lines + +// RUN: %target-swift-frontend %t/common.swift -sdk %t/sdk \ +// RUN: -module-name Common \ +// RUN: -emit-module-path %t/sdk/Common.swiftmodule \ +// RUN: -emit-module-interface-path %t/sdk/Common.swiftinterface \ +// RUN: -enable-library-evolution -swift-version 6 + +// RUN: %target-swift-frontend %t/subimpl.swift -sdk %t/sdk -I %t/sdk \ +// RUN: -module-name SubImpl \ +// RUN: -emit-module-path %t/sdk/SubImpl.swiftmodule \ +// RUN: -emit-module-interface-path %t/sdk/SubImpl.swiftinterface \ +// RUN: -enable-library-evolution -swift-version 6 +// +// RUN: %target-swift-frontend %t/modimpl.swift -sdk %t/sdk -I %t/sdk \ +// RUN: -module-name ModImpl \ +// RUN: -emit-module-path %t/sdk/ModImpl.swiftmodule \ +// RUN: -emit-module-interface-path %t/sdk/ModImpl.swiftinterface \ +// RUN: -enable-library-evolution -swift-version 6 \ +// RUN: -public-module-name PubMod + +// RUN: %target-swift-frontend %t/mod.swift -sdk %t/sdk -I %t/sdk \ +// RUN: -module-name PubMod \ +// RUN: -emit-module-path %t/sdk/PubMod.swiftmodule \ +// RUN: -emit-module-interface-path %t/sdk/PubMod.swiftinterface \ +// RUN: -enable-library-evolution -swift-version 6 + +// RUN: %sourcekitd-test -req=interface-gen -module PubMod -- -swift-version 6 -sdk %t/sdk -I %t/sdk -target %target-triple &> %t/PubMod.generatedinterface +// RUN: %FileCheck -input-file=%t/PubMod.generatedinterface -check-prefix INTERFACE %s + +// Cursor info on the type of `ModTy.member2`, ie. `ImplTy` (see the generated `PubMod.generatedinterface`) +// RUN: %sourcekitd-test -req=interface-gen-open -module PubMod -- -swift-version 6 -sdk %t/sdk -I %t/sdk -target %target-triple \ +// RUN: == -req=cursor -pos=13:24 | %FileCheck %s --check-prefix=INTERFACE-DEF +// INTERFACE-DEF: ImplTy +// INTERFACE-DEF: PubMod + + +//--- common.swift +public struct CommonType {} + + +//--- subimpl.swift +public struct SubImplTy {} + + +//--- modimpl.swift +import struct Common.CommonType +import SubImpl + +public struct ImplTy { + public let member: SubImplTy + public let member2: SubImpl.SubImplTy +} + +public func fromModImpl(arg: ImplTy, arg2: ModImpl.ImplTy) {} + + +//--- mod.swift +@_exported import ModImpl +import struct Common.CommonType + +public struct ModTy { + public let member: ImplTy + public let member2: ModImpl.ImplTy +} + +public func fromMod(arg: ModTy, arg2: PubMod.ModTy) {} + +// INTERFACE-NOT: import ModImpl +// INTERFACE: import struct Common.CommonType +// INTERFACE: import SubImpl +// INTERFACE-NOT: import +// INTERFACE: struct ImplTy +// INTERFACE: let member: SubImplTy +// INTERFACE: let member2: SubImplTy +// INTERFACE: struct ModTy +// INTERFACE: let member: ImplTy +// INTERFACE: let member2: ImplTy +// INTERFACE: func fromMod(arg: ModTy, arg2: ModTy) +// INTERFACE: func fromModImpl(arg: ImplTy, arg2: ImplTy) + + +//--- use.swift +import PubMod + +func test() { + // RUN: %sourcekitd-test -req=cursor -pos=%(line+1):3 %t/use.swift -- -swift-version 6 -sdk %t/sdk -I %t/sdk -target %target-triple %t/use.swift | %FileCheck -check-prefix=MOD %s + fromMod() + // MOD: fromMod + // MOD: PubMod + + // RUN: %sourcekitd-test -req=cursor -pos=%(line+1):3 %t/use.swift -- -swift-version 6 -sdk %t/sdk -I %t/sdk -target %target-triple %t/use.swift | %FileCheck -check-prefix=MODIMPL %s + fromModImpl() + // MODIMPL: fromModImpl + // MODIMPL: PubMod +} diff --git a/test/SourceKit/InterfaceGen/gen_swift_module.swift.from_swiftinterface.response b/test/SourceKit/InterfaceGen/gen_swift_module.swift.from_swiftinterface.response index d24a270fb3bdf..3ad040ac40bf0 100644 --- a/test/SourceKit/InterfaceGen/gen_swift_module.swift.from_swiftinterface.response +++ b/test/SourceKit/InterfaceGen/gen_swift_module.swift.from_swiftinterface.response @@ -1,4 +1,3 @@ - public class MyClass { public func pub_method() @@ -18,104 +17,104 @@ public func pub_function() -> Int [ { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1, + key.offset: 0, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 8, + key.offset: 7, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 14, + key.offset: 13, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 29, + key.offset: 28, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 36, + key.offset: 35, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 41, + key.offset: 40, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 59, + key.offset: 58, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 69, + key.offset: 68, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 76, + key.offset: 75, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 85, + key.offset: 84, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 93, + key.offset: 92, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 107, + key.offset: 106, key.length: 14 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 122, + key.offset: 121, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 131, + key.offset: 130, key.length: 18 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 150, + key.offset: 149, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 157, + key.offset: 156, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 162, + key.offset: 161, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 180, + key.offset: 179, key.length: 3 } ] [ { key.kind: source.lang.swift.ref.associatedtype, - key.offset: 93, + key.offset: 92, key.length: 5 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 180, + key.offset: 179, key.length: 3, key.is_system: 1 } @@ -125,15 +124,15 @@ public func pub_function() -> Int key.kind: source.lang.swift.decl.class, key.accessibility: source.lang.swift.accessibility.public, key.name: "MyClass", - key.offset: 8, + key.offset: 7, key.length: 59, - key.nameoffset: 14, + key.nameoffset: 13, key.namelength: 7, - key.bodyoffset: 23, + key.bodyoffset: 22, key.bodylength: 43, key.attributes: [ { - key.offset: 1, + key.offset: 0, key.length: 6, key.attribute: source.decl.attribute.public } @@ -143,13 +142,13 @@ public func pub_function() -> Int key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "pub_method()", - key.offset: 36, + key.offset: 35, key.length: 17, - key.nameoffset: 41, + key.nameoffset: 40, key.namelength: 12, key.attributes: [ { - key.offset: 29, + key.offset: 28, key.length: 6, key.attribute: source.decl.attribute.public } @@ -161,15 +160,15 @@ public func pub_function() -> Int key.kind: source.lang.swift.decl.protocol, key.accessibility: source.lang.swift.accessibility.public, key.name: "MyProto", - key.offset: 76, + key.offset: 75, key.length: 53, - key.nameoffset: 85, + key.nameoffset: 84, key.namelength: 7, - key.bodyoffset: 101, + key.bodyoffset: 100, key.bodylength: 27, key.attributes: [ { - key.offset: 69, + key.offset: 68, key.length: 6, key.attribute: source.decl.attribute.public } @@ -179,9 +178,9 @@ public func pub_function() -> Int key.kind: source.lang.swift.decl.associatedtype, key.accessibility: source.lang.swift.accessibility.public, key.name: "Assoc", - key.offset: 107, + key.offset: 106, key.length: 20, - key.nameoffset: 122, + key.nameoffset: 121, key.namelength: 5 } ] @@ -190,19 +189,19 @@ public func pub_function() -> Int key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "pub_function()", - key.offset: 157, + key.offset: 156, key.length: 26, key.typename: "Int", - key.nameoffset: 162, + key.nameoffset: 161, key.namelength: 14, key.attributes: [ { - key.offset: 150, + key.offset: 149, key.length: 6, key.attribute: source.decl.attribute.public }, { - key.offset: 131, + key.offset: 130, key.length: 18, key.attribute: source.decl.attribute.discardableResult } diff --git a/test/SourceKit/InterfaceGen/gen_swift_module.swift.response b/test/SourceKit/InterfaceGen/gen_swift_module.swift.response index a953422294b2d..f7e2815d72f0f 100644 --- a/test/SourceKit/InterfaceGen/gen_swift_module.swift.response +++ b/test/SourceKit/InterfaceGen/gen_swift_module.swift.response @@ -1,5 +1,3 @@ -import SwiftOnoneSupport - public class MyClass { public func pub_method() @@ -15,117 +13,101 @@ public func pub_function() -> Int [ - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 0, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7, - key.length: 17 - }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 26, + key.offset: 0, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 33, + key.offset: 7, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 39, + key.offset: 13, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 54, + key.offset: 28, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 61, + key.offset: 35, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 66, + key.offset: 40, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 82, + key.offset: 56, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 89, + key.offset: 63, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 98, + key.offset: 72, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 106, + key.offset: 80, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 120, + key.offset: 94, key.length: 14 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 135, + key.offset: 109, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 144, + key.offset: 118, key.length: 18 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 163, + key.offset: 137, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 170, + key.offset: 144, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 175, + key.offset: 149, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 193, + key.offset: 167, key.length: 3 } ] [ - { - key.kind: source.lang.swift.ref.module, - key.offset: 7, - key.length: 17, - key.is_system: 1 - }, { key.kind: source.lang.swift.ref.associatedtype, - key.offset: 106, + key.offset: 80, key.length: 5 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 193, + key.offset: 167, key.length: 3, key.is_system: 1 } @@ -135,15 +117,15 @@ public func pub_function() -> Int key.kind: source.lang.swift.decl.class, key.accessibility: source.lang.swift.accessibility.public, key.name: "MyClass", - key.offset: 33, + key.offset: 7, key.length: 47, - key.nameoffset: 39, + key.nameoffset: 13, key.namelength: 7, - key.bodyoffset: 48, + key.bodyoffset: 22, key.bodylength: 31, key.attributes: [ { - key.offset: 26, + key.offset: 0, key.length: 6, key.attribute: source.decl.attribute.public } @@ -153,13 +135,13 @@ public func pub_function() -> Int key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "pub_method()", - key.offset: 61, + key.offset: 35, key.length: 17, - key.nameoffset: 66, + key.nameoffset: 40, key.namelength: 12, key.attributes: [ { - key.offset: 54, + key.offset: 28, key.length: 6, key.attribute: source.decl.attribute.public } @@ -171,15 +153,15 @@ public func pub_function() -> Int key.kind: source.lang.swift.decl.protocol, key.accessibility: source.lang.swift.accessibility.public, key.name: "MyProto", - key.offset: 89, + key.offset: 63, key.length: 53, - key.nameoffset: 98, + key.nameoffset: 72, key.namelength: 7, - key.bodyoffset: 114, + key.bodyoffset: 88, key.bodylength: 27, key.attributes: [ { - key.offset: 82, + key.offset: 56, key.length: 6, key.attribute: source.decl.attribute.public } @@ -189,9 +171,9 @@ public func pub_function() -> Int key.kind: source.lang.swift.decl.associatedtype, key.accessibility: source.lang.swift.accessibility.public, key.name: "Assoc", - key.offset: 120, + key.offset: 94, key.length: 20, - key.nameoffset: 135, + key.nameoffset: 109, key.namelength: 5 } ] @@ -200,19 +182,19 @@ public func pub_function() -> Int key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "pub_function()", - key.offset: 170, + key.offset: 144, key.length: 26, key.typename: "Int", - key.nameoffset: 175, + key.nameoffset: 149, key.namelength: 14, key.attributes: [ { - key.offset: 163, + key.offset: 137, key.length: 6, key.attribute: source.decl.attribute.public }, { - key.offset: 144, + key.offset: 118, key.length: 18, key.attribute: source.decl.attribute.discardableResult } diff --git a/test/SourceKit/InterfaceGen/gen_swift_module_cross_import.swift b/test/SourceKit/InterfaceGen/gen_swift_module_cross_import.swift index cdda11c1ae6c5..6dd042ab36349 100644 --- a/test/SourceKit/InterfaceGen/gen_swift_module_cross_import.swift +++ b/test/SourceKit/InterfaceGen/gen_swift_module_cross_import.swift @@ -9,7 +9,7 @@ // Make sure cursor info within the generated interface of A on one of the // decls originally from a cross-import decls shows 'A' as the parent module. // -// RUN: %sourcekitd-test -req=interface-gen-open -module A -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import -I %S/../Inputs/CrossImport -module-cache-path %t.mod/mcp == -req=cursor -print-raw-response -pos=11:15 -- -I %S/../Inputs/CrossImport -Xfrontend -enable-cross-import-overlays > %t.response +// RUN: %sourcekitd-test -req=interface-gen-open -module A -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import -I %S/../Inputs/CrossImport -module-cache-path %t.mod/mcp == -req=cursor -print-raw-response -pos=9:15 -- -I %S/../Inputs/CrossImport -Xfrontend -enable-cross-import-overlays > %t.response // RUN: %FileCheck --input-file %t.response %s // // CHECK: key.name: "From_ABAdditionsType" diff --git a/test/SourceKit/InterfaceGen/gen_swift_module_cross_import.swift.A.response b/test/SourceKit/InterfaceGen/gen_swift_module_cross_import.swift.A.response index 47b8904897690..ab9b8051a7d00 100644 --- a/test/SourceKit/InterfaceGen/gen_swift_module_cross_import.swift.A.response +++ b/test/SourceKit/InterfaceGen/gen_swift_module_cross_import.swift.A.response @@ -1,5 +1,3 @@ -import SwiftOnoneSupport - public func fromA() @@ -27,192 +25,176 @@ public func other(x: A.From_ABAdditionsType) [ - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 0, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7, - key.length: 17 - }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 26, + key.offset: 0, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 33, + key.offset: 7, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 38, + key.offset: 12, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 48, + key.offset: 22, key.length: 23 }, { key.kind: source.lang.swift.syntaxtype.comment.mark, - key.offset: 51, + key.offset: 25, key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 72, + key.offset: 46, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 79, + key.offset: 53, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 82, + key.offset: 56, key.length: 39 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 121, + key.offset: 95, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 128, + key.offset: 102, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 135, + key.offset: 109, key.length: 20 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 161, + key.offset: 135, key.length: 39 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 200, + key.offset: 174, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 207, + key.offset: 181, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 212, + key.offset: 186, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 233, + key.offset: 207, key.length: 29 }, { key.kind: source.lang.swift.syntaxtype.comment.mark, - key.offset: 236, + key.offset: 210, key.length: 25 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 263, + key.offset: 237, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 270, + key.offset: 244, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 273, + key.offset: 247, key.length: 46 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 319, + key.offset: 293, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 326, + key.offset: 300, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 331, + key.offset: 305, key.length: 27 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 362, + key.offset: 336, key.length: 46 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 408, + key.offset: 382, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 415, + key.offset: 389, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 420, + key.offset: 394, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 426, + key.offset: 400, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 429, + key.offset: 403, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 431, + key.offset: 405, key.length: 20 } ] [ { key.kind: source.lang.swift.ref.module, - key.offset: 7, - key.length: 17, - key.is_system: 1 - }, - { - key.kind: source.lang.swift.ref.module, - key.offset: 79, + key.offset: 53, key.length: 1 }, { key.kind: source.lang.swift.ref.module, - key.offset: 270, + key.offset: 244, key.length: 1 }, { key.kind: source.lang.swift.ref.module, - key.offset: 429, + key.offset: 403, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 431, + key.offset: 405, key.length: 20 } ] @@ -221,13 +203,13 @@ public func other(x: A.From_ABAdditionsType) key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fromA()", - key.offset: 33, + key.offset: 7, key.length: 12, - key.nameoffset: 38, + key.nameoffset: 12, key.namelength: 7, key.attributes: [ { - key.offset: 26, + key.offset: 0, key.length: 6, key.attribute: source.decl.attribute.public } @@ -237,15 +219,15 @@ public func other(x: A.From_ABAdditionsType) key.kind: source.lang.swift.decl.struct, key.accessibility: source.lang.swift.accessibility.public, key.name: "From_ABAdditionsType", - key.offset: 128, + key.offset: 102, key.length: 31, - key.nameoffset: 135, + key.nameoffset: 109, key.namelength: 20, - key.bodyoffset: 157, + key.bodyoffset: 131, key.bodylength: 1, key.attributes: [ { - key.offset: 121, + key.offset: 95, key.length: 6, key.attribute: source.decl.attribute.public } @@ -255,13 +237,13 @@ public func other(x: A.From_ABAdditionsType) key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "from_ABAdditions()", - key.offset: 207, + key.offset: 181, key.length: 23, - key.nameoffset: 212, + key.nameoffset: 186, key.namelength: 18, key.attributes: [ { - key.offset: 200, + key.offset: 174, key.length: 6, key.attribute: source.decl.attribute.public } @@ -271,13 +253,13 @@ public func other(x: A.From_ABAdditionsType) key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "from__ABAdditionsCAdditions()", - key.offset: 326, + key.offset: 300, key.length: 34, - key.nameoffset: 331, + key.nameoffset: 305, key.namelength: 29, key.attributes: [ { - key.offset: 319, + key.offset: 293, key.length: 6, key.attribute: source.decl.attribute.public } @@ -287,13 +269,13 @@ public func other(x: A.From_ABAdditionsType) key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "other(x:)", - key.offset: 415, + key.offset: 389, key.length: 37, - key.nameoffset: 420, + key.nameoffset: 394, key.namelength: 32, key.attributes: [ { - key.offset: 408, + key.offset: 382, key.length: 6, key.attribute: source.decl.attribute.public } @@ -302,10 +284,10 @@ public func other(x: A.From_ABAdditionsType) { key.kind: source.lang.swift.decl.var.parameter, key.name: "x", - key.offset: 426, + key.offset: 400, key.length: 25, key.typename: "A.From_ABAdditionsType", - key.nameoffset: 426, + key.nameoffset: 400, key.namelength: 1 } ] diff --git a/test/SourceKit/InterfaceGen/gen_swift_module_cross_import.swift.Other.response b/test/SourceKit/InterfaceGen/gen_swift_module_cross_import.swift.Other.response index 5e6bb1ecdad4e..d187e53272463 100644 --- a/test/SourceKit/InterfaceGen/gen_swift_module_cross_import.swift.Other.response +++ b/test/SourceKit/InterfaceGen/gen_swift_module_cross_import.swift.Other.response @@ -1,5 +1,3 @@ -import SwiftOnoneSupport - public func fromOther() @@ -7,7 +5,6 @@ public func fromOther() import B import C -import A // Available when C is imported with Other /// This has some interesting documentation that shouldn't be separated from @@ -17,127 +14,96 @@ public func from_OtherCAdditions() [ - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 0, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7, - key.length: 17 - }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 26, + key.offset: 0, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 33, + key.offset: 7, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 38, + key.offset: 12, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 52, + key.offset: 26, key.length: 23 }, { key.kind: source.lang.swift.syntaxtype.comment.mark, - key.offset: 55, + key.offset: 29, key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 76, + key.offset: 50, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 83, + key.offset: 57, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 85, + key.offset: 59, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 92, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 94, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 101, + key.offset: 66, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 104, + key.offset: 69, key.length: 43 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 147, + key.offset: 112, key.length: 77 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 224, + key.offset: 189, key.length: 80 }, { key.kind: source.lang.swift.syntaxtype.doccomment, - key.offset: 304, + key.offset: 269, key.length: 36 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 340, + key.offset: 305, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 347, + key.offset: 312, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 352, + key.offset: 317, key.length: 20 } ] [ { key.kind: source.lang.swift.ref.module, - key.offset: 7, - key.length: 17, - key.is_system: 1 - }, - { - key.kind: source.lang.swift.ref.module, - key.offset: 83, + key.offset: 57, key.length: 1 }, { key.kind: source.lang.swift.ref.module, - key.offset: 92, - key.length: 1 - }, - { - key.kind: source.lang.swift.ref.module, - key.offset: 101, + key.offset: 66, key.length: 1 } ] @@ -146,13 +112,13 @@ public func from_OtherCAdditions() key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fromOther()", - key.offset: 33, + key.offset: 7, key.length: 16, - key.nameoffset: 38, + key.nameoffset: 12, key.namelength: 11, key.attributes: [ { - key.offset: 26, + key.offset: 0, key.length: 6, key.attribute: source.decl.attribute.public } @@ -162,15 +128,15 @@ public func from_OtherCAdditions() key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "from_OtherCAdditions()", - key.offset: 347, + key.offset: 312, key.length: 27, - key.nameoffset: 352, + key.nameoffset: 317, key.namelength: 22, - key.docoffset: 147, + key.docoffset: 112, key.doclength: 193, key.attributes: [ { - key.offset: 340, + key.offset: 305, key.length: 6, key.attribute: source.decl.attribute.public } diff --git a/test/SourceKit/InterfaceGen/gen_swift_module_cross_import_common.swift b/test/SourceKit/InterfaceGen/gen_swift_module_cross_import_common.swift index 21ee8932fd1dd..8ec74eb2fe1cc 100644 --- a/test/SourceKit/InterfaceGen/gen_swift_module_cross_import_common.swift +++ b/test/SourceKit/InterfaceGen/gen_swift_module_cross_import_common.swift @@ -12,7 +12,7 @@ // Make sure cursor info within the generated interface of SwiftFramework on one of the // decls originally from a cross-import decls shows 'SwiftFramework' as the parent module. // -// RUN: %sourcekitd-test -req=interface-gen-open -module SwiftFramework -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -module-cache-path %t/mcp == -req=cursor -print-raw-response -pos=9:13 -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -Xfrontend -enable-cross-import-overlays > %t.response +// RUN: %sourcekitd-test -req=interface-gen-open -module SwiftFramework -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -module-cache-path %t/mcp == -req=cursor -print-raw-response -pos=7:13 -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -Xfrontend -enable-cross-import-overlays > %t.response // RUN: %FileCheck --input-file %t.response --check-prefix=CHECKSWIFT %s // // CHECKSWIFT: key.name: "fromSwiftFrameworkCrossImport()" @@ -27,7 +27,7 @@ // Make sure cursor info within the generated interface of ClangFramework on one of the // decls originally from a cross-import decls shows 'ClangFramework' as the parent module. // -// RUN: %sourcekitd-test -req=interface-gen-open -module ClangFramework -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -module-cache-path %t/mcp == -req=cursor -print-raw-response -pos=10:13 -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -Xfrontend -enable-cross-import-overlays > %t.response +// RUN: %sourcekitd-test -req=interface-gen-open -module ClangFramework -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -module-cache-path %t/mcp == -req=cursor -print-raw-response -pos=7:13 -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -Xfrontend -enable-cross-import-overlays > %t.response // RUN: %FileCheck --input-file %t.response --check-prefix=CHECKCLANG %s // // CHECKCLANG: key.name: "fromClangFrameworkCrossImport()" @@ -42,7 +42,7 @@ // Make sure cursor info within the generated interface of OverlaidClangFramework on one of the // decls originally from a cross-import decls shows 'OverlaidClangFramework' as the parent module. // -// RUN: %sourcekitd-test -req=interface-gen-open -module OverlaidClangFramework -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -module-cache-path %t/mcp == -req=cursor -print-raw-response -pos=11:13 -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -Xfrontend -enable-cross-import-overlays > %t.response +// RUN: %sourcekitd-test -req=interface-gen-open -module OverlaidClangFramework -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -module-cache-path %t/mcp == -req=cursor -print-raw-response -pos=9:13 -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -Xfrontend -enable-cross-import-overlays > %t.response // RUN: %FileCheck --input-file %t.response --check-prefix=CHECKOVERLAIDCLANG %s // // CHECKOVERLAIDCLANG: key.name: "fromOverlaidClangFrameworkCrossImport()" diff --git a/test/SourceKit/InterfaceGen/gen_swift_module_cross_import_common.swift.ClangFramework.response b/test/SourceKit/InterfaceGen/gen_swift_module_cross_import_common.swift.ClangFramework.response index 02277acde3047..e328a1534226e 100644 --- a/test/SourceKit/InterfaceGen/gen_swift_module_cross_import_common.swift.ClangFramework.response +++ b/test/SourceKit/InterfaceGen/gen_swift_module_cross_import_common.swift.ClangFramework.response @@ -1,11 +1,8 @@ - public func fromClangFramework() // MARK: - BystandingLibrary Additions -import SwiftOnoneSupport - // Available when BystandingLibrary is imported with ClangFramework public func fromClangFrameworkCrossImport() @@ -13,80 +10,63 @@ public func fromClangFrameworkCrossImport() [ { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 1, + key.offset: 0, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 8, + key.offset: 7, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 13, + key.offset: 12, key.length: 18 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 36, + key.offset: 35, key.length: 39 }, { key.kind: source.lang.swift.syntaxtype.comment.mark, - key.offset: 39, + key.offset: 38, key.length: 35 }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 76, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 83, - key.length: 17 - }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 102, + key.offset: 75, key.length: 68 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 170, + key.offset: 143, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 177, + key.offset: 150, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 182, + key.offset: 155, key.length: 29 } ] -[ - { - key.kind: source.lang.swift.ref.module, - key.offset: 83, - key.length: 17, - key.is_system: 1 - } -] +<> [ { key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fromClangFramework()", - key.offset: 8, + key.offset: 7, key.length: 25, - key.nameoffset: 13, + key.nameoffset: 12, key.namelength: 20, key.attributes: [ { - key.offset: 1, + key.offset: 0, key.length: 6, key.attribute: source.decl.attribute.public } @@ -96,13 +76,13 @@ public func fromClangFrameworkCrossImport() key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fromClangFrameworkCrossImport()", - key.offset: 177, + key.offset: 150, key.length: 36, - key.nameoffset: 182, + key.nameoffset: 155, key.namelength: 31, key.attributes: [ { - key.offset: 170, + key.offset: 143, key.length: 6, key.attribute: source.decl.attribute.public } diff --git a/test/SourceKit/InterfaceGen/gen_swift_module_cross_import_common.swift.OverlaidClangFramework.response b/test/SourceKit/InterfaceGen/gen_swift_module_cross_import_common.swift.OverlaidClangFramework.response index c5264e258bec4..a7457cb95b9a5 100644 --- a/test/SourceKit/InterfaceGen/gen_swift_module_cross_import_common.swift.OverlaidClangFramework.response +++ b/test/SourceKit/InterfaceGen/gen_swift_module_cross_import_common.swift.OverlaidClangFramework.response @@ -1,5 +1,3 @@ -import SwiftOnoneSupport - public func fromOverlaidClangFramework() public func fromOverlaidClangFrameworkOverlay() @@ -12,97 +10,80 @@ public func fromOverlaidClangFrameworkCrossImport() [ - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 0, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7, - key.length: 17 - }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 26, + key.offset: 0, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 33, + key.offset: 7, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 38, + key.offset: 12, key.length: 26 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 68, + key.offset: 42, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 75, + key.offset: 49, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 80, + key.offset: 54, key.length: 33 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 118, + key.offset: 92, key.length: 39 }, { key.kind: source.lang.swift.syntaxtype.comment.mark, - key.offset: 121, + key.offset: 95, key.length: 35 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 158, + key.offset: 132, key.length: 76 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 234, + key.offset: 208, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 241, + key.offset: 215, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 246, + key.offset: 220, key.length: 37 } ] -[ - { - key.kind: source.lang.swift.ref.module, - key.offset: 7, - key.length: 17, - key.is_system: 1 - } -] +<> [ { key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fromOverlaidClangFramework()", - key.offset: 33, + key.offset: 7, key.length: 33, - key.nameoffset: 38, + key.nameoffset: 12, key.namelength: 28, key.attributes: [ { - key.offset: 26, + key.offset: 0, key.length: 6, key.attribute: source.decl.attribute.public } @@ -112,13 +93,13 @@ public func fromOverlaidClangFrameworkCrossImport() key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fromOverlaidClangFrameworkOverlay()", - key.offset: 75, + key.offset: 49, key.length: 40, - key.nameoffset: 80, + key.nameoffset: 54, key.namelength: 35, key.attributes: [ { - key.offset: 68, + key.offset: 42, key.length: 6, key.attribute: source.decl.attribute.public } @@ -128,13 +109,13 @@ public func fromOverlaidClangFrameworkCrossImport() key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fromOverlaidClangFrameworkCrossImport()", - key.offset: 241, + key.offset: 215, key.length: 44, - key.nameoffset: 246, + key.nameoffset: 220, key.namelength: 39, key.attributes: [ { - key.offset: 234, + key.offset: 208, key.length: 6, key.attribute: source.decl.attribute.public } diff --git a/test/SourceKit/InterfaceGen/gen_swift_module_cross_import_common.swift.SwiftFramework.response b/test/SourceKit/InterfaceGen/gen_swift_module_cross_import_common.swift.SwiftFramework.response index 882119057c93d..9aef8083b4b47 100644 --- a/test/SourceKit/InterfaceGen/gen_swift_module_cross_import_common.swift.SwiftFramework.response +++ b/test/SourceKit/InterfaceGen/gen_swift_module_cross_import_common.swift.SwiftFramework.response @@ -1,5 +1,3 @@ -import SwiftOnoneSupport - public func fromSwiftFramework() @@ -10,82 +8,65 @@ public func fromSwiftFrameworkCrossImport() [ - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 0, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7, - key.length: 17 - }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 26, + key.offset: 0, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 33, + key.offset: 7, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 38, + key.offset: 12, key.length: 18 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 61, + key.offset: 35, key.length: 39 }, { key.kind: source.lang.swift.syntaxtype.comment.mark, - key.offset: 64, + key.offset: 38, key.length: 35 }, { key.kind: source.lang.swift.syntaxtype.comment, - key.offset: 101, + key.offset: 75, key.length: 68 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 169, + key.offset: 143, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 176, + key.offset: 150, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 181, + key.offset: 155, key.length: 29 } ] -[ - { - key.kind: source.lang.swift.ref.module, - key.offset: 7, - key.length: 17, - key.is_system: 1 - } -] +<> [ { key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fromSwiftFramework()", - key.offset: 33, + key.offset: 7, key.length: 25, - key.nameoffset: 38, + key.nameoffset: 12, key.namelength: 20, key.attributes: [ { - key.offset: 26, + key.offset: 0, key.length: 6, key.attribute: source.decl.attribute.public } @@ -95,13 +76,13 @@ public func fromSwiftFrameworkCrossImport() key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "fromSwiftFrameworkCrossImport()", - key.offset: 176, + key.offset: 150, key.length: 36, - key.nameoffset: 181, + key.nameoffset: 155, key.namelength: 31, key.attributes: [ { - key.offset: 169, + key.offset: 143, key.length: 6, key.attribute: source.decl.attribute.public } diff --git a/test/SourceKit/InterfaceGen/gen_swiftonly_systemmodule.swift.response b/test/SourceKit/InterfaceGen/gen_swiftonly_systemmodule.swift.response index e254bb11f58a1..302e54eb71954 100644 --- a/test/SourceKit/InterfaceGen/gen_swiftonly_systemmodule.swift.response +++ b/test/SourceKit/InterfaceGen/gen_swiftonly_systemmodule.swift.response @@ -1,5 +1,3 @@ -import SwiftOnoneSupport - public class PublicClass { } @@ -16,149 +14,133 @@ public func publicFunc() [ - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 0, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7, - key.length: 17 - }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 26, + key.offset: 0, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 33, + key.offset: 7, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 39, + key.offset: 13, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 56, + key.offset: 30, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 63, + key.offset: 37, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 70, + key.offset: 44, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 87, + key.offset: 61, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 94, + key.offset: 68, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 98, + key.offset: 72, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 111, + key.offset: 85, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 117, + key.offset: 91, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 128, + key.offset: 102, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 135, + key.offset: 109, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 140, + key.offset: 114, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 158, + key.offset: 132, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 167, + key.offset: 141, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 174, + key.offset: 148, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 179, + key.offset: 153, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 187, + key.offset: 161, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 195, + key.offset: 169, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 202, + key.offset: 176, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 207, + key.offset: 181, key.length: 10 } ] [ - { - key.kind: source.lang.swift.ref.module, - key.offset: 7, - key.length: 17, - key.is_system: 1 - }, { key.kind: source.lang.swift.ref.struct, - key.offset: 111, + key.offset: 85, key.length: 3, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 158, + key.offset: 132, key.length: 3, key.is_system: 1 }, { key.kind: source.lang.swift.ref.struct, - key.offset: 187, + key.offset: 161, key.length: 3, key.is_system: 1 } @@ -168,15 +150,15 @@ public func publicFunc() key.kind: source.lang.swift.decl.class, key.accessibility: source.lang.swift.accessibility.public, key.name: "PublicClass", - key.offset: 33, + key.offset: 7, key.length: 21, - key.nameoffset: 39, + key.nameoffset: 13, key.namelength: 11, - key.bodyoffset: 52, + key.bodyoffset: 26, key.bodylength: 1, key.attributes: [ { - key.offset: 26, + key.offset: 0, key.length: 6, key.attribute: source.decl.attribute.public } @@ -186,15 +168,15 @@ public func publicFunc() key.kind: source.lang.swift.decl.struct, key.accessibility: source.lang.swift.accessibility.public, key.name: "SomeValue", - key.offset: 63, + key.offset: 37, key.length: 130, - key.nameoffset: 70, + key.nameoffset: 44, key.namelength: 9, - key.bodyoffset: 81, + key.bodyoffset: 55, key.bodylength: 111, key.attributes: [ { - key.offset: 56, + key.offset: 30, key.length: 6, key.attribute: source.decl.attribute.public } @@ -204,16 +186,16 @@ public func publicFunc() key.kind: source.lang.swift.decl.var.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "publicValue", - key.offset: 94, + key.offset: 68, key.length: 28, key.typename: "Int", - key.nameoffset: 98, + key.nameoffset: 72, key.namelength: 11, - key.bodyoffset: 116, + key.bodyoffset: 90, key.bodylength: 5, key.attributes: [ { - key.offset: 87, + key.offset: 61, key.length: 6, key.attribute: source.decl.attribute.public } @@ -223,14 +205,14 @@ public func publicFunc() key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "publicMethod()", - key.offset: 135, + key.offset: 109, key.length: 26, key.typename: "Int", - key.nameoffset: 140, + key.nameoffset: 114, key.namelength: 14, key.attributes: [ { - key.offset: 128, + key.offset: 102, key.length: 6, key.attribute: source.decl.attribute.public } @@ -240,13 +222,13 @@ public func publicFunc() key.kind: source.lang.swift.decl.function.method.instance, key.accessibility: source.lang.swift.accessibility.public, key.name: "init(public:)", - key.offset: 174, + key.offset: 148, key.length: 17, - key.nameoffset: 174, + key.nameoffset: 148, key.namelength: 17, key.attributes: [ { - key.offset: 167, + key.offset: 141, key.length: 6, key.attribute: source.decl.attribute.public } @@ -255,10 +237,10 @@ public func publicFunc() { key.kind: source.lang.swift.decl.var.parameter, key.name: "public", - key.offset: 179, + key.offset: 153, key.length: 11, key.typename: "Int", - key.nameoffset: 179, + key.nameoffset: 153, key.namelength: 6 } ] @@ -269,13 +251,13 @@ public func publicFunc() key.kind: source.lang.swift.decl.function.free, key.accessibility: source.lang.swift.accessibility.public, key.name: "publicFunc()", - key.offset: 202, + key.offset: 176, key.length: 17, - key.nameoffset: 207, + key.nameoffset: 181, key.namelength: 12, key.attributes: [ { - key.offset: 195, + key.offset: 169, key.length: 6, key.attribute: source.decl.attribute.public } diff --git a/tools/SourceKit/lib/SwiftLang/SwiftEditorInterfaceGen.cpp b/tools/SourceKit/lib/SwiftLang/SwiftEditorInterfaceGen.cpp index 7cfb02d6f1136..320a74e117f85 100644 --- a/tools/SourceKit/lib/SwiftLang/SwiftEditorInterfaceGen.cpp +++ b/tools/SourceKit/lib/SwiftLang/SwiftEditorInterfaceGen.cpp @@ -387,8 +387,11 @@ static bool getModuleInterfaceInfo( Options.SkipInlineCXXNamespace = true; } } + // Skip submodules but include any exported modules that have the same public + // module name as this module. ModuleTraversalOptions TraversalOptions = - std::nullopt; // Don't print submodules. + ModuleTraversal::VisitMatchingExported; + SmallString<128> Text; llvm::raw_svector_ostream OS(Text); AnnotatingPrinter Printer(Info, OS); diff --git a/tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp b/tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp index 86c93d40e2850..258241054920b 100644 --- a/tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp +++ b/tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp @@ -764,7 +764,8 @@ static StringRef getModuleName(const ValueDecl *VD, // overlay's declaring module as the owning module. if (ModuleDecl *Declaring = MD->getDeclaringModuleIfCrossImportOverlay()) MD = Declaring; - return MD->getNameStr(); + + return MD->getPublicModuleName(/*onlyIfImported=*/false).str(); } struct DeclInfo { From 9482a1be6d8774a40982fcb99c416b189582a6e4 Mon Sep 17 00:00:00 2001 From: Ludwig Hollmann Date: Sat, 3 May 2025 22:22:28 +0200 Subject: [PATCH 07/51] [gardening] Delete an empty header. This header was supposed to be deleted by #63783. --- lib/SILOptimizer/Mandatory/MoveOnlyAddressChecker.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 lib/SILOptimizer/Mandatory/MoveOnlyAddressChecker.h diff --git a/lib/SILOptimizer/Mandatory/MoveOnlyAddressChecker.h b/lib/SILOptimizer/Mandatory/MoveOnlyAddressChecker.h deleted file mode 100644 index e69de29bb2d1d..0000000000000 From 17fc00f8a7da82c310221cee9f00e71b29882266 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Tue, 29 Apr 2025 19:55:23 +0100 Subject: [PATCH 08/51] [test] IRGen: Adjust FileCheck patterns for new `nuw` attribute in upstream LLVM This attribute was introduced in 7eca38ce76d5d1915f4ab7e665964062c0b37697 (llvm-project). Match it using a wildcard regex, since it is not relevant to these tests. This is intended to reduce future conflicts with rebranch. --- ...ifferentiability_witness_function_inst.sil | 8 +- test/ClangImporter/CoreGraphics_test.swift | 2 +- test/DebugInfo/debug_scope_distinct.swift | 6 +- test/DebugInfo/shadowcopy-linetable.swift | 2 +- ...tributed_actor_accessor_thunks_64bit.swift | 26 +- .../distributed_actor_to_actor.swift | 2 +- test/IRGen/abitypes_objc.swift | 34 +- test/IRGen/abitypes_x86_64.swift | 4 +- test/IRGen/access_markers.sil | 10 +- test/IRGen/access_markers_pc.sil | 2 +- test/IRGen/actor_class.swift | 4 +- test/IRGen/actor_class_objc.swift | 4 +- test/IRGen/actor_class_objc_backdeploy.swift | 4 +- test/IRGen/arg_and_result_peepholes.swift | 16 +- test/IRGen/async/builtins.sil | 56 +-- test/IRGen/async/get_async_continuation.sil | 10 +- test/IRGen/async/hop_to_executor.sil | 2 +- test/IRGen/bitcast.sil | 6 +- test/IRGen/boxed_existential.sil | 2 +- test/IRGen/builtins.swift | 14 +- test/IRGen/c_layout.sil | 60 +-- test/IRGen/class.sil | 2 +- test/IRGen/class_bounded_generics.swift | 6 +- test/IRGen/class_field_other_module.swift | 4 +- test/IRGen/class_resilience.swift | 20 +- test/IRGen/class_resilience_objc.swift | 6 +- ...lass_update_callback_with_fixed_layout.sil | 6 +- ...s_update_callback_without_fixed_layout.sil | 6 +- test/IRGen/closure.swift | 2 +- test/IRGen/coroutine_accessors.swift | 2 +- test/IRGen/enum.sil | 30 +- .../enum_copy_init_with_take_memcpy.swift | 2 +- test/IRGen/enum_future.sil | 30 +- test/IRGen/enum_resilience.swift | 2 +- test/IRGen/enum_value_semantics.sil | 48 +-- test/IRGen/enum_value_semantics_future.sil | 48 +-- test/IRGen/exclusivity.sil | 6 +- test/IRGen/existential_metatypes.sil | 8 +- test/IRGen/existential_shape_metadata.swift | 6 +- test/IRGen/existentials.sil | 16 +- test/IRGen/existentials_objc.sil | 28 +- test/IRGen/existentials_opaque_boxed.sil | 76 ++-- test/IRGen/fixed_layout_class.swift | 12 +- test/IRGen/fixed_size_buffer_peepholes.sil | 2 +- test/IRGen/generic_casts.swift | 6 +- test/IRGen/generic_classes.sil | 6 +- test/IRGen/generic_metatypes.swift | 4 +- test/IRGen/generic_metatypes_future.swift | 4 +- test/IRGen/generic_tuples.swift | 2 +- test/IRGen/global_resilience.sil | 8 +- test/IRGen/indexing.sil | 2 +- test/IRGen/indirect_argument.sil | 4 +- test/IRGen/isolated_any.sil | 12 +- test/IRGen/large_argument_c.sil | 2 +- test/IRGen/large_argument_result_c.swift | 2 +- .../large_argument_result_c_x86_64.swift | 2 +- test/IRGen/lazy_globals.swift | 2 +- test/IRGen/lazy_multi_file.swift | 2 +- test/IRGen/lifetime.sil | 4 +- ..._mode_class_with_unimportable_fields.swift | 10 +- test/IRGen/moveonly_deinits.swift | 42 +- .../moveonly_split_module_source_deinit.swift | 4 +- test/IRGen/moveonly_value_functions.sil | 2 +- test/IRGen/multi_file_resilience.swift | 2 +- test/IRGen/multi_module_resilience.swift | 4 +- test/IRGen/multi_payload_shifting.swift | 2 +- test/IRGen/non_fixed_return.swift | 4 +- test/IRGen/objc_block.sil | 2 +- test/IRGen/objc_block_storage.sil | 44 +- test/IRGen/objc_dealloc.sil | 4 +- test/IRGen/objc_extensions.swift | 8 +- test/IRGen/objc_implementation.swift | 2 +- .../pack_metadata_marker_inserter_onone.swift | 6 +- test/IRGen/package_resilience.swift | 20 +- ...ckage_resilient_as_public_by_default.swift | 58 +-- test/IRGen/partial_apply.sil | 24 +- test/IRGen/partial_apply_coro.sil | 382 +++++++++--------- test/IRGen/partial_apply_forwarder.sil | 16 +- test/IRGen/partial_apply_objc.sil | 32 +- test/IRGen/protocol_resilience.sil | 6 +- test/IRGen/raw_layout.swift | 42 +- .../relative_protocol_witness_table.swift | 4 +- test/IRGen/sil_generic_witness_methods.swift | 8 +- test/IRGen/sil_witness_methods.sil | 2 +- test/IRGen/sil_witness_tables.swift | 4 +- test/IRGen/static_initializer.sil | 4 +- test/IRGen/stdlib/Mutex.swift | 8 +- test/IRGen/struct_resilience.swift | 36 +- test/IRGen/struct_with_resilient_type.swift | 4 +- test/IRGen/typed_boxes.sil | 6 +- test/IRGen/typed_throws.sil | 4 +- test/IRGen/typed_throws.swift | 4 +- test/IRGen/typed_throws_abi.swift | 24 +- .../typelayout_based_value_witness.swift | 8 +- test/IRGen/unexploded-calls.swift | 8 +- test/IRGen/unmanaged_objc_throw_func.swift | 2 +- test/IRGen/unowned.sil | 18 +- test/IRGen/unowned_objc.sil | 38 +- test/IRGen/variadic_generic_functions.sil | 4 +- test/IRGen/variadic_generics.sil | 4 +- test/IRGen/weak.sil | 30 +- test/IRGen/weak_class_protocol.sil | 4 +- test/IRGen/witness_table_multifile.swift | 2 +- test/IRGen/yield_once.sil | 4 +- test/IRGen/yield_once_big.sil | 18 +- test/IRGen/yield_once_biggish.sil | 10 +- ...nce_enable_emit_type_malloc_coro_frame.sil | 4 +- test/IRGen/yield_once_indirect.sil | 2 +- test/IRGen/yield_result.sil | 6 +- ...ional_conformance_basic_conformances.swift | 14 +- ...onformance_basic_conformances_future.swift | 14 +- .../conditional_conformance_recursive.swift | 2 +- .../conditional_conformance_subclass.swift | 8 +- ...ditional_conformance_subclass_future.swift | 8 +- .../conditional_conformance_with_assoc.swift | 8 +- ...tional_conformance_with_assoc_future.swift | 8 +- .../Cxx/class/closure-thunk-irgen.swift | 10 +- .../class/closure-thunk-macosx-irgen.swift | 6 +- .../Cxx/class/inheritance/fields-irgen.swift | 2 +- .../Cxx/class/memory-layout-silgen.swift | 2 +- .../inherited-field-access-irgen.swift | 4 +- ...ype-classification-non-trivial-irgen.swift | 26 +- .../base-class-layout-irgen.swift | 2 +- ...ed-field-getter-retainable-frt-irgen.swift | 2 +- .../Cxx/foreign-reference/pod-irgen.swift | 4 +- .../unimportable-member-layout-irgen.swift | 8 +- .../Cxx/operators/member-inline-irgen.swift | 6 +- .../private-stored-member-type-layout.swift | 12 +- 128 files changed, 918 insertions(+), 918 deletions(-) diff --git a/test/AutoDiff/SIL/differentiability_witness_function_inst.sil b/test/AutoDiff/SIL/differentiability_witness_function_inst.sil index 9318d934a9faf..0e702cd253122 100644 --- a/test/AutoDiff/SIL/differentiability_witness_function_inst.sil +++ b/test/AutoDiff/SIL/differentiability_witness_function_inst.sil @@ -95,14 +95,14 @@ bb0: // IRGEN: [[PTR1:%.*]] = load ptr, ptr @fooWJrSUUpSr, align [[PTR_ALIGNMENT]] -// IRGEN: [[PTR2:%.*]] = load ptr, ptr getelementptr inbounds (%swift.differentiability_witness, ptr @fooWJrSSUpSr, i32 0, i32 1), align [[PTR_ALIGNMENT]] +// IRGEN: [[PTR2:%.*]] = load ptr, ptr getelementptr inbounds{{.*}} (%swift.differentiability_witness, ptr @fooWJrSSUpSr, i32 0, i32 1), align [[PTR_ALIGNMENT]] // IRGEN: [[PTR3:%.*]] = load ptr, ptr @barWJrSUUpSUr, align [[PTR_ALIGNMENT]] -// IRGEN: [[PTR4:%.*]] = load ptr, ptr getelementptr inbounds (%swift.differentiability_witness, ptr @barWJrSSUpSSr, i32 0, i32 1), align [[PTR_ALIGNMENT]] +// IRGEN: [[PTR4:%.*]] = load ptr, ptr getelementptr inbounds{{.*}} (%swift.differentiability_witness, ptr @barWJrSSUpSSr, i32 0, i32 1), align [[PTR_ALIGNMENT]] // IRGEN: [[PTR5:%.*]] = load ptr, ptr @generic16_Differentiation14DifferentiableRzlWJrSUpSr, align [[PTR_ALIGNMENT]] -// IRGEN: [[PTR6:%.*]] = load ptr, ptr getelementptr inbounds (%swift.differentiability_witness, ptr @generics18AdditiveArithmeticRz16_Differentiation14DifferentiableRzlWJrSSpSr, i32 0, i32 1), align [[PTR_ALIGNMENT]] +// IRGEN: [[PTR6:%.*]] = load ptr, ptr getelementptr inbounds{{.*}} (%swift.differentiability_witness, ptr @generics18AdditiveArithmeticRz16_Differentiation14DifferentiableRzlWJrSSpSr, i32 0, i32 1), align [[PTR_ALIGNMENT]] -// IRGEN: [[PTR7:%.*]] = load ptr, ptr getelementptr inbounds (%swift.differentiability_witness, ptr @generic16_Differentiation14DifferentiableRz13TangentVector{{.*}}WJrSSpSr, i32 0, i32 1), align [[PTR_ALIGNMENT]] +// IRGEN: [[PTR7:%.*]] = load ptr, ptr getelementptr inbounds{{.*}} (%swift.differentiability_witness, ptr @generic16_Differentiation14DifferentiableRz13TangentVector{{.*}}WJrSSpSr, i32 0, i32 1), align [[PTR_ALIGNMENT]] diff --git a/test/ClangImporter/CoreGraphics_test.swift b/test/ClangImporter/CoreGraphics_test.swift index 7ee411b724c62..edffe974dc9d3 100644 --- a/test/ClangImporter/CoreGraphics_test.swift +++ b/test/ClangImporter/CoreGraphics_test.swift @@ -25,7 +25,7 @@ public func testEnums(_ model: CGColorSpaceModel) -> Int { default: return -1 } -// CHECK: [[GEP:%.+]] = getelementptr inbounds [8 x i64], ptr [[SWITCHTABLE]], i64 0, i64 %{{.*}} +// CHECK: [[GEP:%.+]] = getelementptr inbounds{{.*}} [8 x i64], ptr [[SWITCHTABLE]], i64 0, i64 %{{.*}} // CHECK: [[LOAD:%.+]] = load i64, ptr [[GEP]], align 8 // CHECK: [[PHI:%.*]] = phi i64 [ [[LOAD]], %{{.*}} ], [ -1, %{{.*}} ] // CHECK: ret i64 [[PHI]] diff --git a/test/DebugInfo/debug_scope_distinct.swift b/test/DebugInfo/debug_scope_distinct.swift index c7221bb608281..6dfc157670ebf 100644 --- a/test/DebugInfo/debug_scope_distinct.swift +++ b/test/DebugInfo/debug_scope_distinct.swift @@ -12,14 +12,14 @@ // // CHECK: %[[ARG0:.*]] = load {{.*}} %[[ARG_PTR]] // CHECK: #dbg_value({{.*}} %[[ARG0]], ![[VAR1:[0-9]+]], !DIExpression(DW_OP_LLVM_fragment, 0, 64), ![[LOC1:[0-9]+]] -// CHECK: %[[ARG1_GEP:.*]] = getelementptr inbounds i8, ptr %[[ARG_PTR]], i64 8 +// CHECK: %[[ARG1_GEP:.*]] = getelementptr inbounds{{.*}} i8, ptr %[[ARG_PTR]], i64 8 // CHECK: %[[ARG1:.*]] = load {{.*}} %[[ARG1_GEP]] // CHECK: #dbg_value({{.*}} %[[ARG1]], ![[VAR1]], !DIExpression(DW_OP_LLVM_fragment, 64, 8), ![[LOC1]] // -// CHECK: %[[ARG2_GEP:.*]] = getelementptr inbounds i8, ptr %[[ARG_PTR]], i64 32 +// CHECK: %[[ARG2_GEP:.*]] = getelementptr inbounds{{.*}} i8, ptr %[[ARG_PTR]], i64 32 // CHECK: %[[ARG2:.*]] = load {{.*}} %[[ARG2_GEP]] // CHECK: #dbg_value({{.*}} %[[ARG2]], ![[VAR1]], !DIExpression(DW_OP_LLVM_fragment, 0, 64), ![[LOC2:[0-9]+]] -// CHECK: %[[ARG3_GEP:.*]] = getelementptr inbounds i8, ptr %[[ARG_PTR]], i64 40 +// CHECK: %[[ARG3_GEP:.*]] = getelementptr inbounds{{.*}} i8, ptr %[[ARG_PTR]], i64 40 // CHECK: %[[ARG3:.*]] = load {{.*}} %[[ARG3_GEP]] // CHECK: #dbg_value({{.*}} %[[ARG3]], ![[VAR1]], !DIExpression(DW_OP_LLVM_fragment, 64, 8), ![[LOC2]] diff --git a/test/DebugInfo/shadowcopy-linetable.swift b/test/DebugInfo/shadowcopy-linetable.swift index a5647a24fa9ef..493d0cb8d7e62 100644 --- a/test/DebugInfo/shadowcopy-linetable.swift +++ b/test/DebugInfo/shadowcopy-linetable.swift @@ -24,7 +24,7 @@ func foo(_ x: inout Int64) { // IRCHECK-NEXT: call void @llvm.memset.{{.*}}(ptr align {{(4|8)}} %[[X]], i8 0 // IRCHECK: store ptr %0, ptr %[[X]], align {{(4|8)}} // IRCHECK-SAME: !dbg ![[LOC0:.*]] - // IRCHECK-NEXT: %[[VALUE:.*]] = getelementptr inbounds %Ts5Int64V, ptr %0, i32 0, i32 0, + // IRCHECK-NEXT: %[[VALUE:.*]] = getelementptr inbounds{{.*}} %Ts5Int64V, ptr %0, i32 0, i32 0, // IRCHECK-SAME: !dbg ![[LOCLOAD:.*]] // IRCHECK-NEXT: load i64, ptr %[[VALUE]], align {{(4|8)}} // IRCHECK-SAME: !dbg ![[LOCLOAD]] diff --git a/test/Distributed/distributed_actor_accessor_thunks_64bit.swift b/test/Distributed/distributed_actor_accessor_thunks_64bit.swift index ac91f313d20e0..43a5ad5da4df0 100644 --- a/test/Distributed/distributed_actor_accessor_thunks_64bit.swift +++ b/test/Distributed/distributed_actor_accessor_thunks_64bit.swift @@ -119,12 +119,12 @@ public distributed actor MyOtherActor { // 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 +// CHECK-NEXT: %._value = getelementptr inbounds{{.*}} %TSi, ptr [[ARG_0_VALUE_BUF]], i32 0, i32 0 // CHECK-NEXT: [[ARG_VAL:%.*]] = load i64, ptr %._value /// Setup task context for async call to `simple1` thunk -// CHECK-DIRECT: [[CONTEXT_SIZE:%.*]] = load i32, ptr getelementptr inbounds (%swift.async_func_pointer, ptr @"$s27distributed_actor_accessors7MyActorC7simple1yySiYaKFTETu", i32 0, i32 1) +// CHECK-DIRECT: [[CONTEXT_SIZE:%.*]] = load i32, ptr getelementptr inbounds{{.*}} (%swift.async_func_pointer, ptr @"$s27distributed_actor_accessors7MyActorC7simple1yySiYaKFTETu", i32 0, i32 1) // CHECK-INDIRECT: [[ADDR:%[0-9]+]] = load ptr, ptr inttoptr (i64 and (i64 ptrtoint (ptr @"$s27distributed_actor_accessors7MyActorC7simple1yySiYaKFTETu" to i64), i64 -2) to ptr) // CHECK-INDIRECT-NEXT: [[SELECT:%[0-9]+]] = select i1 true, ptr @"$s27distributed_actor_accessors7MyActorC7simple1yySiYaKFTETu", ptr [[ADDR]] // CHECK-INDIRECT-NEXT: [[LOAD:%[0-9]+]] = getelementptr inbounds %swift.async_func_pointer, ptr [[SELECT]], i32 0, i32 1 @@ -156,7 +156,7 @@ public distributed actor MyOtherActor { /// Setup task context for async call to `simple2` thunk -// CHECK-DIRECT: [[CONTEXT_SIZE:%.*]] = load i32, ptr getelementptr inbounds (%swift.async_func_pointer, ptr @"$s27distributed_actor_accessors7MyActorC7simple2ySSSiYaKFTETu", i32 0, i32 1) +// CHECK-DIRECT: [[CONTEXT_SIZE:%.*]] = load i32, ptr getelementptr inbounds{{.*}} (%swift.async_func_pointer, ptr @"$s27distributed_actor_accessors7MyActorC7simple2ySSSiYaKFTETu", i32 0, i32 1) // CHECK-INDIRECT: [[ADDR:%[0-9]+]] = load ptr, ptr inttoptr (i64 and (i64 ptrtoint (ptr @"$s27distributed_actor_accessors7MyActorC7simple2ySSSiYaKFTETu" to i64), i64 -2) to ptr), align 8 // CHECK-INDIRECT-NEXT: [[SELECT:%[0-9]+]] = select i1 true, ptr @"$s27distributed_actor_accessors7MyActorC7simple2ySSSiYaKFTETu", ptr [[ADDR]] // CHECK-INDIRECT-NEXT: [[LOAD:%[0-9]+]] = getelementptr inbounds %swift.async_func_pointer, ptr [[SELECT]], i32 0, i32 1 @@ -199,7 +199,7 @@ public distributed actor MyOtherActor { // CHECK: [[ARG_SIZE:%.*]] = and i64 {{.*}}, -16 // CHECK: [[ARG_BUF:%.*]] = call swiftcc ptr @swift_task_alloc(i64 [[ARG_SIZE]]) -// CHECK: %._guts = getelementptr inbounds %TSS, ptr [[ARG_BUF]], i32 0, i32 0 +// CHECK: %._guts = getelementptr inbounds{{.*}} %TSS, ptr [[ARG_BUF]], i32 0, i32 0 // CHECK: [[STR_SIZE:%.*]] = load i64, ptr %._guts._object._countAndFlagsBits._value // CHECK: [[STR_VAL:%.*]] = load ptr, ptr %._guts._object._object @@ -210,7 +210,7 @@ public distributed actor MyOtherActor { // CHECK-INDIRECT-NEXT: [[SELECT:%[0-9]+]] = select i1 true, ptr @"$s27distributed_actor_accessors7MyActorC7simple3ySiSSYaKFTETu", ptr [[ADDR]] // CHECK-INDIRECT-NEXT: [[LOAD:%[0-9]+]] = getelementptr inbounds %swift.async_func_pointer, ptr [[SELECT]], i32 0, i32 1 // CHECK-INDIRECT-NEXT: [[CONTEXT_SIZE:%.*]] = load i32, ptr [[LOAD]] -// CHECK-DIRECT: [[CONTEXT_SIZE:%.*]] = load i32, ptr getelementptr inbounds (%swift.async_func_pointer, ptr @"$s27distributed_actor_accessors7MyActorC7simple3ySiSSYaKFTETu", i32 0, i32 1) +// CHECK-DIRECT: [[CONTEXT_SIZE:%.*]] = load i32, ptr getelementptr inbounds{{.*}} (%swift.async_func_pointer, ptr @"$s27distributed_actor_accessors7MyActorC7simple3ySiSSYaKFTETu", i32 0, i32 1) // CHECK-NEXT: [[CONTEXT_SIZE_64:%.*]] = zext i32 [[CONTEXT_SIZE]] to i64 // CHECK-NEXT: [[THUNK_ASYNC_CONTEXT:%.*]] = call swiftcc ptr @swift_task_alloc(i64 [[CONTEXT_SIZE_64]]) @@ -227,7 +227,7 @@ public distributed actor MyOtherActor { // CHECK-NEXT: [[CALLER_ASYNC_CTXT:%.*]] = load ptr, ptr [[TASK_REF]] // CHECK-NEXT: store ptr [[CALLER_ASYNC_CTXT]], ptr // CHECK: [[INT_RES:%.*]] = extractvalue { ptr, i64, ptr } [[THUNK_RESULT]], 1 -// CHECK: %._value = getelementptr inbounds %TSi, ptr [[RESULT_BUFF]], i32 0, i32 0 +// CHECK: %._value = getelementptr inbounds{{.*}} %TSi, ptr [[RESULT_BUFF]], i32 0, i32 0 // CHECK: store i64 [[INT_RES]], ptr %._value // CHECK: {{.*}} = call i1 (ptr, i1, ...) @llvm.coro.end.async({{.*}}, ptr {{.*}}, ptr {{.*}}) @@ -258,7 +258,7 @@ public distributed actor MyOtherActor { // CHECK: [[ARG_1_SIZE:%.*]] = and i64 {{.*}}, -16 // CHECK-NEXT: [[ARG_1_BUF:%.*]] = call swiftcc ptr @swift_task_alloc(i64 [[ARG_1_SIZE]]) -// CHECK: %._value = getelementptr inbounds %TSi, ptr [[ARG_1_BUF]], i32 0, i32 0 +// CHECK: %._value = getelementptr inbounds{{.*}} %TSi, ptr [[ARG_1_BUF]], i32 0, i32 0 // CHECK-NEXT: [[NATIVE_INT_VAL:%.*]] = load i64, ptr %._value /// Call distributed thunk with extracted arguments. @@ -287,7 +287,7 @@ public distributed actor MyOtherActor { // CHECK: [[ARG_0_SIZE:%.*]] = and i64 {{.*}}, -16 // CHECK-NEXT: [[ARG_0_BUF:%.*]] = call swiftcc ptr @swift_task_alloc(i64 [[ARG_0_SIZE]]) -// CHECK: %._buffer = getelementptr inbounds %TSa, ptr [[ARG_0_BUF]], i32 0, i32 0 +// CHECK: %._buffer = getelementptr inbounds{{.*}} %TSa, ptr [[ARG_0_BUF]], i32 0, i32 0 // CHECK: [[NATIVE_ARR_VAL:%.*]] = load ptr, ptr %._buffer._storage /// -> Obj @@ -302,9 +302,9 @@ public distributed actor MyOtherActor { // CHECK: [[ARG_2_SIZE:%.*]] = and i64 {{.*}}, -16 // CHECK-NEXT: [[ARG_2_BUF:%.*]] = call swiftcc ptr @swift_task_alloc(i64 [[ARG_2_SIZE]]) -// CHECK: [[NATIVE_OPT_VAL_0_PTR:%.*]] = getelementptr inbounds { i64, i64 }, ptr [[ARG_2_BUF]], i32 0, i32 0 +// CHECK: [[NATIVE_OPT_VAL_0_PTR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr [[ARG_2_BUF]], i32 0, i32 0 // CHECK-NEXT: [[NATIVE_OPT_VAL_0:%.*]] = load i64, ptr [[NATIVE_OPT_VAL_0_PTR]] -// CHECK-NEXT: [[NATIVE_OPT_VAL_1_PTR:%.*]] = getelementptr inbounds { i64, i64 }, ptr [[ARG_2_BUF]], i32 0, i32 1 +// CHECK-NEXT: [[NATIVE_OPT_VAL_1_PTR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr [[ARG_2_BUF]], i32 0, i32 1 // CHECK-NEXT: [[NATIVE_OPT_VAL_1:%.*]] = load i64, ptr [[NATIVE_OPT_VAL_1_PTR]] /// -> LargeStruct (passed indirectly) @@ -335,8 +335,8 @@ public distributed actor MyOtherActor { // CHECK: [[ARG_1_SIZE:%.*]] = and i64 {{.*}}, -16 // CHECK-NEXT: [[ARG_1_BUF:%.*]] = call swiftcc ptr @swift_task_alloc(i64 [[ARG_1_SIZE]]) -// CHECK: %._buffer = getelementptr inbounds %TSa, ptr [[ARG_1_BUF]], i32 0, i32 0 -// CHECK-NEXT: %._buffer._storage = getelementptr inbounds [[ARRAY_TYPE:%.*]], ptr %._buffer, i32 0, i32 0 +// CHECK: %._buffer = getelementptr inbounds{{.*}} %TSa, ptr [[ARG_1_BUF]], i32 0, i32 0 +// CHECK-NEXT: %._buffer._storage = getelementptr inbounds{{.*}} [[ARRAY_TYPE:%.*]], ptr %._buffer, i32 0, i32 0 // CHECK: [[TYPED_ARG_1:%.*]] = load ptr, ptr %._buffer._storage /// ---> Load generic argument substitutions from the caller-provided buffer @@ -380,7 +380,7 @@ public distributed actor MyOtherActor { // CHECK-NEXT: {{.*}} = call ptr @llvm.coro.begin(token {{%.*}}, ptr null) // CHECK-NEXT: store ptr {{.*}}, ptr {{.*}} // CHECK-NEXT: store ptr null, ptr %swifterror -// CHECK-DIRECT-NEXT: {{.*}} = load i32, ptr getelementptr inbounds (%swift.async_func_pointer, ptr @"$s27distributed_actor_accessors12MyOtherActorC5emptyyyYaKFTETu", i32 0, i32 1) +// CHECK-DIRECT-NEXT: {{.*}} = load i32, ptr getelementptr inbounds{{.*}} (%swift.async_func_pointer, ptr @"$s27distributed_actor_accessors12MyOtherActorC5emptyyyYaKFTETu", i32 0, i32 1) // CHECK-INDIRECT-NEXT: [[ADDR:%[0-9]+]] = load ptr, ptr inttoptr (i64 and (i64 ptrtoint (ptr @"$s27distributed_actor_accessors12MyOtherActorC5emptyyyYaKFTETu" to i64), i64 -2) to ptr), align 8 // CHECK-INDIRECT-NEXT: [[SELECT:%[0-9]+]] = select i1 true, ptr @"$s27distributed_actor_accessors12MyOtherActorC5emptyyyYaKFTETu", ptr [[ADDR]] // CHECK-INDIRECT-NEXT: [[LOAD:%[0-9]+]] = getelementptr inbounds %swift.async_func_pointer, ptr [[SELECT]], i32 0, i32 1 diff --git a/test/Distributed/distributed_actor_to_actor.swift b/test/Distributed/distributed_actor_to_actor.swift index c58211e86aba5..f1b1eb0cb47d6 100644 --- a/test/Distributed/distributed_actor_to_actor.swift +++ b/test/Distributed/distributed_actor_to_actor.swift @@ -32,7 +32,7 @@ func getAnyActor(distributedActor: isolated some DistributedActor) -> any Actor // CHECK-IR-LABEL: define {{.*}} @"$s021distributed_actor_to_B011getAnyActor0aF0ScA_pxYi_t11Distributed0gF0RzlF // CHECK-IR: %conditional.requirement.buffer = alloca [1 x ptr] -// CHECK-IR: [[CONDITIONAL_REQ_GEP:%[0-9]+]] = getelementptr inbounds [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-IR: [[CONDITIONAL_REQ_GEP:%[0-9]+]] = getelementptr inbounds{{.*}} [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-IR-NEXT: [[SELF_DA_REQ:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQ_GEP]], i32 0 // CHECK-IR-NEXT: store ptr %"some DistributedActor.DistributedActor", ptr [[SELF_DA_REQ]] // CHECK-IR-NEXT: call ptr @swift_getWitnessTable(ptr @"$sxScA11DistributedMc{{(.ptrauth)?}}", ptr %"some DistributedActor", ptr [[CONDITIONAL_REQ_GEP]]) diff --git a/test/IRGen/abitypes_objc.swift b/test/IRGen/abitypes_objc.swift index 3bf060dd3a650..698776b4703ac 100644 --- a/test/IRGen/abitypes_objc.swift +++ b/test/IRGen/abitypes_objc.swift @@ -87,9 +87,9 @@ class Foo { // x86_64-macosx: define hidden swiftcc float @"$s8abitypes3FooC17getXFromRectSwift{{.*}}"(float %0, float %1, float %2, float %3, ptr swiftself %4) {{.*}} { // x86_64-macosx: [[COERCED:%.*]] = alloca [[MYRECT:%.*MyRect.*]], align 8 // x86_64-macosx: [[SEL:%.*]] = load ptr, ptr @"\01L_selector(getXFromRect:)", align 8 - // x86_64-macosx: [[T0:%.*]] = getelementptr inbounds { <2 x float>, <2 x float> }, ptr [[COERCED]], i32 0, i32 0 + // x86_64-macosx: [[T0:%.*]] = getelementptr inbounds{{.*}} { <2 x float>, <2 x float> }, ptr [[COERCED]], i32 0, i32 0 // x86_64-macosx: [[FIRST_HALF:%.*]] = load <2 x float>, ptr [[T0]] - // x86_64-macosx: [[T0:%.*]] = getelementptr inbounds { <2 x float>, <2 x float> }, ptr [[COERCED]], i32 0, i32 1 + // x86_64-macosx: [[T0:%.*]] = getelementptr inbounds{{.*}} { <2 x float>, <2 x float> }, ptr [[COERCED]], i32 0, i32 1 // x86_64-macosx: [[SECOND_HALF:%.*]] = load <2 x float>, ptr [[T0]] // x86_64-macosx: [[RESULT:%.*]] = call float @objc_msgSend(ptr %4, ptr [[SEL]], <2 x float> [[FIRST_HALF]], <2 x float> [[SECOND_HALF]]) // armv7-ios: define hidden swiftcc float @"$s8abitypes3FooC17getXFromRectSwift{{[_0-9a-zA-Z]*}}F"(float %0, float %1, float %2, float %3, ptr swiftself %4) {{.*}} { @@ -199,9 +199,9 @@ class Foo { // x86_64-macosx: define hidden swiftcc i64 @"$s8abitypes3FooC7getpair{{[_0-9a-zA-Z]*}}F"(ptr %0, ptr swiftself %1) {{.*}} { // x86_64-macosx: [[RESULT:%.*]] = call i64 @objc_msgSend - // x86_64-macosx: [[GEP1:%.*]] = getelementptr inbounds { i64 }, ptr {{.*}}, i32 0, i32 0 + // x86_64-macosx: [[GEP1:%.*]] = getelementptr inbounds{{.*}} { i64 }, ptr {{.*}}, i32 0, i32 0 // x86_64-macosx: store i64 [[RESULT]], ptr [[GEP1]] - // x86_64-macosx: [[GEP2:%.*]] = getelementptr inbounds { i64 }, ptr {{.*}}, i32 0, i32 0 + // x86_64-macosx: [[GEP2:%.*]] = getelementptr inbounds{{.*}} { i64 }, ptr {{.*}}, i32 0, i32 0 // x86_64-macosx: load i64, ptr [[GEP2]] // x86_64-macosx: ret i64 func getpair(_ p: StructReturns) -> IntPair { @@ -218,7 +218,7 @@ class Foo { // x86_64-macosx: call void @llvm.lifetime.start // x86_64-macosx: store i32 {{.*}} // x86_64-macosx: store i32 {{.*}} - // x86_64-macosx: [[T0:%.*]] = getelementptr inbounds { i64 }, ptr + // x86_64-macosx: [[T0:%.*]] = getelementptr inbounds{{.*}} { i64 }, ptr // x86_64-macosx: load i64, ptr [[T0]], align 8 // x86_64-macosx: call void @llvm.lifetime.end // x86_64-macosx: ret i64 @@ -567,35 +567,35 @@ class Foo { // We need to allocate enough memory on the stack to hold the argument value we load. // arm64-ios: define swiftcc void @"$s8abitypes14testBOOLStructyyF"() // arm64-ios: [[COERCED:%.*]] = alloca i64 -// arm64-ios: [[PTR0:%.*]] = getelementptr inbounds %TSo14FiveByteStructV, ptr [[COERCED]], {{i.*}} 0, {{i.*}} 0 -// arm64-ios: [[PTR1:%.*]] = getelementptr inbounds %T10ObjectiveC8ObjCBoolV, ptr [[PTR0]], {{i.*}} 0, {{i.*}} 0 -// arm64-ios: [[PTR2:%.*]] = getelementptr inbounds %TSb, ptr [[PTR1]], {{i.*}} 0, {{i.*}} 0 +// arm64-ios: [[PTR0:%.*]] = getelementptr inbounds{{.*}} %TSo14FiveByteStructV, ptr [[COERCED]], {{i.*}} 0, {{i.*}} 0 +// arm64-ios: [[PTR1:%.*]] = getelementptr inbounds{{.*}} %T10ObjectiveC8ObjCBoolV, ptr [[PTR0]], {{i.*}} 0, {{i.*}} 0 +// arm64-ios: [[PTR2:%.*]] = getelementptr inbounds{{.*}} %TSb, ptr [[PTR1]], {{i.*}} 0, {{i.*}} 0 // arm64-ios: store i8 0, ptr [[PTR2]], align 8 // arm64-ios: [[ARG:%.*]] = load i64, ptr [[COERCED]] // arm64-ios: call void @objc_msgSend(ptr {{.*}}, ptr {{.*}}, i64 [[ARG]]) // // arm64e-ios: define swiftcc void @"$s8abitypes14testBOOLStructyyF"() // arm64e-ios: [[COERCED:%.*]] = alloca i64 -// arm64e-ios: [[PTR0:%.*]] = getelementptr inbounds %TSo14FiveByteStructV, ptr [[COERCED]], {{i.*}} 0, {{i.*}} 0 -// arm64e-ios: [[PTR1:%.*]] = getelementptr inbounds %T10ObjectiveC8ObjCBoolV, ptr [[PTR0]], {{i.*}} 0, {{i.*}} 0 -// arm64e-ios: [[PTR2:%.*]] = getelementptr inbounds %TSb, ptr [[PTR1]], {{i.*}} 0, {{i.*}} 0 +// arm64e-ios: [[PTR0:%.*]] = getelementptr inbounds{{.*}} %TSo14FiveByteStructV, ptr [[COERCED]], {{i.*}} 0, {{i.*}} 0 +// arm64e-ios: [[PTR1:%.*]] = getelementptr inbounds{{.*}} %T10ObjectiveC8ObjCBoolV, ptr [[PTR0]], {{i.*}} 0, {{i.*}} 0 +// arm64e-ios: [[PTR2:%.*]] = getelementptr inbounds{{.*}} %TSb, ptr [[PTR1]], {{i.*}} 0, {{i.*}} 0 // arm64e-ios: store i8 0, ptr [[PTR2]], align 8 // arm64e-ios: [[ARG:%.*]] = load i64, ptr [[COERCED]] // arm64e-ios: call void @objc_msgSend(ptr {{.*}}, ptr {{.*}}, i64 [[ARG]]) // arm64-macosx: define swiftcc void @"$s8abitypes14testBOOLStructyyF"() // arm64-macosx: [[COERCED:%.*]] = alloca i64 -// arm64-macosx: [[PTR0:%.*]] = getelementptr inbounds %TSo14FiveByteStructV, ptr [[COERCED]], {{i.*}} 0, {{i.*}} 0 -// arm64-macosx: [[PTR1:%.*]] = getelementptr inbounds %T10ObjectiveC8ObjCBoolV, ptr [[PTR0]], {{i.*}} 0, {{i.*}} 0 -// arm64-macosx: [[PTR2:%.*]] = getelementptr inbounds %TSb, ptr [[PTR1]], {{i.*}} 0, {{i.*}} 0 +// arm64-macosx: [[PTR0:%.*]] = getelementptr inbounds{{.*}} %TSo14FiveByteStructV, ptr [[COERCED]], {{i.*}} 0, {{i.*}} 0 +// arm64-macosx: [[PTR1:%.*]] = getelementptr inbounds{{.*}} %T10ObjectiveC8ObjCBoolV, ptr [[PTR0]], {{i.*}} 0, {{i.*}} 0 +// arm64-macosx: [[PTR2:%.*]] = getelementptr inbounds{{.*}} %TSb, ptr [[PTR1]], {{i.*}} 0, {{i.*}} 0 // arm64-macosx: store i8 0, ptr [[PTR2]], align 8 // arm64-macosx: [[ARG:%.*]] = load i64, ptr [[COERCED]] // arm64-macosx: call void @objc_msgSend(ptr {{.*}}, ptr {{.*}}, i64 [[ARG]]) // // arm64-watchos: define swiftcc void @"$s8abitypes14testBOOLStructyyF"() // arm64-watchos: [[COERCED:%.*]] = alloca i64 -// arm64-watchos: [[PTR0:%.*]] = getelementptr inbounds %TSo14FiveByteStructV, ptr [[COERCED]], {{i.*}} 0, {{i.*}} 0 -// arm64-watchos: [[PTR1:%.*]] = getelementptr inbounds %T10ObjectiveC8ObjCBoolV, ptr [[PTR0]], {{i.*}} 0, {{i.*}} 0 -// arm64-watchos: [[PTR2:%.*]] = getelementptr inbounds %TSb, ptr [[PTR1]], {{i.*}} 0, {{i.*}} 0 +// arm64-watchos: [[PTR0:%.*]] = getelementptr inbounds{{.*}} %TSo14FiveByteStructV, ptr [[COERCED]], {{i.*}} 0, {{i.*}} 0 +// arm64-watchos: [[PTR1:%.*]] = getelementptr inbounds{{.*}} %T10ObjectiveC8ObjCBoolV, ptr [[PTR0]], {{i.*}} 0, {{i.*}} 0 +// arm64-watchos: [[PTR2:%.*]] = getelementptr inbounds{{.*}} %TSb, ptr [[PTR1]], {{i.*}} 0, {{i.*}} 0 // arm64-watchos: store i8 0, ptr [[PTR2]], align 8 // arm64-watchos: [[ARG:%.*]] = load i64, ptr [[COERCED]] // arm64-watchos: call void @objc_msgSend(ptr {{.*}}, ptr {{.*}}, i64 [[ARG]]) diff --git a/test/IRGen/abitypes_x86_64.swift b/test/IRGen/abitypes_x86_64.swift index 80314b3fbad3a..04400c2f92d91 100644 --- a/test/IRGen/abitypes_x86_64.swift +++ b/test/IRGen/abitypes_x86_64.swift @@ -11,9 +11,9 @@ import c_gadget // x86_64: store float %1, // x86_64: store float %2, // x86_64: store float %3, -// x86_64: [[T0:%.*]] = getelementptr inbounds { <2 x float>, <2 x float> }, ptr [[COERCED]], i32 0, i32 0 +// x86_64: [[T0:%.*]] = getelementptr inbounds{{.*}} { <2 x float>, <2 x float> }, ptr [[COERCED]], i32 0, i32 0 // x86_64: [[FIRST_HALF:%.*]] = load <2 x float>, ptr [[T0]], align 8 -// x86_64: [[T0:%.*]] = getelementptr inbounds { <2 x float>, <2 x float> }, ptr [[COERCED]], i32 0, i32 1 +// x86_64: [[T0:%.*]] = getelementptr inbounds{{.*}} { <2 x float>, <2 x float> }, ptr [[COERCED]], i32 0, i32 1 // x86_64: [[SECOND_HALF:%.*]] = load <2 x float>, ptr [[T0]], align 8 // x86_64: [[RESULT:%.*]] = call float @MyRect_Area(<2 x float> [[FIRST_HALF]], <2 x float> [[SECOND_HALF]]) // x86_64: ret float [[RESULT]] diff --git a/test/IRGen/access_markers.sil b/test/IRGen/access_markers.sil index 0fe492f18343f..2d50adbc076fb 100644 --- a/test/IRGen/access_markers.sil +++ b/test/IRGen/access_markers.sil @@ -26,14 +26,14 @@ bb0(%0 : @guaranteed $A): // CHECK: [[SCRATCH1:%.*]] = alloca [[BUFFER:.* x i8.]], align // CHECK: [[SCRATCH2:%.*]] = alloca [[BUFFER]], align - // CHECK: [[PROPERTY:%.*]] = getelementptr inbounds [[C]], ptr %0, i32 0, i32 1 + // CHECK: [[PROPERTY:%.*]] = getelementptr inbounds{{.*}} [[C]], ptr %0, i32 0, i32 1 %2 = ref_element_addr %0 : $A, #A.property // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 {{.*}}, ptr [[SCRATCH1]]) // CHECK-NEXT: call void @swift_beginAccess(ptr [[PROPERTY]], ptr [[SCRATCH1]], [[SIZE:i(32|64)]] 33, ptr null) %3 = begin_access [modify] [dynamic] %2 : $*Int64 - // CHECK-NEXT: getelementptr inbounds %Ts5Int64V, ptr [[PROPERTY]], i32 0, i32 0 + // CHECK-NEXT: getelementptr inbounds{{.*}} %Ts5Int64V, ptr [[PROPERTY]], i32 0, i32 0 // CHECK-NEXT: load i64, ptr %4 = load [trivial] %3 : $*Int64 @@ -45,7 +45,7 @@ bb0(%0 : @guaranteed $A): // CHECK-NEXT: call void @swift_beginAccess(ptr [[PROPERTY]], ptr [[SCRATCH2]], [[SIZE]] 32, ptr null) %6 = begin_access [read] [dynamic] %2 : $*Int64 - // CHECK-NEXT: getelementptr inbounds %Ts5Int64V, ptr [[PROPERTY]], i32 0, i32 0 + // CHECK-NEXT: getelementptr inbounds{{.*}} %Ts5Int64V, ptr [[PROPERTY]], i32 0, i32 0 // CHECK-NEXT: load i64, ptr %7 = load [trivial] %6 : $*Int64 @@ -65,7 +65,7 @@ bb0(%0 : $A): // CHECK: [[SCRATCH:%.*]] = alloca [[BUFFER:.* x i8.]], align %1 = alloc_stack $Builtin.UnsafeValueBuffer - // CHECK: [[PROPERTY:%.*]] = getelementptr inbounds [[C]], ptr %0, i32 0, i32 1 + // CHECK: [[PROPERTY:%.*]] = getelementptr inbounds{{.*}} [[C]], ptr %0, i32 0, i32 1 %2 = ref_element_addr %0 : $A, #A.property // CHECK-NEXT: call void @swift_beginAccess(ptr [[PROPERTY]], ptr [[SCRATCH]], [[SIZE]] 33, ptr null) @@ -131,7 +131,7 @@ bb0(%0 : $A): sil @testNontracking : $(@guaranteed A) -> () { bb0(%0 : $A): %1 = alloc_stack $Int64 - // CHECK: [[PROPERTY:%.*]] = getelementptr inbounds [[C]], ptr %0, i32 0, i32 1 + // CHECK: [[PROPERTY:%.*]] = getelementptr inbounds{{.*}} [[C]], ptr %0, i32 0, i32 1 %2 = ref_element_addr %0 : $A, #A.property // CHECK: call void @swift_beginAccess(ptr %{{.*}}, ptr %{{.*}}, [[SIZE]] 0, ptr null) %3 = begin_access [read] [dynamic] [no_nested_conflict] %2 : $*Int64 diff --git a/test/IRGen/access_markers_pc.sil b/test/IRGen/access_markers_pc.sil index cb77a9b4c5f0b..53dcf0d91ccd7 100644 --- a/test/IRGen/access_markers_pc.sil +++ b/test/IRGen/access_markers_pc.sil @@ -21,7 +21,7 @@ sil_vtable A {} // CHECK-LABEL: define {{.*}}void @testUnpairedExternal( sil @testUnpairedExternal : $(@guaranteed A, @inout Builtin.UnsafeValueBuffer) -> () { bb0(%0 : $A, %1 : $*Builtin.UnsafeValueBuffer): - // CHECK: [[PROPERTY:%.*]] = getelementptr inbounds [[C]], ptr %0, i32 0, i32 1 + // CHECK: [[PROPERTY:%.*]] = getelementptr inbounds{{.*}} [[C]], ptr %0, i32 0, i32 1 %2 = ref_element_addr %0 : $A, #A.property // CHECK-NEXT: [[PC:%.*]] = call ptr @llvm.returnaddress(i32 0) diff --git a/test/IRGen/actor_class.swift b/test/IRGen/actor_class.swift index e4e7ec3b57dc9..5526840ca3a6b 100644 --- a/test/IRGen/actor_class.swift +++ b/test/IRGen/actor_class.swift @@ -41,8 +41,8 @@ public actor MyClass { } // CHECK-LABEL: define {{.*}}@"$s11actor_class7MyClassC1xSivg" -// CHECK: [[T0:%.*]] = getelementptr inbounds %T11actor_class7MyClassC, ptr %0, i32 0, i32 2 -// CHECK: [[T1:%.*]] = getelementptr inbounds %TSi, ptr [[T0]], i32 0, i32 0 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %T11actor_class7MyClassC, ptr %0, i32 0, i32 2 +// CHECK: [[T1:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[T0]], i32 0, i32 0 // CHECK: load [[INT]], ptr [[T1]], align // CHECK-LABEL: define {{.*}}swiftcc ptr @"$s11actor_class7MyClassCACycfc" diff --git a/test/IRGen/actor_class_objc.swift b/test/IRGen/actor_class_objc.swift index 0e156c4c8ec29..eeca31a42f4fc 100644 --- a/test/IRGen/actor_class_objc.swift +++ b/test/IRGen/actor_class_objc.swift @@ -34,8 +34,8 @@ import Foundation } // CHECK-LABEL: define {{.*}} @"$s16actor_class_objc7MyClassC1xSivg" -// CHECK: [[T0:%.*]] = getelementptr inbounds %T16actor_class_objc7MyClassC, ptr %0, i32 0, i32 2 -// CHECK: [[T1:%.*]] = getelementptr inbounds %TSi, ptr [[T0]], i32 0, i32 0 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %T16actor_class_objc7MyClassC, ptr %0, i32 0, i32 2 +// CHECK: [[T1:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[T0]], i32 0, i32 0 // CHECK: load [[INT]], ptr [[T1]], align // CHECK-LABEL: define {{.*}}swiftcc ptr @"$s16actor_class_objc7MyClassCACycfc" diff --git a/test/IRGen/actor_class_objc_backdeploy.swift b/test/IRGen/actor_class_objc_backdeploy.swift index ab2c4b3a95698..80a3c9a9b4a4d 100644 --- a/test/IRGen/actor_class_objc_backdeploy.swift +++ b/test/IRGen/actor_class_objc_backdeploy.swift @@ -40,8 +40,8 @@ import Foundation // CHECK-LABEL: define {{.*}} @"$s16actor_class_objc7MyClassC1xSivg" -// CHECK: [[T0:%.*]] = getelementptr inbounds %T16actor_class_objc7MyClassC, ptr %0, i32 0, i32 2 -// CHECK: [[T1:%.*]] = getelementptr inbounds %TSi, ptr [[T0]], i32 0, i32 0 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %T16actor_class_objc7MyClassC, ptr %0, i32 0, i32 2 +// CHECK: [[T1:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[T0]], i32 0, i32 0 // CHECK: load [[INT]], ptr [[T1]], align // CHECK-LABEL: define {{.*}}swiftcc ptr @"$s16actor_class_objc7MyClassCACycfc" diff --git a/test/IRGen/arg_and_result_peepholes.swift b/test/IRGen/arg_and_result_peepholes.swift index 4e3c6337d844d..ee8dc3ab1d12f 100644 --- a/test/IRGen/arg_and_result_peepholes.swift +++ b/test/IRGen/arg_and_result_peepholes.swift @@ -10,13 +10,13 @@ // CHECK: [[TMP2:%.*]] = alloca %TSo9BigStructV // CHECK: [[CALL:%.*]] = alloca %TSo9BigStructV // CHECK: call void @llvm.lifetime.start.p0(i64 256, ptr [[TMP]]) -// CHECK: [[A1:%.*]] = getelementptr inbounds { i64, i64, i64, i64 }, ptr [[TMP]], i32 0, i32 0 +// CHECK: [[A1:%.*]] = getelementptr inbounds{{.*}} { i64, i64, i64, i64 }, ptr [[TMP]], i32 0, i32 0 // CHECK: store i64 %0, ptr [[A1]] -// CHECK: [[A2:%.*]] = getelementptr inbounds { i64, i64, i64, i64 }, ptr [[TMP]], i32 0, i32 1 +// CHECK: [[A2:%.*]] = getelementptr inbounds{{.*}} { i64, i64, i64, i64 }, ptr [[TMP]], i32 0, i32 1 // CHECK: store i64 %1, ptr [[A2]] -// CHECK: [[A3:%.*]] = getelementptr inbounds { i64, i64, i64, i64 }, ptr [[TMP]], i32 0, i32 2 +// CHECK: [[A3:%.*]] = getelementptr inbounds{{.*}} { i64, i64, i64, i64 }, ptr [[TMP]], i32 0, i32 2 // CHECK: store i64 %2, ptr [[A3]] -// CHECK: [[A4:%.*]] = getelementptr inbounds { i64, i64, i64, i64 }, ptr [[TMP]], i32 0, i32 3 +// CHECK: [[A4:%.*]] = getelementptr inbounds{{.*}} { i64, i64, i64, i64 }, ptr [[TMP]], i32 0, i32 3 // CHECK: store i64 %3, ptr [[A4]] // CHECK: call void @llvm.lifetime.start.p0(i64 32, ptr [[ARG_MEM]]) @@ -30,13 +30,13 @@ // CHECK: call void @llvm.memcpy.p0.p0.i64(ptr{{.*}} [[RES_MEM]], ptr{{.*}} [[CALL]], i64 32, i1 false) -// CHECK: [[A5:%.*]] = getelementptr inbounds { i64, i64, i64, i64 }, ptr [[RES_MEM]], i32 0, i32 0 +// CHECK: [[A5:%.*]] = getelementptr inbounds{{.*}} { i64, i64, i64, i64 }, ptr [[RES_MEM]], i32 0, i32 0 // CHECK: [[R1:%.*]] = load i64, ptr [[A5]] -// CHECK: [[A6:%.*]] = getelementptr inbounds { i64, i64, i64, i64 }, ptr [[RES_MEM]], i32 0, i32 1 +// CHECK: [[A6:%.*]] = getelementptr inbounds{{.*}} { i64, i64, i64, i64 }, ptr [[RES_MEM]], i32 0, i32 1 // CHECK: [[R2:%.*]] = load i64, ptr [[A6]] -// CHECK: [[A7:%.*]] = getelementptr inbounds { i64, i64, i64, i64 }, ptr [[RES_MEM]], i32 0, i32 2 +// CHECK: [[A7:%.*]] = getelementptr inbounds{{.*}} { i64, i64, i64, i64 }, ptr [[RES_MEM]], i32 0, i32 2 // CHECK: [[R3:%.*]] = load i64, ptr [[A7]] -// CHECK: [[A8:%.*]] = getelementptr inbounds { i64, i64, i64, i64 }, ptr [[RES_MEM]], i32 0, i32 3 +// CHECK: [[A8:%.*]] = getelementptr inbounds{{.*}} { i64, i64, i64, i64 }, ptr [[RES_MEM]], i32 0, i32 3 // CHECK: [[R4:%.*]] = load i64, ptr [[A8]] // CHECK: call void @llvm.lifetime.end.p0(i64 32, ptr [[ARG_MEM]]) // CHECK: call void @llvm.lifetime.end.p0(i64 32, ptr [[RES_MEM]]) diff --git a/test/IRGen/async/builtins.sil b/test/IRGen/async/builtins.sil index 9ad7f105d3919..1767b1dccab6f 100644 --- a/test/IRGen/async/builtins.sil +++ b/test/IRGen/async/builtins.sil @@ -51,15 +51,15 @@ sil hidden [ossa] @launch_future_on : $@convention(method) (Int, Builtin.Exe bb0(%flags : $Int, %serialExecutor : $Builtin.Executor, %taskFunction: @owned $@async @callee_guaranteed @substituted <Ï„_0_0> () -> (@out Ï„_0_0, @error Error) for ): // CHECK: [[EXECUTOR_RECORD:%.*]] = alloca %swift.serial_executor_task_option // CHECK-NOT: br i1 - // CHECK: [[BASE_GEP:%.*]] = getelementptr inbounds %swift.serial_executor_task_option, ptr [[EXECUTOR_RECORD]], i32 0, i32 0 - // CHECK: [[FLAGS_GEP:%.*]] = getelementptr inbounds %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 0 + // CHECK: [[BASE_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.serial_executor_task_option, ptr [[EXECUTOR_RECORD]], i32 0, i32 0 + // CHECK: [[FLAGS_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 0 // CHECK: store [[INT]] 0, ptr [[FLAGS_GEP]], align - // CHECK: [[PARENT_GEP:%.*]] = getelementptr inbounds %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 1 + // CHECK: [[PARENT_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 1 // CHECK: store ptr null, ptr [[PARENT_GEP]], align - // CHECK: [[EXECUTOR_GEP:%.*]] = getelementptr inbounds %swift.serial_executor_task_option, ptr [[EXECUTOR_RECORD]], i32 0, i32 1 - // CHECK: [[EXECUTOR_IDENT_GEP:%.*]] = getelementptr inbounds %swift.executor, ptr [[EXECUTOR_GEP]], i32 0, i32 0 + // CHECK: [[EXECUTOR_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.serial_executor_task_option, ptr [[EXECUTOR_RECORD]], i32 0, i32 1 + // CHECK: [[EXECUTOR_IDENT_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.executor, ptr [[EXECUTOR_GEP]], i32 0, i32 0 // CHECK: store [[INT]] %1, ptr [[EXECUTOR_IDENT_GEP]], align - // CHECK: [[EXECUTOR_IMPL_GEP:%.*]] = getelementptr inbounds %swift.executor, ptr [[EXECUTOR_GEP]], i32 0, i32 1 + // CHECK: [[EXECUTOR_IMPL_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.executor, ptr [[EXECUTOR_GEP]], i32 0, i32 1 // CHECK: store [[INT]] %2, ptr [[EXECUTOR_IMPL_GEP]], align // CHECK: [[NEW_TASK_AND_CONTEXT:%.*]] = call swift{{(tail)?}}cc %swift.async_task_and_context @swift_task_create([[INT]] %0, ptr [[EXECUTOR_RECORD]], ptr %T, ptr %3, ptr %4) %optSerialExecutor = enum $Optional, #Optional.some, %serialExecutor : $Builtin.Executor @@ -76,12 +76,12 @@ bb0(%flags : $Int, %serialExecutor : $Builtin.Executor, %taskFunction: @owned $@ // CHECK-LABEL: define hidden swift{{(tail)?}}cc void @launch_future_in_group // CHECK: [[OPTIONS:%.*]] = alloca %swift.task_group_task_option // CHECK-NOT: br i1 -// CHECK: [[BASE_GEP:%.*]] = getelementptr inbounds %swift.task_group_task_option, ptr [[OPTIONS]], i32 0, i32 0 -// CHECK: [[FLAGS_GEP:%.*]] = getelementptr inbounds %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 0 +// CHECK: [[BASE_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.task_group_task_option, ptr [[OPTIONS]], i32 0, i32 0 +// CHECK: [[FLAGS_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 0 // CHECK: store [[INT]] 1, ptr [[FLAGS_GEP]], align -// CHECK: [[PARENT_GEP:%.*]] = getelementptr inbounds %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 1 +// CHECK: [[PARENT_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 1 // CHECK: store ptr null, ptr [[PARENT_GEP]], align -// CHECK: [[GROUP_GEP:%.*]] = getelementptr inbounds %swift.task_group_task_option, ptr [[OPTIONS]], i32 0, i32 1 +// CHECK: [[GROUP_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.task_group_task_option, ptr [[OPTIONS]], i32 0, i32 1 // CHECK: store ptr %0, ptr [[GROUP_GEP]], align // CHECK: call swiftcc %swift.async_task_and_context @swift_task_create([[INT]] %3, ptr [[OPTIONS]], sil hidden @launch_future_in_group : $@convention(thin) (Builtin.RawPointer, @owned @async @callee_guaranteed @substituted <Ï„_0_0> () -> (@out Ï„_0_0, @error Error) for , Int) -> () { @@ -106,12 +106,12 @@ bb0(%flags : $Int, %optTaskGroup : $Optional, %taskFunction: // CHECK: br i1 [[GROUP_IS_NULL]], label %task_group.cont, label %task_group.some // CHECK: task_group.some: // CHECK: [[GROUP:%.*]] = inttoptr [[INT]] %1 to ptr - // CHECK: [[BASE_GEP:%.*]] = getelementptr inbounds %swift.task_group_task_option, ptr [[OPTIONS]], i32 0, i32 0 - // CHECK: [[FLAGS_GEP:%.*]] = getelementptr inbounds %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 0 + // CHECK: [[BASE_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.task_group_task_option, ptr [[OPTIONS]], i32 0, i32 0 + // CHECK: [[FLAGS_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 0 // CHECK: store [[INT]] 1, ptr [[FLAGS_GEP]], align - // CHECK: [[PARENT_GEP:%.*]] = getelementptr inbounds %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 1 + // CHECK: [[PARENT_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 1 // CHECK: store ptr null, ptr [[PARENT_GEP]], align - // CHECK: [[GROUP_GEP:%.*]] = getelementptr inbounds %swift.task_group_task_option, ptr [[OPTIONS]], i32 0, i32 1 + // CHECK: [[GROUP_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.task_group_task_option, ptr [[OPTIONS]], i32 0, i32 1 // CHECK: store ptr [[GROUP]], ptr [[GROUP_GEP]], align // CHECK: br label %task_group.cont // CHECK: task_group.cont: @@ -157,23 +157,23 @@ bb0(%taskGroup : $Builtin.RawPointer, %taskExecutor : $Builtin.Executor, %taskFu // CHECK: [[EXECUTOR_RECORD:%.*]] = alloca %swift.task_executor_task_option // CHECK-NOT: br i1 - // CHECK: [[BASE_GEP:%.*]] = getelementptr inbounds %swift.task_group_task_option, ptr [[GROUP_RECORD]], i32 0, i32 0 - // CHECK: [[FLAGS_GEP:%.*]] = getelementptr inbounds %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 0 + // CHECK: [[BASE_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.task_group_task_option, ptr [[GROUP_RECORD]], i32 0, i32 0 + // CHECK: [[FLAGS_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 0 // CHECK: store [[INT]] 1, ptr [[FLAGS_GEP]], align - // CHECK: [[PARENT_GEP:%.*]] = getelementptr inbounds %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 1 + // CHECK: [[PARENT_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 1 // CHECK: store ptr null, ptr [[PARENT_GEP]], align - // CHECK: [[GROUP_GEP:%.*]] = getelementptr inbounds %swift.task_group_task_option, ptr [[GROUP_RECORD]], i32 0, i32 1 + // CHECK: [[GROUP_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.task_group_task_option, ptr [[GROUP_RECORD]], i32 0, i32 1 // CHECK: store ptr %0, ptr [[GROUP_GEP]], align - // CHECK: [[BASE_GEP:%.*]] = getelementptr inbounds %swift.task_executor_task_option, ptr [[EXECUTOR_RECORD]], i32 0, i32 0 - // CHECK: [[FLAGS_GEP:%.*]] = getelementptr inbounds %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 0 + // CHECK: [[BASE_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.task_executor_task_option, ptr [[EXECUTOR_RECORD]], i32 0, i32 0 + // CHECK: [[FLAGS_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 0 // CHECK: store [[INT]] 5, ptr [[FLAGS_GEP]], align - // CHECK: [[PARENT_GEP:%.*]] = getelementptr inbounds %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 1 + // CHECK: [[PARENT_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.task_option, ptr [[BASE_GEP]], i32 0, i32 1 // CHECK: store ptr [[GROUP_RECORD]], ptr [[PARENT_GEP]], align - // CHECK: [[EXECUTOR_GEP:%.*]] = getelementptr inbounds %swift.task_executor_task_option, ptr [[EXECUTOR_RECORD]], i32 0, i32 1 - // CHECK: [[EXECUTOR_IDENT_GEP:%.*]] = getelementptr inbounds %swift.executor, ptr [[EXECUTOR_GEP]], i32 0, i32 0 + // CHECK: [[EXECUTOR_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.task_executor_task_option, ptr [[EXECUTOR_RECORD]], i32 0, i32 1 + // CHECK: [[EXECUTOR_IDENT_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.executor, ptr [[EXECUTOR_GEP]], i32 0, i32 0 // CHECK: store [[INT]] %1, ptr [[EXECUTOR_IDENT_GEP]], align - // CHECK: [[EXECUTOR_IMPL_GEP:%.*]] = getelementptr inbounds %swift.executor, ptr [[EXECUTOR_GEP]], i32 0, i32 1 + // CHECK: [[EXECUTOR_IMPL_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.executor, ptr [[EXECUTOR_GEP]], i32 0, i32 1 // CHECK: store [[INT]] %2, ptr [[EXECUTOR_IMPL_GEP]], align // CHECK: call swift{{(tail)?}}cc %swift.async_task_and_context @swift_task_create([[INT]] %5, ptr [[EXECUTOR_RECORD]] @@ -202,9 +202,9 @@ bb0(%flags : $Int, %taskGroup : $Builtin.RawPointer, %taskFunction: @owned $@asy // CHECK-LABEL: define hidden swiftcc void @resume_nonthrowing_continuation sil hidden [ossa] @resume_nonthrowing_continuation : $(@in Builtin.NativeObject, Builtin.RawUnsafeContinuation) -> () { bb0(%0 : $*Builtin.NativeObject, %1 : $Builtin.RawUnsafeContinuation): - // CHECK: [[CONTEXT_SLOT:%.*]] = getelementptr inbounds %swift.task, ptr %1, i32 0, i32 8 + // CHECK: [[CONTEXT_SLOT:%.*]] = getelementptr inbounds{{.*}} %swift.task, ptr %1, i32 0, i32 8 // CHECK-NEXT: [[CONTEXT_OPAQUE:%.*]] = load ptr, ptr [[CONTEXT_SLOT]], align - // CHECK-NEXT: [[RESULT_ADDR_SLOT:%.*]] = getelementptr inbounds %swift.continuation_context, ptr [[CONTEXT_OPAQUE]], i32 0, i32 4 + // CHECK-NEXT: [[RESULT_ADDR_SLOT:%.*]] = getelementptr inbounds{{.*}} %swift.continuation_context, ptr [[CONTEXT_OPAQUE]], i32 0, i32 4 // CHECK-NEXT: [[RESULT_ADDR_OPAQUE:%.*]] = load ptr, ptr [[RESULT_ADDR_SLOT]], align // CHECK-NEXT: [[VALUE:%.*]] = load ptr, ptr %0, align // CHECK-NEXT: store ptr [[VALUE]], ptr [[RESULT_ADDR_OPAQUE]], align @@ -218,9 +218,9 @@ bb0(%0 : $*Builtin.NativeObject, %1 : $Builtin.RawUnsafeContinuation): // CHECK-LABEL: define hidden swiftcc void @resume_throwing_continuation sil hidden [ossa] @resume_throwing_continuation : $(@in Builtin.NativeObject, Builtin.RawUnsafeContinuation) -> () { bb0(%0 : $*Builtin.NativeObject, %1 : $Builtin.RawUnsafeContinuation): - // CHECK: [[CONTEXT_SLOT:%.*]] = getelementptr inbounds %swift.task, ptr %1, i32 0, i32 8 + // CHECK: [[CONTEXT_SLOT:%.*]] = getelementptr inbounds{{.*}} %swift.task, ptr %1, i32 0, i32 8 // CHECK-NEXT: [[CONTEXT_OPAQUE:%.*]] = load ptr, ptr [[CONTEXT_SLOT]], align - // CHECK-NEXT: [[RESULT_ADDR_SLOT:%.*]] = getelementptr inbounds %swift.continuation_context, ptr [[CONTEXT_OPAQUE]], i32 0, i32 4 + // CHECK-NEXT: [[RESULT_ADDR_SLOT:%.*]] = getelementptr inbounds{{.*}} %swift.continuation_context, ptr [[CONTEXT_OPAQUE]], i32 0, i32 4 // CHECK-NEXT: [[RESULT_ADDR_OPAQUE:%.*]] = load ptr, ptr [[RESULT_ADDR_SLOT]], align // CHECK-NEXT: [[VALUE:%.*]] = load ptr, ptr %0, align // CHECK-NEXT: store ptr [[VALUE]], ptr [[RESULT_ADDR_OPAQUE]], align diff --git a/test/IRGen/async/get_async_continuation.sil b/test/IRGen/async/get_async_continuation.sil index 211df650e4e97..1d5da2ce47f12 100644 --- a/test/IRGen/async/get_async_continuation.sil +++ b/test/IRGen/async/get_async_continuation.sil @@ -23,8 +23,8 @@ bb0: // Initialize the async continuation context: // Initialize Parent. -// CHECK: [[base_context:%.*]] = getelementptr inbounds %swift.continuation_context, ptr [[cont_context]], i32 0, i32 0 -// CHECK: [[context_addr:%.*]] = getelementptr inbounds %swift.context, ptr [[base_context]], i32 0, i32 0 +// CHECK: [[base_context:%.*]] = getelementptr inbounds{{.*}} %swift.continuation_context, ptr [[cont_context]], i32 0, i32 0 +// CHECK: [[context_addr:%.*]] = getelementptr inbounds{{.*}} %swift.context, ptr [[base_context]], i32 0, i32 0 // CHECK: [[ctxt:%.*]] = load ptr, ptr [[ctxt_addr]] // CHECK-arm64e: [[ctxt_addr_int:%[0-9]+]] = ptrtoint ptr [[context_addr]] to i64 // CHECK-arm64e: [[ptrauth_blend:%[0-9]+]] = call i64 @llvm.ptrauth.blend(i64 [[ctxt_addr_int]], i64 48546) @@ -35,12 +35,12 @@ bb0: // CHECK-x86_64: store ptr [[ctxt]], ptr [[context_addr]] // Initialize NormalResult. -// CHECK: [[result_addr:%.*]] = getelementptr inbounds %swift.continuation_context, ptr [[cont_context]], i32 0, i32 4 +// CHECK: [[result_addr:%.*]] = getelementptr inbounds{{.*}} %swift.continuation_context, ptr [[cont_context]], i32 0, i32 4 // CHECK: store ptr [[result_storage]], ptr [[result_addr]] // Initialize ResumeParent. // CHECK: [[resume_intrinsic:%.*]] = call ptr @llvm.coro.async.resume() -// CHECK: [[continuation_fn_addr:%.*]] = getelementptr inbounds %swift.context, ptr [[base_context]], i32 0, i32 1 +// CHECK: [[continuation_fn_addr:%.*]] = getelementptr inbounds{{.*}} %swift.context, ptr [[base_context]], i32 0, i32 1 // CHECK-arm64e: [[continuation_fn_addr_int:%[0-9]+]] = ptrtoint ptr [[continuation_fn_addr]] to i64 // CHECK-arm64e: [[ptrauth_blend:%[0-9]+]] = call i64 @llvm.ptrauth.blend(i64 [[continuation_fn_addr_int]], i64 55047) // CHECK-arm64e: [[continuation_fn_int:%[0-9]+]] = ptrtoint ptr [[resume_intrinsic]] to i64 @@ -57,7 +57,7 @@ bb0: // Arrive at the await_async_continuation point. // CHECK: [[suspend:%.*]] = call { ptr } (i32, ptr, ptr, ...) @llvm.coro.suspend.async.sl_p0s(i32 0, ptr [[resume_intrinsic]], ptr @__swift_async_resume_project_context, ptr @__swift_continuation_await_point, ptr [[cont_context]]) -// CHECK: [[result_addr_addr:%.*]] = getelementptr inbounds %swift.continuation_context, ptr [[cont_context]], i32 0, i32 4 +// CHECK: [[result_addr_addr:%.*]] = getelementptr inbounds{{.*}} %swift.continuation_context, ptr [[cont_context]], i32 0, i32 4 // CHECK: [[result_addr:%.*]] = load ptr, ptr [[result_addr_addr]] // CHECK: [[result_value:%.*]] = load i32, ptr [[result_addr]] // CHECK: br label %[[result_bb:[0-9]+]] diff --git a/test/IRGen/async/hop_to_executor.sil b/test/IRGen/async/hop_to_executor.sil index 421c04f0c3b7d..b35ecab6b9035 100644 --- a/test/IRGen/async/hop_to_executor.sil +++ b/test/IRGen/async/hop_to_executor.sil @@ -20,7 +20,7 @@ import _Concurrency // CHECK: [[RESUME_CTX:%[0-9]+]] = call ptr @__swift_async_resume_get_context( // CHECK: store ptr [[RESUME_CTX]], ptr [[CTX_ADDR]] // CHECK: [[CTX:%[0-9+]+]] = load ptr, ptr [[CTX_ADDR]] -// CHECK: [[CONT_ADDR:%[0-9]+]] = getelementptr inbounds <{ ptr, ptr }>, ptr [[CTX]], i32 0, i32 1 +// CHECK: [[CONT_ADDR:%[0-9]+]] = getelementptr inbounds{{.*}} <{ ptr, ptr }>, ptr [[CTX]], i32 0, i32 1 // CHECK: [[RET_CONTINUATION:%.*]] = load ptr, ptr [[CONT_ADDR]] // CHECK-arm64e: [[T0:%.*]] = ptrtoint ptr [[RET_CONTINUATION]] to i64 // CHECK-arm64e: [[T1:%.*]] = call i64 @llvm.ptrauth.auth(i64 [[T0]] diff --git a/test/IRGen/bitcast.sil b/test/IRGen/bitcast.sil index e7fd7887dc1ad..093886d564e2f 100644 --- a/test/IRGen/bitcast.sil +++ b/test/IRGen/bitcast.sil @@ -19,7 +19,7 @@ protocol CP: class {} // CHECK-i386-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc i32 @bitcast_trivial(ptr %0) {{.*}} { // CHECK-i386: [[BUF:%.*]] = alloca ptr, align 4 // CHECK-i386: store ptr %0, ptr [[BUF]] -// CHECK-i386: [[VALUE_BUF:%.*]] = getelementptr inbounds %TSi, ptr [[BUF]], i32 0, i32 0 +// CHECK-i386: [[VALUE_BUF:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[BUF]], i32 0, i32 0 // CHECK-i386: [[VALUE:%.*]] = load i32, ptr [[VALUE_BUF]], align 4 // CHECK-i386: ret i32 [[VALUE]] // CHECK-i386: } @@ -27,7 +27,7 @@ protocol CP: class {} // CHECK-x86_64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc i64 @bitcast_trivial(ptr %0) {{.*}} { // CHECK-x86_64: [[BUF:%.*]] = alloca ptr, align 8 // CHECK-x86_64: store ptr %0, ptr [[BUF]] -// CHECK-x86_64: [[VALUE_BUF:%.*]] = getelementptr inbounds %TSi, ptr [[BUF]], i32 0, i32 0 +// CHECK-x86_64: [[VALUE_BUF:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[BUF]], i32 0, i32 0 // CHECK-x86_64: [[VALUE:%.*]] = load i64, ptr [[VALUE_BUF]], align 8 // CHECK-x86_64: ret i64 [[VALUE]] // CHECK-x86_64: } @@ -88,7 +88,7 @@ bb0(%0 : $Optional): // A bunch of GEPs happen here to get from Int to int. // CHECK-x86_64: store i64 %{{.*}}, ptr %bitcast.elt._value, align 8 // CHECK-x86_64: store i64 %{{.*}}, ptr %bitcast.elt1._value, align 8 -// CHECK-x86_64-NEXT: [[VAL:%.*]] = getelementptr inbounds %TSi, ptr %bitcast, i32 0, i32 0 +// CHECK-x86_64-NEXT: [[VAL:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr %bitcast, i32 0, i32 0 // CHECK-x86_64-NEXT: [[RESULT:%.*]] = load i64, ptr [[VAL]], align 8 // CHECK-x86_64: ret i64 [[RESULT]] // CHECK-x86_64-NEXT: } diff --git a/test/IRGen/boxed_existential.sil b/test/IRGen/boxed_existential.sil index 16870af6b1632..3c061cf6f27ee 100644 --- a/test/IRGen/boxed_existential.sil +++ b/test/IRGen/boxed_existential.sil @@ -81,7 +81,7 @@ entry(%b : $Error): // CHECK: [[ADDR:%.*]] = load {{.*}} [[OUT_ADDR]] %a = project_existential_box $SomeError in %b : $Error - // CHECK: [[GEP1:%.*]] = getelementptr inbounds %T17boxed_existential9SomeErrorV, ptr %2, i32 0, i32 1 + // CHECK: [[GEP1:%.*]] = getelementptr inbounds{{.*}} %T17boxed_existential9SomeErrorV, ptr %2, i32 0, i32 1 // CHECK: [[GEP2:%.*]] = getelementptr inbounds {{.*}} [[GEP1]], i32 0, i32 0 %c = struct_element_addr %a : $*SomeError, #SomeError._code diff --git a/test/IRGen/builtins.swift b/test/IRGen/builtins.swift index 6cd0d59b5d317..61acb9e227804 100644 --- a/test/IRGen/builtins.swift +++ b/test/IRGen/builtins.swift @@ -212,11 +212,11 @@ func sizeof_alignof_metatype_test() { // CHECK: define hidden {{.*}}void @"$s8builtins27generic_sizeof_alignof_testyyxlF" func generic_sizeof_alignof_test(_: T) { - // CHECK: [[T0:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[T:%.*]], i32 0, i32 8 + // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[T:%.*]], i32 0, i32 8 // CHECK-NEXT: [[SIZE:%.*]] = load i64, ptr [[T0]] // CHECK-NEXT: store i64 [[SIZE]], ptr [[S:%.*]] var s = Builtin.sizeof(T.self) - // CHECK: [[T0:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[T:%.*]], i32 0, i32 10 + // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[T:%.*]], i32 0, i32 10 // CHECK-NEXT: [[FLAGS:%.*]] = load i32, ptr [[T0]] // CHECK-NEXT: [[T2:%.*]] = zext i32 [[FLAGS]] to i64 // CHECK-NEXT: [[T3:%.*]] = and i64 [[T2]], 255 @@ -227,7 +227,7 @@ func generic_sizeof_alignof_test(_: T) { // CHECK: define hidden {{.*}}void @"$s8builtins21generic_strideof_testyyxlF" func generic_strideof_test(_: T) { - // CHECK: [[T0:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[T:%.*]], i32 9 + // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[T:%.*]], i32 9 // CHECK-NEXT: [[STRIDE:%.*]] = load i64, ptr [[T0]] // CHECK-NEXT: store i64 [[STRIDE]], ptr [[S:%.*]] var s = Builtin.strideof(T.self) @@ -667,7 +667,7 @@ func acceptsAnyObject(_ ref: inout Builtin.AnyObject?) {} // ObjC // 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: [[ADDR:%.+]] = getelementptr inbounds{{.*}} [[OPTIONAL_ANYOBJECT_TY:%.*]], ptr %0, i32 0, i32 0 // CHECK-NEXT: [[REF:%.+]] = load ptr, ptr [[ADDR]] // CHECK-objc-NEXT: [[RESULT:%.+]] = call zeroext i1 @swift_isUniquelyReferenced{{(NonObjC)?}}(ptr [[REF]]) // CHECK-native-NEXT: [[RESULT:%.+]] = call zeroext i1 @swift_isUniquelyReferenced_native(ptr [[REF]]) @@ -680,7 +680,7 @@ func isUnique(_ ref: inout Builtin.AnyObject?) -> Bool { // CHECK-LABEL: define hidden {{.*}}i1 @"$s8builtins8isUniqueyBi1_yXlzF" // CHECK-SAME: (ptr nocapture dereferenceable({{.*}}) %0) {{.*}} { // CHECK-NEXT: entry: -// CHECK: [[ADDR:%.+]] = getelementptr inbounds %AnyObject, ptr %0, i32 0, i32 0 +// CHECK: [[ADDR:%.+]] = getelementptr inbounds{{.*}} %AnyObject, ptr %0, i32 0, i32 0 // CHECK: [[REF:%.+]] = load ptr, ptr [[ADDR]] // CHECK-objc-NEXT: [[RESULT:%.+]] = call zeroext i1 @swift_isUniquelyReferenced{{(NonObjC)?}}_nonNull(ptr [[REF]]) // CHECK-native-NEXT: [[RESULT:%.+]] = call zeroext i1 @swift_isUniquelyReferenced_nonNull_native(ptr [[REF]]) @@ -733,7 +733,7 @@ func COWBufferForReading(_ ref: __owned C) -> C { // CHECK-LABEL: define {{.*}} @{{.*}}generic_ispod_test func generic_ispod_test(_: T) { - // CHECK: [[T0:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[T:%.*]], i32 10 + // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[T:%.*]], i32 10 // CHECK-NEXT: [[FLAGS:%.*]] = load i32, ptr [[T0]] // CHECK-NEXT: [[ISNOTPOD:%.*]] = and i32 [[FLAGS]], 65536 // CHECK-NEXT: [[ISPOD:%.*]] = icmp eq i32 [[ISNOTPOD]], 0 @@ -752,7 +752,7 @@ func ispod_test() { // CHECK-LABEL: define {{.*}} @{{.*}}generic_isbitwisetakable_test func generic_isbitwisetakable_test(_: T) { - // CHECK: [[T0:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[T:%.*]], i32 10 + // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[T:%.*]], i32 10 // CHECK-NEXT: [[FLAGS:%.*]] = load i32, ptr [[T0]] // CHECK-NEXT: [[ISNOTBITWISETAKABLE:%.*]] = and i32 [[FLAGS]], 1048576 // CHECK-NEXT: [[ISBITWISETAKABLE:%.*]] = icmp eq i32 [[ISNOTBITWISETAKABLE]], 0 diff --git a/test/IRGen/c_layout.sil b/test/IRGen/c_layout.sil index 6178b60f1d5d6..bf206477193f2 100644 --- a/test/IRGen/c_layout.sil +++ b/test/IRGen/c_layout.sil @@ -33,54 +33,54 @@ bb0: // 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: [[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: [[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 -// CHECK-x86_64: [[ADDR_B:%.*]] = getelementptr inbounds %TSo11BitfieldOneV, ptr [[RESULT]], i32 0, i32 1 -// CHECK-x86_64: [[ADDR_B_X:%.*]] = getelementptr inbounds %TSo6NestedV, ptr [[ADDR_B]], i32 0, i32 0 -// CHECK-x86_64: [[ADDR_B_X_V:%.*]] = getelementptr inbounds %TSf, ptr [[ADDR_B_X]], i32 0, i32 0 +// CHECK-x86_64: [[ADDR_B:%.*]] = getelementptr inbounds{{.*}} %TSo11BitfieldOneV, ptr [[RESULT]], i32 0, i32 1 +// CHECK-x86_64: [[ADDR_B_X:%.*]] = getelementptr inbounds{{.*}} %TSo6NestedV, ptr [[ADDR_B]], i32 0, i32 0 +// CHECK-x86_64: [[ADDR_B_X_V:%.*]] = getelementptr inbounds{{.*}} %TSf, ptr [[ADDR_B_X]], i32 0, i32 0 // CHECK-x86_64: [[B_X:%.*]] = load float, ptr [[ADDR_B_X_V]], align 4 -// CHECK-x86_64: [[ADDR_B_YZ:%.*]] = getelementptr inbounds %TSo6NestedV, ptr [[ADDR_B]], i32 0, i32 1 +// CHECK-x86_64: [[ADDR_B_YZ:%.*]] = getelementptr inbounds{{.*}} %TSo6NestedV, ptr [[ADDR_B]], i32 0, i32 1 // CHECK-x86_64: [[B_YZ:%.*]] = load i24, ptr [[ADDR_B_YZ]], align 4 -// CHECK-x86_64: [[ADDR_CDE:%.*]] = getelementptr inbounds %TSo11BitfieldOneV, ptr [[RESULT]], i32 0, i32 2 +// CHECK-x86_64: [[ADDR_CDE:%.*]] = getelementptr inbounds{{.*}} %TSo11BitfieldOneV, ptr [[RESULT]], i32 0, i32 2 // CHECK-x86_64: [[CDE:%.*]] = load i32, ptr [[ADDR_CDE]], align 4 -// CHECK-x86_64: [[ADDR_FGH:%.*]] = getelementptr inbounds %TSo11BitfieldOneV, ptr [[RESULT]], i32 0, i32 3 +// CHECK-x86_64: [[ADDR_FGH:%.*]] = getelementptr inbounds{{.*}} %TSo11BitfieldOneV, ptr [[RESULT]], i32 0, i32 3 // CHECK-x86_64: [[FGH:%.*]] = load i32, ptr [[ADDR_FGH]], align 8 -// CHECK-x86_64: [[ADDR_I:%.*]] = getelementptr inbounds %TSo11BitfieldOneV, ptr [[RESULT]], i32 0, i32 4 -// CHECK-x86_64: [[ADDR_I_V:%.*]] = getelementptr inbounds %TSf, ptr [[ADDR_I]], i32 0, i32 0 +// CHECK-x86_64: [[ADDR_I:%.*]] = getelementptr inbounds{{.*}} %TSo11BitfieldOneV, ptr [[RESULT]], i32 0, i32 4 +// CHECK-x86_64: [[ADDR_I_V:%.*]] = getelementptr inbounds{{.*}} %TSf, ptr [[ADDR_I]], i32 0, i32 0 // CHECK-x86_64: [[I:%.*]] = load float, ptr [[ADDR_I_V]], align 4 -// CHECK-x86_64: [[ADDR_JK:%.*]] = getelementptr inbounds %TSo11BitfieldOneV, ptr [[RESULT]], i32 0, i32 5 +// CHECK-x86_64: [[ADDR_JK:%.*]] = getelementptr inbounds{{.*}} %TSo11BitfieldOneV, ptr [[RESULT]], i32 0, i32 5 // CHECK-x86_64: [[JK:%.*]] = load i8, ptr [[ADDR_JK]], align 8 -// CHECK-x86_64: [[ADDR_L:%.*]] = getelementptr inbounds %TSo11BitfieldOneV, ptr [[RESULT]], i32 0, i32 7 -// CHECK-x86_64: [[ADDR_L_V:%.*]] = getelementptr inbounds %Ts6UInt64V, ptr [[ADDR_L]], i32 0, i32 0 +// CHECK-x86_64: [[ADDR_L:%.*]] = getelementptr inbounds{{.*}} %TSo11BitfieldOneV, ptr [[RESULT]], i32 0, i32 7 +// CHECK-x86_64: [[ADDR_L_V:%.*]] = getelementptr inbounds{{.*}} %Ts6UInt64V, ptr [[ADDR_L]], i32 0, i32 0 // CHECK-x86_64: [[L:%.*]] = load i64, ptr [[ADDR_L_V]], align 8 -// CHECK-x86_64: [[ADDR_M:%.*]] = getelementptr inbounds %TSo11BitfieldOneV, ptr [[RESULT]], i32 0, i32 8 -// CHECK-x86_64: [[ADDR_M_V:%.*]] = getelementptr inbounds %Ts6UInt32V, ptr [[ADDR_M]], i32 0, i32 0 +// CHECK-x86_64: [[ADDR_M:%.*]] = getelementptr inbounds{{.*}} %TSo11BitfieldOneV, ptr [[RESULT]], i32 0, i32 8 +// CHECK-x86_64: [[ADDR_M_V:%.*]] = getelementptr inbounds{{.*}} %Ts6UInt32V, ptr [[ADDR_M]], i32 0, i32 0 // CHECK-x86_64: [[M:%.*]] = load i32, ptr [[ADDR_M_V]], align 8 // Put all of the values into the indirect argument and make the second call. -// CHECK-x86_64: [[ADDR_A:%.*]] = getelementptr inbounds %TSo11BitfieldOneV, ptr [[ARG]], i32 0, i32 0 -// CHECK-x86_64: [[ADDR_A_V:%.*]] = getelementptr inbounds %Ts6UInt32V, ptr [[ADDR_A]], i32 0, i32 0 +// CHECK-x86_64: [[ADDR_A:%.*]] = getelementptr inbounds{{.*}} %TSo11BitfieldOneV, ptr [[ARG]], i32 0, i32 0 +// CHECK-x86_64: [[ADDR_A_V:%.*]] = getelementptr inbounds{{.*}} %Ts6UInt32V, ptr [[ADDR_A]], i32 0, i32 0 // CHECK-x86_64: store i32 [[A]], ptr [[ADDR_A_V]], align 8 -// CHECK-x86_64: [[ADDR_B:%.*]] = getelementptr inbounds %TSo11BitfieldOneV, ptr [[ARG]], i32 0, i32 1 -// CHECK-x86_64: [[ADDR_B_X:%.*]] = getelementptr inbounds %TSo6NestedV, ptr [[ADDR_B]], i32 0, i32 0 -// CHECK-x86_64: [[ADDR_B_X_V:%.*]] = getelementptr inbounds %TSf, ptr [[ADDR_B_X]], i32 0, i32 0 +// CHECK-x86_64: [[ADDR_B:%.*]] = getelementptr inbounds{{.*}} %TSo11BitfieldOneV, ptr [[ARG]], i32 0, i32 1 +// CHECK-x86_64: [[ADDR_B_X:%.*]] = getelementptr inbounds{{.*}} %TSo6NestedV, ptr [[ADDR_B]], i32 0, i32 0 +// CHECK-x86_64: [[ADDR_B_X_V:%.*]] = getelementptr inbounds{{.*}} %TSf, ptr [[ADDR_B_X]], i32 0, i32 0 // CHECK-x86_64: store float [[B_X]], ptr [[ADDR_B_X_V]], align 4 -// CHECK-x86_64: [[ADDR_B_YZ:%.*]] = getelementptr inbounds %TSo6NestedV, ptr [[ADDR_B]], i32 0, i32 1 +// CHECK-x86_64: [[ADDR_B_YZ:%.*]] = getelementptr inbounds{{.*}} %TSo6NestedV, ptr [[ADDR_B]], i32 0, i32 1 // CHECK-x86_64: store i24 [[B_YZ]], ptr [[ADDR_B_YZ]], align 4 -// CHECK-x86_64: [[ADDR_CDE:%.*]] = getelementptr inbounds %TSo11BitfieldOneV, ptr [[ARG]], i32 0, i32 2 +// CHECK-x86_64: [[ADDR_CDE:%.*]] = getelementptr inbounds{{.*}} %TSo11BitfieldOneV, ptr [[ARG]], i32 0, i32 2 // CHECK-x86_64: store i32 [[CDE]], ptr [[ADDR_CDE]], align 4 -// CHECK-x86_64: [[ADDR_FGH:%.*]] = getelementptr inbounds %TSo11BitfieldOneV, ptr [[ARG]], i32 0, i32 3 +// CHECK-x86_64: [[ADDR_FGH:%.*]] = getelementptr inbounds{{.*}} %TSo11BitfieldOneV, ptr [[ARG]], i32 0, i32 3 // CHECK-x86_64: store i32 [[FGH]], ptr [[ADDR_FGH]], align 8 -// CHECK-x86_64: [[ADDR_I:%.*]] = getelementptr inbounds %TSo11BitfieldOneV, ptr [[ARG]], i32 0, i32 4 -// CHECK-x86_64: [[ADDR_I_V:%.*]] = getelementptr inbounds %TSf, ptr [[ADDR_I]], i32 0, i32 0 +// CHECK-x86_64: [[ADDR_I:%.*]] = getelementptr inbounds{{.*}} %TSo11BitfieldOneV, ptr [[ARG]], i32 0, i32 4 +// CHECK-x86_64: [[ADDR_I_V:%.*]] = getelementptr inbounds{{.*}} %TSf, ptr [[ADDR_I]], i32 0, i32 0 // CHECK-x86_64: store float [[I]], ptr [[ADDR_I_V]], align 4 -// CHECK-x86_64: [[ADDR_JK:%.*]] = getelementptr inbounds %TSo11BitfieldOneV, ptr [[ARG]], i32 0, i32 5 +// CHECK-x86_64: [[ADDR_JK:%.*]] = getelementptr inbounds{{.*}} %TSo11BitfieldOneV, ptr [[ARG]], i32 0, i32 5 // CHECK-x86_64: store i8 [[JK]], ptr [[ADDR_JK]], align 8 -// CHECK-x86_64: [[ADDR_L:%.*]] = getelementptr inbounds %TSo11BitfieldOneV, ptr [[ARG]], i32 0, i32 7 -// CHECK-x86_64: [[ADDR_L_V:%.*]] = getelementptr inbounds %Ts6UInt64V, ptr [[ADDR_L]], i32 0, i32 0 +// CHECK-x86_64: [[ADDR_L:%.*]] = getelementptr inbounds{{.*}} %TSo11BitfieldOneV, ptr [[ARG]], i32 0, i32 7 +// CHECK-x86_64: [[ADDR_L_V:%.*]] = getelementptr inbounds{{.*}} %Ts6UInt64V, ptr [[ADDR_L]], i32 0, i32 0 // CHECK-x86_64: store i64 [[L]], ptr [[ADDR_L_V]], align 8 -// CHECK-x86_64: [[ADDR_M:%.*]] = getelementptr inbounds %TSo11BitfieldOneV, ptr [[ARG]], i32 0, i32 8 -// CHECK-x86_64: [[ADDR_M_V:%.*]] = getelementptr inbounds %Ts6UInt32V, ptr [[ADDR_M]], i32 0, i32 0 +// CHECK-x86_64: [[ADDR_M:%.*]] = getelementptr inbounds{{.*}} %TSo11BitfieldOneV, ptr [[ARG]], i32 0, i32 8 +// CHECK-x86_64: [[ADDR_M_V:%.*]] = getelementptr inbounds{{.*}} %Ts6UInt32V, ptr [[ADDR_M]], i32 0, i32 0 // CHECK-x86_64: store i32 [[M]], ptr [[ADDR_M_V]], align 8 // CHECK-SYSV-x86_64: call void @consumeBitfieldOne(ptr byval({{.*}}) align 8 [[ARG]]) // CHECK-WIN-x86_64: call void @consumeBitfieldOne(ptr [[ARG]]) diff --git a/test/IRGen/class.sil b/test/IRGen/class.sil index 1176280a2caaf..08b0d525d1714 100644 --- a/test/IRGen/class.sil +++ b/test/IRGen/class.sil @@ -154,6 +154,6 @@ entry(%x : $ClassConstrainedGenericField): return %b : $ClassConstraintConformance } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @fixed_class_generic_field(ptr %0) -// CHECK: [[FIELD_ADDR_GENERIC:%.*]] = getelementptr inbounds %T5class28ClassConstrainedGenericFieldCyAA0B21ConstraintConformanceCG, ptr %0, i32 0, i32 1 +// CHECK: [[FIELD_ADDR_GENERIC:%.*]] = getelementptr inbounds{{.*}} %T5class28ClassConstrainedGenericFieldCyAA0B21ConstraintConformanceCG, ptr %0, i32 0, i32 1 // CHECK: load ptr, ptr [[FIELD_ADDR_GENERIC]] diff --git a/test/IRGen/class_bounded_generics.swift b/test/IRGen/class_bounded_generics.swift index ecb5d56460187..5f796216be3e1 100644 --- a/test/IRGen/class_bounded_generics.swift +++ b/test/IRGen/class_bounded_generics.swift @@ -218,9 +218,9 @@ func class_protocol_field_struct_fields func class_generic_field_class_fields (_ x:ClassGenericFieldClass) -> (Int, T, Int) { return (x.x, x.y, x.z) - // CHECK: getelementptr inbounds %T22class_bounded_generics017ClassGenericFieldD0C, ptr %0, i32 0, i32 1 - // CHECK: getelementptr inbounds %T22class_bounded_generics017ClassGenericFieldD0C, ptr %0, i32 0, i32 2 - // CHECK: getelementptr inbounds %T22class_bounded_generics017ClassGenericFieldD0C, ptr %0, i32 0, i32 3 + // CHECK: getelementptr inbounds{{.*}} %T22class_bounded_generics017ClassGenericFieldD0C, ptr %0, i32 0, i32 1 + // CHECK: getelementptr inbounds{{.*}} %T22class_bounded_generics017ClassGenericFieldD0C, ptr %0, i32 0, i32 2 + // CHECK: getelementptr inbounds{{.*}} %T22class_bounded_generics017ClassGenericFieldD0C, ptr %0, i32 0, i32 3 } // CHECK-LABEL: define hidden swiftcc { i64, ptr, ptr, i64 } @"$s22class_bounded_generics0a16_protocol_field_A7_fields{{[_0-9a-zA-Z]*}}F"(ptr %0) diff --git a/test/IRGen/class_field_other_module.swift b/test/IRGen/class_field_other_module.swift index b74db17246396..7785283301891 100644 --- a/test/IRGen/class_field_other_module.swift +++ b/test/IRGen/class_field_other_module.swift @@ -10,7 +10,7 @@ import other_class // 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 +// CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} i8, ptr %0, i64 16 // CHECK-NEXT: [[RESULT:%.*]] = load i32, ptr [[GEP]] // CHECK-NEXT: ret i32 [[RESULT]] public func getSubclassX(_ o: Subclass) -> Int32 { @@ -20,7 +20,7 @@ public func getSubclassX(_ o: Subclass) -> Int32 { // 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 +// CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} i8, ptr %0, i64 20 // CHECK-NEXT: [[RESULT:%.*]] = load i32, ptr [[GEP]] // CHECK-NEXT: ret i32 [[RESULT]] public func getSubclassY(_ o: Subclass) -> Int32 { diff --git a/test/IRGen/class_resilience.swift b/test/IRGen/class_resilience.swift index 361cf1804e85b..508b90872dcc4 100644 --- a/test/IRGen/class_resilience.swift +++ b/test/IRGen/class_resilience.swift @@ -290,7 +290,7 @@ public class ClassWithResilientThenEmpty { // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc i32 @"$s16class_resilience26ClassWithResilientPropertyC5colors5Int32Vvg"(ptr swiftself %0) // CHECK: [[OFFSET:%.*]] = load [[INT]], ptr @"$s16class_resilience26ClassWithResilientPropertyC5colors5Int32VvpWvd" // CHECK-NEXT: [[FIELD_ADDR:%.*]] = getelementptr inbounds i8, ptr %0, [[INT]] [[OFFSET]] -// CHECK-NEXT: [[FIELD_PAYLOAD:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[FIELD_ADDR]], i32 0, i32 0 +// CHECK-NEXT: [[FIELD_PAYLOAD:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[FIELD_ADDR]], i32 0, i32 0 // CHECK-NEXT: [[FIELD_VALUE:%.*]] = load i32, ptr [[FIELD_PAYLOAD]] // CHECK: ret i32 [[FIELD_VALUE]] @@ -299,7 +299,7 @@ public class ClassWithResilientThenEmpty { // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc i32 @"$s16class_resilience33ClassWithResilientlySizedPropertyC5colors5Int32Vvg"(ptr swiftself %0) // CHECK: [[OFFSET:%.*]] = load [[INT]], ptr @"$s16class_resilience33ClassWithResilientlySizedPropertyC5colors5Int32VvpWvd" // CHECK-NEXT: [[FIELD_ADDR:%.*]] = getelementptr inbounds i8, ptr %0, [[INT]] [[OFFSET]] -// CHECK-NEXT: [[FIELD_PAYLOAD:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[FIELD_ADDR]], i32 0, i32 0 +// CHECK-NEXT: [[FIELD_PAYLOAD:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[FIELD_ADDR]], i32 0, i32 0 // CHECK-NEXT: [[FIELD_VALUE:%.*]] = load i32, ptr [[FIELD_PAYLOAD]] // CHECK: ret i32 [[FIELD_VALUE]] @@ -307,8 +307,8 @@ public class ClassWithResilientThenEmpty { // ClassWithIndirectResilientEnum.color getter // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc i32 @"$s16class_resilience30ClassWithIndirectResilientEnumC5colors5Int32Vvg"(ptr swiftself %0) -// CHECK: [[FIELD_PTR:%.*]] = getelementptr inbounds %T16class_resilience30ClassWithIndirectResilientEnumC, ptr %0, i32 0, i32 2 -// CHECK-NEXT: [[FIELD_PAYLOAD:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[FIELD_PTR]], i32 0, i32 0 +// CHECK: [[FIELD_PTR:%.*]] = getelementptr inbounds{{.*}} %T16class_resilience30ClassWithIndirectResilientEnumC, ptr %0, i32 0, i32 2 +// CHECK-NEXT: [[FIELD_PAYLOAD:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[FIELD_PTR]], i32 0, i32 0 // CHECK-NEXT: [[FIELD_VALUE:%.*]] = load i32, ptr [[FIELD_PAYLOAD]] // CHECK: ret i32 [[FIELD_VALUE]] @@ -319,7 +319,7 @@ public class ClassWithResilientThenEmpty { // CHECK: [[OFFSET:%.*]] = load [[INT]], ptr @"$s16class_resilience14ResilientChildC5fields5Int32VvpWvd" // CHECK-NEXT: [[FIELD_ADDR:%.*]] = getelementptr inbounds i8, ptr %0, [[INT]] [[OFFSET]] // CHECK: call void @swift_beginAccess -// CHECK-NEXT: [[FIELD_PAYLOAD:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[FIELD_ADDR]], i32 0, i32 0 +// CHECK-NEXT: [[FIELD_PAYLOAD:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[FIELD_ADDR]], i32 0, i32 0 // CHECK-NEXT: [[FIELD_VALUE:%.*]] = load i32, ptr [[FIELD_PAYLOAD]] // CHECK-NEXT: call void @swift_endAccess // CHECK: ret i32 [[FIELD_VALUE]] @@ -340,7 +340,7 @@ public class ClassWithResilientThenEmpty { // CHECK-NEXT: [[FIELD_OFFSET:%.*]] = load [[INT]], ptr [[FIELD_OFFSET_ADDR:%.*]] // CHECK-NEXT: [[ADDR:%.*]] = getelementptr inbounds i8, ptr %0, [[INT]] [[FIELD_OFFSET]] // CHECK: call void @swift_beginAccess -// CHECK-NEXT: [[PAYLOAD_ADDR:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[ADDR]], i32 0, i32 0 +// CHECK-NEXT: [[PAYLOAD_ADDR:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[ADDR]], i32 0, i32 0 // CHECK-NEXT: [[RESULT:%.*]] = load i32, ptr [[PAYLOAD_ADDR]] // CHECK-NEXT: call void @swift_endAccess // CHECK: ret i32 [[RESULT]] @@ -349,8 +349,8 @@ public class ClassWithResilientThenEmpty { // MyResilientChild.field getter // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc i32 @"$s16class_resilience16MyResilientChildC5fields5Int32Vvg"(ptr swiftself %0) -// CHECK: [[FIELD_ADDR:%.*]] = getelementptr inbounds %T16class_resilience16MyResilientChildC, ptr %0, i32 0, i32 2 -// CHECK-NEXT: [[PAYLOAD_ADDR:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[FIELD_ADDR]], i32 0, i32 0 +// CHECK: [[FIELD_ADDR:%.*]] = getelementptr inbounds{{.*}} %T16class_resilience16MyResilientChildC, ptr %0, i32 0, i32 2 +// CHECK-NEXT: [[PAYLOAD_ADDR:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[FIELD_ADDR]], i32 0, i32 0 // CHECK-NEXT: [[RESULT:%.*]] = load i32, ptr [[PAYLOAD_ADDR]] // CHECK: ret i32 [[RESULT]] @@ -395,7 +395,7 @@ public class ClassWithResilientThenEmpty { // CHECK-objc-NEXT: [[FIELDS_DEST:%.*]] = getelementptr inbounds [[INT]], ptr %0, [[INT]] {{10|13}} // CHECK-native-NEXT: [[FIELDS_DEST:%.*]] = getelementptr inbounds [[INT]], ptr %0, [[INT]] {{7|10}} // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 {{12|24}}, ptr [[FIELDS]]) -// CHECK-NEXT: [[FIELDS_PTR:%.*]] = getelementptr inbounds [3 x ptr], ptr [[FIELDS]], i32 0, i32 0 +// CHECK-NEXT: [[FIELDS_PTR:%.*]] = getelementptr inbounds{{.*}} [3 x ptr], ptr [[FIELDS]], i32 0, i32 0 // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s16resilient_struct4SizeVMa"([[INT]] 319) // CHECK-NEXT: [[SIZE_METADATA:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 @@ -473,7 +473,7 @@ public class ClassWithResilientThenEmpty { // CHECK-objc-NEXT: [[FIELDS_DEST:%.*]] = getelementptr inbounds [[INT]], ptr %0, [[INT]] {{10|13}} // CHECK-native-NEXT: [[FIELDS_DEST:%.*]] = getelementptr inbounds [[INT]], ptr %0, [[INT]] {{7|10}} // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 {{8|16}}, ptr [[FIELDS]]) -// CHECK-NEXT: [[FIELDS_PTR:%.*]] = getelementptr inbounds [2 x ptr], ptr [[FIELDS]], i32 0, i32 0 +// CHECK-NEXT: [[FIELDS_PTR:%.*]] = getelementptr inbounds{{.*}} [2 x ptr], ptr [[FIELDS]], i32 0, i32 0 // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s16resilient_struct9RectangleVMa"([[INT]] 319) // CHECK-NEXT: [[SIZE_METADATA:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 diff --git a/test/IRGen/class_resilience_objc.swift b/test/IRGen/class_resilience_objc.swift index 6c3e22d52524e..a33ff54da89bf 100644 --- a/test/IRGen/class_resilience_objc.swift +++ b/test/IRGen/class_resilience_objc.swift @@ -37,7 +37,7 @@ public class FixedLayoutObjCSubclass : NSObject { // CHECK: [[OFFSET:%.*]] = load [[INT]], ptr @"$s21class_resilience_objc23FixedLayoutObjCSubclassC5fields5Int32VvpWvd" // CHECK-NEXT: [[ADDR:%.*]] = getelementptr inbounds i8, ptr %0, [[INT]] [[OFFSET]] // CHECK: call void @swift_beginAccess -// CHECK-NEXT: [[PAYLOAD_ADDR:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[ADDR]], i32 0, i32 0 +// CHECK-NEXT: [[PAYLOAD_ADDR:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[ADDR]], i32 0, i32 0 // CHECK-NEXT: store i32 10, ptr [[PAYLOAD_ADDR]] func testConstantDirectFieldAccess(_ o: FixedLayoutObjCSubclass) { @@ -54,7 +54,7 @@ public class NonFixedLayoutObjCSubclass : NSCoder { // CHECK: [[OFFSET:%.*]] = load [[INT]], ptr @"$s21class_resilience_objc26NonFixedLayoutObjCSubclassC5fields5Int32VvpWvd" // CHECK-NEXT: [[ADDR:%.*]] = getelementptr inbounds i8, ptr %0, [[INT]] [[OFFSET]] // CHECK: call void @swift_beginAccess -// CHECK-NEXT: [[PAYLOAD_ADDR:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[ADDR]], i32 0, i32 0 +// CHECK-NEXT: [[PAYLOAD_ADDR:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[ADDR]], i32 0, i32 0 // CHECK-NEXT: store i32 10, ptr [[PAYLOAD_ADDR]] func testNonConstantDirectFieldAccess(_ o: NonFixedLayoutObjCSubclass) { @@ -91,7 +91,7 @@ public class GenericObjCSubclass : NSCoder { // CHECK-NEXT: [[FIELD_OFFSET:%.*]] = load [[INT]], ptr [[FIELD_OFFSET_ADDR:%.*]] // CHECK-NEXT: [[ADDR:%.*]] = getelementptr inbounds i8, ptr %0, [[INT]] [[FIELD_OFFSET]] // CHECK: call void @swift_beginAccess -// CHECK-NEXT: [[PAYLOAD_ADDR:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[ADDR]], i32 0, i32 0 +// CHECK-NEXT: [[PAYLOAD_ADDR:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[ADDR]], i32 0, i32 0 // CHECK-NEXT: store i32 10, ptr [[PAYLOAD_ADDR]] func testConstantIndirectFieldAccess(_ o: GenericObjCSubclass) { diff --git a/test/IRGen/class_update_callback_with_fixed_layout.sil b/test/IRGen/class_update_callback_with_fixed_layout.sil index 606f010a58762..c77c249a53814 100644 --- a/test/IRGen/class_update_callback_with_fixed_layout.sil +++ b/test/IRGen/class_update_callback_with_fixed_layout.sil @@ -179,7 +179,7 @@ bb0(%0 : $ClassWithResilientField): // CHECK: [[OFFSET:%.*]] = load i64, ptr @"$s39class_update_callback_with_fixed_layout23ClassWithResilientFieldC5thirdSivpWvd", align 8 // CHECK-NEXT: [[FIELD_ADDR:%.*]] = getelementptr inbounds i8, ptr %0, i64 [[OFFSET]] -// CHECK-NEXT: [[FIELD_PTR:%.*]] = getelementptr inbounds %TSi, ptr [[FIELD_ADDR]], i32 0, i32 0 +// CHECK-NEXT: [[FIELD_PTR:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[FIELD_ADDR]], i32 0, i32 0 %1 = ref_element_addr %0 : $ClassWithResilientField, #ClassWithResilientField.third @@ -208,7 +208,7 @@ bb0(%0 : $ClassWithResilientField): // CHECK-NEXT: [[FIELDS:%.*]] = alloca [3 x ptr] // CHECK-NEXT: [[FIELDS_DEST:%.*]] = getelementptr inbounds [[INT]], ptr %0, [[INT]] {{10|13}} // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 {{12|24}}, ptr [[FIELDS]]) -// CHECK-NEXT: [[FIELDS_PTR:%.*]] = getelementptr inbounds [3 x ptr], ptr [[FIELDS]], i32 0, i32 0 +// CHECK-NEXT: [[FIELDS_PTR:%.*]] = getelementptr inbounds{{.*}} [3 x ptr], ptr [[FIELDS]], i32 0, i32 0 // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s16resilient_struct4SizeVMa"([[INT]] 319) // CHECK-NEXT: [[SIZE_METADATA:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 @@ -252,7 +252,7 @@ bb0(%0 : $ClassWithResilientField): // CHECK-NEXT: [[FIELDS:%.*]] = alloca [0 x ptr] // CHECK-NEXT: [[FIELDS_DEST:%.*]] = getelementptr inbounds [[INT]], ptr %0, [[INT]] {{11|14}} // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 0, ptr [[FIELDS]]) -// CHECK-NEXT: [[FIELDS_PTR:%.*]] = getelementptr inbounds [0 x ptr], ptr [[FIELDS]], i32 0, i32 0 +// CHECK-NEXT: [[FIELDS_PTR:%.*]] = getelementptr inbounds{{.*}} [0 x ptr], ptr [[FIELDS]], i32 0, i32 0 // -- ClassLayoutFlags = 0x100 (HasStaticVTable) // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @swift_updateClassMetadata2(ptr %0, [[INT]] 256, [[INT]] 0, ptr [[FIELDS_PTR]], ptr [[FIELDS_DEST]]) diff --git a/test/IRGen/class_update_callback_without_fixed_layout.sil b/test/IRGen/class_update_callback_without_fixed_layout.sil index f7327307649bb..69cae19e1309a 100644 --- a/test/IRGen/class_update_callback_without_fixed_layout.sil +++ b/test/IRGen/class_update_callback_without_fixed_layout.sil @@ -185,7 +185,7 @@ bb0(%0 : $ClassWithResilientField): // CHECK: [[OFFSET:%.*]] = load [[INT]], ptr @"$s42class_update_callback_without_fixed_layout23ClassWithResilientFieldC5thirdSivpWvd" // CHECK-NEXT: [[FIELD_ADDR:%.*]] = getelementptr inbounds i8, ptr %0, [[INT]] [[OFFSET]] -// CHECK-NEXT: [[FIELD_PTR:%.*]] = getelementptr inbounds %TSi, ptr [[FIELD_ADDR]], i32 0, i32 0 +// CHECK-NEXT: [[FIELD_PTR:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[FIELD_ADDR]], i32 0, i32 0 %1 = ref_element_addr %0 : $ClassWithResilientField, #ClassWithResilientField.third @@ -219,7 +219,7 @@ bb0(%0 : $ClassWithResilientField): // CHECK-64-NEXT: [[FIELDS_DEST:%.*]] = getelementptr inbounds [[INT]], ptr %0, [[INT]] 10 // CHECK-32-NEXT: call void @llvm.lifetime.start.p0(i64 12, ptr [[FIELDS]]) // CHECK-64-NEXT: call void @llvm.lifetime.start.p0(i64 24, ptr [[FIELDS]]) -// CHECK-NEXT: [[FIELDS_PTR:%.*]] = getelementptr inbounds [3 x ptr], ptr [[FIELDS]], i32 0, i32 0 +// CHECK-NEXT: [[FIELDS_PTR:%.*]] = getelementptr inbounds{{.*}} [3 x ptr], ptr [[FIELDS]], i32 0, i32 0 // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s16resilient_struct4SizeVMa"([[INT]] 319) // CHECK-NEXT: [[SIZE_METADATA:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 @@ -265,7 +265,7 @@ bb0(%0 : $ClassWithResilientField): // CHECK-32-NEXT: [[FIELDS_DEST:%.*]] = getelementptr inbounds [[INT]], ptr %0, [[INT]] 17 // CHECK-64-NEXT: [[FIELDS_DEST:%.*]] = getelementptr inbounds [[INT]], ptr %0, [[INT]] 14 // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 0, ptr [[FIELDS]]) -// CHECK-NEXT: [[FIELDS_PTR:%.*]] = getelementptr inbounds [0 x ptr], ptr [[FIELDS]], i32 0, i32 0 +// CHECK-NEXT: [[FIELDS_PTR:%.*]] = getelementptr inbounds{{.*}} [0 x ptr], ptr [[FIELDS]], i32 0, i32 0 // -- ClassLayoutFlags = 0x100 (HasStaticVTable) // CHECK-OLD: [[T0:%.*]] = call swiftcc %swift.metadata_response @swift_initClassMetadata2(ptr %0, [[INT]] 256, [[INT]] 0, ptr [[FIELDS_PTR]], ptr [[FIELDS_DEST]]) diff --git a/test/IRGen/closure.swift b/test/IRGen/closure.swift index 4e90114dfad26..d387eab8848af 100644 --- a/test/IRGen/closure.swift +++ b/test/IRGen/closure.swift @@ -36,7 +36,7 @@ func b(seq seq: T) -> (Int) -> Int { // -- partial_apply stub // CHECK: define internal swiftcc i64 @"$s7closure1b3seqS2icx_tAA9OrdinableRzlFS2icfU_TA"(i64 %0, ptr swiftself %1) {{.*}} { // CHECK: entry: -// CHECK: [[BINDINGSADDR:%.*]] = getelementptr inbounds <{ %swift.refcounted, [16 x i8] }>, ptr %1, i32 0, i32 1 +// CHECK: [[BINDINGSADDR:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [16 x i8] }>, ptr %1, i32 0, i32 1 // CHECK: [[TYPE:%.*]] = load ptr, ptr [[BINDINGSADDR]], align 8 // CHECK: [[WITNESSADDR:%.*]] = getelementptr inbounds ptr, ptr [[BINDINGSADDR]], i32 1 // CHECK: [[WITNESS:%.*]] = load ptr, ptr [[WITNESSADDR]], align 8 diff --git a/test/IRGen/coroutine_accessors.swift b/test/IRGen/coroutine_accessors.swift index 48152378da682..0b3f586f9f41c 100644 --- a/test/IRGen/coroutine_accessors.swift +++ b/test/IRGen/coroutine_accessors.swift @@ -143,7 +143,7 @@ public var irm: Int { // CHECK-SAME: token [[ID]], // CHECK-SAME: ptr null // CHECK-SAME: ) -// CHECK: [[S_FIELD__I:%[^,]+]] = getelementptr inbounds %T19coroutine_accessors1SV, +// CHECK: [[S_FIELD__I:%[^,]+]] = getelementptr inbounds{{.*}} %T19coroutine_accessors1SV, // CHECK-SAME: ptr [[SELF]], // CHECK-SAME: i32 0, // CHECK-SAME: i32 1 diff --git a/test/IRGen/enum.sil b/test/IRGen/enum.sil index 3eb1b681c5405..bea3454e41a98 100644 --- a/test/IRGen/enum.sil +++ b/test/IRGen/enum.sil @@ -276,9 +276,9 @@ entry(%0 : $Builtin.Int64, %1 : $Builtin.Int64): // 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: [[DATA_0_ADDR:%.*]] = getelementptr inbounds{{.*}} <{ i64, i64 }>, ptr %2, i32 0, i32 0 // CHECK: store i64 %0, ptr [[DATA_0_ADDR]] -// CHECK: [[DATA_1_ADDR:%.*]] = getelementptr inbounds <{ i64, i64 }>, ptr %2, i32 0, i32 1 +// CHECK: [[DATA_1_ADDR:%.*]] = getelementptr inbounds{{.*}} <{ i64, i64 }>, ptr %2, i32 0, i32 1 // CHECK: store i64 %1, ptr [[DATA_1_ADDR]] // CHECK: ret void // CHECK: } @@ -352,7 +352,7 @@ end: // 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 +// CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T4enum10NoPayloadsO, ptr %0, i32 0, i32 0 // CHECK: [[TAG:%.*]] = load i8, ptr [[TAG_ADDR]] // CHECK: switch i8 [[TAG]] switch_enum_addr %u : $*NoPayloads, case #NoPayloads.x!enumelt: x_dest, case #NoPayloads.y!enumelt: y_dest, case #NoPayloads.z!enumelt: z_dest @@ -400,7 +400,7 @@ entry: // 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: [[TAG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T4enum10NoPayloadsO, ptr %0, i32 0, i32 0 // CHECK: store i8 2, ptr [[TAG_ADDR]] // CHECK: ret void // CHECK: } @@ -632,7 +632,7 @@ entry(%0 : $Builtin.Word): // 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 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %T4enum18SinglePayloadNoXI2O, ptr %1, i32 0, i32 1 // CHECK: store i8 0, ptr [[T0]] // CHECK: ret void // CHECK: } @@ -658,7 +658,7 @@ entry: // 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 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %T4enum18SinglePayloadNoXI2O, ptr %0, i32 0, i32 1 // CHECK: store i8 1, ptr [[T0]] // CHECK: ret void // CHECK: } @@ -1444,7 +1444,7 @@ end: sil @multi_payload_no_spare_bits_switch_indirect : $(@inout MultiPayloadNoSpareBits) -> () { entry(%u : $*MultiPayloadNoSpareBits): // CHECK-64: [[PAYLOAD:%.*]] = load i64, ptr %0 -// CHECK-64: [[T0:%.*]] = getelementptr inbounds %T4enum23MultiPayloadNoSpareBitsO, ptr %0, i32 0, i32 1 +// CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T4enum23MultiPayloadNoSpareBitsO, ptr %0, i32 0, i32 1 // CHECK-64: [[TAG:%.*]] = load i8, ptr [[T0]] // CHECK-64: switch i8 [[TAG]] // CHECK-64: switch i64 [[PAYLOAD]] @@ -1497,7 +1497,7 @@ entry(%0 : $Builtin.Int64): // 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 +// CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T4enum23MultiPayloadNoSpareBitsO, ptr %1, i32 0, i32 1 // CHECK-64: store i8 0, ptr [[T0]] // CHECK-64: ret void // CHECK-64: } @@ -1550,7 +1550,7 @@ entry: // 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 +// CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T4enum23MultiPayloadNoSpareBitsO, ptr %0, i32 0, i32 1 // CHECK-64: store i8 3, ptr [[T0]] // CHECK-64: ret void // CHECK-64: } @@ -1678,7 +1678,7 @@ end: sil @multi_payload_one_spare_bit_switch_indirect : $(@inout MultiPayloadOneSpareBit) -> () { entry(%u : $*MultiPayloadOneSpareBit): // CHECK-64: [[PAYLOAD:%.*]] = load i64, ptr %0 -// CHECK-64: [[T0:%.*]] = getelementptr inbounds %T4enum23MultiPayloadOneSpareBitO, ptr %0, i32 0, i32 1 +// CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T4enum23MultiPayloadOneSpareBitO, ptr %0, i32 0, i32 1 // CHECK-64: [[TAG:%.*]] = load i8, ptr [[T0]] // CHECK-64: switch i8 {{%.*}} // CHECK-64: switch i64 [[PAYLOAD]] @@ -1745,7 +1745,7 @@ entry(%0 : $Builtin.Int62): // -- 0x7FFF_FFFF_FFFF_FFFF // CHECK-64: [[PAYLOAD_MASKED:%.*]] = and i64 [[PAYLOAD]], 9223372036854775807 // CHECK-64: store i64 [[PAYLOAD_MASKED]], ptr %1 -// CHECK-64: [[T0:%.*]] = getelementptr inbounds %T4enum23MultiPayloadOneSpareBitO, ptr %1, i32 0, i32 1 +// CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T4enum23MultiPayloadOneSpareBitO, ptr %1, i32 0, i32 1 // CHECK-64: store i8 0, ptr [[T0]] // CHECK-64: ret void // CHECK-64: } @@ -1785,7 +1785,7 @@ entry(%0 : $Builtin.Int63): // -- 0x8000_0000_0000_0000 // CHECK-64: [[PAYLOAD_TAGGED:%.*]] = or i64 [[PAYLOAD_MASKED]], -9223372036854775808 // CHECK-64: store i64 [[PAYLOAD_TAGGED]], ptr %1 -// CHECK-64: [[T0:%.*]] = getelementptr inbounds %T4enum23MultiPayloadOneSpareBitO, ptr %1, i32 0, i32 1 +// CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T4enum23MultiPayloadOneSpareBitO, ptr %1, i32 0, i32 1 // CHECK-64: store i8 0, ptr [[T0]] // CHECK-64: ret void // CHECK-64: } @@ -1828,7 +1828,7 @@ entry: // CHECK-64: entry: // -- 0x8000_0000_0000_0000 // CHECK-64: store i64 -9223372036854775808, ptr %0 -// CHECK-64: [[T0:%.*]] = getelementptr inbounds %T4enum23MultiPayloadOneSpareBitO, ptr %0, i32 0, i32 1 +// CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T4enum23MultiPayloadOneSpareBitO, ptr %0, i32 0, i32 1 // CHECK-64: store i8 1, ptr [[T0]] // CHECK-64: ret void // CHECK-64: } @@ -2612,11 +2612,11 @@ entry(%x : $*MyOptional): // CHECK: [[T_VWT:%.*]] = load ptr, ptr [[T_VWT_ADDR]] // CHECK: [[T_LAYOUT:%.*]] = getelementptr inbounds ptr, ptr [[T_VWT]], i32 8 // CHECK: call void @swift_initEnumMetadataSingleCase(ptr [[METADATA]], [[WORD]] 0, ptr [[T_LAYOUT]]) -// CHECK: [[PAYLOAD_EXTRAINHABITANTCNT:%.*]] = getelementptr inbounds %swift.type_layout, ptr [[T_LAYOUT]], i32 0, i32 3 +// CHECK: [[PAYLOAD_EXTRAINHABITANTCNT:%.*]] = getelementptr inbounds{{.*}} %swift.type_layout, ptr [[T_LAYOUT]], i32 0, i32 3 // CHECK: [[CNT:%.*]] = load i32, ptr [[PAYLOAD_EXTRAINHABITANTCNT]] // CHECK: [[VWT_ADDR:%.*]] = getelementptr inbounds ptr, ptr [[METADATA]], [[WORD]] -1 // CHECK: [[VWT:%.*]] = load ptr, ptr [[VWT_ADDR]] -// CHECK: [[XIC_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 11 +// CHECK: [[XIC_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 11 // CHECK: store i32 [[CNT]], ptr [[XIC_ADDR]] // CHECK: ret %swift.metadata_response diff --git a/test/IRGen/enum_copy_init_with_take_memcpy.swift b/test/IRGen/enum_copy_init_with_take_memcpy.swift index b0af515847db3..c551986294f3c 100644 --- a/test/IRGen/enum_copy_init_with_take_memcpy.swift +++ b/test/IRGen/enum_copy_init_with_take_memcpy.swift @@ -28,7 +28,7 @@ struct HasAnEnum { // CHECK: define {{.*}} swiftcc range(i64 -1, 5) i64 @"$s31enum_copy_init_with_take_memcpy9HasAnEnumV9readValueSiyF"(ptr {{.*}} %0) -// CHECK: [[T0:%.*]] = getelementptr inbounds i8, ptr %0, i64 160 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} i8, ptr %0, i64 160 // CHECK: [[T1:%.*]] = load i8, ptr [[T0]] // CHECK: [[T2:%.*]] = and i8 [[T1]], -3 // CHECK: [[T3:%.*]] = icmp eq i8 [[T2]], 0 diff --git a/test/IRGen/enum_future.sil b/test/IRGen/enum_future.sil index 6b27cf26c3ec3..f9b48420f53ce 100644 --- a/test/IRGen/enum_future.sil +++ b/test/IRGen/enum_future.sil @@ -280,9 +280,9 @@ entry(%0 : $Builtin.Int64, %1 : $Builtin.Int64): // 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: [[DATA_0_ADDR:%.*]] = getelementptr inbounds{{.*}} <{ i64, i64 }>, ptr %2, i32 0, i32 0 // CHECK: store i64 %0, ptr [[DATA_0_ADDR]] -// CHECK: [[DATA_1_ADDR:%.*]] = getelementptr inbounds <{ i64, i64 }>, ptr %2, i32 0, i32 1 +// CHECK: [[DATA_1_ADDR:%.*]] = getelementptr inbounds{{.*}} <{ i64, i64 }>, ptr %2, i32 0, i32 1 // CHECK: store i64 %1, ptr [[DATA_1_ADDR]] // CHECK: ret void // CHECK: } @@ -356,7 +356,7 @@ end: // 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 +// CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T11enum_future10NoPayloadsO, ptr %0, i32 0, i32 0 // CHECK: [[TAG:%.*]] = load i8, ptr [[TAG_ADDR]] // CHECK: switch i8 [[TAG]] switch_enum_addr %u : $*NoPayloads, case #NoPayloads.x!enumelt: x_dest, case #NoPayloads.y!enumelt: y_dest, case #NoPayloads.z!enumelt: z_dest @@ -404,7 +404,7 @@ entry: // 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: [[TAG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T11enum_future10NoPayloadsO, ptr %0, i32 0, i32 0 // CHECK: store i8 2, ptr [[TAG_ADDR]] // CHECK: ret void // CHECK: } @@ -636,7 +636,7 @@ entry(%0 : $Builtin.Word): // 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 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %T11enum_future18SinglePayloadNoXI2O, ptr %1, i32 0, i32 1 // CHECK: store i8 0, ptr [[T0]] // CHECK: ret void // CHECK: } @@ -662,7 +662,7 @@ entry: // 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 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %T11enum_future18SinglePayloadNoXI2O, ptr %0, i32 0, i32 1 // CHECK: store i8 1, ptr [[T0]] // CHECK: ret void // CHECK: } @@ -1448,7 +1448,7 @@ end: sil @multi_payload_no_spare_bits_switch_indirect : $(@inout MultiPayloadNoSpareBits) -> () { entry(%u : $*MultiPayloadNoSpareBits): // CHECK-64: [[PAYLOAD:%.*]] = load i64, ptr %0 -// CHECK-64: [[T0:%.*]] = getelementptr inbounds %T11enum_future23MultiPayloadNoSpareBitsO, ptr %0, i32 0, i32 1 +// CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T11enum_future23MultiPayloadNoSpareBitsO, ptr %0, i32 0, i32 1 // CHECK-64: [[TAG:%.*]] = load i8, ptr [[T0]] // CHECK-64: switch i8 [[TAG]] // CHECK-64: switch i64 [[PAYLOAD]] @@ -1501,7 +1501,7 @@ entry(%0 : $Builtin.Int64): // 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 +// CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T11enum_future23MultiPayloadNoSpareBitsO, ptr %1, i32 0, i32 1 // CHECK-64: store i8 0, ptr [[T0]] // CHECK-64: ret void // CHECK-64: } @@ -1554,7 +1554,7 @@ entry: // 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 +// CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T11enum_future23MultiPayloadNoSpareBitsO, ptr %0, i32 0, i32 1 // CHECK-64: store i8 3, ptr [[T0]] // CHECK-64: ret void // CHECK-64: } @@ -1682,7 +1682,7 @@ end: sil @multi_payload_one_spare_bit_switch_indirect : $(@inout MultiPayloadOneSpareBit) -> () { entry(%u : $*MultiPayloadOneSpareBit): // CHECK-64: [[PAYLOAD:%.*]] = load i64, ptr %0 -// CHECK-64: [[T0:%.*]] = getelementptr inbounds %T11enum_future23MultiPayloadOneSpareBitO, ptr %0, i32 0, i32 1 +// CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T11enum_future23MultiPayloadOneSpareBitO, ptr %0, i32 0, i32 1 // CHECK-64: [[TAG:%.*]] = load i8, ptr [[T0]] // CHECK-64: switch i8 {{%.*}} // CHECK-64: switch i64 [[PAYLOAD]] @@ -1749,7 +1749,7 @@ entry(%0 : $Builtin.Int62): // -- 0x7FFF_FFFF_FFFF_FFFF // CHECK-64: [[PAYLOAD_MASKED:%.*]] = and i64 [[PAYLOAD]], 9223372036854775807 // CHECK-64: store i64 [[PAYLOAD_MASKED]], ptr %1 -// CHECK-64: [[T0:%.*]] = getelementptr inbounds %T11enum_future23MultiPayloadOneSpareBitO, ptr %1, i32 0, i32 1 +// CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T11enum_future23MultiPayloadOneSpareBitO, ptr %1, i32 0, i32 1 // CHECK-64: store i8 0, ptr [[T0]] // CHECK-64: ret void // CHECK-64: } @@ -1789,7 +1789,7 @@ entry(%0 : $Builtin.Int63): // -- 0x8000_0000_0000_0000 // CHECK-64: [[PAYLOAD_TAGGED:%.*]] = or i64 [[PAYLOAD_MASKED]], -9223372036854775808 // CHECK-64: store i64 [[PAYLOAD_TAGGED]], ptr %1 -// CHECK-64: [[T0:%.*]] = getelementptr inbounds %T11enum_future23MultiPayloadOneSpareBitO, ptr %1, i32 0, i32 1 +// CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T11enum_future23MultiPayloadOneSpareBitO, ptr %1, i32 0, i32 1 // CHECK-64: store i8 0, ptr [[T0]] // CHECK-64: ret void // CHECK-64: } @@ -1832,7 +1832,7 @@ entry: // CHECK-64: entry: // -- 0x8000_0000_0000_0000 // CHECK-64: store i64 -9223372036854775808, ptr %0 -// CHECK-64: [[T0:%.*]] = getelementptr inbounds %T11enum_future23MultiPayloadOneSpareBitO, ptr %0, i32 0, i32 1 +// CHECK-64: [[T0:%.*]] = getelementptr inbounds{{.*}} %T11enum_future23MultiPayloadOneSpareBitO, ptr %0, i32 0, i32 1 // CHECK-64: store i8 1, ptr [[T0]] // CHECK-64: ret void // CHECK-64: } @@ -2616,11 +2616,11 @@ entry(%x : $*MyOptional): // CHECK: [[T_VWT:%.*]] = load ptr, ptr [[T_VWT_ADDR]] // CHECK: [[T_LAYOUT:%.*]] = getelementptr inbounds ptr, ptr [[T_VWT]], i32 8 // CHECK: call void @swift_initEnumMetadataSingleCase(ptr [[METADATA]], [[WORD]] 0, ptr [[T_LAYOUT]]) -// CHECK: [[PAYLOAD_EXTRAINHABITANTCNT:%.*]] = getelementptr inbounds %swift.type_layout, ptr [[T_LAYOUT]], i32 0, i32 3 +// CHECK: [[PAYLOAD_EXTRAINHABITANTCNT:%.*]] = getelementptr inbounds{{.*}} %swift.type_layout, ptr [[T_LAYOUT]], i32 0, i32 3 // CHECK: [[CNT:%.*]] = load i32, ptr [[PAYLOAD_EXTRAINHABITANTCNT]] // CHECK: [[VWT_ADDR:%.*]] = getelementptr inbounds ptr, ptr [[METADATA]], [[WORD]] -1 // CHECK: [[VWT:%.*]] = load ptr, ptr [[VWT_ADDR]] -// CHECK: [[XIC_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 11 +// CHECK: [[XIC_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 11 // CHECK: store i32 [[CNT]], ptr [[XIC_ADDR]] // CHECK: ret %swift.metadata_response diff --git a/test/IRGen/enum_resilience.swift b/test/IRGen/enum_resilience.swift index 3220e4a0c1ef9..3b73cb7ac1a3f 100644 --- a/test/IRGen/enum_resilience.swift +++ b/test/IRGen/enum_resilience.swift @@ -184,7 +184,7 @@ public func constructResilientEnumPayload(_ s: Size) -> Medium { // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[VWT:%.*]] = inttoptr i64 {{%.*}} to ptr -// CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 8 +// CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 8 // CHECK: [[WITNESS_FOR_SIZE:%size]] = load [[INT]], ptr [[WITNESS_ADDR]] // CHECK: [[ALLOCA:%.*]] = alloca i8, {{.*}} [[WITNESS_FOR_SIZE]], align 16 // CHECK: [[ALLOCA:%.*]] = alloca i8, {{.*}} [[WITNESS_FOR_SIZE]], align 16 diff --git a/test/IRGen/enum_value_semantics.sil b/test/IRGen/enum_value_semantics.sil index 48a4f14849c56..a5a973ab7916f 100644 --- a/test/IRGen/enum_value_semantics.sil +++ b/test/IRGen/enum_value_semantics.sil @@ -195,7 +195,7 @@ bb0(%0 : $SinglePayloadNontrivial): // -- NoPayload getEnumTag // CHECK-LABEL: define internal i32 @"$s20enum_value_semantics9NoPayloadOwug" -// CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds %T20enum_value_semantics9NoPayloadO, ptr %value, i32 0, i32 0 +// CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T20enum_value_semantics9NoPayloadO, ptr %value, i32 0, i32 0 // CHECK-NEXT: [[TAG:%.*]] = load i8, ptr [[TAG_ADDR]], align 1 // CHECK-NEXT: [[RESULT:%.*]] = zext i8 [[TAG]] to i32 // CHECK-NEXT: ret i32 [[RESULT]] @@ -209,7 +209,7 @@ bb0(%0 : $SinglePayloadNontrivial): // -- NoPayload destructiveInjectEnumTag // CHECK-LABEL: define internal void @"$s20enum_value_semantics9NoPayloadOwui" // CHECK: [[TAG:%.*]] = trunc i32 %tag to i8 -// CHECK-NEXT: [[TAG_ADDR:%.*]] = getelementptr inbounds %T20enum_value_semantics9NoPayloadO, ptr %value, i32 0, i32 0 +// CHECK-NEXT: [[TAG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T20enum_value_semantics9NoPayloadO, ptr %value, i32 0, i32 0 // CHECK-NEXT: store i8 [[TAG]], ptr [[TAG_ADDR]], align 1 // CHECK-NEXT: ret void @@ -295,7 +295,7 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK: [[NO_PAYLOAD_TAG_TMP:%.*]] = load i64, ptr %value, align 8 // -- Load the high bits of the tag from the extra tag area -// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds %T20enum_value_semantics19MultiPayloadTrivialO, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds{{.*}} %T20enum_value_semantics19MultiPayloadTrivialO, ptr %value, i32 0, i32 1 // CHECK-NEXT: [[EXTRA_TAG_TMP:%.*]] = load i8, ptr [[EXTRA_TAG_ADDR_TMP]], align 8 // CHECK-NEXT: [[EXTRA_TAG:%.*]] = zext i8 [[EXTRA_TAG_TMP]] to i32 @@ -329,7 +329,7 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK-NEXT: store i64 [[NO_PAYLOAD_TAG2]], ptr %value, align 8 // -- Store the high bits of the tag in the extra tag area -// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds %T20enum_value_semantics19MultiPayloadTrivialO, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds{{.*}} %T20enum_value_semantics19MultiPayloadTrivialO, ptr %value, i32 0, i32 1 // CHECK-NEXT: store i8 2, ptr [[EXTRA_TAG_ADDR_TMP]], align 8 // CHECK-NEXT: br label %[[DONE:.*]] @@ -337,7 +337,7 @@ bb0(%0 : $SinglePayloadNontrivial): // -- Store the tag in the extra tag area // CHECK-NEXT: [[TAG:%.*]] = trunc i32 %tag to i8 -// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds %T20enum_value_semantics19MultiPayloadTrivialO, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds{{.*}} %T20enum_value_semantics19MultiPayloadTrivialO, ptr %value, i32 0, i32 1 // CHECK-NEXT: store i8 [[TAG]], ptr [[EXTRA_TAG_ADDR_TMP]], align 8 // CHECK-NEXT: br label %[[DONE]] @@ -356,7 +356,7 @@ bb0(%0 : $SinglePayloadNontrivial): // -- The payload has no spare bits and there are no empty cases, so the tag // is entirely contained in the extra tag area -// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds %T20enum_value_semantics24MultiPayloadNoEmptyCasesO, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds{{.*}} %T20enum_value_semantics24MultiPayloadNoEmptyCasesO, ptr %value, i32 0, i32 1 // CHECK-NEXT: [[EXTRA_TAG_TMP:%.*]] = load i8, ptr [[EXTRA_TAG_ADDR_TMP]], align 8 // CHECK-NEXT: [[EXTRA_TAG:%.*]] = zext i8 [[EXTRA_TAG_TMP]] to i32 // CHECK-NEXT: ret i32 [[EXTRA_TAG]] @@ -371,7 +371,7 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK: [[TAG:%.*]] = trunc i32 %tag to i8 // -- Store the tag in the extra tag area -// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds %T20enum_value_semantics24MultiPayloadNoEmptyCasesO, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds{{.*}} %T20enum_value_semantics24MultiPayloadNoEmptyCasesO, ptr %value, i32 0, i32 1 // CHECK-NEXT: store i8 [[TAG]], ptr [[EXTRA_TAG_ADDR_TMP]], align 8 // CHECK-NEXT: ret void @@ -385,7 +385,7 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK-LABEL: define internal i32 @"$s20enum_value_semantics017MultiPayloadEmptyE0Owug" // -- Load the tag from the extra tag area -// CHECK: [[EXTRA_TAG_ADDR:%.*]] = getelementptr inbounds %T20enum_value_semantics017MultiPayloadEmptyE0O, ptr %value, i32 0, i32 0 +// CHECK: [[EXTRA_TAG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T20enum_value_semantics017MultiPayloadEmptyE0O, ptr %value, i32 0, i32 0 // CHECK-NEXT: [[EXTRA_TAG_TMP:%.*]] = load i8, ptr [[EXTRA_TAG_ADDR]], align 1 // CHECK-NEXT: [[EXTRA_TAG:%.*]] = zext i8 [[EXTRA_TAG_TMP]] to i32 // CHECK-NEXT: ret i32 [[EXTRA_TAG]] @@ -401,7 +401,7 @@ bb0(%0 : $SinglePayloadNontrivial): // -- Store the tag in the extra tag area // CHECK: [[TAG:%.*]] = trunc i32 %tag to i8 -// CHECK-NEXT: [[EXTRA_TAG_ADDR:%.*]] = getelementptr inbounds %T20enum_value_semantics017MultiPayloadEmptyE0O, ptr %value, i32 0, i32 0 +// CHECK-NEXT: [[EXTRA_TAG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T20enum_value_semantics017MultiPayloadEmptyE0O, ptr %value, i32 0, i32 0 // CHECK-NEXT: store i8 [[TAG]], ptr [[EXTRA_TAG_ADDR]], align 1 // CHECK-NEXT: ret void @@ -417,7 +417,7 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK-NEXT: [[PAYLOAD_0:%.*]] = load i64, ptr [[PAYLOAD_0_ADDR]], align 8 // CHECK-NEXT: [[PAYLOAD_1_ADDR:%.*]] = getelementptr // CHECK-NEXT: [[PAYLOAD_1:%.*]] = load i64, ptr [[PAYLOAD_1_ADDR]], align 8 -// CHECK: [[T0:%.*]] = getelementptr inbounds %T20enum_value_semantics22MultiPayloadNontrivialO, ptr [[OBJ]], i32 0, i32 1 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %T20enum_value_semantics22MultiPayloadNontrivialO, ptr [[OBJ]], i32 0, i32 1 // CHECK-NEXT: [[TAG:%.*]] = load i8, ptr [[T0]], align 8 // CHECK-NEXT: @"$s20enum_value_semantics22MultiPayloadNontrivialOWOe" // CHECK-NEXT: ret void @@ -461,9 +461,9 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK-LABEL: define internal i32 @"$s20enum_value_semantics31MultiPayloadNontrivialSpareBitsOwug" // -- Load the payload -// CHECK: [[FIRST_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 0 +// CHECK: [[FIRST_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 0 // CHECK-NEXT: [[FIRST:%.*]] = load i64, ptr [[FIRST_ADDR]], align 8 -// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 1 // CHECK-NEXT: [[SECOND:%.*]] = load i64, ptr [[SECOND_ADDR]], align 8 // -- Get the high bits of the tag from the spare bits @@ -486,18 +486,18 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK-LABEL: define internal void @"$s20enum_value_semantics31MultiPayloadNontrivialSpareBitsOwup" // -- Load the payload -// CHECK: [[FIRST_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 0 +// CHECK: [[FIRST_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 0 // CHECK-NEXT: [[FIRST:%.*]] = load i64, ptr [[FIRST_ADDR]], align 8 -// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 1 // CHECK-NEXT: [[SECOND:%.*]] = load i64, ptr [[SECOND_ADDR]], align 8 // -- Strip off spare bits // CHECK-NEXT: [[SECOND_PROJ:%.*]] = and i64 [[SECOND]], 4611686018427387903 // -- Store the payload -// CHECK-NEXT: [[FIRST_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 0 +// CHECK-NEXT: [[FIRST_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 0 // CHECK-NEXT: store i64 [[FIRST]], ptr [[FIRST_ADDR]], align 8 -// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 1 // CHECK-NEXT: store i64 [[SECOND_PROJ]], ptr [[SECOND_ADDR]], align 8 // CHECK-NEXT: ret void @@ -513,11 +513,11 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK-NEXT: [[NO_PAYLOAD_TAG2:%.*]] = zext i32 [[NO_PAYLOAD_TAG]] to i64 // -- Store the low bits of the tag into the payload -// CHECK-NEXT: [[FIRST_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 0 +// CHECK-NEXT: [[FIRST_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 0 // CHECK-NEXT: store i64 [[NO_PAYLOAD_TAG2]], ptr [[FIRST_ADDR]], align 8 // -- Store the high bits of the tag into the spare bits -// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 1 // -- 0xc000000000000000 // CHECK-NEXT: store i64 -4611686018427387904, ptr [[SECOND_ADDR]], align 8 // CHECK-NEXT: br label %[[END:.*]] @@ -528,9 +528,9 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK-NEXT: [[TAG_TMP:%.*]] = and i32 %tag, 3 // -- Load the payload -// CHECK-NEXT: [[FIRST_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 0 +// CHECK-NEXT: [[FIRST_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 0 // CHECK-NEXT: [[FIRST:%.*]] = load i64, ptr [[FIRST_ADDR]], align 8 -// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 1 // CHECK-NEXT: [[SECOND:%.*]] = load i64, ptr [[SECOND_ADDR]], align 8 // -- Mask off spare bits in the payload -- 0x00fffffffffffff8 @@ -547,9 +547,9 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK-NEXT: [[SECOND_NEW:%.*]] = or i64 [[SPARE_TAG_TMP]], [[SECOND_PROJ]] // -- Store the payload back -// CHECK-NEXT: [[FIRST_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 0 +// CHECK-NEXT: [[FIRST_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 0 // CHECK-NEXT: store i64 [[FIRST]], ptr [[FIRST_ADDR]], align 8 -// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 1 // CHECK-NEXT: store i64 [[SECOND_NEW]], ptr [[SECOND_ADDR]], align 8 // CHECK-NEXT: br label %[[END]] @@ -563,7 +563,7 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK: [[PAYLOAD:%.*]] = load i64, ptr %value, align 8 // -- Load the load bits of the tag from the extra tag area -// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds %T20enum_value_semantics029MultiPayloadSpareBitsAndExtraG0O, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds{{.*}} %T20enum_value_semantics029MultiPayloadSpareBitsAndExtraG0O, ptr %value, i32 0, i32 1 // CHECK-NEXT: [[EXTRA_TAG:%.*]] = load i8, ptr [[EXTRA_TAG_ADDR_TMP]], align 8 // -- Load the high bits of the tag from the spare bits area @@ -609,6 +609,6 @@ bb0(%0 : $SinglePayloadNontrivial): // -- Store high bits of tag in extra tag area // CHECK-NEXT: [[EXTRA_TAG_TMP:%.*]] = lshr i32 %tag, 1 // CHECK-NEXT: [[EXTRA_TAG:%.*]] = trunc i32 [[EXTRA_TAG_TMP]] to i8 -// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds %T20enum_value_semantics029MultiPayloadSpareBitsAndExtraG0O, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds{{.*}} %T20enum_value_semantics029MultiPayloadSpareBitsAndExtraG0O, ptr %value, i32 0, i32 1 // CHECK-NEXT: store i8 [[EXTRA_TAG]], ptr [[EXTRA_TAG_ADDR_TMP]], align 8 // CHECK-NEXT: ret void diff --git a/test/IRGen/enum_value_semantics_future.sil b/test/IRGen/enum_value_semantics_future.sil index 75393a5e81c0c..f9dd4c6c6d4a8 100644 --- a/test/IRGen/enum_value_semantics_future.sil +++ b/test/IRGen/enum_value_semantics_future.sil @@ -204,7 +204,7 @@ bb0(%0 : $SinglePayloadNontrivial): // -- NoPayload getEnumTag // CHECK-LABEL: define internal i32 @"$s27enum_value_semantics_future9NoPayloadOwug" -// CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds %T27enum_value_semantics_future9NoPayloadO, ptr %value, i32 0, i32 0 +// CHECK: [[TAG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T27enum_value_semantics_future9NoPayloadO, ptr %value, i32 0, i32 0 // CHECK-NEXT: [[TAG:%.*]] = load i8, ptr [[TAG_ADDR]], align 1 // CHECK-NEXT: [[RESULT:%.*]] = zext i8 {{.*}} to i32 // CHECK-NEXT: ret i32 [[RESULT]] @@ -218,7 +218,7 @@ bb0(%0 : $SinglePayloadNontrivial): // -- NoPayload destructiveInjectEnumTag // CHECK-LABEL: define internal void @"$s27enum_value_semantics_future9NoPayloadOwui" // CHECK: [[TAG:%.*]] = trunc i32 %tag to i8 -// CHECK-NEXT: [[TAG_ADDR:%.*]] = getelementptr inbounds %T27enum_value_semantics_future9NoPayloadO, ptr %value, i32 0, i32 0 +// CHECK-NEXT: [[TAG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T27enum_value_semantics_future9NoPayloadO, ptr %value, i32 0, i32 0 // CHECK-NEXT: store i8 [[TAG]], ptr [[TAG_ADDR]], align 1 // CHECK-NEXT: ret void @@ -300,7 +300,7 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK: [[NO_PAYLOAD_TAG_TMP:%.*]] = load i64, ptr %value, align 8 // -- Load the high bits of the tag from the extra tag area -// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds %T27enum_value_semantics_future19MultiPayloadTrivialO, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds{{.*}} %T27enum_value_semantics_future19MultiPayloadTrivialO, ptr %value, i32 0, i32 1 // CHECK-NEXT: [[EXTRA_TAG_TMP:%.*]] = load i8, ptr [[EXTRA_TAG_ADDR_TMP]], align 8 // CHECK-NEXT: [[EXTRA_TAG:%.*]] = zext i8 [[EXTRA_TAG_TMP]] to i32 @@ -334,7 +334,7 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK-NEXT: store i64 [[NO_PAYLOAD_TAG2]], ptr %value, align 8 // -- Store the high bits of the tag in the extra tag area -// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds %T27enum_value_semantics_future19MultiPayloadTrivialO, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds{{.*}} %T27enum_value_semantics_future19MultiPayloadTrivialO, ptr %value, i32 0, i32 1 // CHECK-NEXT: store i8 2, ptr [[EXTRA_TAG_ADDR_TMP]], align 8 // CHECK-NEXT: br label %[[DONE:.*]] @@ -342,7 +342,7 @@ bb0(%0 : $SinglePayloadNontrivial): // -- Store the tag in the extra tag area // CHECK-NEXT: [[TAG:%.*]] = trunc i32 %tag to i8 -// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds %T27enum_value_semantics_future19MultiPayloadTrivialO, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds{{.*}} %T27enum_value_semantics_future19MultiPayloadTrivialO, ptr %value, i32 0, i32 1 // CHECK-NEXT: store i8 [[TAG]], ptr [[EXTRA_TAG_ADDR_TMP]], align 8 // CHECK-NEXT: br label %[[DONE]] @@ -361,7 +361,7 @@ bb0(%0 : $SinglePayloadNontrivial): // -- The payload has no spare bits and there are no empty cases, so the tag // is entirely contained in the extra tag area -// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds %T27enum_value_semantics_future24MultiPayloadNoEmptyCasesO, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds{{.*}} %T27enum_value_semantics_future24MultiPayloadNoEmptyCasesO, ptr %value, i32 0, i32 1 // CHECK-NEXT: [[EXTRA_TAG_TMP:%.*]] = load i8, ptr [[EXTRA_TAG_ADDR_TMP]], align 8 // CHECK-NEXT: [[EXTRA_TAG:%.*]] = zext i8 [[EXTRA_TAG_TMP]] to i32 // CHECK-NEXT: ret i32 [[EXTRA_TAG]] @@ -376,7 +376,7 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK: [[TAG:%.*]] = trunc i32 %tag to i8 // -- Store the tag in the extra tag area -// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds %T27enum_value_semantics_future24MultiPayloadNoEmptyCasesO, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds{{.*}} %T27enum_value_semantics_future24MultiPayloadNoEmptyCasesO, ptr %value, i32 0, i32 1 // CHECK-NEXT: store i8 [[TAG]], ptr [[EXTRA_TAG_ADDR_TMP]], align 8 // CHECK-NEXT: ret void @@ -390,7 +390,7 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK-LABEL: define internal i32 @"$s27enum_value_semantics_future017MultiPayloadEmptyF0Owug" // -- Load the tag from the extra tag area -// CHECK: [[EXTRA_TAG_ADDR:%.*]] = getelementptr inbounds %T27enum_value_semantics_future017MultiPayloadEmptyF0O, ptr %value, i32 0, i32 0 +// CHECK: [[EXTRA_TAG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T27enum_value_semantics_future017MultiPayloadEmptyF0O, ptr %value, i32 0, i32 0 // CHECK-NEXT: [[EXTRA_TAG_TMP:%.*]] = load i8, ptr [[EXTRA_TAG_ADDR]], align 1 // CHECK-NEXT: [[EXTRA_TAG:%.*]] = zext i8 [[EXTRA_TAG_TMP]] to i32 // CHECK-NEXT: ret i32 [[EXTRA_TAG]] @@ -406,7 +406,7 @@ bb0(%0 : $SinglePayloadNontrivial): // -- Store the tag in the extra tag area // CHECK: [[TAG:%.*]] = trunc i32 %tag to i8 -// CHECK-NEXT: [[EXTRA_TAG_ADDR:%.*]] = getelementptr inbounds %T27enum_value_semantics_future017MultiPayloadEmptyF0O, ptr %value, i32 0, i32 0 +// CHECK-NEXT: [[EXTRA_TAG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T27enum_value_semantics_future017MultiPayloadEmptyF0O, ptr %value, i32 0, i32 0 // CHECK-NEXT: store i8 [[TAG]], ptr [[EXTRA_TAG_ADDR]], align 1 // CHECK-NEXT: ret void @@ -422,7 +422,7 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK-NEXT: [[PAYLOAD_0:%.*]] = load i64, ptr [[PAYLOAD_0_ADDR]], align 8 // CHECK-NEXT: [[PAYLOAD_1_ADDR:%.*]] = getelementptr // CHECK-NEXT: [[PAYLOAD_1:%.*]] = load i64, ptr [[PAYLOAD_1_ADDR]], align 8 -// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds %T27enum_value_semantics_future22MultiPayloadNontrivialO, ptr {{.*}}, i32 0, i32 1 +// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} %T27enum_value_semantics_future22MultiPayloadNontrivialO, ptr {{.*}}, i32 0, i32 1 // CHECK-NEXT: [[TAG:%.*]] = load i8, ptr [[T0]], align 8 // CHECK-NEXT: @"$s27enum_value_semantics_future22MultiPayloadNontrivialOWOe" // CHECK-NEXT: ret void @@ -466,9 +466,9 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK-LABEL: define internal i32 @"$s27enum_value_semantics_future31MultiPayloadNontrivialSpareBitsOwug" // -- Load the payload -// CHECK: [[FIRST_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 0 +// CHECK: [[FIRST_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 0 // CHECK-NEXT: [[FIRST:%.*]] = load i64, ptr [[FIRST_ADDR]], align 8 -// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 1 // CHECK-NEXT: [[SECOND:%.*]] = load i64, ptr [[SECOND_ADDR]], align 8 // -- Get the high bits of the tag from the spare bits @@ -491,18 +491,18 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK-LABEL: define internal void @"$s27enum_value_semantics_future31MultiPayloadNontrivialSpareBitsOwup" // -- Load the payload -// CHECK: [[FIRST_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 0 +// CHECK: [[FIRST_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 0 // CHECK-NEXT: [[FIRST:%.*]] = load i64, ptr [[FIRST_ADDR]], align 8 -// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 1 // CHECK-NEXT: [[SECOND:%.*]] = load i64, ptr [[SECOND_ADDR]], align 8 // -- Strip off spare bits // CHECK-NEXT: [[SECOND_PROJ:%.*]] = and i64 [[SECOND]], 4611686018427387903 // -- Store the payload -// CHECK-NEXT: [[FIRST_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 0 +// CHECK-NEXT: [[FIRST_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 0 // CHECK-NEXT: store i64 [[FIRST]], ptr [[FIRST_ADDR]], align 8 -// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 1 // CHECK-NEXT: store i64 [[SECOND_PROJ]], ptr [[SECOND_ADDR]], align 8 // CHECK-NEXT: ret void @@ -518,11 +518,11 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK-NEXT: [[NO_PAYLOAD_TAG2:%.*]] = zext i32 [[NO_PAYLOAD_TAG]] to i64 // -- Store the low bits of the tag into the payload -// CHECK-NEXT: [[FIRST_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 0 +// CHECK-NEXT: [[FIRST_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 0 // CHECK-NEXT: store i64 [[NO_PAYLOAD_TAG2]], ptr [[FIRST_ADDR]], align 8 // -- Store the high bits of the tag into the spare bits -// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 1 // -- 0xc000000000000000 // CHECK-NEXT: store i64 -4611686018427387904, ptr [[SECOND_ADDR]], align 8 // CHECK-NEXT: br label %[[END:.*]] @@ -533,9 +533,9 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK-NEXT: [[TAG_TMP:%.*]] = and i32 %tag, 3 // -- Load the payload -// CHECK-NEXT: [[FIRST_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 0 +// CHECK-NEXT: [[FIRST_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 0 // CHECK-NEXT: [[FIRST:%.*]] = load i64, ptr [[FIRST_ADDR]], align 8 -// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 1 // CHECK-NEXT: [[SECOND:%.*]] = load i64, ptr [[SECOND_ADDR]], align 8 // -- Mask off spare bits in the payload -- 0x00fffffffffffff8 @@ -552,9 +552,9 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK-NEXT: [[SECOND_NEW:%.*]] = or i64 [[SPARE_TAG_TMP]], [[SECOND_PROJ]] // -- Store the payload back -// CHECK-NEXT: [[FIRST_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 0 +// CHECK-NEXT: [[FIRST_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 0 // CHECK-NEXT: store i64 [[FIRST]], ptr [[FIRST_ADDR]], align 8 -// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds { i64, i64 }, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[SECOND_ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64 }, ptr %value, i32 0, i32 1 // CHECK-NEXT: store i64 [[SECOND_NEW]], ptr [[SECOND_ADDR]], align 8 // CHECK-NEXT: br label %[[END]] @@ -568,7 +568,7 @@ bb0(%0 : $SinglePayloadNontrivial): // CHECK: [[PAYLOAD:%.*]] = load i64, ptr %value, align 8 // -- Load the load bits of the tag from the extra tag area -// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds %T27enum_value_semantics_future029MultiPayloadSpareBitsAndExtraH0O, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds{{.*}} %T27enum_value_semantics_future029MultiPayloadSpareBitsAndExtraH0O, ptr %value, i32 0, i32 1 // CHECK-NEXT: [[EXTRA_TAG:%.*]] = load i8, ptr [[EXTRA_TAG_ADDR_TMP]], align 8 // -- Load the high bits of the tag from the spare bits area @@ -614,6 +614,6 @@ bb0(%0 : $SinglePayloadNontrivial): // -- Store high bits of tag in extra tag area // CHECK-NEXT: [[EXTRA_TAG_TMP:%.*]] = lshr i32 %tag, 1 // CHECK-NEXT: [[EXTRA_TAG:%.*]] = trunc i32 [[EXTRA_TAG_TMP]] to i8 -// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds %T27enum_value_semantics_future029MultiPayloadSpareBitsAndExtraH0O, ptr %value, i32 0, i32 1 +// CHECK-NEXT: [[EXTRA_TAG_ADDR_TMP:%.*]] = getelementptr inbounds{{.*}} %T27enum_value_semantics_future029MultiPayloadSpareBitsAndExtraH0O, ptr %value, i32 0, i32 1 // CHECK-NEXT: store i8 [[EXTRA_TAG]], ptr [[EXTRA_TAG_ADDR_TMP]], align 8 // CHECK-NEXT: ret void diff --git a/test/IRGen/exclusivity.sil b/test/IRGen/exclusivity.sil index fd3ccf3c08962..656173cf0397f 100644 --- a/test/IRGen/exclusivity.sil +++ b/test/IRGen/exclusivity.sil @@ -18,14 +18,14 @@ bb0(%0 : $A): // CHECK: [[SCRATCH0:%.*]] = alloca [[BUFFER_T:\[.* x i8\]]], // CHECK: [[SCRATCH1:%.*]] = alloca [[BUFFER_T:\[.* x i8\]]], - // CHECK: [[PROP:%.*]] = getelementptr inbounds [[C:%T11exclusivity1AC]], ptr %0, i32 0, i32 1 + // CHECK: [[PROP:%.*]] = getelementptr inbounds{{.*}} [[C:%T11exclusivity1AC]], ptr %0, i32 0, i32 1 %3 = ref_element_addr %0 : $A, #A.x // CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr [[SCRATCH0]]) // CHECK: call void @swift_beginAccess(ptr [[PROP]], ptr [[SCRATCH0]], [[SIZE_T:i32|i64]] 32, ptr null) %4 = begin_access [read] [dynamic] %3 : $*Int - // CHECK: [[T0:%.*]] = getelementptr inbounds [[INT:%TSi]], ptr %1, i32 0, i32 0 + // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} [[INT:%TSi]], ptr %1, i32 0, i32 0 // CHECK: load {{(i64|i32)}}, ptr [[T0]] %5 = load %4 : $*Int @@ -35,7 +35,7 @@ bb0(%0 : $A): %9 = function_ref @changeInt : $@convention(thin) (@inout Int) -> () - // CHECK: [[PROP:%.*]] = getelementptr inbounds [[C:%T11exclusivity1AC]], ptr %0, i32 0, i32 1 + // CHECK: [[PROP:%.*]] = getelementptr inbounds{{.*}} [[C:%T11exclusivity1AC]], ptr %0, i32 0, i32 1 %11 = ref_element_addr %0 : $A, #A.x // CHECK: call void @llvm.lifetime.start.p0(i64 -1, ptr [[SCRATCH1]]) diff --git a/test/IRGen/existential_metatypes.sil b/test/IRGen/existential_metatypes.sil index fc216e378e8d0..b2ba3ddb56cb2 100644 --- a/test/IRGen/existential_metatypes.sil +++ b/test/IRGen/existential_metatypes.sil @@ -58,17 +58,17 @@ bb0: // CHECK: [[V:%.*]] = alloca { ptr, ptr }, align 8 // CHECK-NEXT: llvm.lifetime.start %0 = alloc_stack $@thick Kindable.Type, var, name "v" - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds { ptr, ptr }, ptr [[V]], i32 0, i32 0 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} { ptr, ptr }, ptr [[V]], i32 0, i32 0 // CHECK-NEXT: store ptr @"$sSiN", ptr [[T0]], align 8 - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds { ptr, ptr }, ptr [[V]], i32 0, i32 1 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} { ptr, ptr }, ptr [[V]], i32 0, i32 1 %1 = metatype $@thin Int.Type %2 = metatype $@thick Int.Type %3 = init_existential_metatype %2 : $@thick Int.Type, $@thick Kindable.Type // CHECK-NEXT: store ptr @"$sSi21existential_metatypes8KindableAAWP", ptr [[T0]], align 8 store %3 to %0 : $*@thick Kindable.Type - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds { ptr, ptr }, ptr [[V]], i32 0, i32 0 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} { ptr, ptr }, ptr [[V]], i32 0, i32 0 // CHECK-NEXT: store ptr @"$sSfN", ptr [[T0]], align 8 - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds { ptr, ptr }, ptr [[V]], i32 0, i32 1 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} { ptr, ptr }, ptr [[V]], i32 0, i32 1 %5 = metatype $@thin Float.Type %6 = metatype $@thick Float.Type %7 = init_existential_metatype %6 : $@thick Float.Type, $@thick Kindable.Type diff --git a/test/IRGen/existential_shape_metadata.swift b/test/IRGen/existential_shape_metadata.swift index b065f4582c781..4a4ef092da7de 100644 --- a/test/IRGen/existential_shape_metadata.swift +++ b/test/IRGen/existential_shape_metadata.swift @@ -46,7 +46,7 @@ public func testConcrete() -> Any.Type { // CHECK-LABEL: define{{.*}} @"$s26existential_shape_metadata13testDependent public func testDependent(t: T.Type) -> Any.Type { // CHECK: [[ARGS:%.*]] = alloca [1 x ptr], align - // CHECK: [[T0:%.*]] = getelementptr inbounds [1 x ptr], ptr [[ARGS]], i32 0, i32 0 + // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr [[ARGS]], i32 0, i32 0 // CHECK: store ptr %T, ptr [[T0]], align // CHECK: [[METADATA:%.*]] = call ptr @swift_getExtendedExistentialTypeMetadata(ptr @"$sl26existential_shape_metadata2Q0_px1TRts_XPXGMq{{(\.ptrauth)?}}", ptr [[ARGS]]) // CHECK: ret ptr [[METADATA]] @@ -59,7 +59,7 @@ public func testComplexApplication(t: T.Type) -> Any.Type { // CHECK: [[ARGS:%.*]] = alloca [1 x ptr], align // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s26existential_shape_metadata1BVMa"([[INT]] 255, ptr %T) // CHECK: [[B_T:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 - // CHECK: [[T0:%.*]] = getelementptr inbounds [1 x ptr], ptr [[ARGS]], i32 0, i32 0 + // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr [[ARGS]], i32 0, i32 0 // CHECK: store ptr [[B_T]], ptr [[T0]], align // CHECK: [[METADATA:%.*]] = call ptr @swift_getExtendedExistentialTypeMetadata(ptr @"$sl26existential_shape_metadata2Q0_px1TRts_XPXGMq{{(\.ptrauth)?}}", ptr [[ARGS]]) // CHECK: ret ptr [[METADATA]] @@ -70,7 +70,7 @@ public func testComplexApplication(t: T.Type) -> Any.Type { // CHECK-LABEL: define{{.*}} @"$s26existential_shape_metadata12test_private public func test_private(t: T.Type) -> Any.Type { // CHECK: [[ARGS:%.*]] = alloca [1 x ptr], align - // CHECK: [[T0:%.*]] = getelementptr inbounds [1 x ptr], ptr [[ARGS]], i32 0, i32 0 + // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr [[ARGS]], i32 0, i32 0 // CHECK: store ptr %T, ptr [[T0]], align // FIXME: this should be unique? // CHECK: [[METADATA:%.*]] = call ptr @swift_getExtendedExistentialTypeMetadata_unique(ptr @"$sl26existential_shape_metadata2R033_881A0B6978EB4286E7CFF1E27030ACACLL_px1TRts_XPXG{{(\.ptrauth)?}}", ptr [[ARGS]]) diff --git a/test/IRGen/existentials.sil b/test/IRGen/existentials.sil index 8c3d3ebe14cac..c56b8e141628d 100644 --- a/test/IRGen/existentials.sil +++ b/test/IRGen/existentials.sil @@ -55,29 +55,29 @@ entry(%w : $*@sil_weak CP?, %a : $CP?): // CHECK: [[SRC_REF:%.*]] = inttoptr {{.*}} ptr // CHECK: [[SRC_WITNESS:%.*]] = inttoptr {{.*}} ptr - // CHECK: [[DEST_WITNESS_ADDR:%.*]] = getelementptr inbounds { %swift.weak, ptr }, ptr %0, i32 0, i32 1 + // CHECK: [[DEST_WITNESS_ADDR:%.*]] = getelementptr inbounds{{.*}} { %swift.weak, ptr }, ptr %0, i32 0, i32 1 // CHECK: store ptr [[SRC_WITNESS]], ptr [[DEST_WITNESS_ADDR]] - // CHECK: [[DEST_REF_ADDR:%.*]] = getelementptr inbounds { %swift.weak, ptr }, ptr %0, i32 0, i32 0 + // CHECK: [[DEST_REF_ADDR:%.*]] = getelementptr inbounds{{.*}} { %swift.weak, ptr }, ptr %0, i32 0, i32 0 // CHECK: call ptr @swift_weakInit(ptr returned [[DEST_REF_ADDR]], ptr [[SRC_REF]]) store_weak %a to [init] %w : $*@sil_weak CP? // CHECK: [[SRC_REF:%.*]] = inttoptr {{.*}} ptr // CHECK: [[SRC_WITNESS:%.*]] = inttoptr {{.*}} ptr - // CHECK: [[DEST_WITNESS_ADDR:%.*]] = getelementptr inbounds { %swift.weak, ptr }, ptr %0, i32 0, i32 1 + // CHECK: [[DEST_WITNESS_ADDR:%.*]] = getelementptr inbounds{{.*}} { %swift.weak, ptr }, ptr %0, i32 0, i32 1 // CHECK: store ptr [[SRC_WITNESS]], ptr [[DEST_WITNESS_ADDR]] - // CHECK: [[DEST_REF_ADDR:%.*]] = getelementptr inbounds { %swift.weak, ptr }, ptr %0, i32 0, i32 0 + // CHECK: [[DEST_REF_ADDR:%.*]] = getelementptr inbounds{{.*}} { %swift.weak, ptr }, ptr %0, i32 0, i32 0 // CHECK: call ptr @swift_weakAssign(ptr returned [[DEST_REF_ADDR]], ptr [[SRC_REF]]) store_weak %a to %w : $*@sil_weak CP? - // CHECK: [[SRC_REF_ADDR:%.*]] = getelementptr inbounds { %swift.weak, ptr }, ptr %0, i32 0, i32 0 + // CHECK: [[SRC_REF_ADDR:%.*]] = getelementptr inbounds{{.*}} { %swift.weak, ptr }, ptr %0, i32 0, i32 0 // CHECK: [[DEST_REF:%.*]] = call ptr @swift_weakTakeStrong(ptr [[SRC_REF_ADDR]]) - // CHECK: [[SRC_WITNESS_ADDR:%.*]] = getelementptr inbounds { %swift.weak, ptr }, ptr %0, i32 0, i32 1 + // CHECK: [[SRC_WITNESS_ADDR:%.*]] = getelementptr inbounds{{.*}} { %swift.weak, ptr }, ptr %0, i32 0, i32 1 // CHECK: [[DEST_WITNESS:%.*]] = load ptr, ptr [[SRC_WITNESS_ADDR]] %b = load_weak [take] %w : $*@sil_weak CP? - // CHECK: [[SRC_REF_ADDR:%.*]] = getelementptr inbounds { %swift.weak, ptr }, ptr %0, i32 0, i32 0 + // CHECK: [[SRC_REF_ADDR:%.*]] = getelementptr inbounds{{.*}} { %swift.weak, ptr }, ptr %0, i32 0, i32 0 // CHECK: [[DEST_REF:%.*]] = call ptr @swift_weakLoadStrong(ptr [[SRC_REF_ADDR]]) - // CHECK: [[SRC_WITNESS_ADDR:%.*]] = getelementptr inbounds { %swift.weak, ptr }, ptr %0, i32 0, i32 1 + // CHECK: [[SRC_WITNESS_ADDR:%.*]] = getelementptr inbounds{{.*}} { %swift.weak, ptr }, ptr %0, i32 0, i32 1 // CHECK: [[DEST_WITNESS:%.*]] = load ptr, ptr [[SRC_WITNESS_ADDR]] %c = load_weak %w : $*@sil_weak CP? diff --git a/test/IRGen/existentials_objc.sil b/test/IRGen/existentials_objc.sil index 35bb3b5813f8b..dc3be933dd6a3 100644 --- a/test/IRGen/existentials_objc.sil +++ b/test/IRGen/existentials_objc.sil @@ -23,10 +23,10 @@ bb0(%0 : $*Any, %1 : $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: [[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 -// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[ANY]], ptr %0, i32 0, i32 0 +// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[ANY]], ptr %0, i32 0, i32 0 +// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[ANY]], ptr %0, i32 0, i32 0 // CHECK-NEXT: store ptr %1, ptr [[T0]], align 8 // CHECK-NEXT: ret void @@ -68,12 +68,12 @@ entry(%s : $CP): // CHECK: [[U2:%.*]] = alloca [[UREF]], align 8 store_unowned %s to [init] %u1 : $*@sil_unowned CP - // CHECK: [[T0:%.*]] = getelementptr inbounds [[UREF]], ptr [[U1]], i32 0, i32 1 + // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} [[UREF]], ptr [[U1]], i32 0, i32 1 // CHECK: store ptr %1, ptr [[T0]], align 8 - // CHECK: [[T0:%.*]] = getelementptr inbounds [[UREF]], ptr [[U1]], i32 0, i32 0 + // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} [[UREF]], ptr [[U1]], i32 0, i32 0 // CHECK: call ptr @swift_unknownObjectUnownedInit(ptr returned [[T0]], ptr %0) - // CHECK: [[T0:%.*]] = getelementptr inbounds [[UREF]], ptr [[U1]], i32 0, i32 0 + // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} [[UREF]], ptr [[U1]], i32 0, i32 0 // CHECK: [[T1:%.*]] = call ptr @swift_unknownObjectUnownedLoadStrong(ptr [[T0]]) %t = load_unowned %u1 : $*@sil_unowned CP // CHECK: call void @swift_unknownObjectRelease(ptr [[T1]]) @@ -105,29 +105,29 @@ entry(%w : $*@sil_weak CP?, %a : $CP?): // CHECK: [[SRC_REF:%.*]] = inttoptr {{.*}} ptr // CHECK: [[SRC_WITNESS:%.*]] = inttoptr {{.*}} ptr - // CHECK: [[DEST_WITNESS_ADDR:%.*]] = getelementptr inbounds { %swift.weak, ptr }, ptr %0, i32 0, i32 1 + // CHECK: [[DEST_WITNESS_ADDR:%.*]] = getelementptr inbounds{{.*}} { %swift.weak, ptr }, ptr %0, i32 0, i32 1 // CHECK: store ptr [[SRC_WITNESS]], ptr [[DEST_WITNESS_ADDR]] - // CHECK: [[DEST_REF_ADDR:%.*]] = getelementptr inbounds { %swift.weak, ptr }, ptr %0, i32 0, i32 0 + // CHECK: [[DEST_REF_ADDR:%.*]] = getelementptr inbounds{{.*}} { %swift.weak, ptr }, ptr %0, i32 0, i32 0 // CHECK: call ptr @swift_unknownObjectWeakInit(ptr returned [[DEST_REF_ADDR]], ptr [[SRC_REF]]) store_weak %a to [init] %w : $*@sil_weak CP? // CHECK: [[SRC_REF:%.*]] = inttoptr {{.*}} ptr // CHECK: [[SRC_WITNESS:%.*]] = inttoptr {{.*}} ptr - // CHECK: [[DEST_WITNESS_ADDR:%.*]] = getelementptr inbounds { %swift.weak, ptr }, ptr %0, i32 0, i32 1 + // CHECK: [[DEST_WITNESS_ADDR:%.*]] = getelementptr inbounds{{.*}} { %swift.weak, ptr }, ptr %0, i32 0, i32 1 // CHECK: store ptr [[SRC_WITNESS]], ptr [[DEST_WITNESS_ADDR]] - // CHECK: [[DEST_REF_ADDR:%.*]] = getelementptr inbounds { %swift.weak, ptr }, ptr %0, i32 0, i32 0 + // CHECK: [[DEST_REF_ADDR:%.*]] = getelementptr inbounds{{.*}} { %swift.weak, ptr }, ptr %0, i32 0, i32 0 // CHECK: call ptr @swift_unknownObjectWeakAssign(ptr returned [[DEST_REF_ADDR]], ptr [[SRC_REF]]) store_weak %a to %w : $*@sil_weak CP? - // CHECK: [[SRC_REF_ADDR:%.*]] = getelementptr inbounds { %swift.weak, ptr }, ptr %0, i32 0, i32 0 + // CHECK: [[SRC_REF_ADDR:%.*]] = getelementptr inbounds{{.*}} { %swift.weak, ptr }, ptr %0, i32 0, i32 0 // CHECK: [[DEST_REF:%.*]] = call ptr @swift_unknownObjectWeakTakeStrong(ptr [[SRC_REF_ADDR]]) - // CHECK: [[SRC_WITNESS_ADDR:%.*]] = getelementptr inbounds { %swift.weak, ptr }, ptr %0, i32 0, i32 1 + // CHECK: [[SRC_WITNESS_ADDR:%.*]] = getelementptr inbounds{{.*}} { %swift.weak, ptr }, ptr %0, i32 0, i32 1 // CHECK: [[DEST_WITNESS:%.*]] = load ptr, ptr [[SRC_WITNESS_ADDR]] %b = load_weak [take] %w : $*@sil_weak CP? - // CHECK: [[SRC_REF_ADDR:%.*]] = getelementptr inbounds { %swift.weak, ptr }, ptr %0, i32 0, i32 0 + // CHECK: [[SRC_REF_ADDR:%.*]] = getelementptr inbounds{{.*}} { %swift.weak, ptr }, ptr %0, i32 0, i32 0 // CHECK: [[DEST_REF:%.*]] = call ptr @swift_unknownObjectWeakLoadStrong(ptr [[SRC_REF_ADDR]]) - // CHECK: [[SRC_WITNESS_ADDR:%.*]] = getelementptr inbounds { %swift.weak, ptr }, ptr %0, i32 0, i32 1 + // CHECK: [[SRC_WITNESS_ADDR:%.*]] = getelementptr inbounds{{.*}} { %swift.weak, ptr }, ptr %0, i32 0, i32 1 // CHECK: [[DEST_WITNESS:%.*]] = load ptr, ptr [[SRC_WITNESS_ADDR]] %c = load_weak %w : $*@sil_weak CP? diff --git a/test/IRGen/existentials_opaque_boxed.sil b/test/IRGen/existentials_opaque_boxed.sil index 1315c54be3722..044b906b96f0b 100644 --- a/test/IRGen/existentials_opaque_boxed.sil +++ b/test/IRGen/existentials_opaque_boxed.sil @@ -46,18 +46,18 @@ entry(%0 : $*T): } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} linkonce_odr hidden ptr @__swift_allocate_boxed_opaque_existential_1(ptr %0) -// CHECK: [[METATYPE_ADDR:%.*]] = getelementptr inbounds %__opaque_existential_type_1, ptr %0, i32 0, i32 1 +// CHECK: [[METATYPE_ADDR:%.*]] = getelementptr inbounds{{.*}} %__opaque_existential_type_1, ptr %0, i32 0, i32 1 // CHECK: [[METATYPE:%.*]] = load ptr, ptr [[METATYPE_ADDR]] // CHECK: [[VWT_ADDR:%.*]] = getelementptr inbounds ptr, ptr [[METATYPE]], {{(i64|i32)}} -1 // CHECK: [[VWT:%.*]] = load ptr, ptr [[VWT_ADDR]] // CHECK-arm64e-NEXT: ptrtoint ptr [[VWT_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[VWT:%.*]] = inttoptr i64 {{%.*}} to ptr -// CHECK: [[FLAGS_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 10 +// CHECK: [[FLAGS_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 10 // CHECK: [[FLAGS:%.*]] = load i32, ptr [[FLAGS_ADDR]] // CHECK: [[ISNOTINLINE:%.*]] = and i32 [[FLAGS]], 131072 // CHECK: [[ISINLINE:%.*]] = icmp eq i32 [[ISNOTINLINE]], 0 -// CHECK: [[EXISTENTIAL_BUFFER:%.*]] = getelementptr inbounds %__opaque_existential_type_1, ptr %0, i32 0, i32 0 +// CHECK: [[EXISTENTIAL_BUFFER:%.*]] = getelementptr inbounds{{.*}} %__opaque_existential_type_1, ptr %0, i32 0, i32 0 // CHECK: br i1 [[ISINLINE]], label %done, label %allocateBox // // CHECK:done: @@ -79,8 +79,8 @@ entry(%0 : $*T): // CHECK-LABEL: define {{.*}} @test_init_existential_fixed // CHECK: [[CONTAINER:%.*]] = alloca %T25existentials_opaque_boxed11ExistentialP // The first inline buffer reference is from the emitOpaqueExistentialContainerInit call. -// CHECK: [[INLINEBUFFER:%.*]] = getelementptr inbounds %T25existentials_opaque_boxed11ExistentialP, ptr [[CONTAINER]], i32 0, i32 0 -// CHECK: [[INLINEBUFFER:%.*]] = getelementptr inbounds %T25existentials_opaque_boxed11ExistentialP, ptr [[CONTAINER]], i32 0, i32 0 +// CHECK: [[INLINEBUFFER:%.*]] = getelementptr inbounds{{.*}} %T25existentials_opaque_boxed11ExistentialP, ptr [[CONTAINER]], i32 0, i32 0 +// CHECK: [[INLINEBUFFER:%.*]] = getelementptr inbounds{{.*}} %T25existentials_opaque_boxed11ExistentialP, ptr [[CONTAINER]], i32 0, i32 0 sil @test_init_existential_fixed : $@convention(thin) () -> () { entry: %exist_container = alloc_stack $Existential @@ -101,10 +101,10 @@ entry: // CHECK-LABEL: define {{.*}} @test_init_existential_fixed_not_inline() // CHECK: [[CONTAINER:%.*]] = alloca %T25existentials_opaque_boxed11ExistentialP -// CHECK: [[INLINEBUFFER:%.*]] = getelementptr inbounds %T25existentials_opaque_boxed11ExistentialP, ptr [[CONTAINER]], i32 0, i32 0 -// CHECK: [[INLINEBUFFER:%.*]] = getelementptr inbounds %T25existentials_opaque_boxed11ExistentialP, ptr [[CONTAINER]], i32 0, i32 0 +// CHECK: [[INLINEBUFFER:%.*]] = getelementptr inbounds{{.*}} %T25existentials_opaque_boxed11ExistentialP, ptr [[CONTAINER]], i32 0, i32 0 +// CHECK: [[INLINEBUFFER:%.*]] = getelementptr inbounds{{.*}} %T25existentials_opaque_boxed11ExistentialP, ptr [[CONTAINER]], i32 0, i32 0 // CHECK: [[BOX:%.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata, i32 0, i32 2), {{(i64 48|i32 40)}}, {{(i64|i32)}} 7) -// CHECK: [[VALUE_ADDR:%.*]] = getelementptr inbounds <{ %swift.refcounted{{(, \[4 x i8\])?}}, [32 x i8] }>, ptr [[BOX]], i32 0, i32 {{(1|2)}} +// CHECK: [[VALUE_ADDR:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted{{(, \[4 x i8\])?}}, [32 x i8] }>, ptr [[BOX]], i32 0, i32 {{(1|2)}} // CHECK: store ptr [[BOX]], ptr [[INLINEBUFFER]] // CHECK: ret void sil @test_init_existential_fixed_not_inline : $@convention(thin) () -> () { @@ -148,14 +148,14 @@ entry: } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} linkonce_odr hidden void @__swift_deallocate_boxed_opaque_existential_1(ptr %0) -// CHECK: [[META_ADDR:%.*]] = getelementptr inbounds %__opaque_existential_type_1, ptr %0, i32 0, i32 1 +// CHECK: [[META_ADDR:%.*]] = getelementptr inbounds{{.*}} %__opaque_existential_type_1, ptr %0, i32 0, i32 1 // CHECK: [[META:%.*]] = load ptr, ptr [[META_ADDR]] // CHECK: [[VWT_ADDR:%.*]] = getelementptr inbounds ptr, ptr %2, {{(i64|i32)}} -1 // CHECK: [[VWT:%.*]] = load ptr, ptr [[VWT_ADDR]] // CHECK-arm64e-NEXT: ptrtoint ptr [[VWT_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[VWT:%.*]] = inttoptr i64 {{%.*}} to ptr -// CHECK: [[FLAGS_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 10 +// CHECK: [[FLAGS_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 10 // CHECK: [[FLAGS:%.*]] = load i32, ptr [[FLAGS_ADDR]] // CHECK: [[ISNOTINLINE:%.*]] = and i32 [[FLAGS]], 131072 // CHECK: [[ISINLINE:%.*]] = icmp eq i32 [[ISNOTINLINE]], 0 @@ -165,14 +165,14 @@ entry: // CHECK: ret void // CHECK: deallocateBox: -// CHECK: [[BUFFER:%.*]] = getelementptr inbounds %__opaque_existential_type_1, ptr %0, i32 0, i32 0 +// CHECK: [[BUFFER:%.*]] = getelementptr inbounds{{.*}} %__opaque_existential_type_1, ptr %0, i32 0, i32 0 // CHECK: [[REFERENCE:%.*]] = load ptr, ptr [[BUFFER]] // CHECK: [[VWT_ADDR2:%.*]] = getelementptr inbounds ptr, ptr [[META]], {{(i64|i32)}} -1 // CHECK: [[VWT2:%.*]] = load ptr, ptr [[VWT_ADDR2]] // CHECK-arm64e-NEXT: ptrtoint ptr [[VWT_ADDR2]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[VWT2:%.*]] = inttoptr i64 {{%.*}} to ptr -// CHECK: [[SIZE2_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT2]], i32 0, i32 8 +// CHECK: [[SIZE2_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT2]], i32 0, i32 8 // CHECK: [[SIZE:%.*]] = load [[INT]], ptr [[SIZE2_ADDR]] // CHECK-64:[[T0:%.*]] = zext i32 [[FLAGS]] to i64 // CHECK-64:[[ALIGNMASK:%.*]] = and i64 [[T0]], 255 @@ -188,9 +188,9 @@ entry: // CHECK: ret void // CHECK-LABEL: define {{.*}} @test_open_existential_addr_immutable(ptr -// CHECK: [[META_ADDR:%.*]] = getelementptr inbounds %T25existentials_opaque_boxed11ExistentialP, ptr %0, i32 0, i32 1 +// CHECK: [[META_ADDR:%.*]] = getelementptr inbounds{{.*}} %T25existentials_opaque_boxed11ExistentialP, ptr %0, i32 0, i32 1 // CHECK: [[METATYPE:%.*]] = load ptr, ptr [[META_ADDR]] -// CHECK: [[VWT_ADDR:%.*]] = getelementptr inbounds %T25existentials_opaque_boxed11ExistentialP, ptr %0, i32 0, i32 2 +// CHECK: [[VWT_ADDR:%.*]] = getelementptr inbounds{{.*}} %T25existentials_opaque_boxed11ExistentialP, ptr %0, i32 0, i32 2 // CHECK: [[VWT:%.*]] = load ptr, ptr [[VWT_ADDR]] // CHECK: [[VALUE_ADDR:%.*]] = call ptr @__swift_project_boxed_opaque_existential_1(ptr %0, ptr [[METATYPE]]) // CHECK: ret void @@ -207,7 +207,7 @@ bb0(%0 : $*Existential): // CHECK-arm64e-NEXT: ptrtoint ptr [[VWT_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[VWT:%.*]] = inttoptr i64 {{%.*}} to ptr -// CHECK: [[FLAGS_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 10 +// CHECK: [[FLAGS_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 10 // CHECK: [[FLAGS:%.*]] = load i32, ptr [[FLAGS_ADDR]] // CHECK: [[ISNOTINLINE:%.*]] = and i32 [[FLAGS]], 131072 // CHECK: [[ISINLINE:%.*]] = icmp eq i32 [[ISNOTINLINE]], 0 @@ -231,9 +231,9 @@ bb0(%0 : $*Existential): // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} {{.*}} @test_open_existential_addr_mutable -// CHECK: [[META_ADDR:%.*]] = getelementptr inbounds %T25existentials_opaque_boxed11ExistentialP, ptr %0, i32 0, i32 1 +// CHECK: [[META_ADDR:%.*]] = getelementptr inbounds{{.*}} %T25existentials_opaque_boxed11ExistentialP, ptr %0, i32 0, i32 1 // CHECK: [[METATYPE:%.*]] = load ptr, ptr [[META_ADDR]] -// CHECK: [[VWT_ADDR:%.*]] = getelementptr inbounds %T25existentials_opaque_boxed11ExistentialP, ptr %0, i32 0, i32 2 +// CHECK: [[VWT_ADDR:%.*]] = getelementptr inbounds{{.*}} %T25existentials_opaque_boxed11ExistentialP, ptr %0, i32 0, i32 2 // CHECK: [[VWT:%.*]] = load ptr, ptr [[VWT_ADDR]] // CHECK: [[VALUE_ADDR:%.*]] = call ptr @__swift_mutable_project_boxed_opaque_existential_1(ptr %0, ptr [[METATYPE]]) // CHECK: ret void @@ -250,7 +250,7 @@ bb0(%0 : $*Existential): // CHECK-arm64e-NEXT: ptrtoint ptr [[VWT_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[VWT:%.*]] = inttoptr i64 {{%.*}} to ptr -// CHECK: [[FLAGS_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 10 +// CHECK: [[FLAGS_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 10 // CHECK: [[FLAGS:%.*]] = load i32, ptr [[FLAGS_ADDR]] // CHECK: [[ISNOTINLINE:%.*]] = and i32 [[FLAGS]], 131072 // CHECK: [[ISINLINE:%.*]] = icmp eq i32 [[ISNOTINLINE]], 0 @@ -290,15 +290,15 @@ bb0(%0 : $*OtherExistential): } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} linkonce_odr hidden void @__swift_destroy_boxed_opaque_existential_1(ptr %0) -// CHECK: [[METADATA_ADDR:%.*]] = getelementptr inbounds %__opaque_existential_type_1, ptr %0, i32 0, i32 1 +// CHECK: [[METADATA_ADDR:%.*]] = getelementptr inbounds{{.*}} %__opaque_existential_type_1, ptr %0, i32 0, i32 1 // CHECK: [[METADATA:%.*]] = load ptr, ptr [[METADATA_ADDR]] -// CHECK: [[BUFFER_ADDR:%.*]] = getelementptr inbounds %__opaque_existential_type_1, ptr %0, i32 0, i32 0 +// CHECK: [[BUFFER_ADDR:%.*]] = getelementptr inbounds{{.*}} %__opaque_existential_type_1, ptr %0, i32 0, i32 0 // CHECK: [[VWT_ADDR:%.*]] = getelementptr inbounds ptr, ptr [[METADATA]], {{(i64|i32)}} -1 // CHECK: [[VWT:%.*]] = load ptr, ptr [[VWT_ADDR]] // CHECK-arm64e-NEXT: ptrtoint ptr [[VWT_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[VWT:%.*]] = inttoptr i64 {{%.*}} to ptr -// CHECK: [[FLAGS_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 10 +// CHECK: [[FLAGS_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 10 // CHECK: [[FLAGS:%.*]] = load i32, ptr [[FLAGS_ADDR]] // CHECK: [[ISNOTINLINE:%.*]] = and i32 [[FLAGS]], 131072 // CHECK: [[ISINLINE:%.*]] = icmp eq i32 [[ISNOTINLINE]], 0 @@ -349,11 +349,11 @@ bb0(%0 : $*OtherExistential): // CHECK: br i1 [[SELFASSIGN]], label %done, label %cont // // CHECK: cont: -// CHECK: [[DEST_BUFFERADDR:%.*]] = getelementptr inbounds %__opaque_existential_type_1, ptr %0, i32 0, i32 0 -// CHECK: [[SRC_BUFFERADDR:%.*]] = getelementptr inbounds %__opaque_existential_type_1, ptr %1, i32 0, i32 0 -// CHECK: [[DEST_TYPEADDR:%.*]] = getelementptr inbounds %__opaque_existential_type_1, ptr %0, i32 0, i32 1 +// CHECK: [[DEST_BUFFERADDR:%.*]] = getelementptr inbounds{{.*}} %__opaque_existential_type_1, ptr %0, i32 0, i32 0 +// CHECK: [[SRC_BUFFERADDR:%.*]] = getelementptr inbounds{{.*}} %__opaque_existential_type_1, ptr %1, i32 0, i32 0 +// CHECK: [[DEST_TYPEADDR:%.*]] = getelementptr inbounds{{.*}} %__opaque_existential_type_1, ptr %0, i32 0, i32 1 // CHECK: [[DEST_TYPE:%.*]] = load ptr, ptr [[DEST_TYPEADDR]] -// CHECK: [[SRC_TYPEADDR:%.*]] = getelementptr inbounds %__opaque_existential_type_1, ptr %1, i32 0, i32 1 +// CHECK: [[SRC_TYPEADDR:%.*]] = getelementptr inbounds{{.*}} %__opaque_existential_type_1, ptr %1, i32 0, i32 1 // CHECK: [[SRC_TYPE:%.*]] = load ptr, ptr [[SRC_TYPEADDR]] // CHECK: [[ISSAME:%.*]] = icmp eq ptr [[DEST_TYPE]], [[SRC_TYPE]] // CHECK: br i1 [[ISSAME]], label %match, label %no-match @@ -364,7 +364,7 @@ bb0(%0 : $*OtherExistential): // CHECK-arm64e-NEXT: ptrtoint ptr [[VWT_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[VWT:%.*]] = inttoptr i64 {{%.*}} to ptr -// CHECK: [[FLAGS_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 10 +// CHECK: [[FLAGS_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 10 // CHECK: [[FLAGS:%.*]] = load i32, ptr [[FLAGS_ADDR]] // CHECK: [[ISNOTINLINE:%.*]] = and i32 [[FLAGS]], 131072 // CHECK: [[ISINLINE:%.*]] = icmp eq i32 [[ISNOTINLINE]], 0 @@ -391,8 +391,8 @@ bb0(%0 : $*OtherExistential): // CHECK: no-match: // CHECK: store ptr [[SRC_TYPE]], ptr [[DEST_TYPEADDR]] -// CHECK: [[DEST_PWT_ADDR:%.*]] = getelementptr inbounds %__opaque_existential_type_1, ptr %0, i32 0, i32 2 -// CHECK: [[SRC_PWT_ADDR:%.*]] = getelementptr inbounds %__opaque_existential_type_1, ptr %1, i32 0, i32 2 +// CHECK: [[DEST_PWT_ADDR:%.*]] = getelementptr inbounds{{.*}} %__opaque_existential_type_1, ptr %0, i32 0, i32 2 +// CHECK: [[SRC_PWT_ADDR:%.*]] = getelementptr inbounds{{.*}} %__opaque_existential_type_1, ptr %1, i32 0, i32 2 // CHECK: [[SRC_PTW:%.*]] = load ptr, ptr [[SRC_PWT_ADDR]] // CHECK: store ptr [[SRC_PTW]], ptr [[DEST_PWT_ADDR]] // CHECK: [[DEST_VWT_ADDR:%.*]] = getelementptr inbounds ptr, ptr [[DEST_TYPE]], {{(i64|i32)}} -1 @@ -400,7 +400,7 @@ bb0(%0 : $*OtherExistential): // CHECK-arm64e-NEXT: ptrtoint ptr [[DEST_VWT_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[DEST_VWT:%.*]] = inttoptr i64 {{%.*}} to ptr -// CHECK: [[DEST_FLAGS_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[DEST_VWT]], i32 0, i32 10 +// CHECK: [[DEST_FLAGS_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[DEST_VWT]], i32 0, i32 10 // CHECK: [[DEST_FLAGS:%.*]] = load i32, ptr [[DEST_FLAGS_ADDR]] // CHECK: [[DEST_ISNOTINLINE:%.*]] = and i32 [[DEST_FLAGS]], 131072 // CHECK: [[DEST_ISINLINE:%.*]] = icmp eq i32 [[DEST_ISNOTINLINE]], 0 @@ -409,7 +409,7 @@ bb0(%0 : $*OtherExistential): // CHECK-arm64e-NEXT: ptrtoint ptr [[SRC_VWT_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[SRC_VWT:%.*]] = inttoptr i64 {{%.*}} to ptr -// CHECK: [[SRC_FLAGS_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[SRC_VWT]], i32 0, i32 10 +// CHECK: [[SRC_FLAGS_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[SRC_VWT]], i32 0, i32 10 // CHECK: [[SRC_FLAGS:%.*]] = load i32, ptr [[SRC_FLAGS_ADDR]] // CHECK: [[SRC_ISNOTINLINE:%.*]] = and i32 [[SRC_FLAGS]], 131072 // CHECK: [[SRC_ISINLINE:%.*]] = icmp eq i32 [[SRC_ISNOTINLINE]], 0 @@ -536,16 +536,16 @@ bb0(%0 : $*OtherExistential): // CHECK: call ptr @"$s25existentials_opaque_boxed11Existential_pWOc"(ptr %0, ptr [[LOCAL]]) // CHECK: ret void // CHECK-LABEL: define linkonce_odr hidden ptr @"$s25existentials_opaque_boxed11Existential_pWOc"(ptr %0, ptr %1) -// CHECK: [[TYPE_ADDR:%.*]] = getelementptr inbounds %T25existentials_opaque_boxed11ExistentialP, ptr %0, i32 0, i32 1 +// CHECK: [[TYPE_ADDR:%.*]] = getelementptr inbounds{{.*}} %T25existentials_opaque_boxed11ExistentialP, ptr %0, i32 0, i32 1 // CHECK: [[ARG_TYPE:%.*]] = load ptr, ptr [[TYPE_ADDR]] -// CHECK: [[LOCAL_TYPE_ADDR:%.*]] = getelementptr inbounds %T25existentials_opaque_boxed11ExistentialP, ptr %1, i32 0, i32 1 +// CHECK: [[LOCAL_TYPE_ADDR:%.*]] = getelementptr inbounds{{.*}} %T25existentials_opaque_boxed11ExistentialP, ptr %1, i32 0, i32 1 // CHECK: store ptr [[ARG_TYPE]], ptr [[LOCAL_TYPE_ADDR]] -// CHECK: [[PWT_ADDR:%.*]] = getelementptr inbounds %T25existentials_opaque_boxed11ExistentialP, ptr %0, i32 0, i32 2 +// CHECK: [[PWT_ADDR:%.*]] = getelementptr inbounds{{.*}} %T25existentials_opaque_boxed11ExistentialP, ptr %0, i32 0, i32 2 // CHECK: [[PWT:%.*]] = load ptr, ptr [[PWT_ADDR]] -// CHECK: [[LOCAL_PWT_ADDR:%.*]] = getelementptr inbounds %T25existentials_opaque_boxed11ExistentialP, ptr %1, i32 0, i32 2 +// CHECK: [[LOCAL_PWT_ADDR:%.*]] = getelementptr inbounds{{.*}} %T25existentials_opaque_boxed11ExistentialP, ptr %1, i32 0, i32 2 // CHECK: store ptr [[PWT]], ptr [[LOCAL_PWT_ADDR]] -// CHECK: [[BUFFER_ARG_ADDR:%.*]] = getelementptr inbounds %T25existentials_opaque_boxed11ExistentialP, ptr %0, i32 0, i32 0 -// CHECK: [[BUFFER_LOCAL_ADDR:%.*]] = getelementptr inbounds %T25existentials_opaque_boxed11ExistentialP, ptr %1, i32 0, i32 0 +// CHECK: [[BUFFER_ARG_ADDR:%.*]] = getelementptr inbounds{{.*}} %T25existentials_opaque_boxed11ExistentialP, ptr %0, i32 0, i32 0 +// CHECK: [[BUFFER_LOCAL_ADDR:%.*]] = getelementptr inbounds{{.*}} %T25existentials_opaque_boxed11ExistentialP, ptr %1, i32 0, i32 0 // CHECK: [[VWT_ADDR:%.*]] = getelementptr inbounds ptr, ptr [[ARG_TYPE]], {{(i64|i32)}} -1 // CHECK: [[VWT:%.*]] = load ptr, ptr [[VWT_ADDR]] // CHECK-arm64e-NEXT: ptrtoint ptr [[VWT_ADDR]] to i64 @@ -581,8 +581,8 @@ struct FixedOveralign : Existential { // CHECK-LABEL: define {{.*}} @test_init_existential_fixed_align_not_inline() // CHECK: [[CONTAINER:%.*]] = alloca %T25existentials_opaque_boxed11ExistentialP -// CHECK: [[INLINEBUFFER:%.*]] = getelementptr inbounds %T25existentials_opaque_boxed11ExistentialP, ptr [[CONTAINER]], i32 0, i32 0 -// CHECK: [[INLINEBUFFER:%.*]] = getelementptr inbounds %T25existentials_opaque_boxed11ExistentialP, ptr [[CONTAINER]], i32 0, i32 0 +// CHECK: [[INLINEBUFFER:%.*]] = getelementptr inbounds{{.*}} %T25existentials_opaque_boxed11ExistentialP, ptr [[CONTAINER]], i32 0, i32 0 +// CHECK: [[INLINEBUFFER:%.*]] = getelementptr inbounds{{.*}} %T25existentials_opaque_boxed11ExistentialP, ptr [[CONTAINER]], i32 0, i32 0 // CHECK: [[BOX:%.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata.4, i32 0, i32 2), {{(i64|i32)}} 32, {{(i64|i32)}} 15) // CHECK: [[VALUE_ADDR:%.*]] = getelementptr inbounds {{.*}}, ptr [[BOX]], i32 0, i32 {{(1|2)}} // CHECK: store ptr [[BOX]], ptr [[INLINEBUFFER]] diff --git a/test/IRGen/fixed_layout_class.swift b/test/IRGen/fixed_layout_class.swift index 202dc9e4af623..294188e8595f4 100644 --- a/test/IRGen/fixed_layout_class.swift +++ b/test/IRGen/fixed_layout_class.swift @@ -12,7 +12,7 @@ import fixed_layout_class // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s16class_resilience20useRootClassPropertyyy013fixed_layout_A0026OutsideParentWithResilientF0CF"(ptr %0) public func useRootClassProperty(_ o: OutsideParentWithResilientProperty) { - // CHECK: getelementptr inbounds %T18fixed_layout_class34OutsideParentWithResilientPropertyC, ptr %0, i32 0, i32 1 + // CHECK: getelementptr inbounds{{.*}} %T18fixed_layout_class34OutsideParentWithResilientPropertyC, ptr %0, i32 0, i32 1 let a = o.p // CHECK: load [[INT]], ptr @"$s18fixed_layout_class34OutsideParentWithResilientPropertyC1s16resilient_struct4SizeVvpWvd" let b = o.s @@ -23,9 +23,9 @@ public func useRootClassProperty(_ o: OutsideParentWithResilientProperty) { // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s16class_resilience19useSubclassPropertyyy013fixed_layout_A012OutsideChildCF"(ptr %0) public func useSubclassProperty(_ o: OutsideChild) { - // CHECK: getelementptr inbounds %T18fixed_layout_class13OutsideParentC, ptr {{%[0-9]+}}, i32 0, i32 1 + // CHECK: getelementptr inbounds{{.*}} %T18fixed_layout_class13OutsideParentC, ptr {{%[0-9]+}}, i32 0, i32 1 let a = o.property - // CHECK: getelementptr inbounds %T18fixed_layout_class12OutsideChildC, ptr %0, i32 0, i32 2 + // CHECK: getelementptr inbounds{{.*}} %T18fixed_layout_class12OutsideChildC, ptr %0, i32 0, i32 2 let b = o.childProperty // CHECK: ret void } @@ -51,7 +51,7 @@ public func useGenericRootClassProperty(_ o: GenericOutsideParent) { // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s16class_resilience27useGenericRootClassPropertyyy013fixed_layout_A00D13OutsideParentCySiGF"(ptr %0) public func useGenericRootClassProperty(_ o: GenericOutsideParent) { - // CHECK: getelementptr inbounds %T18fixed_layout_class20GenericOutsideParentCySiG, ptr %0, i32 0, i32 1 + // CHECK: getelementptr inbounds{{.*}} %T18fixed_layout_class20GenericOutsideParentCySiG, ptr %0, i32 0, i32 1 let a = o.property // CHECK: ret void @@ -87,10 +87,10 @@ public func useGenericSubclassProperty(_ o: GenericOutsideChild) { // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s16class_resilience26useGenericSubclassPropertyyy013fixed_layout_A00D12OutsideChildCySiGF"(ptr %0) public func useGenericSubclassProperty(_ o: GenericOutsideChild) { - // CHECK: getelementptr inbounds %T18fixed_layout_class20GenericOutsideParentCySiG, ptr %0, i32 0, i32 1 + // CHECK: getelementptr inbounds{{.*}} %T18fixed_layout_class20GenericOutsideParentCySiG, ptr %0, i32 0, i32 1 let a = o.property - // CHECK: getelementptr inbounds %T18fixed_layout_class19GenericOutsideChildCySiG, ptr %0, i32 0, i32 2 + // CHECK: getelementptr inbounds{{.*}} %T18fixed_layout_class19GenericOutsideChildCySiG, ptr %0, i32 0, i32 2 let b = o.childProperty // CHECK: ret void diff --git a/test/IRGen/fixed_size_buffer_peepholes.sil b/test/IRGen/fixed_size_buffer_peepholes.sil index d155865530ac2..378f5c92032d2 100644 --- a/test/IRGen/fixed_size_buffer_peepholes.sil +++ b/test/IRGen/fixed_size_buffer_peepholes.sil @@ -5,7 +5,7 @@ import Builtin protocol P {} // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dont_crash( -// CHECK: [[TYPE_ADDR:%.*]] = getelementptr inbounds %T27fixed_size_buffer_peepholes1PP, ptr %0, i32 0, i32 1 +// CHECK: [[TYPE_ADDR:%.*]] = getelementptr inbounds{{.*}} %T27fixed_size_buffer_peepholes1PP, ptr %0, i32 0, i32 1 // CHECK: [[TYPE:%.*]] = load ptr, ptr [[TYPE_ADDR]] // CHECK: call {{.*}} @__swift_project_boxed_opaque_existential_1 // CHECK: [[VWT_ADDR:%.*]] = getelementptr inbounds ptr, ptr [[TYPE]], {{(i64|i32)}} -1 diff --git a/test/IRGen/generic_casts.swift b/test/IRGen/generic_casts.swift index edb132269d1f4..4d34360cb01e0 100644 --- a/test/IRGen/generic_casts.swift +++ b/test/IRGen/generic_casts.swift @@ -39,12 +39,12 @@ func allToInt(_ x: T) -> Int { // CHECK: [[INT_TEMP:%.*]] = alloca %TSi, // CHECK: [[VWT_ADDR:%.*]] = getelementptr inbounds ptr, ptr %T, i64 -1 // CHECK: [[VWT:%.*]] = load ptr, ptr [[VWT_ADDR]] - // CHECK: [[SIZE_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 8 + // CHECK: [[SIZE_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 8 // CHECK: [[SIZE:%.*]] = load i64, ptr [[SIZE_ADDR]] // CHECK: [[T_ALLOCA:%.*]] = alloca i8, {{.*}} [[SIZE]], align 16 // CHECK: [[TEMP:%.*]] = call ptr {{.*}}(ptr noalias [[T_ALLOCA]], ptr noalias %0, ptr %T) // CHECK: call zeroext i1 @swift_dynamicCast(ptr [[INT_TEMP]], ptr [[T_ALLOCA]], ptr %T, ptr @"$sSiN", i64 7) - // CHECK: [[T0:%.*]] = getelementptr inbounds %TSi, ptr [[INT_TEMP]], i32 0, i32 0 + // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[INT_TEMP]], i32 0, i32 0 // CHECK: [[INT_RESULT:%.*]] = load i64, ptr [[T0]], // CHECK: ret i64 [[INT_RESULT]] } @@ -52,7 +52,7 @@ func allToInt(_ x: T) -> Int { // CHECK: define hidden swiftcc void @"$s13generic_casts8intToAllyxSilF"(ptr noalias sret({{.*}}) %0, i64 %1, ptr %T) {{.*}} { func intToAll(_ x: Int) -> T { // CHECK: [[INT_TEMP:%.*]] = alloca %TSi, - // CHECK: [[T0:%.*]] = getelementptr inbounds %TSi, ptr [[INT_TEMP]], i32 0, i32 0 + // CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[INT_TEMP]], i32 0, i32 0 // CHECK: store i64 %1, ptr [[T0]], // CHECK: call zeroext i1 @swift_dynamicCast(ptr %0, ptr [[INT_TEMP]], ptr @"$sSiN", ptr %T, i64 7) return x as! T diff --git a/test/IRGen/generic_classes.sil b/test/IRGen/generic_classes.sil index e21c9b8006bd5..42638f18799d6 100644 --- a/test/IRGen/generic_classes.sil +++ b/test/IRGen/generic_classes.sil @@ -274,7 +274,7 @@ entry: // RootGeneric.x has fixed layout // CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc i8 @RootGeneric_concrete_fragile_dependent_member_access_x -// CHECK: getelementptr inbounds [[ROOTGENERIC]], ptr %0, i32 0, i32 1 +// CHECK: getelementptr inbounds{{.*}} [[ROOTGENERIC]], ptr %0, i32 0, i32 1 sil @RootGeneric_concrete_fragile_dependent_member_access_x : $ (RootGeneric) -> UInt8 { entry(%c : $RootGeneric): %p = ref_element_addr %c : $RootGeneric, #RootGeneric.x @@ -321,7 +321,7 @@ entry(%c : $RootGeneric): // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc i8 @RootGeneric_subst_concrete_fragile_dependent_member_access_z // CHECK: [[Z_ADDR:%.*]] = getelementptr inbounds {{.*}}, ptr %0, i32 0, i32 4 -// CHECK: [[T0:%.*]] = getelementptr inbounds %Ts5UInt8V, ptr [[Z_ADDR]], i32 0, i32 0 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %Ts5UInt8V, ptr [[Z_ADDR]], i32 0, i32 0 // CHECK: load i8, ptr [[T0]], align sil @RootGeneric_subst_concrete_fragile_dependent_member_access_z : $(RootGeneric) -> UInt8 { entry(%c : $RootGeneric): @@ -377,7 +377,7 @@ entry(%c : $RootGeneric): // Initialize our own dependent field offsets. // CHECK-objc: [[OFFSETS:%.*]] = getelementptr inbounds i64, ptr [[METADATA]], i64 20 // CHECK-native: [[OFFSETS:%.*]] = getelementptr inbounds i64, ptr [[METADATA]], i64 17 -// CHECK: [[FIELDS_ADDR:%.*]] = getelementptr inbounds [1 x ptr], ptr %classFields, i32 0, i32 0 +// CHECK: [[FIELDS_ADDR:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr %classFields, i32 0, i32 0 // CHECK: [[T0:%.*]] = call{{( tail)?}} swiftcc %swift.metadata_response @swift_checkMetadataState(i64 319, ptr %B) // CHECK: [[B_CHECKED:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 // CHECK: [[B_STATUS:%.*]] = extractvalue %swift.metadata_response [[T0]], 1 diff --git a/test/IRGen/generic_metatypes.swift b/test/IRGen/generic_metatypes.swift index d27fe84c46160..7a37d2b923e76 100644 --- a/test/IRGen/generic_metatypes.swift +++ b/test/IRGen/generic_metatypes.swift @@ -60,11 +60,11 @@ protocol Bas {} // 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_ADDR:%.*]] = getelementptr inbounds{{.*}} %T17generic_metatypes3BasP, ptr [[X:%.*]], i32 0, i32 1 // CHECK: [[METADATA:%.*]] = load ptr, ptr [[METADATA_ADDR]] // CHECK: [[VALUE_ADDR:%.*]] = call ptr @__swift_project_boxed_opaque_existential_1(ptr [[X]], ptr [[METADATA]]) // CHECK: [[METATYPE:%.*]] = call ptr @swift_getDynamicType(ptr [[VALUE_ADDR]], ptr [[METADATA]], i1 true) - // CHECK: [[WTABLE_ADDR:%.*]] = getelementptr inbounds %T17generic_metatypes3BasP, ptr %0, i32 0, i32 2 + // CHECK: [[WTABLE_ADDR:%.*]] = getelementptr inbounds{{.*}} %T17generic_metatypes3BasP, ptr %0, i32 0, i32 2 // CHECK: [[WTABLE:%.*]] = load ptr, ptr [[WTABLE_ADDR]] // CHECK-NOT: call void @__swift_destroy_boxed_opaque_existential_1(ptr %0) // CHECK: [[T0:%.*]] = insertvalue { ptr, ptr } undef, ptr [[METATYPE]], 0 diff --git a/test/IRGen/generic_metatypes_future.swift b/test/IRGen/generic_metatypes_future.swift index f1492f3c9f46e..f67ec6edcc5b2 100644 --- a/test/IRGen/generic_metatypes_future.swift +++ b/test/IRGen/generic_metatypes_future.swift @@ -61,11 +61,11 @@ protocol Bas {} // 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_ADDR:%.*]] = getelementptr inbounds{{.*}} %T17generic_metatypes3BasP, ptr [[X:%.*]], i32 0, i32 1 // CHECK: [[METADATA:%.*]] = load ptr, ptr [[METADATA_ADDR]] // CHECK: [[VALUE_ADDR:%.*]] = call ptr @__swift_project_boxed_opaque_existential_1(ptr [[X]], ptr [[METADATA]]) // CHECK: [[METATYPE:%.*]] = call ptr @swift_getDynamicType(ptr [[VALUE_ADDR]], ptr [[METADATA]], i1 true) - // CHECK: [[WTABLE_ADDR:%.*]] = getelementptr inbounds %T17generic_metatypes3BasP, ptr %0, i32 0, i32 2 + // CHECK: [[WTABLE_ADDR:%.*]] = getelementptr inbounds{{.*}} %T17generic_metatypes3BasP, ptr %0, i32 0, i32 2 // CHECK: [[WTABLE:%.*]] = load ptr, ptr [[WTABLE_ADDR]] // CHECK-NOT: call void @__swift_destroy_boxed_opaque_existential_1(ptr %0) // CHECK: [[T0:%.*]] = insertvalue { ptr, ptr } undef, ptr [[METATYPE]], 0 diff --git a/test/IRGen/generic_tuples.swift b/test/IRGen/generic_tuples.swift index b1ad0a699daa8..773f302150a41 100644 --- a/test/IRGen/generic_tuples.swift +++ b/test/IRGen/generic_tuples.swift @@ -15,7 +15,7 @@ func dup(_ x: T) -> (T, T) { var x = x; return (x,x) } // Allocate a local variable for 'x'. // CHECK: [[VWT_ADDR:%.*]] = getelementptr inbounds ptr, ptr %T, i64 -1 // CHECK: [[VWT:%.*]] = load ptr, ptr [[VWT_ADDR]] -// CHECK: [[SIZE_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 8 +// CHECK: [[SIZE_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 8 // CHECK: [[SIZE:%.*]] = load i64, ptr [[SIZE_ADDR]] // CHECK: [[X_ALLOCA:%.*]] = alloca i8, {{.*}} [[SIZE]], align 16 // Debug info shadow copy. diff --git a/test/IRGen/global_resilience.sil b/test/IRGen/global_resilience.sil index 4d655b1683278..058ee7345c61a 100644 --- a/test/IRGen/global_resilience.sil +++ b/test/IRGen/global_resilience.sil @@ -94,7 +94,7 @@ bb0: %addr = global_addr @fixedGlobal : $*LargeResilientStruct - // CHECK: [[VALUE:%.*]] = load i64, ptr getelementptr inbounds (%T17global_resilience20LargeResilientStructV, ptr @fixedGlobal, i32 0, i32 1) + // CHECK: [[VALUE:%.*]] = load i64, ptr getelementptr inbounds{{.*}} (%T17global_resilience20LargeResilientStructV, ptr @fixedGlobal, i32 0, i32 1) %x_addr = struct_element_addr %addr : $*LargeResilientStruct, #LargeResilientStruct.x %x = load %x_addr : $*Int64 @@ -126,7 +126,7 @@ bb0: // CHECK-arm64e-NEXT: ptrtoint ptr [[VWT_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[VWT:%.*]] = inttoptr i64 {{%.*}} to ptr -// CHECK: [[FLAGS_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 10 +// CHECK: [[FLAGS_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 10 // CHECK: [[FLAGS:%.*]] = load i32, ptr [[FLAGS_ADDR]] // CHECK: [[ISNOTINLINE:%.*]] = and i32 [[FLAGS]], 131072 // CHECK: [[ISINLINE:%.*]] = icmp eq i32 [[ISNOTINLINE]], 0 @@ -138,7 +138,7 @@ bb0: // CHECK-arm64e-NEXT: ptrtoint ptr [[VWT_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[VWT:%.*]] = inttoptr i64 {{%.*}} to ptr -// CHECK: [[SIZE_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 8 +// CHECK: [[SIZE_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 8 // CHECK: [[SIZE:%.*]] = load [[INT]], ptr [[SIZE_ADDR]] // CHECK: [[ALIGN:%.*]] = and {{.*}}, 255 // CHECK: [[PTR:%.*]] = call noalias ptr @swift_slowAlloc({{.*}} [[SIZE]], {{.*}} [[ALIGN]]) @@ -156,7 +156,7 @@ bb0: // CHECK-arm64e-NEXT: ptrtoint ptr [[VWT_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[VWT:%.*]] = inttoptr i64 {{%.*}} to ptr -// CHECK: [[FLAGS_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 10 +// CHECK: [[FLAGS_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 10 // CHECK: [[FLAGS:%.*]] = load i32, ptr [[FLAGS_ADDR]] // CHECK: [[ISNOTINLINE:%.*]] = and i32 [[FLAGS]], 131072 // CHECK: [[ISINLINE:%.*]] = icmp eq i32 [[ISNOTINLINE]], 0 diff --git a/test/IRGen/indexing.sil b/test/IRGen/indexing.sil index a908a84d15d9e..9076f8adab6f3 100644 --- a/test/IRGen/indexing.sil +++ b/test/IRGen/indexing.sil @@ -41,7 +41,7 @@ entry(%p : $*(), %i: $Builtin.Word): // CHECK: define{{( protected)?}} {{.*}}void @dynamic_size(ptr noalias %0, i64 %1, ptr %T) {{.*}} { // CHECK: [[T1:%.*]] = getelementptr inbounds ptr, ptr %T, i64 -1 // CHECK-NEXT: [[VWT:%T.valueWitnesses]] = load ptr, ptr [[T1]], align 8 -// CHECK: [[STRIDE_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 9 +// CHECK: [[STRIDE_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 9 // CHECK: [[STRIDE:%.*]] = load i64, ptr [[STRIDE_ADDR]] // CHECK-NEXT: [[T0:%.*]] = mul nsw i64 %1, [[STRIDE]] // CHECK-NEXT: getelementptr inbounds i8, ptr %0, i64 [[T0]] diff --git a/test/IRGen/indirect_argument.sil b/test/IRGen/indirect_argument.sil index bb521b9ba5907..466fbc81686ac 100644 --- a/test/IRGen/indirect_argument.sil +++ b/test/IRGen/indirect_argument.sil @@ -71,7 +71,7 @@ entry(%o : $*Huge, %x : $Huge): // 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: [[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]] @@ -90,7 +90,7 @@ entry(%x : $Huge, %y : $Huge): // 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: [[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]]) diff --git a/test/IRGen/isolated_any.sil b/test/IRGen/isolated_any.sil index 5c688a2ab94cf..c85559c203b09 100644 --- a/test/IRGen/isolated_any.sil +++ b/test/IRGen/isolated_any.sil @@ -25,12 +25,12 @@ entry(%actor: $Optional, %int: $Int): // ptr: int capture // CHECK-64: [[BOX:%.*]] = call noalias ptr @swift_allocObject(ptr {{.*}}, [[INT]] 48, [[INT]] 7) // CHECK-32: [[BOX:%.*]] = call noalias ptr @swift_allocObject(ptr {{.*}}, [[INT]] 24, [[INT]] 3) -// CHECK-NEXT: [[ISO_ADDR:%.*]] = getelementptr inbounds <{ %swift.refcounted, %TScA_pSg, [{{4|8}} x i8], %TSi }>, ptr [[BOX]], i32 0, i32 1 -// CHECK-NEXT: [[ISO_REF_ADDR:%.*]] = getelementptr inbounds { [[INT]], [[INT]] }, ptr [[ISO_ADDR]], i32 0, i32 0 +// CHECK-NEXT: [[ISO_ADDR:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %TScA_pSg, [{{4|8}} x i8], %TSi }>, ptr [[BOX]], i32 0, i32 1 +// CHECK-NEXT: [[ISO_REF_ADDR:%.*]] = getelementptr inbounds{{.*}} { [[INT]], [[INT]] }, ptr [[ISO_ADDR]], i32 0, i32 0 // CHECK-NEXT: store [[INT]] %0, ptr [[ISO_REF_ADDR]], align -// CHECK-NEXT: [[ISO_WT_ADDR:%.*]] = getelementptr inbounds { [[INT]], [[INT]] }, ptr [[ISO_ADDR]], i32 0, i32 1 +// CHECK-NEXT: [[ISO_WT_ADDR:%.*]] = getelementptr inbounds{{.*}} { [[INT]], [[INT]] }, ptr [[ISO_ADDR]], i32 0, i32 1 // CHECK-NEXT: store [[INT]] %1, ptr [[ISO_WT_ADDR]], align -// CHECK-NEXT: [[T_ADDR:%.*]] = getelementptr inbounds <{ %swift.refcounted, %TScA_pSg, [{{4|8}} x i8], %TSi }>, ptr [[BOX]], i32 0, i32 2 +// CHECK-NEXT: [[T_ADDR:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %TScA_pSg, [{{4|8}} x i8], %TSi }>, ptr [[BOX]], i32 0, i32 2 // CHECK-NEXT: store ptr %T, ptr [[T_ADDR]], align // CHECK: [[RESULT:%.*]] = insertvalue { ptr, ptr } { ptr @"$s7closureTA{{(\.ptrauth.*)?}}", ptr undef }, ptr [[BOX]], 1 // CHECK-NEXT: ret { ptr, ptr } [[RESULT]] @@ -44,9 +44,9 @@ entry(%fn : $@callee_guaranteed @isolated(any) () -> ()): // CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32 } @extract_closure_isolation // CHECK-64: [[ISO_ADDR:%.*]] = getelementptr inbounds i8, ptr %1, i32 16 // CHECK-32: [[ISO_ADDR:%.*]] = getelementptr inbounds i8, ptr %1, i32 8 -// CHECK-NEXT: [[ISO_REF_ADDR:%.*]] = getelementptr inbounds { [[INT]], [[INT]] }, ptr [[ISO_ADDR]], i32 0, i32 0 +// CHECK-NEXT: [[ISO_REF_ADDR:%.*]] = getelementptr inbounds{{.*}} { [[INT]], [[INT]] }, ptr [[ISO_ADDR]], i32 0, i32 0 // CHECK-NEXT: [[ISO_REF:%.*]] = load [[INT]], ptr [[ISO_REF_ADDR]], align -// CHECK-NEXT: [[ISO_WT_ADDR:%.*]] = getelementptr inbounds { [[INT]], [[INT]] }, ptr [[ISO_ADDR]], i32 0, i32 1 +// CHECK-NEXT: [[ISO_WT_ADDR:%.*]] = getelementptr inbounds{{.*}} { [[INT]], [[INT]] }, ptr [[ISO_ADDR]], i32 0, i32 1 // CHECK-NEXT: [[ISO_WT:%.*]] = load [[INT]], ptr [[ISO_WT_ADDR]], align // CHECK-NEXT: [[T0:%.*]] = insertvalue { [[INT]], [[INT]] } undef, [[INT]] [[ISO_REF]], 0 // CHECK-NEXT: [[T1:%.*]] = insertvalue { [[INT]], [[INT]] } [[T0]], [[INT]] [[ISO_WT]], 1 diff --git a/test/IRGen/large_argument_c.sil b/test/IRGen/large_argument_c.sil index 1141d8714d73b..656d480899d07 100644 --- a/test/IRGen/large_argument_c.sil +++ b/test/IRGen/large_argument_c.sil @@ -21,7 +21,7 @@ sil @pass_and_return : $@convention(c) (large_thing, large_thing) -> large_thing // CHECK: define{{.*}} swiftcc void @test(ptr {{.*}} dereferenceable(256) %0) // CHECK: [[TMP:%.*]] = alloca %TSo11large_thinga -// CHECK: [[PROJ_ADDR:%.*]] = getelementptr inbounds i8, ptr %0, i64 128 +// CHECK: [[PROJ_ADDR:%.*]] = getelementptr inbounds{{.*}} i8, ptr %0, i64 128 // CHECK: [[VAL:%.*]] = load i64, ptr %.sroa.3.0..sroa_idx // CHECK: store i64 [[VAL]], ptr [[TMP]] sil @test : $@convention(thin) (@in ContainingLargeThing) -> () { diff --git a/test/IRGen/large_argument_result_c.swift b/test/IRGen/large_argument_result_c.swift index c90042fbd4b66..fa05e2f14a025 100644 --- a/test/IRGen/large_argument_result_c.swift +++ b/test/IRGen/large_argument_result_c.swift @@ -16,7 +16,7 @@ // CHECK: call void @pass_and_return(ptr {{.*}} [[CALL_ALLOCA]], ptr nonnull [[TMP_ALLOCA]], ptr nonnull [[TMP_ALLOCA2]]) // CHECK: call {{.*}} @swift_allocObject // CHECK: [[BOX:%.*]] = call noalias ptr @swift_allocObject( -// CHECK: [[ADDR_IN_BOX:%.*]] = getelementptr inbounds i8, ptr [[BOX]], i64 16 +// CHECK: [[ADDR_IN_BOX:%.*]] = getelementptr inbounds{{.*}} i8, ptr [[BOX]], i64 16 // CHECK: call void @llvm.memcpy.p0.p0.i64(ptr {{.*}} [[ADDR_IN_BOX]], ptr {{.*}} [[CALL_ALLOCA]], i64 128, i1 false) // CHECK: call void @llvm.lifetime.end.p0(i64 128, ptr nonnull [[CALL_ALLOCA]]) public func runTest(_ l : large_thing) { diff --git a/test/IRGen/large_argument_result_c_x86_64.swift b/test/IRGen/large_argument_result_c_x86_64.swift index be69a0c5e09af..831837ba726cf 100644 --- a/test/IRGen/large_argument_result_c_x86_64.swift +++ b/test/IRGen/large_argument_result_c_x86_64.swift @@ -15,7 +15,7 @@ // CHECK: call void @pass_and_return(ptr {{.*}} [[CALL_ALLOCA]], ptr nonnull byval{{.*}} %0, ptr nonnull byval{{.*}} %0) // CHECK: call {{.*}} @swift_allocObject // CHECK: [[BOX:%.*]] = {{.*}}call noalias ptr @swift_allocObject( -// CHECK: [[ADDR_IN_BOX:%.*]] = getelementptr inbounds i8, ptr [[BOX]], i64 16 +// CHECK: [[ADDR_IN_BOX:%.*]] = getelementptr inbounds{{.*}} i8, ptr [[BOX]], i64 16 // CHECK: call void @llvm.memcpy.p0.p0.i64(ptr {{.*}} [[ADDR_IN_BOX]], ptr {{.*}} [[CALL_ALLOCA]], i64 128, i1 false) // CHECK: call void @llvm.lifetime.end.p0(i64 128, ptr nonnull [[CALL_ALLOCA]]) public func runTest(_ l : large_thing) { diff --git a/test/IRGen/lazy_globals.swift b/test/IRGen/lazy_globals.swift index 457e33fbfaf81..1998c17726a77 100644 --- a/test/IRGen/lazy_globals.swift +++ b/test/IRGen/lazy_globals.swift @@ -34,7 +34,7 @@ var (x, y, z) = (1, 2, 3) // CHECK: define hidden swiftcc i64 @"$s12lazy_globals4getXSiyF"() {{.*}} { // CHECK: entry: // CHECK: %0 = call swiftcc ptr @"$s12lazy_globals1xSivau"() -// CHECK: %._value = getelementptr inbounds %TSi, ptr %0, i32 0, i32 0 +// CHECK: %._value = getelementptr inbounds{{.*}} %TSi, ptr %0, i32 0, i32 0 // CHECK: [[V:%.*]] = load i64, ptr %._value, align 8 // CHECK: ret i64 [[V]] // CHECK: } diff --git a/test/IRGen/lazy_multi_file.swift b/test/IRGen/lazy_multi_file.swift index 7e53cbd4d6833..95444fc142e8d 100644 --- a/test/IRGen/lazy_multi_file.swift +++ b/test/IRGen/lazy_multi_file.swift @@ -16,7 +16,7 @@ class Subclass : LazyContainerClass { // // 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 + // 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..84dd8e1d6f9bf 100644 --- a/test/IRGen/lifetime.sil +++ b/test/IRGen/lifetime.sil @@ -21,7 +21,7 @@ bb0(%x : $*T): // CHECK-arm64e-NEXT: ptrtoint ptr [[VWT_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[VWT:%.*]] = inttoptr i64 {{%.*}} to ptr -// CHECK-NEXT: [[SIZE_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 8 +// CHECK-NEXT: [[SIZE_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 8 // CHECK-NEXT: [[SIZE:%.*]] = load [[INT]], ptr [[SIZE_ADDR]] // CHECK-NEXT: [[Y_ALLOCA:%.*]] = alloca i8, {{.*}} [[SIZE]], align 16 // CHECK-NEXT: call void @llvm.lifetime.start.p0({{(i32|i64)}} -1, ptr [[Y_ALLOCA]]) @@ -61,7 +61,7 @@ bb0(%x : $*T): // CHECK-arm64e-NEXT: ptrtoint ptr [[VWT_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[VWT:%.*]] = inttoptr i64 {{%.*}} to ptr -// CHECK-NEXT: [[SIZE_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 8 +// CHECK-NEXT: [[SIZE_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 8 // CHECK-NEXT: [[SIZE:%.*]] = load [[INT]], ptr [[SIZE_ADDR]] // CHECK-NEXT: [[Y_ALLOCA:%.*]] = alloca i8, {{.*}} [[SIZE]], align 16 // CHECK-NEXT: call void @llvm.lifetime.start.p0({{(i32|i64)}} -1, ptr [[Y_ALLOCA]]) diff --git a/test/IRGen/mixed_mode_class_with_unimportable_fields.swift b/test/IRGen/mixed_mode_class_with_unimportable_fields.swift index 9bd7f2bd40a94..8b64e7cba224f 100644 --- a/test/IRGen/mixed_mode_class_with_unimportable_fields.swift +++ b/test/IRGen/mixed_mode_class_with_unimportable_fields.swift @@ -36,9 +36,9 @@ public func accessFinalFields(of holder: ButtHolder) -> (Any, Any) { // ButtHolder.y is correctly imported in Swift 5 mode, so we can use fixed offsets. - // CHECK-V5: [[OFFSET:%.*]] = getelementptr inbounds %T14UsingObjCStuff10ButtHolderC, ptr %2, i32 0, i32 1 + // CHECK-V5: [[OFFSET:%.*]] = getelementptr inbounds{{.*}} %T14UsingObjCStuff10ButtHolderC, ptr %2, i32 0, i32 1 - // CHECK-V5: [[OFFSET:%.*]] = getelementptr inbounds %T14UsingObjCStuff10ButtHolderC, ptr %2, i32 0, i32 3 + // CHECK-V5: [[OFFSET:%.*]] = getelementptr inbounds{{.*}} %T14UsingObjCStuff10ButtHolderC, ptr %2, i32 0, i32 3 return (holder.x, holder.z) } @@ -63,11 +63,11 @@ public func accessFinalFields(ofSub holder: SubButtHolder) -> (Any, Any, Any) { // ButtHolder.y is correctly imported in Swift 5 mode, so we can use fixed offsets. - // CHECK-V5: [[OFFSET:%.*]] = getelementptr inbounds %T14UsingObjCStuff10ButtHolderC, ptr %3, i32 0, i32 1 + // CHECK-V5: [[OFFSET:%.*]] = getelementptr inbounds{{.*}} %T14UsingObjCStuff10ButtHolderC, ptr %3, i32 0, i32 1 - // CHECK-V5: [[OFFSET:%.*]] = getelementptr inbounds %T14UsingObjCStuff10ButtHolderC, ptr %3, i32 0, i32 3 + // CHECK-V5: [[OFFSET:%.*]] = getelementptr inbounds{{.*}} %T14UsingObjCStuff10ButtHolderC, ptr %3, i32 0, i32 3 - // CHECK-V5: [[OFFSET:%.*]] = getelementptr inbounds %T4main13SubButtHolderC, ptr %3, i32 0, i32 4 + // CHECK-V5: [[OFFSET:%.*]] = getelementptr inbounds{{.*}} %T4main13SubButtHolderC, ptr %3, i32 0, i32 4 return (holder.x, holder.z, holder.w) } diff --git a/test/IRGen/moveonly_deinits.swift b/test/IRGen/moveonly_deinits.swift index b79317436b508..3c30170943138 100644 --- a/test/IRGen/moveonly_deinits.swift +++ b/test/IRGen/moveonly_deinits.swift @@ -66,11 +66,11 @@ var value: Bool { false } // IR: br i1 {{%.*}}, label %[[BB1:[0-9]+]], label %[[BB2:[0-9]+]] // // IR: [[BB1]]: -// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], ptr [[ALLOCA]], i32 0, i32 0 -// IR-NEXT: [[GEP2:%.*]] = getelementptr inbounds %TSi, ptr [[GEP]], i32 0, i32 0 +// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} [[TYPE]], ptr [[ALLOCA]], i32 0, i32 0 +// IR-NEXT: [[GEP2:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[GEP]], i32 0, i32 0 // IR-NEXT: [[LHS:%.*]] = load i64, ptr [[GEP2]] -// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], ptr [[ALLOCA]], i32 0, i32 1 -// IR-NEXT: [[GEP2:%.*]] = getelementptr inbounds %TSi, ptr [[GEP]], i32 0, i32 0 +// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} [[TYPE]], ptr [[ALLOCA]], i32 0, i32 1 +// IR-NEXT: [[GEP2:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[GEP]], i32 0, i32 0 // IR-NEXT: [[RHS:%.*]] = load i64, ptr [[GEP2]] // IR-NEXT: call swiftcc void @"$s16moveonly_deinits27consumeIntPairWithoutDeinityyAA0defG0VnF"(i64 [[LHS]], i64 [[RHS]]) // IR-NEXT: br label %[[CONT:[0-9]+]] @@ -95,21 +95,21 @@ public func testIntPairWithoutDeinit() { // IR: br i1 {{%.*}}, label %[[BB1:[0-9]+]], label %[[BB2:[0-9]+]] // // IR: [[BB1]]: -// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], ptr [[ALLOCA]], i32 0, i32 0 -// IR-NEXT: [[GEP2:%.*]] = getelementptr inbounds %TSi, ptr [[GEP]], i32 0, i32 0 +// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} [[TYPE]], ptr [[ALLOCA]], i32 0, i32 0 +// IR-NEXT: [[GEP2:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[GEP]], i32 0, i32 0 // IR-NEXT: [[LHS:%.*]] = load i64, ptr [[GEP2]] -// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], ptr [[ALLOCA]], i32 0, i32 1 -// IR-NEXT: [[GEP2:%.*]] = getelementptr inbounds %TSi, ptr [[GEP]], i32 0, i32 0 +// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} [[TYPE]], ptr [[ALLOCA]], i32 0, i32 1 +// IR-NEXT: [[GEP2:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[GEP]], i32 0, i32 0 // IR-NEXT: [[RHS:%.*]] = load i64, ptr [[GEP2]] // IR-NEXT: call swiftcc void @"$s16moveonly_deinits24consumeIntPairWithDeinityyAA0defG0VnF"( // IR-NEXT: br label %[[CONT:[0-9]+]] // // IR: [[BB2]]: -// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], ptr [[ALLOCA]], i32 0, i32 0 -// IR-NEXT: [[GEP2:%.*]] = getelementptr inbounds %TSi, ptr [[GEP]], i32 0, i32 0 +// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} [[TYPE]], ptr [[ALLOCA]], i32 0, i32 0 +// IR-NEXT: [[GEP2:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[GEP]], i32 0, i32 0 // IR-NEXT: [[LHS:%.*]] = load i64, ptr [[GEP2]] -// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], ptr [[ALLOCA]], i32 0, i32 1 -// IR-NEXT: [[GEP2:%.*]] = getelementptr inbounds %TSi, ptr [[GEP]], i32 0, i32 0 +// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} [[TYPE]], ptr [[ALLOCA]], i32 0, i32 1 +// IR-NEXT: [[GEP2:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[GEP]], i32 0, i32 0 // IR-NEXT: [[RHS:%.*]] = load i64, ptr [[GEP2]] // IR-NEXT: call swiftcc void @"$s16moveonly_deinits17IntPairWithDeinitVfD"(i64 [[LHS]], i64 [[RHS]]) // IR-NEXT: br label %[[CONT]] @@ -130,9 +130,9 @@ public func testIntPairWithDeinit() { // IR: br i1 {{%.*}}, label %[[BB1:[0-9]+]], label %[[BB2:[0-9]+]] // // IR: [[BB1]]: -// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], ptr [[ALLOCA]], i32 0, i32 0 +// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} [[TYPE]], ptr [[ALLOCA]], i32 0, i32 0 // IR-NEXT: [[LHS:%.*]] = load ptr, ptr [[GEP]] -// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], ptr [[ALLOCA]], i32 0, i32 1 +// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} [[TYPE]], ptr [[ALLOCA]], i32 0, i32 1 // IR-NEXT: [[RHS:%.*]] = load ptr, ptr [[GEP]] // IR-NEXT: call swiftcc void @"$s16moveonly_deinits29consumeKlassPairWithoutDeinityyAA0defG0VnF"(ptr [[LHS]], ptr [[RHS]]) // IR-NEXT: br label %[[CONT:[0-9]+]] @@ -157,17 +157,17 @@ public func testKlassPairWithoutDeinit() { // IR: br i1 {{%.*}}, label %[[BB1:[0-9]+]], label %[[BB2:[0-9]+]] // // IR: [[BB1]]: -// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], ptr [[ALLOCA]], i32 0, i32 0 +// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} [[TYPE]], ptr [[ALLOCA]], i32 0, i32 0 // IR-NEXT: [[LHS:%.*]] = load ptr, ptr [[GEP]] -// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], ptr [[ALLOCA]], i32 0, i32 1 +// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} [[TYPE]], ptr [[ALLOCA]], i32 0, i32 1 // IR-NEXT: [[RHS:%.*]] = load ptr, ptr [[GEP]] // IR-NEXT: call swiftcc void @"$s16moveonly_deinits26consumeKlassPairWithDeinityyAA0defG0VnF"(ptr [[LHS]], ptr [[RHS]]) // IR-NEXT: br label %[[CONT:[0-9]+]] // // IR: [[BB2]]: -// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], ptr [[ALLOCA]], i32 0, i32 0 +// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} [[TYPE]], ptr [[ALLOCA]], i32 0, i32 0 // IR-NEXT: [[LHS:%.*]] = load ptr, ptr [[GEP]] -// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], ptr [[ALLOCA]], i32 0, i32 1 +// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} [[TYPE]], ptr [[ALLOCA]], i32 0, i32 1 // IR-NEXT: [[RHS:%.*]] = load ptr, ptr [[GEP]] // IR-NEXT: call swiftcc void @"$s16moveonly_deinits19KlassPairWithDeinitVfD"(ptr [[LHS]], ptr [[RHS]]) // IR-NEXT: br label %[[CONT]] @@ -230,7 +230,7 @@ func consumeKlassEnumPairWithDeinit(_ x: __owned KlassEnumPairWithDeinit) { } // // IR: [[BB1]]: // IR-NEXT: [[LHS:%.*]] = load i64, ptr [[ALLOCA]] -// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], ptr [[ALLOCA]], i32 0, i32 1 +// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} [[TYPE]], ptr [[ALLOCA]], i32 0, i32 1 // IR-NEXT: [[RHS:%.*]] = load i8, ptr [[GEP]] // IR-NEXT: call swiftcc void @"$s16moveonly_deinits31consumeIntEnumPairWithoutDeinityyAA0defgH0OnF"(i64 [[LHS]], i8 [[RHS]]) // IR-NEXT: br label %[[CONT:[0-9]+]] @@ -255,14 +255,14 @@ public func testIntEnumPairWithoutDeinit() { // // IR: [[BB1]]: // IR-NEXT: [[LHS:%.*]] = load i64, ptr [[ALLOCA]] -// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], ptr [[ALLOCA]], i32 0, i32 1 +// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} [[TYPE]], ptr [[ALLOCA]], i32 0, i32 1 // IR-NEXT: [[RHS:%.*]] = load i8, ptr [[GEP]] // IR-NEXT: call swiftcc void @"$s16moveonly_deinits28consumeIntEnumPairWithDeinityyAA0defgH0OnF"(i64 [[LHS]], i8 [[RHS]]) // IR-NEXT: br label %[[CONT:[0-9]+]] // // IR: [[BB2]]: // IR-NEXT: [[LHS:%.*]] = load i64, ptr [[ALLOCA]] -// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds [[TYPE]], ptr [[ALLOCA]], i32 0, i32 1 +// IR-NEXT: [[GEP:%.*]] = getelementptr inbounds{{.*}} [[TYPE]], ptr [[ALLOCA]], i32 0, i32 1 // IR-NEXT: [[RHS:%.*]] = load i8, ptr [[GEP]] // IR-NEXT: call swiftcc void @"$s16moveonly_deinits21IntEnumPairWithDeinitOfD"(i64 [[LHS]], i8 [[RHS]]) // IR-NEXT: br label %[[CONT]] diff --git a/test/IRGen/moveonly_split_module_source_deinit.swift b/test/IRGen/moveonly_split_module_source_deinit.swift index a9b1836263f0d..e9e1035d52683 100644 --- a/test/IRGen/moveonly_split_module_source_deinit.swift +++ b/test/IRGen/moveonly_split_module_source_deinit.swift @@ -15,9 +15,9 @@ // Make sure that in the other module, we do call the deinit directly from the value witness. // DEFINING_MODULE-LABEL: define internal void @"$s6server8MoveOnlyVwxx"(ptr noalias %object, ptr %MoveOnly) {{.*}} { -// DEFINING_MODULE: [[VAR:%.*]] = getelementptr inbounds {{%.*}}, ptr %object +// DEFINING_MODULE: [[VAR:%.*]] = getelementptr inbounds{{.*}} {{%.*}}, ptr %object // DEFINING_MODULE: [[LOADED_VAR:%.*]] = load ptr, ptr [[VAR]], -// DEFINING_MODULE: [[VAR2:%.*]] = getelementptr inbounds {{%.*}}, ptr %object +// DEFINING_MODULE: [[VAR2:%.*]] = getelementptr inbounds{{.*}} {{%.*}}, ptr %object // DEFINING_MODULE: [[LOADED_VAR2:%.*]] = load ptr, ptr [[VAR2]], // DEFINING_MODULE: call swiftcc void @"$s6server8MoveOnlyVfD"(ptr [[LOADED_VAR]], ptr [[LOADED_VAR2]]) @main diff --git a/test/IRGen/moveonly_value_functions.sil b/test/IRGen/moveonly_value_functions.sil index 2c3e4625ab694..f7f2eae7bf0d4 100644 --- a/test/IRGen/moveonly_value_functions.sil +++ b/test/IRGen/moveonly_value_functions.sil @@ -29,7 +29,7 @@ sil @deinit_count : $@convention(method) <Ï„_0_0 where Ï„_0_0 : ~Copyable> (move // CHECK: entry: // CHECK: [[CELL_VWT_ADDR:%[^,]+]] = getelementptr inbounds ptr, ptr %"_Cell", [[INT]] -1 // CHECK: %"_Cell.valueWitnesses" = load ptr, ptr [[CELL_VWT_ADDR]] -// CHECK: [[CELL_SIZE_ADDR:%[^,]+]] = getelementptr inbounds %swift.vwtable +// CHECK: [[CELL_SIZE_ADDR:%[^,]+]] = getelementptr inbounds{{.*}} %swift.vwtable // : ptr %"_Cell.valueWitnesses", // CHECK-SAME: i32 0 // CHECK-SAME: i32 8 diff --git a/test/IRGen/multi_file_resilience.swift b/test/IRGen/multi_file_resilience.swift index c3742a80a90da..4538ea2aed631 100644 --- a/test/IRGen/multi_file_resilience.swift +++ b/test/IRGen/multi_file_resilience.swift @@ -23,7 +23,7 @@ // CHECK-arm64e: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[VWT:%.*]] = inttoptr i64 {{%.*}} to ptr // Allocate 'copy'. -// CHECK: [[SIZE_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 8 +// CHECK: [[SIZE_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 8 // CHECK: [[SIZE:%.*]] = load [[INT]], ptr [[SIZE_ADDR]] // CHECK: [[ALLOCA:%.*]] = alloca i8, [[INT]] [[SIZE]], // Perform 'initializeWithCopy' via the VWT instead of trying to inline it. diff --git a/test/IRGen/multi_module_resilience.swift b/test/IRGen/multi_module_resilience.swift index 97fb2a0928d89..74616044c9eaf 100644 --- a/test/IRGen/multi_module_resilience.swift +++ b/test/IRGen/multi_module_resilience.swift @@ -22,7 +22,7 @@ import OtherModule // CHECK-arm64e: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[VWT:%.*]] = inttoptr i64 {{%.*}} to ptr // Allocate 'copy'. -// CHECK: [[SIZE_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 8 +// CHECK: [[SIZE_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 8 // CHECK: [[SIZE:%.*]] = load [[INT]], ptr [[SIZE_ADDR]] // CHECK: [[ALLOCA:%.*]] = alloca i8, [[INT]] [[SIZE]], // Perform 'initializeWithCopy' via the VWT instead of trying to inline it. @@ -43,7 +43,7 @@ public func copyFoo(foo: Foo) -> Foo { // CHECK-arm64e: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[VWT:%.*]] = inttoptr i64 {{%.*}} to ptr // Allocate 'copy'. -// CHECK: [[SIZE_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 8 +// CHECK: [[SIZE_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 8 // CHECK: [[SIZE:%.*]] = load [[INT]], ptr [[SIZE_ADDR]] // CHECK: [[ALLOCA:%.*]] = alloca i8, [[INT]] [[SIZE]], // Perform 'initializeWithCopy' via the VWT instead of trying to inline it. diff --git a/test/IRGen/multi_payload_shifting.swift b/test/IRGen/multi_payload_shifting.swift index 253f6c5467d71..1ef8792f461b1 100644 --- a/test/IRGen/multi_payload_shifting.swift +++ b/test/IRGen/multi_payload_shifting.swift @@ -25,7 +25,7 @@ enum Node { } // CHECK: define internal i32 @"$s22multi_payload_shifting4NodeOwet"(ptr noalias %value, i32 %numEmptyCases, ptr %Node) -// CHECK: [[ADDR:%.*]] = getelementptr inbounds { i64, i64, i64, i8 }, ptr {{.*}}, i32 0, i32 3 +// CHECK: [[ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64, i64, i8 }, ptr {{.*}}, i32 0, i32 3 // CHECK: [[BYTE:%.*]] = load i8, ptr [[ADDR]] // Make sure we zext before we shift. // CHECK: [[ZEXT:%.*]] = zext i8 [[BYTE]] to i32 diff --git a/test/IRGen/non_fixed_return.swift b/test/IRGen/non_fixed_return.swift index a2ae029bcddb9..b4c3ee64f0ace 100644 --- a/test/IRGen/non_fixed_return.swift +++ b/test/IRGen/non_fixed_return.swift @@ -64,8 +64,8 @@ func create(_ t: T) -> C { // Make sure we don't loose the stores for the optional UInt32? in optimize mode. // OPT-LABEL: define hidden swiftcc void @"$s16non_fixed_return1CVACyxGycfC"(ptr noalias sret(%swift.opaque) %0 // OPT: store i32 0, ptr [[BASE:%[0-9]+]] -// OPT: [[ADDR2:%.*]] = getelementptr inbounds i8, ptr [[BASE]], i64 4 +// OPT: [[ADDR2:%.*]] = getelementptr inbounds{{.*}} i8, ptr [[BASE]], i64 4 // OPT: store i8 1, ptr [[ADDR2]] -// OPT: [[ADDR4:%.*]] = getelementptr inbounds i8, ptr [[BASE]], i64 8 +// OPT: [[ADDR4:%.*]] = getelementptr inbounds{{.*}} i8, ptr [[BASE]], i64 8 // OPT: call void @llvm.memset.p0.i64(ptr {{.*}}[[ADDR4]], i8 0, i64 16, i1 false) // OPT: ret void diff --git a/test/IRGen/objc_block.sil b/test/IRGen/objc_block.sil index 277d3488cd90e..7133f42ba82e3 100644 --- a/test/IRGen/objc_block.sil +++ b/test/IRGen/objc_block.sil @@ -16,7 +16,7 @@ entry(%b : $@convention(block) (Foo) -> Foo, %x : $Foo): } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @call_block(ptr %0, ptr %1) {{.*}} { // CHECK: entry: -// CHECK: [[T0:%.*]] = getelementptr inbounds %objc_block, ptr %0, i32 0, i32 3 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr %0, i32 0, i32 3 // CHECK: [[T1:%.*]] = load ptr, ptr [[T0]] // CHECK: [[T4:%.*]] = call ptr [[T1]](ptr %0, ptr %1) // CHECK: ret ptr [[T4]] diff --git a/test/IRGen/objc_block_storage.sil b/test/IRGen/objc_block_storage.sil index 5ecd6d590d1a5..64f23214c4d44 100644 --- a/test/IRGen/objc_block_storage.sil +++ b/test/IRGen/objc_block_storage.sil @@ -40,7 +40,7 @@ import gizmo // 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: %1 = getelementptr inbounds{{.*}} { %objc_block, ptr }, ptr %0, i32 0, i32 1 // CHECK-NEXT: %2 = load ptr, ptr %1, align 8 // CHECK-NEXT: ret ptr %2 // CHECK-NEXT: } @@ -53,7 +53,7 @@ entry(%0 : $*@block_storage Builtin.RawPointer): // 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: %1 = getelementptr inbounds{{.*}} { %objc_block, fp128 }, ptr %0, i32 0, i32 1 // CHECK-NEXT: %2 = load fp128, ptr %1, align 16 // CHECK-NEXT: ret fp128 %2 // CHECK-NEXT: } @@ -65,17 +65,17 @@ entry(%0 : $*@block_storage Builtin.FPIEEE128): } // 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: [[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]] -// CHECK: [[T0:%.*]] = getelementptr inbounds %objc_block, ptr [[HEADER]], i32 0, i32 1 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr [[HEADER]], i32 0, i32 1 // -- 0x4000_0000 -- HAS_SIGNATURE // CHECK: store i32 1073741824, ptr [[T0]] -// CHECK: [[T0:%.*]] = getelementptr inbounds %objc_block, ptr [[HEADER]], i32 0, i32 2 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr [[HEADER]], i32 0, i32 2 // CHECK: store i32 0, ptr [[T0]] -// CHECK: [[T0:%.*]] = getelementptr inbounds %objc_block, ptr [[HEADER]], i32 0, i32 3 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr [[HEADER]], i32 0, i32 3 // CHECK: store ptr @invoke_trivial, ptr [[T0]] -// CHECK: [[T0:%.*]] = getelementptr inbounds %objc_block, ptr [[HEADER]], i32 0, i32 4 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr [[HEADER]], i32 0, i32 4 // CHECK: store ptr [[TRIVIAL_BLOCK_DESCRIPTOR]], ptr [[T0]] // CHECK: ret ptr %0 sil @init_block_header_trivial : $@convention(thin) (@inout_aliasable @block_storage Builtin.RawPointer) -> @convention(block) () -> () { @@ -86,7 +86,7 @@ entry(%0 : $*@block_storage Builtin.RawPointer): } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} void @invoke_trivial(ptr %0) {{.*}} { -// CHECK: %1 = getelementptr inbounds { %objc_block, ptr }, ptr %0, i32 0, i32 1 +// CHECK: %1 = getelementptr inbounds{{.*}} { %objc_block, ptr }, ptr %0, i32 0, i32 1 sil @invoke_trivial : $@convention(c) (@inout_aliasable @block_storage Builtin.RawPointer) -> () { entry(%0 : $*@block_storage Builtin.RawPointer): %c = project_block_storage %0 : $*@block_storage Builtin.RawPointer @@ -111,16 +111,16 @@ entry(%0 : $*@block_storage Builtin.RawPointer, %1 : $Int): // 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: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr [[HEADER]], i32 0, i32 0 // CHECK: store ptr [[BLOCK_ISA]], ptr [[T0]] -// CHECK: [[T0:%.*]] = getelementptr inbounds %objc_block, ptr [[HEADER]], i32 0, i32 1 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr [[HEADER]], i32 0, i32 1 // -- 0x4200_0000 -- HAS_SIGNATURE, HAS_COPY_DISPOSE // CHECK: store i32 1107296256, ptr [[T0]] -// CHECK: [[T0:%.*]] = getelementptr inbounds %objc_block, ptr [[HEADER]], i32 0, i32 2 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr [[HEADER]], i32 0, i32 2 // CHECK: store i32 0, ptr [[T0]] -// CHECK: [[T0:%.*]] = getelementptr inbounds %objc_block, ptr [[HEADER]], i32 0, i32 3 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr [[HEADER]], i32 0, i32 3 // CHECK: store ptr @invoke_nontrivial, ptr [[T0]] -// CHECK: [[T0:%.*]] = getelementptr inbounds %objc_block, ptr [[HEADER]], i32 0, i32 4 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr [[HEADER]], i32 0, i32 4 // CHECK: store ptr [[NONTRIVIAL_BLOCK_DESCRIPTOR]], ptr [[T0]] sil @init_block_header_nontrivial : $@convention(thin) (@inout_aliasable @block_storage Builtin.NativeObject) -> @convention(block) () -> () { entry(%0 : $*@block_storage Builtin.NativeObject): @@ -131,8 +131,8 @@ entry(%0 : $*@block_storage Builtin.NativeObject): // CHECK: define internal void [[NONTRIVIAL_BLOCK_COPY]] // CHECK-NEXT: entry: -// CHECK-NEXT: %2 = getelementptr inbounds { %objc_block, ptr }, ptr %0, i32 0, i32 1 -// CHECK-NEXT: %3 = getelementptr inbounds { %objc_block, ptr }, ptr %1, i32 0, i32 1 +// CHECK-NEXT: %2 = getelementptr inbounds{{.*}} { %objc_block, ptr }, ptr %0, i32 0, i32 1 +// CHECK-NEXT: %3 = getelementptr inbounds{{.*}} { %objc_block, ptr }, ptr %1, i32 0, i32 1 // CHECK-NEXT: %4 = load ptr, ptr %3, align 8 // CHECK-NEXT: call ptr @swift_retain(ptr returned %4) {{#[0-9]+}} // CHECK-NEXT: store ptr %4, ptr %2, align 8 @@ -140,7 +140,7 @@ entry(%0 : $*@block_storage Builtin.NativeObject): // CHECK: define internal void [[NONTRIVIAL_BLOCK_DISPOSE]] // CHECK-NEXT: entry: -// CHECK-NEXT: %1 = getelementptr inbounds { %objc_block, ptr }, ptr %0, i32 0, i32 1 +// CHECK-NEXT: %1 = getelementptr inbounds{{.*}} { %objc_block, ptr }, ptr %0, i32 0, i32 1 // CHECK-NEXT: %toDestroy = load ptr, ptr %1, align 8 // CHECK-NEXT: call void @swift_release(ptr %toDestroy) {{#[0-9]+}} // CHECK-NEXT: ret void @@ -149,16 +149,16 @@ sil public_external @invoke_nontrivial : $@convention(c) (@inout_aliasable @bloc // 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: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr [[HEADER]], i32 0, i32 0 // CHECK: store ptr [[BLOCK_ISA]], ptr [[T0]] -// CHECK: [[T0:%.*]] = getelementptr inbounds %objc_block, ptr [[HEADER]], i32 0, i32 1 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr [[HEADER]], i32 0, i32 1 // -- 0x6000_0000 -- HAS_STRET, HAS_SIGNATURE // CHECK: store i32 1610612736, ptr [[T0]] -// CHECK: [[T0:%.*]] = getelementptr inbounds %objc_block, ptr [[HEADER]], i32 0, i32 2 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr [[HEADER]], i32 0, i32 2 // CHECK: store i32 0, ptr [[T0]] -// CHECK: [[T0:%.*]] = getelementptr inbounds %objc_block, ptr [[HEADER]], i32 0, i32 3 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr [[HEADER]], i32 0, i32 3 // CHECK: store ptr @invoke_stret, ptr [[T0]] -// CHECK: [[T0:%.*]] = getelementptr inbounds %objc_block, ptr [[HEADER]], i32 0, i32 4 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} %objc_block, ptr [[HEADER]], i32 0, i32 4 // CHECK: store ptr [[STRET_BLOCK_DESCRIPTOR]], ptr [[T0]] sil @init_block_header_stret : $@convention(thin) (@inout_aliasable @block_storage Builtin.RawPointer) -> @convention(block) () -> NSRect { entry(%0 : $*@block_storage Builtin.RawPointer): diff --git a/test/IRGen/objc_dealloc.sil b/test/IRGen/objc_dealloc.sil index aecdf14bc3174..54a53824a7ecd 100644 --- a/test/IRGen/objc_dealloc.sil +++ b/test/IRGen/objc_dealloc.sil @@ -94,9 +94,9 @@ bb0(%0 : @unowned $SwiftGizmo): // Call super -dealloc. // CHECK: [[TMP:%.*]] = call swiftcc %swift.metadata_response @"$s12objc_dealloc10SwiftGizmoCMa"(i64 0) // CHECK-NEXT: [[T0:%.*]] = extractvalue %swift.metadata_response [[TMP]], 0 - // CHECK-NEXT: [[OBJC_SUPER_RECEIVER:%[a-zA-Z0-9]+]] = getelementptr inbounds %objc_super, ptr [[OBJC_SUPER]], i32 0, i32 0 + // CHECK-NEXT: [[OBJC_SUPER_RECEIVER:%[a-zA-Z0-9]+]] = getelementptr inbounds{{.*}} %objc_super, ptr [[OBJC_SUPER]], i32 0, i32 0 // CHECK-NEXT: store ptr %0, ptr [[OBJC_SUPER_RECEIVER]], align 8 - // CHECK-NEXT: [[OBJC_SUPER_CLASS:%[a-zA-Z0-9]+]] = getelementptr inbounds %objc_super, ptr [[OBJC_SUPER]], i32 0, i32 1 + // CHECK-NEXT: [[OBJC_SUPER_CLASS:%[a-zA-Z0-9]+]] = getelementptr inbounds{{.*}} %objc_super, ptr [[OBJC_SUPER]], i32 0, i32 1 // CHECK-NEXT: store ptr [[T0]], ptr [[OBJC_SUPER_CLASS]], align 8 // CHECK-NEXT: [[DEALLOC_SEL:%[a-zA-Z0-9]+]] = load ptr, ptr @"\01L_selector(dealloc)", align 8 // CHECK-NEXT: call void @objc_msgSendSuper2(ptr [[OBJC_SUPER]], ptr [[DEALLOC_SEL]]) diff --git a/test/IRGen/objc_extensions.swift b/test/IRGen/objc_extensions.swift index 059ca2df9c36a..a9874b87d1412 100644 --- a/test/IRGen/objc_extensions.swift +++ b/test/IRGen/objc_extensions.swift @@ -230,8 +230,8 @@ extension FungingArray { // CHECK-SAME: (ptr %0, ptr swiftself %1) // CHECK: [[ALLOCA:%[^, =]+]] = alloca %Any, align 8 // CHECK: @__swift_instantiateConcreteTypeFromMangledName{{.*}}@"$sSo9NSFunging_pMD"{{.*}}!dbg - // CHECK: {{%[^, =]+}} = getelementptr inbounds %Any, ptr [[ALLOCA]], i32 0, i32 0 - // CHECK: [[ANYBUF:%[^, =]+]] = getelementptr inbounds %Any, ptr [[ALLOCA]], i32 0, i32 0 + // CHECK: {{%[^, =]+}} = getelementptr inbounds{{.*}} %Any, ptr [[ALLOCA]], i32 0, i32 0 + // CHECK: [[ANYBUF:%[^, =]+]] = getelementptr inbounds{{.*}} %Any, ptr [[ALLOCA]], i32 0, i32 0 // CHECK: [[BUFPTR:%[^, =]+]] = {{.*}} [[ANYBUF]] // CHECK: store {{.*}} %0, {{.*}} [[BUFPTR]] // CHECK: call swiftcc void @"$s15objc_extensions11opaquePrintyyypF"(ptr {{.*}} [[ALLOCA]]) @@ -249,8 +249,8 @@ extension FungingArray { // CHECK: [[ALLOCA:%[^, =]+]] = alloca %Any, align 8 // CHECK: @__swift_instantiateConcreteTypeFromMangledName{{.*}}@"$sSo9NSFunging_pMD"{{.*}}!dbg // CHECK: [[OBJC_CLASS:%[^, =]+]] = call ptr @swift_getObjCClassFromMetadata(ptr %0) - // CHECK: {{%[^, =]+}} = getelementptr inbounds %Any, ptr [[ALLOCA]], i32 0, i32 0 - // CHECK: [[ANYBUF:%[^, =]+]] = getelementptr inbounds %Any, ptr [[ALLOCA]], i32 0, i32 0 + // CHECK: {{%[^, =]+}} = getelementptr inbounds{{.*}} %Any, ptr [[ALLOCA]], i32 0, i32 0 + // CHECK: [[ANYBUF:%[^, =]+]] = getelementptr inbounds{{.*}} %Any, ptr [[ALLOCA]], i32 0, i32 0 // CHECK: [[BUFPTR:%[^, =]+]] = {{.*}} [[ANYBUF]] // CHECK: store {{.*}} [[OBJC_CLASS]], {{.*}} [[BUFPTR]] // CHECK: call swiftcc void @"$s15objc_extensions11opaquePrintyyypF"(ptr {{.*}} [[ALLOCA]]) diff --git a/test/IRGen/objc_implementation.swift b/test/IRGen/objc_implementation.swift index 844ef699cbc0d..6b1384eeb8de5 100644 --- a/test/IRGen/objc_implementation.swift +++ b/test/IRGen/objc_implementation.swift @@ -357,7 +357,7 @@ public func fn(impl: ImplClass, swiftSub: SwiftSubclass) { // // This function should directly gather the field sizes and invoke the metadata update. // CHECK: %classFields = alloca [4 x ptr] -// CHECK: [[FIELDS_ARRAY:%[0-9]+]] = getelementptr inbounds [4 x ptr], ptr %classFields, i32 0, i32 0 +// CHECK: [[FIELDS_ARRAY:%[0-9]+]] = getelementptr inbounds{{.*}} [4 x ptr], ptr %classFields, i32 0, i32 0 // CHECK: store ptr getelementptr inbounds (ptr, ptr @"$sBi32_WV", i32 8), ptr {{%[0-9]+}} // CHECK: {{%[0-9]+}} = call swiftcc %swift.metadata_response @"$ss6MirrorVSgMa"(i64 63) // CHECK: store ptr {{%[0-9]+}}, ptr {{%[0-9]+}} diff --git a/test/IRGen/pack_metadata_marker_inserter_onone.swift b/test/IRGen/pack_metadata_marker_inserter_onone.swift index 343dd62131a4d..4a7f79365db7f 100644 --- a/test/IRGen/pack_metadata_marker_inserter_onone.swift +++ b/test/IRGen/pack_metadata_marker_inserter_onone.swift @@ -23,7 +23,7 @@ public struct S { // CHECK-LLVM: [[G_METADATA_PACK:%[^,]+]] = alloca [1 x ptr] // CHECK-LLVM: call void @llvm.lifetime.start.p0( // CHECK-LLVM-SAME: ptr [[G_METADATA_PACK]]) -// CHECK-LLVM: [[G_METADATA_PACK_T_SLOT:%[^,]+]] = getelementptr inbounds [1 x ptr], ptr [[G_METADATA_PACK]] +// CHECK-LLVM: [[G_METADATA_PACK_T_SLOT:%[^,]+]] = getelementptr inbounds{{.*}} [1 x ptr], ptr [[G_METADATA_PACK]] // CHECK-LLVM: store ptr [[T_METADATA]], ptr [[G_METADATA_PACK_T_SLOT]] // CHECK-LLVM: [[G_METADATA_RESPONSE:%[^,]+]] = call swiftcc %swift.metadata_response @"$s35pack_metadata_marker_inserter_onone1GVMa"( // CHECK-LLVM-SAME: ptr [[G_METADATA_PACK]]) @@ -72,7 +72,7 @@ public func consume2S(_: consuming S, _: consuming S) {} // CHECK-LLVM: [[S_METADATA:%[^,]+]] = extractvalue %swift.metadata_response [[S_METADATA_RESPONSE]] // CHECK-LLVM: [[S_VWT_ADDR:%[^,]+]] = getelementptr inbounds ptr, ptr [[S_METADATA]], [[INT]] -1 // CHECK-LLVM: [[S_VWT:%[^,]+]] = load ptr, ptr [[S_VWT_ADDR]] -// CHECK-LLVM: [[S_SIZE_ADDR:%[^,]+]] = getelementptr inbounds %swift.vwtable, ptr +// CHECK-LLVM: [[S_SIZE_ADDR:%[^,]+]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr // HECK-LLVM-SAME: [[S_VWT]] // CHECK-LLVM: [[S_SIZE:%[^,]+]] = load [[INT]], ptr [[S_SIZE_ADDR]] // CHECK-LLVM: [[COPY_1_ADDR:%[^,]+]] = alloca i8, [[INT]] [[S_SIZE]] @@ -83,7 +83,7 @@ public func consume2S(_: consuming S, _: consuming S) {} // CHECK-LLVM-SAME: ptr [[COPY_2_ADDR]]) // CHECK-LLVM: call void @llvm.lifetime.start.p0( // CHECK-LLVM-SAME: ptr [[G_METADATA_PACK]]) -// CHECK-LLVM: [[G_METADATA_PACK_T_SLOT:%[^,]+]] = getelementptr inbounds [1 x ptr], ptr [[G_METADATA_PACK]] +// CHECK-LLVM: [[G_METADATA_PACK_T_SLOT:%[^,]+]] = getelementptr inbounds{{.*}} [1 x ptr], ptr [[G_METADATA_PACK]] // CHECK-LLVM: store ptr [[T_METADATA]], ptr [[G_METADATA_PACK_T_SLOT]] // CHECK-LLVM: [[G_METADATA_RESPONSE:%[^,]+]] = call swiftcc %swift.metadata_response @"$s35pack_metadata_marker_inserter_onone1GVMa"( // CHECK-LLVM-SAME: ptr [[G_METADATA_PACK]]) diff --git a/test/IRGen/package_resilience.swift b/test/IRGen/package_resilience.swift index ab089270ecd9c..c00033a5b2081 100644 --- a/test/IRGen/package_resilience.swift +++ b/test/IRGen/package_resilience.swift @@ -172,22 +172,22 @@ package class ClassWithResilientThenEmpty { // ClassWithResilientProperty.color getter // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc i32 @"$s18package_resilience26ClassWithResilientPropertyC5colors5Int32Vvg"(ptr swiftself %0) -// CHECK: [[FIELD_ADDR:%.*]] = getelementptr inbounds %T18package_resilience26ClassWithResilientPropertyC, ptr %0, -// CHECK-NEXT: [[FIELD_PAYLOAD:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[FIELD_ADDR]], i32 0, i32 0 +// CHECK: [[FIELD_ADDR:%.*]] = getelementptr inbounds{{.*}} %T18package_resilience26ClassWithResilientPropertyC, ptr %0, +// CHECK-NEXT: [[FIELD_PAYLOAD:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[FIELD_ADDR]], i32 0, i32 0 // CHECK-NEXT: [[FIELD_VALUE:%.*]] = load i32, ptr [[FIELD_PAYLOAD]] // CHECK: ret i32 [[FIELD_VALUE]] // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc i32 @"$s18package_resilience33ClassWithResilientlySizedPropertyC5colors5Int32Vvg"(ptr swiftself %0) -// CHECK: [[FIELD_ADDR:%.*]] = getelementptr inbounds %T18package_resilience33ClassWithResilientlySizedPropertyC, ptr %0, -// CHECK-NEXT: [[FIELD_PAYLOAD:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[FIELD_ADDR]], i32 0, i32 0 +// CHECK: [[FIELD_ADDR:%.*]] = getelementptr inbounds{{.*}} %T18package_resilience33ClassWithResilientlySizedPropertyC, ptr %0, +// CHECK-NEXT: [[FIELD_PAYLOAD:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[FIELD_ADDR]], i32 0, i32 0 // CHECK-NEXT: [[FIELD_VALUE:%.*]] = load i32, ptr [[FIELD_PAYLOAD]] // CHECK: ret i32 [[FIELD_VALUE]] // ClassWithIndirectResilientEnum.color getter // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc i32 @"$s18package_resilience30ClassWithIndirectResilientEnumC5colors5Int32Vvg"(ptr swiftself %0) -// CHECK: [[FIELD_PTR:%.*]] = getelementptr inbounds %T18package_resilience30ClassWithIndirectResilientEnumC, ptr %0, i32 0, i32 2 -// CHECK-NEXT: [[FIELD_PAYLOAD:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[FIELD_PTR]], i32 0, i32 0 +// CHECK: [[FIELD_PTR:%.*]] = getelementptr inbounds{{.*}} %T18package_resilience30ClassWithIndirectResilientEnumC, ptr %0, i32 0, i32 2 +// CHECK-NEXT: [[FIELD_PAYLOAD:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[FIELD_PTR]], i32 0, i32 0 // CHECK-NEXT: [[FIELD_VALUE:%.*]] = load i32, ptr [[FIELD_PAYLOAD]] // CHECK-NEXT: ret i32 [[FIELD_VALUE]] @@ -197,8 +197,8 @@ package class ClassWithResilientThenEmpty { // MyResilientChild.field getter // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc i32 @"$s18package_resilience16MyResilientChildC5fields5Int32Vvg"(ptr swiftself %0) -// CHECK: [[FIELD_ADDR:%.*]] = getelementptr inbounds %T18package_resilience16MyResilientChildC, ptr %0, i32 0, i32 2 -// CHECK-NEXT: [[PAYLOAD_ADDR:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[FIELD_ADDR]], i32 0, i32 0 +// CHECK: [[FIELD_ADDR:%.*]] = getelementptr inbounds{{.*}} %T18package_resilience16MyResilientChildC, ptr %0, i32 0, i32 2 +// CHECK-NEXT: [[PAYLOAD_ADDR:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[FIELD_ADDR]], i32 0, i32 0 // CHECK-NEXT: [[RESULT:%.*]] = load i32, ptr [[PAYLOAD_ADDR]] // CHECK: ret i32 [[RESULT]] @@ -232,14 +232,14 @@ public func memoryLayoutDotAlignmentWithResilientStruct() -> Int { // CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s18package_resilience31constructResilientEnumNoPayload14resilient_enum6MediumOyF" package func constructResilientEnumNoPayload() -> Medium { - // CHECK: [[FIELD_PTR:%.*]] = getelementptr inbounds %T14resilient_enum6MediumO, ptr %0, i32 0, i32 1 + // CHECK: [[FIELD_PTR:%.*]] = getelementptr inbounds{{.*}} %T14resilient_enum6MediumO, ptr %0, i32 0, i32 1 // CHECK: ret void return Medium.Paper } // CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s18package_resilience39constructExhaustiveWithResilientMembers14resilient_enum11SimpleShapeOyF" package func constructExhaustiveWithResilientMembers() -> SimpleShape { - // CHECK: [[FIELD_PTR:%.*]] = getelementptr inbounds %T14resilient_enum11SimpleShapeO, ptr %0, i32 0, i32 1 + // CHECK: [[FIELD_PTR:%.*]] = getelementptr inbounds{{.*}} %T14resilient_enum11SimpleShapeO, ptr %0, i32 0, i32 1 // CHECK: ret void return .KleinBottle } diff --git a/test/IRGen/package_resilient_as_public_by_default.swift b/test/IRGen/package_resilient_as_public_by_default.swift index dedf6470da569..ac3dce2659aee 100644 --- a/test/IRGen/package_resilient_as_public_by_default.swift +++ b/test/IRGen/package_resilient_as_public_by_default.swift @@ -87,7 +87,7 @@ public class PublicClassWithPbProperties { // CHECK: define{{.*}} swiftcc {{.*}} @"$s18package_resilience27PublicClassWithPbPropertiesC5colors5Int32Vvg"(ptr swiftself %0) // CHECK: [[OFFSET:%.*]] = load {{i32|i64}}, ptr @"$s18package_resilience27PublicClassWithPbPropertiesC5colors5Int32VvpWvd" // CHECK-NEXT: [[PTR:%.*]] = getelementptr inbounds i8, ptr {{.*}}, {{i32|i64}} [[OFFSET]] -// CHECK-NEXT: [[VALUE:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[PTR]] +// CHECK-NEXT: [[VALUE:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[PTR]] // CHECK-NEXT: [[RET:%.*]] = load {{i32|i64}}, ptr [[VALUE]] // CHECK-NEXT: ret {{i32|i64}} [[RET]] @@ -126,7 +126,7 @@ package class PkgClassWithPublicProperties { // CHECK: define{{.*}} swiftcc {{.*}} @"$s18package_resilience28PkgClassWithPublicPropertiesC5colors5Int32Vvg"(ptr swiftself %0) // CHECK: [[OFFSET:%.*]] = load {{i32|i64}}, ptr @"$s18package_resilience28PkgClassWithPublicPropertiesC5colors5Int32VvpWvd" // CHECK-NEXT: [[PTR:%.*]] = getelementptr inbounds i8, ptr {{.*}}, {{i32|i64}} [[OFFSET]] -// CHECK-NEXT: [[VALUE:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[PTR]] +// CHECK-NEXT: [[VALUE:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[PTR]] // CHECK-NEXT: [[RET:%.*]] = load {{i32|i64}}, ptr [[VALUE]] // CHECK-NEXT: ret {{i32|i64}} [[RET]] @@ -162,7 +162,7 @@ package class PkgWithPackageProperties { // CHECK: define{{.*}} swiftcc {{.*}} @"$s18package_resilience24PkgWithPackagePropertiesC5colors5Int32Vvg"(ptr swiftself %0) // CHECK: [[OFFSET:%.*]] = load {{i32|i64}}, ptr @"$s18package_resilience24PkgWithPackagePropertiesC5colors5Int32VvpWvd" // CHECK-NEXT: [[PTR:%.*]] = getelementptr inbounds i8, ptr {{.*}}, {{i32|i64}} [[OFFSET]] -// CHECK-NEXT: [[VALUE:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[PTR]] +// CHECK-NEXT: [[VALUE:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[PTR]] // CHECK-NEXT: [[RET:%.*]] = load {{i32|i64}}, ptr [[VALUE]] // CHECK-NEXT: ret {{i32|i64}} [[RET]] @@ -182,12 +182,12 @@ public class PublicClassWithFrozenPbProperties { // PublicClassWithFrozenPbProperties.p getter // CHECK: define{{.*}} swiftcc { {{i32|i64}}, {{i32|i64}} } @"$s18package_resilience33PublicClassWithFrozenPbPropertiesC1p16resilient_struct0fC5PointVvg"(ptr swiftself %0) -// CHECK: [[T1:%.*]] = getelementptr inbounds %T18package_resilience33PublicClassWithFrozenPbPropertiesC, ptr {{.*}} -// CHECK-NEXT: [[X:%.*]] = getelementptr inbounds %T16resilient_struct17FrozenPublicPointV, ptr [[T1]] -// CHECK-NEXT: [[XVAL:%.*]] = getelementptr inbounds %TSi, ptr [[X]] +// CHECK: [[T1:%.*]] = getelementptr inbounds{{.*}} %T18package_resilience33PublicClassWithFrozenPbPropertiesC, ptr {{.*}} +// CHECK-NEXT: [[X:%.*]] = getelementptr inbounds{{.*}} %T16resilient_struct17FrozenPublicPointV, ptr [[T1]] +// CHECK-NEXT: [[XVAL:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[X]] // CHECK-NEXT: [[T2:%.*]] = load {{i32|i64}}, ptr [[XVAL]] -// CHECK-NEXT: [[Y:%.*]] = getelementptr inbounds %T16resilient_struct17FrozenPublicPointV, ptr [[T1]] -// CHECK-NEXT: [[YVAL:%.*]] = getelementptr inbounds %TSi, ptr [[Y]] +// CHECK-NEXT: [[Y:%.*]] = getelementptr inbounds{{.*}} %T16resilient_struct17FrozenPublicPointV, ptr [[T1]] +// CHECK-NEXT: [[YVAL:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[Y]] // CHECK-NEXT: [[T3:%.*]] = load {{i32|i64}}, ptr [[YVAL]] // CHECK-NEXT: [[T4:%.*]] = insertvalue {{.*}} undef, {{i32|i64}} [[T2]], 0 // CHECK-NEXT: [[T5:%.*]] = insertvalue {{.*}} [[T4]], {{i32|i64}} [[T3]], 1 @@ -197,8 +197,8 @@ public class PublicClassWithFrozenPbProperties { // PublicClassWithFrozenPbProperties.color getter // CHECK: define{{.*}} swiftcc {{i32|64}} @"$s18package_resilience33PublicClassWithFrozenPbPropertiesC5colors5Int32Vvg"(ptr swiftself %0) -// CHECK: [[T1:%.*]] = getelementptr inbounds %T18package_resilience33PublicClassWithFrozenPbPropertiesC, ptr {{.*}} -// CHECK-NEXT: [[VAL:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[T1]] +// CHECK: [[T1:%.*]] = getelementptr inbounds{{.*}} %T18package_resilience33PublicClassWithFrozenPbPropertiesC, ptr {{.*}} +// CHECK-NEXT: [[VAL:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[T1]] // CHECK-NEXT: [[T2:%.*]] = load {{i32|i64}}, ptr [[VAL]] // CHECK-NEXT: ret {{i32|i64}} [[T2]] @@ -219,12 +219,12 @@ package class PkgClassWithFrozenPublicProperties { // PkgClassWithFrozenPublicProperties.p getter // CHECK: define{{.*}} swiftcc { i64, i64 } @"$s18package_resilience34PkgClassWithFrozenPublicPropertiesC1p16resilient_struct0fG5PointVvg"(ptr swiftself %0) -// CHECK: [[T1:%.*]] = getelementptr inbounds %T18package_resilience34PkgClassWithFrozenPublicPropertiesC, ptr {{.*}} -// CHECK-NEXT: [[X:%.*]] = getelementptr inbounds %T16resilient_struct17FrozenPublicPointV, ptr [[T1]] -// CHECK-NEXT: [[XVAL:%.*]] = getelementptr inbounds %TSi, ptr [[X]] +// CHECK: [[T1:%.*]] = getelementptr inbounds{{.*}} %T18package_resilience34PkgClassWithFrozenPublicPropertiesC, ptr {{.*}} +// CHECK-NEXT: [[X:%.*]] = getelementptr inbounds{{.*}} %T16resilient_struct17FrozenPublicPointV, ptr [[T1]] +// CHECK-NEXT: [[XVAL:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[X]] // CHECK-NEXT: [[T2:%.*]] = load {{i32|i64}}, ptr [[XVAL]] -// CHECK-NEXT: [[Y:%.*]] = getelementptr inbounds %T16resilient_struct17FrozenPublicPointV, ptr [[T1]] -// CHECK-NEXT: [[YVAL:%.*]] = getelementptr inbounds %TSi, ptr [[Y]] +// CHECK-NEXT: [[Y:%.*]] = getelementptr inbounds{{.*}} %T16resilient_struct17FrozenPublicPointV, ptr [[T1]] +// CHECK-NEXT: [[YVAL:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[Y]] // CHECK-NEXT: [[T3:%.*]] = load {{i32|i64}}, ptr [[YVAL]] // CHECK-NEXT: [[T4:%.*]] = insertvalue { i64, i64 } undef, i64 [[T2]], 0 // CHECK-NEXT: [[T5:%.*]] = insertvalue { i64, i64 } %4, i64 [[T3]], 1 @@ -233,8 +233,8 @@ package class PkgClassWithFrozenPublicProperties { // PkgClassWithFrozenPublicProperties.color getter // CHECK: define{{.*}} swiftcc {{i32|64}} @"$s18package_resilience34PkgClassWithFrozenPublicPropertiesC5colors5Int32Vvg"(ptr swiftself %0) #0 { -// CHECK: [[T1:%.*]] = getelementptr inbounds %T18package_resilience34PkgClassWithFrozenPublicPropertiesC, ptr {{.*}} -// CHECK-NEXT: [[VAL:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[T1]] +// CHECK: [[T1:%.*]] = getelementptr inbounds{{.*}} %T18package_resilience34PkgClassWithFrozenPublicPropertiesC, ptr {{.*}} +// CHECK-NEXT: [[VAL:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[T1]] // CHECK-NEXT: [[T2:%.*]] = load {{i32|i64}}, ptr [[VAL]] // CHECK-NEXT: ret {{i32|i64}} [[T2]] @@ -269,7 +269,7 @@ public class PublicClassWithEnumIndirectCases { // CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc {{.*}} @"$s18package_resilience32PublicClassWithEnumIndirectCasesC5colors5Int32Vvg"(ptr swiftself %0) // CHECK: [[OFFSET:%.*]] = load {{i32|i64}}, ptr @"$s18package_resilience32PublicClassWithEnumIndirectCasesC5colors5Int32VvpWvd", // CHECK-NEXT: [[PTR:%.*]] = getelementptr inbounds i8, ptr {{.*}}, {{i32|i64}} [[OFFSET]] -// CHECK-NEXT: [[VALUE:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[PTR]] +// CHECK-NEXT: [[VALUE:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[PTR]] // CHECK-NEXT: [[RET:%.*]] = load {{i32|i64}}, ptr [[VALUE]] // CHECK-NEXT: ret {{i32|i64}} [[RET]] @@ -302,7 +302,7 @@ package class PkgClassWithEnumIndirectCases { // CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc {{i32|64}} @"$s18package_resilience29PkgClassWithEnumIndirectCasesC5colors5Int32Vvg"(ptr swiftself %0) // CHECK: [[OFFSET:%.*]] = load {{i32|i64}}, ptr @"$s18package_resilience29PkgClassWithEnumIndirectCasesC5colors5Int32VvpWvd", // CHECK-NEXT: [[PTR:%.*]] = getelementptr inbounds i8, ptr {{.*}}, {{i32|i64}} [[OFFSET]] -// CHECK-NEXT: [[VALUE:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[PTR]] +// CHECK-NEXT: [[VALUE:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[PTR]] // CHECK-NEXT: [[RET:%.*]] = load {{i32|i64}}, ptr [[VALUE]] // CHECK-NEXT: ret {{i32|i64}} [[RET]] @@ -339,8 +339,8 @@ public class PublicClassConcreteChild : PublicClassGenericParent { // PublicClassConcreteChild.x getter // CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc {{.*}} @"$s18package_resilience24PublicClassConcreteChildC1xSivg"(ptr swiftself %0) -// CHECK: [[PTR:%.*]] = getelementptr inbounds %T18package_resilience24PublicClassConcreteChildC, ptr {{.*}} -// CHECK-NEXT: [[VAL:%.*]] = getelementptr inbounds %TSi, ptr [[PTR]] +// CHECK: [[PTR:%.*]] = getelementptr inbounds{{.*}} %T18package_resilience24PublicClassConcreteChildC, ptr {{.*}} +// CHECK-NEXT: [[VAL:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[PTR]] // CHECK-NEXT: [[RET:%.*]] = load {{i32|i64}}, ptr [[VAL]] // CHECK-NEXT: ret {{i32|i64}} [[RET]] @@ -379,8 +379,8 @@ package class PkgClassConcreteChild : PkgClassGenericParent { // PkgClassConcreteChild.x getter // CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc {{.*}} @"$s18package_resilience21PkgClassConcreteChildC1xSivg"(ptr swiftself %0) -// CHECK: [[PTR:%.*]] = getelementptr inbounds %T18package_resilience21PkgClassConcreteChildC, ptr {{.*}} -// CHECK-NEXT: [[VAL:%.*]] = getelementptr inbounds %TSi, ptr [[PTR]] +// CHECK: [[PTR:%.*]] = getelementptr inbounds{{.*}} %T18package_resilience21PkgClassConcreteChildC, ptr {{.*}} +// CHECK-NEXT: [[VAL:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[PTR]] // CHECK-NEXT: [[RET:%.*]] = load {{i32|i64}}, ptr [[VAL]] // CHECK-NEXT: ret {{i32|i64}} [[RET]] @@ -470,7 +470,7 @@ package class PkgClassWithResilientThenEmpty { // CHECK: define{{.*}} swiftcc {{.*}} @"$s18package_resilience35memoryLayoutDotSizeWithPublicStructSiyF"() public func memoryLayoutDotSizeWithPublicStruct() -> Int { // CHECK: [[FIELD_VALUE:%.*]] = load ptr, ptr {{.*}}, - // CHECK-NEXT: [[FIELD_PTR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[FIELD_VALUE]], + // CHECK-NEXT: [[FIELD_PTR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[FIELD_VALUE]], // CHECK-NEXT: [[SIZE:%.*]] = load {{i32|i64}}, ptr [[FIELD_PTR]], // CHECK-NEXT: ret {{i32|i64}} [[SIZE]] return MemoryLayout.size @@ -479,7 +479,7 @@ public func memoryLayoutDotSizeWithPublicStruct() -> Int { // CHECK: define{{.*}} swiftcc {{.*}} @"$s18package_resilience32memoryLayoutDotSizeWithPkgStructSiyF"() package func memoryLayoutDotSizeWithPkgStruct() -> Int { // CHECK: [[FIELD_VALUE:%.*]] = load ptr, ptr {{.*}}, -// CHECK-NEXT: [[FIELD_PTR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[FIELD_VALUE]], +// CHECK-NEXT: [[FIELD_PTR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[FIELD_VALUE]], // CHECK-NEXT: [[SIZE:%.*]] = load {{i32|i64}}, ptr [[FIELD_PTR]], // CHECK-NEXT: ret {{i32|i64}} [[SIZE]] return MemoryLayout.size @@ -495,7 +495,7 @@ public func memoryLayoutDotSizeWithFrozenPublicStruct() -> Int { // CHECK: define{{.*}} swiftcc {{.*}} @"$s18package_resilience37memoryLayoutDotStrideWithPublicStructSiyF"() public func memoryLayoutDotStrideWithPublicStruct() -> Int { // CHECK: [[FIELD_VALUE:%.*]] = load ptr, ptr {{.*}}, -// CHECK-NEXT: [[FIELD_PTR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[FIELD_VALUE]], +// CHECK-NEXT: [[FIELD_PTR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[FIELD_VALUE]], // CHECK-NEXT: [[STRIDE:%.*]] = load {{i32|i64}}, ptr [[FIELD_PTR]], // CHECK-NEXT: ret {{i32|i64}} [[STRIDE]] return MemoryLayout.stride @@ -504,7 +504,7 @@ public func memoryLayoutDotStrideWithPublicStruct() -> Int { // CHECK: define{{.*}} swiftcc {{.*}} @"$s18package_resilience34memoryLayoutDotStrideWithPkgStructSiyF"() package func memoryLayoutDotStrideWithPkgStruct() -> Int { // CHECK: [[FIELD_VALUE:%.*]] = load ptr, ptr {{.*}}, -// CHECK-NEXT: [[FIELD_PTR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[FIELD_VALUE]], +// CHECK-NEXT: [[FIELD_PTR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[FIELD_VALUE]], // CHECK-NEXT: [[STRIDE:%.*]] = load {{i32|i64}}, ptr [[FIELD_PTR]], // CHECK-NEXT: ret {{i32|i64}} [[STRIDE]] return MemoryLayout.stride @@ -520,7 +520,7 @@ public func memoryLayoutDotStrideWithFrozenPublicStruct() -> Int { // CHECK: define{{.*}} swiftcc {{.*}} @"$s18package_resilience40memoryLayoutDotAlignmentWithPublicStructSiyF"() public func memoryLayoutDotAlignmentWithPublicStruct() -> Int { // CHECK: [[FIELD_VALUE:%.*]] = load ptr, ptr {{.*}}, -// CHECK-NEXT: [[FIELD_PTR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[FIELD_VALUE]], +// CHECK-NEXT: [[FIELD_PTR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[FIELD_VALUE]], // CHECK-NEXT: [[FIELD_FLAGS:%.*]] = load {{i32|i64}}, ptr [[FIELD_PTR]], // CHECK-NEXT: [[FIELD_ADDR:%.*]] = zext {{i32|i64}} [[FIELD_FLAGS]] to {{i32|i64}} // CHECK-NEXT: [[FIELD_MASK:%.*]] = and {{i32|i64}} [[FIELD_ADDR]] @@ -532,7 +532,7 @@ public func memoryLayoutDotAlignmentWithPublicStruct() -> Int { // CHECK: define{{.*}} swiftcc {{.*}} @"$s18package_resilience43memoryLayoutDotAlignmentWithResilientStructSiyF"() package func memoryLayoutDotAlignmentWithResilientStruct() -> Int { // CHECK: [[FIELD_VALUE:%.*]] = load ptr, ptr {{.*}}, -// CHECK-NEXT: [[FIELD_PTR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[FIELD_VALUE]], +// CHECK-NEXT: [[FIELD_PTR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[FIELD_VALUE]], // CHECK-NEXT: [[FIELD_FLAGS:%.*]] = load {{i32|i64}}, ptr [[FIELD_PTR]], // CHECK-NEXT: [[FIELD_ADDR:%.*]] = zext {{i32|i64}} [[FIELD_FLAGS]] to {{i32|i64}} // CHECK-NEXT: [[FIELD_MASK:%.*]] = and {{i32|i64}} [[FIELD_ADDR]] diff --git a/test/IRGen/partial_apply.sil b/test/IRGen/partial_apply.sil index 6ebfac8e03a82..0c79bfae956a2 100644 --- a/test/IRGen/partial_apply.sil +++ b/test/IRGen/partial_apply.sil @@ -53,9 +53,9 @@ entry(%a : $SwiftClass): // CHECK: define{{.*}} swiftcc void @partial_apply_two_classes_on_stack(ptr %0, ptr %1) // CHECK: entry: // CHECK: [[CTX:%.*]] = alloca i8, i64 32, align 16 -// CHECK: [[CAPTURE1:%.*]] = getelementptr inbounds <{ %swift.refcounted, ptr, ptr }>, ptr [[CTX]], i32 0, i32 1 +// CHECK: [[CAPTURE1:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, ptr, ptr }>, ptr [[CTX]], i32 0, i32 1 // CHECK: store ptr %0, ptr [[CAPTURE1]], align 8 -// CHECK: [[CAPTURE2:%.*]] = getelementptr inbounds <{ %swift.refcounted, ptr, ptr }>, ptr [[CTX]], i32 0, i32 2 +// CHECK: [[CAPTURE2:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, ptr, ptr }>, ptr [[CTX]], i32 0, i32 2 // CHECK: store ptr %1, ptr [[CAPTURE2]], align 8 // CHECK: call swiftcc void @use_closure(ptr @"$s34partially_applyable_to_two_classesTA", ptr [[CTX]]) // CHECK: call void @swift_release(ptr %0) @@ -199,9 +199,9 @@ sil public_external @guaranteed_captured_class_pair_param : $@convention(thin) ( // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_guaranteed_class_pair_param(ptr %0, ptr %1) // CHECK: [[CONTEXT_OBJ:%.*]] = call noalias ptr @swift_allocObject // CHECK: [[PAIR_ADDR:%.*]] = getelementptr -// CHECK-NEXT: [[X_ADDR:%.*]] = getelementptr inbounds %T13partial_apply14SwiftClassPairV, ptr [[PAIR_ADDR]], i32 0, i32 0 +// CHECK-NEXT: [[X_ADDR:%.*]] = getelementptr inbounds{{.*}} %T13partial_apply14SwiftClassPairV, ptr [[PAIR_ADDR]], i32 0, i32 0 // CHECK-NEXT: store ptr %0, ptr [[X_ADDR]], align -// CHECK-NEXT: [[Y_ADDR:%.*]] = getelementptr inbounds %T13partial_apply14SwiftClassPairV, ptr [[PAIR_ADDR]], i32 0, i32 1 +// CHECK-NEXT: [[Y_ADDR:%.*]] = getelementptr inbounds{{.*}} %T13partial_apply14SwiftClassPairV, ptr [[PAIR_ADDR]], i32 0, i32 1 // CHECK-NEXT: store ptr %1, ptr [[Y_ADDR]], align // CHECK-NOT: {{retain|release}} // CHECK: [[T0:%.*]] = insertvalue {{.*}} [[PARTIAL_APPLY_FORWARDER:@"\$s[A-Za-z0-9_]+TA"]], {{.*}} [[CONTEXT_OBJ]] @@ -209,9 +209,9 @@ sil public_external @guaranteed_captured_class_pair_param : $@convention(thin) ( // CHECK: define internal swiftcc i64 [[PARTIAL_APPLY_FORWARDER]] // CHECK: [[PAIR_ADDR:%.*]] = getelementptr -// CHECK-NEXT: [[X_ADDR:%.*]] = getelementptr inbounds %T13partial_apply14SwiftClassPairV, ptr [[PAIR_ADDR]], i32 0, i32 0 +// CHECK-NEXT: [[X_ADDR:%.*]] = getelementptr inbounds{{.*}} %T13partial_apply14SwiftClassPairV, ptr [[PAIR_ADDR]], i32 0, i32 0 // CHECK-NEXT: [[X:%.*]] = load ptr, ptr [[X_ADDR]], align -// CHECK-NEXT: [[Y_ADDR:%.*]] = getelementptr inbounds %T13partial_apply14SwiftClassPairV, ptr [[PAIR_ADDR]], i32 0, i32 1 +// CHECK-NEXT: [[Y_ADDR:%.*]] = getelementptr inbounds{{.*}} %T13partial_apply14SwiftClassPairV, ptr [[PAIR_ADDR]], i32 0, i32 1 // CHECK-NEXT: [[Y:%.*]] = load ptr, ptr [[Y_ADDR]], align // CHECK-NOT: retain // CHECK: [[RESULT:%.*]] = call swiftcc i64 @guaranteed_captured_class_pair_param(i64 %0, ptr [[X]], ptr [[Y]]) @@ -276,7 +276,7 @@ sil public_external @captured_fixed_and_dependent_params : $@convention(thin) , ptr [[T0]], i32 0, i32 1 +// CHECK-NEXT: [[BUFFER:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [24 x i8], %TSi }>, ptr [[T0]], i32 0, i32 1 // CHECK-NEXT: store ptr %T, ptr [[BUFFER]], align 8 // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds ptr, ptr [[BUFFER]], i32 1 // CHECK-NEXT: store ptr %T.P2, ptr [[T0]], align 8 @@ -617,7 +617,7 @@ bb0(%x : $*SwiftClassPair): sil public_external @use_closure2 : $@convention(thin) (@noescape @callee_guaranteed (Int) -> Int) -> () // CHECK-LABEL: define{{.*}} swiftcc void @partial_apply_stack_callee_guaranteed_indirect_guaranteed_class_pair_param(ptr {{.*}} %0) -// CHECK: [[CLOSURE_STACK_ADDR:%.*]] = getelementptr inbounds <{ %swift.refcounted, ptr }>, ptr {{.*}}, i32 0, i32 1 +// CHECK: [[CLOSURE_STACK_ADDR:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, ptr }>, ptr {{.*}}, i32 0, i32 1 // CHECK: store ptr %0, ptr [[CLOSURE_STACK_ADDR]] // CHECK: call swiftcc void @use_closure2(ptr [[FORWARDER:@[^,]*]], ptr {{.*}}) // CHECK: ret void @@ -641,7 +641,7 @@ bb0(%x : $*SwiftClassPair): } // CHECK: define{{.*}} swiftcc void @partial_apply_stack_callee_guaranteed_indirect_in_class_pair_param(ptr {{.*}} %0) -// CHECK: [[CLOSURE_STACK_ADDR:%.*]] = getelementptr inbounds <{ %swift.refcounted, ptr }>, ptr {{.*}}, i32 0, i32 1 +// CHECK: [[CLOSURE_STACK_ADDR:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, ptr }>, ptr {{.*}}, i32 0, i32 1 // CHECK: store ptr %0, ptr [[CLOSURE_STACK_ADDR]] // CHECK: call swiftcc void @use_closure2(ptr [[FORWARDER:@[^,]*]], ptr {{.*}}) // CHECK: ret void @@ -675,7 +675,7 @@ sil public_external @closure : $@convention(thin) (@in_guaranteed ResilientInt, // CHECK: [[MD:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 // CHECK: [[VWT_PTR:%.*]] = getelementptr inbounds ptr, ptr [[MD]], i64 -1 // CHECK: [[VWT:%.*]] = load ptr, ptr [[VWT_PTR]] -// CHECK: [[FLAGS_PTR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 10 +// CHECK: [[FLAGS_PTR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 10 // CHECK: [[FLAGS:%.*]] = load i32, ptr [[FLAGS_PTR]] // CHECK: [[FLAGS2:%.*]] = zext i32 [[FLAGS]] to i64 // CHECK: [[ALIGNMASK:%.*]] = and i64 [[FLAGS2]], 255 diff --git a/test/IRGen/partial_apply_coro.sil b/test/IRGen/partial_apply_coro.sil index 26ed13a46b652..0d728dbb08645 100644 --- a/test/IRGen/partial_apply_coro.sil +++ b/test/IRGen/partial_apply_coro.sil @@ -46,10 +46,10 @@ bb2: // CHECK-NEXT: entry: // CHECK-NEXT: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8] // CHECK-NEXT: %[[PA_CTX_BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata -// CHECK-NEXT: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, %TSf }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 -// CHECK-NEXT: %[[PA_ARG:.*]] = getelementptr inbounds %TSf, ptr %[[PA_CTX]], i32 0, i32 0 +// CHECK-NEXT: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %TSf }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK-NEXT: %[[PA_ARG:.*]] = getelementptr inbounds{{.*}} %TSf, ptr %[[PA_CTX]], i32 0, i32 0 // CHECK-NEXT: store float %[[ARG]], ptr %[[PA_ARG]] -// CHECK-NEXT: %[[CTXPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[CTX]], i32 0, i32 0 +// CHECK-NEXT: %[[CTXPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[CTX]], i32 0, i32 0 // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[CTXPTR]]) // CHECK-NEXT: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, float } @"$s6yield1TA{{.*}}"(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTXPTR]], ptr swiftself %[[PA_CTX_BOX]]) // CHECK-NEXT: %[[RESUME:.*]] = extractvalue { ptr, float } %[[YIELD_PAIR]], 0 @@ -71,10 +71,10 @@ bb2: // CHECK-NEXT: %[[SPILL:.*]] = call ptr @malloc // CHECK-NEXT: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK-NEXT: %[[FRAME:.*]] = getelementptr inbounds %"$s6yield1TA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK-NEXT: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, %TSf }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 -// CHECK-NEXT: %[[PA_ARG:.*]] = getelementptr inbounds %TSf, ptr %[[PA_CTX]], i32 0, i32 0 +// CHECK-NEXT: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %TSf }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK-NEXT: %[[PA_ARG:.*]] = getelementptr inbounds{{.*}} %TSf, ptr %[[PA_CTX]], i32 0, i32 0 // CHECK-NEXT: %[[ARG:.*]] = load float, ptr %[[PA_ARG]] -// CHECK-NEXT: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// CHECK-NEXT: %[[FRAMEPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) // CHECK-NEXT: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, float } @yield1(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], float %[[ARG]]) // CHECK-NEXT: %[[RESUME:.*]] = extractvalue { ptr, float } %[[YIELD_PAIR]], 0 @@ -99,7 +99,7 @@ bb2: // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s6yield1TA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK-NEXT: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK-NEXT: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK-NEXT: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK-NEXT: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK-NEXT: call void @free(ptr %[[FRAME]]) // CHECK-NEXT: unreachable @@ -107,7 +107,7 @@ bb2: // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s6yield1TA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK-NEXT: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK-NEXT: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK-NEXT: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK-NEXT: call swiftcc void %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK-NEXT: call void @free(ptr %[[FRAME]]) // CHECK-NEXT: ret void @@ -174,14 +174,14 @@ bb2: // CHECK-NEXT: entry: // CHECK-NEXT: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8] // CHECK-NEXT: %[[PA_CTX_BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata.{{.*}} -// CHECK-NEXT: %[[PA_CTX0:.*]] = getelementptr inbounds <{ %swift.refcounted, %TSi, %TSf }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 -// CHECK-NEXT: %[[PA_ARG0:.*]] = getelementptr inbounds %TSi, ptr %[[PA_CTX0]], i32 0, i32 0 +// CHECK-NEXT: %[[PA_CTX0:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %TSi, %TSf }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK-NEXT: %[[PA_ARG0:.*]] = getelementptr inbounds{{.*}} %TSi, ptr %[[PA_CTX0]], i32 0, i32 0 // CHECK-64-NEXT: store i64 %[[ARG0]], ptr %[[PA_ARG0]], align 8 // CHECK-32-NEXT: store i32 %[[ARG0]], ptr %[[PA_ARG0]], align 4 -// CHECK-NEXT: %[[PA_CTX1:.*]] = getelementptr inbounds <{ %swift.refcounted, %TSi, %TSf }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 -// CHECK-NEXT: %[[PA_ARG1:.*]] = getelementptr inbounds %TSf, ptr %[[PA_CTX1]], i32 0, i32 0 +// CHECK-NEXT: %[[PA_CTX1:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %TSi, %TSf }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 +// CHECK-NEXT: %[[PA_ARG1:.*]] = getelementptr inbounds{{.*}} %TSf, ptr %[[PA_CTX1]], i32 0, i32 0 // CHECK-NEXT: store float %[[ARG1]], ptr %[[PA_ARG1]] -// CHECK-NEXT: %[[CTXPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[CTX]], i32 0, i32 0 +// CHECK-NEXT: %[[CTXPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[CTX]], i32 0, i32 0 // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[CTXPTR]]) // CHECK-NEXT: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, float } @"$s6yield2TA{{.*}}"(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTXPTR]], ptr swiftself %[[PA_CTX_BOX]]) // CHECK-NEXT: %[[RESUME:.*]] = extractvalue { ptr, float } %[[YIELD_PAIR]], 0 @@ -202,13 +202,13 @@ bb2: // CHECK-NEXT: %[[SPILL:.*]] = call ptr @malloc // CHECK-NEXT: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK-NEXT: %[[FRAME:.*]] = getelementptr inbounds %"$s6yield2TA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK-NEXT: %[[BOXPTR0:.*]] = getelementptr inbounds <{ %swift.refcounted, %TSi, %TSf }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 -// CHECK-NEXT: %[[ARG0PTR:.*]] = getelementptr inbounds %TSi, ptr %[[BOXPTR0]], i32 0, i32 0 +// CHECK-NEXT: %[[BOXPTR0:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %TSi, %TSf }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK-NEXT: %[[ARG0PTR:.*]] = getelementptr inbounds{{.*}} %TSi, ptr %[[BOXPTR0]], i32 0, i32 0 // CHECK-NEXT: %[[ARG0:.*]] = load [[ARGTYPE:i(32|64)]], ptr %[[ARG0PTR]] -// CHECK-NEXT: %[[BOXPTR1:.*]] = getelementptr inbounds <{ %swift.refcounted, %TSi, %TSf }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 -// CHECK-NEXT: %[[ARG1PTR:.*]] = getelementptr inbounds %TSf, ptr %[[BOXPTR1]], i32 0, i32 0 +// CHECK-NEXT: %[[BOXPTR1:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %TSi, %TSf }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 +// CHECK-NEXT: %[[ARG1PTR:.*]] = getelementptr inbounds{{.*}} %TSf, ptr %[[BOXPTR1]], i32 0, i32 0 // CHECK-NEXT: %[[ARG1:.*]] = load float, ptr %[[ARG1PTR]] -// CHECK-NEXT: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// CHECK-NEXT: %[[FRAMEPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[FRAMEPTR]]) // CHECK-NEXT: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, float } @yield2(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARGTYPE]] %[[ARG0]], float %[[ARG1]]) // CHECK-NEXT: %[[RESUME:.*]] = extractvalue { ptr, float } %[[YIELD_PAIR]], 0 @@ -235,7 +235,7 @@ bb2: // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s6yield2TA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK-NEXT: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK-NEXT: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK-NEXT: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK-NEXT: %{{.*}} = call swiftcc [[ARGTYPE]] %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK-NEXT: call void @free(ptr %[[FRAME]]) // CHECK-NEXT: unreachable @@ -243,7 +243,7 @@ bb2: // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s6yield2TA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK-NEXT: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK-NEXT: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK-NEXT: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK-NEXT: %[[RET:.*]] = call swiftcc [[ARGTYPE]] %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK-NEXT: call void @free(ptr %[[FRAME]]) // CHECK-NEXT: ret [[ARGTYPE]] %[[RET]] @@ -298,7 +298,7 @@ bb2: // CHECK-SAMEL (float %[[ARG:.*]]) // CHECK-NEXT: entry: // CHECK: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8] -// CHECK: %[[CTXPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[CTX]], i32 0, i32 0 +// CHECK: %[[CTXPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[CTX]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[CTXPTR]]) // CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @"$s9yieldgen1TA{{.*}}"(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTXPTR]], ptr swiftself // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 @@ -315,7 +315,7 @@ bb2: // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s9yieldgen1TA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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 } @yieldgen1(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], ptr noalias %[[PA_CTX_BOX2:.*]], ptr @"$sSfN") // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 @@ -339,7 +339,7 @@ bb2: // CHECK-64: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s9yieldgen1TA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK-32: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s9yieldgen1TA.Frame", ptr %[[FRAME]], i32 0, i32 2 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK: %[[CTX:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -348,7 +348,7 @@ bb2: // CHECK-64: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s9yieldgen1TA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK-32: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s9yieldgen1TA.Frame", ptr %[[FRAME]], i32 0, i32 2 // CHECK: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret void @@ -424,14 +424,14 @@ bb2: // CHECK: %[[INDIRECT_RET:.*]] = alloca %TSf, align 4 // CHECK: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8] // CHECK: call void @llvm.lifetime.start.p0(i64 4, ptr %[[ARG_COPY]]) -// CHECK: %[[ARG_COPY_PTR:.*]] = getelementptr inbounds %TSf, ptr %[[ARG_COPY]], i32 0, i32 0 +// CHECK: %[[ARG_COPY_PTR:.*]] = getelementptr inbounds{{.*}} %TSf, ptr %[[ARG_COPY]], i32 0, i32 0 // CHECK: store float %[[ARG]], ptr %[[ARG_COPY_PTR]], align 4 // CHECK: %[[PA_CTX_BOX:.*]] = call noalias ptr @swift_allocObject -// CHECK: %[[PA_CTX_ARG:.*]] = getelementptr inbounds <{ %swift.refcounted, %TSf }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK: %[[PA_CTX_ARG:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %TSf }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK-64: call void @llvm.memcpy.p0.p0.i64(ptr align 8 %[[PA_CTX_ARG]], ptr align 4 %[[ARG_COPY]], i64 4, i1 false) // CHECK-32: call void @llvm.memcpy.p0.p0.i32(ptr align 4 %[[PA_CTX_ARG]], ptr align 4 %[[ARG_COPY]], i32 4, i1 false) // CHECK: call void @llvm.lifetime.start.p0(i64 4, ptr %[[INDIRECT_RET]]) -// CHECK: %[[CTXPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[CTX]], i32 0, i32 0 +// CHECK: %[[CTXPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[CTX]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[CTXPTR]]) // CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @"$s9yieldgen2TA{{.*}}"(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTXPTR]], ptr %[[INDIRECT_RET]], ptr swiftself // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 @@ -451,11 +451,11 @@ bb2: // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK-NEXT: %[[SPILL2:.*]] = getelementptr inbounds %"$s9yieldgen2TA.Frame", ptr %[[SPILL]], i32 0 // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s9yieldgen2TA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK: %[[ARG:.*]] = getelementptr inbounds <{ %swift.refcounted, %TSf }>, ptr %[[PA_BOX_CTX:.*]], i32 0, i32 1 +// CHECK: %[[ARG:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %TSf }>, ptr %[[PA_BOX_CTX:.*]], i32 0, i32 1 // CHECK: call void @llvm.lifetime.start.p0(i64 4, ptr %[[SPILL2:.*]]) // CHECK-64: call void @llvm.memcpy.p0.p0.i64(ptr align 4 %[[SPILL2:.*]], ptr align 8 %[[ARG]], i64 4, i1 false) // CHECK-32: call void @llvm.memcpy.p0.p0.i32(ptr align 4 %[[SPILL2:.*]], ptr align 4 %[[ARG]], i32 4, i1 false) -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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 } @yieldgen2(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], ptr %[[INDIRECT_RET]], ptr noalias %[[SPILL2]], ptr @"$sSfN") // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 @@ -479,7 +479,7 @@ bb2: // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s9yieldgen2TA.Frame", ptr %[[FRAME]], i32 0 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0:.*]] -// CHECK: %[[CTX:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -488,7 +488,7 @@ bb2: // CHECK-64: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s9yieldgen2TA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK-32: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s9yieldgen2TA.Frame", ptr %[[FRAME]], i32 0, i32 2 // CHECK: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret void @@ -561,7 +561,7 @@ bb2: // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s28partially_applyable_to_classTA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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 } @partially_applyable_to_class(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], ptr %[[PA_CTX_BOX]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 @@ -583,7 +583,7 @@ bb2: // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s28partially_applyable_to_classTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -591,7 +591,7 @@ bb2: // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s28partially_applyable_to_classTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret void @@ -621,7 +621,7 @@ sil @use_closure_two : $@convention(thin) (@noescape @yield_once @callee_guarant // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s28partially_applyable_to_classTA.{{[0-9]+}}.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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 } @partially_applyable_to_class(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], ptr %[[PA_CTX_BOX]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 @@ -643,7 +643,7 @@ sil @use_closure_two : $@convention(thin) (@noescape @yield_once @callee_guarant // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s28partially_applyable_to_classTA.{{[0-9]+}}.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -651,7 +651,7 @@ sil @use_closure_two : $@convention(thin) (@noescape @yield_once @callee_guarant // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s28partially_applyable_to_classTA.{{[0-9]+}}.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret void @@ -703,9 +703,9 @@ bb2: // CHECK-SAME: (ptr %[[ARG0:.*]], ptr %[[ARG1:.*]]) // CHECK: entry: // CHECK: %[[BOX:.*]] = alloca i8, {{(i32|i64)}} [[BUFFER_SIZE]], align 16 -// CHECK: %[[BOXPTR0:.*]] = getelementptr inbounds <{ %swift.refcounted, ptr, ptr }>, ptr %[[BOX]], i32 0, i32 1 +// CHECK: %[[BOXPTR0:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, ptr, ptr }>, ptr %[[BOX]], i32 0, i32 1 // CHECK: store ptr %[[ARG0]], ptr %[[BOXPTR0]] -// CHECK: %[[BOXPTR1:.*]] = getelementptr inbounds <{ %swift.refcounted, ptr, ptr }>, ptr %[[BOX]], i32 0, i32 2 +// CHECK: %[[BOXPTR1:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, ptr, ptr }>, ptr %[[BOX]], i32 0, i32 2 // CHECK: store ptr %[[ARG1]], ptr %[[BOXPTR1]] // CHECK: call swiftcc void @use_closure_two(ptr @"$s34partially_applyable_to_two_classesTA{{.*}}", ptr %[[BOX]]) // CHECK: call void @swift_release(ptr %[[ARG0]]) @@ -719,11 +719,11 @@ bb2: // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s34partially_applyable_to_two_classesTA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK: %[[PA_CTX0:.*]] = getelementptr inbounds <{ %swift.refcounted, ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK: %[[PA_CTX0:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: %[[ARG0:.*]] = load ptr, ptr %[[PA_CTX0]] -// CHECK: %[[PA_CTX1:.*]] = getelementptr inbounds <{ %swift.refcounted, ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 +// CHECK: %[[PA_CTX1:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 // CHECK: %[[ARG1:.*]] = load ptr, ptr %[[PA_CTX1]] -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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 } @partially_applyable_to_two_classes(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], ptr %[[ARG0]], ptr %[[ARG1]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 @@ -745,7 +745,7 @@ bb2: // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s34partially_applyable_to_two_classesTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: %{{.*}} = call swiftcc ptr %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -753,7 +753,7 @@ bb2: // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s34partially_applyable_to_two_classesTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: %[[RET:.*]] = call swiftcc ptr %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret ptr %[[RET]] @@ -804,10 +804,10 @@ bb2: // CHECK: entry: // CHECK: %[[ARG:.*]] = alloca %TSi // CHECK: call void @llvm.lifetime.start.p0(i64 {{4|8}}, ptr %[[ARG]]) -// CHECK: %[[ARGPTR:.*]] = getelementptr inbounds %TSi, ptr %[[ARG]], i32 0, i32 0 +// CHECK: %[[ARGPTR:.*]] = getelementptr inbounds{{.*}} %TSi, ptr %[[ARG]], i32 0, i32 0 // CHECK: store [[ARG_TYPE]] %[[ARG0]], ptr %[[ARGPTR]] // CHECK: %[[BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata.{{.*}} -// CHECK: %[[BOXPTR:.*]] = getelementptr inbounds <{ %swift.refcounted, ptr }>, ptr %[[BOX]], i32 0, i32 1 +// CHECK: %[[BOXPTR:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, ptr }>, ptr %[[BOX]], i32 0, i32 1 // CHECK: store ptr %[[ARG]], ptr %[[BOXPTR]] // CHECK: call void @llvm.lifetime.end.p0(i64 {{4|8}}, ptr %[[ARG]]) // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s22generic_captured_paramTA{{.*}}", ptr undef }, ptr %[[BOX]], 1 @@ -821,9 +821,9 @@ bb2: // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s22generic_captured_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: %[[ARG1:.*]] = load ptr, ptr %[[PA_CTX]] -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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]] } @generic_captured_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr %[[ARG1]], ptr @"$sSiN") // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 @@ -845,7 +845,7 @@ bb2: // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s22generic_captured_paramTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -853,7 +853,7 @@ bb2: // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s22generic_captured_paramTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret void @@ -881,9 +881,9 @@ entry(%i : $*T, %io : $*T): // CHECK-SAME: (ptr %[[ARG0:.*]], ptr %[[ARG1:.*]]) // CHECK: entry: // CHECK: %[[BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata -// CHECK: %[[BOXPTR1:.*]] = getelementptr inbounds <{ %swift.refcounted, [{{4|8}} x i8], ptr }>, ptr %[[BOX]], i32 0, i32 1 +// CHECK: %[[BOXPTR1:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [{{4|8}} x i8], ptr }>, ptr %[[BOX]], i32 0, i32 1 // CHECK: store ptr %[[ARG1]], ptr %[[BOXPTR1]] -// CHECK: %[[BOXPTR2:.*]] = getelementptr inbounds <{ %swift.refcounted, [{{4|8}} x i8], ptr }>, ptr %[[BOX]], i32 0, i32 2 +// CHECK: %[[BOXPTR2:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [{{4|8}} x i8], ptr }>, ptr %[[BOX]], i32 0, i32 2 // CHECK: store ptr %[[ARG0]], ptr %[[BOXPTR2]], // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s31generic_captured_and_open_paramTA{{.*}}", ptr undef }, ptr %[[BOX]], 1 // CHECK: ret { ptr, ptr } %[[RET]] @@ -895,11 +895,11 @@ entry(%i : $*T, %io : $*T): // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s31generic_captured_and_open_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, [{{4|8}} x i8], ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [{{4|8}} x i8], ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: %[[ARG1:.*]] = load ptr, ptr %[[PA_CTX]] -// CHECK: %[[PA_CTX2:.*]] = getelementptr inbounds <{ %swift.refcounted, [{{4|8}} x i8], ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 +// CHECK: %[[PA_CTX2:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [{{4|8}} x i8], ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 // CHECK: %[[ARG2:.*]] = load ptr, ptr %[[PA_CTX2]] -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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 } @generic_captured_and_open_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], ptr noalias %[[ARG0]], ptr %[[ARG2]], ptr %[[ARG1]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 @@ -921,7 +921,7 @@ entry(%i : $*T, %io : $*T): // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s31generic_captured_and_open_paramTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK: %[[CTX0]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX0]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -929,7 +929,7 @@ entry(%i : $*T, %io : $*T): // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s31generic_captured_and_open_paramTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret void @@ -968,7 +968,7 @@ entry(%i : $Int, %c : $SwiftClass): // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s31guaranteed_captured_class_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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 } @guaranteed_captured_class_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr %[[PA_CTX_BOX]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 @@ -990,7 +990,7 @@ entry(%i : $Int, %c : $SwiftClass): // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s31guaranteed_captured_class_paramTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -998,7 +998,7 @@ entry(%i : $Int, %c : $SwiftClass): // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s31guaranteed_captured_class_paramTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret void @@ -1035,7 +1035,7 @@ entry(%i : $Int, %c : $*SwiftClass): // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s40indirect_guaranteed_captured_class_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 0 // CHECK: store ptr %[[PA_CTX_BOX]], ptr %[[SELFPTR]] -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 @@ -1057,7 +1057,7 @@ entry(%i : $Int, %c : $*SwiftClass): // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s40indirect_guaranteed_captured_class_paramTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -1065,7 +1065,7 @@ entry(%i : $Int, %c : $*SwiftClass): // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s40indirect_guaranteed_captured_class_paramTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret void @@ -1103,7 +1103,7 @@ entry(%i : $Int, %c : $*SwiftClass): // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s38indirect_consumed_captured_class_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 0 // CHECK: %{{.*}} = call ptr @swift_retain(ptr returned %[[PA_CTX_BOX]]) // CHECK: store ptr %[[PA_CTX_BOX]], ptr %[[SELFPTR]] -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 @@ -1125,7 +1125,7 @@ entry(%i : $Int, %c : $*SwiftClass): // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s38indirect_consumed_captured_class_paramTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -1133,7 +1133,7 @@ entry(%i : $Int, %c : $*SwiftClass): // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s38indirect_consumed_captured_class_paramTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret void @@ -1166,10 +1166,10 @@ entry(%i : $Int, %c : $SwiftClassPair): // CHECK-SAME: (ptr %[[ARG0:.*]], ptr %[[ARG1:.*]]) // 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 -// CHECK: %[[ARG0PTR:.*]] = getelementptr inbounds %T18partial_apply_coro14SwiftClassPairV, ptr %[[BOXPTR]], i32 0, i32 0 +// CHECK: %[[BOXPTR:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[BOX]], i32 0, i32 1 +// CHECK: %[[ARG0PTR:.*]] = getelementptr inbounds{{.*}} %T18partial_apply_coro14SwiftClassPairV, ptr %[[BOXPTR]], i32 0, i32 0 // CHECK: store ptr %[[ARG0]], ptr %[[ARG0PTR]] -// CHECK: %[[ARG1PTR:.*]] = getelementptr inbounds %T18partial_apply_coro14SwiftClassPairV, ptr %[[BOXPTR]], i32 0, i32 1 +// CHECK: %[[ARG1PTR:.*]] = getelementptr inbounds{{.*}} %T18partial_apply_coro14SwiftClassPairV, ptr %[[BOXPTR]], i32 0, i32 1 // CHECK: store ptr %[[ARG1]], ptr %[[ARG1PTR]] // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s36guaranteed_captured_class_pair_paramTA{{.*}}", ptr undef }, ptr %[[BOX]], 1 // CHECK: ret { ptr, ptr } %[[RET]] @@ -1181,12 +1181,12 @@ entry(%i : $Int, %c : $SwiftClassPair): // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s36guaranteed_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 -// CHECK: %[[PA_CTX_ARG1:.*]] = getelementptr inbounds %T18partial_apply_coro14SwiftClassPairV, ptr %[[PA_CTX]], i32 0, i32 0 +// CHECK: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK: %[[PA_CTX_ARG1:.*]] = getelementptr inbounds{{.*}} %T18partial_apply_coro14SwiftClassPairV, ptr %[[PA_CTX]], i32 0, i32 0 // CHECK: %[[ARG1:.*]] = load ptr, ptr %[[PA_CTX_ARG1]] -// CHECK: %[[PA_CTX_ARG2:.*]] = getelementptr inbounds %T18partial_apply_coro14SwiftClassPairV, ptr %[[PA_CTX]], i32 0, i32 1 +// CHECK: %[[PA_CTX_ARG2:.*]] = getelementptr inbounds{{.*}} %T18partial_apply_coro14SwiftClassPairV, ptr %[[PA_CTX]], i32 0, i32 1 // CHECK: %[[ARG2:.*]] = load ptr, ptr %[[PA_CTX_ARG2]] -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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]] } @guaranteed_captured_class_pair_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG0]], ptr %[[ARG1]], ptr %[[ARG2]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 @@ -1208,7 +1208,7 @@ entry(%i : $Int, %c : $SwiftClassPair): // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s36guaranteed_captured_class_pair_paramTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -1216,7 +1216,7 @@ entry(%i : $Int, %c : $SwiftClassPair): // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s36guaranteed_captured_class_pair_paramTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret void @@ -1242,7 +1242,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): // 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 +// CHECK: %[[BOXPTR:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[BOX]], i32 0, i32 1 // CHECK: call void @llvm.memcpy.p0.p0.[[ARG_TYPE]](ptr align {{4|8}} %[[BOXPTR]], ptr align {{4|8}} %[[ARG]], [[ARG_TYPE]] [[PAIR_SIZE]], i1 false) // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s45indirect_guaranteed_captured_class_pair_paramTA{{.*}}", ptr undef }, ptr %[[BOX]], 1 // CHECK: ret { ptr, ptr } %[[RET]] @@ -1255,8 +1255,8 @@ entry(%i : $Int, %c : $*SwiftClassPair): // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[SPILL1:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// 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: %[[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: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 @@ -1278,7 +1278,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -1286,7 +1286,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret void @@ -1312,7 +1312,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): // 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 +// CHECK: %[[BOXPTR:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[BOX]], i32 0, i32 1 // CHECK: call void @llvm.memcpy.p0.p0.[[ARG_TYPE]](ptr align {{4|8}} %[[BOXPTR]], ptr align {{4|8}} %[[ARG]], [[ARG_TYPE]] [[PAIR_SIZE]], i1 false) // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s43indirect_consumed_captured_class_pair_paramTA{{.*}}", ptr undef }, ptr %[[BOX]], 1 // CHECK: ret { ptr, ptr } %[[RET]] @@ -1326,10 +1326,10 @@ entry(%i : $Int, %c : $*SwiftClassPair): // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[SPILL1:.*]] = getelementptr inbounds %"$s43indirect_consumed_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 1 // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s43indirect_consumed_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: call void @llvm.lifetime.start.p0(i64 [[PAIR_SIZE]], ptr %[[SPILL1]]) // 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: %[[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: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 @@ -1351,7 +1351,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s43indirect_consumed_captured_class_pair_paramTA.Frame", ptr %[[FRAME]], i32 0, i32 2 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -1359,7 +1359,7 @@ entry(%i : $Int, %c : $*SwiftClassPair): // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s43indirect_consumed_captured_class_pair_paramTA.Frame", ptr %[[FRAME]], i32 0, i32 2 // CHECK: %[[RESUME:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret void @@ -1388,24 +1388,24 @@ entry(%c : $SwiftClass, %a : $*A, %i : $Int): // CHECK-arm64e: %[[VWTABLEADDR:.*]] = ptrtoint ptr %[[VWTABLE]] to i64 // CHECK-arm64e: %[[VWTABLEAUTH:.*]] = call i64 @llvm.ptrauth.auth(i64 %[[VWTABLEADDR]], i32 2 // CHECK-arm64e: %[[VWTABLE:.*]] = inttoptr i64 %[[VWTABLEAUTH]] to ptr -// CHECK: %[[WITNESS:.*]] = getelementptr inbounds %swift.vwtable, ptr %[[VWTABLE]], i32 0, i32 10 +// CHECK: %[[WITNESS:.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr %[[VWTABLE]], i32 0, i32 10 // CHECK: %[[FLAGS:.*]] = load i32, ptr %[[WITNESS]] // do not check computation of align; may be target dependent -// CHECK: %[[WITNESS_SIZE:.*]] = getelementptr inbounds %swift.vwtable, ptr %[[VWTABLE]], i32 0, i32 8 +// CHECK: %[[WITNESS_SIZE:.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr %[[VWTABLE]], i32 0, i32 8 // do not check computation of size; may be target dependent // CHECK: %[[BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata{{.*}} -// CHECK-32: %[[BOXPTR0:.*]] = getelementptr inbounds <{ %swift.refcounted, [4 x i8], ptr }>, ptr %[[BOX]], i32 0, i32 1 -// CHECK-64: %[[BOXPTR0:.*]] = getelementptr inbounds <{ %swift.refcounted, [8 x i8], ptr }>, ptr %[[BOX]], i32 0, i32 1 +// CHECK-32: %[[BOXPTR0:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [4 x i8], ptr }>, ptr %[[BOX]], i32 0, i32 1 +// CHECK-64: %[[BOXPTR0:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [8 x i8], ptr }>, ptr %[[BOX]], i32 0, i32 1 // CHECK: store ptr %[[TY]], ptr %[[BOXPTR0]] -// CHECK-32: %[[BOXPTR1:.*]] = getelementptr inbounds <{ %swift.refcounted, [4 x i8], ptr }>, ptr %[[BOX]], i32 0, i32 2 -// CHECK-64: %[[BOXPTR1:.*]] = getelementptr inbounds <{ %swift.refcounted, [8 x i8], ptr }>, ptr %[[BOX]], i32 0, i32 2 +// CHECK-32: %[[BOXPTR1:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [4 x i8], ptr }>, ptr %[[BOX]], i32 0, i32 2 +// CHECK-64: %[[BOXPTR1:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [8 x i8], ptr }>, ptr %[[BOX]], i32 0, i32 2 // CHECK: store ptr %[[CTX]], ptr %[[BOXPTR1]] // CHECK: %[[BOXPTR2:.*]] = getelementptr inbounds i8, ptr %[[BOX]] // CHECK: %[[INITPTR:.*]] = getelementptr inbounds ptr, ptr %[[VWTABLE]], i32 4 // CHECK: %[[INIT:.*]] = load ptr, ptr %[[INITPTR]] // CHECK: %{{.*}} = call ptr %[[INIT]](ptr noalias %[[BOXPTR2]], ptr noalias %[[ARG0]], ptr %[[TY]]) // CHECK: %[[BOXPTR3:.*]] = getelementptr inbounds i8, ptr %[[BOX]], {{i32|i64}} %{{.*}} -// CHECK: %[[BOXPTR3VAL:.*]] = getelementptr inbounds %TSi, ptr %[[BOXPTR3]], i32 0, i32 0 +// CHECK: %[[BOXPTR3VAL:.*]] = getelementptr inbounds{{.*}} %TSi, ptr %[[BOXPTR3]], i32 0, i32 0 // CHECK: store [[ARG_TYPE]] %[[ARG1]], ptr %[[BOXPTR3VAL]] // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s35captured_fixed_and_dependent_paramsTA{{.*}}", ptr undef }, ptr %[[BOX]], 1 // CHECK: ret { ptr, ptr } %[[RET]] @@ -1417,8 +1417,8 @@ entry(%c : $SwiftClass, %a : $*A, %i : $Int): // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s35captured_fixed_and_dependent_paramsTA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK-32: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, [4 x i8], ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 -// CHECK-64: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, [8 x i8], ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK-32: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [4 x i8], ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK-64: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [8 x i8], ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: %[[TY:.*]] = load ptr, ptr %[[PA_CTX]] // CHECK: store ptr %[[TY]], ptr %[[TY]] // CHECK: %[[TYMD:.*]] = getelementptr inbounds ptr, ptr %[[TY]], {{i32|i64}} -1 @@ -1426,19 +1426,19 @@ entry(%c : $SwiftClass, %a : $*A, %i : $Int): // CHECK-arm64e: %[[VWTABLEADDR:.*]] = ptrtoint ptr %[[VWTABLE]] to i64 // CHECK-arm64e: %[[VWTABLEAUTH:.*]] = call i64 @llvm.ptrauth.auth(i64 %[[VWTABLEADDR]], i32 2 // CHECK-arm64e: %[[VWTABLE:.*]] = inttoptr i64 %[[VWTABLEAUTH]] to ptr -// CHECK: %[[WITNESS:.*]] = getelementptr inbounds %swift.vwtable, ptr %[[VWTABLE]], i32 0, i32 10 +// CHECK: %[[WITNESS:.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr %[[VWTABLE]], i32 0, i32 10 // CHECK: %[[FLAGS:.*]] = load i32, ptr %[[WITNESS]] // do not check computation of align; may be target dependent -// CHECK: %[[WITNESS_SIZE:.*]] = getelementptr inbounds %swift.vwtable, ptr %[[VWTABLE]], i32 0, i32 8 +// CHECK: %[[WITNESS_SIZE:.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr %[[VWTABLE]], i32 0, i32 8 // do not check computation of size; may be target dependent -// CHECK-32: %[[PA_CTX2:.*]] = getelementptr inbounds <{ %swift.refcounted, [4 x i8], ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 -// CHECK-64: %[[PA_CTX2:.*]] = getelementptr inbounds <{ %swift.refcounted, [8 x i8], ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 +// CHECK-32: %[[PA_CTX2:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [4 x i8], ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 +// CHECK-64: %[[PA_CTX2:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [8 x i8], ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 // CHECK: %[[ARG0:.*]] = load ptr, ptr %[[PA_CTX2]] // CHECK: %[[ARG1:.*]] = getelementptr inbounds i8, ptr %[[PA_CTX_BOX]], {{i32|i64}} %{{.*}} // CHECK: %[[ARG2PTR0:.*]] = getelementptr inbounds i8, ptr %[[PA_CTX_BOX]], {{i32|i64}} %{{.*}} -// CHECK: %[[ARG2PTR1:.*]] = getelementptr inbounds %TSi, ptr %[[ARG2PTR0]], i32 0, i32 0 +// CHECK: %[[ARG2PTR1:.*]] = getelementptr inbounds{{.*}} %TSi, ptr %[[ARG2PTR0]], i32 0, i32 0 // CHECK: %[[ARG2:.*]] = load [[ARG_TYPE]], ptr %[[ARG2PTR1]] -// CHECK: %[[CTXPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// CHECK: %[[CTXPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[CTXPTR]]) // CHECK: %[[RESUME:.*]] = call swiftcc ptr @captured_fixed_and_dependent_params(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTXPTR]], ptr %[[ARG0]], ptr noalias %[[ARG1]], [[ARG_TYPE]] %[[ARG2]], ptr %T) // CHECK: %[[SPILL2:.*]] = getelementptr inbounds %"$s35captured_fixed_and_dependent_paramsTA.Frame", ptr %[[SPILL]], i32 0, i32 1 @@ -1456,7 +1456,7 @@ entry(%c : $SwiftClass, %a : $*A, %i : $Int): // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s35captured_fixed_and_dependent_paramsTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -1464,7 +1464,7 @@ entry(%c : $SwiftClass, %a : $*A, %i : $Int): // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s35captured_fixed_and_dependent_paramsTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX1]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX1]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret void @@ -1485,14 +1485,14 @@ bb0(%a : $SwiftClass, %b : $*T, %c : $Int): // CHECK-arm64e: %[[VWTABLEADDR:.*]] = ptrtoint ptr %[[ARGTY_VW]] to i64 // CHECK-arm64e: %[[VWTABLEAUTH:.*]] = call i64 @llvm.ptrauth.auth(i64 %[[VWTABLEADDR]], i32 2 // CHECK-arm64e: %[[ARGTY_VW:.*]] = inttoptr i64 %[[VWTABLEAUTH]] to ptr -// CHECK: %[[ARGTY_FLAGS_PTR:.*]] = getelementptr inbounds %swift.vwtable, ptr %[[ARGTY_VW]], i32 0, i32 10 +// CHECK: %[[ARGTY_FLAGS_PTR:.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr %[[ARGTY_VW]], i32 0, i32 10 // CHECK: %[[ARGTY_FLAGS:.*]] = load i32, ptr %[[ARGTY_FLAGS_PTR]] // do not check computation of align; may be target dependent -// CHECK: %[[ARGTY_SIZE_PTR:.*]] = getelementptr inbounds %swift.vwtable, ptr %[[ARGTY_VW]], i32 0, i32 8 +// CHECK: %[[ARGTY_SIZE_PTR:.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr %[[ARGTY_VW]], i32 0, i32 8 // do not check computation of size; may be target dependent // CHECK: %[[PA_BOX_ALLOC:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @{{.*}} -// CHECK-32: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, [4 x i8] }>, ptr %[[PA_BOX_ALLOC]], i32 0, i32 1 -// CHECK-64: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, [8 x i8] }>, ptr %[[PA_BOX_ALLOC]], i32 0, i32 1 +// CHECK-32: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [4 x i8] }>, ptr %[[PA_BOX_ALLOC]], i32 0, i32 1 +// CHECK-64: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [8 x i8] }>, ptr %[[PA_BOX_ALLOC]], i32 0, i32 1 // CHECK: store ptr %[[ARGTY]], ptr %[[PA_CTX]] // CHECK: %[[PA_CTX_ARG:.*]] = getelementptr inbounds i8, ptr %[[PA_BOX_ALLOC]], // CHECK: %[[INIT_PTR:.*]] = getelementptr inbounds ptr, ptr %[[ARGTY_VW]], i32 4 @@ -1507,18 +1507,18 @@ bb0(%a : $SwiftClass, %b : $*T, %c : $Int): // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s28captured_dependent_out_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK-32: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, [4 x i8] }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 -// CHECK-64: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, [8 x i8] }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK-32: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [4 x i8] }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK-64: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [8 x i8] }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: %[[TY:.*]] = load ptr, ptr %[[PA_CTX]] // CHECK: %[[TYMD:.*]] = getelementptr inbounds ptr, ptr %[[TY]], {{i32|i64}} -1 // CHECK: %[[VWTABLE:.*]] = load ptr, ptr %[[TYMD]] // CHECK-arm64e: %[[VWTABLEADDR:.*]] = ptrtoint ptr %[[VWTABLE]] to i64 // CHECK-arm64e: %[[VWTABLEAUTH:.*]] = call i64 @llvm.ptrauth.auth(i64 %[[VWTABLEADDR]], i32 2 // CHECK-arm64e: %[[VWTABLE:.*]] = inttoptr i64 %[[VWTABLEAUTH]] to ptr -// CHECK: %[[WITNESS:.*]] = getelementptr inbounds %swift.vwtable, ptr %[[VWTABLE]], i32 0, i32 10 +// CHECK: %[[WITNESS:.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr %[[VWTABLE]], i32 0, i32 10 // CHECK: %[[FLAGS:.*]] = load i32, ptr %[[WITNESS]] // do not check computation of align; may be target dependent -// CHECK: %[[WITNESS_SIZE:.*]] = getelementptr inbounds %swift.vwtable, ptr %[[VWTABLE]], i32 0, i32 8 +// CHECK: %[[WITNESS_SIZE:.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr %[[VWTABLE]], i32 0, i32 8 // do not check computation of size; may be target dependent // CHECK: %[[PA_CTX2:.*]] = getelementptr inbounds i8, ptr %[[PA_CTX_BOX]] // CHECK: %[[ARG_COPY:.*]] = call ptr @malloc @@ -1526,7 +1526,7 @@ bb0(%a : $SwiftClass, %b : $*T, %c : $Int): // CHECK: %[[INIT_PTR:.*]] = getelementptr inbounds ptr, ptr %[[VWTABLE]], i32 2 // CHECK: %[[INIT:.*]] = load ptr, ptr %[[INIT_PTR]] // CHECK: call ptr %[[INIT]](ptr noalias %[[ARG_COPY]], ptr noalias %[[PA_CTX2]], ptr %[[TY]]) -// CHECK: %[[CTXPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// CHECK: %[[CTXPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[CTXPTR]]) // CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @captured_dependent_out_param(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTXPTR]], ptr %[[INDIRECT_RET]], ptr noalias %[[ARG_COPY]], ptr %[[TY]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 @@ -1555,15 +1555,15 @@ bb0(%x : $*T): // CHECK-SAME: (i32 %[[ARG1:.*]], ptr %[[ARG_FUNC:.*]], ptr %[[ARG_FUNC_SELF:.*]], ptr %[[TY:.*]]) // CHECK: entry: // CHECK: %[[PA_CTX_BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata -// CHECK-32: %[[PA_ARG1:.*]] = getelementptr inbounds <{ %swift.refcounted, %Ts5Int32V, ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 -// CHECK-64: %[[PA_ARG1:.*]] = getelementptr inbounds <{ %swift.refcounted, %Ts5Int32V, [4 x i8], ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 -// CHECK: %[[PA_ARG1_INT:.*]] = getelementptr inbounds %Ts5Int32V, ptr %[[PA_ARG1]], i32 0, i32 0 +// CHECK-32: %[[PA_ARG1:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %Ts5Int32V, ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK-64: %[[PA_ARG1:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %Ts5Int32V, [4 x i8], ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK: %[[PA_ARG1_INT:.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr %[[PA_ARG1]], i32 0, i32 0 // CHECK: store i32 %[[ARG1]], ptr %[[PA_ARG1_INT]] -// CHECK-32: %[[PA_ARG_FUNC_SELF:.*]] = getelementptr inbounds <{ %swift.refcounted, %Ts5Int32V, ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 -// CHECK-64: %[[PA_ARG_FUNC_SELF:.*]] = getelementptr inbounds <{ %swift.refcounted, %Ts5Int32V, [4 x i8], ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 3 +// CHECK-32: %[[PA_ARG_FUNC_SELF:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %Ts5Int32V, ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 +// CHECK-64: %[[PA_ARG_FUNC_SELF:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %Ts5Int32V, [4 x i8], ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 3 // CHECK: store ptr %[[ARG_FUNC_SELF]], ptr %[[PA_ARG_FUNC_SELF]] -// CHECK-32: %[[PA_ARG_FUNC:.*]] = getelementptr inbounds <{ %swift.refcounted, %Ts5Int32V, ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 3 -// CHECK-64: %[[PA_ARG_FUNC:.*]] = getelementptr inbounds <{ %swift.refcounted, %Ts5Int32V, [4 x i8], ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 4 +// CHECK-32: %[[PA_ARG_FUNC:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %Ts5Int32V, ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 3 +// CHECK-64: %[[PA_ARG_FUNC:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %Ts5Int32V, [4 x i8], ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 4 // CHECK-arm64e: %[[ARG_FUNC_ADDR:.*]] = ptrtoint ptr %[[ARG_FUNC]] to i64 // CHECK-arm64e: %[[ARG_FUNC_AUTH:.*]] = call i64 @llvm.ptrauth.resign(i64 %[[ARG_FUNC_ADDR]] // CHECK-arm64e: %[[ARG_FUNC:.*]] = inttoptr i64 %[[ARG_FUNC_AUTH]] to ptr @@ -1578,17 +1578,17 @@ bb0(%x : $*T): // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$sTA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK-32: %[[PA_ARG1:.*]] = getelementptr inbounds <{ %swift.refcounted, %Ts5Int32V, ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 -// CHECK-64: %[[PA_ARG1:.*]] = getelementptr inbounds <{ %swift.refcounted, %Ts5Int32V, [4 x i8], ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 -// CHECK: %[[PA_ARG1_INT:.*]] = getelementptr inbounds %Ts5Int32V, ptr %[[PA_ARG1]], i32 0, i32 0 +// CHECK-32: %[[PA_ARG1:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %Ts5Int32V, ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK-64: %[[PA_ARG1:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %Ts5Int32V, [4 x i8], ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK: %[[PA_ARG1_INT:.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr %[[PA_ARG1]], i32 0, i32 0 // CHECK: %[[ARG1:.*]] = load i32, ptr %[[PA_ARG1_INT]] -// CHECK-32: %[[PA_ARG_FUNC_SELF:.*]] = getelementptr inbounds <{ %swift.refcounted, %Ts5Int32V, ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 -// CHECK-64: %[[PA_ARG_FUNC_SELF:.*]] = getelementptr inbounds <{ %swift.refcounted, %Ts5Int32V, [4 x i8], ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 3 +// CHECK-32: %[[PA_ARG_FUNC_SELF:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %Ts5Int32V, ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 +// CHECK-64: %[[PA_ARG_FUNC_SELF:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %Ts5Int32V, [4 x i8], ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 3 // CHECK: %[[ARG_FUNC_SELF:.*]] = load ptr, ptr %[[PA_ARG_FUNC_SELF]] -// CHECK-32: %[[PA_ARG_FUNC:.*]] = getelementptr inbounds <{ %swift.refcounted, %Ts5Int32V, ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 3 -// CHECK-64: %[[PA_ARG_FUNC:.*]] = getelementptr inbounds <{ %swift.refcounted, %Ts5Int32V, [4 x i8], ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 4 +// CHECK-32: %[[PA_ARG_FUNC:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %Ts5Int32V, ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 3 +// CHECK-64: %[[PA_ARG_FUNC:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %Ts5Int32V, [4 x i8], ptr, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 4 // CHECK: %[[ARG_FUNC:.*]] = load ptr, ptr %[[PA_ARG_FUNC]] -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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 } %[[ARG_FUNC]](ptr noalias {{.*}} %[[FRAMEPTR]], ptr %[[INDIRECT_RET]], i32 %[[ARG1]], ptr swiftself %[[ARG_FUNC_SELF]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 @@ -1671,14 +1671,14 @@ bb2: // CHECK: entry: // CHECK: %[[CTX0:.*]] = alloca [[[BUFFER_SIZE]] x i8] // CHECK: %[[CTX1:.*]] = alloca [[[BUFFER_SIZE]] x i8] -// CHECK: %[[CTX0PTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[CTX0]], i32 0, i32 0 +// CHECK: %[[CTX0PTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[CTX0]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[CTX0PTR]]) // CHECK: %[[MDRESP:.*]] = call swiftcc %swift.metadata_response @"$s18partial_apply_coro3SubCMa" // CHECK: %[[MD:.*]] = extractvalue %swift.metadata_response %[[MDRESP]], 0 // CHECK: %[[RESUME0:.*]] = call swiftcc ptr @receive_closure(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0PTR]], ptr @"$s26parametric_casting_closureTA.{{[0-9]+}}{{.*}}", ptr %[[ARG0]], ptr %[[MD]]) // CHECK: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0PTR]], i1 false) // CHECK: call void @llvm.lifetime.end.p0(i64 [[BUFFER_SIZE]], ptr %[[CTX0PTR]]) -// CHECK: %[[CTX1PTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[CTX1]], i32 0, i32 0 +// CHECK: %[[CTX1PTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[CTX1]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[CTX1PTR]]) // CHECK: %[[RESUME1:.*]] = call swiftcc ptr @receive_closure2(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1PTR]], ptr @"$s26parametric_casting_closureTA{{.*}}", ptr null, ptr %[[MD]]) // CHECK: call swiftcc void %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1PTR]], i1 false) @@ -1694,7 +1694,7 @@ bb2: // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s26parametric_casting_closureTA.Frame", ptr %[[SPILL]], i32 0, i32 0 // CHECK: %[[MDRESP:.*]] = call swiftcc %swift.metadata_response @"$s18partial_apply_coro3SubCMa" // CHECK: %[[MD:.*]] = extractvalue %swift.metadata_response %[[MDRESP]], 0 -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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 } @parametric_casting_closure(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], ptr %1, ptr %[[MD]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 @@ -1716,7 +1716,7 @@ bb2: // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s26parametric_casting_closureTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: %{{.*}} = call swiftcc ptr %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -1724,7 +1724,7 @@ bb2: // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s26parametric_casting_closureTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: %[[RET:.*]] = call swiftcc ptr %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret ptr %[[RET]] @@ -1738,7 +1738,7 @@ bb2: // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s26parametric_casting_closureTA.{{[0-9]+}}.Frame", ptr %[[SPILL]], i32 0, i32 0 // CHECK: %[[MDRESP:.*]] = call swiftcc %swift.metadata_response @"$s18partial_apply_coro3SubCMa" // CHECK: %[[MD:.*]] = extractvalue %swift.metadata_response %[[MDRESP]], 0 -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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 } @parametric_casting_closure(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], ptr %[[PA_CTX_BOX]], ptr %[[MD]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 @@ -1760,7 +1760,7 @@ bb2: // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s26parametric_casting_closureTA.{{[0-9]+}}.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]], -// CHECK: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: %{{.*}} = call swiftcc ptr %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -1768,7 +1768,7 @@ bb2: // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s26parametric_casting_closureTA.{{[0-9]+}}.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: %[[RET:.*]] = call swiftcc ptr %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret ptr %[[RET]] @@ -1803,18 +1803,18 @@ protocol P2 { associatedtype Y : P1 } // CHECK: entry: // CHECK: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8] // CHECK: %[[PA_CTX_BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, {{.*}} -// CHECK-32: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, [12 x i8], %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 -// CHECK-64: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, [24 x i8], %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK-32: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [12 x i8], %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK-64: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [24 x i8], %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: store ptr %[[TY1]], ptr %[[PA_CTX]] // CHECK: %[[PA_CTX1:.*]] = getelementptr inbounds ptr, ptr %[[PA_CTX]], i32 1 // CHECK: store ptr %[[TY2]], ptr %[[PA_CTX1]] // CHECK: %[[PA_CTX2:.*]] = getelementptr inbounds ptr, ptr %[[PA_CTX]], i32 2 // CHECK: store ptr %[[TY3]], ptr %[[PA_CTX2]] -// CHECK-32: %[[PA_ARG:.*]] = getelementptr inbounds <{ %swift.refcounted, [12 x i8], %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 -// CHECK-64: %[[PA_ARG:.*]] = getelementptr inbounds <{ %swift.refcounted, [24 x i8], %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 -// CHECK: %[[PA_ARG_PTR:.*]] = getelementptr inbounds %TSi, ptr %[[PA_ARG]], i32 0, i32 0 +// CHECK-32: %[[PA_ARG:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [12 x i8], %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 +// CHECK-64: %[[PA_ARG:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [24 x i8], %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 +// CHECK: %[[PA_ARG_PTR:.*]] = getelementptr inbounds{{.*}} %TSi, ptr %[[PA_ARG]], i32 0, i32 0 // CHECK: store [[ARG_TYPE]] %[[ARG]], ptr %[[PA_ARG_PTR]] -// CHECK: %[[CTXPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[CTX]], i32 0, i32 0 +// CHECK: %[[CTXPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[CTX]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[CTXPTR]]) // CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @"$s24complex_generic_functionTA{{.*}}"(ptr noalias {{.*}} %[[CTXPTR]], ptr swiftself %[[PA_CTX_BOX]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 @@ -1830,19 +1830,19 @@ protocol P2 { associatedtype Y : P1 } // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s24complex_generic_functionTA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK-32: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, [12 x i8], %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 -// CHECK-64: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, [24 x i8], %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK-32: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [12 x i8], %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK-64: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [24 x i8], %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: %[[TY1:.*]] = load ptr, ptr %[[PA_CTX]] // CHECK: %[[TY2_PTR:.*]] = getelementptr inbounds ptr, ptr %[[PA_CTX]], i32 1 // CHECK: %[[TY2:.*]] = load ptr, ptr %[[TY2_PTR]] // CHECK: %[[TY3_PTR:.*]] = getelementptr inbounds ptr, ptr %[[PA_CTX]], i32 2 // CHECK: %[[TY3:.*]] = load ptr, ptr %[[TY3_PTR]] -// CHECK-32: %[[PA_ARG_PTR:.*]] = getelementptr inbounds <{ %swift.refcounted, [12 x i8], %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 -// CHECK-64: %[[PA_ARG_PTR:.*]] = getelementptr inbounds <{ %swift.refcounted, [24 x i8], %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 -// CHECK: %[[PA_ARG:.*]] = getelementptr inbounds %TSi, ptr %[[PA_ARG_PTR]], i32 0, i32 0 +// CHECK-32: %[[PA_ARG_PTR:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [12 x i8], %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 +// CHECK-64: %[[PA_ARG_PTR:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [24 x i8], %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 2 +// CHECK: %[[PA_ARG:.*]] = getelementptr inbounds{{.*}} %TSi, ptr %[[PA_ARG_PTR]], i32 0, i32 0 // CHECK: %[[ARG:.*]] = load [[ARG_TYPE]], ptr %[[PA_ARG]] // CHECK: call void @swift_release(ptr %[[PA_CTX_BOX]]) -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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 } @complex_generic_function(ptr noalias {{.*}} %[[FRAMEPTR]], [[ARG_TYPE]] %[[ARG]], ptr %[[TY1]], ptr %[[TY2]], ptr %[[TY3]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 @@ -1871,12 +1871,12 @@ bb0(%0 : $Int): // CHECK: entry: // CHECK: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8] // CHECK: %[[PA_CTX_BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, {{.*}}) -// CHECK-32: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, [4 x i8] }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 -// CHECK-64: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, [8 x i8] }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK-32: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [4 x i8] }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK-64: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [8 x i8] }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: %[[MD_RES:.*]] = call swiftcc %swift.metadata_response @"$s18partial_apply_coro18ComplexBoundedTypeVMa"({{i32|i64}} 0, ptr %[[TY1]], ptr %[[TY2]]) // CHECK: %[[MD:.*]] = extractvalue %swift.metadata_response %[[MD_RES]], 0 // CHECK: store ptr %[[MD]], ptr %[[PA_CTX]] -// CHECK: %[[CTXPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[CTX]], i32 0, i32 0 +// CHECK: %[[CTXPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[CTX]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[CTXPTR]]) // CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, ptr } @"$s16generic_functionTA{{.*}}"(ptr noalias {{.*}} %[[CTXPTR]], ptr swiftself %[[PA_CTX_BOX]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 @@ -1892,11 +1892,11 @@ bb0(%0 : $Int): // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s16generic_functionTA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK-32: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, [4 x i8] }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 -// CHECK-64: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, [8 x i8] }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK-32: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [4 x i8] }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK-64: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [8 x i8] }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: %[[MD:.*]] = load ptr, ptr %[[PA_CTX]] // CHECK: call void @swift_release(ptr %[[PA_CTX_BOX]]) -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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 } @generic_function(ptr noalias {{.*}} %[[FRAMEPTR]], ptr %[[MD]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 @@ -1936,8 +1936,8 @@ entry(%i : $Int): // CHECK-SAME: ([[ARG_TYPE:(i32|i64)]] %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[PA_CTX_BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, {{.*}}) -// CHECK: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 -// CHECK: %[[PA_ARG_PTR:.*]] = getelementptr inbounds %TSi, ptr %[[PA_CTX]], i32 0, i32 0 +// CHECK: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK: %[[PA_ARG_PTR:.*]] = getelementptr inbounds{{.*}} %TSi, ptr %[[PA_CTX]], i32 0, i32 0 // CHECK: store [[ARG_TYPE]] %[[ARG]], ptr %[[PA_ARG_PTR]] // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s23generic_indirect_returnTA{{.*}}", ptr undef }, ptr %[[PA_CTX_BOX]], 1 // CHECK: ret { ptr, ptr } %[[RET]] @@ -1965,8 +1965,8 @@ entry(%i : $Int): // CHECK-SAME: ([[ARG_TYPE:(i32|i64)]] %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[PA_CTX_BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, {{.*}}) -// CHECK: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 -// CHECK: %[[PA_ARG_PTR:.*]] = getelementptr inbounds %TSi, ptr %[[PA_CTX]], i32 0, i32 0 +// CHECK: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK: %[[PA_ARG_PTR:.*]] = getelementptr inbounds{{.*}} %TSi, ptr %[[PA_CTX]], i32 0, i32 0 // CHECK: store [[ARG_TYPE]] %[[ARG]], ptr %[[PA_ARG_PTR]] // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s24generic_indirect_return2TA{{.*}}", ptr undef }, ptr %[[PA_CTX_BOX]], 1 // CHECK: ret { ptr, ptr } %[[RET]] @@ -2002,7 +2002,7 @@ entry(%t : $@thin SwiftStruct.Type, %c : $SwiftClass): // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s3funTA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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 } @fun(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[FRAMEPTR]], ptr %[[PA_CTX_BOX]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, ptr } %[[YIELD_PAIR]], 0 @@ -2024,7 +2024,7 @@ entry(%t : $@thin SwiftStruct.Type, %c : $SwiftClass): // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s3funTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -2032,7 +2032,7 @@ entry(%t : $@thin SwiftStruct.Type, %c : $SwiftClass): // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s3funTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret void @@ -2080,7 +2080,7 @@ entry(%a : $*A2): // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s7amethodTA.Frame", ptr %[[SPILL]], i32 0, i32 0 // CHECK: store ptr %[[SELF]], ptr %[[SELFPTR]] -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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]]) @@ -2109,7 +2109,7 @@ entry(%a : $*A2): // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s7amethodTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK: store ptr %[[ERRORVAL]], ptr %[[ERRORPTR]] // CHECK: call void @free(ptr %[[FRAME]]) @@ -2118,7 +2118,7 @@ entry(%a : $*A2): // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s7amethodTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK: store ptr %[[ERRORVAL]], ptr %[[ERRORPTR]] // CHECK: call void @free(ptr %[[FRAME]]) @@ -2140,7 +2140,7 @@ bb0(%0 : $*A2): // 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 +// CHECK: %[[BOXPTR:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %T18partial_apply_coro14SwiftClassPairV }>, ptr %[[BOX]], i32 0, i32 1 // CHECK: call void @llvm.memcpy.p0.p0.{{i32|i64}}(ptr align {{4|8}} %[[BOXPTR]], ptr align {{4|8}} %[[ARG]], {{i32|i64}} [[ARG_SIZE]], i1 false) // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s45indirect_guaranteed_captured_class_pair_paramTA.{{[0-9]+}}{{.*}}", ptr undef }, ptr %[[BOX]], 1 // CHECK: ret { ptr, ptr } %[[RET]] @@ -2153,8 +2153,8 @@ bb0(%0 : $*A2): // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.{{[0-9]+}}.Frame", ptr %[[SPILL]], i32 0, i32 0 -// 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: %[[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: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 @@ -2176,7 +2176,7 @@ bb0(%0 : $*A2): // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.{{[0-9]+}}.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -2184,7 +2184,7 @@ bb0(%0 : $*A2): // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.{{[0-9]+}}.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret void @@ -2205,9 +2205,9 @@ sil public_external @use_closure2 : $@yield_once @convention(thin) (@noescape @y // CHECK: entry: // CHECK: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8] // CHECK: %[[BOX:.*]] = alloca i8 -// CHECK: %[[BOXPTR:.*]] = getelementptr inbounds <{ %swift.refcounted, ptr }>, ptr %[[BOX]], i32 0, i32 1 +// CHECK: %[[BOXPTR:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, ptr }>, ptr %[[BOX]], i32 0, i32 1 // CHECK: store ptr %[[ARG]], ptr %[[BOXPTR]] -// CHECK: %[[CTXPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[CTX]], i32 0, i32 0 +// CHECK: %[[CTXPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[CTX]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[CTXPTR]]) // CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[RES_TYPE:(i32|i64)]] } @use_closure2(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTXPTR]], ptr @"$s45indirect_guaranteed_captured_class_pair_paramTA.{{[0-9]+}}{{.*}}", ptr %[[BOX]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[RES_TYPE]] } %[[YIELD_PAIR]], 0 @@ -2224,9 +2224,9 @@ sil public_external @use_closure2 : $@yield_once @convention(thin) (@noescape @y // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.{{[0-9]+}}.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: %[[PA_ARG:.*]] = load ptr, ptr %[[PA_CTX]] -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 @@ -2248,7 +2248,7 @@ sil public_external @use_closure2 : $@yield_once @convention(thin) (@noescape @y // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.{{[0-9]+}}.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -2256,7 +2256,7 @@ sil public_external @use_closure2 : $@yield_once @convention(thin) (@noescape @y // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s45indirect_guaranteed_captured_class_pair_paramTA.{{[0-9]+}}.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret void @@ -2288,9 +2288,9 @@ entry(%i : $Int, %p : $*SwiftClassPair): // CHECK: entry: // CHECK: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8], // CHECK: %[[BOX:.*]] = alloca i8 -// CHECK: %[[BOXPTR:.*]] = getelementptr inbounds <{ %swift.refcounted, ptr }>, ptr %[[BOX]], i32 0, i32 1 +// CHECK: %[[BOXPTR:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, ptr }>, ptr %[[BOX]], i32 0, i32 1 // CHECK: store ptr %[[ARG]], ptr %[[BOXPTR]] -// CHECK: %[[CTXPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[CTX]], i32 0, i32 0 +// CHECK: %[[CTXPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[CTX]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[CTXPTR]]) // CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @use_closure2(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTXPTR]], ptr @"$s37indirect_in_captured_class_pair_paramTA{{.*}}", ptr %[[BOX]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 @@ -2308,9 +2308,9 @@ entry(%i : $Int, %p : $*SwiftClassPair): // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s37indirect_in_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: %[[PA_ARG:.*]] = load ptr, ptr %[[PA_CTX]] -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 @@ -2332,7 +2332,7 @@ entry(%i : $Int, %p : $*SwiftClassPair): // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s37indirect_in_captured_class_pair_paramTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -2340,7 +2340,7 @@ entry(%i : $Int, %p : $*SwiftClassPair): // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1]] = getelementptr inbounds %"$s37indirect_in_captured_class_pair_paramTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME1]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret void @@ -2367,7 +2367,7 @@ bb0(%x : $*SwiftClassPair): // CHECK-arm64e: [[VWTABLEADDR:%.*]] = ptrtoint ptr [[VWT_PTR]] to i64 // CHECK-arm64e: [[VWTABLEAUTH:%.*]] = call i64 @llvm.ptrauth.auth(i64 [[VWTABLEADDR]], i32 2 // CHECK-arm64e: [[VWTABLE:%.*]] = inttoptr i64 [[VWTABLEAUTH]] to ptr -// CHECK: [[FLAGS_PTR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWTABLE]], i32 0, i32 10 +// CHECK: [[FLAGS_PTR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWTABLE]], i32 0, i32 10 sil public_external @closure : $@yield_once @convention(thin) (@in_guaranteed ResilientInt, @guaranteed SwiftClass) -> (@yields @in ResilientInt) sil @test_initial_offset : $@convention(thin) (@in ResilientInt, @guaranteed SwiftClass) -> () { @@ -2489,9 +2489,9 @@ entry(%i : $Int, %ic : $*SwiftClassPair): // CHECK: entry: // CHECK: %[[CTX:.*]] = alloca [[[BUFFER_SIZE]] x i8] // CHECK: %[[BOX:.*]] = alloca i8 -// CHECK: %[[BOXPTR:.*]] = getelementptr inbounds <{ %swift.refcounted, ptr }>, ptr %[[BOX]], i32 0, i32 1 +// CHECK: %[[BOXPTR:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, ptr }>, ptr %[[BOX]], i32 0, i32 1 // CHECK: store ptr %[[ARG]], ptr %[[BOXPTR]] -// CHECK: %[[CTXPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[CTX]], i32 0, i32 0 +// CHECK: %[[CTXPTR:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[CTX]], i32 0, i32 0 // CHECK: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr %[[CTXPTR]]) // CHECK: %[[YIELD_PAIR:.*]] = call swiftcc { ptr, [[ARG_TYPE]] } @use_closure2(ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTXPTR]], ptr @"$s46indirect_in_constant_captured_class_pair_paramTA{{.*}}", ptr %[[BOX]]) // CHECK: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 @@ -2509,9 +2509,9 @@ entry(%i : $Int, %ic : $*SwiftClassPair): // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s46indirect_in_constant_captured_class_pair_paramTA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, ptr }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 // CHECK: %[[PA_ARG:.*]] = load ptr, ptr %[[PA_CTX]] -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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: %[[RESUME:.*]] = extractvalue { ptr, [[ARG_TYPE]] } %[[YIELD_PAIR]], 0 @@ -2533,7 +2533,7 @@ entry(%i : $Int, %ic : $*SwiftClassPair): // CHECK-LABEL: unwind: // CHECK: %[[RESUME_ADDR0:.*]] = getelementptr inbounds %"$s46indirect_in_constant_captured_class_pair_paramTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME0:.*]] = load ptr, ptr %[[RESUME_ADDR0]] -// CHECK: %[[CTX0:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX0:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME0]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX0]], i1 true) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: unreachable @@ -2541,7 +2541,7 @@ entry(%i : $Int, %ic : $*SwiftClassPair): // CHECK-LABEL: resume: // CHECK: %[[RESUME_ADDR1:.*]] = getelementptr inbounds %"$s46indirect_in_constant_captured_class_pair_paramTA.Frame", ptr %[[FRAME]], i32 0, i32 1 // CHECK: %[[RESUME1:.*]] = load ptr, ptr %[[RESUME_ADDR1]] -// CHECK: %[[CTX1:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 +// CHECK: %[[CTX1:.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr %[[FRAMEPTR]], i32 0, i32 0 // CHECK: call swiftcc void %[[RESUME1]](ptr noalias dereferenceable([[BUFFER_SIZE]]) %[[CTX1]], i1 false) // CHECK: call void @free(ptr %[[FRAME]]) // CHECK: ret void @@ -2571,8 +2571,8 @@ bb0(%thick : $@callee_guaranteed @yield_once @convention(thick) (Int64, Int32) - // CHECK-SAME: ([[ARG_TYPE:(i64|i32)]] %[[ARG:.*]]) // CHECK: entry: // CHECK: %[[BOX:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata -// CHECK: %[[BOXPTR:.*]] = getelementptr inbounds <{ %swift.refcounted, %TSi }>, ptr %1, i32 0, i32 1 -// CHECK: %[[ARGPTR:.*]] = getelementptr inbounds %TSi, ptr %2, i32 0, i32 0 +// CHECK: %[[BOXPTR:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %TSi }>, ptr %1, i32 0, i32 1 +// CHECK: %[[ARGPTR:.*]] = getelementptr inbounds{{.*}} %TSi, ptr %2, i32 0, i32 0 // CHECK: store [[ARG_TYPE]] %[[ARG]], ptr %[[ARGPTR]] // CHECK: %[[RET:.*]] = insertvalue { ptr, ptr } { ptr @"$s16external_closureTA{{.*}}", ptr undef }, ptr %[[BOX]], 1 // CHECK: ret { ptr, ptr } %[[RET]] @@ -2584,10 +2584,10 @@ bb0(%thick : $@callee_guaranteed @yield_once @convention(thick) (Int64, Int32) - // CHECK: %[[SPILL:.*]] = call ptr @malloc // CHECK: store ptr %[[SPILL]], ptr %[[CTX]] // CHECK: %[[FRAME:.*]] = getelementptr inbounds %"$s16external_closureTA.Frame", ptr %[[SPILL]], i32 0, i32 0 -// CHECK: %[[PA_CTX:.*]] = getelementptr inbounds <{ %swift.refcounted, %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 -// CHECK: %[[PA_ARG:.*]] = getelementptr inbounds %TSi, ptr %[[PA_CTX]], i32 0, i32 0 +// CHECK: %[[PA_CTX:.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, %TSi }>, ptr %[[PA_CTX_BOX]], i32 0, i32 1 +// CHECK: %[[PA_ARG:.*]] = getelementptr inbounds{{.*}} %TSi, ptr %[[PA_CTX]], i32 0, i32 0 // CHECK: %[[ARG2:.*]] = load [[ARG_TYPE]], ptr %[[PA_ARG]] -// CHECK: %[[FRAMEPTR:.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr %[[FRAME]], i32 0, i32 0 +// 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]]) diff --git a/test/IRGen/partial_apply_forwarder.sil b/test/IRGen/partial_apply_forwarder.sil index 8f1af66496687..ae8a0f604372b 100644 --- a/test/IRGen/partial_apply_forwarder.sil +++ b/test/IRGen/partial_apply_forwarder.sil @@ -170,15 +170,15 @@ sil hidden_external @takingQAndS : $@convention(thin) <Ï„_0_0 where Ï„_0_0 : Q> // CHECK: [[WBREF:%.*]] = call noalias ptr @swift_allocObject(ptr [[WBTY]] // CHECK: [[CONTEXT0:%.*]] = call noalias ptr @swift_allocObject -// CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds <{ %swift.refcounted,{{.*}} %T23partial_apply_forwarder1SV, ptr }>, ptr [[CONTEXT0]], i32 0, i32 {{(1|2)}} +// CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted,{{.*}} %T23partial_apply_forwarder1SV, ptr }>, ptr [[CONTEXT0]], i32 0, i32 {{(1|2)}} // CHECK: [[WITNESS:%.*]] = call ptr @swift_getWitnessTable(ptr @"$s23partial_apply_forwarder12BaseProducerVyxGAA1QAAMc", ptr [[BPTY]], ptr undef) // CHECK: store ptr [[WITNESS]], ptr [[WITNESS_ADDR]] -// CHECK: [[SADDR:%.*]] = getelementptr inbounds <{ %swift.refcounted,{{.*}} %T23partial_apply_forwarder1SV, ptr }>, ptr [[CONTEXT0]], i32 0, i32 {{(2|3)}} -// CHECK: [[XADDR:%.*]] = getelementptr inbounds %T23partial_apply_forwarder1SV, ptr [[SADDR]], i32 0, i32 0 +// CHECK: [[SADDR:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted,{{.*}} %T23partial_apply_forwarder1SV, ptr }>, ptr [[CONTEXT0]], i32 0, i32 {{(2|3)}} +// CHECK: [[XADDR:%.*]] = getelementptr inbounds{{.*}} %T23partial_apply_forwarder1SV, ptr [[SADDR]], i32 0, i32 0 // CHECK: store i64 %1, ptr [[XADDR]] -// CHECK: [[WBADDR:%.*]] = getelementptr inbounds <{ %swift.refcounted,{{.*}} %T23partial_apply_forwarder1SV, ptr }>, ptr [[CONTEXT0]], i32 0, i32 {{(3|4)}} +// CHECK: [[WBADDR:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted,{{.*}} %T23partial_apply_forwarder1SV, ptr }>, ptr [[CONTEXT0]], i32 0, i32 {{(3|4)}} // CHECK: store ptr [[WBREF]], ptr [[WBADDR]] // CHECK: [[CLOSURE:%.*]] = insertvalue { ptr, ptr } { ptr @"$s11takingQAndSTA{{(\.ptrauth)?}}", ptr undef }, ptr [[CONTEXT0]], 1 // CHECK: ret { ptr, ptr } [[CLOSURE]] @@ -186,14 +186,14 @@ sil hidden_external @takingQAndS : $@convention(thin) <Ï„_0_0 where Ï„_0_0 : Q> // CHECK-LABEL: define internal swiftcc void @"$s11takingQAndSTA"(ptr swiftself %0) // CHECK: entry: -// CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds <{ %swift.refcounted,{{.*}} %T23partial_apply_forwarder1SV, ptr }>, ptr %0, i32 0, i32 {{(1|2)}} +// CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted,{{.*}} %T23partial_apply_forwarder1SV, ptr }>, ptr %0, i32 0, i32 {{(1|2)}} // CHECK: [[WITNESS:%.*]] = load ptr, ptr [[WITNESS_ADDR]] -// CHECK: [[SADDR:%.*]] = getelementptr inbounds <{ %swift.refcounted,{{.*}} %T23partial_apply_forwarder1SV, ptr }>, ptr %0, i32 0, i32 {{(2|3)}} -// CHECK: [[XADDR:%.*]] = getelementptr inbounds %T23partial_apply_forwarder1SV, ptr [[SADDR]], i32 0, i32 0 +// CHECK: [[SADDR:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted,{{.*}} %T23partial_apply_forwarder1SV, ptr }>, ptr %0, i32 0, i32 {{(2|3)}} +// CHECK: [[XADDR:%.*]] = getelementptr inbounds{{.*}} %T23partial_apply_forwarder1SV, ptr [[SADDR]], i32 0, i32 0 // CHECK: [[X:%.*]] = load i64, ptr [[XADDR]] -// CHECK: [[WBADDR:%.*]] = getelementptr inbounds <{ %swift.refcounted,{{.*}} %T23partial_apply_forwarder1SV, ptr }>, ptr %0, i32 0, i32 {{(3|4)}} +// CHECK: [[WBADDR:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted,{{.*}} %T23partial_apply_forwarder1SV, ptr }>, ptr %0, i32 0, i32 {{(3|4)}} // CHECK: [[WB:%.*]] = load ptr, ptr [[WBADDR]] // CHECK: call ptr @swift_retain(ptr returned [[WB]]) // CHECK: [[TY:%.*]] = load ptr, ptr [[WB]] diff --git a/test/IRGen/partial_apply_objc.sil b/test/IRGen/partial_apply_objc.sil index 8d538f79ad261..f777edfec7c57 100644 --- a/test/IRGen/partial_apply_objc.sil +++ b/test/IRGen/partial_apply_objc.sil @@ -51,22 +51,22 @@ bb0(%0 : $ObjCClass): // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @indirect_partial_apply(ptr %0, ptr %1, i64 %2) {{.*}} { // CHECK: entry: // CHECK: [[OBJ:%.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata, i32 0, i32 2), i64 40, i64 7) -// CHECK: [[X_ADDR:%.*]] = getelementptr inbounds [[DATA_TYPE:<{ %swift.refcounted, i64, ptr, ptr }>]], ptr [[OBJ]], i32 0, i32 1 +// CHECK: [[X_ADDR:%.*]] = getelementptr inbounds{{.*}} [[DATA_TYPE:<{ %swift.refcounted, i64, ptr, ptr }>]], ptr [[OBJ]], i32 0, i32 1 // CHECK: store i64 %2, ptr [[X_ADDR]], align 8 -// CHECK: [[CONTEXT_ADDR:%.*]] = getelementptr inbounds [[DATA_TYPE]], ptr [[OBJ]], i32 0, i32 2 +// CHECK: [[CONTEXT_ADDR:%.*]] = getelementptr inbounds{{.*}} [[DATA_TYPE]], ptr [[OBJ]], i32 0, i32 2 // CHECK: store ptr %1, ptr [[CONTEXT_ADDR]], align 8 -// CHECK: [[FN_ADDR:%.*]] = getelementptr inbounds [[DATA_TYPE]], ptr [[OBJ]], i32 0, i32 3 +// CHECK: [[FN_ADDR:%.*]] = getelementptr inbounds{{.*}} [[DATA_TYPE]], ptr [[OBJ]], i32 0, i32 3 // CHECK: store ptr %0, ptr [[FN_ADDR]], align 8 // CHECK: [[RET:%.*]] = insertvalue { ptr, ptr } { ptr [[INDIRECT_PARTIAL_APPLY_STUB:@"\$sTA[A-Za-z0-9_]*"]], ptr undef }, ptr [[OBJ]], 1 // CHECK: ret { ptr, ptr } [[RET]] // CHECK: } // CHECK: define internal swiftcc void [[INDIRECT_PARTIAL_APPLY_STUB]](ptr swiftself %0) {{.*}} { // CHECK: entry: -// CHECK: [[X_ADDR:%.*]] = getelementptr inbounds [[DATA_TYPE]], ptr %0, i32 0, i32 1 +// CHECK: [[X_ADDR:%.*]] = getelementptr inbounds{{.*}} [[DATA_TYPE]], ptr %0, i32 0, i32 1 // CHECK: [[X:%.*]] = load i64, ptr [[X_ADDR]], align 8 -// CHECK: [[CONTEXT_ADDR:%.*]] = getelementptr inbounds [[DATA_TYPE]], ptr %0, i32 0, i32 2 +// CHECK: [[CONTEXT_ADDR:%.*]] = getelementptr inbounds{{.*}} [[DATA_TYPE]], ptr %0, i32 0, i32 2 // CHECK: [[CONTEXT:%.*]] = load ptr, ptr [[CONTEXT_ADDR]], align 8 -// CHECK: [[FN_ADDR:%.*]] = getelementptr inbounds [[DATA_TYPE]], ptr %0, i32 0, i32 3 +// CHECK: [[FN_ADDR:%.*]] = getelementptr inbounds{{.*}} [[DATA_TYPE]], ptr %0, i32 0, i32 3 // CHECK: [[FN_PTR:%.*]] = load ptr, ptr [[FN_ADDR]], align 8 // CHECK: tail call swiftcc void [[FN_PTR]](i64 [[X]], ptr swiftself [[CONTEXT]]) // CHECK: ret void @@ -81,7 +81,7 @@ entry(%f : $@callee_owned (Builtin.Word) -> (), %x : $Builtin.Word): // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @objc_partial_apply(ptr %0) {{.*}} { // CHECK: entry: // CHECK: [[OBJ:%.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%swift.full_boxmetadata, ptr @metadata.2, i32 0, i32 2), i64 24, i64 7) -// CHECK: [[X_ADDR:%.*]] = getelementptr inbounds [[DATA_TYPE:<{ %swift.refcounted, ptr }>]], ptr [[OBJ]], i32 0, i32 1 +// CHECK: [[X_ADDR:%.*]] = getelementptr inbounds{{.*}} [[DATA_TYPE:<{ %swift.refcounted, ptr }>]], ptr [[OBJ]], i32 0, i32 1 // CHECK: store ptr %0, ptr [[X_ADDR]], align 8 // CHECK: [[RET:%.*]] = insertvalue { ptr, ptr } { ptr [[OBJC_PARTIAL_APPLY_STUB:@"\$sTa[A-Za-z0-9_]*"]], ptr undef }, ptr [[OBJ]], 1 // CHECK: ret { ptr, ptr } [[RET]] @@ -90,7 +90,7 @@ entry(%f : $@callee_owned (Builtin.Word) -> (), %x : $Builtin.Word): // CHECK: entry: // CHECK-NOT: swift_retain // CHECK-NOT: swift_retain -// CHECK: [[X_ADDR:%.*]] = getelementptr inbounds [[DATA_TYPE]], ptr %1, i32 0, i32 1 +// CHECK: [[X_ADDR:%.*]] = getelementptr inbounds{{.*}} [[DATA_TYPE]], ptr %1, i32 0, i32 1 // CHECK-NOT: swift_retain // CHECK: [[SELF:%.*]] = load ptr, ptr [[X_ADDR]], align 8 // CHECK-NOT: swift_retain @@ -109,16 +109,16 @@ entry(%c : $ObjCClass): // CHECK-LABEL: define{{.*}} { ptr, ptr } @objc_partial_apply_indirect_sil_argument(ptr %0) {{.*}} // CHECK: [[CTX:%.*]] = call noalias ptr @swift_allocObject -// CHECK: [[SELF_ADDR:%.*]] = getelementptr inbounds [[CTXTYPE:<{ %swift.refcounted, ptr }>]], ptr [[CTX]], i32 0, i32 1 +// CHECK: [[SELF_ADDR:%.*]] = getelementptr inbounds{{.*}} [[CTXTYPE:<{ %swift.refcounted, ptr }>]], ptr [[CTX]], i32 0, i32 1 // CHECK: store ptr %0, ptr [[SELF_ADDR]] // CHECK: [[CLOSURE:%.*]] = insertvalue { ptr, ptr } { ptr [[OBJC_PARTIAL_APPLY_STUB2:@"\$sTa[A-Za-z0-9_.]*"]], ptr undef }, ptr [[CTX]], 1 // CHECK: ret { ptr, ptr } [[CLOSURE]] // CHECK:} // CHECK: define internal swiftcc void [[OBJC_PARTIAL_APPLY_STUB2]](double %0, double %1, double %2, double %3, ptr // CHECK: [[TMP:%.*]] = alloca %TSo6NSRectV -// CHECK: [[ORIGIN:%.*]] = getelementptr inbounds %TSo6NSRectV, ptr [[TMP]] -// CHECK: [[ORIGINX:%.*]] = getelementptr inbounds %TSo7NSPointV, ptr [[ORIGIN]] -// CHECK: [[ORIGINXVAL:%*]] = getelementptr inbounds %TSd, ptr [[ORIGINX]] +// CHECK: [[ORIGIN:%.*]] = getelementptr inbounds{{.*}} %TSo6NSRectV, ptr [[TMP]] +// CHECK: [[ORIGINX:%.*]] = getelementptr inbounds{{.*}} %TSo7NSPointV, ptr [[ORIGIN]] +// CHECK: [[ORIGINXVAL:%*]] = getelementptr inbounds{{.*}} %TSd, ptr [[ORIGINX]] // CHECK: store double %0, ptr [[ORIGINXVAL]] sil @objc_partial_apply_indirect_sil_argument : $@convention(thin) (ObjCClass) -> @callee_owned (NSRect) -> () { entry(%c : $ObjCClass): @@ -130,7 +130,7 @@ entry(%c : $ObjCClass): // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @objc_partial_apply_consumes_self(ptr %0) {{.*}} { // CHECK: insertvalue {{.*}} [[OBJC_CONSUMES_SELF_PARTIAL_APPLY_STUB:@"\$sTa[A-Za-z0-9_.]*"]] // CHECK: define internal swiftcc ptr [[OBJC_CONSUMES_SELF_PARTIAL_APPLY_STUB]](ptr swiftself %0) {{.*}} { -// CHECK: [[X_ADDR:%.*]] = getelementptr inbounds [[DATA_TYPE:<{ %swift.refcounted, ptr }>]], ptr %0, i32 0, i32 1 +// CHECK: [[X_ADDR:%.*]] = getelementptr inbounds{{.*}} [[DATA_TYPE:<{ %swift.refcounted, ptr }>]], ptr %0, i32 0, i32 1 // CHECK: [[SELF:%.*]] = load ptr, ptr [[X_ADDR]], align 8 // CHECK: call ptr @llvm.objc.retain(ptr [[SELF]]) // CHECK: [[CMD:%.*]] = load ptr, ptr @"\01L_selector(fakeInitFamily)", align 8 @@ -190,11 +190,11 @@ entry(%c : $Gizmo): // CHECK: define internal swiftcc void @"$sTa.17"(i64 %0, i64 %1, i64 %2, ptr swiftself %3) // CHECK: [[TMPCOERCE:%.*]] = alloca { i64, i64, i64 } // CHECK: [[INDIRECTTEMP:%.*]] = alloca %TSo3FobV -// CHECK: [[ADDR:%.*]] = getelementptr inbounds { i64, i64, i64 }, ptr [[TMPCOERCE]], i32 0, i32 0 +// CHECK: [[ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64, i64 }, ptr [[TMPCOERCE]], i32 0, i32 0 // CHECK: store i64 %0, ptr [[ADDR]] -// CHECK: [[ADDR:%.]] = getelementptr inbounds { i64, i64, i64 }, ptr [[TMPCOERCE]], i32 0, i32 1 +// CHECK: [[ADDR:%.]] = getelementptr inbounds{{.*}} { i64, i64, i64 }, ptr [[TMPCOERCE]], i32 0, i32 1 // CHECK: store i64 %1, ptr [[ADDR]] -// CHECK: [[ADDR:%.*]] = getelementptr inbounds { i64, i64, i64 }, ptr [[TMPCOERCE]], i32 0, i32 2 +// CHECK: [[ADDR:%.*]] = getelementptr inbounds{{.*}} { i64, i64, i64 }, ptr [[TMPCOERCE]], i32 0, i32 2 // CHECK: store i64 %2, ptr [[ADDR]] // CHECK: load i64 // CHECK: load i32 diff --git a/test/IRGen/protocol_resilience.sil b/test/IRGen/protocol_resilience.sil index 7d2c1784e7401..dcd3871e88bd9 100644 --- a/test/IRGen/protocol_resilience.sil +++ b/test/IRGen/protocol_resilience.sil @@ -173,7 +173,7 @@ bb0(%0 : $*Self): // implementation // CHECK-NEXT: [[CONTEXT:%.*]] = call noalias ptr @swift_allocObject({{.*}}) - // CHECK: [[WTABLE_ADDR:%.*]] = getelementptr inbounds <{ %swift.refcounted, [{{4|8}} x i8], ptr }>, ptr [[CONTEXT]], i32 0, i32 2 + // CHECK: [[WTABLE_ADDR:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [{{4|8}} x i8], ptr }>, ptr [[CONTEXT]], i32 0, i32 2 // CHECK-NEXT: store ptr %SelfWitnessTable, ptr [[WTABLE_ADDR]] %fn3 = function_ref @defaultC : $@convention(witness_method: ResilientProtocol) (@in_guaranteed Self) -> () @@ -211,7 +211,7 @@ bb0(%0 : $@thick Self.Type): // implementation // CHECK-NEXT: [[CONTEXT:%.*]] = call noalias ptr @swift_allocObject({{.*}}) - // CHECK: [[WTABLE_ADDR:%.*]] = getelementptr inbounds <{ %swift.refcounted, [{{4|8}} x i8], ptr }>, ptr [[CONTEXT]], i32 0, i32 2 + // CHECK: [[WTABLE_ADDR:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, [{{4|8}} x i8], ptr }>, ptr [[CONTEXT]], i32 0, i32 2 // CHECK-NEXT: store ptr %SelfWitnessTable, ptr [[WTABLE_ADDR]] %fn3 = function_ref @defaultF : $@convention(witness_method: ResilientProtocol) (@thick Self.Type) -> () @@ -289,7 +289,7 @@ bb0(%0 : $*ConformingStruct): // Make sure we can partially apply direct references to default implementations // CHECK-NEXT: [[CONTEXT:%.*]] = call noalias ptr @swift_allocObject({{.*}}) - // CHECK-NEXT: [[WTABLE:%.*]] = getelementptr inbounds <{ %swift.refcounted, ptr }>, ptr [[CONTEXT]], i32 0, i32 1 + // CHECK-NEXT: [[WTABLE:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, ptr }>, ptr [[CONTEXT]], i32 0, i32 1 // CHECK-NEXT: store ptr %SelfWitnessTable, ptr [[WTABLE]] %fn1 = function_ref @defaultC : $@convention(witness_method: ResilientProtocol) (@in_guaranteed Self) -> () diff --git a/test/IRGen/raw_layout.swift b/test/IRGen/raw_layout.swift index 2c0200be2182a..3479536941d6b 100644 --- a/test/IRGen/raw_layout.swift +++ b/test/IRGen/raw_layout.swift @@ -430,7 +430,7 @@ entry(%0 : $*Cell): //===----------------------------------------------------------------------===// // CHECK-LABEL: define {{.*}} void @"$s10raw_layout18ConcreteMoveAsLikeVwxx"(ptr {{.*}} %object, ptr %ConcreteMoveAsLike) -// CHECK: [[OBJ_CELL:%.*]] = getelementptr inbounds %T10raw_layout18ConcreteMoveAsLikeV, ptr %object, i32 0, i32 0 +// CHECK: [[OBJ_CELL:%.*]] = getelementptr inbounds{{.*}} %T10raw_layout18ConcreteMoveAsLikeV, ptr %object, i32 0, i32 0 // CHECK: {{invoke void|invoke ptr|call void|call ptr}} @{{.*}}(ptr [[OBJ_CELL]]) //===----------------------------------------------------------------------===// @@ -438,8 +438,8 @@ entry(%0 : $*Cell): //===----------------------------------------------------------------------===// // CHECK-LABEL: define {{.*}} ptr @"$s10raw_layout18ConcreteMoveAsLikeVwtk"(ptr {{.*}} %dest, ptr {{.*}} %src, ptr %ConcreteMoveAsLike) -// CHECK: [[DEST_CELL:%.*]] = getelementptr inbounds %T10raw_layout18ConcreteMoveAsLikeV, ptr %dest, i32 0, i32 0 -// CHECK: [[SRC_CELL:%.*]] = getelementptr inbounds %T10raw_layout18ConcreteMoveAsLikeV, ptr %src, i32 0, i32 0 +// CHECK: [[DEST_CELL:%.*]] = getelementptr inbounds{{.*}} %T10raw_layout18ConcreteMoveAsLikeV, ptr %dest, i32 0, i32 0 +// CHECK: [[SRC_CELL:%.*]] = getelementptr inbounds{{.*}} %T10raw_layout18ConcreteMoveAsLikeV, ptr %src, i32 0, i32 0 // CHECK: {{invoke void|invoke ptr|call ptr}} @{{.*}}(ptr [[DEST_CELL]], ptr [[SRC_CELL]]) //===----------------------------------------------------------------------===// @@ -447,8 +447,8 @@ entry(%0 : $*Cell): //===----------------------------------------------------------------------===// // CHECK-LABEL: define {{.*}} ptr @"$s10raw_layout18ConcreteMoveAsLikeVwta"(ptr {{.*}} %dest, ptr {{.*}} %src, ptr %ConcreteMoveAsLike) -// CHECK: [[DEST_CELL:%.*]] = getelementptr inbounds %T10raw_layout18ConcreteMoveAsLikeV, ptr %dest, i32 0, i32 0 -// CHECK: [[SRC_CELL:%.*]] = getelementptr inbounds %T10raw_layout18ConcreteMoveAsLikeV, ptr %src, i32 0, i32 0 +// CHECK: [[DEST_CELL:%.*]] = getelementptr inbounds{{.*}} %T10raw_layout18ConcreteMoveAsLikeV, ptr %dest, i32 0, i32 0 +// CHECK: [[SRC_CELL:%.*]] = getelementptr inbounds{{.*}} %T10raw_layout18ConcreteMoveAsLikeV, ptr %src, i32 0, i32 0 // CHECK: {{invoke void|invoke ptr|call ptr}} @{{.*}}(ptr [[DEST_CELL]], ptr [[SRC_CELL]]) //===----------------------------------------------------------------------===// @@ -469,7 +469,7 @@ entry(%0 : $*Cell): // CHECK: store {{i64|i32}} [[NEW_I]], ptr [[I_ALLOCA]] // CHECK: [[T_ADDR:%.*]] = getelementptr inbounds ptr, ptr %"SmallVectorOf2MovesAsLike", {{i64|i32}} 2 // CHECK-NEXT: [[T:%.*]] = load ptr, ptr [[T_ADDR]] -// CHECK: [[STRIDE_GEP:%.*]] = getelementptr inbounds %swift.vwtable, ptr {{%.*}}, i32 0, i32 9 +// CHECK: [[STRIDE_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr {{%.*}}, i32 0, i32 9 // CHECK-NEXT: [[STRIDE:%.*]] = load {{i64|i32}}, ptr [[STRIDE_GEP]] // CHECK: [[OFFSET:%.*]] = mul {{i64|i32}} [[I]], [[STRIDE]] // CHECK-NEXT: [[OBJ_ELT:%.*]] = getelementptr inbounds i8, ptr %object, {{i64|i32}} [[OFFSET]] @@ -498,7 +498,7 @@ entry(%0 : $*Cell): // CHECK: store {{i64|i32}} [[NEW_I]], ptr [[I_ALLOCA]] // CHECK: [[T_ADDR:%.*]] = getelementptr inbounds ptr, ptr %"SmallVectorOf2MovesAsLike", {{i64|i32}} 2 // CHECK-NEXT: [[T:%.*]] = load ptr, ptr [[T_ADDR]] -// CHECK: [[STRIDE_GEP:%.*]] = getelementptr inbounds %swift.vwtable, ptr {{%.*}}, i32 0, i32 9 +// CHECK: [[STRIDE_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr {{%.*}}, i32 0, i32 9 // CHECK-NEXT: [[STRIDE:%.*]] = load {{i64|i32}}, ptr [[STRIDE_GEP]] // CHECK: [[OFFSET_0:%.*]] = mul {{i64|i32}} [[I]], [[STRIDE]] // CHECK-NEXT: [[SRC_ELT_0:%.*]] = getelementptr inbounds i8, ptr %src, {{i64|i32}} [[OFFSET_0]] @@ -528,7 +528,7 @@ entry(%0 : $*Cell): // CHECK: store {{i64|i32}} [[NEW_I]], ptr [[I_ALLOCA]] // CHECK: [[T_ADDR:%.*]] = getelementptr inbounds ptr, ptr %"SmallVectorOf2MovesAsLike", {{i64|i32}} 2 // CHECK-NEXT: [[T:%.*]] = load ptr, ptr [[T_ADDR]] -// CHECK: [[STRIDE_GEP:%.*]] = getelementptr inbounds %swift.vwtable, ptr {{%.*}}, i32 0, i32 9 +// CHECK: [[STRIDE_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr {{%.*}}, i32 0, i32 9 // CHECK-NEXT: [[STRIDE:%.*]] = load {{i64|i32}}, ptr [[STRIDE_GEP]] // CHECK: [[OFFSET_0:%.*]] = mul {{i64|i32}} [[I]], [[STRIDE]] // CHECK-NEXT: [[SRC_ELT_0:%.*]] = getelementptr inbounds i8, ptr %src, {{i64|i32}} [[OFFSET_0]] @@ -546,7 +546,7 @@ entry(%0 : $*Cell): // CHECK-LABEL: define {{.*}} void @"$s10raw_layout30ConcreteSmallVectorMovesAsLikeVwxx"(ptr {{.*}} %object, ptr %ConcreteSmallVectorMovesAsLike) // CHECK: [[I_ALLOCA:%.*]] = alloca {{i64|i32}} -// CHECK: [[OBJ_VECTOR:%.*]] = getelementptr inbounds %T10raw_layout30ConcreteSmallVectorMovesAsLikeV, ptr %object, i32 0, i32 0 +// CHECK: [[OBJ_VECTOR:%.*]] = getelementptr inbounds{{.*}} %T10raw_layout30ConcreteSmallVectorMovesAsLikeV, ptr %object, i32 0, i32 0 // CHECK: store {{i64|i32}} 0, ptr [[I_ALLOCA]] // CHECK: br label %[[COND_BR:.*]] @@ -573,8 +573,8 @@ entry(%0 : $*Cell): // CHECK-LABEL: define {{.*}} ptr @"$s10raw_layout30ConcreteSmallVectorMovesAsLikeVwtk"(ptr {{.*}} %dest, ptr {{.*}} %src, ptr %ConcreteSmallVectorMovesAsLike) // CHECK: [[I_ALLOCA:%.*]] = alloca {{i64|i32}} -// CHECK: [[DEST_VECTOR:%.*]] = getelementptr inbounds %T10raw_layout30ConcreteSmallVectorMovesAsLikeV, ptr %dest, i32 0, i32 0 -// CHECK: [[SRC_VECTOR:%.*]] = getelementptr inbounds %T10raw_layout30ConcreteSmallVectorMovesAsLikeV, ptr %src, i32 0, i32 0 +// CHECK: [[DEST_VECTOR:%.*]] = getelementptr inbounds{{.*}} %T10raw_layout30ConcreteSmallVectorMovesAsLikeV, ptr %dest, i32 0, i32 0 +// CHECK: [[SRC_VECTOR:%.*]] = getelementptr inbounds{{.*}} %T10raw_layout30ConcreteSmallVectorMovesAsLikeV, ptr %src, i32 0, i32 0 // CHECK: store {{i64|i32}} 0, ptr [[I_ALLOCA]] // CHECK: br label %[[COND_BR:.*]] @@ -602,8 +602,8 @@ entry(%0 : $*Cell): // CHECK-LABEL: define {{.*}} ptr @"$s10raw_layout30ConcreteSmallVectorMovesAsLikeVwta"(ptr {{.*}} %dest, ptr {{.*}} %src, ptr %ConcreteSmallVectorMovesAsLike) // CHECK: [[I_ALLOCA:%.*]] = alloca {{i64|i32}} -// CHECK: [[DEST_VECTOR:%.*]] = getelementptr inbounds %T10raw_layout30ConcreteSmallVectorMovesAsLikeV, ptr %dest, i32 0, i32 0 -// CHECK: [[SRC_VECTOR:%.*]] = getelementptr inbounds %T10raw_layout30ConcreteSmallVectorMovesAsLikeV, ptr %src, i32 0, i32 0 +// CHECK: [[DEST_VECTOR:%.*]] = getelementptr inbounds{{.*}} %T10raw_layout30ConcreteSmallVectorMovesAsLikeV, ptr %dest, i32 0, i32 0 +// CHECK: [[SRC_VECTOR:%.*]] = getelementptr inbounds{{.*}} %T10raw_layout30ConcreteSmallVectorMovesAsLikeV, ptr %src, i32 0, i32 0 // CHECK: store {{i64|i32}} 0, ptr [[I_ALLOCA]] // CHECK: br label %[[COND_BR:.*]] @@ -655,7 +655,7 @@ entry(%0 : $*Cell): // CHECK: store {{i64|i32}} [[NEW_I]], ptr [[I_ALLOCA]] // CHECK: [[T_ADDR:%.*]] = getelementptr inbounds ptr, ptr %"VectorMovesAsLike", {{i64|i32}} 2 // CHECK-NEXT: [[T:%.*]] = load ptr, ptr [[T_ADDR]] -// CHECK: [[STRIDE_GEP:%.*]] = getelementptr inbounds %swift.vwtable, ptr {{%.*}}, i32 0, i32 9 +// CHECK: [[STRIDE_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr {{%.*}}, i32 0, i32 9 // CHECK-NEXT: [[STRIDE:%.*]] = load {{i64|i32}}, ptr [[STRIDE_GEP]] // CHECK: [[OFFSET:%.*]] = mul {{i64|i32}} [[I]], [[STRIDE]] // CHECK-NEXT: [[OBJECT:%.*]] = getelementptr inbounds i8, ptr %object, {{i64|i32}} [[OFFSET]] @@ -687,7 +687,7 @@ entry(%0 : $*Cell): // CHECK: store {{i64|i32}} [[NEW_I]], ptr [[I_ALLOCA]] // CHECK: [[T_ADDR:%.*]] = getelementptr inbounds ptr, ptr %"VectorMovesAsLike", {{i64|i32}} 2 // CHECK-NEXT: [[T:%.*]] = load ptr, ptr [[T_ADDR]] -// CHECK: [[STRIDE_GEP:%.*]] = getelementptr inbounds %swift.vwtable, ptr {{%.*}}, i32 0, i32 9 +// CHECK: [[STRIDE_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr {{%.*}}, i32 0, i32 9 // CHECK-NEXT: [[STRIDE:%.*]] = load {{i64|i32}}, ptr [[STRIDE_GEP]] // CHECK: [[OFFSET_0:%.*]] = mul {{i64|i32}} [[I]], [[STRIDE]] // CHECK-NEXT: [[SRC_ELT_0:%.*]] = getelementptr inbounds i8, ptr %src, {{i64|i32}} [[OFFSET_0]] @@ -720,7 +720,7 @@ entry(%0 : $*Cell): // CHECK: store {{i64|i32}} [[NEW_I]], ptr [[I_ALLOCA]] // CHECK: [[T_ADDR:%.*]] = getelementptr inbounds ptr, ptr %"VectorMovesAsLike", {{i64|i32}} 2 // CHECK-NEXT: [[T:%.*]] = load ptr, ptr [[T_ADDR]] -// CHECK: [[STRIDE_GEP:%.*]] = getelementptr inbounds %swift.vwtable, ptr {{%.*}}, i32 0, i32 9 +// CHECK: [[STRIDE_GEP:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr {{%.*}}, i32 0, i32 9 // CHECK-NEXT: [[STRIDE:%.*]] = load {{i64|i32}}, ptr [[STRIDE_GEP]] // CHECK: [[OFFSET_0:%.*]] = mul {{i64|i32}} [[I]], [[STRIDE]] // CHECK-NEXT: [[SRC_ELT_0:%.*]] = getelementptr inbounds i8, ptr %src, {{i64|i32}} [[OFFSET_0]] @@ -738,7 +738,7 @@ entry(%0 : $*Cell): // CHECK-LABEL: define {{.*}} void @"$s10raw_layout25ConcreteVectorMovesAsLikeVwxx"(ptr {{.*}} %object, ptr %ConcreteVectorMovesAsLike) // CHECK: [[I_ALLOCA:%.*]] = alloca {{i64|i32}} -// CHECK: [[OBJ_VECTOR:%.*]] = getelementptr inbounds %T10raw_layout25ConcreteVectorMovesAsLikeV, ptr %object, i32 0, i32 0 +// CHECK: [[OBJ_VECTOR:%.*]] = getelementptr inbounds{{.*}} %T10raw_layout25ConcreteVectorMovesAsLikeV, ptr %object, i32 0, i32 0 // CHECK: store {{i64|i32}} 0, ptr [[I_ALLOCA]] // CHECK: br label %[[COND_BR:.*]] @@ -765,8 +765,8 @@ entry(%0 : $*Cell): // CHECK-LABEL: define {{.*}} ptr @"$s10raw_layout25ConcreteVectorMovesAsLikeVwtk"(ptr {{.*}} %dest, ptr {{.*}} %src, ptr %ConcreteVectorMovesAsLike) // CHECK: [[I_ALLOCA:%.*]] = alloca {{i64|i32}} -// CHECK: [[DEST_VECTOR:%.*]] = getelementptr inbounds %T10raw_layout25ConcreteVectorMovesAsLikeV, ptr %dest, i32 0, i32 0 -// CHECK: [[SRC_VECTOR:%.*]] = getelementptr inbounds %T10raw_layout25ConcreteVectorMovesAsLikeV, ptr %src, i32 0, i32 0 +// CHECK: [[DEST_VECTOR:%.*]] = getelementptr inbounds{{.*}} %T10raw_layout25ConcreteVectorMovesAsLikeV, ptr %dest, i32 0, i32 0 +// CHECK: [[SRC_VECTOR:%.*]] = getelementptr inbounds{{.*}} %T10raw_layout25ConcreteVectorMovesAsLikeV, ptr %src, i32 0, i32 0 // CHECK: store {{i64|i32}} 0, ptr [[I_ALLOCA]] // CHECK: br label %[[COND_BR:.*]] @@ -794,8 +794,8 @@ entry(%0 : $*Cell): // CHECK-LABEL: define {{.*}} ptr @"$s10raw_layout25ConcreteVectorMovesAsLikeVwta"(ptr {{.*}} %dest, ptr {{.*}} %src, ptr %ConcreteVectorMovesAsLike) // CHECK: [[I_ALLOCA:%.*]] = alloca {{i64|i32}} -// CHECK: [[DEST_VECTOR:%.*]] = getelementptr inbounds %T10raw_layout25ConcreteVectorMovesAsLikeV, ptr %dest, i32 0, i32 0 -// CHECK: [[SRC_VECTOR:%.*]] = getelementptr inbounds %T10raw_layout25ConcreteVectorMovesAsLikeV, ptr %src, i32 0, i32 0 +// CHECK: [[DEST_VECTOR:%.*]] = getelementptr inbounds{{.*}} %T10raw_layout25ConcreteVectorMovesAsLikeV, ptr %dest, i32 0, i32 0 +// CHECK: [[SRC_VECTOR:%.*]] = getelementptr inbounds{{.*}} %T10raw_layout25ConcreteVectorMovesAsLikeV, ptr %src, i32 0, i32 0 // CHECK: store {{i64|i32}} 0, ptr [[I_ALLOCA]] // CHECK: br label %[[COND_BR:.*]] diff --git a/test/IRGen/relative_protocol_witness_table.swift b/test/IRGen/relative_protocol_witness_table.swift index 8c6c24627f959..27b3fc0b3a78f 100644 --- a/test/IRGen/relative_protocol_witness_table.swift +++ b/test/IRGen/relative_protocol_witness_table.swift @@ -319,7 +319,7 @@ func instantiate_conditional_conformance_2nd(_ t : T) where T: Sub, T.S == T // CHECK: define{{.*}} swiftcc void @"$s1A39instantiate_conditional_conformance_2ndyyxAA3SubRz1SQzRszlF"(ptr {{.*}}, ptr [[T:%.*]], ptr [[TSUB:%.*]]) // CHECK: [[CONDBUFFER:%.*]] = alloca [1 x ptr] -// CHECK: [[T0:%.*]] = getelementptr inbounds [1 x ptr], ptr [[CONDBUFFER]], i32 0, i32 0 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr [[CONDBUFFER]], i32 0, i32 0 // CHECK: [[T1:%.*]] = getelementptr inbounds ptr, ptr [[T0]], i32 0 // CHECK: store ptr [[TSUB]], ptr [[T1]] // CHECK: call ptr @swift_getWitnessTableRelative({{.*}}@"$s1A1XVyxGAA3SubA2aERz1SQzRszlMc{{.*}}, ptr {{.*}}, ptr [[T0]]) @@ -331,7 +331,7 @@ func instantiate_conditional_conformance_2nd(_ t : T) where T: Sub, T.S == T // CHECK: [[T3:%.*]] = getelementptr inbounds ptr, ptr [[C1]], i32 0 // CHECK: [[T4:%.*]] = load ptr, ptr [[T3]] // CHECK: [[TBASE:%.*]] = call ptr @__swift_relative_protocol_witness_table_parent_1(ptr [[T4]]) -// CHECK: [[T24:%.*]] = getelementptr inbounds [1 x ptr], ptr [[C2]], i32 0, i32 0 +// CHECK: [[T24:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr [[C2]], i32 0, i32 0 // CHECK: [[T25:%.*]] = getelementptr inbounds ptr, ptr [[T24]], i32 0 // CHECK: store ptr [[TBASE]], ptr [[T25]] // CHECK: [[T26:%.*]] = call ptr @swift_getWitnessTableRelative({{.*}}@"$s1A1XVyxGAA4BaseA2aERzlMc{{.*}}, ptr {{.*}}, ptr [[T24]]) diff --git a/test/IRGen/sil_generic_witness_methods.swift b/test/IRGen/sil_generic_witness_methods.swift index a9c80505798c9..7a3fa619c093a 100644 --- a/test/IRGen/sil_generic_witness_methods.swift +++ b/test/IRGen/sil_generic_witness_methods.swift @@ -36,18 +36,18 @@ func call_methods(_ x: T, y: S, z: U) { // 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_ADDR:%.*]] = getelementptr inbounds{{.*}} %T27sil_generic_witness_methods1PP, ptr [[X:%0]], i32 0, i32 1 // CHECK: [[METADATA:%.*]] = load ptr, ptr [[METADATA_ADDR]], align 8 - // CHECK: [[WTABLE_ADDR:%.*]] = getelementptr inbounds %T27sil_generic_witness_methods1PP, ptr [[X]], i32 0, i32 2 + // CHECK: [[WTABLE_ADDR:%.*]] = getelementptr inbounds{{.*}} %T27sil_generic_witness_methods1PP, ptr [[X]], i32 0, i32 2 // CHECK: [[WTABLE:%.*]] = load ptr, ptr [[WTABLE_ADDR]], align 8 // CHECK: [[CONCRETE_METHOD_PTR_GEP:%.*]] = getelementptr inbounds ptr, ptr [[WTABLE]], i32 1 // CHECK: [[CONCRETE_METHOD_PTR:%.*]] = load ptr, ptr [[CONCRETE_METHOD_PTR_GEP]], align 8 // CHECK: call swiftcc void [[CONCRETE_METHOD_PTR]](ptr noalias swiftself {{%.*}}, ptr [[METADATA]], ptr [[WTABLE]]) x.concrete_method() - // CHECK: [[METADATA_ADDR:%.*]] = getelementptr inbounds %T27sil_generic_witness_methods1PP, ptr [[X]], i32 0, i32 1 + // CHECK: [[METADATA_ADDR:%.*]] = getelementptr inbounds{{.*}} %T27sil_generic_witness_methods1PP, ptr [[X]], i32 0, i32 1 // CHECK: [[METADATA:%.*]] = load ptr, ptr [[METADATA_ADDR]], align 8 - // CHECK: [[WTABLE_ADDR:%.*]] = getelementptr inbounds %T27sil_generic_witness_methods1PP, ptr [[X:%.*]], i32 0, i32 2 + // CHECK: [[WTABLE_ADDR:%.*]] = getelementptr inbounds{{.*}} %T27sil_generic_witness_methods1PP, ptr [[X:%.*]], i32 0, i32 2 // CHECK: [[WTABLE:%.*]] = load ptr, ptr [[WTABLE_ADDR]], align 8 // CHECK: [[GENERIC_METHOD_ADDR:%.*]] = getelementptr inbounds ptr, ptr [[WTABLE]], i32 3 // CHECK: [[GENERIC_METHOD_PTR:%.*]] = load ptr, ptr [[GENERIC_METHOD_ADDR]], align 8 diff --git a/test/IRGen/sil_witness_methods.sil b/test/IRGen/sil_witness_methods.sil index 2c2594a76940b..e1a6e737bbd0b 100644 --- a/test/IRGen/sil_witness_methods.sil +++ b/test/IRGen/sil_witness_methods.sil @@ -147,7 +147,7 @@ entry: // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_concrete_witness() {{.*}} { // CHECK: [[CONTEXT:%.*]] = call noalias ptr @swift_allocObject({{.*}}) -// CHECK: [[WTABLE:%.*]] = getelementptr inbounds <{ %swift.refcounted, ptr }>, ptr [[CONTEXT]], i32 0, i32 1 +// CHECK: [[WTABLE:%.*]] = getelementptr inbounds{{.*}} <{ %swift.refcounted, ptr }>, ptr [[CONTEXT]], i32 0, i32 1 // CHECK: store ptr @"$s19sil_witness_methods3BarCyxq_q0_GAA1PAAWP", ptr [[WTABLE]] // CHECK: [[RESULT:%.*]] = insertvalue { ptr, ptr } { ptr @"$s36generic_type_concrete_method_witnessTA", ptr undef }, ptr [[CONTEXT]], 1 // CHECK: ret { ptr, ptr } [[RESULT]] diff --git a/test/IRGen/sil_witness_tables.swift b/test/IRGen/sil_witness_tables.swift index 0318819450467..94b5d0bc4e4ea 100644 --- a/test/IRGen/sil_witness_tables.swift +++ b/test/IRGen/sil_witness_tables.swift @@ -58,14 +58,14 @@ struct Conformer2: Q { } // 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: [[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: [[WITNESS_TABLE_ADDR:%.*]] = getelementptr inbounds %T39sil_witness_tables_external_conformance9ExternalPP, ptr %0, i32 0, i32 2 +// 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 { return c diff --git a/test/IRGen/static_initializer.sil b/test/IRGen/static_initializer.sil index cd658d1aad8f9..4fc8988d05199 100644 --- a/test/IRGen/static_initializer.sil +++ b/test/IRGen/static_initializer.sil @@ -187,8 +187,8 @@ bb0: // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i32 } @"$s6nested1fAA2S2VyF"() {{.*}} { // CHECK-NEXT: entry: // CHECK: load i32, ptr @"$s6nested1xAA2S2Vv" -// CHECK-NEXT: load i32, ptr getelementptr inbounds (%T18static_initializer2S2V, ptr @"$s6nested1xAA2S2Vv", i32 0, i32 1) -// CHECK-NEXT: load i32, ptr getelementptr inbounds (%T18static_initializer2S2V, ptr @"$s6nested1xAA2S2Vv", i32 0, i32 2) +// CHECK-NEXT: load i32, ptr getelementptr inbounds{{.*}} (%T18static_initializer2S2V, ptr @"$s6nested1xAA2S2Vv", i32 0, i32 1) +// CHECK-NEXT: load i32, ptr getelementptr inbounds{{.*}} (%T18static_initializer2S2V, ptr @"$s6nested1xAA2S2Vv", i32 0, i32 2) sil @$s6nested1fAA2S2VyF : $@convention(thin) () -> S2 { bb0: %0 = global_addr @$s6nested1xAA2S2Vv : $*S2 diff --git a/test/IRGen/stdlib/Mutex.swift b/test/IRGen/stdlib/Mutex.swift index c086008658f32..2791e6456d8b8 100644 --- a/test/IRGen/stdlib/Mutex.swift +++ b/test/IRGen/stdlib/Mutex.swift @@ -31,8 +31,8 @@ final class Awaitable: Sendable where Value: Sendable, Failure: } // CHECK: define {{.*}} ptr @"$s15Synchronization5MutexVy6stdlib9AwaitableC5StateVyxq__GGs8SendableRzs5ErrorR_r0_lWOb"(ptr [[SRC:%.*]], ptr [[DEST:%.*]], ptr {{%.*}}, ptr {{%.*}}, ptr {{%.*}}, ptr {{%.*}}, ptr {{%.*}}, ptr {{%.*}}, ptr [[MUTEX:%.*]]) -// CHECK: [[DEST_HANDLE_PTR:%.*]] = getelementptr inbounds %T15Synchronization5MutexV{{.*}}, ptr [[DEST]], i32 0, i32 0 -// CHECK: [[SRC_HANDLE_PTR:%.*]] = getelementptr inbounds %T15Synchronization5MutexV{{.*}}, ptr [[SRC]], i32 0, i32 0 +// CHECK: [[DEST_HANDLE_PTR:%.*]] = getelementptr inbounds{{.*}} %T15Synchronization5MutexV{{.*}}, ptr [[DEST]], i32 0, i32 0 +// CHECK: [[SRC_HANDLE_PTR:%.*]] = getelementptr inbounds{{.*}} %T15Synchronization5MutexV{{.*}}, ptr [[SRC]], i32 0, i32 0 // CHECK: call void @llvm.memcpy.p0.p0.i{{32|64}}(ptr {{.*}} [[DEST_HANDLE_PTR]], ptr {{.*}} [[SRC_HANDLE_PTR]], i{{32|64}} {{.*}}, i1 false) // CHECK: [[DEST_MUTEX_VALUE_OFFSET_PTR:%.*]] = getelementptr inbounds i32, ptr [[MUTEX]], i{{32 4|64 7}} // CHECK: [[DEST_MUTEX_VALUE_OFFSET:%.*]] = load i32, ptr [[DEST_MUTEX_VALUE_OFFSET_PTR]] @@ -42,5 +42,5 @@ final class Awaitable: Sendable where Value: Sendable, Failure: // CHECK: [[SRC_VALUE_PTR:%.*]] = getelementptr inbounds i8, ptr [[SRC]], i32 [[SRC_MUTEX_VALUE_OFFSET]] // These GEPs used to cause compiler crashes because they were incorrectly typed... -// CHECK: [[DEST_PENDING_CONSUMERS_PTR:%.*]] = getelementptr inbounds %T6stdlib9AwaitableC5StateV{{.*}}, ptr [[DEST_VALUE_PTR]], i32 0, i32 0 -// CHECK: [[SRC_PENDING_CONSUMERS_PTR:%.*]] = getelementptr inbounds %T6stdlib9AwaitableC5StateV{{.*}}, ptr [[SRC_VALUE_PTR]], i32 0, i32 0 +// CHECK: [[DEST_PENDING_CONSUMERS_PTR:%.*]] = getelementptr inbounds{{.*}} %T6stdlib9AwaitableC5StateV{{.*}}, ptr [[DEST_VALUE_PTR]], i32 0, i32 0 +// CHECK: [[SRC_PENDING_CONSUMERS_PTR:%.*]] = getelementptr inbounds{{.*}} %T6stdlib9AwaitableC5StateV{{.*}}, ptr [[SRC_VALUE_PTR]], i32 0, i32 0 diff --git a/test/IRGen/struct_resilience.swift b/test/IRGen/struct_resilience.swift index 73960b0340bae..5871ed78b1c6f 100644 --- a/test/IRGen/struct_resilience.swift +++ b/test/IRGen/struct_resilience.swift @@ -26,7 +26,7 @@ public func functionWithResilientTypesSize(_ s: __owned Size, f: (__owned Size) // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[VWT:%.*]] = inttoptr i64 {{%.*}} to ptr -// CHECK-NEXT: [[WITNESS_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 8 +// CHECK-NEXT: [[WITNESS_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 8 // CHECK: [[WITNESS_FOR_SIZE:%.*]] = load [[INT]], ptr [[WITNESS_ADDR]] // CHECK: [[ALLOCA:%.*]] = alloca i8, {{.*}} [[WITNESS_FOR_SIZE]], align 16 @@ -62,7 +62,7 @@ public func functionWithResilientTypesRectangle(_ r: Rectangle) { // CHECK-NEXT: [[FIELD_OFFSET_PTR:%.*]] = getelementptr inbounds i32, ptr [[METADATA]], [[INT]] [[IDX:2|4|6]] // CHECK-NEXT: [[FIELD_OFFSET:%.*]] = load i32, ptr [[FIELD_OFFSET_PTR]] // CHECK-NEXT: [[FIELD_ADDR:%.*]] = getelementptr inbounds i8, ptr %0, i32 [[FIELD_OFFSET]] -// CHECK-NEXT: [[FIELD_PAYLOAD_PTR:%.*]] = getelementptr inbounds %TSi, ptr [[FIELD_ADDR]], i32 0, i32 0 +// CHECK-NEXT: [[FIELD_PAYLOAD_PTR:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[FIELD_ADDR]], i32 0, i32 0 // CHECK-NEXT: [[FIELD_PAYLOAD:%.*]] = load [[INT]], ptr [[FIELD_PAYLOAD_PTR]] _ = r.color @@ -88,23 +88,23 @@ public func functionWithMyResilientTypesSize(_ s: __owned MySize, f: (__owned My // CHECK: [[DST:%.*]] = alloca %T17struct_resilience6MySizeV -// CHECK: [[W_ADDR:%.*]] = getelementptr inbounds %T17struct_resilience6MySizeV, ptr %1, i32 0, i32 0 -// CHECK: [[W_PTR:%.*]] = getelementptr inbounds %TSi, ptr [[W_ADDR]], i32 0, i32 0 +// CHECK: [[W_ADDR:%.*]] = getelementptr inbounds{{.*}} %T17struct_resilience6MySizeV, ptr %1, i32 0, i32 0 +// CHECK: [[W_PTR:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[W_ADDR]], i32 0, i32 0 // CHECK: [[W:%.*]] = load [[INT]], ptr [[W_PTR]] -// CHECK: [[H_ADDR:%.*]] = getelementptr inbounds %T17struct_resilience6MySizeV, ptr %1, i32 0, i32 1 -// CHECK: [[H_PTR:%.*]] = getelementptr inbounds %TSi, ptr [[H_ADDR]], i32 0, i32 0 +// CHECK: [[H_ADDR:%.*]] = getelementptr inbounds{{.*}} %T17struct_resilience6MySizeV, ptr %1, i32 0, i32 1 +// CHECK: [[H_PTR:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[H_ADDR]], i32 0, i32 0 // CHECK: [[H:%.*]] = load [[INT]], ptr [[H_PTR]] // CHECK: call void @llvm.lifetime.start.p0({{i32|i64}} {{8|16}}, ptr [[DST]]) -// CHECK: [[W_ADDR:%.*]] = getelementptr inbounds %T17struct_resilience6MySizeV, ptr [[DST]], i32 0, i32 0 -// CHECK: [[W_PTR:%.*]] = getelementptr inbounds %TSi, ptr [[W_ADDR]], i32 0, i32 0 +// CHECK: [[W_ADDR:%.*]] = getelementptr inbounds{{.*}} %T17struct_resilience6MySizeV, ptr [[DST]], i32 0, i32 0 +// CHECK: [[W_PTR:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[W_ADDR]], i32 0, i32 0 // CHECK: store [[INT]] [[W]], ptr [[W_PTR]] -// CHECK: [[H_ADDR:%.*]] = getelementptr inbounds %T17struct_resilience6MySizeV, ptr [[DST]], i32 0, i32 1 -// CHECK: [[H_PTR:%.*]] = getelementptr inbounds %TSi, ptr [[H_ADDR]], i32 0, i32 0 +// CHECK: [[H_ADDR:%.*]] = getelementptr inbounds{{.*}} %T17struct_resilience6MySizeV, ptr [[DST]], i32 0, i32 1 +// CHECK: [[H_PTR:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[H_ADDR]], i32 0, i32 0 // CHECK: store [[INT]] [[H]], ptr [[H_PTR]] @@ -136,7 +136,7 @@ public struct StructWithResilientStorage { // CHECK-NEXT: [[FIELD_OFFSET_PTR:%.*]] = getelementptr inbounds i32, ptr [[METADATA]], [[INT]] [[IDX:2|4|6]] // CHECK-NEXT: [[FIELD_OFFSET:%.*]] = load i32, ptr [[FIELD_OFFSET_PTR]] // CHECK-NEXT: [[FIELD_ADDR:%.*]] = getelementptr inbounds i8, ptr %0, i32 [[FIELD_OFFSET]] -// CHECK-NEXT: [[FIELD_PAYLOAD_PTR:%.*]] = getelementptr inbounds %TSi, ptr [[FIELD_ADDR]], i32 0, i32 0 +// CHECK-NEXT: [[FIELD_PAYLOAD_PTR:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[FIELD_ADDR]], i32 0, i32 0 // CHECK-NEXT: [[FIELD_PAYLOAD:%.*]] = load [[INT]], ptr [[FIELD_PAYLOAD_PTR]] // CHECK-NEXT: ret [[INT]] [[FIELD_PAYLOAD]] @@ -150,8 +150,8 @@ public struct StructWithIndirectResilientEnum { // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc {{i32|i64}} @"$s17struct_resilience31StructWithIndirectResilientEnumV1nSivg"(ptr {{.*}}) -// CHECK: [[FIELD_PTR:%.*]] = getelementptr inbounds %T17struct_resilience31StructWithIndirectResilientEnumV, ptr %0, i32 0, i32 1 -// CHECK-NEXT: [[FIELD_PAYLOAD_PTR:%.*]] = getelementptr inbounds %TSi, ptr [[FIELD_PTR]], i32 0, i32 0 +// CHECK: [[FIELD_PTR:%.*]] = getelementptr inbounds{{.*}} %T17struct_resilience31StructWithIndirectResilientEnumV, ptr %0, i32 0, i32 1 +// CHECK-NEXT: [[FIELD_PAYLOAD_PTR:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[FIELD_PTR]], i32 0, i32 0 // CHECK-NEXT: [[FIELD_PAYLOAD:%.*]] = load [[INT]], ptr [[FIELD_PAYLOAD_PTR]] // CHECK: ret [[INT]] [[FIELD_PAYLOAD]] @@ -187,7 +187,7 @@ public func resilientAny(s : ResilientWeakRef) { // CHECK: [[ANY:%.*]] = alloca %Any // CHECK: [[META:%.*]] = call swiftcc %swift.metadata_response @"$s16resilient_struct16ResilientWeakRefVMa"([[INT]] 0) // CHECK: [[META2:%.*]] = extractvalue %swift.metadata_response [[META]], 0 -// CHECK: [[TYADDR:%.*]] = getelementptr inbounds %Any, ptr [[ANY]], i32 0, i32 1 +// 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]]) @@ -208,7 +208,7 @@ public func memoryLayoutDotSizeWithResilientStruct() -> Int { // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[VWT:%.*]] = inttoptr i64 {{%.*}} to ptr - // CHECK-NEXT: [[WITNESS_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 8 + // CHECK-NEXT: [[WITNESS_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 8 // CHECK: [[WITNESS_FOR_SIZE:%.*]] = load [[INT]], ptr [[WITNESS_ADDR]] // CHECK: ret [[INT]] [[WITNESS_FOR_SIZE]] @@ -226,7 +226,7 @@ public func memoryLayoutDotStrideWithResilientStruct() -> Int { // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[VWT:%.*]] = inttoptr i64 {{%.*}} to ptr - // CHECK-NEXT: [[WITNESS_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 9 + // CHECK-NEXT: [[WITNESS_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 9 // CHECK: [[WITNESS_FOR_STRIDE:%.*]] = load [[INT]], ptr [[WITNESS_ADDR]] // CHECK: ret [[INT]] [[WITNESS_FOR_STRIDE]] @@ -244,7 +244,7 @@ public func memoryLayoutDotAlignmentWithResilientStruct() -> Int { // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend // CHECK-arm64e: [[VWT:%.*]] = inttoptr i64 {{%.*}} to ptr - // CHECK-NEXT: [[WITNESS_ADDR:%.*]] = getelementptr inbounds %swift.vwtable, ptr [[VWT]], i32 0, i32 10 + // CHECK-NEXT: [[WITNESS_ADDR:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable, ptr [[VWT]], i32 0, i32 10 // CHECK: [[WITNESS_FOR_FLAGS:%.*]] = load i32, ptr [[WITNESS_ADDR]] // Not checked because it only exists on 64-bit: [[EXTENDED_FLAGS:%.*]] = zext i32 [[WITNESS_FOR_FLAGS]] to [[INT]] @@ -286,7 +286,7 @@ public func memoryLayoutDotOffsetOfWithResilientStruct() -> Int? { // CHECK: [[FIELDS:%.*]] = alloca [4 x ptr] // CHECK: [[TUPLE_LAYOUT:%.*]] = alloca %swift.full_type_layout, -// CHECK: [[FIELDS_ADDR:%.*]] = getelementptr inbounds [4 x ptr], ptr [[FIELDS]], i32 0, i32 0 +// CHECK: [[FIELDS_ADDR:%.*]] = getelementptr inbounds{{.*}} [4 x ptr], ptr [[FIELDS]], i32 0, i32 0 // public let s: Size diff --git a/test/IRGen/struct_with_resilient_type.swift b/test/IRGen/struct_with_resilient_type.swift index 20bc54a4cfa0b..00c03d270cb57 100644 --- a/test/IRGen/struct_with_resilient_type.swift +++ b/test/IRGen/struct_with_resilient_type.swift @@ -51,10 +51,10 @@ crashCaller() // VWT-macosx: [[T2:%.*]] = extractvalue %swift.metadata_response [[T1]], 0 // VWT-macosx: [[T3:%.*]] = getelementptr inbounds i8, ptr [[T2]], i64 -8 // VWT-macosx: [[T5:%.*]] = load ptr, ptr [[T3]] -// VWT-macosx: [[T6:%.*]] = getelementptr inbounds i8, ptr [[T5]], i64 4 +// VWT-macosx: [[T6:%.*]] = getelementptr inbounds{{.*}} i8, ptr [[T5]], i64 4 // VWT-macosx: [[T8:%.*]] = load ptr, ptr [[T6]] // VWT-macosx: tail call ptr [[T8]]( -// VWT-macosx: [[F01:%.*]] = getelementptr inbounds i8, ptr [[MT]], i64 24 +// VWT-macosx: [[F01:%.*]] = getelementptr inbounds{{.*}} i8, ptr [[MT]], i64 24 // VWT-macosx: [[F03:%.*]] = load i32, ptr [[F01]], align 8 // VWT-macosx: [[F04:%.*]] = sext i32 [[F03]] to i64 // VWT-macosx: [[FA1:%.*]] = getelementptr inbounds i8, ptr {{.*}}, i64 [[F04]] diff --git a/test/IRGen/typed_boxes.sil b/test/IRGen/typed_boxes.sil index cebe4838b4841..1f5b78f8aa00f 100644 --- a/test/IRGen/typed_boxes.sil +++ b/test/IRGen/typed_boxes.sil @@ -9,7 +9,7 @@ sil @pod_box_8_8_a : $@convention(thin) () -> () { entry: // CHECK: [[BOX:%.*]] = call noalias ptr @swift_allocObject(ptr {{.*}} [[POD_8_8_METADATA:@metadata[0-9.]*]], i32 0, i32 2), [[WORD:i[0-9]+]] [[POD_8_8_SIZE:[0-9]+]], [[WORD]] 7) %a = alloc_box $<Ï„_0_0> { var Ï„_0_0 } - // CHECK: [[BOX_DATA:%.*]] = getelementptr inbounds [[POD_8_8_LAYOUT:<\{ %swift.refcounted, \[8 x i8\] \}>]], ptr [[BOX]], i32 0, i32 1 + // CHECK: [[BOX_DATA:%.*]] = getelementptr inbounds{{.*}} [[POD_8_8_LAYOUT:<\{ %swift.refcounted, \[8 x i8\] \}>]], ptr [[BOX]], i32 0, i32 1 %b = project_box %a : $<Ï„_0_0> { var Ï„_0_0 } , 0 // CHECK: call void @swift_deallocUninitializedObject(ptr [[BOX]], [[WORD]] [[POD_8_8_SIZE]], [[WORD]] 7) dealloc_box %a : $<Ï„_0_0> { var Ï„_0_0 } @@ -21,7 +21,7 @@ sil @pod_box_8_8_b : $@convention(thin) () -> () { entry: // CHECK: [[BOX:%.*]] = call noalias ptr @swift_allocObject(ptr {{.*}} [[POD_8_8_METADATA]], i32 0, i32 2), [[WORD]] [[POD_8_8_SIZE]], [[WORD]] 7) %a = alloc_box $<Ï„_0_0> { var Ï„_0_0 } - // CHECK: [[BOX_DATA:%.*]] = getelementptr inbounds [[POD_8_8_LAYOUT]], ptr [[BOX]], i32 0, i32 1 + // CHECK: [[BOX_DATA:%.*]] = getelementptr inbounds{{.*}} [[POD_8_8_LAYOUT]], ptr [[BOX]], i32 0, i32 1 %b = project_box %a : $<Ï„_0_0> { var Ï„_0_0 } , 0 // CHECK: call void @swift_deallocUninitializedObject(ptr [[BOX]], [[WORD]] [[POD_8_8_SIZE]], [[WORD]] 7) dealloc_box %a : $<Ï„_0_0> { var Ï„_0_0 } @@ -145,7 +145,7 @@ entry: // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc i64 @proj_box sil @proj_box : $@convention(thin) (<Ï„_0_0> { var Ï„_0_0 } ) -> Builtin.Int64 { entry(%0 : $<Ï„_0_0> { var Ï„_0_0 } ): - // CHECK: [[BOX_DATA:%.*]] = getelementptr inbounds [[POD_8_8_LAYOUT]], ptr %0, i32 0, i32 1 + // CHECK: [[BOX_DATA:%.*]] = getelementptr inbounds{{.*}} [[POD_8_8_LAYOUT]], ptr %0, i32 0, i32 1 %p = project_box %0 : $<Ï„_0_0> { var Ï„_0_0 } , 0 // CHECK: [[R:%.*]] = load i64, ptr [[BOX_DATA]] %l = load %p : $*Builtin.Int64 diff --git a/test/IRGen/typed_throws.sil b/test/IRGen/typed_throws.sil index 8d5caa462ee53..c2f42b8f5c36d 100644 --- a/test/IRGen/typed_throws.sil +++ b/test/IRGen/typed_throws.sil @@ -403,12 +403,12 @@ entry(%0: $*T): // CHECK: define{{.*}} swiftcc void @apply_closure_generic(ptr %0, ptr %1, ptr %T, ptr %V) // CHECK: [[T0:%.*]] = getelementptr inbounds ptr, ptr %T // CHECK: [[T1:%.*]] = load ptr, ptr [[T0]] -// CHECK: [[T2:%.*]] = getelementptr inbounds %swift.vwtable{{.*}} +// CHECK: [[T2:%.*]] = getelementptr inbounds{{.*}} %swift.vwtable{{.*}} // CHECK: [[T3:%.*]] = load i64, ptr [[T2]] // CHECK: [[T4:%.*]] = alloca i8, i64 [[T3]] // CHECK: [[V0:%.*]] = getelementptr inbounds ptr, ptr %V // CHECK: [[V1:%.*]] = load ptr, ptr [[V0]] -// CHECK: [[V2:%.*]] = getelementptr inbounds %swift.vwtable{{.*}} +// 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]]) diff --git a/test/IRGen/typed_throws.swift b/test/IRGen/typed_throws.swift index f4581f0d039e1..69b1c317a126c 100644 --- a/test/IRGen/typed_throws.swift +++ b/test/IRGen/typed_throws.swift @@ -318,7 +318,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: [[TRUNC:%.*]] = trunc i64 [[RES]] to i16 -// CHECK: [[COERCED_PTR:%.*]] = getelementptr inbounds { i16 }, ptr [[COERCED]], i32 0, i32 0 +// CHECK: [[COERCED_PTR:%.*]] = getelementptr inbounds{{.*}} { i16 }, ptr [[COERCED]], i32 0, i32 0 // CHECK: store i16 [[TRUNC]], ptr [[COERCED_PTR]], align 2 func callSmallResultLargerError() { let res = try! smallResultLargerError() @@ -337,7 +337,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: [[TRUNC:%.*]] = trunc i64 [[RES]] to i16 -// CHECK: [[COERCED_PTR:%.*]] = getelementptr inbounds { i16 }, ptr [[COERCED]], i32 0, i32 0 +// CHECK: [[COERCED_PTR:%.*]] = getelementptr inbounds{{.*}} { i16 }, ptr [[COERCED]], i32 0, i32 0 // CHECK: store i16 [[TRUNC]], ptr [[COERCED_PTR]], align 2 func callSmallErrorLargerResult() { do { diff --git a/test/IRGen/typed_throws_abi.swift b/test/IRGen/typed_throws_abi.swift index 6f2479d39c44e..58d6240263382 100644 --- a/test/IRGen/typed_throws_abi.swift +++ b/test/IRGen/typed_throws_abi.swift @@ -888,8 +888,8 @@ func callImpl_g4(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int) { // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] // CHECK: typed.error.load: -// CHECK: %swifterror1.x = getelementptr inbounds %T16typed_throws_abi7OneWordV, ptr %swifterror1, i32 0, i32 0 -// CHECK: %swifterror1.x._value = getelementptr inbounds %TSi, ptr %swifterror1.x, i32 0, i32 0 +// CHECK: %swifterror1.x = getelementptr inbounds{{.*}} %T16typed_throws_abi7OneWordV, ptr %swifterror1, i32 0, i32 0 +// CHECK: %swifterror1.x._value = getelementptr inbounds{{.*}} %TSi, ptr %swifterror1.x, i32 0, i32 0 // CHECK: [[CALL_ERROR_RES:%.*]] = load i64, ptr %swifterror1.x._value, align 8 // CHECK: br label %[[SET_ERROR:.*]] // CHECK: [[SUCCESS]]: @@ -1124,8 +1124,8 @@ func callImpl_h4(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int) { // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] // CHECK: typed.error.load: -// CHECK: %swifterror1.x = getelementptr inbounds %T16typed_throws_abi8TwoWordsV, ptr %swifterror1, i32 0, i32 0 -// CHECK: %swifterror1.x._value = getelementptr inbounds %TSi, ptr %swifterror1.x, i32 0, i32 0 +// CHECK: %swifterror1.x = getelementptr inbounds{{.*}} %T16typed_throws_abi8TwoWordsV, ptr %swifterror1, i32 0, i32 0 +// CHECK: %swifterror1.x._value = getelementptr inbounds{{.*}} %TSi, ptr %swifterror1.x, i32 0, i32 0 // CHECK: [[CALL_ERROR_RES0:%.*]] = load i64, ptr %swifterror1.x._value, align 8 // CHECK: [[CALL_ERROR_RES1:%.*]] = load i64, ptr %swifterror1.y._value, align 8 // CHECK: br label %[[SET_ERROR:.*]] @@ -1377,8 +1377,8 @@ func callImpl_i4(_ impl: Impl, _ b: Bool) -> (Int, Int, Int, Int) { // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] // CHECK: typed.error.load: -// CHECK: %swifterror1.x = getelementptr inbounds %T16typed_throws_abi10ThreeWordsV, ptr %swifterror1, i32 0, i32 0 -// CHECK: %swifterror1.x._value = getelementptr inbounds %TSi, ptr %swifterror1.x, i32 0, i32 0 +// CHECK: %swifterror1.x = getelementptr inbounds{{.*}} %T16typed_throws_abi10ThreeWordsV, ptr %swifterror1, i32 0, i32 0 +// CHECK: %swifterror1.x._value = getelementptr inbounds{{.*}} %TSi, ptr %swifterror1.x, i32 0, i32 0 // CHECK: [[CALL_ERROR_RES0:%.*]] = load i64, ptr %swifterror1.x._value, align 8 // CHECK: [[CALL_ERROR_RES1:%.*]] = load i64, ptr %swifterror1.y._value, align 8 // CHECK: [[CALL_ERROR_RES2:%.*]] = load i64, ptr %swifterror1.z._value, align 8 @@ -2401,8 +2401,8 @@ func callImplAsync_g4(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] // CHECK: typed.error.load: -// CHECK: %swifterror.x = getelementptr inbounds %T16typed_throws_abi7OneWordV, ptr %swifterror, i32 0, i32 0 -// CHECK: %swifterror.x._value = getelementptr inbounds %TSi, ptr %swifterror.x, i32 0, i32 0 +// CHECK: %swifterror.x = getelementptr inbounds{{.*}} %T16typed_throws_abi7OneWordV, ptr %swifterror, i32 0, i32 0 +// CHECK: %swifterror.x._value = getelementptr inbounds{{.*}} %TSi, ptr %swifterror.x, i32 0, i32 0 // CHECK: [[ERROR_X:%.*]] = load i64, ptr %swifterror.x._value, align 8 // CHECK: br label %[[SET_ERROR:.*]] // CHECK: [[SUCCESS]]: @@ -2667,8 +2667,8 @@ func callImplAsync_h4(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] // CHECK: typed.error.load: -// CHECK: %swifterror.x = getelementptr inbounds %T16typed_throws_abi8TwoWordsV, ptr %swifterror, i32 0, i32 0 -// CHECK: %swifterror.x._value = getelementptr inbounds %TSi, ptr %swifterror.x, i32 0, i32 0 +// CHECK: %swifterror.x = getelementptr inbounds{{.*}} %T16typed_throws_abi8TwoWordsV, ptr %swifterror, i32 0, i32 0 +// CHECK: %swifterror.x._value = getelementptr inbounds{{.*}} %TSi, ptr %swifterror.x, i32 0, i32 0 // CHECK: [[ERROR_X:%.*]] = load i64, ptr %swifterror.x._value, align 8 // CHECK: [[ERROR_Y:%.*]] = load i64, ptr %swifterror.y._value, align 8 // CHECK: br label %[[SET_ERROR:.*]] @@ -2947,8 +2947,8 @@ func callImplAsync_i4(_ impl: ImplAsync, _ b: Bool) async -> (Int, Int, Int, Int // CHECK: [[ISERROR:%.*]] = icmp ne ptr [[ERROR]], null // CHECK: br i1 [[ISERROR]], label %typed.error.load, label %[[SUCCESS:.*]] // CHECK: typed.error.load: -// CHECK: %swifterror.x = getelementptr inbounds %T16typed_throws_abi10ThreeWordsV, ptr %swifterror, i32 0, i32 0 -// CHECK: %swifterror.x._value = getelementptr inbounds %TSi, ptr %swifterror.x, i32 0, i32 0 +// CHECK: %swifterror.x = getelementptr inbounds{{.*}} %T16typed_throws_abi10ThreeWordsV, ptr %swifterror, i32 0, i32 0 +// CHECK: %swifterror.x._value = getelementptr inbounds{{.*}} %TSi, ptr %swifterror.x, i32 0, i32 0 // CHECK: [[ERROR_X:%.*]] = load i64, ptr %swifterror.x._value, align 8 // CHECK: [[ERROR_Y:%.*]] = load i64, ptr %swifterror.y._value, align 8 // CHECK: [[ERROR_Z:%.*]] = load i64, ptr %swifterror.z._value, align 8 diff --git a/test/IRGen/typelayout_based_value_witness.swift b/test/IRGen/typelayout_based_value_witness.swift index 77ee87f9d965b..b0f8c1b207736 100644 --- a/test/IRGen/typelayout_based_value_witness.swift +++ b/test/IRGen/typelayout_based_value_witness.swift @@ -82,7 +82,7 @@ public enum ForwardEnum { // 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_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 @@ -94,17 +94,17 @@ public enum ForwardEnum { // OPT-ptrauth: [[VWT_INT:%.*]] = tail call i64 @llvm.ptrauth.auth(i64 [[SIGNED_VWT]], i32 2, i64 [[DISCRIMINANT]]) // OPT-ptrauth: [[VWT:%.*]] = inttoptr i64 [[VWT_INT]] to ptr -// OPT: [[DESTROY_VW:%.*]] = getelementptr inbounds i8, ptr [[VWT]], {{(i64|i32)}} 8 +// OPT: [[DESTROY_VW:%.*]] = getelementptr inbounds{{.*}} i8, ptr [[VWT]], {{(i64|i32)}} 8 // OPT: [[DESTROY:%.*]] = load ptr, ptr [[DESTROY_VW]] // OPT-ptrauth: [[DESTROY_ADDR:%.*]] = ptrtoint ptr [[DESTROY_VW]] to i64 // OPT-ptrauth: [[DISCRIMINANT:%.*]] = tail call i64 @llvm.ptrauth.blend(i64 [[DESTROY_ADDR]], i64 1272) // OPT: tail call void [[DESTROY]](ptr noalias %object, ptr [[T]]) -// OPT: [[SIZE_VW:%.*]] = getelementptr inbounds i8, ptr [[VWT]], {{(i64|i32)}} 64 +// OPT: [[SIZE_VW:%.*]] = getelementptr inbounds{{.*}} i8, ptr [[VWT]], {{(i64|i32)}} 64 // OPT: [[SIZE_T:%.*]] = load {{(i64|i32)}}, ptr [[SIZE_VW]] // OPT: [[OBJECT:%.*]] = ptrtoint ptr %object to {{(i64|i32)}} -// OPT: [[FLAGS_VW:%.*]] = getelementptr inbounds i8, ptr [[VWT]], {{(i64|i32)}} 80 +// OPT: [[FLAGS_VW:%.*]] = getelementptr inbounds{{.*}} i8, ptr [[VWT]], {{(i64|i32)}} 80 // OPT: [[FLAGS3:%.*]] = load i32, ptr [[FLAGS_VW]] // OPT: [[FLAGS:%.*]] = and i32 [[FLAGS3]], 255 // OPT-64: %flags.alignmentMask = zext nneg i32 [[FLAGS]] to i64 diff --git a/test/IRGen/unexploded-calls.swift b/test/IRGen/unexploded-calls.swift index 3d64fcfbbb19e..661cec671b196 100644 --- a/test/IRGen/unexploded-calls.swift +++ b/test/IRGen/unexploded-calls.swift @@ -21,11 +21,11 @@ public func g(_ s : S) { // CHECK: entry: // CHECK: alloca // CHECK: [[ALLOCA:%[-._0-9a-zA-Z]+]] = alloca %TSo1SV, align 4 -// CHECK: [[ALLOCA]].f = getelementptr inbounds %TSo1SV, ptr [[ALLOCA]], i32 0, i32 0 -// CHECK: [[ALLOCA]].f._value = getelementptr inbounds %TSf, ptr [[ALLOCA]].f, i32 0, i32 0 +// CHECK: [[ALLOCA]].f = getelementptr inbounds{{.*}} %TSo1SV, ptr [[ALLOCA]], i32 0, i32 0 +// CHECK: [[ALLOCA]].f._value = getelementptr inbounds{{.*}} %TSf, ptr [[ALLOCA]].f, i32 0, i32 0 // CHECK: store float %0, ptr [[ALLOCA]].f._value, align 4 -// CHECK: [[ALLOCA]].g = getelementptr inbounds %TSo1SV, ptr [[ALLOCA]], i32 0, i32 1 -// CHECK: [[ALLOCA]].g._value = getelementptr inbounds %TSf, ptr [[ALLOCA]].g, i32 0, i32 0 +// CHECK: [[ALLOCA]].g = getelementptr inbounds{{.*}} %TSo1SV, ptr [[ALLOCA]], i32 0, i32 1 +// CHECK: [[ALLOCA]].g._value = getelementptr inbounds{{.*}} %TSf, ptr [[ALLOCA]].g, i32 0, i32 0 // CHECK: store float %1, ptr [[ALLOCA]].g._value, align 4 // CHECK: %[[LOAD:.*]] = load %struct.S, ptr [[ALLOCA]], align 4 // CHECK: call void @f(%struct.S %[[LOAD]]) diff --git a/test/IRGen/unmanaged_objc_throw_func.swift b/test/IRGen/unmanaged_objc_throw_func.swift index 77114e5b7c234..07f6a7b4d2c01 100644 --- a/test/IRGen/unmanaged_objc_throw_func.swift +++ b/test/IRGen/unmanaged_objc_throw_func.swift @@ -16,7 +16,7 @@ import Foundation // CHECK: %[[T0:.+]] = call swiftcc { ptr, ptr } @"$ss27_allocateUninitializedArrayySayxG_BptBwlF"(i{{32|64}} 1, ptr @"$sSiN") // CHECK-NEXT: %[[T1:.+]] = extractvalue { ptr, ptr } %[[T0]], 0 // CHECK-NEXT: %[[T2:.+]] = extractvalue { ptr, ptr } %[[T0]], 1 - // CHECK-NEXT: %._value = getelementptr inbounds %TSi, ptr %[[T2]], i32 0, i32 0 + // CHECK-NEXT: %._value = getelementptr inbounds{{.*}} %TSi, ptr %[[T2]], i32 0, i32 0 // CHECK: %[[T7:.+]] = call swiftcc ptr @"$ss27_finalizeUninitializedArrayySayxGABnlF"(ptr %[[T1]], ptr @"$sSiN") // CHECK: %[[T4:.+]] = call swiftcc ptr @"$sSa10FoundationE19_bridgeToObjectiveCSo7NSArrayCyF"(ptr %[[T7]], ptr @"$sSiN") // CHECK-NEXT: store ptr %[[T4]] diff --git a/test/IRGen/unowned.sil b/test/IRGen/unowned.sil index f2aadb0505482..3e93db14c3dac 100644 --- a/test/IRGen/unowned.sil +++ b/test/IRGen/unowned.sil @@ -49,8 +49,8 @@ bb0(%0 : $@sil_unowned P): // initializeBufferWithCopyOfBuffer // CHECK: define internal ptr @"$s7unowned1AVwCP"(ptr noalias [[DESTBUF:%.*]], ptr noalias [[SRCBUF:%.*]], ptr -// CHECK: [[T0:%.*]] = getelementptr inbounds [[A]], ptr [[DESTBUF]], i32 0, i32 0 -// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds [[A]], ptr [[SRCBUF]], i32 0, i32 0 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[DESTBUF]], i32 0, i32 0 +// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[SRCBUF]], i32 0, i32 0 // CHECK-NEXT: [[T2:%.*]] = load ptr, ptr [[T1]], align 8 // CHECK-NEXT: call ptr @swift_unownedRetain(ptr returned [[T2]]) // CHECK-NEXT: store ptr [[T2]], ptr [[T0]], align 8 @@ -58,15 +58,15 @@ bb0(%0 : $@sil_unowned P): // destroy // CHECK: define internal void @"$s7unowned1AVwxx"(ptr noalias [[ARG:%.*]], ptr -// CHECK: [[T1:%.*]] = getelementptr inbounds [[A]], ptr [[ARG]], i32 0, i32 0 +// CHECK: [[T1:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[ARG]], i32 0, i32 0 // CHECK-NEXT: [[T2:%.*]] = load ptr, ptr [[T1]], align 8 // CHECK-NEXT: call void @swift_unownedRelease(ptr [[T2]]) // CHECK-NEXT: ret void // initializeWithCopy // CHECK: define internal ptr @"$s7unowned1AVwcp"(ptr noalias [[DEST_OPQ:%.*]], ptr noalias [[SRC_OPQ:%.*]], ptr -// CHECK: [[T0:%.*]] = getelementptr inbounds [[A]], ptr [[DEST_OPQ]], i32 0, i32 0 -// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds [[A]], ptr [[SRC_OPQ]], i32 0, i32 0 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[DEST_OPQ]], i32 0, i32 0 +// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[SRC_OPQ]], i32 0, i32 0 // CHECK-NEXT: [[T2:%.*]] = load ptr, ptr [[T1]], align 8 // CHECK-NEXT: call ptr @swift_unownedRetain(ptr returned [[T2]]) // CHECK-NEXT: store ptr [[T2]], ptr [[T0]], align 8 @@ -74,8 +74,8 @@ bb0(%0 : $@sil_unowned P): // assignWithCopy // CHECK: define internal ptr @"$s7unowned1AVwca"(ptr [[DEST_OPQ:%.*]], ptr [[SRC_OPQ:%.*]], ptr -// CHECK: [[DEST_X:%.*]] = getelementptr inbounds [[A]], ptr [[DEST_OPQ]], i32 0, i32 0 -// CHECK-NEXT: [[SRC_X:%.*]] = getelementptr inbounds [[A]], ptr [[SRC_OPQ]], i32 0, i32 0 +// CHECK: [[DEST_X:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[DEST_OPQ]], i32 0, i32 0 +// CHECK-NEXT: [[SRC_X:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[SRC_OPQ]], i32 0, i32 0 // CHECK-NEXT: [[NEW:%.*]] = load ptr, ptr [[SRC_X]], align 8 // CHECK-NEXT: call ptr @swift_unownedRetain(ptr returned [[NEW]]) // CHECK-NEXT: [[OLD:%.*]] = load ptr, ptr [[DEST_X]], align 8 @@ -85,8 +85,8 @@ bb0(%0 : $@sil_unowned P): // assignWithTake // CHECK: define internal ptr @"$s7unowned1AVwta"(ptr noalias [[DEST_OPQ:%.*]], ptr noalias [[SRC_OPQ:%.*]], ptr -// CHECK: [[DEST_X:%.*]] = getelementptr inbounds [[A]], ptr [[DEST_OPQ]], i32 0, i32 0 -// CHECK-NEXT: [[SRC_X:%.*]] = getelementptr inbounds [[A]], ptr [[SRC_OPQ]], i32 0, i32 0 +// CHECK: [[DEST_X:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[DEST_OPQ]], i32 0, i32 0 +// CHECK-NEXT: [[SRC_X:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[SRC_OPQ]], i32 0, i32 0 // CHECK-NEXT: [[NEW:%.*]] = load ptr, ptr [[SRC_X]], align 8 // CHECK-NEXT: [[OLD:%.*]] = load ptr, ptr [[DEST_X]], align 8 // CHECK-NEXT: store ptr [[NEW]], ptr [[DEST_X]], align 8 diff --git a/test/IRGen/unowned_objc.sil b/test/IRGen/unowned_objc.sil index 7e1a5a44e3c25..c53688876a383 100644 --- a/test/IRGen/unowned_objc.sil +++ b/test/IRGen/unowned_objc.sil @@ -50,18 +50,18 @@ bb0(%p : $P, %q : $P): // CHECK-NEXT: llvm.lifetime.start %y = alloc_stack $@sil_unowned P - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[UREF]], ptr [[X]], i32 0, i32 1 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[UREF]], ptr [[X]], i32 0, i32 1 // CHECK-NEXT: store ptr [[PP:%1]], ptr [[T0]], align 8 - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[UREF]], ptr [[X]], i32 0, i32 0 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[UREF]], ptr [[X]], i32 0, i32 0 // CHECK-NEXT: call ptr @swift_unknownObjectUnownedInit(ptr returned [[T0]], ptr [[PV:%0]]) store_unowned %p to [init] %x : $*@sil_unowned P // CHECK-NEXT: call ptr @"$s12unowned_objc1P_pXoWOc"(ptr [[X]], ptr [[Y]]) copy_addr %x to [init] %y : $*@sil_unowned P - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[UREF]], ptr [[X]], i32 0, i32 0 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[UREF]], ptr [[X]], i32 0, i32 0 // CHECK-NEXT: [[TV:%.*]] = call ptr @swift_unknownObjectUnownedLoadStrong(ptr [[T0]]) - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[UREF]], ptr [[X]], i32 0, i32 1 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[UREF]], ptr [[X]], i32 0, i32 1 // CHECK-NEXT: [[TP:%.*]] = load ptr, ptr [[T0]], align 8 %t0 = load_unowned %x : $*@sil_unowned P @@ -71,9 +71,9 @@ bb0(%p : $P, %q : $P): // CHECK-NEXT: call ptr @"$s12unowned_objc1P_pXoWOf"(ptr [[X]], ptr [[Y]]) copy_addr %x to %y : $*@sil_unowned P - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[UREF]], ptr [[Y]], i32 0, i32 1 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[UREF]], ptr [[Y]], i32 0, i32 1 // CHECK-NEXT: store ptr [[QP:%3]], ptr [[T0]], align 8 - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[UREF]], ptr [[Y]], i32 0, i32 0 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[UREF]], ptr [[Y]], i32 0, i32 0 // CHECK-NEXT: call ptr @swift_unknownObjectUnownedAssign(ptr returned [[T0]], ptr [[QV:%2]]) store_unowned %q to %y : $*@sil_unowned P @@ -83,15 +83,15 @@ bb0(%p : $P, %q : $P): // CHECK-NEXT: call ptr @"$s12unowned_objc1P_pXoWOb"(ptr [[Y]], ptr [[X]]) copy_addr [take] %y to [init] %x : $*@sil_unowned P - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[UREF]], ptr [[Y]], i32 0, i32 0 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[UREF]], ptr [[Y]], i32 0, i32 0 // CHECK-NEXT: [[TV:%.*]] = call ptr @swift_unknownObjectUnownedTakeStrong(ptr [[T0]]) - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[UREF]], ptr [[Y]], i32 0, i32 1 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[UREF]], ptr [[Y]], i32 0, i32 1 // CHECK-NEXT: [[TP:%.*]] = load ptr, ptr [[T0]], align 8 %t1 = load_unowned [take] %y : $*@sil_unowned P - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[UREF]], ptr [[X]], i32 0, i32 1 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[UREF]], ptr [[X]], i32 0, i32 1 // CHECK-NEXT: store ptr [[TP]], ptr [[T0]], align 8 - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[UREF]], ptr [[X]], i32 0, i32 0 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[UREF]], ptr [[X]], i32 0, i32 0 // CHECK-NEXT: call ptr @swift_unknownObjectUnownedInit(ptr returned [[T0]], ptr [[TV]]) store_unowned %t1 to [init] %x : $*@sil_unowned P @@ -121,8 +121,8 @@ bb0(%p : $P, %q : $P): // initializeBufferWithCopyOfBuffer // CHECK: define internal ptr @"$s12unowned_objc1AVwCP"(ptr noalias [[DESTBUF:%.*]], ptr noalias [[SRCBUF:%.*]], ptr -// CHECK: [[T0:%.*]] = getelementptr inbounds [[A]], ptr [[DESTBUF]], i32 0, i32 0 -// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds [[A]], ptr [[SRCBUF]], i32 0, i32 0 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[DESTBUF]], i32 0, i32 0 +// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[SRCBUF]], i32 0, i32 0 // CHECK-NEXT: [[T2:%.*]] = load ptr, ptr [[T1]], align 8 // CHECK-NEXT: call ptr @swift_unownedRetain(ptr returned [[T2]]) // CHECK-NEXT: store ptr [[T2]], ptr [[T0]], align 8 @@ -130,15 +130,15 @@ bb0(%p : $P, %q : $P): // destroy // CHECK: define internal void @"$s12unowned_objc1AVwxx"(ptr noalias [[ARG:%.*]], ptr -// CHECK: [[T1:%.*]] = getelementptr inbounds [[A]], ptr [[ARG]], i32 0, i32 0 +// CHECK: [[T1:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[ARG]], i32 0, i32 0 // CHECK-NEXT: [[T2:%.*]] = load ptr, ptr [[T1]], align 8 // CHECK-NEXT: call void @swift_unownedRelease(ptr [[T2]]) // CHECK-NEXT: ret void // initializeWithCopy // CHECK: define internal ptr @"$s12unowned_objc1AVwcp"(ptr noalias [[DEST_OPQ:%.*]], ptr noalias [[SRC_OPQ:%.*]], ptr -// CHECK: [[T0:%.*]] = getelementptr inbounds [[A]], ptr [[DEST_OPQ]], i32 0, i32 0 -// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds [[A]], ptr [[SRC_OPQ]], i32 0, i32 0 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[DEST_OPQ]], i32 0, i32 0 +// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[SRC_OPQ]], i32 0, i32 0 // CHECK-NEXT: [[T2:%.*]] = load ptr, ptr [[T1]], align 8 // CHECK-NEXT: call ptr @swift_unownedRetain(ptr returned [[T2]]) // CHECK-NEXT: store ptr [[T2]], ptr [[T0]], align 8 @@ -146,8 +146,8 @@ bb0(%p : $P, %q : $P): // assignWithCopy // CHECK: define internal ptr @"$s12unowned_objc1AVwca"(ptr [[DEST_OPQ:%.*]], ptr [[SRC_OPQ:%.*]], ptr -// CHECK: [[DEST_X:%.*]] = getelementptr inbounds [[A]], ptr [[DEST_OPQ]], i32 0, i32 0 -// CHECK-NEXT: [[SRC_X:%.*]] = getelementptr inbounds [[A]], ptr [[SRC_OPQ]], i32 0, i32 0 +// CHECK: [[DEST_X:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[DEST_OPQ]], i32 0, i32 0 +// CHECK-NEXT: [[SRC_X:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[SRC_OPQ]], i32 0, i32 0 // CHECK-NEXT: [[NEW:%.*]] = load ptr, ptr [[SRC_X]], align 8 // CHECK-NEXT: call ptr @swift_unownedRetain(ptr returned [[NEW]]) // CHECK-NEXT: [[OLD:%.*]] = load ptr, ptr [[DEST_X]], align 8 @@ -157,8 +157,8 @@ bb0(%p : $P, %q : $P): // assignWithTake // CHECK: define internal ptr @"$s12unowned_objc1AVwta"(ptr noalias [[DEST_OPQ:%.*]], ptr noalias [[SRC_OPQ:%.*]], ptr -// CHECK: [[DEST_X:%.*]] = getelementptr inbounds [[A]], ptr [[DEST_OPQ]], i32 0, i32 0 -// CHECK-NEXT: [[SRC_X:%.*]] = getelementptr inbounds [[A]], ptr [[SRC_OPQ]], i32 0, i32 0 +// CHECK: [[DEST_X:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[DEST_OPQ]], i32 0, i32 0 +// CHECK-NEXT: [[SRC_X:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[SRC_OPQ]], i32 0, i32 0 // CHECK-NEXT: [[NEW:%.*]] = load ptr, ptr [[SRC_X]], align 8 // CHECK-NEXT: [[OLD:%.*]] = load ptr, ptr [[DEST_X]], align 8 // CHECK-NEXT: store ptr [[NEW]], ptr [[DEST_X]], align 8 diff --git a/test/IRGen/variadic_generic_functions.sil b/test/IRGen/variadic_generic_functions.sil index 0d8257698e285..ee6ebc954d411 100644 --- a/test/IRGen/variadic_generic_functions.sil +++ b/test/IRGen/variadic_generic_functions.sil @@ -30,9 +30,9 @@ struct Gen2 : Q {} // CHECK: entry: // CHECK: [[METADATA_PACK:%[^,]+]] = alloca [1 x ptr] // CHECK: [[WTABLE_PACK:%[^,]+]] = alloca [1 x ptr] -// CHECK: [[METADATA_ELEMENT_0:%[^,]+]] = getelementptr inbounds [1 x ptr], ptr [[METADATA_PACK]] +// CHECK: [[METADATA_ELEMENT_0:%[^,]+]] = getelementptr inbounds{{.*}} [1 x ptr], ptr [[METADATA_PACK]] // CHECK: store ptr {{.*}}$s26variadic_generic_functions3S_2VMf{{.*}}, ptr [[METADATA_ELEMENT_0]] -// CHECK: [[WTABLE_ELEMENT_0:%[^,]+]] = getelementptr inbounds [1 x ptr], ptr [[WTABLE_PACK]] +// CHECK: [[WTABLE_ELEMENT_0:%[^,]+]] = getelementptr inbounds{{.*}} [1 x ptr], ptr [[WTABLE_PACK]] // CHECK: store ptr {{.*}}$s26variadic_generic_functions3S_2VAA1PAAWP{{.*}}, ptr [[WTABLE_ELEMENT_0]] // CHECK: call swiftcc void @g([[INT]] 1, ptr [[METADATA_PACK]], ptr [[WTABLE_PACK]]) sil @c : $() -> () { diff --git a/test/IRGen/variadic_generics.sil b/test/IRGen/variadic_generics.sil index 4876fe99b1d17..5e95b32d9b0d7 100644 --- a/test/IRGen/variadic_generics.sil +++ b/test/IRGen/variadic_generics.sil @@ -75,7 +75,7 @@ bb0: // CHECK: [[INDEX:%.*]] = add [[INT]] %1, 1 // CHECK: [[ELT_STORAGE:%.*]] = getelementptr inbounds ptr, ptr %0, [[INT]] [[INDEX]] // CHECK: [[ELT_ADDR:%.*]] = load ptr, ptr [[ELT_STORAGE]], align -// CHECK: [[VALUE_ADDR:%.*]] = getelementptr inbounds %TSi, ptr [[ELT_ADDR]], i32 0, i32 0 +// CHECK: [[VALUE_ADDR:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[ELT_ADDR]], i32 0, i32 0 // CHECK: [[RET:%.*]] = load [[INT]], ptr [[VALUE_ADDR]], align // CHECK: ret [[INT]] [[RET]] sil @test_pack_element_get_1 : $ (@pack_owned Pack{Int, repeat each T, Int}) -> Int { @@ -90,7 +90,7 @@ bb0(%pack : $*Pack{Int, repeat each T, Int}): // CHECK: [[INDEX:%.*]] = add [[INT]] %2, 1 // CHECK: [[ELT_STORAGE:%.*]] = getelementptr inbounds ptr, ptr %0, [[INT]] [[INDEX]] // CHECK: [[ELT_ADDR:%.*]] = load ptr, ptr [[ELT_STORAGE]], align -// CHECK: [[VALUE_ADDR:%.*]] = getelementptr inbounds %TSi, ptr [[ELT_ADDR]], i32 0, i32 0 +// CHECK: [[VALUE_ADDR:%.*]] = getelementptr inbounds{{.*}} %TSi, ptr [[ELT_ADDR]], i32 0, i32 0 // CHECK: store [[INT]] %1, ptr [[VALUE_ADDR]], align // CHECK: ret void sil @test_pack_element_set_1 : $ (@pack_owned Pack{Int, repeat each T, Int}, Int) -> () { diff --git a/test/IRGen/weak.sil b/test/IRGen/weak.sil index 153d6337cc9c1..45a31832a4c41 100644 --- a/test/IRGen/weak.sil +++ b/test/IRGen/weak.sil @@ -37,7 +37,7 @@ bb0(%0 : $*A, %1 : $Optional): return %4 : $() } // CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test_weak_load_store(ptr dereferenceable({{.*}}) %0, i64 %1) {{.*}} { -// CHECK: [[X:%.*]] = getelementptr inbounds [[A:%T4weak1AV]], ptr %0, i32 0, i32 0 +// CHECK: [[X:%.*]] = getelementptr inbounds{{.*}} [[A:%T4weak1AV]], ptr %0, i32 0, i32 0 // CHECK-NEXT: [[T0:%.*]] = call ptr @swift_weakLoadStrong(ptr [[X]]) // CHECK-NEXT: %3 = ptrtoint ptr %2 to i64 // CHECK-NEXT: %4 = inttoptr @@ -60,16 +60,16 @@ bb0(%0 : $*B, %1 : $Optional

): return %4 : $() } // CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test_weak_load_store_proto(ptr dereferenceable({{.*}}) %0, i64 %1, i64 %2) -// CHECK: [[X:%.*]] = getelementptr inbounds [[B:%T4weak1BV]], ptr %0, i32 0, i32 0 -// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds { [[WEAK:%swift.weak]], ptr }, ptr [[X]], i32 0, i32 0 +// CHECK: [[X:%.*]] = getelementptr inbounds{{.*}} [[B:%T4weak1BV]], ptr %0, i32 0, i32 0 +// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} { [[WEAK:%swift.weak]], ptr }, ptr [[X]], i32 0, i32 0 // CHECK-NEXT: [[T1:%.*]] = call ptr @swift_unknownObjectWeakLoadStrong(ptr [[T0]]) -// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds { [[WEAK]], ptr }, ptr [[X]], i32 0, i32 1 +// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} { [[WEAK]], ptr }, ptr [[X]], i32 0, i32 1 // CHECK-NEXT: [[W:%.*]] = load ptr, ptr [[T0]], align 8 // CHECK: [[TMPOBJ:%.*]] = inttoptr {{.*}} to ptr // CHECK: [[TMPTAB:%.*]] = inttoptr {{.*}} to ptr -// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds { [[WEAK]], ptr }, ptr [[X]], i32 0, i32 1 +// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} { [[WEAK]], ptr }, ptr [[X]], i32 0, i32 1 // CHECK-NEXT: store ptr [[TMPTAB]], ptr [[T0]], align 8 -// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds { [[WEAK]], ptr }, ptr [[X]], i32 0, i32 0 +// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} { [[WEAK]], ptr }, ptr [[X]], i32 0, i32 0 // CHECK-NEXT: call ptr @swift_unknownObjectWeakAssign(ptr returned [[T0]], ptr [[TMPOBJ]]) // CHECK: call void @swift_unknownObjectRelease @@ -86,9 +86,9 @@ bb0(%0 : $Optional

): // CHECK: [[X:%.*]] = alloca { [[WEAK]], ptr }, align 8 // CHECK: [[TMPOBJ:%.*]] = inttoptr {{.*}} to ptr // CHECK: [[TMPTAB:%.*]] = inttoptr {{.*}} to ptr -// CHECK: [[T0:%.*]] = getelementptr inbounds { [[WEAK]], ptr }, ptr [[X]], i32 0, i32 1 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} { [[WEAK]], ptr }, ptr [[X]], i32 0, i32 1 // CHECK-NEXT: store ptr [[TMPTAB:%.*]], ptr [[T0]], align 8 -// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds { [[WEAK]], ptr }, ptr [[X]], i32 0, i32 0 +// CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} { [[WEAK]], ptr }, ptr [[X]], i32 0, i32 0 // CHECK-NEXT: call ptr @swift_unknownObjectWeakInit(ptr returned [[T0]], ptr [[TMPOBJ:%.*]]) // CHECK-NEXT: call ptr @"$s4weak1P_pSgXwWOh"(ptr [[X]]) // CHECK-NEXT: llvm.lifetime.end @@ -107,7 +107,7 @@ bb0(%0 : $Optional

): // destroy // CHECK: define internal void @"$s4weak1AVwxx"(ptr noalias [[ARG:%.*]], ptr -// CHECK: [[T1:%.*]] = getelementptr inbounds [[A]], ptr [[ARG]], i32 0, i32 0 +// CHECK: [[T1:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[ARG]], i32 0, i32 0 // CHECK-NEXT: call void @swift_weakDestroy(ptr [[T1]]) // CHECK-NEXT: ret void @@ -116,8 +116,8 @@ bb0(%0 : $Optional

): // initializeWithCopy // CHECK: define internal ptr @"$s4weak1AVwcp"(ptr noalias [[DEST_OPQ:%.*]], ptr noalias [[SRC_OPQ:%.*]], ptr -// CHECK: [[T0:%.*]] = getelementptr inbounds [[A]], ptr [[DEST_OPQ]], i32 0, i32 0 -// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds [[A]], ptr [[SRC_OPQ]], i32 0, i32 0 +// CHECK: [[T0:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[DEST_OPQ]], i32 0, i32 0 +// CHECK-NEXT: [[T1:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[SRC_OPQ]], i32 0, i32 0 // CHECK-NEXT: call ptr @swift_weakCopyInit(ptr returned [[T0]], ptr [[T1]]) // CHECK-NEXT: ret ptr [[DEST_OPQ]] @@ -126,8 +126,8 @@ bb0(%0 : $Optional

): // assignWithCopy // CHECK: define internal ptr @"$s4weak1AVwca"(ptr [[DEST_OPQ:%.*]], ptr [[SRC_OPQ:%.*]], ptr -// CHECK: [[DEST_X:%.*]] = getelementptr inbounds [[A]], ptr [[DEST_OPQ]], i32 0, i32 0 -// CHECK-NEXT: [[SRC_X:%.*]] = getelementptr inbounds [[A]], ptr [[SRC_OPQ]], i32 0, i32 0 +// CHECK: [[DEST_X:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[DEST_OPQ]], i32 0, i32 0 +// CHECK-NEXT: [[SRC_X:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[SRC_OPQ]], i32 0, i32 0 // CHECK-NEXT: call ptr @swift_weakCopyAssign(ptr returned [[DEST_X]], ptr [[SRC_X]]) // CHECK-NEXT: ret ptr [[DEST_OPQ]] @@ -136,8 +136,8 @@ bb0(%0 : $Optional

): // assignWithTake // CHECK: define internal ptr @"$s4weak1AVwta"(ptr noalias [[DEST_OPQ:%.*]], ptr noalias [[SRC_OPQ:%.*]], ptr -// CHECK: [[DEST_X:%.*]] = getelementptr inbounds [[A]], ptr [[DEST_OPQ]], i32 0, i32 0 -// CHECK-NEXT: [[SRC_X:%.*]] = getelementptr inbounds [[A]], ptr [[SRC_OPQ]], i32 0, i32 0 +// CHECK: [[DEST_X:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[DEST_OPQ]], i32 0, i32 0 +// CHECK-NEXT: [[SRC_X:%.*]] = getelementptr inbounds{{.*}} [[A]], ptr [[SRC_OPQ]], i32 0, i32 0 // CHECK-NEXT: call ptr @swift_weakTakeAssign(ptr returned [[DEST_X]], ptr [[SRC_X]]) // CHECK-NEXT: ret ptr [[DEST_OPQ]] diff --git a/test/IRGen/weak_class_protocol.sil b/test/IRGen/weak_class_protocol.sil index b2bd4418c6c3c..9a93d73a4c752 100644 --- a/test/IRGen/weak_class_protocol.sil +++ b/test/IRGen/weak_class_protocol.sil @@ -11,9 +11,9 @@ protocol Foo: class { } // CHECK-objc: [[INSTANCE:%.*]] = inttoptr i64 %1 to ptr // CHECK-native: [[INSTANCE:%.*]] = inttoptr i64 %1 to ptr // CHECK: [[WTABLE:%.*]] = inttoptr i64 %2 to ptr -// CHECK: [[WTABLE_SLOT:%.*]] = getelementptr inbounds { %swift.weak, ptr }, ptr %0, i32 0, i32 1 +// CHECK: [[WTABLE_SLOT:%.*]] = getelementptr inbounds{{.*}} { %swift.weak, ptr }, ptr %0, i32 0, i32 1 // CHECK: store ptr [[WTABLE]], ptr [[WTABLE_SLOT]], align 8 -// CHECK: [[INSTANCE_SLOT:%.*]] = getelementptr inbounds { %swift.weak, ptr }, ptr %0, i32 0, i32 0 +// CHECK: [[INSTANCE_SLOT:%.*]] = getelementptr inbounds{{.*}} { %swift.weak, ptr }, ptr %0, i32 0, i32 0 // CHECK-objc: call ptr @swift_unknownObjectWeakAssign(ptr returned [[INSTANCE_SLOT]], ptr [[INSTANCE]]) {{#[0-9]+}} // CHECK-native: call ptr @swift_weakAssign(ptr returned [[INSTANCE_SLOT]], ptr [[INSTANCE]]) {{#[0-9]+}} // CHECK: ret void diff --git a/test/IRGen/witness_table_multifile.swift b/test/IRGen/witness_table_multifile.swift index 3cc30a2a8364c..de4d1defc0fb6 100644 --- a/test/IRGen/witness_table_multifile.swift +++ b/test/IRGen/witness_table_multifile.swift @@ -5,7 +5,7 @@ // CHECK-LABEL: define hidden swiftcc void @"$s23witness_table_multifile3baryyF" func bar() { // CHECK: call swiftcc void @"$s23witness_table_multifile2goAA1P_pyF" - // CHECK: [[WITNESS_TABLE_ADDR:%[0-9]+]] = getelementptr inbounds [[P_WITNESS_TABLE]], ptr %0, i32 0, i32 2 + // CHECK: [[WITNESS_TABLE_ADDR:%[0-9]+]] = getelementptr inbounds{{.*}} [[P_WITNESS_TABLE]], ptr %0, i32 0, i32 2 // CHECK: [[WITNESS_TABLE:%[A-Za-z0-9_-]+]] = load ptr, ptr [[WITNESS_TABLE_ADDR]] // CHECK: [[BUFFER:%[0-9]+]] = call ptr @__swift_project_boxed_opaque_existential_1 // CHECK-NEXT: getelementptr inbounds ptr, ptr [[WITNESS_TABLE]], i32 4 diff --git a/test/IRGen/yield_once.sil b/test/IRGen/yield_once.sil index 155df74b64ed9..cf24aa50f3f07 100644 --- a/test/IRGen/yield_once.sil +++ b/test/IRGen/yield_once.sil @@ -51,7 +51,7 @@ sil @test_simple_call : $(Builtin.Int1) -> () { entry(%flag : $Builtin.Int1): // Allocate the buffer. // CHECK: [[T0:%.*]] = alloca {{\[}}[[BUFFER_SIZE]] x i8], align [[BUFFER_ALIGN]] - // CHECK-NEXT: [[BUFFER:%.*]] = getelementptr inbounds {{\[}}[[BUFFER_SIZE]] x i8], ptr [[T0]], i32 0, i32 0 + // CHECK-NEXT: [[BUFFER:%.*]] = getelementptr inbounds{{.*}} {{\[}}[[BUFFER_SIZE]] x i8], ptr [[T0]], i32 0, i32 0 // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr [[BUFFER]]) // Prepare the continuation function pointer to block analysis. @@ -100,7 +100,7 @@ entry: // Allocate the buffer. // CHECK: [[T0:%.*]] = alloca {{\[}}[[BUFFER_SIZE]] x i8], align [[BUFFER_ALIGN]] - // CHECK-NEXT: [[BUFFER:%.*]] = getelementptr inbounds {{\[}}[[BUFFER_SIZE]] x i8], ptr [[T0]], i32 0, i32 0 + // CHECK-NEXT: [[BUFFER:%.*]] = getelementptr inbounds{{.*}} {{\[}}[[BUFFER_SIZE]] x i8], ptr [[T0]], i32 0, i32 0 // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr [[BUFFER]]) // Prepare the continuation function pointer to block analysis. diff --git a/test/IRGen/yield_once_big.sil b/test/IRGen/yield_once_big.sil index af03283f3f129..efafc5bffbea7 100644 --- a/test/IRGen/yield_once_big.sil +++ b/test/IRGen/yield_once_big.sil @@ -97,7 +97,7 @@ sil [ossa] @test_simple_call : $(Builtin.Int1) -> () { entry(%flag : $Builtin.Int1): // Allocate the buffer. // CHECK: [[T0:%.*]] = alloca {{\[}}[[BUFFER_SIZE]] x i8], align [[BUFFER_ALIGN]] - // CHECK-NEXT: [[BUFFER:%.*]] = getelementptr inbounds {{\[}}[[BUFFER_SIZE]] x i8], ptr [[T0]], i32 0, i32 0 + // CHECK-NEXT: [[BUFFER:%.*]] = getelementptr inbounds{{.*}} {{\[}}[[BUFFER_SIZE]] x i8], ptr [[T0]], i32 0, i32 0 // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr [[BUFFER]]) // CHECK-NEXT: [[TMP:%.*]] = call swiftcc %swift.metadata_response @"$s14yield_once_big12SomeSubclassCMa"([[INT]] 0) @@ -113,21 +113,21 @@ entry(%flag : $Builtin.Int1): (%value, %token) = begin_apply %0() : $@convention(thin) @yield_once () -> (@yields @owned Big) // Load. This is spurious. - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[BIGSUB:%T14yield_once_big3BigVyAA12SomeSubclassCG]], ptr [[PTR]], i32 0, i32 0 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[BIGSUB:%T14yield_once_big3BigVyAA12SomeSubclassCG]], ptr [[PTR]], i32 0, i32 0 // CHECK-NEXT: [[R0:%.*]] = load ptr, ptr [[T0]], align - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[BIGSUB]], ptr [[PTR]], i32 0, i32 1 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[BIGSUB]], ptr [[PTR]], i32 0, i32 1 // CHECK-NEXT: [[R1:%.*]] = load ptr, ptr [[T0]], align - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[BIGSUB]], ptr [[PTR]], i32 0, i32 2 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[BIGSUB]], ptr [[PTR]], i32 0, i32 2 // CHECK-NEXT: [[R2:%.*]] = load ptr, ptr [[T0]], align - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[BIGSUB]], ptr [[PTR]], i32 0, i32 3 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[BIGSUB]], ptr [[PTR]], i32 0, i32 3 // CHECK-NEXT: [[R3:%.*]] = load ptr, ptr [[T0]], align - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[BIGSUB]], ptr [[PTR]], i32 0, i32 4 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[BIGSUB]], ptr [[PTR]], i32 0, i32 4 // CHECK-NEXT: [[R4:%.*]] = load ptr, ptr [[T0]], align - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[BIGSUB]], ptr [[PTR]], i32 0, i32 5 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[BIGSUB]], ptr [[PTR]], i32 0, i32 5 // CHECK-NEXT: [[R5:%.*]] = load ptr, ptr [[T0]], align - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[BIGSUB]], ptr [[PTR]], i32 0, i32 6 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[BIGSUB]], ptr [[PTR]], i32 0, i32 6 // CHECK-NEXT: [[R6:%.*]] = load ptr, ptr [[T0]], align - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[BIGSUB]], ptr [[PTR]], i32 0, i32 7 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[BIGSUB]], ptr [[PTR]], i32 0, i32 7 // CHECK-NEXT: [[R7:%.*]] = load ptr, ptr [[T0]], align // Branch. diff --git a/test/IRGen/yield_once_biggish.sil b/test/IRGen/yield_once_biggish.sil index 039e3cafa9749..56fbaaa0a3460 100644 --- a/test/IRGen/yield_once_biggish.sil +++ b/test/IRGen/yield_once_biggish.sil @@ -59,9 +59,9 @@ entry: // Write the spilled objects to the buffer. // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 {{.*}}, ptr [[SPILLS]]) - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[SPILLS_T]], ptr [[SPILLS]], i32 0, i32 0 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[SPILLS_T]], ptr [[SPILLS]], i32 0, i32 0 // CHECK-NEXT: store ptr [[R2]], ptr [[T0]] - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[SPILLS_T]], ptr [[SPILLS]], i32 0, i32 1 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[SPILLS_T]], ptr [[SPILLS]], i32 0, i32 1 // CHECK-NEXT: store ptr [[R3]], ptr [[T0]] // Suspend. @@ -101,7 +101,7 @@ sil [ossa] @test_simple_call : $(Builtin.Int1) -> () { entry(%flag : $Builtin.Int1): // Allocate the buffer. // CHECK: [[T0:%.*]] = alloca {{\[}}[[BUFFER_SIZE]] x i8], align [[BUFFER_ALIGN]] - // CHECK-NEXT: [[BUFFER:%.*]] = getelementptr inbounds {{\[}}[[BUFFER_SIZE]] x i8], ptr [[T0]], i32 0, i32 0 + // CHECK-NEXT: [[BUFFER:%.*]] = getelementptr inbounds{{.*}} {{\[}}[[BUFFER_SIZE]] x i8], ptr [[T0]], i32 0, i32 0 // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr [[BUFFER]]) // CHECK-NEXT: [[TMP:%.*]] = call swiftcc %swift.metadata_response @"$s18yield_once_biggish12SomeSubclassCMa"([[INT]] 0) @@ -115,9 +115,9 @@ entry(%flag : $Builtin.Int1): // CHECK-NEXT: [[R0_ORIG:%.*]] = extractvalue [[RAMP_RESULT_T]] [[RAMP_RESULT]], 1 // CHECK-NEXT: [[R1_ORIG:%.*]] = extractvalue [[RAMP_RESULT_T]] [[RAMP_RESULT]], 2 // CHECK-NEXT: [[SPILLS:%.*]] = extractvalue [[RAMP_RESULT_T]] [[RAMP_RESULT]], 3 - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[SPILLS_T]], ptr [[SPILLS]], i32 0, i32 0 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[SPILLS_T]], ptr [[SPILLS]], i32 0, i32 0 // CHECK-NEXT: [[R2_ORIG:%.*]] = load ptr, ptr [[T0]], align - // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds [[SPILLS_T]], ptr [[SPILLS]], i32 0, i32 1 + // CHECK-NEXT: [[T0:%.*]] = getelementptr inbounds{{.*}} [[SPILLS_T]], ptr [[SPILLS]], i32 0, i32 1 // CHECK-NEXT: [[R3_ORIG:%.*]] = load ptr, ptr [[T0]], align %0 = function_ref @test_simple : $@convention(thin) @yield_once () -> (@yields @owned Biggish) (%value, %token) = begin_apply %0() : $@convention(thin) @yield_once () -> (@yields @owned Biggish) diff --git a/test/IRGen/yield_once_enable_emit_type_malloc_coro_frame.sil b/test/IRGen/yield_once_enable_emit_type_malloc_coro_frame.sil index 173a5d0cce5e1..6ed9e6fbb7535 100644 --- a/test/IRGen/yield_once_enable_emit_type_malloc_coro_frame.sil +++ b/test/IRGen/yield_once_enable_emit_type_malloc_coro_frame.sil @@ -70,7 +70,7 @@ sil @test_simple_call : $(Builtin.Int1) -> () { entry(%flag : $Builtin.Int1): // Allocate the buffer. // CHECK: [[T0:%.*]] = alloca {{\[}}[[BUFFER_SIZE]] x i8], align [[BUFFER_ALIGN]] - // CHECK-NEXT: [[BUFFER:%.*]] = getelementptr inbounds {{\[}}[[BUFFER_SIZE]] x i8], ptr [[T0]], i32 0, i32 0 + // CHECK-NEXT: [[BUFFER:%.*]] = getelementptr inbounds{{.*}} {{\[}}[[BUFFER_SIZE]] x i8], ptr [[T0]], i32 0, i32 0 // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr [[BUFFER]]) // Prepare the continuation function pointer to block analysis. @@ -119,7 +119,7 @@ entry: // Allocate the buffer. // CHECK: [[T0:%.*]] = alloca {{\[}}[[BUFFER_SIZE]] x i8], align [[BUFFER_ALIGN]] - // CHECK-NEXT: [[BUFFER:%.*]] = getelementptr inbounds {{\[}}[[BUFFER_SIZE]] x i8], ptr [[T0]], i32 0, i32 0 + // CHECK-NEXT: [[BUFFER:%.*]] = getelementptr inbounds{{.*}} {{\[}}[[BUFFER_SIZE]] x i8], ptr [[T0]], i32 0, i32 0 // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr [[BUFFER]]) // Prepare the continuation function pointer to block analysis. diff --git a/test/IRGen/yield_once_indirect.sil b/test/IRGen/yield_once_indirect.sil index e45ed9b15a985..f4d48b3db74c6 100644 --- a/test/IRGen/yield_once_indirect.sil +++ b/test/IRGen/yield_once_indirect.sil @@ -88,7 +88,7 @@ sil @test_simple_call : $(Builtin.Int1) -> () { entry(%flag : $Builtin.Int1): // Allocate the buffer. // CHECK: [[T0:%.*]] = alloca {{\[}}[[BUFFER_SIZE]] x i8], align [[BUFFER_ALIGN]] - // CHECK-NEXT: [[BUFFER:%.*]] = getelementptr inbounds {{\[}}[[BUFFER_SIZE]] x i8], ptr [[T0]], i32 0, i32 0 + // CHECK-NEXT: [[BUFFER:%.*]] = getelementptr inbounds{{.*}} {{\[}}[[BUFFER_SIZE]] x i8], ptr [[T0]], i32 0, i32 0 // CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 [[BUFFER_SIZE]], ptr [[BUFFER]]) // CHECK-NEXT: [[TMP:%.*]] = call swiftcc %swift.metadata_response @"$s19yield_once_indirect12SomeSubclassCMa"([[INT]] 0) diff --git a/test/IRGen/yield_result.sil b/test/IRGen/yield_result.sil index dca022d6fc83c..b192005c9e7b6 100644 --- a/test/IRGen/yield_result.sil +++ b/test/IRGen/yield_result.sil @@ -60,7 +60,7 @@ entry: // CHECK: [[T0:%.*]] = alloca {{\[}}[[BUFFER_SIZE1:.*]] x i8 // CHECK: [[T1:%.*]] = alloca {{\[}}[[BUFFER_SIZE2:.*]] x i8 -// CHECK: [[BUFFER1:%.*]] = getelementptr inbounds {{\[}}[[BUFFER_SIZE1]] x i8], ptr [[T0]], i32 0, i32 0 +// CHECK: [[BUFFER1:%.*]] = getelementptr inbounds{{.*}} {{\[}}[[BUFFER_SIZE1]] x i8], ptr [[T0]], i32 0, i32 0 // CHECK: [[CORO1:%.*]] = call ptr @llvm.coro.prepare.retcon(ptr @coro_ret) // CHECK: [[FRAME1:%.*]] = call swiftcc { ptr, i64 } [[CORO1]](ptr noalias dereferenceable([[BUFFER_SIZE1]]) [[BUFFER1]] // CHECK: [[CONT1:%.*]] = extractvalue { ptr, i64 } [[FRAME1]], 0 @@ -76,7 +76,7 @@ entry: %coro2 = function_ref @coro_ret_pair : $@yield_once @convention(thin) () -> (@yields Builtin.Int64, Builtin.Int64, Builtin.Int64) (%second, %token2) = begin_apply %coro2() : $@yield_once @convention(thin) () -> (@yields Builtin.Int64, Builtin.Int64, Builtin.Int64) -// CHECK: [[BUFFER2:%.*]] = getelementptr inbounds {{\[}}[[BUFFER_SIZE2]] x i8], ptr [[T1]], i32 0, i32 0 +// CHECK: [[BUFFER2:%.*]] = getelementptr inbounds{{.*}} {{\[}}[[BUFFER_SIZE2]] x i8], ptr [[T1]], i32 0, i32 0 // CHECK: [[CORO2:%.*]] = call ptr @llvm.coro.prepare.retcon(ptr @coro_ret_pair) // CHECK: [[FRAME2:%.*]] = call swiftcc { ptr, i64 } [[CORO2]](ptr noalias dereferenceable([[BUFFER_SIZE2]]) [[BUFFER2]] // CHECK: [[CONT2:%.*]] = extractvalue { ptr, i64 } [[FRAME2]], 0 @@ -139,7 +139,7 @@ bb0(%0 : $Builtin.Int64): %out = alloc_stack $Builtin.Int64 // CHECK: store i64 [[ARG]], ptr [[ARG_COPY]] - // CHECK: [[CTX:%.*]] = getelementptr inbounds [[[BUFFER_SIZE]] x i8], ptr [[FRAME]], i32 0, i32 0 + // CHECK: [[CTX:%.*]] = getelementptr inbounds{{.*}} [[[BUFFER_SIZE]] x i8], ptr [[FRAME]], i32 0, i32 0 // CHECK: [[CORO:%.*]] = call ptr @llvm.coro.prepare.retcon(ptr @coro_ret_indirect) // CHECK: [[FRAME:%.*]] = call swiftcc { ptr, ptr } [[CORO]](ptr{{.*}} [[CTX]], ptr [[INDIRECT_RET]], ptr noalias [[ARG_COPY]], ptr getelementptr inbounds (%swift.full_existential_type, ptr @{{.*}} diff --git a/test/Inputs/conditional_conformance_basic_conformances.swift b/test/Inputs/conditional_conformance_basic_conformances.swift index 40e8cc66b3c40..9b8bf6bc52667 100644 --- a/test/Inputs/conditional_conformance_basic_conformances.swift +++ b/test/Inputs/conditional_conformance_basic_conformances.swift @@ -48,7 +48,7 @@ public func single_generic(_: T.Type) { // CHECK: %conditional.requirement.buffer = alloca [1 x ptr], align 8 // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s42conditional_conformance_basic_conformances6SingleVMa"(i64 0, ptr %T) // CHECK-NEXT: [[Single_TYPE:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[T_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr %T.P2, ptr [[T_P2_PTR]], align 8 // CHECK-NEXT: [[Single_P1:%.*]] = call ptr @swift_getWitnessTable @@ -123,7 +123,7 @@ public func single_concrete() { // CHECK-STABLE-ABI-FALSE-NEXT: extractvalue %swift.metadata_response [[T0]], 1 // CHECK-STABLE-ABI-TRUE-NEXT: [[T0:%.*]] = call ptr @__swift_instantiateConcreteTypeFromMangledNameAbstract(ptr @"$s42conditional_conformance_basic_conformances6SingleVyAA4IsP2VGMD") -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr @"$s42conditional_conformance_basic_conformances4IsP2VAA0F0AAWP", ptr [[A_P2_PTR]], align 8 @@ -145,7 +145,7 @@ public func single_concrete() { // TYPEBYNAME: cacheIsNull: // TYPEBYNAME-NEXT: [[T0:%.*]] = call ptr @__swift_instantiateConcreteTypeFromMangledNameAbstract(ptr @"$s42conditional_conformance_basic_conformances6SingleVyAA4IsP2VGMD") -// TYPEBYNAME-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// TYPEBYNAME-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // TYPEBYNAME-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // TYPEBYNAME-NEXT: store ptr @"$s42conditional_conformance_basic_conformances4IsP2VAA0F0AAWP", ptr [[A_P2_PTR]], align 8 @@ -166,7 +166,7 @@ public func single_concrete() { // TYPEBYNAME_PRESPECIALIZED-NEXT: br i1 [[IS_NULL]], label %cacheIsNull, label %cont // TYPEBYNAME_PRESPECIALIZED: cacheIsNull: -// TYPEBYNAME_PRESPECIALIZED-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// TYPEBYNAME_PRESPECIALIZED-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // TYPEBYNAME_PRESPECIALIZED-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // TYPEBYNAME_PRESPECIALIZED-NEXT: store ptr @"$s42conditional_conformance_basic_conformances4IsP2VAA0F0AAWP", ptr [[A_P2_PTR]], align 8 @@ -237,7 +237,7 @@ public func double_generic_generic(_: U.Type, _: V.Type) { // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s42conditional_conformance_basic_conformances6DoubleVMa"(i64 0, ptr %U, ptr %V) // CHECK-NEXT: [[Double_TYPE:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [2 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [2 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr %U.P2, ptr [[B_P2_PTR]], align 8 // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 1 @@ -257,7 +257,7 @@ public func double_generic_concrete(_: X.Type) { // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s42conditional_conformance_basic_conformances6DoubleVMa"(i64 0, ptr %X, ptr getelementptr inbounds (<{ ptr, ptr, i64, ptr }>, ptr @"$s42conditional_conformance_basic_conformances4IsP3VMf", i32 0, i32 2)) // CHECK-NEXT: [[Double_TYPE:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [2 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [2 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr %X.P2, ptr [[B_P2_PTR]], align 8 // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 1 @@ -294,7 +294,7 @@ public func double_concrete_concrete() { // CHECK-STABLE-ABI-FALSE-NEXT: extractvalue %swift.metadata_response [[T0]], 1 // CHECK-STABLE-ABI-TRUE-NEXT: [[T0:%.*]] = call ptr @__swift_instantiateConcreteTypeFromMangledNameAbstract(ptr @"$s42conditional_conformance_basic_conformances6DoubleVyAA4IsP2VAA0F2P3VGMD") -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [2 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [2 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr @"$s42conditional_conformance_basic_conformances4IsP2VAA0F0AAWP", ptr [[B_P2_PTR]], align 8 // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 1 diff --git a/test/Inputs/conditional_conformance_basic_conformances_future.swift b/test/Inputs/conditional_conformance_basic_conformances_future.swift index e867a340524c7..a5e4289658656 100644 --- a/test/Inputs/conditional_conformance_basic_conformances_future.swift +++ b/test/Inputs/conditional_conformance_basic_conformances_future.swift @@ -48,7 +48,7 @@ public func single_generic(_: T.Type) { // CHECK: %conditional.requirement.buffer = alloca [1 x ptr], align 8 // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s42conditional_conformance_basic_conformances6SingleVMa"(i64 0, ptr %T) // CHECK-NEXT: [[Single_TYPE:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[T_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr %T.P2, ptr [[T_P2_PTR]], align 8 // CHECK-NEXT: [[Single_P1:%.*]] = call ptr @swift_getWitnessTable @@ -92,7 +92,7 @@ public func single_concrete() { // CHECK-NEXT: br i1 [[IS_NULL]], label %cacheIsNull, label %cont // CHECK: cacheIsNull: -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr @"$s42conditional_conformance_basic_conformances4IsP2VAA0F0AAWP", ptr [[A_P2_PTR]], align 8 @@ -124,7 +124,7 @@ public func single_concrete() { // TYPEBYNAME: cacheIsNull: // TYPEBYNAME-NEXT: [[T0:%.*]] = call ptr @__swift_instantiateConcreteTypeFromMangledNameAbstract(ptr @"$s42conditional_conformance_basic_conformances6SingleVyAA4IsP2VGMD") -// TYPEBYNAME-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// TYPEBYNAME-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // TYPEBYNAME-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // TYPEBYNAME-NEXT: store ptr @"$s42conditional_conformance_basic_conformances4IsP2VAA0F0AAWP", ptr [[A_P2_PTR]], align 8 @@ -145,7 +145,7 @@ public func single_concrete() { // TYPEBYNAME_PRESPECIALIZED-NEXT: br i1 [[IS_NULL]], label %cacheIsNull, label %cont // TYPEBYNAME_PRESPECIALIZED: cacheIsNull: -// TYPEBYNAME_PRESPECIALIZED-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// TYPEBYNAME_PRESPECIALIZED-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // TYPEBYNAME_PRESPECIALIZED-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // TYPEBYNAME_PRESPECIALIZED-NEXT: store ptr @"$s42conditional_conformance_basic_conformances4IsP2VAA0F0AAWP", ptr [[A_P2_PTR]], align 8 @@ -216,7 +216,7 @@ public func double_generic_generic(_: U.Type, _: V.Type) { // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s42conditional_conformance_basic_conformances6DoubleVMa"(i64 0, ptr %U, ptr %V) // CHECK-NEXT: [[Double_TYPE:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [2 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [2 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr %U.P2, ptr [[B_P2_PTR]], align 8 // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 1 @@ -251,7 +251,7 @@ public func double_generic_concrete(_: X.Type) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: [[Double_TYPE:%[0-9]+]] = extractvalue %swift.metadata_response [[Double_TYPE_Response]], 0 -// CHECK: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [2 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [2 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr %X.P2, ptr [[B_P2_PTR]], align 8 // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 1 @@ -306,7 +306,7 @@ public func double_concrete_concrete() { // CHECK-NEXT: br i1 [[IS_NULL]], label %cacheIsNull, label %cont // CHECK: cacheIsNull: -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [2 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [2 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr @"$s42conditional_conformance_basic_conformances4IsP2VAA0F0AAWP", ptr [[B_P2_PTR]], align 8 // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 1 diff --git a/test/Inputs/conditional_conformance_recursive.swift b/test/Inputs/conditional_conformance_recursive.swift index 37725fc368e1e..76e1bd6da402c 100644 --- a/test/Inputs/conditional_conformance_recursive.swift +++ b/test/Inputs/conditional_conformance_recursive.swift @@ -21,5 +21,5 @@ extension Wrapper: P3 where T: P3 { } // associated type witness table accessor for A : P2 in Wrapper: P2 // CHECK-LABEL: define internal swiftcc ptr @"$s33conditional_conformance_recursive7WrapperVyxGAA2P2A2aERzrl1AAA2P1P_AaEPWT" // CHECK: [[CONDITIONAL_REQ_BUFFER:%.*]] = alloca [1 x ptr] -// CHECK: [[FIRST_REQ:%.*]] = getelementptr inbounds [1 x ptr], ptr [[CONDITIONAL_REQ_BUFFER]] +// CHECK: [[FIRST_REQ:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr [[CONDITIONAL_REQ_BUFFER]] // CHECK: call ptr @swift_getWitnessTable diff --git a/test/Inputs/conditional_conformance_subclass.swift b/test/Inputs/conditional_conformance_subclass.swift index de35a0d82cc72..a91dcb3dfb281 100644 --- a/test/Inputs/conditional_conformance_subclass.swift +++ b/test/Inputs/conditional_conformance_subclass.swift @@ -50,7 +50,7 @@ public func subclassgeneric_generic(_: T.Type) { // CHECK: %conditional.requirement.buffer = alloca [1 x ptr], align 8 // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s32conditional_conformance_subclass15SubclassGenericCMa"(i64 0, ptr %T) // CHECK-NEXT: [[SubclassGeneric_TYPE:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[T_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr %T.P2, ptr [[T_P2_PTR]], align 8 // CHECK-NEXT: [[Base_P1:%.*]] = call ptr @swift_getWitnessTable @@ -85,7 +85,7 @@ public func subclassgeneric_concrete() { // CHECK-STABLE-ABI-FALSE-NEXT: extractvalue %swift.metadata_response [[T0]], 1 // CHECK-STABLE-ABI-TRUE-NEXT: [[T0:%.*]] = call ptr @__swift_instantiateConcreteTypeFromMangledNameAbstract(ptr @"$s32conditional_conformance_subclass15SubclassGenericCyAA4IsP2VGMD") -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr @"$s32conditional_conformance_subclass4IsP2VAA0E0AAWP", ptr [[A_P2_PTR]], align 8 // CHECK-NEXT: [[Base_P1:%.*]] = call ptr @swift_getWitnessTable @@ -122,7 +122,7 @@ public func subclassconcrete() { // CHECK-NEXT: [[SubclassConcrete_TYPE:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 // CHECK-NEXT: extractvalue %swift.metadata_response [[T0]], 1 -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr @"$s32conditional_conformance_subclass4IsP2VAA0E0AAWP", ptr [[A_P2_PTR]], align 8 // CHECK-NEXT: [[Base_P1:%.*]] = call ptr @swift_getWitnessTable @@ -158,7 +158,7 @@ public func subclassgenericconcrete() { // CHECK-NEXT: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s32conditional_conformance_subclass23SubclassGenericConcreteCMa"(i64 255) // CHECK-NEXT: [[SubclassGenericConcrete_TYPE:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 // CHECK-NEXT: extractvalue %swift.metadata_response [[T0]], 1 -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr @"$s32conditional_conformance_subclass4IsP2VAA0E0AAWP", ptr [[A_P2_PTR]], align 8 // CHECK-NEXT: [[Base_P1:%.*]] = call ptr @swift_getWitnessTable diff --git a/test/Inputs/conditional_conformance_subclass_future.swift b/test/Inputs/conditional_conformance_subclass_future.swift index 4f1a59e28b3f4..efe653ebc65b8 100644 --- a/test/Inputs/conditional_conformance_subclass_future.swift +++ b/test/Inputs/conditional_conformance_subclass_future.swift @@ -50,7 +50,7 @@ public func subclassgeneric_generic(_: T.Type) { // CHECK: %conditional.requirement.buffer = alloca [1 x ptr], align 8 // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s32conditional_conformance_subclass15SubclassGenericCMa"(i64 0, ptr %T) // CHECK-NEXT: [[SubclassGeneric_TYPE:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[T_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr %T.P2, ptr [[T_P2_PTR]], align 8 // CHECK-NEXT: [[Base_P1:%.*]] = call ptr @swift_getWitnessTable @@ -89,7 +89,7 @@ public func subclassgeneric_concrete() { // linux-android-NEXT: [[T0:%.*]] = call ptr @__swift_instantiateConcreteTypeFromMangledNameAbstract(ptr @"$s32conditional_conformance_subclass15SubclassGenericCyAA4IsP2VGMD") // windows-msvc-NEXT: [[T0:%.*]] = call ptr @__swift_instantiateConcreteTypeFromMangledNameAbstract(ptr @"$s32conditional_conformance_subclass15SubclassGenericCyAA4IsP2VGMD") -// CHECK: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr @"$s32conditional_conformance_subclass4IsP2VAA0E0AAWP", ptr [[A_P2_PTR]], align 8 // CHECK-NEXT: [[Base_P1:%.*]] = call ptr @swift_getWitnessTable @@ -126,7 +126,7 @@ public func subclassconcrete() { // CHECK-NEXT: [[SubclassConcrete_TYPE:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 // CHECK-NEXT: extractvalue %swift.metadata_response [[T0]], 1 -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr @"$s32conditional_conformance_subclass4IsP2VAA0E0AAWP", ptr [[A_P2_PTR]], align 8 // CHECK-NEXT: [[Base_P1:%.*]] = call ptr @swift_getWitnessTable @@ -162,7 +162,7 @@ public func subclassgenericconcrete() { // CHECK-NEXT: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s32conditional_conformance_subclass23SubclassGenericConcreteCMa"(i64 255) // CHECK-NEXT: [[SubclassGenericConcrete_TYPE:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 // CHECK-NEXT: extractvalue %swift.metadata_response [[T0]], 1 -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [1 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr @"$s32conditional_conformance_subclass4IsP2VAA0E0AAWP", ptr [[A_P2_PTR]], align 8 // CHECK-NEXT: [[Base_P1:%.*]] = call ptr @swift_getWitnessTable diff --git a/test/Inputs/conditional_conformance_with_assoc.swift b/test/Inputs/conditional_conformance_with_assoc.swift index 1aeffe8f2cf56..adc6aa0de2c97 100644 --- a/test/Inputs/conditional_conformance_with_assoc.swift +++ b/test/Inputs/conditional_conformance_with_assoc.swift @@ -103,7 +103,7 @@ public func generic_generic(_: T.Type, _: U.Type) // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s34conditional_conformance_with_assoc6DoubleVMa"(i64 0, ptr %T, ptr %U, ptr %T.P2) // CHECK-NEXT: [[Double_TYPE:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [3 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [3 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr %U.P3, ptr [[C_P3_PTR]], align 8 // CHECK-NEXT: [[B_AT2_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 1 @@ -142,7 +142,7 @@ public func generic_concrete(_: T.Type) // CHECK-SAME: ) // CHECK-NEXT: [[Double_TYPE:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [3 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [3 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr @"$s34conditional_conformance_with_assoc4IsP3VAA0F0AAWP", ptr [[C_P3_PTR]], align 8 // CHECK-NEXT: [[B_AT2_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 1 @@ -167,7 +167,7 @@ public func concrete_generic(_: U.Type) // CHECK: %conditional.requirement.buffer = alloca [3 x ptr], align 8 // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s34conditional_conformance_with_assoc6DoubleVMa"(i64 0, ptr getelementptr inbounds (<{ {{.*}} }>, ptr @"$s34conditional_conformance_with_assoc8IsAlsoP2VMf", i32 0, i32 2), ptr %U, ptr @"$s34conditional_conformance_with_assoc8IsAlsoP2VAA0G0AAWP") // CHECK-NEXT: [[Double_TYPE:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [3 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [3 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr %U.P3, ptr [[C_P3_PTR]], align 8 // CHECK-NEXT: [[B_AT2_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 1 @@ -206,7 +206,7 @@ public func concrete_concrete() { // CHECK-STABLE-ABI-FALSE-NEXT: [[Double_TYPE:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 // CHECK-STABLE-ABI-FALSE-NEXT: extractvalue %swift.metadata_response [[T0]], 1 // CHECK-STABLE-ABI-TRUE-NEXT: [[T0:%.*]] = call ptr @__swift_instantiateConcreteTypeFromMangledNameAbstract(ptr @"$s34conditional_conformance_with_assoc6DoubleVyAA8IsAlsoP2VAA0F2P3VGMD") -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [3 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [3 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr @"$s34conditional_conformance_with_assoc4IsP3VAA0F0AAWP", ptr [[C_P3_PTR]], align 8 // CHECK-NEXT: [[B_AT2_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 1 diff --git a/test/Inputs/conditional_conformance_with_assoc_future.swift b/test/Inputs/conditional_conformance_with_assoc_future.swift index 5dee20e72d072..f264b742db309 100644 --- a/test/Inputs/conditional_conformance_with_assoc_future.swift +++ b/test/Inputs/conditional_conformance_with_assoc_future.swift @@ -103,7 +103,7 @@ public func generic_generic(_: T.Type, _: U.Type) // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s34conditional_conformance_with_assoc6DoubleVMa"(i64 0, ptr %T, ptr %U, ptr %T.P2) // CHECK-NEXT: [[Double_TYPE:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [3 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [3 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr %U.P3, ptr [[C_P3_PTR]], align 8 // CHECK-NEXT: [[B_AT2_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 1 @@ -143,7 +143,7 @@ public func generic_concrete(_: T.Type) // CHECK-SAME: ) // CHECK-NEXT: [[Double_TYPE:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [3 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [3 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr @"$s34conditional_conformance_with_assoc4IsP3VAA0F0AAWP", ptr [[C_P3_PTR]], align 8 // CHECK-NEXT: [[B_AT2_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 1 @@ -168,7 +168,7 @@ public func concrete_generic(_: U.Type) // CHECK: %conditional.requirement.buffer = alloca [3 x ptr], align 8 // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s34conditional_conformance_with_assoc6DoubleVMa"(i64 0, ptr getelementptr inbounds (<{ {{.*}} }>, ptr @"$s34conditional_conformance_with_assoc8IsAlsoP2VMf", i32 0, i32 2), ptr %U, ptr @"$s34conditional_conformance_with_assoc8IsAlsoP2VAA0G0AAWP") // CHECK-NEXT: [[Double_TYPE:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [3 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [3 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr %U.P3, ptr [[C_P3_PTR]], align 8 // CHECK-NEXT: [[B_AT2_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 1 @@ -215,7 +215,7 @@ public func concrete_concrete() { // CHECK-NEXT: br i1 [[IS_NULL]], label %cacheIsNull, label %cont // CHECK: cacheIsNull: -// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds [3 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 +// CHECK-NEXT: [[CONDITIONAL_REQUIREMENTS:%.*]] = getelementptr inbounds{{.*}} [3 x ptr], ptr %conditional.requirement.buffer, i32 0, i32 0 // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 0 // CHECK-NEXT: store ptr @"$s34conditional_conformance_with_assoc4IsP3VAA0F0AAWP", ptr [[C_P3_PTR]], align 8 // CHECK-NEXT: [[B_AT2_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr [[CONDITIONAL_REQUIREMENTS]], i32 1 diff --git a/test/Interop/Cxx/class/closure-thunk-irgen.swift b/test/Interop/Cxx/class/closure-thunk-irgen.swift index 7745b4364d798..856777ac27996 100644 --- a/test/Interop/Cxx/class/closure-thunk-irgen.swift +++ b/test/Interop/Cxx/class/closure-thunk-irgen.swift @@ -5,10 +5,10 @@ import Closure // CHECK: define linkonce_odr hidden void @"$sSo10NonTrivialVIegn_ABIeyBX_TR"(ptr %[[V0:.*]], ptr %[[V1:.*]]) -// CHECK: %[[V2:.*]] = getelementptr inbounds { %{{.*}}, %{{.*}} }, ptr %[[V0]], i32 0, i32 1 -// CHECK-NEXT: %[[_FN:.*]] = getelementptr inbounds %{{.*}}, ptr %[[V2]], i32 0, i32 0 +// CHECK: %[[V2:.*]] = getelementptr inbounds{{.*}} { %{{.*}}, %{{.*}} }, ptr %[[V0]], i32 0, i32 1 +// CHECK-NEXT: %[[_FN:.*]] = getelementptr inbounds{{.*}} %{{.*}}, ptr %[[V2]], i32 0, i32 0 // CHECK-NEXT: %[[V3:.*]] = load ptr, ptr %[[_FN]], align 8 -// CHECK-NEXT: %[[_DATA:.*]] = getelementptr inbounds %{{.*}}, ptr %[[V2]], i32 0, i32 1 +// CHECK-NEXT: %[[_DATA:.*]] = getelementptr inbounds{{.*}} %{{.*}}, ptr %[[V2]], i32 0, i32 1 // CHECK-NEXT: %[[V4:.*]] = load ptr, ptr %[[_DATA]], align 8 // CHECK-NEXT: call ptr @swift_retain(ptr returned %[[V4]]) // CHECK-NEXT: call swiftcc void %[[V3]](ptr noalias dereferenceable(8) %[[V1]], ptr swiftself %[[V4]]) @@ -44,7 +44,7 @@ public func testClosureToFuncPtrReturnNonTrivial() { // CHECK: define swiftcc { ptr, ptr } @"$s4main13returnFuncPtrySo10NonTrivialVcyF"() // CHECK: %[[V0:.*]] = call ptr @_Z8getFnPtrv() // CHECK: %[[V1:.*]] = call noalias ptr @swift_allocObject(ptr getelementptr inbounds (%{{.*}}, ptr @{{.*}}, i32 0, i32 2), i64 24, i64 7) -// CHECK: %[[V2:.*]] = getelementptr inbounds <{ %{{.*}}, ptr }>, ptr %[[V1]], i32 0, i32 1 +// CHECK: %[[V2:.*]] = getelementptr inbounds{{.*}} <{ %{{.*}}, ptr }>, ptr %[[V1]], i32 0, i32 1 // CHECK: store ptr %[[V0]], ptr %[[V2]], align 8 // CHECK: %[[V3:.*]] = insertvalue { ptr, ptr } { ptr @"$sSo10NonTrivialVIetCX_ABIegn_TRTA{{(\.ptrauth)?}}", ptr undef }, ptr %[[V1]], 1 // CHECK: ret { ptr, ptr } %[[V3]] @@ -62,7 +62,7 @@ public func testClosureToFuncPtrReturnNonTrivial() { // CHECK-NEXT: ret void // CHECK: define internal swiftcc void @"$sSo10NonTrivialVIetCX_ABIegn_TRTA"(ptr noalias dereferenceable(8) %[[V0]], ptr swiftself %[[V1]]) -// CHECK: %[[V2]] = getelementptr inbounds <{ %{{.*}}, ptr }>, ptr %[[V1]], i32 0, i32 1 +// CHECK: %[[V2]] = getelementptr inbounds{{.*}} <{ %{{.*}}, ptr }>, ptr %[[V1]], i32 0, i32 1 // CHECK-NEXT: %[[V3]] = load ptr, ptr %[[V2]], align 8 // CHECK-NEXT: tail call swiftcc void @"$sSo10NonTrivialVIetCX_ABIegn_TR"(ptr noalias dereferenceable(8) %[[V0]], ptr %[[V3]]) // CHECK-NEXT: ret void diff --git a/test/Interop/Cxx/class/closure-thunk-macosx-irgen.swift b/test/Interop/Cxx/class/closure-thunk-macosx-irgen.swift index 2cc33bdd042d3..9dfe7846df1ee 100644 --- a/test/Interop/Cxx/class/closure-thunk-macosx-irgen.swift +++ b/test/Interop/Cxx/class/closure-thunk-macosx-irgen.swift @@ -9,10 +9,10 @@ import Closure // CHECK: ret void // CHECK: define linkonce_odr hidden void @"$sSo10NonTrivialVIegr_ABIeyBr_TR"(ptr noalias sret(%{{.*}}) %[[V0:.*]], ptr %[[V1:.*]]) -// CHECK: %[[V2:.*]] = getelementptr inbounds { %{{.*}}, %{{.*}} }, ptr %[[V1]], i32 0, i32 1 -// CHECK: %[[_FN:.*]] = getelementptr inbounds %{{.*}}, ptr %[[V2]], i32 0, i32 0 +// CHECK: %[[V2:.*]] = getelementptr inbounds{{.*}} { %{{.*}}, %{{.*}} }, ptr %[[V1]], i32 0, i32 1 +// CHECK: %[[_FN:.*]] = getelementptr inbounds{{.*}} %{{.*}}, ptr %[[V2]], i32 0, i32 0 // CHECK: %[[V3:.*]] = load ptr, ptr %[[_FN]], align 8 -// CHECK: %[[_DATA:.*]] = getelementptr inbounds %{{.*}}, ptr %[[V2]], i32 0, i32 1 +// CHECK: %[[_DATA:.*]] = getelementptr inbounds{{.*}} %{{.*}}, ptr %[[V2]], i32 0, i32 1 // CHECK: %[[V4:.*]] = load ptr, ptr %[[_DATA]], align 8 // CHECK: call ptr @swift_retain(ptr returned %[[V4]]) // CHECK: call swiftcc void %[[V3]](ptr noalias sret(%{{.*}}) %[[V0]], ptr swiftself %[[V4]]) diff --git a/test/Interop/Cxx/class/inheritance/fields-irgen.swift b/test/Interop/Cxx/class/inheritance/fields-irgen.swift index b18a39da3ce7d..7ce5472b0673d 100644 --- a/test/Interop/Cxx/class/inheritance/fields-irgen.swift +++ b/test/Interop/Cxx/class/inheritance/fields-irgen.swift @@ -11,4 +11,4 @@ let _ = testGetX() // CHECK: define {{.*}}linkonce_odr{{.*}} i32 @{{(.*)(30CopyTrackedDerivedDerivedClass33__synthesizedBaseGetterAccessor_x|__synthesizedBaseGetterAccessor_x@CopyTrackedDerivedDerivedClass)(.*)}}(ptr {{.*}} %[[THIS_PTR:.*]]) // CHECK: %[[ADD_PTR:.*]] = getelementptr inbounds i8, ptr %{{.*}}, i{{32|64}} 4 -// CHECK: %[[X:.*]] = getelementptr inbounds %class.CopyTrackedBaseClass, ptr %[[ADD_PTR]], i32 0, i32 0 +// CHECK: %[[X:.*]] = getelementptr inbounds{{.*}} %class.CopyTrackedBaseClass, ptr %[[ADD_PTR]], i32 0, i32 0 diff --git a/test/Interop/Cxx/class/memory-layout-silgen.swift b/test/Interop/Cxx/class/memory-layout-silgen.swift index d56a3ee81d2f5..22afb63089844 100644 --- a/test/Interop/Cxx/class/memory-layout-silgen.swift +++ b/test/Interop/Cxx/class/memory-layout-silgen.swift @@ -8,5 +8,5 @@ var v = PrivateMemberLayout() // words, we use Clang's, not Swift's view of the class to compute the memory // layout. // The important point here is that the second index is 1, not 0. -// CHECK: store i32 42, ptr getelementptr inbounds (%TSo19PrivateMemberLayoutV, ptr @"$s4main1vSo19PrivateMemberLayoutVvp", i32 0, i32 1), align 4 +// CHECK: store i32 42, ptr getelementptr inbounds{{.*}} (%TSo19PrivateMemberLayoutV, ptr @"$s4main1vSo19PrivateMemberLayoutVvp", i32 0, i32 1), align 4 v.b = 42 diff --git a/test/Interop/Cxx/class/move-only/inherited-field-access-irgen.swift b/test/Interop/Cxx/class/move-only/inherited-field-access-irgen.swift index 75643f9261883..8152635fa8d32 100644 --- a/test/Interop/Cxx/class/move-only/inherited-field-access-irgen.swift +++ b/test/Interop/Cxx/class/move-only/inherited-field-access-irgen.swift @@ -18,9 +18,9 @@ func testSetX(_ x: CInt) { testSetX(2) // CHECK: define {{.*}}linkonce_odr{{.*}} ptr @{{(.*)(31NonCopyableHolderDerivedDerived*33__synthesizedBaseGetterAccessor_x|__synthesizedBaseGetterAccessor_x@NonCopyableHolderDerivedDerived)(.*)}} -// CHECK: %[[VPTR:.*]] = getelementptr inbounds %struct.NonCopyableHolder +// CHECK: %[[VPTR:.*]] = getelementptr inbounds{{.*}} %struct.NonCopyableHolder // CHECK: ret ptr %[[VPTR]] // CHECK: define {{.*}}linkonce_odr{{.*}} ptr @{{(.*)(31NonCopyableHolderDerivedDerived33__synthesizedBaseSetterAccessor_x|__synthesizedBaseSetterAccessor_x@NonCopyableHolderDerivedDerived)(.*)}} -// CHECK: %[[VPTRS:.*]] = getelementptr inbounds %struct.NonCopyableHolder +// CHECK: %[[VPTRS:.*]] = getelementptr inbounds{{.*}} %struct.NonCopyableHolder // CHECK: ret ptr %[[VPTRS]] diff --git a/test/Interop/Cxx/class/type-classification-non-trivial-irgen.swift b/test/Interop/Cxx/class/type-classification-non-trivial-irgen.swift index ad62ecb3174d5..625c0a0618276 100644 --- a/test/Interop/Cxx/class/type-classification-non-trivial-irgen.swift +++ b/test/Interop/Cxx/class/type-classification-non-trivial-irgen.swift @@ -13,8 +13,8 @@ import TypeClassification // CHECK-LABEL: define {{.*}}i1 @"$s4main37testStructWithCopyConstructorAndValueSbyF" // CHECK: [[OBJ:%.*]] = alloca %TSo33StructWithCopyConstructorAndValueV // CHECK: call {{.*}}@{{_ZN33StructWithCopyConstructorAndValueC(1|2)Ei|"\?\?0StructWithCopyConstructorAndValue@@QEAA@H@Z"}}(ptr {{(noalias )?}}[[OBJ]], i32 42) -// CHECK: [[OBJ_VAL:%.*]] = getelementptr inbounds %TSo33StructWithCopyConstructorAndValueV, ptr [[OBJ]], i32 0, i32 0 -// CHECK: [[I_VAL:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[OBJ_VAL]], i32 0, i32 0 +// CHECK: [[OBJ_VAL:%.*]] = getelementptr inbounds{{.*}} %TSo33StructWithCopyConstructorAndValueV, ptr [[OBJ]], i32 0, i32 0 +// CHECK: [[I_VAL:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[OBJ_VAL]], i32 0, i32 0 // CHECK: [[I_VAL_VAL:%.*]] = load i32, ptr [[OBJ_VAL]] // CHECK: [[OUT:%.*]] = icmp eq i32 [[I_VAL_VAL]], 42 // CHECK: ret i1 [[OUT]] @@ -29,8 +29,8 @@ public func testStructWithCopyConstructorAndValue() -> Bool { // CHECK: alloca %TSo33StructWithCopyConstructorAndValueV // CHECK: [[TMP:%.*]] = alloca %TSo33StructWithCopyConstructorAndValueV // CHECK: call {{.*}}@{{_ZN33StructWithCopyConstructorAndValueC(1|2)Ei|"\?\?0StructWithCopyConstructorAndValue@@QEAA@H@Z"}}(ptr {{(noalias )?}}[[MEMBER]], i32 42) -// CHECK: [[TEMP_MEMBER:%.*]] = getelementptr inbounds %TSo33StructWithCopyConstructorAndValueV, ptr [[TMP]], i32 0, i32 0 -// CHECK: [[TEMP_MEMBER_VALUE:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[TEMP_MEMBER]], i32 0, i32 0 +// CHECK: [[TEMP_MEMBER:%.*]] = getelementptr inbounds{{.*}} %TSo33StructWithCopyConstructorAndValueV, ptr [[TMP]], i32 0, i32 0 +// CHECK: [[TEMP_MEMBER_VALUE:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[TEMP_MEMBER]], i32 0, i32 0 // CHECK: [[LHS:%.*]] = load i32, ptr [[TEMP_MEMBER_VALUE]] // CHECK: [[OUT:%.*]] = icmp eq i32 [[LHS]], 42 // CHECK: ret i1 [[OUT]] @@ -48,8 +48,8 @@ public func testStructWithSubobjectCopyConstructorAndValue() -> Bool { // CHECK: call {{.*}}@{{_ZN33StructWithCopyConstructorAndValueC(1|2)Ei|"\?\?0StructWithCopyConstructorAndValue@@QEAA@H@Z"}}(ptr {{(noalias )?}}[[MEMBER]], i32 42) // CHECK: call {{.*}}@{{_ZN33StructWithCopyConstructorAndValueC(1|2)ERKS_|"\?\?0StructWithCopyConstructorAndValue@@QEAA@AEBU0@@Z"}}(ptr [[TEMP]], ptr [[MEMBER]]) // CHECK: call {{.*}}@{{_ZN60StructWithCopyConstructorAndSubobjectCopyConstructorAndValueC(1|2)E33StructWithCopyConstructorAndValue|"\?\?0StructWithCopyConstructorAndSubobjectCopyConstructorAndValue@@QEAA@UStructWithCopyConstructorAndValue@@@Z"}}(ptr {{(noalias )?}}[[OBJ]], ptr [[TEMP]]) -// CHECK: [[TEMP_MEMBER:%.*]] = getelementptr inbounds %TSo33StructWithCopyConstructorAndValueV, ptr [[TEMP2]], i32 0, i32 0 -// CHECK: [[TEMP_MEMBER_VAL:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[TEMP_MEMBER]], i32 0, i32 0 +// CHECK: [[TEMP_MEMBER:%.*]] = getelementptr inbounds{{.*}} %TSo33StructWithCopyConstructorAndValueV, ptr [[TEMP2]], i32 0, i32 0 +// CHECK: [[TEMP_MEMBER_VAL:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[TEMP_MEMBER]], i32 0, i32 0 // CHECK: [[LHS:%.*]] = load i32, ptr [[TEMP_MEMBER_VAL]] // CHECK: [[OUT:%.*]] = icmp eq i32 [[LHS]], 42 // CHECK: ret i1 [[OUT]] @@ -63,8 +63,8 @@ public func testStructWithCopyConstructorAndSubobjectCopyConstructorAndValue() } // CHECK-LABEL: define {{.*}}i1 @"$s4main4test3objSbSo33StructWithCopyConstructorAndValueV_tF"(ptr noalias dereferenceable(4) %0) -// CHECK: [[VAL:%.*]] = getelementptr inbounds %TSo33StructWithCopyConstructorAndValueV, ptr %0, i32 0, i32 0 -// CHECK: [[VAL_VAL:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[VAL]], i32 0, i32 0 +// CHECK: [[VAL:%.*]] = getelementptr inbounds{{.*}} %TSo33StructWithCopyConstructorAndValueV, ptr %0, i32 0, i32 0 +// CHECK: [[VAL_VAL:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[VAL]], i32 0, i32 0 // CHECK: [[LHS:%.*]] = load i32, ptr [[VAL_VAL]] // CHECK: [[OUT:%.*]] = icmp eq i32 [[LHS]], 42 // CHECK: ret i1 [[OUT]] @@ -74,9 +74,9 @@ public func test(obj: StructWithCopyConstructorAndValue) -> Bool { // CHECK-LABEL: define {{.*}}i1 @"$s4main4test3objSbSo42StructWithSubobjectCopyConstructorAndValueV_tF"(ptr noalias dereferenceable(4) %0) // CHECK: [[TMP:%.*]] = alloca %TSo33StructWithCopyConstructorAndValueV -// CHECK: [[MEMBER:%.*]] = getelementptr inbounds %TSo42StructWithSubobjectCopyConstructorAndValueV, ptr %0, i32 0, i32 0 -// CHECK: [[VAL:%.*]] = getelementptr inbounds %TSo33StructWithCopyConstructorAndValueV, ptr [[TMP]], i32 0, i32 0 -// CHECK: [[VAL_VAL:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[VAL]], i32 0, i32 0 +// CHECK: [[MEMBER:%.*]] = getelementptr inbounds{{.*}} %TSo42StructWithSubobjectCopyConstructorAndValueV, ptr %0, i32 0, i32 0 +// CHECK: [[VAL:%.*]] = getelementptr inbounds{{.*}} %TSo33StructWithCopyConstructorAndValueV, ptr [[TMP]], i32 0, i32 0 +// CHECK: [[VAL_VAL:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[VAL]], i32 0, i32 0 // CHECK: [[LHS:%.*]] = load i32, ptr [[VAL_VAL]] // CHECK: [[OUT:%.*]] = icmp eq i32 [[LHS]], 42 // CHECK: ret i1 [[OUT]] @@ -86,8 +86,8 @@ public func test(obj: StructWithSubobjectCopyConstructorAndValue) -> Bool { // CHECK-LABEL: define {{.*}}i1 @"$s4main4test3objSbSo037StructWithCopyConstructorAndSubobjectfgH5ValueV_tF"(ptr noalias dereferenceable(4) %0) // CHECK:[[TEMP:%.*]] = alloca %TSo33StructWithCopyConstructorAndValueV -// CHECK:[[VAL:%.*]] = getelementptr inbounds %TSo33StructWithCopyConstructorAndValueV, ptr [[TEMP]], i32 0, i32 0 -// CHECK:[[VAL_VAL:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[VAL]], i32 0, i32 0 +// CHECK:[[VAL:%.*]] = getelementptr inbounds{{.*}} %TSo33StructWithCopyConstructorAndValueV, ptr [[TEMP]], i32 0, i32 0 +// CHECK:[[VAL_VAL:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[VAL]], i32 0, i32 0 // CHECK:[[LHS:%.*]] = load i32, ptr [[VAL_VAL]] // CHECK:[[OUT:%.*]] = icmp eq i32 [[LHS]], 42 // CHECK:ret i1 [[OUT]] diff --git a/test/Interop/Cxx/foreign-reference/base-class-layout-irgen.swift b/test/Interop/Cxx/foreign-reference/base-class-layout-irgen.swift index cfbda03cb9b2b..8866fb5db666e 100644 --- a/test/Interop/Cxx/foreign-reference/base-class-layout-irgen.swift +++ b/test/Interop/Cxx/foreign-reference/base-class-layout-irgen.swift @@ -5,7 +5,7 @@ import MemberLayout // CHECK: %TSo7IntBaseV = type <{ [4 x i8], %Ts5Int32V }> // CHECK-LABEL: define {{.*}}swiftcc i32 @"$s4testAA1ys5Int32VSo7IntBaseV_tF"(ptr %0) -// CHECK: getelementptr inbounds %TSo7IntBaseV, ptr %0, i32 0, i32 1 +// CHECK: getelementptr inbounds{{.*}} %TSo7IntBaseV, ptr %0, i32 0, i32 1 public func test(y: IntBase) -> CInt { return y.i } diff --git a/test/Interop/Cxx/foreign-reference/derived-field-getter-retainable-frt-irgen.swift b/test/Interop/Cxx/foreign-reference/derived-field-getter-retainable-frt-irgen.swift index a8eb643102929..aeacbd09db366 100644 --- a/test/Interop/Cxx/foreign-reference/derived-field-getter-retainable-frt-irgen.swift +++ b/test/Interop/Cxx/foreign-reference/derived-field-getter-retainable-frt-irgen.swift @@ -11,6 +11,6 @@ let _ = testGetX() // CHECK: define {{.*}}linkonce_odr{{.*}} ptr @{{.*}}__synthesizedBaseGetterAccessor_{{.*}}(ptr {{.*}} %[[THIS_PTR:.*]]) -// CHECK: %[[VALUE_PTR_PTR:.*]] = getelementptr inbounds %class.BaseFieldFRT, ptr %{{.*}}, i32 0, i32 0 +// CHECK: %[[VALUE_PTR_PTR:.*]] = getelementptr inbounds{{.*}} %class.BaseFieldFRT, ptr %{{.*}}, i32 0, i32 0 // CHECK: %[[VALUE_PTR:.*]] = load ptr, ptr %[[VALUE_PTR_PTR]] // CHECK: call void @{{.*}}retainRefCounted{{.*}}(ptr noundef %[[VALUE_PTR]]) diff --git a/test/Interop/Cxx/foreign-reference/pod-irgen.swift b/test/Interop/Cxx/foreign-reference/pod-irgen.swift index 5354911f559aa..d1d17254381aa 100644 --- a/test/Interop/Cxx/foreign-reference/pod-irgen.swift +++ b/test/Interop/Cxx/foreign-reference/pod-irgen.swift @@ -13,8 +13,8 @@ import POD // CHECK: [[CREATED:%.*]] = call ptr @{{_ZN7IntPair6createEv|"\?create\@IntPair\@\@SAPEAU1\@XZ"}}() // CHECK: store ptr [[CREATED]], ptr [[X]] -// CHECK: [[B_FIELD:%.*]] = getelementptr inbounds %TSo7IntPairV, ptr [[CREATED]], i32 0, i32 1 -// CHECK: [[INT_VALUE:%.*]] = getelementptr inbounds %Ts5Int32V, ptr [[B_FIELD]], i32 0, i32 0 +// CHECK: [[B_FIELD:%.*]] = getelementptr inbounds{{.*}} %TSo7IntPairV, ptr [[CREATED]], i32 0, i32 1 +// CHECK: [[INT_VALUE:%.*]] = getelementptr inbounds{{.*}} %Ts5Int32V, ptr [[B_FIELD]], i32 0, i32 0 // CHECK: store i32 42, ptr [[INT_VALUE]], align 4 // CHECK: call i32 @{{_ZNK7IntPair4testEv|"\?test\@IntPair\@\@QEBAHXZ"}}(ptr [[CREATED]]) diff --git a/test/Interop/Cxx/foreign-reference/unimportable-member-layout-irgen.swift b/test/Interop/Cxx/foreign-reference/unimportable-member-layout-irgen.swift index 37122a035e1b2..c6057f082dead 100644 --- a/test/Interop/Cxx/foreign-reference/unimportable-member-layout-irgen.swift +++ b/test/Interop/Cxx/foreign-reference/unimportable-member-layout-irgen.swift @@ -11,25 +11,25 @@ import MemberLayout // CHECK: %TSo23UnimportableMemberValueV = type <{ %Ts5Int32V, %Ts5Int32V, [8 x i8], %Ts5Int32V }> // CHECK-LABEL: define {{.*}}swiftcc i8 @"$s4testAA1ys4Int8VSo10IntCharRefV_tF"(ptr %0) -// CHECK: getelementptr inbounds %TSo10IntCharRefV, ptr %0, i32 0, i32 1 +// CHECK: getelementptr inbounds{{.*}} %TSo10IntCharRefV, ptr %0, i32 0, i32 1 public func test(y: IntCharRef) -> CChar { return y.b } // CHECK-LABEL: define {{.*}}swiftcc i8 @"$s4testAA1ys4Int8VSo12IntCharValueV_tF"(ptr %0) -// CHECK: getelementptr inbounds %TSo12IntCharValueV, ptr %0, i32 0, i32 1 +// CHECK: getelementptr inbounds{{.*}} %TSo12IntCharValueV, ptr %0, i32 0, i32 1 public func test(y: IntCharValue) -> CChar { return y.b } // CHECK-LABEL: define {{.*}}swiftcc i32 @"$s4testAA1ys5Int32VSo21UnimportableMemberRefV_tF"(ptr %0) -// CHECK: getelementptr inbounds %TSo21UnimportableMemberRefV, ptr %0, i32 0, i32 3 +// CHECK: getelementptr inbounds{{.*}} %TSo21UnimportableMemberRefV, ptr %0, i32 0, i32 3 public func test(y: UnimportableMemberRef) -> CInt { return y.y } // CHECK-LABEL: define {{.*}}swiftcc i32 @"$s4testAA1ys5Int32VSo23UnimportableMemberValueV_tF"(ptr %0) -// CHECK: getelementptr inbounds %TSo23UnimportableMemberValueV, ptr %0, i32 0, i32 3 +// CHECK: getelementptr inbounds{{.*}} %TSo23UnimportableMemberValueV, ptr %0, i32 0, i32 3 public func test(y: UnimportableMemberValue) -> CInt { return y.y } diff --git a/test/Interop/Cxx/operators/member-inline-irgen.swift b/test/Interop/Cxx/operators/member-inline-irgen.swift index c3f5472ab4ba7..33b7e9d394e58 100644 --- a/test/Interop/Cxx/operators/member-inline-irgen.swift +++ b/test/Interop/Cxx/operators/member-inline-irgen.swift @@ -24,7 +24,7 @@ public func index(_ arr: inout ReadOnlyIntArray, _ arg: Int32) -> Int32 { arr[ar // CHECK: call ptr [[NAME:@(_ZNK16ReadOnlyIntArrayixEi|"\?\?AReadOnlyIntArray@@QEBAAEBHH@Z")]](ptr {{.*}}, {{i32|i64}}{{.*}}) // CHECK: define {{.*}}ptr [[NAME]](ptr {{.*}}, {{i32|\[1 x i32\]|i64|%struct.ReadOnlyIntArray\* byval\(%struct.ReadOnlyIntArray\)}}{{.*}}) // CHECK: [[THIS:%.*]] = load ptr, ptr -// CHECK: [[VALUES:%.*]] = getelementptr inbounds %struct.ReadOnlyIntArray, ptr [[THIS]] +// CHECK: [[VALUES:%.*]] = getelementptr inbounds{{.*}} %struct.ReadOnlyIntArray, ptr [[THIS]] // CHECK: [[VALUE:%.*]] = getelementptr inbounds [5 x {{i32|i64}}], ptr [[VALUES]] // CHECK: ret ptr [[VALUE]] @@ -33,7 +33,7 @@ public func index(_ arr: inout ReadWriteIntArray, _ arg: Int32, _ val: Int32) { // CHECK: call ptr [[NAME:@(_ZN17ReadWriteIntArrayixEi|"\?\?AReadWriteIntArray@@QEAAAEAHH@Z")]](ptr {{.*}}, {{i32|i64}}{{.*}}) // CHECK: define {{.*}}ptr [[NAME]](ptr {{.*}}, {{i32|\[1 x i32\]|i64|%struct.ReadWriteIntArray\* byval\(%struct.ReadWriteIntArray\)}}{{.*}}) // CHECK: [[THIS:%.*]] = load ptr, ptr -// CHECK: [[VALUES:%.*]] = getelementptr inbounds %struct.ReadWriteIntArray, ptr [[THIS]] +// CHECK: [[VALUES:%.*]] = getelementptr inbounds{{.*}} %struct.ReadWriteIntArray, ptr [[THIS]] // CHECK: [[VALUE:%.*]] = getelementptr inbounds [5 x {{i32|i64}}], ptr [[VALUES]] // CHECK: ret ptr [[VALUE]] @@ -44,7 +44,7 @@ public func index(_ arr: inout NonTrivialIntArrayByVal, _ arg: Int32) -> Int32 { // CHECK: define {{.*}}[[RES:i32|i64]] [[NAME]](ptr {{.*}}, {{i32|\[1 x i32\]|i64|%struct.NonTrivialIntArrayByVal\* byval\(%struct.NonTrivialIntArrayByVal\)}}{{.*}}) // CHECK: [[THIS:%.*]] = load ptr, ptr -// CHECK: [[VALUES:%.*]] = getelementptr inbounds %struct.NonTrivialIntArrayByVal, ptr [[THIS]] +// CHECK: [[VALUES:%.*]] = getelementptr inbounds{{.*}} %struct.NonTrivialIntArrayByVal, ptr [[THIS]] // CHECK: [[VALUE:%.*]] = getelementptr inbounds [5 x {{i32|i64}}], ptr [[VALUES]] // CHECK: [[VALUE2:%.*]] = load {{i32|i64}}, ptr [[VALUE]] // CHECK: ret {{i32|i64}} [[VALUE2]] diff --git a/test/ModuleInterface/private-stored-member-type-layout.swift b/test/ModuleInterface/private-stored-member-type-layout.swift index fba3799c8b993..494aa191c920f 100644 --- a/test/ModuleInterface/private-stored-member-type-layout.swift +++ b/test/ModuleInterface/private-stored-member-type-layout.swift @@ -28,17 +28,17 @@ import PrivateStoredMembers // CHECK-EXEC: swiftcc void @"$s{{[^ ]+}}8makeUseryyF"() #0 { public func makeUser() { let ptr = UnsafeMutablePointer.allocate(capacity: 1) - // CHECK-EXEC: %.publicEndVar = getelementptr inbounds [[MYSTRUCT]], ptr %{{[0-9]+}}, i32 0, i32 [[PUBLIC_END_VAR_IDX:12]] - // CHECK-EXEC: %.publicEndVar._value = getelementptr inbounds %Ts5Int64V, ptr %.publicEndVar, i32 0, i32 0 + // CHECK-EXEC: %.publicEndVar = getelementptr inbounds{{.*}} [[MYSTRUCT]], ptr %{{[0-9]+}}, i32 0, i32 [[PUBLIC_END_VAR_IDX:12]] + // CHECK-EXEC: %.publicEndVar._value = getelementptr inbounds{{.*}} %Ts5Int64V, ptr %.publicEndVar, i32 0, i32 0 // CHECK-EXEC: store i64 4, ptr %.publicEndVar._value ptr.pointee.publicEndVar = 4 - // CHECK-EXEC: %.publicEndVar1 = getelementptr inbounds [[MYSTRUCT]], ptr %{{[0-9]+}}, i32 0, i32 [[PUBLIC_END_VAR_IDX]] - // CHECK-EXEC: %.publicEndVar1._value = getelementptr inbounds %Ts5Int64V, ptr %.publicEndVar1, i32 0, i32 0 + // CHECK-EXEC: %.publicEndVar1 = getelementptr inbounds{{.*}} [[MYSTRUCT]], ptr %{{[0-9]+}}, i32 0, i32 [[PUBLIC_END_VAR_IDX]] + // CHECK-EXEC: %.publicEndVar1._value = getelementptr inbounds{{.*}} %Ts5Int64V, ptr %.publicEndVar1, i32 0, i32 0 // CHECK-EXEC: [[PUBLIC_END_VAR_LOAD:%[0-9]+]] = load i64, ptr %.publicEndVar1._value, align 8 - // CHECK-EXEC: %.publicVar = getelementptr inbounds [[MYSTRUCT]], ptr %{{[0-9]+}}, i32 0, i32 0 - // CHECK-EXEC: %.publicVar._value = getelementptr inbounds %Ts5Int64V, ptr %.publicVar, i32 0, i32 0 + // CHECK-EXEC: %.publicVar = getelementptr inbounds{{.*}} [[MYSTRUCT]], ptr %{{[0-9]+}}, i32 0, i32 0 + // CHECK-EXEC: %.publicVar._value = getelementptr inbounds{{.*}} %Ts5Int64V, ptr %.publicVar, i32 0, i32 0 // CHECK-EXEC: store i64 [[PUBLIC_END_VAR_LOAD]], ptr %.publicVar._value, align 8 ptr.pointee.publicVar = ptr.pointee.publicEndVar ptr.deallocate() From d57f78eeb3cb28c550e1bcd50c39b58e11b553b7 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 30 Apr 2025 01:36:47 +0100 Subject: [PATCH 09/51] [test] IRGen: Adjust FileCheck pattern for `nocapture` refactoring in upstream LLVM The current pattern does not match a ')' inside the argument list. This will no longer work because `nocapture` became `captures(none) in 29441e4f5fa5f5c7709f7cf180815ba97f611297 (llvm-project). Use a wildcard regex instead. Doing so does not compromise the test because the `unnamed_addr` attribute we are guarding against can appear only after the argument list. This is intended to reduce future conflicts with rebranch. --- test/IRGen/objc_function_merge.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/IRGen/objc_function_merge.swift b/test/IRGen/objc_function_merge.swift index c2e07effb02fc..19ee8d37c6857 100644 --- a/test/IRGen/objc_function_merge.swift +++ b/test/IRGen/objc_function_merge.swift @@ -43,9 +43,9 @@ class Derived : Base { // Check if the objc methods are not generated with the unnamed_addr attribute. -// CHECK-IR-DAG: define {{.*}} @"$s4test4BaseC20supportsSecureCodingSbvgZTo"({{[^\)]*}}) #{{[0-9]+}} { -// CHECK-IR-DAG: define {{.*}} @"$s4test4BaseC6encode4withySo7NSCoderC_tFTo"({{[^\)]*}}) #{{[0-9]+}} { -// CHECK-IR-DAG: define {{.*}} @"$s4test7DerivedC20supportsSecureCodingSbvgZTo"({{[^\)]*}}) #{{[0-9]+}} { +// CHECK-IR-DAG: define {{.*}} @"$s4test4BaseC20supportsSecureCodingSbvgZTo"({{.*}}) #{{[0-9]+}} { +// CHECK-IR-DAG: define {{.*}} @"$s4test4BaseC6encode4withySo7NSCoderC_tFTo"({{.*}}) #{{[0-9]+}} { +// CHECK-IR-DAG: define {{.*}} @"$s4test7DerivedC20supportsSecureCodingSbvgZTo"({{.*}}) #{{[0-9]+}} { let d = Derived(s: "") if #available(macOS 10.13, iOS 11, tvOS 11, watchOS 4, *) { From 314d5247a6996887329cc18b0a8bb600e36afa31 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 30 Apr 2025 01:58:32 +0100 Subject: [PATCH 10/51] [test] IRGen: Adjust FileCheck patterns for new `initializes` attribute in upstream LLVM The parameter attribute was introduced in 5ece35df8586d0cb8c104a9f44eaae771de025f5 (llvm-project) and is expected here according to the lowered function bodies. Match it using a wildcard regex, since it is not relevant to these tests. This is intended to reduce future conflicts with rebranch. --- test/IRGen/non_fixed_return.swift | 4 ++-- test/IRGen/pre_specialize.swift | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/test/IRGen/non_fixed_return.swift b/test/IRGen/non_fixed_return.swift index b4c3ee64f0ace..080ebd8864aa4 100644 --- a/test/IRGen/non_fixed_return.swift +++ b/test/IRGen/non_fixed_return.swift @@ -55,14 +55,14 @@ func create(_ t: T) -> C { // We use opaque storage types because LLVM performs type based analysis based // on the sret storage type which goes wrong with non fixed types. -// CHECK-LABEL: define hidden swiftcc void @"$s16non_fixed_return1CVACyxGycfC"(ptr noalias sret(%swift.opaque) %0 +// CHECK-LABEL: define hidden swiftcc void @"$s16non_fixed_return1CVACyxGycfC"(ptr noalias sret(%swift.opaque){{.*}} %0 // CHECK-LABEL: define hidden swiftcc void @"$s16non_fixed_return6createyAA1CVyxGxlF"(ptr noalias sret(%swift.opaque) %0, ptr noalias %1, ptr %T) // CHECK: call swiftcc void @"$s16non_fixed_return1CVACyxGycfC"(ptr noalias sret(%swift.opaque) %0 // CHECK: ret void // Make sure we don't loose the stores for the optional UInt32? in optimize mode. -// OPT-LABEL: define hidden swiftcc void @"$s16non_fixed_return1CVACyxGycfC"(ptr noalias sret(%swift.opaque) %0 +// OPT-LABEL: define hidden swiftcc void @"$s16non_fixed_return1CVACyxGycfC"(ptr noalias sret(%swift.opaque){{.*}} %0 // OPT: store i32 0, ptr [[BASE:%[0-9]+]] // OPT: [[ADDR2:%.*]] = getelementptr inbounds{{.*}} i8, ptr [[BASE]], i64 4 // OPT: store i8 1, ptr [[ADDR2]] diff --git a/test/IRGen/pre_specialize.swift b/test/IRGen/pre_specialize.swift index b959a4833cab3..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 nocapture 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 nocapture 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" From f512eb18e55dca20630f64307005e140f9806543 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 30 Apr 2025 02:09:48 +0100 Subject: [PATCH 11/51] [test] IRGen: Adjust FileCheck patterns for new `captures` attribute in upstream LLVM The `captures(ret: address, provenance)` parameter attribute is expected because these functions either immediately return the pointer argument or pass it as an argument to another such parameter. See https://llvm.org/docs/LangRef.html#parameter-attributes. Match it using a wildcard regex, since it is not relevant to these tests. This is intended to reduce future conflicts with rebranch. --- test/IRGen/package_bypass_resilience_class.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/IRGen/package_bypass_resilience_class.swift b/test/IRGen/package_bypass_resilience_class.swift index 9496cfe063e82..0df131fdd0a76 100644 --- a/test/IRGen/package_bypass_resilience_class.swift +++ b/test/IRGen/package_bypass_resilience_class.swift @@ -46,7 +46,7 @@ final public class Pub { // method lookup function for Core.Pub // CHECK-COMMON-DAG: define {{(dllexport |protected )?}}swiftcc ptr @"$s4Core3PubCMu"(ptr %0, ptr %1) - // CHECK-COMMON-DAG: define {{(dllexport |protected )?}}swiftcc ptr @"$s4Core3PubCfd"(ptr readnone returned swiftself %0) + // CHECK-COMMON-DAG: define {{(dllexport |protected )?}}swiftcc ptr @"$s4Core3PubCfd"(ptr readnone returned swiftself{{.*}} %0) // CHECK-COMMON-DAG: define {{(dllexport |protected )?}}swiftcc void @"$s4Core3PubCfD"(ptr swiftself %0) } @@ -97,7 +97,7 @@ package class Foo { // CHECK-COMMON-DAG: define {{(dllexport |protected )?}}swiftcc { ptr, ptr } @"$s4Core3FooC02myB0AA3PubCSgvMTj" // Core.Foo.deinit - // CHECK-COMMON-DAG: define {{(dllexport |protected )?}}swiftcc ptr @"$s4Core3FooCfd"(ptr readonly returned swiftself %0) + // CHECK-COMMON-DAG: define {{(dllexport |protected )?}}swiftcc ptr @"$s4Core3FooCfd"(ptr readonly returned swiftself{{.*}} %0) // Core.Foo.__deallocating_deinit // CHECK-COMMON-DAG: define {{(dllexport |protected )?}}swiftcc void @"$s4Core3FooCfD"(ptr swiftself %0) @@ -119,7 +119,7 @@ final package class Bar { // method lookup function for Core.Bar // CHECK-COMMON-DAG: define {{(dllexport |protected )?}}swiftcc ptr @"$s4Core3BarCMu"(ptr %0, ptr %1) - // CHECK-COMMON-DAG: define {{(dllexport |protected )?}}swiftcc ptr @"$s4Core3BarCfd"(ptr readonly returned swiftself %0) + // CHECK-COMMON-DAG: define {{(dllexport |protected )?}}swiftcc ptr @"$s4Core3BarCfd"(ptr readonly returned swiftself{{.*}} %0) // CHECK-COMMON-DAG: define {{(dllexport |protected )?}}swiftcc void @"$s4Core3BarCfD"(ptr swiftself %0) package var myBar: Pub? From f477aceb5f0dcba410d90b9dc8159c53a2e7cd4f Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 30 Apr 2025 02:56:38 +0100 Subject: [PATCH 12/51] [test] IRGen: Adjust FileCheck pattern for new `range` attribute in upstream LLVM The attribute is `range(i8 -127, -128)`. The documentation specifies that the range can wrap, meaning that for i8 [-127, -128) is equivalent to [-127, 127). This is expected for a function that simply increments a i8 value. See https://llvm.org/docs/LangRef.html#parameter-attributes. Match it using a wildcard regex, since it is not relevant to this test. This is intended to reduce future conflicts with rebranch. --- test/IRGen/condfail_message.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/IRGen/condfail_message.swift b/test/IRGen/condfail_message.swift index 7638aebaab18a..3dd0ba87f2801 100644 --- a/test/IRGen/condfail_message.swift +++ b/test/IRGen/condfail_message.swift @@ -2,7 +2,7 @@ // RUN: %target-swift-frontend -primary-file %s -g -O -emit-ir | %FileCheck %s // REQUIRES: optimized_stdlib -// CHECK-LABEL: define hidden swiftcc i8 @"$s16condfail_message6testitys4Int8VADF"(i8 %0) +// CHECK-LABEL: define hidden swiftcc{{.*}} i8 @"$s16condfail_message6testitys4Int8VADF"(i8 %0) // CHECK: call void @llvm.trap(), !dbg [[LOC:![0-9]+]] func testit(_ a: Int8) -> Int8 { From 76333e2800da19a3eb916e9efc4a030a76b684e5 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Wed, 30 Apr 2025 03:47:48 +0100 Subject: [PATCH 13/51] [test] IRGen: Adjust FileCheck pattern where attribute order changed in upstream LLVM `alias nocapture swiftself` -> `alias swiftself captures(none)`. `nocapture` became `captures(none)` in 29441e4f5fa5f5c7709f7cf180815ba97f611297 (llvm-project). This is intended to reduce future conflicts with rebranch. --- test/IRGen/raw_layout.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/IRGen/raw_layout.swift b/test/IRGen/raw_layout.swift index 3479536941d6b..10d3670806556 100644 --- a/test/IRGen/raw_layout.swift +++ b/test/IRGen/raw_layout.swift @@ -348,7 +348,7 @@ entry(%K: $*Keymaster): return undef : $() } -// CHECK: define {{.*}}swiftcc ptr @get_cell_addr(ptr %"Cell", ptr {{.*}} swiftself [[SELF:%.*]]) +// CHECK: define {{.*}}swiftcc ptr @get_cell_addr(ptr %"Cell", ptr {{.*}} swiftself{{.*}} [[SELF:%.*]]) // CHECK-NEXT: entry: // CHECK-NEXT: ret ptr [[SELF]] sil @get_cell_addr : $@convention(method) (@in_guaranteed Cell) -> UnsafeMutablePointer { From 39aa95066061dbc32fd0c9d08b600622064a7ba2 Mon Sep 17 00:00:00 2001 From: Ludwig Hollmann Date: Sun, 4 May 2025 22:26:26 +0200 Subject: [PATCH 14/51] Update file header comments for headers in lib. --- lib/AST/ConformanceLookupTable.h | 2 +- lib/ClangImporter/SwiftDeclSynthesizer.h | 2 +- lib/Demangling/RemanglerBase.h | 2 +- lib/IRGen/GenericArguments.h | 2 +- lib/PrintAsClang/_SwiftStdlibCxxOverlay.h | 2 +- .../FunctionSignatureTransforms/ExistentialTransform.h | 2 +- lib/SILOptimizer/Mandatory/MoveOnlyBorrowToDestructureUtils.h | 2 +- lib/Sema/TypeCheckMacros.h | 2 +- lib/Serialization/SILSerializationFunctionBuilder.h | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/AST/ConformanceLookupTable.h b/lib/AST/ConformanceLookupTable.h index 8199526975ce8..31904e9c8f0ed 100644 --- a/lib/AST/ConformanceLookupTable.h +++ b/lib/AST/ConformanceLookupTable.h @@ -1,4 +1,4 @@ -//===--- ConformanceLookupTable - Conformance Lookup Table ------*- C++ -*-===// +//===--- ConformanceLookupTable.h - Conformance Lookup Table ----*- C++ -*-===// // // This source file is part of the Swift.org open source project // diff --git a/lib/ClangImporter/SwiftDeclSynthesizer.h b/lib/ClangImporter/SwiftDeclSynthesizer.h index 916219b2243b1..11124e9f8e470 100644 --- a/lib/ClangImporter/SwiftDeclSynthesizer.h +++ b/lib/ClangImporter/SwiftDeclSynthesizer.h @@ -1,4 +1,4 @@ -//===--- DeclSynthesizer.h - Synthesize helper Swift decls ------*- C++ -*-===// +//===--- SwiftDeclSynthesizer.h - Synthesize helper Swift decls -*- C++ -*-===// // // This source file is part of the Swift.org open source project // diff --git a/lib/Demangling/RemanglerBase.h b/lib/Demangling/RemanglerBase.h index 9448331b00a88..2ed698e4d2a91 100644 --- a/lib/Demangling/RemanglerBase.h +++ b/lib/Demangling/RemanglerBase.h @@ -1,4 +1,4 @@ -//===--- Demangler.h - String to Node-Tree Demangling -----------*- C++ -*-===// +//===--- RemanglerBase.h - String to Node-Tree Demangling -------*- C++ -*-===// // // This source file is part of the Swift.org open source project // diff --git a/lib/IRGen/GenericArguments.h b/lib/IRGen/GenericArguments.h index a2cf298e0b5a7..18a635da8b4be 100644 --- a/lib/IRGen/GenericArguments.h +++ b/lib/IRGen/GenericArguments.h @@ -1,4 +1,4 @@ -//===--- MetadataRequest.cpp - IR generation for metadata requests --------===// +//===--- GenericArguments.h - IR generation for metadata requests ---------===// // // This source file is part of the Swift.org open source project // diff --git a/lib/PrintAsClang/_SwiftStdlibCxxOverlay.h b/lib/PrintAsClang/_SwiftStdlibCxxOverlay.h index 4e1332c20cd22..930e7b0b9bc06 100644 --- a/lib/PrintAsClang/_SwiftStdlibCxxOverlay.h +++ b/lib/PrintAsClang/_SwiftStdlibCxxOverlay.h @@ -1,4 +1,4 @@ -//===--- _SwiftStlibCxxOverlay.h - Additions for Stdlib ---------*- C++ -*-===// +//===--- _SwiftStdlibCxxOverlay.h - Additions for Stdlib --------*- C++ -*-===// // // This source file is part of the Swift.org open source project // diff --git a/lib/SILOptimizer/FunctionSignatureTransforms/ExistentialTransform.h b/lib/SILOptimizer/FunctionSignatureTransforms/ExistentialTransform.h index 79ad59ec7ebda..08dad3cd73203 100644 --- a/lib/SILOptimizer/FunctionSignatureTransforms/ExistentialTransform.h +++ b/lib/SILOptimizer/FunctionSignatureTransforms/ExistentialTransform.h @@ -1,4 +1,4 @@ -//===---- ExistentialSpecializerTransform.h - Existential Specializer -----===// +//===--- ExistentialTransform.h - Existential Specializer -----------------===// // // This source file is part of the Swift.org open source project // diff --git a/lib/SILOptimizer/Mandatory/MoveOnlyBorrowToDestructureUtils.h b/lib/SILOptimizer/Mandatory/MoveOnlyBorrowToDestructureUtils.h index a4b4b695a1b1b..f4ce2b3a66645 100644 --- a/lib/SILOptimizer/Mandatory/MoveOnlyBorrowToDestructureUtils.h +++ b/lib/SILOptimizer/Mandatory/MoveOnlyBorrowToDestructureUtils.h @@ -1,4 +1,4 @@ -//===--- MoveOnlyBorrowToDestructure.h ------------------------------------===// +//===--- MoveOnlyBorrowToDestructureUtils.h -------------------------------===// // // This source file is part of the Swift.org open source project // diff --git a/lib/Sema/TypeCheckMacros.h b/lib/Sema/TypeCheckMacros.h index 3be6fd2b3f79d..bd10751b3e0fa 100644 --- a/lib/Sema/TypeCheckMacros.h +++ b/lib/Sema/TypeCheckMacros.h @@ -1,4 +1,4 @@ -//===--- TypeCheckConcurrency.h - Concurrency -------------------*- C++ -*-===// +//===--- TypeCheckMacros.h - Macros -----------------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // diff --git a/lib/Serialization/SILSerializationFunctionBuilder.h b/lib/Serialization/SILSerializationFunctionBuilder.h index a6ee2ab2759d1..8570108c5c0e6 100644 --- a/lib/Serialization/SILSerializationFunctionBuilder.h +++ b/lib/Serialization/SILSerializationFunctionBuilder.h @@ -1,4 +1,4 @@ -//===--- SerializationFunctionBuilder.h -----------------------------------===// +//===--- SILSerializationFunctionBuilder.h --------------------------------===// // // This source file is part of the Swift.org open source project // From f04e916dffe3eecc132181bead9a658ab54947ff Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Mon, 5 May 2025 10:12:06 -0700 Subject: [PATCH 15/51] Fix issue with older compilers not handling MutableSpan code The use of SendableCompletionHandlers here is completely incidental, because it happened to be introduced at roughly the same time as the bits we needed for MutableSpan. Fixes rdar://148072153. --- stdlib/public/core/Span/MutableRawSpan.swift | 12 ++++++++++++ stdlib/public/core/Span/MutableSpan.swift | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/stdlib/public/core/Span/MutableRawSpan.swift b/stdlib/public/core/Span/MutableRawSpan.swift index fb75d96071c7e..47c4aa7d43308 100644 --- a/stdlib/public/core/Span/MutableRawSpan.swift +++ b/stdlib/public/core/Span/MutableRawSpan.swift @@ -588,10 +588,14 @@ extension MutableRawSpan { @_alwaysEmitIntoClient @lifetime(&self) mutating public func extracting(first maxLength: Int) -> Self { +#if compiler(>=5.3) && hasFeature(SendableCompletionHandlers) _precondition(maxLength >= 0, "Can't have a prefix of negative length") let newCount = min(maxLength, byteCount) let newSpan = unsafe Self(_unchecked: _pointer, byteCount: newCount) return unsafe _overrideLifetime(newSpan, mutating: &self) +#else + fatalError("Unsupported compiler") +#endif } /// Returns a span over all but the given number of trailing elements. @@ -611,11 +615,15 @@ extension MutableRawSpan { @_alwaysEmitIntoClient @lifetime(&self) mutating public func extracting(droppingLast k: Int) -> Self { +#if compiler(>=5.3) && hasFeature(SendableCompletionHandlers) _precondition(k >= 0, "Can't drop a negative number of elements") let droppedCount = min(k, byteCount) let newCount = byteCount &- droppedCount let newSpan = unsafe Self(_unchecked: _pointer, byteCount: newCount) return unsafe _overrideLifetime(newSpan, mutating: &self) +#else + fatalError("Unsupported compiler") +#endif } /// Returns a span containing the final elements of the span, @@ -660,11 +668,15 @@ extension MutableRawSpan { @_alwaysEmitIntoClient @lifetime(&self) mutating public func extracting(droppingFirst k: Int) -> Self { +#if compiler(>=5.3) && hasFeature(SendableCompletionHandlers) _precondition(k >= 0, "Can't drop a negative number of bytes") let droppedCount = min(k, byteCount) let newStart = unsafe _pointer?.advanced(by: droppedCount) let newCount = byteCount &- droppedCount let newSpan = unsafe Self(_unchecked: newStart, byteCount: newCount) return unsafe _overrideLifetime(newSpan, mutating: &self) +#else + fatalError("Unsupported compiler") +#endif } } diff --git a/stdlib/public/core/Span/MutableSpan.swift b/stdlib/public/core/Span/MutableSpan.swift index b67510ffb166b..e21472bea784c 100644 --- a/stdlib/public/core/Span/MutableSpan.swift +++ b/stdlib/public/core/Span/MutableSpan.swift @@ -825,10 +825,14 @@ extension MutableSpan where Element: ~Copyable { @_alwaysEmitIntoClient @lifetime(&self) mutating public func extracting(first maxLength: Int) -> Self { +#if compiler(>=5.3) && hasFeature(SendableCompletionHandlers) _precondition(maxLength >= 0, "Can't have a prefix of negative length") let newCount = min(maxLength, count) let newSpan = unsafe Self(_unchecked: _pointer, count: newCount) return unsafe _overrideLifetime(newSpan, mutating: &self) +#else + fatalError("Unsupported compiler") +#endif } /// Returns a span over all but the given number of trailing elements. @@ -848,11 +852,15 @@ extension MutableSpan where Element: ~Copyable { @_alwaysEmitIntoClient @lifetime(&self) mutating public func extracting(droppingLast k: Int) -> Self { +#if compiler(>=5.3) && hasFeature(SendableCompletionHandlers) _precondition(k >= 0, "Can't drop a negative number of elements") let droppedCount = min(k, count) let newCount = count &- droppedCount let newSpan = unsafe Self(_unchecked: _pointer, count: newCount) return unsafe _overrideLifetime(newSpan, mutating: &self) +#else + fatalError("Unsupported compiler") +#endif } /// Returns a span containing the final elements of the span, @@ -873,12 +881,16 @@ extension MutableSpan where Element: ~Copyable { @_alwaysEmitIntoClient @lifetime(&self) mutating public func extracting(last maxLength: Int) -> Self { +#if compiler(>=5.3) && hasFeature(SendableCompletionHandlers) _precondition(maxLength >= 0, "Can't have a suffix of negative length") let newCount = min(maxLength, count) let offset = (count &- newCount) * MemoryLayout.stride let newStart = unsafe _pointer?.advanced(by: offset) let newSpan = unsafe Self(_unchecked: newStart, count: newCount) return unsafe _overrideLifetime(newSpan, mutating: &self) +#else + fatalError("Unsupported compiler") +#endif } /// Returns a span over all but the given number of initial elements. @@ -898,6 +910,7 @@ extension MutableSpan where Element: ~Copyable { @_alwaysEmitIntoClient @lifetime(&self) mutating public func extracting(droppingFirst k: Int) -> Self { +#if compiler(>=5.3) && hasFeature(SendableCompletionHandlers) _precondition(k >= 0, "Can't drop a negative number of elements") let droppedCount = min(k, count) let offset = droppedCount * MemoryLayout.stride @@ -905,5 +918,8 @@ extension MutableSpan where Element: ~Copyable { let newCount = count &- droppedCount let newSpan = unsafe Self(_unchecked: newStart, count: newCount) return unsafe _overrideLifetime(newSpan, mutating: &self) +#else + fatalError("Unsupported compiler") +#endif } } From fd0e55143f295b4083a20d59384172538b4b0fd7 Mon Sep 17 00:00:00 2001 From: Artem Chikin Date: Fri, 2 May 2025 15:25:07 -0700 Subject: [PATCH 16/51] [Dependency Scanning] Always use a locking diagnostic consumer Since we enabled parallel dependency scanning by-default, each individual scan needs a diagnostic consumer that is safe to use across many threads. Deprecate the 'Locking' sub-class, making its behavior the default in the base class. --- .../DependencyScan/DependencyScanningTool.h | 16 ++-------------- lib/DependencyScan/DependencyScanningTool.cpp | 11 ++++------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/include/swift/DependencyScan/DependencyScanningTool.h b/include/swift/DependencyScan/DependencyScanningTool.h index 7129b1503c781..db0ba76b94c33 100644 --- a/include/swift/DependencyScan/DependencyScanningTool.h +++ b/include/swift/DependencyScan/DependencyScanningTool.h @@ -40,6 +40,7 @@ class DependencyScanDiagnosticCollector : public DiagnosticConsumer { std::optional ImportLocation; }; std::vector Diagnostics; + llvm::sys::SmartMutex ScanningDiagnosticConsumerStateLock; void handleDiagnostic(SourceManager &SM, const DiagnosticInfo &Info) override; @@ -55,19 +56,6 @@ class DependencyScanDiagnosticCollector : public DiagnosticConsumer { } }; -/// Locking variant of the above diagnostic collector that guards accesses to -/// its state with a lock. -class LockingDependencyScanDiagnosticCollector - : public DependencyScanDiagnosticCollector { -private: - void addDiagnostic(SourceManager &SM, const DiagnosticInfo &Info) override; - llvm::sys::SmartMutex ScanningDiagnosticConsumerStateLock; - -public: - friend DependencyScanningTool; - LockingDependencyScanDiagnosticCollector() {} -}; - /// Given a set of arguments to a print-target-info frontend tool query, produce the /// JSON target info. llvm::ErrorOr getTargetInfo(ArrayRef Command, @@ -118,7 +106,7 @@ class DependencyScanningTool { llvm::sys::SmartMutex DependencyScanningToolStateLock; /// A shared consumer that accumulates encountered diagnostics. - LockingDependencyScanDiagnosticCollector CDC; + DependencyScanDiagnosticCollector CDC; llvm::BumpPtrAllocator Alloc; llvm::StringSaver Saver; }; diff --git a/lib/DependencyScan/DependencyScanningTool.cpp b/lib/DependencyScan/DependencyScanningTool.cpp index f83d1f68175ab..a101f64e18984 100644 --- a/lib/DependencyScan/DependencyScanningTool.cpp +++ b/lib/DependencyScan/DependencyScanningTool.cpp @@ -74,6 +74,8 @@ void DependencyScanDiagnosticCollector::handleDiagnostic(SourceManager &SM, void DependencyScanDiagnosticCollector::addDiagnostic( SourceManager &SM, const DiagnosticInfo &Info) { + llvm::sys::SmartScopedLock Lock(ScanningDiagnosticConsumerStateLock); + // Determine what kind of diagnostic we're emitting. llvm::SourceMgr::DiagKind SMKind; switch (Info.Kind) { @@ -129,12 +131,6 @@ void DependencyScanDiagnosticCollector::addDiagnostic( } } -void LockingDependencyScanDiagnosticCollector::addDiagnostic( - SourceManager &SM, const DiagnosticInfo &Info) { - llvm::sys::SmartScopedLock Lock(ScanningDiagnosticConsumerStateLock); - DependencyScanDiagnosticCollector::addDiagnostic(SM, Info); -} - swiftscan_diagnostic_set_t *mapCollectedDiagnosticsForOutput( const DependencyScanDiagnosticCollector *diagnosticCollector) { auto collectedDiagnostics = diagnosticCollector->getDiagnostics(); @@ -272,7 +268,8 @@ DependencyScanningTool::getDependencies( StringRef WorkingDirectory) { // There may be errors as early as in instance initialization, so we must ensure // we can catch those. - auto ScanDiagnosticConsumer = std::make_shared(); + auto ScanDiagnosticConsumer = + std::make_shared(); // The primary instance used to scan the query Swift source-code auto QueryContextOrErr = initCompilerInstanceForScan(Command, From c1991d7e7e96eaa39f9af3ac905055a9d8d2a1a1 Mon Sep 17 00:00:00 2001 From: Artem Chikin Date: Mon, 5 May 2025 10:33:15 -0700 Subject: [PATCH 17/51] [Dependency Scanning][libSwiftScan] Deprecate scanner-global diagnostic collection All clients are expected to have switched to the per-scan-query diagnostics using 'swiftscan_dependency_graph_get_diagnostics' --- .../DependencyScan/DependencyScanningTool.h | 8 ---- lib/DependencyScan/DependencyScanningTool.cpp | 18 +-------- lib/Tooling/libSwiftScan/libSwiftScan.cpp | 40 +++---------------- 3 files changed, 6 insertions(+), 60 deletions(-) diff --git a/include/swift/DependencyScan/DependencyScanningTool.h b/include/swift/DependencyScan/DependencyScanningTool.h index db0ba76b94c33..8aa380c83fc0e 100644 --- a/include/swift/DependencyScan/DependencyScanningTool.h +++ b/include/swift/DependencyScan/DependencyScanningTool.h @@ -85,11 +85,6 @@ class DependencyScanningTool { llvm::ErrorOr getImports(ArrayRef Command, StringRef WorkingDirectory); - /// Query diagnostics consumed so far. - std::vector getDiagnostics(); - /// Discared the collection of diagnostics encountered so far. - void resetDiagnostics(); - /// Using the specified invocation command, instantiate a CompilerInstance /// that will be used for this scan. llvm::ErrorOr @@ -104,9 +99,6 @@ class DependencyScanningTool { /// Shared state mutual-exclusivity lock llvm::sys::SmartMutex DependencyScanningToolStateLock; - - /// A shared consumer that accumulates encountered diagnostics. - DependencyScanDiagnosticCollector CDC; llvm::BumpPtrAllocator Alloc; llvm::StringSaver Saver; }; diff --git a/lib/DependencyScan/DependencyScanningTool.cpp b/lib/DependencyScan/DependencyScanningTool.cpp index a101f64e18984..e2651976c16da 100644 --- a/lib/DependencyScan/DependencyScanningTool.cpp +++ b/lib/DependencyScan/DependencyScanningTool.cpp @@ -259,7 +259,7 @@ static swiftscan_import_set_t generateHollowDiagnosticOutputImportSet( DependencyScanningTool::DependencyScanningTool() : ScanningService(std::make_unique()), - CDC(), Alloc(), Saver(Alloc) {} + Alloc(), Saver(Alloc) {} llvm::ErrorOr DependencyScanningTool::getDependencies( @@ -326,18 +326,6 @@ DependencyScanningTool::getImports(ArrayRef Command, return std::move(*DependenciesOrErr); } -std::vector< - DependencyScanDiagnosticCollector::ScannerDiagnosticInfo> -DependencyScanningTool::getDiagnostics() { - llvm::sys::SmartScopedLock Lock(DependencyScanningToolStateLock); - return CDC.Diagnostics; -} - -void DependencyScanningTool::resetDiagnostics() { - llvm::sys::SmartScopedLock Lock(DependencyScanningToolStateLock); - CDC.reset(); -} - llvm::ErrorOr DependencyScanningTool::initCompilerInstanceForScan( ArrayRef CommandArgs, @@ -353,10 +341,6 @@ DependencyScanningTool::initCompilerInstanceForScan( // State unique to an individual scan auto Instance = std::make_unique(); - - // FIXME: The shared CDC must be deprecated once all clients have switched - // to using per-scan diagnostic output embedded in the `swiftscan_dependency_graph_s` - Instance->addDiagnosticConsumer(&CDC); Instance->addDiagnosticConsumer(scannerDiagnosticsCollector.get()); // Basic error checking on the arguments diff --git a/lib/Tooling/libSwiftScan/libSwiftScan.cpp b/lib/Tooling/libSwiftScan/libSwiftScan.cpp index dec94b2b101cc..e51f8191b8c41 100644 --- a/lib/Tooling/libSwiftScan/libSwiftScan.cpp +++ b/lib/Tooling/libSwiftScan/libSwiftScan.cpp @@ -589,45 +589,15 @@ swiftscan_compiler_supported_features_query() { //=== Scanner Diagnostics -------------------------------------------------===// swiftscan_diagnostic_set_t* swiftscan_scanner_diagnostics_query(swiftscan_scanner_t scanner) { - DependencyScanningTool *ScanningTool = unwrap(scanner); - auto Diagnostics = ScanningTool->getDiagnostics(); - auto NumDiagnostics = Diagnostics.size(); - - swiftscan_diagnostic_set_t *Result = new swiftscan_diagnostic_set_t; - Result->count = NumDiagnostics; - Result->diagnostics = new swiftscan_diagnostic_info_t[NumDiagnostics]; - - for (size_t i = 0; i < NumDiagnostics; ++i) { - const auto &Diagnostic = Diagnostics[i]; - swiftscan_diagnostic_info_s *DiagnosticInfo = new swiftscan_diagnostic_info_s; - DiagnosticInfo->message = swift::c_string_utils::create_clone(Diagnostic.Message.c_str()); - switch (Diagnostic.Severity) { - case llvm::SourceMgr::DK_Error: - DiagnosticInfo->severity = SWIFTSCAN_DIAGNOSTIC_SEVERITY_ERROR; - break; - case llvm::SourceMgr::DK_Warning: - DiagnosticInfo->severity = SWIFTSCAN_DIAGNOSTIC_SEVERITY_WARNING; - break; - case llvm::SourceMgr::DK_Note: - DiagnosticInfo->severity = SWIFTSCAN_DIAGNOSTIC_SEVERITY_NOTE; - break; - case llvm::SourceMgr::DK_Remark: - DiagnosticInfo->severity = SWIFTSCAN_DIAGNOSTIC_SEVERITY_REMARK; - break; - } - // swiftscan_scanner_diagnostics_query is deprecated, - // so it does not support source locations. - DiagnosticInfo->source_location = nullptr; - Result->diagnostics[i] = DiagnosticInfo; - } - - return Result; + // This method is deprecated + swiftscan_diagnostic_set_t *set = new swiftscan_diagnostic_set_t; + set->count = 0; + return set; } void swiftscan_scanner_diagnostics_reset(swiftscan_scanner_t scanner) { - DependencyScanningTool *ScanningTool = unwrap(scanner); - ScanningTool->resetDiagnostics(); + // This method is deprecated } swiftscan_string_ref_t From 8c7e8550aaedec76cfe516f404dcbc0791fe00e1 Mon Sep 17 00:00:00 2001 From: Eric Miotto Date: Thu, 1 May 2025 09:29:19 -0700 Subject: [PATCH 18/51] CMake: add explicit dependency to _Builtin_float to targets... ... that would import that as a result of importing Darwin from the SDK. Amend my previous change to Differentiation and Distributed in this sense. Addresses rdar://150400049 --- stdlib/private/OSLog/CMakeLists.txt | 10 ++++++++++ stdlib/private/StdlibUnittest/CMakeLists.txt | 11 +++++++++++ stdlib/private/SwiftPrivate/CMakeLists.txt | 11 +++++++++++ stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt | 11 +++++++++++ .../private/SwiftPrivateThreadExtras/CMakeLists.txt | 11 +++++++++++ stdlib/private/SwiftReflectionTest/CMakeLists.txt | 11 +++++++++++ stdlib/public/Distributed/CMakeLists.txt | 9 +++++---- stdlib/public/Synchronization/CMakeLists.txt | 9 +++++---- stdlib/public/libexec/swift-backtrace/CMakeLists.txt | 11 +++++++++++ 9 files changed, 86 insertions(+), 8 deletions(-) diff --git a/stdlib/private/OSLog/CMakeLists.txt b/stdlib/private/OSLog/CMakeLists.txt index befc43e172b7c..21cab695c781d 100644 --- a/stdlib/private/OSLog/CMakeLists.txt +++ b/stdlib/private/OSLog/CMakeLists.txt @@ -8,6 +8,16 @@ endif() if (SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING) list(APPEND swift_oslog_darwin_dependencies "_StringProcessing") endif() +if((SWIFT_BUILD_CLANG_OVERLAYS + OR SWIFT_BUILD_TEST_SUPPORT_MODULES) + AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT + OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)) + # We need to make this dependency explicit because this library + # imports Darwin and Darwin re-exports _Builtin_float, + # but in most configurations we pull Darwin from the SDK, + # meaning we specify no Darwin dependency in the build system + list(APPEND swift_oslog_darwin_dependencies _Builtin_float) +endif() add_swift_target_library(swiftOSLogTestHelper IS_SDK_OVERLAY diff --git a/stdlib/private/StdlibUnittest/CMakeLists.txt b/stdlib/private/StdlibUnittest/CMakeLists.txt index 5ebc25ecd3f72..a54fc7b006777 100644 --- a/stdlib/private/StdlibUnittest/CMakeLists.txt +++ b/stdlib/private/StdlibUnittest/CMakeLists.txt @@ -4,6 +4,17 @@ else() set(swift_stdlib_unittest_darwin_dependencies) endif() +if((SWIFT_BUILD_CLANG_OVERLAYS + OR SWIFT_BUILD_TEST_SUPPORT_MODULES) + AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT + OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)) + # We need to make this dependency explicit because this library + # imports Darwin and Darwin re-exports _Builtin_float, + # but in most configurations we pull Darwin from the SDK, + # meaning we specify no Darwin dependency in the build system + list(APPEND swift_stdlib_unittest_darwin_dependencies _Builtin_float) +endif() + set(swift_stdlib_unittest_compile_flags "-Xfrontend" "-disable-objc-attr-requires-foundation-module") if (SWIFT_RUNTIME_ENABLE_LEAK_CHECKER) diff --git a/stdlib/private/SwiftPrivate/CMakeLists.txt b/stdlib/private/SwiftPrivate/CMakeLists.txt index 07b8ac7d0033c..585a0b36c86de 100644 --- a/stdlib/private/SwiftPrivate/CMakeLists.txt +++ b/stdlib/private/SwiftPrivate/CMakeLists.txt @@ -8,6 +8,17 @@ else() set(swift_swiftprivate_darwin_dependencies) endif() +if((SWIFT_BUILD_CLANG_OVERLAYS + OR SWIFT_BUILD_TEST_SUPPORT_MODULES) + AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT + OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)) + # We need to make this dependency explicit because this library + # imports Darwin and Darwin re-exports _Builtin_float, + # but in most configurations we pull Darwin from the SDK, + # meaning we specify no Darwin dependency in the build system + list(APPEND swift_swiftprivate_darwin_dependencies _Builtin_float) +endif() + add_swift_target_library(swiftSwiftPrivate ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB # This file should be listed the first. Module name is inferred from the # filename. diff --git a/stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt b/stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt index 83a13affb475d..22adfe2cb6af2 100644 --- a/stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt +++ b/stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt @@ -20,6 +20,17 @@ else() set(swift_private_libc_extras_darwin_dependencies) endif() +if((SWIFT_BUILD_CLANG_OVERLAYS + OR SWIFT_BUILD_TEST_SUPPORT_MODULES) + AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT + OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)) + # We need to make this dependency explicit because this library + # imports Darwin and Darwin re-exports _Builtin_float, + # but in most configurations we pull Darwin from the SDK, + # meaning we specify no Darwin dependency in the build system + list(APPEND swift_private_libc_extras_darwin_dependencies _Builtin_float) +endif() + add_swift_target_library(swiftSwiftPrivateLibcExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB # This file should be listed the first. Module name is inferred from the # filename. diff --git a/stdlib/private/SwiftPrivateThreadExtras/CMakeLists.txt b/stdlib/private/SwiftPrivateThreadExtras/CMakeLists.txt index 124f162220585..5d005a783d595 100644 --- a/stdlib/private/SwiftPrivateThreadExtras/CMakeLists.txt +++ b/stdlib/private/SwiftPrivateThreadExtras/CMakeLists.txt @@ -4,6 +4,17 @@ else() set(swift_private_thread_extras_darwin_dependencies) endif() +if((SWIFT_BUILD_CLANG_OVERLAYS + OR SWIFT_BUILD_TEST_SUPPORT_MODULES) + AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT + OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)) + # We need to make this dependency explicit because this library + # imports Darwin and Darwin re-exports _Builtin_float, + # but in most configurations we pull Darwin from the SDK, + # meaning we specify no Darwin dependency in the build system + list(APPEND swift_private_thread_extras_darwin_dependencies _Builtin_float) +endif() + add_swift_target_library(swiftSwiftPrivateThreadExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB # This file should be listed the first. Module name is inferred from the # filename. diff --git a/stdlib/private/SwiftReflectionTest/CMakeLists.txt b/stdlib/private/SwiftReflectionTest/CMakeLists.txt index 6dba4e6ac07fb..d9474ac61bd44 100644 --- a/stdlib/private/SwiftReflectionTest/CMakeLists.txt +++ b/stdlib/private/SwiftReflectionTest/CMakeLists.txt @@ -4,6 +4,17 @@ else() set(swift_reflection_test_darwin_dependencies) endif() +if((SWIFT_BUILD_CLANG_OVERLAYS + OR SWIFT_BUILD_TEST_SUPPORT_MODULES) + AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT + OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)) + # We need to make this dependency explicit because this library + # imports Darwin and Darwin re-exports _Builtin_float, + # but in most configurations we pull Darwin from the SDK, + # meaning we specify no Darwin dependency in the build system + list(APPEND swift_reflection_test_darwin_dependencies _Builtin_float) +endif() + if (SWIFT_INCLUDE_TESTS AND SWIFT_BUILD_DYNAMIC_STDLIB) add_swift_target_library(swiftSwiftReflectionTest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB SwiftReflectionTest.swift diff --git a/stdlib/public/Distributed/CMakeLists.txt b/stdlib/public/Distributed/CMakeLists.txt index 49cfcfb08cb2a..aec0c14f7c2b3 100644 --- a/stdlib/public/Distributed/CMakeLists.txt +++ b/stdlib/public/Distributed/CMakeLists.txt @@ -20,9 +20,11 @@ if((SWIFT_BUILD_CLANG_OVERLAYS OR SWIFT_BUILD_TEST_SUPPORT_MODULES) AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)) -set(swift_distributed_dependencies _Builtin_float) -else() -set(swift_distributed_dependencies) + # We need to make this dependency explicit because this library + # imports Darwin and Darwin re-exports _Builtin_float, + # but in most configurations we pull Darwin from the SDK, + # meaning we specify no Darwin dependency in the build system + list(APPEND swift_distributed_darwin_dependencies _Builtin_float) endif() set(swift_distributed_link_libraries @@ -39,7 +41,6 @@ add_swift_target_library(swiftDistributed ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS DistributedMetadata.swift LocalTestingDistributedActorSystem.swift - SWIFT_MODULE_DEPENDS ${swift_distributed_dependencies} SWIFT_MODULE_DEPENDS_IOS ${swift_distributed_darwin_dependencies} SWIFT_MODULE_DEPENDS_OSX ${swift_distributed_darwin_dependencies} SWIFT_MODULE_DEPENDS_TVOS ${swift_distributed_darwin_dependencies} diff --git a/stdlib/public/Synchronization/CMakeLists.txt b/stdlib/public/Synchronization/CMakeLists.txt index e0256d57d0388..302d332b82c3e 100644 --- a/stdlib/public/Synchronization/CMakeLists.txt +++ b/stdlib/public/Synchronization/CMakeLists.txt @@ -41,12 +41,15 @@ if(SWIFT_BUILD_SDK_OVERLAY) set(SWIFT_SYNCHRONIZATION_DARWIN_DEPENDENCIES Darwin) endif() -set(SWIFT_SYNCHRONIZATION_DEPENDENCIES) if((SWIFT_BUILD_CLANG_OVERLAYS OR SWIFT_BUILD_TEST_SUPPORT_MODULES) AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)) - set(SWIFT_SYNCHRONIZATION_DEPENDENCIES _Builtin_float) + # We need to make this dependency explicit because this library + # imports Darwin and Darwin re-exports _Builtin_float, + # but in most configurations we pull Darwin from the SDK, + # meaning we specify no Darwin dependency in the build system + list(APPEND SWIFT_SYNCHRONIZATION_DARWIN_DEPENDENCIES _Builtin_float) endif() set(SWIFT_SYNCHRONIZATION_DARWIN_SOURCES @@ -112,8 +115,6 @@ add_swift_target_library(swiftSynchronization ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES SWIFT_SOURCES_DEPENDS_FREESTANDING Mutex/MutexUnavailable.swift - SWIFT_MODULE_DEPENDS - ${SWIFT_SYNCHRONIZATION_DEPENDENCIES} SWIFT_MODULE_DEPENDS_OSX ${SWIFT_SYNCHRONIZATION_DARWIN_DEPENDENCIES} SWIFT_MODULE_DEPENDS_IOS diff --git a/stdlib/public/libexec/swift-backtrace/CMakeLists.txt b/stdlib/public/libexec/swift-backtrace/CMakeLists.txt index 20f6048a1ea8f..8f42800b0e6f3 100644 --- a/stdlib/public/libexec/swift-backtrace/CMakeLists.txt +++ b/stdlib/public/libexec/swift-backtrace/CMakeLists.txt @@ -12,6 +12,17 @@ if(SWIFT_BUILD_SDK_OVERLAY) set(musl Musl) endif() +if((SWIFT_BUILD_CLANG_OVERLAYS + OR SWIFT_BUILD_TEST_SUPPORT_MODULES) + AND (NOT DEFINED SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT + OR NOT SWIFT_BUILD_CLANG_OVERLAYS_SKIP_BUILTIN_FLOAT)) + # We need to make this dependency explicit because this library + # imports Darwin and Darwin re-exports _Builtin_float, + # but in most configurations we pull Darwin from the SDK, + # meaning we specify no Darwin dependency in the build system + list(APPEND darwin _Builtin_float) +endif() + # Similarly, we only want the Runtime dependency if we're building # with the stdlib. set(runtime) From 22efac8e1204841cbff271bdb14f4d722012a954 Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Mon, 5 May 2025 10:43:07 -0700 Subject: [PATCH 19/51] Revert "[Concurrency] adjust abi test for hashable async stream" This reverts commit 99d95aa21d81e05a4ebe08cb5f073657cd012b4b. --- test/abi/macOS/arm64/concurrency.swift | 18 ------------------ test/abi/macOS/x86_64/concurrency.swift | 18 ------------------ .../stability-concurrency-abi.test | 7 ------- 3 files changed, 43 deletions(-) diff --git a/test/abi/macOS/arm64/concurrency.swift b/test/abi/macOS/arm64/concurrency.swift index d2d8c407be7a0..432a5d8e36500 100644 --- a/test/abi/macOS/arm64/concurrency.swift +++ b/test/abi/macOS/arm64/concurrency.swift @@ -421,21 +421,3 @@ Added: _$ss12SwiftSettingVsE16defaultIsolationyABScA_pXpSgFZ // Clock systemEpochs Added: _$ss15ContinuousClockV11systemEpochAB7InstantVvpMV Added: _$ss15SuspendingClockV11systemEpochAB7InstantVvpMV - -// Hashable for (Throwing)AsyncStream -Added: _$sScS12ContinuationV7storageScS8_StorageCyx_Gvg -Added: _$sScS12ContinuationV7storageScS8_StorageCyx_GvpMV -Added: _$sScS8_StorageCMa -Added: _$sScS8_StorageCMn -Added: _$sScS8_StorageCMo -Added: _$sScS8_StorageCMu -Added: _$sScS8_StorageCfD -Added: _$sScS8_StorageCfd -Added: _$sScs12ContinuationV7storageScs8_StorageCyxq__Gvg -Added: _$sScs12ContinuationV7storageScs8_StorageCyxq__GvpMV -Added: _$sScs8_StorageCMa -Added: _$sScs8_StorageCMn -Added: _$sScs8_StorageCMo -Added: _$sScs8_StorageCMu -Added: _$sScs8_StorageCfD -Added: _$sScs8_StorageCfd diff --git a/test/abi/macOS/x86_64/concurrency.swift b/test/abi/macOS/x86_64/concurrency.swift index 4d89a93fed3f0..a2a81391d555b 100644 --- a/test/abi/macOS/x86_64/concurrency.swift +++ b/test/abi/macOS/x86_64/concurrency.swift @@ -421,21 +421,3 @@ Added: _$ss12SwiftSettingVsE16defaultIsolationyABScA_pXpSgFZ // Clock systemEpochs Added: _$ss15ContinuousClockV11systemEpochAB7InstantVvpMV Added: _$ss15SuspendingClockV11systemEpochAB7InstantVvpMV - -// Hashable for (Throwing)AsyncStream -Added: _$sScS12ContinuationV7storageScS8_StorageCyx_Gvg -Added: _$sScS12ContinuationV7storageScS8_StorageCyx_GvpMV -Added: _$sScS8_StorageCMa -Added: _$sScS8_StorageCMn -Added: _$sScS8_StorageCMo -Added: _$sScS8_StorageCMu -Added: _$sScS8_StorageCfD -Added: _$sScS8_StorageCfd -Added: _$sScs12ContinuationV7storageScs8_StorageCyxq__Gvg -Added: _$sScs12ContinuationV7storageScs8_StorageCyxq__GvpMV -Added: _$sScs8_StorageCMa -Added: _$sScs8_StorageCMn -Added: _$sScs8_StorageCMo -Added: _$sScs8_StorageCMu -Added: _$sScs8_StorageCfD -Added: _$sScs8_StorageCfd diff --git a/test/api-digester/stability-concurrency-abi.test b/test/api-digester/stability-concurrency-abi.test index d419fcd9fb636..c9132ed6298ee 100644 --- a/test/api-digester/stability-concurrency-abi.test +++ b/test/api-digester/stability-concurrency-abi.test @@ -128,13 +128,6 @@ Func withThrowingTaskGroup(of:returning:body:) has parameter 2 type change from Func withTaskGroup(of:returning:body:) has been renamed to Func withTaskGroup(of:returning:isolation:body:) Func withTaskGroup(of:returning:body:) has mangled name changing from '_Concurrency.withTaskGroup(of: A.Type, returning: B.Type, body: (inout Swift.TaskGroup) async -> B) async -> B' to '_Concurrency.withTaskGroup(of: A.Type, returning: B.Type, isolation: isolated Swift.Optional, body: (inout Swift.TaskGroup) async -> B) async -> B' -// Hashable for (Throwing)AsyncStream -// These are just @usableFromInline: -Var AsyncStream.Continuation.storage is a new API without '@available' -Var AsyncThrowingStream.Continuation.storage is a new API without '@available' -Class AsyncStream._Storage is a new API without '@available' -Class AsyncThrowingStream._Storage is a new API without '@available' - // *** DO NOT DISABLE OR XFAIL THIS TEST. *** (See comment above.) From f358c1e6b7206eafbf55b5878931e177a49663af Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Mon, 5 May 2025 10:43:11 -0700 Subject: [PATCH 20/51] Revert "[Concurrency] Hashable funcs should be inlinable for AsyncStream" This reverts commit 06bb7183f4545f9060535ae04c176a8dc2889865. --- stdlib/public/Concurrency/AsyncStream.swift | 4 ---- stdlib/public/Concurrency/AsyncStreamBuffer.swift | 2 -- stdlib/public/Concurrency/AsyncThrowingStream.swift | 4 ---- 3 files changed, 10 deletions(-) diff --git a/stdlib/public/Concurrency/AsyncStream.swift b/stdlib/public/Concurrency/AsyncStream.swift index f8ac91bb03194..ca6eb979695c1 100644 --- a/stdlib/public/Concurrency/AsyncStream.swift +++ b/stdlib/public/Concurrency/AsyncStream.swift @@ -177,7 +177,6 @@ public struct AsyncStream { case bufferingNewest(Int) } - @usableFromInline let storage: _Storage /// Resume the task awaiting the next iteration point by having it return @@ -478,17 +477,14 @@ extension AsyncStream.Continuation.YieldResult: Sendable where Element: Sendable @available(SwiftStdlib 6.2, *) extension AsyncStream.Continuation: Hashable { - @inlinable @available(SwiftStdlib 6.2, *) public func hash(into hasher: inout Hasher) { return hasher.combine(ObjectIdentifier(storage)) } - @inlinable @available(SwiftStdlib 6.2, *) public var hashValue: Int { return _hashValue(for: self) } - @inlinable @available(SwiftStdlib 6.2, *) public static func == (lhs: Self, rhs: Self) -> Bool { return lhs.storage === rhs.storage diff --git a/stdlib/public/Concurrency/AsyncStreamBuffer.swift b/stdlib/public/Concurrency/AsyncStreamBuffer.swift index 35bfff2870976..bc73a4d7ad078 100644 --- a/stdlib/public/Concurrency/AsyncStreamBuffer.swift +++ b/stdlib/public/Concurrency/AsyncStreamBuffer.swift @@ -55,7 +55,6 @@ func _unlock(_ ptr: UnsafeRawPointer) @available(SwiftStdlib 5.1, *) extension AsyncStream { @safe - @usableFromInline internal final class _Storage: @unchecked Sendable { typealias TerminationHandler = @Sendable (Continuation.Termination) -> Void @@ -282,7 +281,6 @@ extension AsyncStream { @available(SwiftStdlib 5.1, *) extension AsyncThrowingStream { @safe - @usableFromInline internal final class _Storage: @unchecked Sendable { typealias TerminationHandler = @Sendable (Continuation.Termination) -> Void enum Terminal { diff --git a/stdlib/public/Concurrency/AsyncThrowingStream.swift b/stdlib/public/Concurrency/AsyncThrowingStream.swift index 7c416e2594ced..3cdc5d0077bf0 100644 --- a/stdlib/public/Concurrency/AsyncThrowingStream.swift +++ b/stdlib/public/Concurrency/AsyncThrowingStream.swift @@ -199,7 +199,6 @@ public struct AsyncThrowingStream { case bufferingNewest(Int) } - @usableFromInline let storage: _Storage /// Resume the task awaiting the next iteration point by having it return @@ -524,17 +523,14 @@ extension AsyncThrowingStream.Continuation.YieldResult: Sendable where Element: @available(SwiftStdlib 6.2, *) extension AsyncThrowingStream.Continuation: Hashable { - @inlinable @available(SwiftStdlib 6.2, *) public func hash(into hasher: inout Hasher) { return hasher.combine(ObjectIdentifier(storage)) } - @inlinable @available(SwiftStdlib 6.2, *) public var hashValue: Int { return _hashValue(for: self) } - @inlinable @available(SwiftStdlib 6.2, *) public static func == (lhs: Self, rhs: Self) -> Bool { return lhs.storage === rhs.storage From 2e345492363b051579b45e620484e9890b6f8a49 Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Sun, 4 May 2025 22:20:25 -0700 Subject: [PATCH 21/51] [SE-0470] Prohibit inference of isolated conformances with nonisolated witnesses If all of the witnesses to a conformance are nonisolated, then infer that conformance as nonisolated rather than global-actor-isolated. This is only relevant when InferIsolatedConformances is enabled, and prevents that inference to help maintain source compatibility. --- lib/Sema/TypeCheckConcurrency.cpp | 50 +++++++++++++++--- .../isolated_conformance_default_actor.swift | 4 +- .../isolated_conformance_inference.swift | 7 +++ .../Inputs/syntax_macro_definitions.swift | 52 +++++++++++++++++++ test/Macros/macro_expand_extensions.swift | 12 +++++ 5 files changed, 115 insertions(+), 10 deletions(-) diff --git a/lib/Sema/TypeCheckConcurrency.cpp b/lib/Sema/TypeCheckConcurrency.cpp index 0c90d215ecbdb..44eca63a9f650 100644 --- a/lib/Sema/TypeCheckConcurrency.cpp +++ b/lib/Sema/TypeCheckConcurrency.cpp @@ -7955,17 +7955,51 @@ ConformanceIsolationRequest::evaluate(Evaluator &evaluator, ProtocolConformance if (getActorIsolation(rootNormal->getProtocol()).isActorIsolated()) return ActorIsolation::forNonisolated(false); - // If we are inferring isolated conformances and the conforming type is - // isolated to a global actor, use the conforming type's isolation. + // Isolation inference rules follow. If we aren't inferring isolated conformances, + // we're done. + if (!ctx.LangOpts.hasFeature(Feature::InferIsolatedConformances)) + return ActorIsolation::forNonisolated(false); + auto nominal = dc->getSelfNominalTypeDecl(); - if (ctx.LangOpts.hasFeature(Feature::InferIsolatedConformances) && - nominal) { - auto nominalIsolation = getActorIsolation(nominal); - if (nominalIsolation.isGlobalActor()) - return nominalIsolation; + if (!nominal) { + return ActorIsolation::forNonisolated(false); + } + + // If we are inferring isolated conformances and the conforming type is + // isolated to a global actor, we may use the conforming type's isolation. + auto nominalIsolation = getActorIsolation(nominal); + if (!nominalIsolation.isGlobalActor()) { + return ActorIsolation::forNonisolated(false); + } + + // If all of the value witnesses are nonisolated, then we should not infer + // global actor isolation. + bool anyIsolatedWitness = false; + auto protocol = conformance->getProtocol(); + for (auto requirement : protocol->getMembers()) { + if (isa(requirement)) + continue; + + auto valueReq = dyn_cast(requirement); + if (!valueReq) + continue; + + auto witness = conformance->getWitnessDecl(valueReq); + if (!witness) + continue; + + auto witnessIsolation = getActorIsolation(witness); + if (witnessIsolation.isActorIsolated()) { + anyIsolatedWitness = true; + break; + } + } + + if (!anyIsolatedWitness) { + return ActorIsolation::forNonisolated(false); } - return ActorIsolation::forNonisolated(false); + return nominalIsolation; } namespace { diff --git a/test/Concurrency/isolated_conformance_default_actor.swift b/test/Concurrency/isolated_conformance_default_actor.swift index ce8cce07ecc1f..42db7b83405c5 100644 --- a/test/Concurrency/isolated_conformance_default_actor.swift +++ b/test/Concurrency/isolated_conformance_default_actor.swift @@ -46,8 +46,8 @@ func acceptSendablePMeta(_: T.Type) { } func acceptSendableQMeta(_: T.Type) { } nonisolated func testConformancesFromNonisolated() { - let _: any P = CExplicitMainActor() // expected-error{{main actor-isolated conformance of 'CExplicitMainActor' to 'P' cannot be used in nonisolated context}} - let _: any P = CImplicitMainActor() // expected-error{{main actor-isolated conformance of 'CImplicitMainActor' to 'P' cannot be used in nonisolated context}} + let _: any P = CExplicitMainActor() // okay + let _: any P = CImplicitMainActor() // okay let _: any P = CNonIsolated() let _: any P = CImplicitMainActorNonisolatedConformance() diff --git a/test/Concurrency/isolated_conformance_inference.swift b/test/Concurrency/isolated_conformance_inference.swift index 5210513b19872..5389e88314197 100644 --- a/test/Concurrency/isolated_conformance_inference.swift +++ b/test/Concurrency/isolated_conformance_inference.swift @@ -32,6 +32,11 @@ extension CExplicit: Q { func g() { } } +@SomeGlobalActor +class CViaNonisolatedWitness: P { + nonisolated func f() { } // okay! conformance above is nonisolated via this witness +} + // expected-error@+3{{conformance of 'CNonIsolated' to protocol 'P' crosses into global actor 'SomeGlobalActor'-isolated code and can cause data races}} // expected-note@+2{{turn data races into runtime errors with '@preconcurrency'}} // expected-note@+1{{isolate this conformance to the global actor 'SomeGlobalActor' with '@SomeGlobalActor'}}{{33-33=@SomeGlobalActor }} @@ -49,4 +54,6 @@ nonisolated func testConformancesFromNonisolated() { // Okay, these are nonisolated conformances. let _: any Q = CExplicit() + + let _: any P = CViaNonisolatedWitness() } diff --git a/test/Macros/Inputs/syntax_macro_definitions.swift b/test/Macros/Inputs/syntax_macro_definitions.swift index 2cfce74ce198a..a6f8d73fa8bf6 100644 --- a/test/Macros/Inputs/syntax_macro_definitions.swift +++ b/test/Macros/Inputs/syntax_macro_definitions.swift @@ -2881,6 +2881,58 @@ public struct HangingMacro: PeerMacro { } } +public struct PWithNonisolatedFuncMacro: ExtensionMacro { + public static var inferNonisolatedConformances: Bool { false } + + public static func expansion( + of node: AttributeSyntax, + attachedTo decl: some DeclGroupSyntax, + providingExtensionsOf type: some TypeSyntaxProtocol, + conformingTo protocols: [TypeSyntax], + in context: some MacroExpansionContext + ) throws -> [ExtensionDeclSyntax] { + if (protocols.isEmpty) { + return [] + } + + let decl: DeclSyntax = + """ + extension \(raw: type.trimmedDescription): P { + nonisolated static func requirement() { } + } + """ + + return [ + decl.cast(ExtensionDeclSyntax.self) + ] + } +} + +public struct NonisolatedPWithNonisolatedFuncMacro: ExtensionMacro { + public static func expansion( + of node: AttributeSyntax, + attachedTo decl: some DeclGroupSyntax, + providingExtensionsOf type: some TypeSyntaxProtocol, + conformingTo protocols: [TypeSyntax], + in context: some MacroExpansionContext + ) throws -> [ExtensionDeclSyntax] { + if (protocols.isEmpty) { + return [] + } + + let decl: DeclSyntax = + """ + extension \(raw: type.trimmedDescription): P { + nonisolated static func requirement() { } + } + """ + + return [ + decl.cast(ExtensionDeclSyntax.self) + ] + } +} + public struct BigEndianAccessorMacro: AccessorMacro { public static func expansion( of node: AttributeSyntax, diff --git a/test/Macros/macro_expand_extensions.swift b/test/Macros/macro_expand_extensions.swift index 4a70143e7d344..b333b7d12d802 100644 --- a/test/Macros/macro_expand_extensions.swift +++ b/test/Macros/macro_expand_extensions.swift @@ -283,3 +283,15 @@ struct HasNestedType { // extensions of nested types when the outer type has an // attached macro that can add other nested types. extension HasNestedType.Inner {} + +@attached(extension, conformances: P, names: named(requirement)) +macro AddPWithNonisolated() = #externalMacro(module: "MacroDefinition", type: "PWithNonisolatedFuncMacro") + +@attached(extension, conformances: P, names: named(requirement)) +macro AddNonisolatedPWithNonisolated() = #externalMacro(module: "MacroDefinition", type: "NonisolatedPWithNonisolatedFuncMacro") + +@AddNonisolatedPWithNonisolated +struct MakeMeNonisolated { } + +@AddPWithNonisolated +struct KeepMeIsolated { } From 1b5c9368a006f3e50b6f6bab143e2f498d88d927 Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Mon, 5 May 2025 10:56:23 -0700 Subject: [PATCH 22/51] Make ConformanceIsolationRequest cache per-ProtocolConformance This request was looking through to the root conformance, which could mess with the caching bits. Sink the "is nonisolated conformance" bit down into ProtocolConformance, and have the request for a non-root conformance be defined in terms of the request for the root conformance. --- include/swift/AST/ProtocolConformance.h | 29 ++++++++++++++----------- lib/AST/TypeCheckRequests.cpp | 14 ++++-------- lib/Sema/TypeCheckConcurrency.cpp | 3 +++ 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/include/swift/AST/ProtocolConformance.h b/include/swift/AST/ProtocolConformance.h index 74f5b49cfa947..b375cb3afeaed 100644 --- a/include/swift/AST/ProtocolConformance.h +++ b/include/swift/AST/ProtocolConformance.h @@ -131,6 +131,8 @@ class alignas(1 << DeclAlignInBits) ProtocolConformance /// conformance definition. Type ConformingType; + friend class ConformanceIsolationRequest; + protected: // clang-format off // @@ -139,9 +141,13 @@ class alignas(1 << DeclAlignInBits) ProtocolConformance union { uint64_t OpaqueBits; SWIFT_INLINE_BITFIELD_BASE(ProtocolConformance, + 1+ bitmax(NumProtocolConformanceKindBits, 8), /// The kind of protocol conformance. - Kind : bitmax(NumProtocolConformanceKindBits, 8) + Kind : bitmax(NumProtocolConformanceKindBits, 8), + + /// Whether the computed actor isolation is nonisolated. + IsComputedNonisolated : 1 ); SWIFT_INLINE_BITFIELD_EMPTY(RootProtocolConformance, ProtocolConformance); @@ -161,9 +167,6 @@ class alignas(1 << DeclAlignInBits) ProtocolConformance /// this conformance. IsPreconcurrencyEffectful : 1, - /// Whether the computed actor isolation is nonisolated. - IsComputedNonisolated : 1, - /// Whether there is an explicit global actor specified for this /// conformance. HasExplicitGlobalActor : 1, @@ -198,6 +201,15 @@ class alignas(1 << DeclAlignInBits) ProtocolConformance ProtocolConformance(ProtocolConformanceKind kind, Type conformingType) : ConformingType(conformingType) { Bits.ProtocolConformance.Kind = unsigned(kind); + Bits.ProtocolConformance.IsComputedNonisolated = false; + } + + bool isComputedNonisolated() const { + return Bits.ProtocolConformance.IsComputedNonisolated; + } + + void setComputedNonnisolated(bool value = true) { + Bits.ProtocolConformance.IsComputedNonisolated = value; } public: @@ -587,14 +599,6 @@ class NormalProtocolConformance : public RootProtocolConformance, // Record the explicitly-specified global actor isolation. void setExplicitGlobalActorIsolation(TypeExpr *typeExpr); - bool isComputedNonisolated() const { - return Bits.NormalProtocolConformance.IsComputedNonisolated; - } - - void setComputedNonnisolated(bool value = true) { - Bits.NormalProtocolConformance.IsComputedNonisolated = value; - } - public: NormalProtocolConformance(Type conformingType, ProtocolDecl *protocol, SourceLoc loc, DeclContext *dc, @@ -618,7 +622,6 @@ class NormalProtocolConformance : public RootProtocolConformance, Bits.NormalProtocolConformance.HasComputedAssociatedConformances = false; Bits.NormalProtocolConformance.SourceKind = unsigned(ConformanceEntryKind::Explicit); - Bits.NormalProtocolConformance.IsComputedNonisolated = false; Bits.NormalProtocolConformance.HasExplicitGlobalActor = false; setExplicitGlobalActorIsolation(options.getGlobalActorIsolationType()); } diff --git a/lib/AST/TypeCheckRequests.cpp b/lib/AST/TypeCheckRequests.cpp index 7d475ad5690aa..11bd7187d880d 100644 --- a/lib/AST/TypeCheckRequests.cpp +++ b/lib/AST/TypeCheckRequests.cpp @@ -1373,31 +1373,25 @@ ConformanceIsolationRequest::getCachedResult() const { // everything else, which is nearly every conformance, this request quickly // returns "nonisolated" so there is no point in caching it. auto conformance = std::get<0>(getStorage()); - auto rootNormal = - dyn_cast(conformance->getRootConformance()); - if (!rootNormal) - return ActorIsolation::forNonisolated(false); // Was actor isolation non-isolated? - if (rootNormal->isComputedNonisolated()) + if (conformance->isComputedNonisolated()) return ActorIsolation::forNonisolated(false); - ASTContext &ctx = rootNormal->getDeclContext()->getASTContext(); + ASTContext &ctx = conformance->getDeclContext()->getASTContext(); return ctx.evaluator.getCachedNonEmptyOutput(*this); } void ConformanceIsolationRequest::cacheResult(ActorIsolation result) const { auto conformance = std::get<0>(getStorage()); - auto rootNormal = - cast(conformance->getRootConformance()); // Common case: conformance is nonisolated. if (result.isNonisolated()) { - rootNormal->setComputedNonnisolated(); + conformance->setComputedNonnisolated(); return; } - ASTContext &ctx = rootNormal->getDeclContext()->getASTContext(); + ASTContext &ctx = conformance->getDeclContext()->getASTContext(); ctx.evaluator.cacheNonEmptyOutput(*this, std::move(result)); } diff --git a/lib/Sema/TypeCheckConcurrency.cpp b/lib/Sema/TypeCheckConcurrency.cpp index 44eca63a9f650..c1bf985cf4720 100644 --- a/lib/Sema/TypeCheckConcurrency.cpp +++ b/lib/Sema/TypeCheckConcurrency.cpp @@ -7918,6 +7918,9 @@ ConformanceIsolationRequest::evaluate(Evaluator &evaluator, ProtocolConformance if (!rootNormal) return ActorIsolation::forNonisolated(false); + if (conformance != rootNormal) + return rootNormal->getIsolation(); + // If the conformance is explicitly non-isolated, report that. if (rootNormal->getOptions().contains(ProtocolConformanceFlags::Nonisolated)) return ActorIsolation::forNonisolated(false); From e4e141f17256b3652f57793377d2159201cfe000 Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Mon, 5 May 2025 11:06:49 -0700 Subject: [PATCH 23/51] [Request evaluator] Eliminate assert that fires on cycles This assertion will trigger whenever there is a cycle with a split-cached request. Remove the assertion. --- include/swift/AST/Evaluator.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/swift/AST/Evaluator.h b/include/swift/AST/Evaluator.h index f3f56f0f85ae2..aeedf3ba2b297 100644 --- a/include/swift/AST/Evaluator.h +++ b/include/swift/AST/Evaluator.h @@ -276,9 +276,7 @@ class Evaluator { typename std::enable_if::type* = nullptr> void cacheNonEmptyOutput(const Request &request, typename Request::OutputType &&output) { - bool inserted = cache.insert(request, std::move(output)); - assert(inserted && "Request result was already cached"); - (void) inserted; + (void)cache.insert(request, std::move(output)); } /// Consults the request evaluator's cache for a split-cached request. From ba845de87408519dcb9457eecf41e47665e100c0 Mon Sep 17 00:00:00 2001 From: Meghana Gupta Date: Mon, 5 May 2025 11:20:38 -0700 Subject: [PATCH 24/51] Fix newly introduced warnings in LifetimeDependenceScopeFixup --- .../LifetimeDependenceScopeFixup.swift | 14 +------------- SwiftCompilerSources/Sources/SIL/Builder.swift | 1 + 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceScopeFixup.swift b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceScopeFixup.swift index 46b77460ea1fa..817a6958aa713 100644 --- a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceScopeFixup.swift +++ b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceScopeFixup.swift @@ -194,19 +194,7 @@ private func createEndCOWMutationIfNeeded(lifetimeDep: LifetimeDependence, _ con } scoped = beginApply // None of the below cases can generate a mutable address. - case let .owned: - fallthrough - case let .borrowed: - fallthrough - case let .local: - fallthrough - case let .initialized: - fallthrough - case let .caller: - fallthrough - case let .global: - fallthrough - case let .unknown: + case .owned, .borrowed, .local, .initialized, .caller, .global, .unknown: return } diff --git a/SwiftCompilerSources/Sources/SIL/Builder.swift b/SwiftCompilerSources/Sources/SIL/Builder.swift index 9d305f700e20a..235a5dcc411eb 100644 --- a/SwiftCompilerSources/Sources/SIL/Builder.swift +++ b/SwiftCompilerSources/Sources/SIL/Builder.swift @@ -582,6 +582,7 @@ public struct Builder { return notifyNew(endMutation.getAs(EndCOWMutationInst.self)) } + @discardableResult public func createEndCOWMutationAddr(address: Value) -> EndCOWMutationAddrInst { let endMutation = bridged.createEndCOWMutationAddr(address.bridged) return notifyNew(endMutation.getAs(EndCOWMutationAddrInst.self)) From 31947d0617324254bdb57a1d11448720be18e4a4 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 5 May 2025 14:22:11 -0400 Subject: [PATCH 25/51] RemoteInspection: Fix latent bug in TypeRefIsConcrete::visitOpaqueArchetypeTypeRef() --- stdlib/public/RemoteInspection/TypeRef.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/stdlib/public/RemoteInspection/TypeRef.cpp b/stdlib/public/RemoteInspection/TypeRef.cpp index bc2440bf9ee66..e994c40c80412 100644 --- a/stdlib/public/RemoteInspection/TypeRef.cpp +++ b/stdlib/public/RemoteInspection/TypeRef.cpp @@ -506,6 +506,13 @@ struct TypeRefIsConcrete } bool visitOpaqueArchetypeTypeRef(const OpaqueArchetypeTypeRef *O) { + for (auto Args : O->getArgumentLists()) { + for (auto *Arg : Args) { + if (!visit(Arg)) + return false; + } + } + return false; } From c205c802f640fd0787c3e365df96780ae9a9a8c2 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 5 May 2025 14:25:46 -0400 Subject: [PATCH 26/51] RemoteInspection: Remove 'DidSubstitute' form of TypeRef::subst() --- include/swift/RemoteInspection/TypeRef.h | 4 ---- stdlib/public/RemoteInspection/TypeRef.cpp | 17 ++--------------- .../public/RemoteInspection/TypeRefBuilder.cpp | 5 +++-- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/include/swift/RemoteInspection/TypeRef.h b/include/swift/RemoteInspection/TypeRef.h index 593a923d35370..1a69421b1f84c 100644 --- a/include/swift/RemoteInspection/TypeRef.h +++ b/include/swift/RemoteInspection/TypeRef.h @@ -238,10 +238,6 @@ class alignas(8) TypeRef { const TypeRef *subst(TypeRefBuilder &Builder, const GenericArgumentMap &Subs) const; - const TypeRef *subst(TypeRefBuilder &Builder, - const GenericArgumentMap &Subs, - bool &DidSubstitute) const; - std::optional getSubstMap() const; virtual ~TypeRef() = default; diff --git a/stdlib/public/RemoteInspection/TypeRef.cpp b/stdlib/public/RemoteInspection/TypeRef.cpp index e994c40c80412..26df023a75ffe 100644 --- a/stdlib/public/RemoteInspection/TypeRef.cpp +++ b/stdlib/public/RemoteInspection/TypeRef.cpp @@ -1357,15 +1357,12 @@ class TypeRefSubstitution : public TypeRefVisitor { TypeRefBuilder &Builder; GenericArgumentMap Substitutions; - // Set true iff the Substitution map was actually used - bool DidSubstitute; + public: using TypeRefVisitor::visit; TypeRefSubstitution(TypeRefBuilder &Builder, GenericArgumentMap Substitutions) - : Builder(Builder), Substitutions(Substitutions), DidSubstitute(false) {} - - bool didSubstitute() const { return DidSubstitute; } + : Builder(Builder), Substitutions(Substitutions) {} const TypeRef *visitBuiltinTypeRef(const BuiltinTypeRef *B) { return B; @@ -1495,7 +1492,6 @@ class TypeRefSubstitution if (found == Substitutions.end()) return GTP; assert(found->second->isConcrete()); - DidSubstitute = true; // We actually used the Substitutions // When substituting a concrete type containing a metatype into a // type parameter, (eg: T, T := C.Type), we must also represent @@ -1616,15 +1612,6 @@ const TypeRef *TypeRef::subst(TypeRefBuilder &Builder, return TypeRefSubstitution(Builder, Subs).visit(this); } -const TypeRef *TypeRef::subst(TypeRefBuilder &Builder, - const GenericArgumentMap &Subs, - bool &DidSubstitute) const { - auto subst = TypeRefSubstitution(Builder, Subs); - auto TR = subst.visit(this); - DidSubstitute = subst.didSubstitute(); - return TR; -} - bool TypeRef::deriveSubstitutions(GenericArgumentMap &Subs, const TypeRef *OrigTR, const TypeRef *SubstTR) { diff --git a/stdlib/public/RemoteInspection/TypeRefBuilder.cpp b/stdlib/public/RemoteInspection/TypeRefBuilder.cpp index d696c1056a96a..d3cd6b6894b78 100644 --- a/stdlib/public/RemoteInspection/TypeRefBuilder.cpp +++ b/stdlib/public/RemoteInspection/TypeRefBuilder.cpp @@ -538,8 +538,9 @@ bool TypeRefBuilder::getFieldTypeRefs( // We need this for enums; an enum case "is generic" if any generic type // parameter substitutions occurred on the payload. E.g., // `case a([T?])` is generic, but `case a([Int?])` is not. - bool IsGeneric = false; - auto Substituted = Unsubstituted->subst(*this, *Subs, IsGeneric); + bool IsGeneric = !Unsubstituted->isConcrete(); + auto Substituted = (IsGeneric ? Unsubstituted->subst(*this, *Subs) + : Unsubstituted); bool IsIndirect = FD.isEnum() && Field->IsIndirectCase; auto FieldTI = FieldTypeInfo(FieldName.str(), FieldValue, Substituted, From e8a4fcbb445cf3221be0ec6f3dcfae5c264aef55 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Mon, 5 May 2025 20:36:27 +0100 Subject: [PATCH 27/51] CODEOWNERS: Temporarily assign myself to `test/IRGen` LLVM changed both the syntax and relative position of the `nocapture` parameter attribute. I would like to get notified of any changes in this area to make sure new tests match the attribute on main such that it won't cause a conflict with rebranch. --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 51116f4f6dab8..39421de56a0f2 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -223,7 +223,7 @@ /test/Generics/ @hborla @slavapestov /test/Generics/inverse* @kavon /test/IDE/ @ahoppen @bnbarham @hamishknight @rintaro -/test/IRGen/ @rjmccall +/test/IRGen/ @AnthonyLatsis @rjmccall /test/Index/ @ahoppen @bnbarham @hamishknight @rintaro /test/Interop/ @zoecarver @egorzhdan @Xazax-hun @j-hui @fahadnayyar @susmonteiro @hnrklssn /test/Macros/SwiftifyImport @hnrklssn @Xazax-hun From df02862c2a45f4f47d6cbd63e30923014941991b Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 5 May 2025 16:03:29 -0400 Subject: [PATCH 28/51] Sema: Disallow SE-0361 with variadic generic types for now `extension G` introduces a same-type requirement, and this isn't supported for variadic generic types yet. Make sure we pass a valid source location here to diagnose instead of dropping the error. - Fixes https://github.com/apple/swift/issues/70432 - Fixes rdar://119613080 --- .../RequirementMachineRequests.cpp | 2 +- test/Generics/variadic_generic_types.swift | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/AST/RequirementMachine/RequirementMachineRequests.cpp b/lib/AST/RequirementMachine/RequirementMachineRequests.cpp index 83f06a1538ef6..97a46d677ad13 100644 --- a/lib/AST/RequirementMachine/RequirementMachineRequests.cpp +++ b/lib/AST/RequirementMachine/RequirementMachineRequests.cpp @@ -870,7 +870,7 @@ InferredGenericSignatureRequest::evaluate( // inferred same-type requirements when building the generic signature of // an extension whose extended type is a generic typealias. for (const auto &req : addedRequirements) - requirements.push_back({req, SourceLoc()}); + requirements.push_back({req, loc}); desugarRequirements(requirements, inverses, errors); diff --git a/test/Generics/variadic_generic_types.swift b/test/Generics/variadic_generic_types.swift index 6b4ab724c31f3..6ee1a5b00af5c 100644 --- a/test/Generics/variadic_generic_types.swift +++ b/test/Generics/variadic_generic_types.swift @@ -116,3 +116,16 @@ func packExpansionInScalarArgument(_: repeat each T) { typealias A = U typealias One = A // expected-error {{pack expansion 'repeat each T' can only appear in a function parameter list, tuple element, or generic argument of a variadic type}} } + +// Make sure we diagnose instead of silently dropping the same-type requirement +// https://github.com/apple/swift/issues/70432 + +struct WithPack {} + +// FIXME: The diagnostics are misleading. + +extension WithPack {} +// expected-error@-1 {{same-element requirements are not yet supported}} + +extension WithPack where (repeat each T) == (Int, Int) {} +// expected-error@-1 {{generic signature requires types '(repeat each T)' and '(Int, Int)' to be the same}} \ No newline at end of file From 9d59dbed175c50744610a9671bb0314ea3920492 Mon Sep 17 00:00:00 2001 From: Michael Gottesman Date: Mon, 5 May 2025 11:08:38 -0700 Subject: [PATCH 29/51] [swift-settings] Now that we aren't using it immediately, remove it from tree. We can always get it back from the git history. rdar://150695113 --- Runtimes/Core/core/CMakeLists.txt | 1 - include/swift/AST/ASTBridging.h | 2 - include/swift/AST/DiagnosticsSema.def | 15 - include/swift/AST/KnownStdlibTypes.def | 2 - include/swift/AST/MacroDefinition.h | 3 - include/swift/AST/SourceFile.h | 12 - include/swift/AST/TypeCheckRequests.h | 20 -- include/swift/AST/TypeCheckerTypeIDZone.def | 3 - include/swift/Basic/Features.def | 3 - lib/AST/ASTPrinter.cpp | 3 - lib/AST/FeatureSet.cpp | 8 - lib/AST/Module.cpp | 279 ------------------ .../Sources/MacroEvaluation/Macros.swift | 3 - lib/Sema/TypeCheckConcurrency.cpp | 22 +- lib/Sema/TypeCheckMacros.cpp | 16 - lib/Sema/TypeChecker.cpp | 4 - lib/Serialization/Deserialization.cpp | 4 - lib/Serialization/Serialization.cpp | 3 - stdlib/public/Concurrency/Actor.swift | 9 - stdlib/public/core/CMakeLists.txt | 1 - stdlib/public/core/GroupInfo.json | 3 +- stdlib/public/core/SwiftSettings.swift | 27 -- .../swiftsettings_defaultIsolation.swift | 54 ---- test/Sema/swiftsettings.swift | 20 -- test/Sema/swiftsettings_duplicates.swift | 24 -- test/abi/macOS/arm64/concurrency.swift | 3 - test/abi/macOS/arm64/stdlib.swift | 6 - test/abi/macOS/x86_64/concurrency.swift | 3 - test/abi/macOS/x86_64/stdlib.swift | 6 - 29 files changed, 2 insertions(+), 557 deletions(-) delete mode 100644 stdlib/public/core/SwiftSettings.swift delete mode 100644 test/Concurrency/swiftsettings_defaultIsolation.swift delete mode 100644 test/Sema/swiftsettings.swift delete mode 100644 test/Sema/swiftsettings_duplicates.swift diff --git a/Runtimes/Core/core/CMakeLists.txt b/Runtimes/Core/core/CMakeLists.txt index 0dbeb8f8f7451..306825ed684a9 100644 --- a/Runtimes/Core/core/CMakeLists.txt +++ b/Runtimes/Core/core/CMakeLists.txt @@ -188,7 +188,6 @@ add_library(swiftCore StringWordBreaking.swift Substring.swift SwiftNativeNSArray.swift - SwiftSettings.swift TemporaryAllocation.swift ThreadLocalStorage.swift UIntBuffer.swift diff --git a/include/swift/AST/ASTBridging.h b/include/swift/AST/ASTBridging.h index 3b144b87d134c..f609fa4c3506a 100644 --- a/include/swift/AST/ASTBridging.h +++ b/include/swift/AST/ASTBridging.h @@ -3051,8 +3051,6 @@ enum ENUM_EXTENSIBILITY_ATTR(open) BridgedMacroDefinitionKind : size_t { BridgedBuiltinExternalMacro, /// The builtin definition for the "isolation" macro. BridgedBuiltinIsolationMacro, - /// The builtin definition for the "SwiftSetting" macro. - BridgedBuiltinSwiftSettingsMacro, }; struct BridgedASTType { diff --git a/include/swift/AST/DiagnosticsSema.def b/include/swift/AST/DiagnosticsSema.def index 88755b944e6a5..b7bd335f37291 100644 --- a/include/swift/AST/DiagnosticsSema.def +++ b/include/swift/AST/DiagnosticsSema.def @@ -8717,20 +8717,5 @@ ERROR(extensible_attr_on_internal_type,none, ERROR(pre_enum_extensibility_without_extensible,none, "%0 can only be used together with '@extensible' attribute", (DeclAttribute)) -//===----------------------------------------------------------------------===// -// MARK: SwiftSettings -//===----------------------------------------------------------------------===// - -ERROR(swift_settings_invalid_setting, none, - "Unrecognized setting passed to #SwiftSettings", ()) - -ERROR(swift_settings_must_be_top_level, none, - "#SwiftSettings can only be invoked as a top level declaration", ()) - -ERROR(swift_settings_duplicate_setting, none, - "duplicate setting passed to #SwiftSettings", ()) -NOTE(swift_settings_duplicate_setting_original_loc, none, - "setting originally passed here", ()) - #define UNDEFINE_DIAGNOSTIC_MACROS #include "DefineDiagnosticMacros.h" diff --git a/include/swift/AST/KnownStdlibTypes.def b/include/swift/AST/KnownStdlibTypes.def index 9ca3953464bd5..425c846e26854 100644 --- a/include/swift/AST/KnownStdlibTypes.def +++ b/include/swift/AST/KnownStdlibTypes.def @@ -101,8 +101,6 @@ KNOWN_STDLIB_TYPE_DECL(Result, NominalTypeDecl, 2) KNOWN_STDLIB_TYPE_DECL(InlineArray, NominalTypeDecl, 2) -KNOWN_STDLIB_TYPE_DECL(SwiftSetting, NominalTypeDecl, 0) - KNOWN_STDLIB_TYPE_DECL(MutableSpan, NominalTypeDecl, 1) #undef KNOWN_STDLIB_TYPE_DECL diff --git a/include/swift/AST/MacroDefinition.h b/include/swift/AST/MacroDefinition.h index 17937a9bba82d..7c7538948c43f 100644 --- a/include/swift/AST/MacroDefinition.h +++ b/include/swift/AST/MacroDefinition.h @@ -77,9 +77,6 @@ enum class BuiltinMacroKind : uint8_t { ExternalMacro, /// #isolation, which produces the isolation of the current context IsolationMacro, - /// #SwiftSettings, which allows for the user to set a compiler setting at - /// the file level - SwiftSettingsMacro, }; /// A single replacement diff --git a/include/swift/AST/SourceFile.h b/include/swift/AST/SourceFile.h index 6b8e1b7accd93..a847b43bfd8f9 100644 --- a/include/swift/AST/SourceFile.h +++ b/include/swift/AST/SourceFile.h @@ -54,15 +54,6 @@ enum class RestrictedImportKind { /// Import that limits the access level of imported entities. using ImportAccessLevel = std::optional>; -/// Language options only for use with a specific SourceFile. -/// -/// Vended by SourceFile::getLanguageOptions(). -struct SourceFileLangOptions { - /// If unset, no value was provided. If a Type, that type is the type of the - /// isolation. If set to an empty type, nil was specified explicitly. - std::optional defaultIsolation; -}; - /// A file containing Swift source code. /// /// This is a .swift or .sil file (or a virtual file, such as the contents of @@ -572,9 +563,6 @@ class SourceFile final : public FileUnit { ObjCSelector selector, SmallVectorImpl &results) const override; - /// File level language options. - SourceFileLangOptions getLanguageOptions() const; - protected: virtual void lookupOperatorDirect(Identifier name, OperatorFixity fixity, diff --git a/include/swift/AST/TypeCheckRequests.h b/include/swift/AST/TypeCheckRequests.h index cdaeb774b0158..526fecfe2125d 100644 --- a/include/swift/AST/TypeCheckRequests.h +++ b/include/swift/AST/TypeCheckRequests.h @@ -5332,26 +5332,6 @@ class SemanticAvailabilitySpecRequest void cacheResult(std::optional value) const; }; -class SourceFileLangOptionsRequest - : public SimpleRequest { - -public: - using SimpleRequest::SimpleRequest; - -private: - friend SimpleRequest; - - SourceFileLangOptions evaluate(Evaluator &evaluator, - SourceFile *sourceFile) const; - -public: - bool isCached() const { return true; } - std::optional getCachedResult() const; - void cacheResult(SourceFileLangOptions value) const; -}; - #define SWIFT_TYPEID_ZONE TypeChecker #define SWIFT_TYPEID_HEADER "swift/AST/TypeCheckerTypeIDZone.def" #include "swift/Basic/DefineTypeIDZone.h" diff --git a/include/swift/AST/TypeCheckerTypeIDZone.def b/include/swift/AST/TypeCheckerTypeIDZone.def index 7a3a2735ce4da..ff50e811953d5 100644 --- a/include/swift/AST/TypeCheckerTypeIDZone.def +++ b/include/swift/AST/TypeCheckerTypeIDZone.def @@ -629,6 +629,3 @@ SWIFT_REQUEST(TypeChecker, SemanticAvailabilitySpecRequest, std::optional (const AvailabilitySpec *, const DeclContext *), SeparatelyCached, NoLocationInfo) - -SWIFT_REQUEST(TypeChecker, SourceFileLangOptionsRequest, - SourceFileLangOptions (SourceFile *), Cached, NoLocationInfo) diff --git a/include/swift/Basic/Features.def b/include/swift/Basic/Features.def index af9f1c219723c..b79ad779bdeab 100644 --- a/include/swift/Basic/Features.def +++ b/include/swift/Basic/Features.def @@ -489,9 +489,6 @@ SUPPRESSIBLE_EXPERIMENTAL_FEATURE(ABIAttribute, true) /// Allow custom availability domains to be defined and referenced. EXPERIMENTAL_FEATURE(CustomAvailability, true) -/// Allow SwiftSettings -EXPERIMENTAL_FEATURE(SwiftSettings, false) - /// Syntax sugar features for concurrency. EXPERIMENTAL_FEATURE(ConcurrencySyntaxSugar, true) diff --git a/lib/AST/ASTPrinter.cpp b/lib/AST/ASTPrinter.cpp index bdf5293211f9e..3a46f8815a345 100644 --- a/lib/AST/ASTPrinter.cpp +++ b/lib/AST/ASTPrinter.cpp @@ -4808,9 +4808,6 @@ void PrintAST::visitMacroDecl(MacroDecl *decl) { case BuiltinMacroKind::IsolationMacro: Printer << "IsolationMacro"; break; - case BuiltinMacroKind::SwiftSettingsMacro: - Printer << "SwiftSettingsMacro"; - break; } break; diff --git a/lib/AST/FeatureSet.cpp b/lib/AST/FeatureSet.cpp index 3b410786f53bf..4d5ee7f190f2a 100644 --- a/lib/AST/FeatureSet.cpp +++ b/lib/AST/FeatureSet.cpp @@ -451,14 +451,6 @@ UNINTERESTING_FEATURE(SuppressCXXForeignReferenceTypeInitializers) UNINTERESTING_FEATURE(CoroutineAccessorsUnwindOnCallerError) UNINTERESTING_FEATURE(AllowRuntimeSymbolDeclarations) -static bool usesFeatureSwiftSettings(const Decl *decl) { - // We just need to guard `#SwiftSettings`. - auto *macro = dyn_cast(decl); - return macro && macro->isStdlibDecl() && - macro->getMacroRoles().contains(MacroRole::Declaration) && - macro->getBaseIdentifier().is("SwiftSettings"); -} - bool swift::usesFeatureIsolatedDeinit(const Decl *decl) { if (auto cd = dyn_cast(decl)) { return cd->getFormalAccess() == AccessLevel::Open && diff --git a/lib/AST/Module.cpp b/lib/AST/Module.cpp index f8ed0c23c6850..03a100512445d 100644 --- a/lib/AST/Module.cpp +++ b/lib/AST/Module.cpp @@ -4181,282 +4181,3 @@ version::Version ModuleDecl::getLanguageVersionBuiltWith() const { return version::Version(); } - -//===----------------------------------------------------------------------===// -// MARK: SwiftSettings -//===----------------------------------------------------------------------===// - -static llvm::cl::opt AllowForDuplicateSwiftSettings( - "swift-settings-allow-duplicates", - llvm::cl::desc("Option that allows for duplicate SwiftSettings. Just for " - "compiler testing"), - llvm::cl::Hidden); - -namespace { - -enum class SwiftSettingKind { - Unknown = 0, - DefaultIsolation, - - LastKind = DefaultIsolation, -}; - -struct SwiftSettingsWalker : ASTWalker { - SourceFile &sf; - ASTContext &ctx; - SourceFileLangOptions result; - - SmallVector swiftSettingIndexToOriginalExprMap; - - SwiftSettingsWalker(SourceFile &sf, ASTContext &ctx) - : sf(sf), ctx(ctx), result() { - // NOTE: We do not store a value for Unknown. - for (unsigned i : range(unsigned(SwiftSettingKind::LastKind))) { - (void)i; - swiftSettingIndexToOriginalExprMap.push_back(nullptr); - } - } - - Expr *&getOriginalSwiftSetting(SwiftSettingKind kind) { - assert(kind != SwiftSettingKind::Unknown); - return swiftSettingIndexToOriginalExprMap[unsigned(kind) - 1]; - } - - /// Given a specific CallExpr, pattern matches the CallExpr's first argument - /// to validate it is MainActor.self. Returns CanType() if the CallExpr has - /// multiple parameters or if its first parameter is not a MainActor.self. - /// - /// This is used when pattern matching against - /// .defaultIsolation(MainActor.self). - CanType patternMatchDefaultIsolationMainActor(CallExpr *callExpr); - - /// Validates that macroExpr is a well formed "SwiftSettings" macro. Returns - /// true if we can process it and false otherwise. - bool isSwiftSettingsMacroExpr(MacroExpansionExpr *macroExpr); - - /// Given a specific \p arg to a SwiftSettings macro, attempt to lookup the - /// static method on SwiftSetting. Returns nullptr on failure. - std::optional> - getSwiftSettingArgDecl(Argument arg); - - PreWalkResult walkToExprPre(Expr *expr) override { - // First see if we have a "SwiftSettings" macro expansion expr. If we do not - // there is no further work to do... just continue. - auto *macroExpr = dyn_cast(expr); - if (!macroExpr || !isSwiftSettingsMacroExpr(macroExpr)) - return Action::SkipChildren(expr); - - // Ok, we found our SwiftSettingsMacro. Lets start pattern matching. - bool emittedDiagnostic = false; - for (auto arg : *macroExpr->getArgs()) { - // If we did not find any macro, we emit an unknown macro error. We use - // SWIFT_DEFER so we can use early exits below and ensure we always - // perform the check. - bool foundValidArg = false; - SWIFT_DEFER { - if (!foundValidArg) { - emittedDiagnostic = true; - ctx.Diags.diagnose(arg.getStartLoc(), - diag::swift_settings_invalid_setting); - } - }; - - auto calleeFuncDecl = getSwiftSettingArgDecl(arg); - if (!calleeFuncDecl) - continue; - CallExpr *callExpr; - FuncDecl *funcDecl; - std::tie(callExpr, funcDecl) = *calleeFuncDecl; - - auto kind = - llvm::StringSwitch( - funcDecl->getBaseIdentifier().get()) - .Case("defaultIsolation", SwiftSettingKind::DefaultIsolation) - .Default(SwiftSettingKind::Unknown); - switch (kind) { - case SwiftSettingKind::Unknown: - // Emit error. - continue; - - case SwiftSettingKind::DefaultIsolation: - auto *&expr = - getOriginalSwiftSetting(SwiftSettingKind::DefaultIsolation); - - // If we already have an expr, emit an error and continue. - if (!AllowForDuplicateSwiftSettings && expr) { - ctx.Diags.diagnose(arg.getStartLoc(), - diag::swift_settings_duplicate_setting); - ctx.Diags.diagnose( - expr->getLoc(), - diag::swift_settings_duplicate_setting_original_loc); - foundValidArg = true; - continue; - } - - // Otherwise, set things up appropriately. - if (auto actor = patternMatchDefaultIsolationMainActor(callExpr)) { - expr = callExpr; - result.defaultIsolation = actor; - foundValidArg = true; - continue; - } - - if (isa(callExpr->getArgs()->getExpr(0))) { - expr = callExpr; - result.defaultIsolation = {Type()}; - foundValidArg = true; - continue; - } - - continue; - } - } - - return Action::SkipChildren(expr); - } -}; - -} // namespace - -bool SwiftSettingsWalker::isSwiftSettingsMacroExpr( - MacroExpansionExpr *macroExpr) { - // First make sure we actually have a macro with the name SwiftSettings. - if (!macroExpr->getMacroName().getBaseName().getIdentifier().is( - "SwiftSettings")) - return false; - - // Ok, we found a SwiftSettings macro. Perform an unqualified lookup to find - // the decl. - SmallVector macroDecls; - namelookup::forEachPotentialResolvedMacro( - sf.getModuleScopeContext(), macroExpr->getMacroName(), - MacroRole::Declaration, - [&](MacroDecl *decl, const MacroRoleAttr *) -> void { - macroDecls.push_back(decl); - }); - - // If we have multiple macroDecls, we must have some other macro called - // SwiftSettings. Let that take precedence and do not emit anything. The - // user can always specify Swift.SwiftSettings if needed? - if (macroDecls.size() != 1) - return false; - - // Ok, we only found one macroDecl. Make sure that it is from the stdlib. If - // not, something weird is happening... we can just skip the children. - auto *macroDecl = macroDecls.pop_back_val(); - if (!macroDecl->isStdlibDecl()) - return false; - - // Validate the form of our macroDef. We use assert instead of ASSERT since we - // go through the request evaluator when we call getDefinition(). -#ifndef NDEBUG - auto macroDef = macroDecl->getDefinition(); - assert(macroDef.kind == MacroDefinition::Kind::Builtin && - macroDef.getBuiltinKind() == BuiltinMacroKind::SwiftSettingsMacro && - "SwiftSettings macro from the stdlib that is not the actual builtin " - "macro?!"); -#endif - - // We found a good SwiftSettings macro! - return true; -} - -std::optional> -SwiftSettingsWalker::getSwiftSettingArgDecl(Argument arg) { - auto *callExpr = dyn_cast(arg.getExpr()); - if (!callExpr) - return {}; - - auto *directCallee = - dyn_cast(callExpr->getDirectCallee()); - if (!directCallee) - return {}; - - // Now lookup our swiftSettingDecl. - NominalTypeDecl *swiftSettingsDecl = nullptr; - { - SmallVector decls; - ctx.lookupInSwiftModule("SwiftSetting", decls); - - // We should always have only one decl and it should be a nominal type - // decl. - if (decls.size() != 1) - return {}; - swiftSettingsDecl = dyn_cast(decls.pop_back_val()); - if (!swiftSettingsDecl) - return {}; - } - assert(swiftSettingsDecl); - - // We have our callee, perform qualified name lookup for it on - // SwiftSetting. - DirectLookupDescriptor lookupDesc{ - swiftSettingsDecl, directCallee->getName().getFullName(), - NominalTypeDecl::LookupDirectFlags::ExcludeMacroExpansions}; - auto lookup = - evaluateOrDefault(ctx.evaluator, DirectLookupRequest{lookupDesc, {}}, {}); - if (lookup.empty()) - return {}; - - auto *f = dyn_cast(lookup.front()); - if (!f) - return {}; - - return {{callExpr, f}}; -} - -CanType -SwiftSettingsWalker::patternMatchDefaultIsolationMainActor(CallExpr *callExpr) { - // Grab the dot self expr. - auto *selfExpr = dyn_cast(callExpr->getArgs()->getExpr(0)); - if (!selfExpr) - return CanType(); - - // Then validate we have something that is MainActor. - auto *declRefExpr = dyn_cast(selfExpr->getSubExpr()); - if (!declRefExpr || - !declRefExpr->getName().getBaseName().getIdentifier().is("MainActor")) - return CanType(); - - // Then use unqualified lookup descriptor to find our MainActor. - UnqualifiedLookupDescriptor lookupDesc{ - declRefExpr->getName(), sf.getModuleScopeContext(), SourceLoc(), - UnqualifiedLookupFlags::ExcludeMacroExpansions}; - auto lookup = evaluateOrDefault(ctx.evaluator, - UnqualifiedLookupRequest{lookupDesc}, {}); - if (lookup.allResults().empty()) - return CanType(); - - // Then grab our nominal type decl and make sure it is from the concurrency - // module. - auto *nomDecl = - dyn_cast(lookup.allResults().front().getValueDecl()); - if (!nomDecl) - return CanType(); - auto *nomDeclDC = nomDecl->getDeclContext(); - auto *nomDeclModule = nomDecl->getParentModule(); - if (!nomDeclDC->isModuleScopeContext() || !nomDeclModule->isConcurrencyModule()) - return CanType(); - - return nomDecl->getDeclaredType()->getCanonicalType(); -} - -SourceFileLangOptions -SourceFileLangOptionsRequest::evaluate(Evaluator &evaluator, - SourceFile *f) const { - SwiftSettingsWalker walker(*f, f->getASTContext()); - - if (!f->getASTContext().LangOpts.hasFeature(Feature::SwiftSettings)) - return walker.result; - - for (auto *decl : f->getTopLevelDecls()) - decl->walk(walker); - - return walker.result; -} - -SourceFileLangOptions SourceFile::getLanguageOptions() const { - auto &eval = getASTContext().evaluator; - auto *self = const_cast(this); - return evaluateOrDefault(eval, SourceFileLangOptionsRequest{self}, {}); -} diff --git a/lib/ASTGen/Sources/MacroEvaluation/Macros.swift b/lib/ASTGen/Sources/MacroEvaluation/Macros.swift index 21c42fbbcbc89..2845418be557a 100644 --- a/lib/ASTGen/Sources/MacroEvaluation/Macros.swift +++ b/lib/ASTGen/Sources/MacroEvaluation/Macros.swift @@ -244,9 +244,6 @@ func checkMacroDefinition( case "IsolationMacro": return Int(BridgedMacroDefinitionKind.builtinIsolationMacro.rawValue) - case "SwiftSettingsMacro": - return Int(BridgedMacroDefinitionKind.builtinSwiftSettingsMacro.rawValue) - // These builtins don't exist, but are put into the standard library at // least for documentation purposes right now. Don't emit a warning for // them, but do fail operation. diff --git a/lib/Sema/TypeCheckConcurrency.cpp b/lib/Sema/TypeCheckConcurrency.cpp index e16a02e45c428..3d8df04be94dc 100644 --- a/lib/Sema/TypeCheckConcurrency.cpp +++ b/lib/Sema/TypeCheckConcurrency.cpp @@ -5785,28 +5785,8 @@ computeDefaultInferredActorIsolation(ValueDecl *value) { return {}; }; - // Otherwise, see if we have one specified by our file unit. - bool ignoreUnspecifiedMeansMainActorIsolated = false; - if (ctx.LangOpts.hasFeature(Feature::SwiftSettings)) { - if (auto *sourceFile = value->getDeclContext()->getParentSourceFile()) { - auto options = sourceFile->getLanguageOptions(); - if (auto isolation = options.defaultIsolation) { - if (*isolation) { - auto result = globalActorHelper(*options.defaultIsolation); - if (result) - return *result; - } else { - // If we found a nil type, then we know we should ignore unspecified - // means main actor isolated. - ignoreUnspecifiedMeansMainActorIsolated = true; - } - } - } - } - // If we are required to use main actor... just use that. - if (!ignoreUnspecifiedMeansMainActorIsolated && - ctx.LangOpts.DefaultIsolationBehavior == DefaultIsolation::MainActor) + if (ctx.LangOpts.DefaultIsolationBehavior == DefaultIsolation::MainActor) if (auto result = globalActorHelper(ctx.getMainActorType()->mapTypeOutOfContext())) return *result; diff --git a/lib/Sema/TypeCheckMacros.cpp b/lib/Sema/TypeCheckMacros.cpp index e6785da1c003b..7e22cfee5d11e 100644 --- a/lib/Sema/TypeCheckMacros.cpp +++ b/lib/Sema/TypeCheckMacros.cpp @@ -183,9 +183,6 @@ MacroDefinition MacroDefinitionRequest::evaluate( case BridgedBuiltinIsolationMacro: return MacroDefinition::forBuiltin(BuiltinMacroKind::IsolationMacro); - - case BridgedBuiltinSwiftSettingsMacro: - return MacroDefinition::forBuiltin(BuiltinMacroKind::SwiftSettingsMacro); } // Type-check the macro expansion. @@ -1154,14 +1151,6 @@ evaluateFreestandingMacro(FreestandingMacroExpansion *expansion, adjustMacroExpansionBufferName(*discriminator)); break; } - - case BuiltinMacroKind::SwiftSettingsMacro: { - // Just insert empty scratch space. We are not expanding to anything. - std::string scratchSpace; - evaluatedSource = llvm::MemoryBuffer::getMemBufferCopy( - scratchSpace, adjustMacroExpansionBufferName(*discriminator)); - break; - } } break; } @@ -1279,9 +1268,6 @@ std::optional swift::expandMacroExpr(MacroExpansionExpr *mee) { expandedExpr = new (ctx) CurrentContextIsolationExpr( macroBufferRange.getStart(), expandedType); break; - - case BuiltinMacroKind::SwiftSettingsMacro: - break; } } @@ -1500,7 +1486,6 @@ static SourceFile *evaluateAttachedMacro(MacroDecl *macro, Decl *attachedTo, switch (macroDef.getBuiltinKind()) { case BuiltinMacroKind::ExternalMacro: case BuiltinMacroKind::IsolationMacro: - case BuiltinMacroKind::SwiftSettingsMacro: // FIXME: Error here. return nullptr; } @@ -1653,7 +1638,6 @@ static SourceFile *evaluateAttachedMacro(MacroDecl *macro, switch (macroDef.getBuiltinKind()) { case BuiltinMacroKind::ExternalMacro: case BuiltinMacroKind::IsolationMacro: - case BuiltinMacroKind::SwiftSettingsMacro: // FIXME: Error here. return nullptr; } diff --git a/lib/Sema/TypeChecker.cpp b/lib/Sema/TypeChecker.cpp index 8ef68b61a254e..6f1dca8b6019e 100644 --- a/lib/Sema/TypeChecker.cpp +++ b/lib/Sema/TypeChecker.cpp @@ -283,10 +283,6 @@ TypeCheckPrimaryFileRequest::evaluate(Evaluator &eval, SourceFile *SF) const { // checking. (void)AvailabilityScope::getOrBuildForSourceFile(*SF); - // Before we type check any of the top level code decls, generate the per - // file language options. - (void)SF->getLanguageOptions(); - // Type check the top-level elements of the source file. for (auto D : SF->getTopLevelDecls()) { if (auto *TLCD = dyn_cast(D)) { diff --git a/lib/Serialization/Deserialization.cpp b/lib/Serialization/Deserialization.cpp index 12668a90ebd01..e00c099d3f225 100644 --- a/lib/Serialization/Deserialization.cpp +++ b/lib/Serialization/Deserialization.cpp @@ -5585,10 +5585,6 @@ class DeclDeserializer { builtinKind = BuiltinMacroKind::IsolationMacro; break; - case 3: - builtinKind = BuiltinMacroKind::SwiftSettingsMacro; - break; - default: break; } diff --git a/lib/Serialization/Serialization.cpp b/lib/Serialization/Serialization.cpp index 196e6dc6da9b9..adc4742aeb497 100644 --- a/lib/Serialization/Serialization.cpp +++ b/lib/Serialization/Serialization.cpp @@ -5189,9 +5189,6 @@ class Serializer::DeclSerializer : public DeclVisitor { case BuiltinMacroKind::IsolationMacro: builtinID = 2; break; - case BuiltinMacroKind::SwiftSettingsMacro: - builtinID = 3; - break; } break; } diff --git a/stdlib/public/Concurrency/Actor.swift b/stdlib/public/Concurrency/Actor.swift index c72fa895a7622..263783305006e 100644 --- a/stdlib/public/Concurrency/Actor.swift +++ b/stdlib/public/Concurrency/Actor.swift @@ -120,15 +120,6 @@ public macro Task( ) = #externalMacro(module: "SwiftMacros", type: "TaskMacro") -// NOTE: We put SwiftSetting under $Macro since #SwiftSettings() is a macro. -@available(SwiftStdlib 9999, *) -extension SwiftSetting { - /// Force the current module to use the passed in defaultIsolation instead of - /// the default isolation. - @available(SwiftStdlib 9999, *) - public static func defaultIsolation(_ actor: Actor.Type?) -> SwiftSetting { SwiftSetting() } -} - #endif #if $IsolatedAny diff --git a/stdlib/public/core/CMakeLists.txt b/stdlib/public/core/CMakeLists.txt index 50050feeca63d..3fe6ca201d234 100644 --- a/stdlib/public/core/CMakeLists.txt +++ b/stdlib/public/core/CMakeLists.txt @@ -57,7 +57,6 @@ split_embedded_sources( EMBEDDED CollectionAlgorithms.swift EMBEDDED Comparable.swift EMBEDDED CompilerProtocols.swift - EMBEDDED SwiftSettings.swift EMBEDDED Sendable.swift EMBEDDED ContiguousArray.swift EMBEDDED ContiguouslyStored.swift diff --git a/stdlib/public/core/GroupInfo.json b/stdlib/public/core/GroupInfo.json index f606571e3d01f..ab9f72243d030 100644 --- a/stdlib/public/core/GroupInfo.json +++ b/stdlib/public/core/GroupInfo.json @@ -269,8 +269,7 @@ "EmbeddedRuntime.swift", "EmbeddedStubs.swift", "EmbeddedPrint.swift", - "InlineArray.swift", - "SwiftSettings.swift" + "InlineArray.swift" ], "Result": [ "Result.swift" diff --git a/stdlib/public/core/SwiftSettings.swift b/stdlib/public/core/SwiftSettings.swift deleted file mode 100644 index 5db14ec144a0a..0000000000000 --- a/stdlib/public/core/SwiftSettings.swift +++ /dev/null @@ -1,27 +0,0 @@ -//===--- SwiftSettings.swift ----------------------------------------------===// -// -// This source file is part of the Swift.org open source project -// -// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors -// Licensed under Apache License v2.0 with Runtime Library Exception -// -// See https://swift.org/LICENSE.txt for license information -// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors -// -//===----------------------------------------------------------------------===// - -#if $Macros - -@available(SwiftStdlib 9999, *) -public struct SwiftSetting { - public init() { - fatalError("A SwiftSetting should never actually be constructed") - } -} - -@available(SwiftStdlib 9999, *) -@freestanding(declaration) -public macro SwiftSettings(_ settings: SwiftSetting...) = - Builtin.SwiftSettingsMacro - -#endif diff --git a/test/Concurrency/swiftsettings_defaultIsolation.swift b/test/Concurrency/swiftsettings_defaultIsolation.swift deleted file mode 100644 index 7ecb695a07722..0000000000000 --- a/test/Concurrency/swiftsettings_defaultIsolation.swift +++ /dev/null @@ -1,54 +0,0 @@ -// RUN: %target-swift-frontend -enable-experimental-feature SwiftSettings -c -verify -swift-version 6 -verify-additional-prefix nonisolated- -disable-availability-checking %s -// RUN: %target-swift-frontend -enable-experimental-feature SwiftSettings -c -verify -swift-version 6 -verify-additional-prefix main-actor- -disable-availability-checking -DSWIFT_SETTINGS_MAIN_ACTOR %s -// RUN: %target-swift-frontend -default-isolation MainActor -enable-experimental-feature SwiftSettings -c -verify -swift-version 6 -disable-availability-checking -verify-additional-prefix main-actor- %s -// RUN: %target-swift-frontend -default-isolation MainActor -enable-experimental-feature SwiftSettings -c -verify -swift-version 6 -disable-availability-checking -verify-additional-prefix nonisolated- -DSWIFT_SETTINGS_NONISOLATED %s - -// REQUIRES: asserts -// REQUIRES: concurrency -// REQUIRES: swift_feature_SwiftSettings - -#if SWIFT_SETTINGS_MAIN_ACTOR - -#SwiftSettings(.defaultIsolation(MainActor.self)) - -#endif - -#if SWIFT_SETTINGS_NONISOLATED - -#SwiftSettings(.defaultIsolation(nil)) - -#endif - -class UnspecifiedKlass {} -nonisolated class NonisolatedKlass {} - -func unspecifiedFunc(_ t: T) async {} -nonisolated func nonisolatedFunc(_ t: T) async {} -@MainActor func mainActorFunc(_ t: T) async {} - -func test1(_ x: UnspecifiedKlass) async { - await unspecifiedFunc(x) -} - -func test2(_ x: NonisolatedKlass) async { - await unspecifiedFunc(x) -} - -func test3(_ x: UnspecifiedKlass) async { - await nonisolatedFunc(x) -} - -func test4(_ x: NonisolatedKlass) async { - await nonisolatedFunc(x) // expected-main-actor-error {{sending 'x' risks causing data races}} - // expected-main-actor-note @-1 {{sending main actor-isolated 'x' to nonisolated global function 'nonisolatedFunc' risks causing data races between nonisolated and main actor-isolated uses}} -} - -func test5(_ x: UnspecifiedKlass) async { - await mainActorFunc(x) // expected-nonisolated-error {{sending 'x' risks causing data races}} - // expected-nonisolated-note @-1 {{sending task-isolated 'x' to main actor-isolated global function 'mainActorFunc' risks causing data races between main actor-isolated and task-isolated uses}} -} - -func test6(_ x: NonisolatedKlass) async { - await mainActorFunc(x) // expected-nonisolated-error {{sending 'x' risks causing data races}} - // expected-nonisolated-note @-1 {{sending task-isolated 'x' to main actor-isolated global function 'mainActorFunc' risks causing data races between main actor-isolated and task-isolated uses}} -} diff --git a/test/Sema/swiftsettings.swift b/test/Sema/swiftsettings.swift deleted file mode 100644 index fa230432358a0..0000000000000 --- a/test/Sema/swiftsettings.swift +++ /dev/null @@ -1,20 +0,0 @@ -// RUN: %target-swift-frontend -enable-experimental-feature SwiftSettings -enable-experimental-feature Macros -c -swift-version 6 -disable-availability-checking -verify -Xllvm -swift-settings-allow-duplicates %s - -// REQUIRES: asserts -// REQUIRES: concurrency -// REQUIRES: swift_feature_Macros -// REQUIRES: swift_feature_SwiftSettings - -actor MyActor {} - -#SwiftSettings(.defaultIsolation(MainActor.self)) -#SwiftSettings(.defaultIsolation(nil)) -#SwiftSettings(.defaultIsolation(MyActor.self)) // expected-error {{Unrecognized setting passed to #SwiftSettings}} -#SwiftSettings(.defaultIsolation(1)) // expected-error {{Unrecognized setting passed to #SwiftSettings}} -// expected-error @-1 {{cannot convert value of type 'Int' to expected argument type 'any Actor.Type'}} -#SwiftSettings(2) // expected-error {{Unrecognized setting passed to #SwiftSettings}} -// expected-error @-1 {{cannot convert value of type 'Int' to expected argument type 'SwiftSetting'}} - -#SwiftSettings(.defaultIsolation(MainActor.self), - .defaultIsolation(nil)) - diff --git a/test/Sema/swiftsettings_duplicates.swift b/test/Sema/swiftsettings_duplicates.swift deleted file mode 100644 index d55d251564905..0000000000000 --- a/test/Sema/swiftsettings_duplicates.swift +++ /dev/null @@ -1,24 +0,0 @@ -// RUN: %target-swift-frontend -enable-experimental-feature SwiftSettings -enable-experimental-feature Macros -c -swift-version 6 -disable-availability-checking -verify %s - -// REQUIRES: asserts -// REQUIRES: concurrency -// REQUIRES: swift_feature_Macros -// REQUIRES: swift_feature_SwiftSettings - -// This test specifically tests the behavior of #SwiftSettings when we find -// multiple instances of the same setting. - -actor MyActor {} - -#SwiftSettings(.defaultIsolation(MainActor.self), // expected-note 6 {{setting originally passed here}} - .defaultIsolation(nil)) // expected-error {{duplicate setting passed to #SwiftSettings}} -#SwiftSettings(.defaultIsolation(nil)) // expected-error {{duplicate setting passed to #SwiftSettings}} -#SwiftSettings(.defaultIsolation(MyActor.self)) // expected-error {{duplicate setting passed to #SwiftSettings}} -#SwiftSettings(.defaultIsolation(1)) // expected-error {{duplicate setting passed to #SwiftSettings}} -// expected-error @-1 {{cannot convert value of type 'Int' to expected argument type 'any Actor.Type'}} -#SwiftSettings(2) // expected-error {{Unrecognized setting passed to #SwiftSettings}} -// expected-error @-1 {{cannot convert value of type 'Int' to expected argument type 'SwiftSetting'}} - -#SwiftSettings(.defaultIsolation(MainActor.self), // expected-error {{duplicate setting passed to #SwiftSettings}} - .defaultIsolation(nil)) // expected-error {{duplicate setting passed to #SwiftSettings}} - diff --git a/test/abi/macOS/arm64/concurrency.swift b/test/abi/macOS/arm64/concurrency.swift index d2d8c407be7a0..9607cdcbcc647 100644 --- a/test/abi/macOS/arm64/concurrency.swift +++ b/test/abi/macOS/arm64/concurrency.swift @@ -415,9 +415,6 @@ Added: _$sScf25isIsolatingCurrentContextSbSgyFTq // CoroutineAccessors Added: _swift_task_dealloc_through -// SwiftSettings -Added: _$ss12SwiftSettingVsE16defaultIsolationyABScA_pXpSgFZ - // Clock systemEpochs Added: _$ss15ContinuousClockV11systemEpochAB7InstantVvpMV Added: _$ss15SuspendingClockV11systemEpochAB7InstantVvpMV diff --git a/test/abi/macOS/arm64/stdlib.swift b/test/abi/macOS/arm64/stdlib.swift index 3d4e5e4fd98d0..1e8c39edcaa35 100644 --- a/test/abi/macOS/arm64/stdlib.swift +++ b/test/abi/macOS/arm64/stdlib.swift @@ -1064,12 +1064,6 @@ Added: _swift_ConformanceExecutionContextSize Added: _swift_conformsToProtocolWithExecutionContext Added: _swift_isInConformanceExecutionContext -// Swift Settings -Added: _$ss12SwiftSettingVABycfC -Added: _$ss12SwiftSettingVMa -Added: _$ss12SwiftSettingVMn -Added: _$ss12SwiftSettingVN - // EnumeratedSequence Collection conformances Added: _$ss18EnumeratedSequenceVyxGSksSkRzrlMc Added: _$ss18EnumeratedSequenceVyxGSlsSlRzrlMc diff --git a/test/abi/macOS/x86_64/concurrency.swift b/test/abi/macOS/x86_64/concurrency.swift index 4d89a93fed3f0..7b5e584daa698 100644 --- a/test/abi/macOS/x86_64/concurrency.swift +++ b/test/abi/macOS/x86_64/concurrency.swift @@ -415,9 +415,6 @@ Added: _$sScf25isIsolatingCurrentContextSbSgyFTq // CoroutineAccessors Added: _swift_task_dealloc_through -// SwiftSettings -Added: _$ss12SwiftSettingVsE16defaultIsolationyABScA_pXpSgFZ - // Clock systemEpochs Added: _$ss15ContinuousClockV11systemEpochAB7InstantVvpMV Added: _$ss15SuspendingClockV11systemEpochAB7InstantVvpMV diff --git a/test/abi/macOS/x86_64/stdlib.swift b/test/abi/macOS/x86_64/stdlib.swift index 0ef169daa4121..ea0cdc82b5da4 100644 --- a/test/abi/macOS/x86_64/stdlib.swift +++ b/test/abi/macOS/x86_64/stdlib.swift @@ -1064,12 +1064,6 @@ Added: _swift_ConformanceExecutionContextSize Added: _swift_conformsToProtocolWithExecutionContext Added: _swift_isInConformanceExecutionContext -// Swift Settings -Added: _$ss12SwiftSettingVABycfC -Added: _$ss12SwiftSettingVMa -Added: _$ss12SwiftSettingVMn -Added: _$ss12SwiftSettingVN - // EnumeratedSequence Collection conformances Added: _$ss18EnumeratedSequenceVyxGSksSkRzrlMc Added: _$ss18EnumeratedSequenceVyxGSlsSlRzrlMc From 24fa9c8703111d788aeb4f385267e5810d198a66 Mon Sep 17 00:00:00 2001 From: Allan Shortlidge Date: Fri, 2 May 2025 10:47:33 -0700 Subject: [PATCH 30/51] ClangImporter: Introduce the #ClangDeclarationImport diagnostic group. The warnings that ClangImporter emits about issues it encounters while importing declarations from Clang modules should all belong to a diagnostic group so that users of `-warnings-as-errors` can control their behavior using the compiler flags introduce with SE-0443. It's especially important that these diagnostics be controllable since they are often caused by external dependencies and therefore the developer may not have any control over whether they are emitted. The `#ClangDeclarationImport` diagnostic group is intentionally broad so that developers have a way to control all of these diagnostics with a single `-Wwarning` flag. I fully expect that we'll introduce finer-grained diagnostic groups for some of these diagnostics in the future, but those groups should be hierarchically nested under `#ClangDeclarationImport`, which is supported by SE-0443. Resolves rdar://150524204. --- include/swift/AST/DiagnosticGroups.def | 3 +- .../swift/AST/DiagnosticsClangImporter.def | 42 ++++++++++--------- .../Inputs/custom-modules/ImportAsMember.h | 4 +- test/ClangImporter/attr-swift_name.swift | 6 +-- test/ClangImporter/duplicate_mainactor.swift | 4 +- test/IDE/print_omit_needless_words.swift | 2 +- .../Cxx/class/nonescapable-errors.swift | 12 +++--- .../cxx-functions-and-methods-returning-frt.h | 2 +- .../diagnostics/clang-declaration-import.md | 17 ++++++++ 9 files changed, 57 insertions(+), 35 deletions(-) create mode 100644 userdocs/diagnostics/clang-declaration-import.md diff --git a/include/swift/AST/DiagnosticGroups.def b/include/swift/AST/DiagnosticGroups.def index c70f391876631..c4607c53ccfe7 100644 --- a/include/swift/AST/DiagnosticGroups.def +++ b/include/swift/AST/DiagnosticGroups.def @@ -41,7 +41,7 @@ GROUP(no_group, "") GROUP(ActorIsolatedCall, "actor-isolated-call") -GROUP(NonisolatedNonsendingByDefault, "nonisolated-nonsending-by-default") +GROUP(ClangDeclarationImport, "clang-declaration-import") GROUP(ConformanceIsolation, "conformance-isolation") GROUP(DeprecatedDeclaration, "deprecated-declaration") GROUP(DynamicCallable, "dynamic-callable-requirements") @@ -52,6 +52,7 @@ GROUP(IsolatedConformances, "isolated-conformances") GROUP(MultipleInheritance, "multiple-inheritance") GROUP(MutableGlobalVariable, "mutable-global-variable") GROUP(NominalTypes, "nominal-types") +GROUP(NonisolatedNonsendingByDefault, "nonisolated-nonsending-by-default") GROUP(OpaqueTypeInference, "opaque-type-inference") GROUP(PreconcurrencyImport, "preconcurrency-import") GROUP(PropertyWrappers, "property-wrapper-requirements") diff --git a/include/swift/AST/DiagnosticsClangImporter.def b/include/swift/AST/DiagnosticsClangImporter.def index 5fdf7a41560f6..20a1374901287 100644 --- a/include/swift/AST/DiagnosticsClangImporter.def +++ b/include/swift/AST/DiagnosticsClangImporter.def @@ -51,10 +51,10 @@ ERROR(emit_pcm_error,Fatal, ERROR(dump_pcm_error,Fatal, "failed to dump precompiled module '%0'", (StringRef)) -WARNING(invalid_swift_name_method,none, +GROUPED_WARNING(invalid_swift_name_method, ClangDeclarationImport, none, "too %select{few|many}0 parameters in swift_name attribute (expected %1; " "got %2)", (bool, unsigned, unsigned)) -WARNING(invalid_swift_name_for_decl,none, +GROUPED_WARNING(invalid_swift_name_for_decl, ClangDeclarationImport, none, "custom Swift name '%0' ignored because it is not valid for %kindonly1; " "imported as %1 instead", (StringRef, ValueDecl *)) @@ -67,20 +67,20 @@ ERROR(swift_name_protocol_static, none, "swift_name cannot be used to define " ERROR(swift_name_no_prototype, none, "swift_name cannot be used on a non-prototyped function declaration", ()) -WARNING(inconsistent_swift_name,none, +GROUPED_WARNING(inconsistent_swift_name, ClangDeclarationImport, none, "inconsistent Swift name for Objective-C %select{method|property}0 " "'%1' in '%2' (%3 in '%4' vs. %5 in '%6')", (bool, StringRef, StringRef, DeclName, StringRef, DeclName, StringRef)) -WARNING(swift_name_circular_context_import,none, +GROUPED_WARNING(swift_name_circular_context_import, ClangDeclarationImport, none, "cycle detected while resolving '%0' in swift_name attribute for '%1'", (StringRef, StringRef)) NOTE(swift_name_circular_context_import_other,none, "while resolving '%0' in swift_name attribute for '%1'", (StringRef, StringRef)) -WARNING(unresolvable_clang_decl,none, +GROUPED_WARNING(unresolvable_clang_decl, ClangDeclarationImport, none, "imported declaration '%0' could not be mapped to '%1'", (StringRef, StringRef)) @@ -88,14 +88,14 @@ NOTE(unresolvable_clang_decl_is_a_framework_bug,none, "please report this issue to the owners of '%0'", (StringRef)) -WARNING(clang_swift_attr_unhandled,none, +GROUPED_WARNING(clang_swift_attr_unhandled, ClangDeclarationImport, none, "ignoring unknown Swift attribute or modifier '%0'", (StringRef)) -WARNING(clang_error_code_must_be_sendable,none, +GROUPED_WARNING(clang_error_code_must_be_sendable, ClangDeclarationImport, none, "cannot make error code type '%0' non-sendable because Swift errors " "are always sendable", (StringRef)) -WARNING(clang_ignored_sendable_attr,none, +GROUPED_WARNING(clang_ignored_sendable_attr, ClangDeclarationImport, none, "cannot make type %0 sendable because '@Sendable' and '& Sendable' " "cannot be added to it", (Type)) @@ -108,18 +108,18 @@ WARNING(implicit_bridging_header_imported_from_module,none, "is deprecated and will be removed in a later version of Swift", (StringRef, Identifier)) -WARNING(import_multiple_mainactor_attr,none, +GROUPED_WARNING(import_multiple_mainactor_attr, ClangDeclarationImport, none, "this attribute for global actor '%0' is invalid; the declaration already has attribute for global actor '%1'", (StringRef, StringRef)) -WARNING(contradicting_mutation_attrs,none, +GROUPED_WARNING(contradicting_mutation_attrs, ClangDeclarationImport, none, "attribute '%0' is ignored when combined with attribute '%1'", (StringRef, StringRef)) -WARNING(nonmutating_without_const,none, +GROUPED_WARNING(nonmutating_without_const, ClangDeclarationImport, none, "attribute 'nonmutating' has no effect on non-const method", ()) -WARNING(nonmutating_without_mutable_fields,none, +GROUPED_WARNING(nonmutating_without_mutable_fields, ClangDeclarationImport, none, "attribute 'nonmutating' has no effect without any mutable fields", ()) ERROR(module_map_not_found, none, "module map file '%0' not found", (StringRef)) @@ -135,7 +135,7 @@ WARNING(libstdcxx_modulemap_not_found, none, "module map for libstdc++ not found for '%0'; C++ stdlib may be unavailable", (StringRef)) -WARNING(api_pattern_attr_ignored, none, +GROUPED_WARNING(api_pattern_attr_ignored, ClangDeclarationImport, none, "'%0' Swift attribute ignored on type '%1': type is not copyable or destructible", (StringRef, StringRef)) @@ -226,7 +226,7 @@ ERROR(private_fileid_attr_repeated, none, NOTE(private_fileid_attr_here, none, "SWIFT_PRIVATE_FILEID annotation found here", ()) - WARNING(private_fileid_attr_format_invalid, none, + GROUPED_WARNING(private_fileid_attr_format_invalid, ClangDeclarationImport, none, "SWIFT_PRIVATE_FILEID annotation on '%0' does not have a valid file ID", (StringRef)) REMARK(private_fileid_attr_format_specification, none, @@ -306,12 +306,12 @@ ERROR(returns_retained_or_returns_unretained_for_non_cxx_frt_values, none, // TODO: In the next C++ interop version, convert this warning into an error and // stop importing unannotated C++ APIs that return SWIFT_SHARED_REFERENCE. // rdar://138806722 -WARNING(no_returns_retained_returns_unretained, none, +GROUPED_WARNING(no_returns_retained_returns_unretained, ClangDeclarationImport, none, "%0 should be annotated with either SWIFT_RETURNS_RETAINED or " "SWIFT_RETURNS_UNRETAINED as it is returning a SWIFT_SHARED_REFERENCE", (const clang::NamedDecl *)) -WARNING(returns_retained_returns_unretained_on_overloaded_operator, none, +GROUPED_WARNING(returns_retained_returns_unretained_on_overloaded_operator, ClangDeclarationImport, none, "SWIFT_RETURNS_RETAINED and SWIFT_RETURNS_UNRETAINED is not supported " "yet for overloaded C++ %0. Overloaded C++ operators always " "return " @@ -322,7 +322,7 @@ WARNING(returns_retained_returns_unretained_on_overloaded_operator, none, // stop importing C++ types that inherit from SWIFT_SHARED_REFERENCE if the // Swift compiler cannot find unique retain/release functions. // rdar://145194375 -WARNING(cant_infer_frt_in_cxx_inheritance, none, +GROUPED_WARNING(cant_infer_frt_in_cxx_inheritance, ClangDeclarationImport, none, "unable to infer SWIFT_SHARED_REFERENCE for %0, although one of its " "transitive base types is marked as SWIFT_SHARED_REFERENCE", (const clang::NamedDecl *)) @@ -355,8 +355,12 @@ NOTE(forward_declared_protocol_clashes_with_imported_objc_Swift_protocol, none, "its name conflicts with a %1 in module %2", (const clang::NamedDecl*, StringRef, StringRef)) -WARNING(return_escapable_with_lifetimebound, none, "the returned type '%0' is annotated as escapable; it cannot have lifetime dependencies", (StringRef)) -WARNING(return_nonescapable_without_lifetimebound, none, "the returned type '%0' is annotated as non-escapable; its lifetime dependencies must be annotated", (StringRef)) +GROUPED_WARNING(return_escapable_with_lifetimebound, ClangDeclarationImport, none, + "the returned type '%0' is annotated as escapable; it cannot have lifetime dependencies", + (StringRef)) +GROUPED_WARNING(return_nonescapable_without_lifetimebound, ClangDeclarationImport, none, + "the returned type '%0' is annotated as non-escapable; its lifetime dependencies must be annotated", + (StringRef)) ERROR(unknown_template_parameter,none, "template parameter '%0' does not exist", (StringRef)) diff --git a/test/ClangImporter/Inputs/custom-modules/ImportAsMember.h b/test/ClangImporter/Inputs/custom-modules/ImportAsMember.h index b3897bafe3f62..ef91710530241 100644 --- a/test/ClangImporter/Inputs/custom-modules/ImportAsMember.h +++ b/test/ClangImporter/Inputs/custom-modules/ImportAsMember.h @@ -70,8 +70,8 @@ typedef float MNInnerFloat __attribute__((swift_name("IAMMultipleNested.Inner")) typedef int IAMBadInnerInt __attribute__((swift_name("IAMNonexistent.Inner"))); -// CHECK: ImportAsMember.h:[[@LINE-1]]:{{[0-9]+}}: warning: imported declaration 'IAMBadInnerInt' could not be mapped to 'IAMNonexistent.Inner' -// CHECK: note: please report this issue to the owners of 'ImportAsMember' +// CHECK: ImportAsMember.h:[[@LINE-1]]:{{[0-9]+}}: warning: imported declaration 'IAMBadInnerInt' could not be mapped to 'IAMNonexistent.Inner' [#ClangDeclarationImport] +// CHECK: note: please report this issue to the owners of 'ImportAsMember' [#ClangDeclarationImport] typedef int IAMBadInnerIntAPINotes; // CHECK: ImportAsMember.h:[[@LINE-1]]:{{[0-9]+}}: warning: imported declaration 'IAMBadInnerIntAPINotes' could not be mapped to 'IAMNonexistent.Inner2' // CHECK: note: please report this issue to the owners of 'ImportAsMember' diff --git a/test/ClangImporter/attr-swift_name.swift b/test/ClangImporter/attr-swift_name.swift index aae82c80c9950..29361fe5e1041 100644 --- a/test/ClangImporter/attr-swift_name.swift +++ b/test/ClangImporter/attr-swift_name.swift @@ -20,19 +20,19 @@ func test(_ i: Int) { // We only see these five warnings because Clang can catch the other invalid // cases, and marks the attribute as invalid ahead of time. - // CHECK: warning: too few parameters in swift_name attribute (expected 2; got 1) + // CHECK: warning: too few parameters in swift_name attribute (expected 2; got 1) [#ClangDeclarationImport] // CHECK: + (instancetype)g:(id)x outParam:(int *)foo SWIFT_NAME(init(g:)); // CHECK-NOT: warning: // CHECK: note: please report this issue to the owners of 'ObjCIRExtras' // CHECK-NOT: warning: - // CHECK: warning: cycle detected while resolving 'CircularName' in swift_name attribute for 'CircularName' + // CHECK: warning: cycle detected while resolving 'CircularName' in swift_name attribute for 'CircularName' [#ClangDeclarationImport] // CHECK: SWIFT_NAME(CircularName.Inner) @interface CircularName : NSObject @end // CHECK-NOT: {{warning|note}}: // CHECK: note: please report this issue to the owners of 'ObjCIRExtras' // CHECK-NOT: warning: - // CHECK: warning: cycle detected while resolving 'MutuallyCircularNameB' in swift_name attribute for 'MutuallyCircularNameA' + // CHECK: warning: cycle detected while resolving 'MutuallyCircularNameB' in swift_name attribute for 'MutuallyCircularNameA' [#ClangDeclarationImport] // CHECK: SWIFT_NAME(MutuallyCircularNameB.Inner) @interface MutuallyCircularNameA : NSObject @end // CHECK-NOT: {{warning|note}}: // CHECK: note: while resolving 'MutuallyCircularNameA' in swift_name attribute for 'MutuallyCircularNameB' diff --git a/test/ClangImporter/duplicate_mainactor.swift b/test/ClangImporter/duplicate_mainactor.swift index 9ae0e6cb68388..e891dcae6b0d3 100644 --- a/test/ClangImporter/duplicate_mainactor.swift +++ b/test/ClangImporter/duplicate_mainactor.swift @@ -5,6 +5,6 @@ // REQUIRES: concurrency // REQUIRES: objc_interop -// CHECK: DoubleMainActor.h:{{[0-9]+}}:{{[0-9]+}}: warning: this attribute for global actor '@MainActor' is invalid; the declaration already has attribute for global actor '@UIActor' +// CHECK: DoubleMainActor.h:{{[0-9]+}}:{{[0-9]+}}: warning: this attribute for global actor '@MainActor' is invalid; the declaration already has attribute for global actor '@UIActor' [#ClangDeclarationImport] -protocol P : DoubleMainActor {} \ No newline at end of file +protocol P : DoubleMainActor {} diff --git a/test/IDE/print_omit_needless_words.swift b/test/IDE/print_omit_needless_words.swift index 4a73c02eba132..924b65a1fa03a 100644 --- a/test/IDE/print_omit_needless_words.swift +++ b/test/IDE/print_omit_needless_words.swift @@ -314,7 +314,7 @@ // CHECK-OMIT-NEEDLESS-WORDS-NEXT: @available(swift, obsoleted: 3, renamed: "veryCarefullyBurn()") // CHECK-OMIT-NEEDLESS-WORDS-NEXT: func veryCarefullyBurnGarbage4DTypeRefMask_t() -// CHECK-OMIT-NEEDLESS-WORDS-DIAGS: inconsistent Swift name for Objective-C property 'conflictingProp1' in 'OMWSub' ('waggleProp1' in 'OMWWaggle' vs. 'wiggleProp1' in 'OMWSuper') +// CHECK-OMIT-NEEDLESS-WORDS-DIAGS: inconsistent Swift name for Objective-C property 'conflictingProp1' in 'OMWSub' ('waggleProp1' in 'OMWWaggle' vs. 'wiggleProp1' in 'OMWSuper') [#ClangDeclarationImport] // Don't drop the 'error'. // CHECK-ERRORS: func tryAndReturnError(_: ()) throws diff --git a/test/Interop/Cxx/class/nonescapable-errors.swift b/test/Interop/Cxx/class/nonescapable-errors.swift index dee07d54e7ece..0dcc7e88e7635 100644 --- a/test/Interop/Cxx/class/nonescapable-errors.swift +++ b/test/Interop/Cxx/class/nonescapable-errors.swift @@ -111,16 +111,16 @@ public func importInvalid(_ x: Invalid) { // CHECK: error: a function with a ~Escapable result needs a parameter to depend on // CHECK-NO-LIFETIMES: test.swift:11:32: error: a function with a ~Escapable result requires '-enable-experimental-feature LifetimeDependence' public func noAnnotations() -> View { - // CHECK: nonescapable.h:16:7: warning: the returned type 'Owner' is annotated as escapable; it cannot have lifetime dependencies - // CHECK-NO-LIFETIMES: nonescapable.h:16:7: warning: the returned type 'Owner' is annotated as escapable; it cannot have lifetime dependencies + // CHECK: nonescapable.h:16:7: warning: the returned type 'Owner' is annotated as escapable; it cannot have lifetime dependencies [#ClangDeclarationImport] + // CHECK-NO-LIFETIMES: nonescapable.h:16:7: warning: the returned type 'Owner' is annotated as escapable; it cannot have lifetime dependencies [#ClangDeclarationImport] f(nil) - // CHECK: nonescapable.h:20:7: warning: the returned type 'Owner' is annotated as escapable; it cannot have lifetime dependencies - // CHECK-NO-LIFETIMES: nonescapable.h:20:7: warning: the returned type 'Owner' is annotated as escapable; it cannot have lifetime dependencies + // CHECK: nonescapable.h:20:7: warning: the returned type 'Owner' is annotated as escapable; it cannot have lifetime dependencies [#ClangDeclarationImport] + // CHECK-NO-LIFETIMES: nonescapable.h:20:7: warning: the returned type 'Owner' is annotated as escapable; it cannot have lifetime dependencies [#ClangDeclarationImport] // No duplicate warning for f2: // CHECK-NOT: nonescapable.h:20 f2(nil, nil) - // CHECK: nonescapable.h:24:6: warning: the returned type 'View' is annotated as non-escapable; its lifetime dependencies must be annotated - // CHECK-NO-LIFETIMES: nonescapable.h:24:6: warning: the returned type 'View' is annotated as non-escapable; its lifetime dependencies must be annotated + // CHECK: nonescapable.h:24:6: warning: the returned type 'View' is annotated as non-escapable; its lifetime dependencies must be annotated [#ClangDeclarationImport] + // CHECK-NO-LIFETIMES: nonescapable.h:24:6: warning: the returned type 'View' is annotated as non-escapable; its lifetime dependencies must be annotated [#ClangDeclarationImport] // CHECK-NO-LIFETIMES: nonescapable.h:24:6: error: a function with a ~Escapable result requires '-enable-experimental-feature LifetimeDependence' g(nil) h1(nil) diff --git a/test/Interop/Cxx/foreign-reference/Inputs/cxx-functions-and-methods-returning-frt.h b/test/Interop/Cxx/foreign-reference/Inputs/cxx-functions-and-methods-returning-frt.h index e81c918a62766..41e91326feee9 100644 --- a/test/Interop/Cxx/foreign-reference/Inputs/cxx-functions-and-methods-returning-frt.h +++ b/test/Interop/Cxx/foreign-reference/Inputs/cxx-functions-and-methods-returning-frt.h @@ -179,7 +179,7 @@ __attribute__((swift_attr("unsafe"))); // C++ APIs returning cxx frts (for testing diagnostics) struct StructWithAPIsReturningCxxFrt { - static FRTStruct *_Nonnull StaticMethodReturningCxxFrt(); // expected-warning {{'StaticMethodReturningCxxFrt' should be annotated with either SWIFT_RETURNS_RETAINED or SWIFT_RETURNS_UNRETAINED as it is returning a SWIFT_SHARED_REFERENCE}} + static FRTStruct *_Nonnull StaticMethodReturningCxxFrt(); // expected-warning {{'StaticMethodReturningCxxFrt' should be annotated with either SWIFT_RETURNS_RETAINED or SWIFT_RETURNS_UNRETAINED as it is returning a SWIFT_SHARED_REFERENCE}} static FRTStruct *_Nonnull StaticMethodReturningCxxFrtWithAnnotation() __attribute__((swift_attr("returns_retained"))); }; diff --git a/userdocs/diagnostics/clang-declaration-import.md b/userdocs/diagnostics/clang-declaration-import.md new file mode 100644 index 0000000000000..01a0c82613d4b --- /dev/null +++ b/userdocs/diagnostics/clang-declaration-import.md @@ -0,0 +1,17 @@ +# Imported Clang Declaration Warnings (`ClangDeclarationImport`) + + +This diagnostic group covers all warnings related to malformed APIs that are imported into Swift from C, C++, and Obj-C headers. + +As one example of a potential malformed API diagnostic, suppose a Clang module dependency contained the following declaration: + +``` +typedef int NotificationIdentifier + __attribute__((swift_name("Notification.Identifier"))) +``` + +The Swift compiler would emit the following warning if no type named `Notification` could be found: + +``` +warning: imported declaration 'NotificationIdentifier' could not be mapped to 'Notification.Identifier’ +``` From d24aa0952d72fbcb35fd89f48bb168b8b0c00dcb Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Mon, 5 May 2025 15:15:11 -0700 Subject: [PATCH 31/51] Disable conformance isolation inference for @preconcurrency conformances --- lib/Sema/TypeCheckConcurrency.cpp | 4 ++++ .../isolated_conformance_inference.swift | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/Sema/TypeCheckConcurrency.cpp b/lib/Sema/TypeCheckConcurrency.cpp index c1bf985cf4720..9b744f37c70d8 100644 --- a/lib/Sema/TypeCheckConcurrency.cpp +++ b/lib/Sema/TypeCheckConcurrency.cpp @@ -7958,6 +7958,10 @@ ConformanceIsolationRequest::evaluate(Evaluator &evaluator, ProtocolConformance if (getActorIsolation(rootNormal->getProtocol()).isActorIsolated()) return ActorIsolation::forNonisolated(false); + // @preconcurrency disables isolation inference. + if (rootNormal->isPreconcurrency()) + return ActorIsolation::forNonisolated(false); + // Isolation inference rules follow. If we aren't inferring isolated conformances, // we're done. if (!ctx.LangOpts.hasFeature(Feature::InferIsolatedConformances)) diff --git a/test/Concurrency/isolated_conformance_inference.swift b/test/Concurrency/isolated_conformance_inference.swift index 5389e88314197..e73591be5ea04 100644 --- a/test/Concurrency/isolated_conformance_inference.swift +++ b/test/Concurrency/isolated_conformance_inference.swift @@ -47,7 +47,21 @@ nonisolated class CNonIsolated: P { func acceptSendablePMeta(_: T.Type) { } func acceptSendableQMeta(_: T.Type) { } -nonisolated func testConformancesFromNonisolated() { +// @preconcurrency suppresses actor isolation inference +struct NotSendable: Equatable, Hashable { +} + +@available(*, unavailable) +extension NotSendable: Sendable {} + +extension NotSendable : Codable {} + +@MainActor +struct TestDerivedCodable : @preconcurrency Codable { + var x: NotSendable +} + +nonisolated func testConformancesFromNonisolated(tdc: TestDerivedCodable) { let _: any P = CExplicit() // expected-error{{global actor 'SomeGlobalActor'-isolated conformance of 'CExplicit' to 'P' cannot be used in nonisolated context}} let _: any P = CNonIsolated() @@ -56,4 +70,6 @@ nonisolated func testConformancesFromNonisolated() { let _: any Q = CExplicit() let _: any P = CViaNonisolatedWitness() + + let _: any Codable = tdc } From 4436e942aed6573f8a5b92a098a5ab92fa242030 Mon Sep 17 00:00:00 2001 From: Andrew Trick Date: Mon, 5 May 2025 10:16:06 -0700 Subject: [PATCH 32/51] [NFC] fix a comment typo in LifetimeDependence --- lib/AST/LifetimeDependence.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/AST/LifetimeDependence.cpp b/lib/AST/LifetimeDependence.cpp index 566aabdb53ffe..e8bce0b005446 100644 --- a/lib/AST/LifetimeDependence.cpp +++ b/lib/AST/LifetimeDependence.cpp @@ -1132,8 +1132,8 @@ class LifetimeDependenceChecker { // The 'newValue' dependence kind must match the getter's dependence kind // because generated the implementation '_modify' accessor composes the // getter's result with the setter's 'newValue'. In particular, if the - // result type is non-Escapable then the setter must not depend on - // 'newValue'. + // result type is Escapable then the getter does not have any lifetime + // dependency, so the setter cannot depend on 'newValue'. if (!paramTypeInContext->isEscapable()) { targetDeps = std::move(targetDeps) .add(newValIdx, LifetimeDependenceKind::Inherit); From 170c563b00097f5d145bcb6d83c08b4768b6d31d Mon Sep 17 00:00:00 2001 From: Andrew Trick Date: Mon, 5 May 2025 14:52:26 -0700 Subject: [PATCH 33/51] [NFC] cleanup Instruction/Value.findVarDecl() APIs. These APIs are quite convoluted. The checks for var_decl need to be performed in just the right order. The is a consequence of complexity in the SIL representation itself, not a problem with the APIs. It is common for code to accidentally call a less-complete form of the API. It is essential that they be defined in a central location, and the we get the same answer whether we start with an Instruction, Argument, or Value. The primary public interface should always check for debug_value users. The varDecl property is actually an implementation detail. It is questionable whether a function like findVarDecl() that returns a basic property of SIL and does not require arguments should be a property instead. It is a function to hint that it may scan the use-list, which is not something we normally want SIL properties to do. Use-lists can grow linearly in function size. But, again, this is a natural result of the SIL representation and needs to be considered an implementation detail. --- .../LifetimeDependenceDiagnostics.swift | 2 +- .../Sources/SIL/Argument.swift | 6 ++-- .../Sources/SIL/Instruction.swift | 30 +++++++++---------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceDiagnostics.swift b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceDiagnostics.swift index ddf3c3ffc2cc3..f0d4bd63c6c7c 100644 --- a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceDiagnostics.swift +++ b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceDiagnostics.swift @@ -342,7 +342,7 @@ private struct LifetimeVariable { private init(introducer: Value, _ context: some Context) { if let arg = introducer as? FunctionArgument { - self.varDecl = arg.varDecl + self.varDecl = arg.findVarDecl() self.sourceLoc = arg.sourceLoc self.isArgument = true self.isClosureCapture = arg.isClosureCapture diff --git a/SwiftCompilerSources/Sources/SIL/Argument.swift b/SwiftCompilerSources/Sources/SIL/Argument.swift index 0620e99179f41..9106c881bc437 100644 --- a/SwiftCompilerSources/Sources/SIL/Argument.swift +++ b/SwiftCompilerSources/Sources/SIL/Argument.swift @@ -34,14 +34,14 @@ public class Argument : Value, Hashable { public var isLexical: Bool { false } - public var varDecl: VarDecl? { + public func findVarDecl() -> VarDecl? { if let varDecl = bridged.getVarDecl().getAs(VarDecl.self) { return varDecl } - return debugUserDecl + return findVarDeclFromDebugUsers() } - public var sourceLoc: SourceLoc? { varDecl?.nameLoc } + public var sourceLoc: SourceLoc? { findVarDecl()?.nameLoc } public static func ==(lhs: Argument, rhs: Argument) -> Bool { lhs === rhs diff --git a/SwiftCompilerSources/Sources/SIL/Instruction.swift b/SwiftCompilerSources/Sources/SIL/Instruction.swift index 1acd690a8e4df..6e3aafe647875 100644 --- a/SwiftCompilerSources/Sources/SIL/Instruction.swift +++ b/SwiftCompilerSources/Sources/SIL/Instruction.swift @@ -450,17 +450,17 @@ public enum VariableScopeInstruction { scopeBegin.uses.lazy.filter { $0.endsLifetime || $0.instruction is ExtendLifetimeInst } } - // TODO: with SIL verification, we might be able to make varDecl non-Optional. - public var varDecl: VarDecl? { - if let debugVarDecl = instruction.debugResultDecl { - return debugVarDecl - } + // TODO: assert that VarDecl is valid whenever isFromVarDecl returns tyue. + public func findVarDecl() -> VarDecl? { // SILGen may produce double var_decl instructions for the same variable: // %box = alloc_box [var_decl] "x" // begin_borrow %box [var_decl] // - // Assume that, if the begin_borrow or move_value does not have its own debug_value, then it must actually be - // associated with its operand's var_decl. + // Therefore, first check if begin_borrow or move_value has any debug_value users. + if let debugVarDecl = instruction.findVarDeclFromDebugUsers() { + return debugVarDecl + } + // Otherwise, assume that the var_decl is associated with its operand's var_decl. return instruction.operands[0].value.definingInstruction?.findVarDecl() } } @@ -472,14 +472,14 @@ extension Instruction { return varDeclInst.varDecl } if let varScopeInst = VariableScopeInstruction(self) { - return varScopeInst.varDecl + return varScopeInst.findVarDecl() } - return debugResultDecl + return findVarDeclFromDebugUsers() } - var debugResultDecl: VarDecl? { + func findVarDeclFromDebugUsers() -> VarDecl? { for result in results { - if let varDecl = result.debugUserDecl { + if let varDecl = result.findVarDeclFromDebugUsers() { return varDecl } } @@ -488,14 +488,14 @@ extension Instruction { } extension Value { - var debugValDecl: VarDecl? { + public func findVarDecl() -> VarDecl? { if let arg = self as? Argument { - return arg.varDecl + return arg.findVarDecl() } - return debugUserDecl + return findVarDeclFromDebugUsers() } - var debugUserDecl: VarDecl? { + func findVarDeclFromDebugUsers() -> VarDecl? { for use in uses { if let debugVal = use.instruction as? DebugValueInst { return debugVal.varDecl From 77a8b39806a0b3825092632d7ea9c8c43fcfd6b5 Mon Sep 17 00:00:00 2001 From: Andrew Trick Date: Mon, 5 May 2025 21:11:17 -0700 Subject: [PATCH 34/51] [NFC] remove FIXMEs from test/SILOptimizer/Inputs/SpanExtras.swift OutputSpan APIs generally work now. --- test/SILOptimizer/Inputs/SpanExtras.swift | 144 +++++++++++++--------- 1 file changed, 86 insertions(+), 58 deletions(-) diff --git a/test/SILOptimizer/Inputs/SpanExtras.swift b/test/SILOptimizer/Inputs/SpanExtras.swift index 881ac3d998b26..b13176a092fac 100644 --- a/test/SILOptimizer/Inputs/SpanExtras.swift +++ b/test/SILOptimizer/Inputs/SpanExtras.swift @@ -280,20 +280,6 @@ extension MutableSpan where Element: ~Copyable { } } -@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, visionOS 9999, *) -extension MutableSpan where Element: BitwiseCopyable { - - /// Construct a RawSpan over the memory represented by this span - /// - /// - Returns: a RawSpan over the memory represented by this span - @unsafe //FIXME: remove when the lifetime inference is fixed - @_alwaysEmitIntoClient - public var _unsafeRawSpan: RawSpan { - @lifetime(borrow self) - get { RawSpan(_unsafeMutableSpan: self) } - } -} - @available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, visionOS 9999, *) extension MutableSpan where Element: ~Copyable { @@ -687,11 +673,91 @@ public struct OutputSpan: ~Copyable, ~Escapable { extension OutputSpan: Sendable {} @available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, visionOS 9999, *) -extension OutputSpan where Element: ~Copyable { +extension OutputSpan where Element: ~Copyable { + @unsafe + @_alwaysEmitIntoClient + @lifetime(borrow buffer) + public init( + _uncheckedBuffer buffer: UnsafeMutableBufferPointer, + initializedCount: Int + ) { + unsafe _pointer = .init(buffer.baseAddress) + capacity = buffer.count + _initialized = initializedCount + } + + /// Unsafely create an OutputSpan over partly-initialized memory. + /// + /// The memory in `buffer` must remain valid throughout the lifetime + /// of the newly-created `OutputSpan`. Its prefix must contain + /// `initializedCount` initialized instances, followed by uninitialized + /// memory. The default value of `initializedCount` is 0, representing + /// the common case of a completely uninitialized `buffer`. + /// + /// - Parameters: + /// - buffer: an `UnsafeMutableBufferPointer` to be initialized + /// - initializedCount: the number of initialized elements + /// at the beginning of `buffer`. + @unsafe + @_alwaysEmitIntoClient + @lifetime(borrow buffer) + public init( + buffer: UnsafeMutableBufferPointer, + initializedCount: Int + ) { + precondition(buffer._isWellAligned(), "Misaligned OutputSpan") + if let baseAddress = buffer.baseAddress { + precondition( + unsafe baseAddress.advanced(by: buffer.count) >= baseAddress, + "Buffer must not wrap around the address space" + ) + } + precondition( + 0 <= initializedCount && initializedCount <= buffer.count, + "OutputSpan count is not within capacity" + ) + unsafe self.init( + _uncheckedBuffer: buffer, initializedCount: initializedCount + ) + } +} + +extension UnsafePointer where Pointee: ~Copyable { + @safe + @_alwaysEmitIntoClient + public func _isWellAligned() -> Bool { + (Int(bitPattern: self) & (MemoryLayout.alignment &- 1)) == 0 + } +} + +extension UnsafeMutablePointer where Pointee: ~Copyable { + @safe + @_alwaysEmitIntoClient + public func _isWellAligned() -> Bool { + (Int(bitPattern: self) & (MemoryLayout.alignment &- 1)) == 0 + } +} + +extension UnsafeBufferPointer where Element: ~Copyable { + @safe + @_alwaysEmitIntoClient + public func _isWellAligned() -> Bool { + guard let p = baseAddress else { return true } + return p._isWellAligned() + } +} + +extension UnsafeMutableBufferPointer where Element: ~Copyable { + @inlinable + public func _isWellAligned() -> Bool { + guard let p = baseAddress else { return true } + return p._isWellAligned() + } +} + +@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, visionOS 9999, *) +extension OutputSpan where Element: ~Copyable { -@available(macOS 9999, *) -@available(macOS 9999, *) -@available(macOS 9999, *) @_alwaysEmitIntoClient @lifetime(self: copy self) public mutating func append(_ value: consuming Element) { @@ -767,11 +833,7 @@ extension OutputSpan { fromContentsOf source: some Collection ) { let void: Void? = source.withContiguousStorageIfAvailable { -#if false append(fromContentsOf: Span(_unsafeElements: $0)) -#else //FIXME: remove once rdar://136838539 & rdar://136849171 are fixed - append(fromContentsOf: $0) -#endif } if void != nil { return @@ -792,24 +854,6 @@ extension OutputSpan { _initialized &+= copied } - //FIXME: remove once rdar://136838539 & rdar://136849171 are fixed - @lifetime(self: copy self) - public mutating func append( - fromContentsOf source: UnsafeBufferPointer - ) { - guard !source.isEmpty else { return } - precondition( - source.count <= available, - "destination span cannot contain every element from source." - ) - let tail = _start.advanced(by: _initialized&*MemoryLayout.stride) - source.baseAddress!.withMemoryRebound(to: Element.self, capacity: source.count) { - _ = tail.initializeMemory(as: Element.self, from: $0, count: source.count) - } - _initialized += source.count - } - - //FIXME: rdar://136838539 & rdar://136849171 @_alwaysEmitIntoClient @lifetime(self: copy self) public mutating func append( @@ -863,21 +907,8 @@ extension OutputSpan where Element: ~Copyable { public mutating func moveAppend( fromContentsOf source: UnsafeMutableBufferPointer ) { -#if false //FIXME: rdar://136838539 & rdar://136849171 - let source = OutputSpan(_initializing: source, initialized: source.count) + let source = OutputSpan(buffer: source, initializedCount: source.count) moveAppend(fromContentsOf: source) -#else - guard !source.isEmpty else { return } - precondition( - source.count <= available, - "buffer cannot contain every element from source." - ) - let tail = _start.advanced(by: _initialized&*MemoryLayout.stride) - tail.moveInitializeMemory( - as: Element.self, from: source.baseAddress!, count: source.count - ) - _initialized &+= source.count -#endif } } @@ -912,11 +943,9 @@ extension OutputSpan where Element: ~Copyable { } } - /* FIXME: rdar://147194789 ([nonescapable] 'mutating get' causes a - type checking error for non-existent _read accessor) @_alwaysEmitIntoClient public var mutableSpan: MutableSpan { - @lifetime(borrow self) + @lifetime(&self) mutating get { // the accessor must provide a mutable projection let pointer = _pointer?.assumingMemoryBound(to: Element.self) let buffer = UnsafeMutableBufferPointer(start: pointer, count: _initialized) @@ -924,7 +953,6 @@ extension OutputSpan where Element: ~Copyable { return _overrideLifetime(span, mutating: &self) } } - */ } @available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, visionOS 9999, *) From 7d92dfe7996fea28ef313605809464953805d1ff Mon Sep 17 00:00:00 2001 From: finagolfin Date: Tue, 6 May 2025 13:54:26 +0530 Subject: [PATCH 35/51] [test] Fix checking C and C++ headers for cross-compilation by explicitly adding the sysroot and target triple (#81312) @weliveindetail noticed that these header checks when cross-compiling are incorrectly checked against the host C and C++ headers and target, so he added the cross-compilation sysroot for the C++ header check alone more than a month ago in #79185. However, that broke several C++ Interop tests when running the compiler validation suite for Android on both [the Windows toolchain CI](https://ci-external.swift.org/job/swift-main-windows-toolchain/) and [the community Android CI on a linux host](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-24.04-android-arm64/): ``` FAIL: Swift(android-x86_64) :: Interop/SwiftToCxx/class/nested-classes-in-cxx.swift (4495 of 18856) ******************** TEST 'Swift(android-x86_64) :: Interop/SwiftToCxx/class/nested-classes-in-cxx.swift' FAILED ******************** Exit Code: 1 Command Output (stdout): -- # RUN: at line 1 rm -rf "T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp" && mkdir -p "T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp" # executed command: rm -rf 'T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp' # executed command: mkdir -p 'T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp' # RUN: at line 2 t:\5\bin\swift-frontend.exe -target x86_64-unknown-linux-android -sdk T:/android-ndk-r27c/toolchains/llvm/prebuilt/windows-x86_64/sysroot -resource-dir T:/x86_64-unknown-linux-android28/Runtime/./lib/swift -module-cache-path T:\x86_64-unknown-linux-android28\Runtime\swift-test-results\x86_64-unknown-linux-android\clang-module-cache -swift-version 4 -define-availability 'SwiftStdlib 9999:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999' -define-availability 'SwiftStdlib 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2' -define-availability 'SwiftStdlib 5.1:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0' -define-availability 'SwiftStdlib 5.2:macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4' -define-availability 'SwiftStdlib 5.3:macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0' -define-availability 'SwiftStdlib 5.4:macOS 11.3, iOS 14.5, watchOS 7.4, tvOS 14.5' -define-availability 'SwiftStdlib 5.5:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0' -define-availability 'SwiftStdlib 5.6:macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4' -define-availability 'SwiftStdlib 5.7:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0' -define-availability 'SwiftStdlib 5.8:macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4' -define-availability 'SwiftStdlib 5.9:macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0' -define-availability 'SwiftStdlib 5.10:macOS 14.4, iOS 17.4, watchOS 10.4, tvOS 17.4, visionOS 1.1' -define-availability 'SwiftStdlib 6.0:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0' -define-availability 'SwiftStdlib 6.1:macOS 15.4, iOS 18.4, watchOS 11.4, tvOS 18.4, visionOS 2.4' -define-availability 'SwiftStdlib 6.2:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999' -define-availability 'SwiftCompatibilitySpan 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, visionOS 1.1' -define-availability 'SwiftCompatibilitySpan 6.2:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0' -typo-correction-limit 10 C:\Users\swift-ci\jenkins\workspace\swift-main-windows-toolchain\swift\test\Interop\SwiftToCxx\class\nested-classes-in-cxx.swift -enable-library-evolution -typecheck -module-name Classes -clang-header-expose-decls=all-public -emit-clang-header-path T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp/classes.h # executed command: 't:\5\bin\swift-frontend.exe' -target x86_64-unknown-linux-android -sdk T:/android-ndk-r27c/toolchains/llvm/prebuilt/windows-x86_64/sysroot -resource-dir T:/x86_64-unknown-linux-android28/Runtime/./lib/swift -module-cache-path 'T:\x86_64-unknown-linux-android28\Runtime\swift-test-results\x86_64-unknown-linux-android\clang-module-cache' -swift-version 4 -define-availability 'SwiftStdlib 9999:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999' -define-availability 'SwiftStdlib 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2' -define-availability 'SwiftStdlib 5.1:macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0' -define-availability 'SwiftStdlib 5.2:macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4' -define-availability 'SwiftStdlib 5.3:macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0' -define-availability 'SwiftStdlib 5.4:macOS 11.3, iOS 14.5, watchOS 7.4, tvOS 14.5' -define-availability 'SwiftStdlib 5.5:macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0' -define-availability 'SwiftStdlib 5.6:macOS 12.3, iOS 15.4, watchOS 8.5, tvOS 15.4' -define-availability 'SwiftStdlib 5.7:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0' -define-availability 'SwiftStdlib 5.8:macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4' -define-availability 'SwiftStdlib 5.9:macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0' -define-availability 'SwiftStdlib 5.10:macOS 14.4, iOS 17.4, watchOS 10.4, tvOS 17.4, visionOS 1.1' -define-availability 'SwiftStdlib 6.0:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0' -define-availability 'SwiftStdlib 6.1:macOS 15.4, iOS 18.4, watchOS 11.4, tvOS 18.4, visionOS 2.4' -define-availability 'SwiftStdlib 6.2:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999' -define-availability 'SwiftCompatibilitySpan 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, visionOS 1.1' -define-availability 'SwiftCompatibilitySpan 6.2:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0' -typo-correction-limit 10 'C:\Users\swift-ci\jenkins\workspace\swift-main-windows-toolchain\swift\test\Interop\SwiftToCxx\class\nested-classes-in-cxx.swift' -enable-library-evolution -typecheck -module-name Classes -clang-header-expose-decls=all-public -emit-clang-header-path 'T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp/classes.h' # RUN: at line 3 't:\\5\\bin\\clang++.exe' -fmodules-cache-path='T:\\x86_64-unknown-linux-android28\\Runtime\\swift-test-results\\x86_64-unknown-linux-android\\clang-module-cache' -fsyntax-only -x c++-header -Weverything -Werror -Wno-unused-macros -Wno-incomplete-module -Wno-auto-import -Wno-variadic-macros -Wno-c++98-compat-pedantic -Wno-poison-system-directories -Wno-unused-command-line-argument -Wno-nullability-extension --sysroot 'T:/android-ndk-r27c/toolchains/llvm/prebuilt/windows-x86_64/sysroot' -F 'C:\\Users\\swift-ci\\jenkins\\workspace\\swift-main-windows-toolchain\\swift\\test\\Inputs\\clang-importer-sdk'/frameworks -I T:\x86_64-unknown-linux-android28\LLVM\include -isysroot 'C:/Users/swift-ci/jenkins/workspace/swift-main-windows-toolchain/swift\\test'/Inputs/clang-importer-sdk -std=c++14 -Wno-padded -Wno-c11-extensions -D_LIBCPP_CSTDLIB -IT:/x86_64-unknown-linux-android28/Runtime/./lib/swift T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp/classes.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY -std=c++17 && 't:\\5\\bin\\clang++.exe' -fmodules-cache-path='T:\\x86_64-unknown-linux-android28\\Runtime\\swift-test-results\\x86_64-unknown-linux-android\\clang-module-cache' -fsyntax-only -x c++-header -Weverything -Werror -Wno-unused-macros -Wno-incomplete-module -Wno-auto-import -Wno-variadic-macros -Wno-c++98-compat-pedantic -Wno-poison-system-directories -Wno-unused-command-line-argument -Wno-nullability-extension --sysroot 'T:/android-ndk-r27c/toolchains/llvm/prebuilt/windows-x86_64/sysroot' -F 'C:\\Users\\swift-ci\\jenkins\\workspace\\swift-main-windows-toolchain\\swift\\test\\Inputs\\clang-importer-sdk'/frameworks -I T:\x86_64-unknown-linux-android28\LLVM\include -isysroot 'C:/Users/swift-ci/jenkins/workspace/swift-main-windows-toolchain/swift\\test'/Inputs/clang-importer-sdk -std=c++17 -Wno-padded -Wno-c11-extensions -D_LIBCPP_CSTDLIB -IT:/x86_64-unknown-linux-android28/Runtime/./lib/swift T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp/classes.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY -std=c++17 && 't:\\5\\bin\\clang++.exe' -fmodules-cache-path='T:\\x86_64-unknown-linux-android28\\Runtime\\swift-test-results\\x86_64-unknown-linux-android\\clang-module-cache' -fsyntax-only -x c++-header -Weverything -Werror -Wno-unused-macros -Wno-incomplete-module -Wno-auto-import -Wno-variadic-macros -Wno-c++98-compat-pedantic -Wno-poison-system-directories -Wno-unused-command-line-argument -Wno-nullability-extension --sysroot 'T:/android-ndk-r27c/toolchains/llvm/prebuilt/windows-x86_64/sysroot' -F 'C:\\Users\\swift-ci\\jenkins\\workspace\\swift-main-windows-toolchain\\swift\\test\\Inputs\\clang-importer-sdk'/frameworks -I T:\x86_64-unknown-linux-android28\LLVM\include -isysroot 'C:/Users/swift-ci/jenkins/workspace/swift-main-windows-toolchain/swift\\test'/Inputs/clang-importer-sdk -std=c++20 -Wno-padded -Wno-c11-extensions -D_LIBCPP_CSTDLIB -IT:/x86_64-unknown-linux-android28/Runtime/./lib/swift T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp/classes.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY -std=c++17 # executed command: 't:\\5\\bin\\clang++.exe' '-fmodules-cache-path=T:\\x86_64-unknown-linux-android28\\Runtime\\swift-test-results\\x86_64-unknown-linux-android\\clang-module-cache' -fsyntax-only -x c++-header -Weverything -Werror -Wno-unused-macros -Wno-incomplete-module -Wno-auto-import -Wno-variadic-macros -Wno-c++98-compat-pedantic -Wno-poison-system-directories -Wno-unused-command-line-argument -Wno-nullability-extension --sysroot T:/android-ndk-r27c/toolchains/llvm/prebuilt/windows-x86_64/sysroot -F 'C:\\Users\\swift-ci\\jenkins\\workspace\\swift-main-windows-toolchain\\swift\\test\\Inputs\\clang-importer-sdk/frameworks' -I 'T:\x86_64-unknown-linux-android28\LLVM\include' -isysroot 'C:/Users/swift-ci/jenkins/workspace/swift-main-windows-toolchain/swift\\test/Inputs/clang-importer-sdk' -std=c++14 -Wno-padded -Wno-c11-extensions -D_LIBCPP_CSTDLIB -IT:/x86_64-unknown-linux-android28/Runtime/./lib/swift 'T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp/classes.h' -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY -std=c++17 # .---command stderr------------ # | T:\x86_64-unknown-linux-android28\Runtime\test-android-x86_64\Interop\SwiftToCxx\class\Output\nested-classes-in-cxx.swift.tmp/classes.h:29:10: fatal error: 'cstdint' file not found # | 29 | #include # | | ^~~~~~~~~ # | 1 error generated. # `----------------------------- # error: command failed with exit status: 1 ``` I experimented a bit and found that explicitly passing in the target triple fixed these tests, so this pull does that for C++ and also corrects the C header check. --- test/lit.cfg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/lit.cfg b/test/lit.cfg index 061f2947e6bcf..7e4730f1685f3 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -2742,6 +2742,8 @@ extraCheckWarningFlags = ( # Verifies that a C++ file can be compiled without warnings except for some exceptions. config.substitutions.insert(0, ('%check-c-header-in-clang', '%clang -fsyntax-only -x c-header ' + extraCheckWarningFlags + + ' --sysroot %r ' % config.variant_sdk + + '-target %r ' % config.variant_triple + # Use standard header/framework search paths. '-F %%clang-importer-sdk-path/frameworks ' '-I %%clang-include-dir ' @@ -2751,6 +2753,7 @@ config.substitutions.insert(0, ('%check-c-header-in-clang', config.substitutions.insert(0, ('%check-cxx-header-in-clang', '%clangxx -fsyntax-only -x c++-header ' + extraCheckWarningFlags + ' --sysroot %r ' % config.variant_sdk + + '-target %r ' % config.variant_triple + # Use standard header/framework search paths. '-F %%clang-importer-sdk-path/frameworks ' '-I %%clang-include-dir %%cxx-stdlib-include ' From 555bc1b54fd39a03e2991f60155647cb131c6caa Mon Sep 17 00:00:00 2001 From: Hamish Knight Date: Tue, 6 May 2025 10:18:17 +0100 Subject: [PATCH 36/51] [xcodegen] Clean up file extension handling Factor out `FileExtension.matches` and add some tests. --- .../Sources/SwiftXcodeGen/Path/AnyPath.swift | 6 ----- .../SwiftXcodeGen/Path/PathProtocol.swift | 22 +++++++++++------ .../Tests/SwiftXcodeGenTest/PathTests.swift | 24 +++++++++++++++++++ 3 files changed, 39 insertions(+), 13 deletions(-) diff --git a/utils/swift-xcodegen/Sources/SwiftXcodeGen/Path/AnyPath.swift b/utils/swift-xcodegen/Sources/SwiftXcodeGen/Path/AnyPath.swift index 5ba0651f01739..4f40241f5685b 100644 --- a/utils/swift-xcodegen/Sources/SwiftXcodeGen/Path/AnyPath.swift +++ b/utils/swift-xcodegen/Sources/SwiftXcodeGen/Path/AnyPath.swift @@ -74,9 +74,3 @@ extension AnyPath: ExpressibleByArgument { self.init(rawPath) } } - -extension StringProtocol { - func hasExtension(_ ext: FileExtension) -> Bool { - FilePath(String(self)).extension == ext.rawValue - } -} diff --git a/utils/swift-xcodegen/Sources/SwiftXcodeGen/Path/PathProtocol.swift b/utils/swift-xcodegen/Sources/SwiftXcodeGen/Path/PathProtocol.swift index 9a11681ab0109..2000382b7f73c 100644 --- a/utils/swift-xcodegen/Sources/SwiftXcodeGen/Path/PathProtocol.swift +++ b/utils/swift-xcodegen/Sources/SwiftXcodeGen/Path/PathProtocol.swift @@ -68,16 +68,11 @@ public extension PathProtocol { return RelativePath(result) } - func hasExtension(_ ext: FileExtension) -> Bool { - storage.extension == ext.rawValue - } func hasExtension(_ exts: FileExtension...) -> Bool { // Note that querying `.extension` involves re-parsing, so only do it // once here. - guard let ext = storage.extension else { return false } - return exts.contains(where: { - ext.compare($0.rawValue, options: .caseInsensitive) == .orderedSame - }) + guard let pathExt = storage.extension else { return false } + return exts.contains(where: { $0.matches(pathExt) }) } func starts(with other: Self) -> Bool { @@ -158,3 +153,16 @@ extension Collection where Element: PathProtocol { return result == first ? result.parentDir : result } } + +extension StringProtocol { + func hasExtension(_ exts: FileExtension...) -> Bool { + guard let pathExt = FilePath(String(self)).extension else { return false } + return exts.contains(where: { $0.matches(pathExt) }) + } +} + +extension FileExtension { + func matches(_ extStr: String) -> Bool { + rawValue.compare(extStr, options: .caseInsensitive) == .orderedSame + } +} diff --git a/utils/swift-xcodegen/Tests/SwiftXcodeGenTest/PathTests.swift b/utils/swift-xcodegen/Tests/SwiftXcodeGenTest/PathTests.swift index 5ad40c301c766..a77c027585a0e 100644 --- a/utils/swift-xcodegen/Tests/SwiftXcodeGenTest/PathTests.swift +++ b/utils/swift-xcodegen/Tests/SwiftXcodeGenTest/PathTests.swift @@ -37,4 +37,28 @@ class PathTests: XCTestCase { XCTAssertEqual(RelativePath("foo/bar").dropLast(2), "") XCTAssertEqual(RelativePath("foo/bar").dropLast(5), "") } + + func testExtension() throws { + func match( + _ ext: FileExtension, with path: String, + value: Bool = true, file: StaticString = #file, line: UInt = #line + ) { + XCTAssert(path.hasExtension(ext) == value, file: file, line: line) + XCTAssert(AnyPath(path).hasExtension(ext) == value, file: file, line: line) + } + match(.swift, with: "x.swift") + match(.swift, with: "/x.swift") + match(.swift, with: ".swift", value: false) + match(.swift, with: "/.swift", value: false) + + match(.swift, with: "x.SWIFT") + match(.swift, with: "/x.SWIFT") + match(.swift, with: ".SWIFT", value: false) + match(.swift, with: "/.SWIFT", value: false) + + match(.swift, with: "x.swiftx", value: false) + + XCTAssert("x.sWift".hasExtension(.asm, .swift)) + XCTAssert(AnyPath("x.sWift").hasExtension(.asm, .swift)) + } } From 774d8695177e24567c340299a63d964538c0c934 Mon Sep 17 00:00:00 2001 From: Erik Eckstein Date: Tue, 6 May 2025 12:32:56 +0200 Subject: [PATCH 37/51] Fix some compiler warnings --- lib/AST/ASTContext.cpp | 7 ------- lib/Demangling/Remangler.cpp | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 1f042b10047d3..dcec91dabadd6 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -2201,13 +2201,6 @@ Identifier ASTContext::getRealModuleName(Identifier key, ModuleAliasLookupOption return value.first; } -namespace { - static StringRef pathStringFromSearchPath( - const SearchPathOptions::SearchPath &next) { - return next.Path; - } -} - std::vector ASTContext::getDarwinImplicitFrameworkSearchPaths() const { assert(LangOpts.Target.isOSDarwin()); diff --git a/lib/Demangling/Remangler.cpp b/lib/Demangling/Remangler.cpp index 687357facd5c4..5b0179f6429a5 100644 --- a/lib/Demangling/Remangler.cpp +++ b/lib/Demangling/Remangler.cpp @@ -2781,8 +2781,8 @@ ManglingError Remangler::mangleDependentProtocolConformanceOpaque(Node *node, unsigned depth) { DEMANGLER_ASSERT(node->getKind() == Node::Kind::DependentProtocolConformanceOpaque, node); - mangleAnyProtocolConformance(node->getChild(0), depth + 1); - mangleType(node->getChild(1), depth + 1); + RETURN_IF_ERROR(mangleAnyProtocolConformance(node->getChild(0), depth + 1)); + RETURN_IF_ERROR(mangleType(node->getChild(1), depth + 1)); Buffer << "HO"; return ManglingError::Success; } From 67425a541e70c2ed514fc7e299666b69bfef5a99 Mon Sep 17 00:00:00 2001 From: Erik Eckstein Date: Fri, 2 May 2025 09:14:09 +0200 Subject: [PATCH 38/51] Swift Optimizer: introduce `InstructionSetWithCount` It's based on `InstructionSet` but also provides a `count` property --- .../Optimizer/DataStructures/Set.swift | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/SwiftCompilerSources/Sources/Optimizer/DataStructures/Set.swift b/SwiftCompilerSources/Sources/Optimizer/DataStructures/Set.swift index 2b95ad273cb4e..37aca675af749 100644 --- a/SwiftCompilerSources/Sources/Optimizer/DataStructures/Set.swift +++ b/SwiftCompilerSources/Sources/Optimizer/DataStructures/Set.swift @@ -177,7 +177,44 @@ struct SpecificInstructionSet : IntrusiveSet { } } +/// An `InstructionSet` which also provides a `count` property. +struct SpecificInstructionSetWithCount : IntrusiveSet { + private(set) var count = 0 + private var underlyingSet: SpecificInstructionSet + + init(_ context: some Context) { + self.underlyingSet = SpecificInstructionSet(context) + } + + func contains(_ inst: InstType) -> Bool { underlyingSet.contains(inst) } + + var isEmpty: Bool { count == 0 } + + /// Returns true if `inst` was not contained in the set before inserting. + @discardableResult + mutating func insert(_ inst: InstType) -> Bool { + if underlyingSet.insert(inst) { + count += 1 + return true + } + return false + } + + mutating func erase(_ inst: InstType) { + if underlyingSet.contains(inst) { + count -= 1 + assert(count >= 0) + } + underlyingSet.erase(inst) + } + + var description: String { underlyingSet.description } + + mutating func deinitialize() { underlyingSet.deinitialize() } +} + typealias InstructionSet = SpecificInstructionSet +typealias InstructionSetWithCount = SpecificInstructionSetWithCount /// A set of operands. /// From 8f39c3cad8a2750cff985fae94c35857ecb0021d Mon Sep 17 00:00:00 2001 From: Erik Eckstein Date: Fri, 2 May 2025 09:26:29 +0200 Subject: [PATCH 39/51] Swift SIL: rename `isTakeOfSrc` -> `isTakeOfSource` and `isInitializationOfDest` -> `isInitializationOfDestination` Trying to avoid abbreviations in ABI names --- .../Optimizer/Analysis/AliasAnalysis.swift | 4 ++-- .../FunctionPasses/ComputeSideEffects.swift | 6 ++--- .../FunctionPasses/LetPropertyLowering.swift | 2 +- .../NamedReturnValueOptimization.swift | 2 +- .../RedundantLoadElimination.swift | 2 +- .../Optimizer/Utilities/EscapeUtils.swift | 2 +- .../Utilities/LifetimeDependenceUtils.swift | 2 +- .../Optimizer/Utilities/OptUtils.swift | 10 ++++---- .../Optimizer/Utilities/Verifier.swift | 2 +- .../Sources/SIL/Instruction.swift | 24 +++++++++---------- 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/SwiftCompilerSources/Sources/Optimizer/Analysis/AliasAnalysis.swift b/SwiftCompilerSources/Sources/Optimizer/Analysis/AliasAnalysis.swift index 2b4880ceb9265..73552643abf17 100644 --- a/SwiftCompilerSources/Sources/Optimizer/Analysis/AliasAnalysis.swift +++ b/SwiftCompilerSources/Sources/Optimizer/Analysis/AliasAnalysis.swift @@ -262,8 +262,8 @@ struct AliasAnalysis { case let copy as SourceDestAddrInstruction: let mayRead = memLoc.mayAlias(with: copy.source, self) let mayWrite = memLoc.mayAlias(with: copy.destination, self) - var effects = SideEffects.Memory(read: mayRead, write: mayWrite || (mayRead && copy.isTakeOfSrc)) - if !copy.isInitializationOfDest { + var effects = SideEffects.Memory(read: mayRead, write: mayWrite || (mayRead && copy.isTakeOfSource)) + if !copy.isInitializationOfDestination { effects.merge(with: defaultEffects(of: copy, on: memLoc)) } return effects diff --git a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/ComputeSideEffects.swift b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/ComputeSideEffects.swift index ac29452380b18..ce60db6ba195f 100644 --- a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/ComputeSideEffects.swift +++ b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/ComputeSideEffects.swift @@ -108,10 +108,10 @@ private struct CollectedEffects { addEffects(.read, to: copy.source) addEffects(.write, to: copy.destination) - if !copy.isTakeOfSrc { + if !copy.isTakeOfSource { addEffects(.copy, to: copy.source) } - if !copy.isInitializationOfDest { + if !copy.isInitializationOfDestination { addDestroyEffects(ofAddress: copy.destination) } @@ -494,7 +494,7 @@ private struct ArgumentEscapingWalker : ValueDefUseWalker, AddressDefUseWalker { case let copy as CopyAddrInst: if address == copy.sourceOperand && !address.value.hasTrivialType && - (!function.hasOwnership || copy.isTakeOfSrc) { + (!function.hasOwnership || copy.isTakeOfSource) { foundTakingLoad = true } return .continueWalk diff --git a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LetPropertyLowering.swift b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LetPropertyLowering.swift index 7e1872e572660..65142837b4d56 100644 --- a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LetPropertyLowering.swift +++ b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LetPropertyLowering.swift @@ -153,7 +153,7 @@ private func constructLetInitRegion( case let copy as CopyAddrInst where copy.destination.isLetFieldAddress(of: markUninitialized): - assert(copy.isInitializationOfDest) + assert(copy.isInitializationOfDestination) initRegion.insert(inst) case let beginAccess as BeginAccessInst diff --git a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/NamedReturnValueOptimization.swift b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/NamedReturnValueOptimization.swift index 6fc0f342145fd..8720b4c057660 100644 --- a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/NamedReturnValueOptimization.swift +++ b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/NamedReturnValueOptimization.swift @@ -78,7 +78,7 @@ private func findCopyForNRVO(for outArg: FunctionArgument) -> CopyAddrInst? { // %local = alloc_stack $T // store %in to %local : $*T // copy_addr %local to [init] %out : $*T - if !copyToArg.isTakeOfSrc { + if !copyToArg.isTakeOfSource { return nil } diff --git a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/RedundantLoadElimination.swift b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/RedundantLoadElimination.swift index 8f4447ddd81df..4899172e6cc7b 100644 --- a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/RedundantLoadElimination.swift +++ b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/RedundantLoadElimination.swift @@ -158,7 +158,7 @@ extension CopyAddrInst : LoadingInstruction { return false } if !parentFunction.hasOwnership { - if !isTakeOfSrc || !isInitializationOfDest { + if !isTakeOfSource || !isInitializationOfDestination { // For simplicity, bail if we would have to insert compensating retains and releases. return false } diff --git a/SwiftCompilerSources/Sources/Optimizer/Utilities/EscapeUtils.swift b/SwiftCompilerSources/Sources/Optimizer/Utilities/EscapeUtils.swift index b2078b667a378..912b3ba69c951 100644 --- a/SwiftCompilerSources/Sources/Optimizer/Utilities/EscapeUtils.swift +++ b/SwiftCompilerSources/Sources/Optimizer/Utilities/EscapeUtils.swift @@ -519,7 +519,7 @@ fileprivate struct EscapeWalker : ValueDefUseWalker, if operand == copyAddr.sourceOperand { return walkUp(address: copyAddr.destination, path: path) } else { - if !copyAddr.isInitializationOfDest { + if !copyAddr.isInitializationOfDestination { if handleDestroy(of: operand.value, path: path.with(knownType: nil)) == .abortWalk { return .abortWalk } diff --git a/SwiftCompilerSources/Sources/Optimizer/Utilities/LifetimeDependenceUtils.swift b/SwiftCompilerSources/Sources/Optimizer/Utilities/LifetimeDependenceUtils.swift index 355c1d33f0c53..c5c075461a918 100644 --- a/SwiftCompilerSources/Sources/Optimizer/Utilities/LifetimeDependenceUtils.swift +++ b/SwiftCompilerSources/Sources/Optimizer/Utilities/LifetimeDependenceUtils.swift @@ -495,7 +495,7 @@ extension LifetimeDependence.Scope { case is DestroyAddrInst: range.insert(inst) case let sdai as SourceDestAddrInstruction - where sdai.sourceOperand == use && sdai.isTakeOfSrc: + where sdai.sourceOperand == use && sdai.isTakeOfSource: range.insert(inst) case let li as LoadInst where li.loadOwnership == .take: range.insert(inst) diff --git a/SwiftCompilerSources/Sources/Optimizer/Utilities/OptUtils.swift b/SwiftCompilerSources/Sources/Optimizer/Utilities/OptUtils.swift index fe4be62d35d5f..c8a4ef4e2ccc4 100644 --- a/SwiftCompilerSources/Sources/Optimizer/Utilities/OptUtils.swift +++ b/SwiftCompilerSources/Sources/Optimizer/Utilities/OptUtils.swift @@ -954,7 +954,7 @@ extension CopyAddrInst { let srcFieldAddr = builder.createStructElementAddr(structAddress: source, fieldIndex: idx) let destFieldAddr = builder.createStructElementAddr(structAddress: destination, fieldIndex: idx) builder.createCopyAddr(from: srcFieldAddr, to: destFieldAddr, - takeSource: isTake(for: srcFieldAddr), initializeDest: isInitializationOfDest) + takeSource: isTake(for: srcFieldAddr), initializeDest: isInitializationOfDestination) } context.erase(instruction: self) return true @@ -964,7 +964,7 @@ extension CopyAddrInst { let srcFieldAddr = builder.createTupleElementAddr(tupleAddress: source, elementIndex: idx) let destFieldAddr = builder.createTupleElementAddr(tupleAddress: destination, elementIndex: idx) builder.createCopyAddr(from: srcFieldAddr, to: destFieldAddr, - takeSource: isTake(for: srcFieldAddr), initializeDest: isInitializationOfDest) + takeSource: isTake(for: srcFieldAddr), initializeDest: isInitializationOfDestination) } context.erase(instruction: self) return true @@ -973,7 +973,7 @@ extension CopyAddrInst { } private func isTake(for fieldValue: Value) -> Bool { - return isTakeOfSrc && !fieldValue.type.objectType.isTrivial(in: parentFunction) + return isTakeOfSource && !fieldValue.type.objectType.isTrivial(in: parentFunction) } @discardableResult @@ -992,7 +992,7 @@ extension CopyAddrInst { if type.isTrivial(in: parentFunction) { return .trivial } - if isTakeOfSrc { + if isTakeOfSource { return .take } return .copy @@ -1005,7 +1005,7 @@ extension CopyAddrInst { if type.isTrivial(in: parentFunction) { return .trivial } - if isInitializationOfDest { + if isInitializationOfDestination { return .initialize } return .assign diff --git a/SwiftCompilerSources/Sources/Optimizer/Utilities/Verifier.swift b/SwiftCompilerSources/Sources/Optimizer/Utilities/Verifier.swift index 42f5bba0f7099..d54ded9805934 100644 --- a/SwiftCompilerSources/Sources/Optimizer/Utilities/Verifier.swift +++ b/SwiftCompilerSources/Sources/Optimizer/Utilities/Verifier.swift @@ -230,7 +230,7 @@ private extension Operand { case let copy as SourceDestAddrInstruction: if self == copy.destinationOperand { return true - } else if self == copy.sourceOperand && copy.isTakeOfSrc { + } else if self == copy.sourceOperand && copy.isTakeOfSource { return true } return false diff --git a/SwiftCompilerSources/Sources/SIL/Instruction.swift b/SwiftCompilerSources/Sources/SIL/Instruction.swift index 6e3aafe647875..e299a2290af94 100644 --- a/SwiftCompilerSources/Sources/SIL/Instruction.swift +++ b/SwiftCompilerSources/Sources/SIL/Instruction.swift @@ -318,8 +318,8 @@ final public class AssignOrInitInst : Instruction, StoringInstruction {} public protocol SourceDestAddrInstruction : Instruction { var sourceOperand: Operand { get } var destinationOperand: Operand { get } - var isTakeOfSrc: Bool { get } - var isInitializationOfDest: Bool { get } + var isTakeOfSource: Bool { get } + var isInitializationOfDestination: Bool { get } } extension SourceDestAddrInstruction { @@ -330,10 +330,10 @@ extension SourceDestAddrInstruction { } final public class CopyAddrInst : Instruction, SourceDestAddrInstruction { - public var isTakeOfSrc: Bool { + public var isTakeOfSource: Bool { bridged.CopyAddrInst_isTakeOfSrc() } - public var isInitializationOfDest: Bool { + public var isInitializationOfDestination: Bool { bridged.CopyAddrInst_isInitializationOfDest() } } @@ -342,10 +342,10 @@ final public class ExplicitCopyAddrInst : Instruction, SourceDestAddrInstruction public var source: Value { return sourceOperand.value } public var destination: Value { return destinationOperand.value } - public var isTakeOfSrc: Bool { + public var isTakeOfSource: Bool { bridged.ExplicitCopyAddrInst_isTakeOfSrc() } - public var isInitializationOfDest: Bool { + public var isInitializationOfDestination: Bool { bridged.ExplicitCopyAddrInst_isInitializationOfDest() } } @@ -542,8 +542,8 @@ final public class UnconditionalCheckedCastAddrInst : Instruction, SourceDestAdd CanonicalType(bridged: bridged.UnconditionalCheckedCastAddr_getTargetFormalType()) } - public var isTakeOfSrc: Bool { true } - public var isInitializationOfDest: Bool { true } + public var isTakeOfSource: Bool { true } + public var isInitializationOfDestination: Bool { true } public override var mayTrap: Bool { true } public var isolatedConformances: CastingIsolatedConformances { @@ -723,8 +723,8 @@ class UncheckedRefCastInst : SingleValueInstruction, UnaryInstruction { final public class UncheckedRefCastAddrInst : Instruction, SourceDestAddrInstruction { - public var isTakeOfSrc: Bool { true } - public var isInitializationOfDest: Bool { true } + public var isTakeOfSource: Bool { true } + public var isInitializationOfDestination: Bool { true } } final public class UncheckedAddrCastInst : SingleValueInstruction, UnaryInstruction { @@ -1318,8 +1318,8 @@ final public class MarkUnresolvedNonCopyableValueInst: SingleValueInstruction, U final public class MarkUnresolvedReferenceBindingInst : SingleValueInstruction {} final public class MarkUnresolvedMoveAddrInst : Instruction, SourceDestAddrInstruction { - public var isTakeOfSrc: Bool { true } - public var isInitializationOfDest: Bool { true } + public var isTakeOfSource: Bool { true } + public var isInitializationOfDestination: Bool { true } } final public class CopyableToMoveOnlyWrapperValueInst: SingleValueInstruction, UnaryInstruction {} From d2f8c0cf497dad4054263dd92092be378a35d013 Mon Sep 17 00:00:00 2001 From: Erik Eckstein Date: Fri, 2 May 2025 09:31:42 +0200 Subject: [PATCH 40/51] Swift SIL: add some Instruction APIs * `OpenExistentialAddrInst.isImmutable` * `YieldInst.convention` * `CopyAddrInst.set(isTakeOfSource:)` and `CopyAddrInst.set(isInitializationOfDestination:)` --- .../Optimizer/PassManager/Context.swift | 14 +++++++++++++ .../Sources/SIL/Instruction.swift | 7 ++++++- include/swift/SIL/SILBridging.h | 4 ++++ include/swift/SIL/SILBridgingImpl.h | 20 +++++++++++++++++++ 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/SwiftCompilerSources/Sources/Optimizer/PassManager/Context.swift b/SwiftCompilerSources/Sources/Optimizer/PassManager/Context.swift index 8f14e0bdf90f4..d667123c43aa8 100644 --- a/SwiftCompilerSources/Sources/Optimizer/PassManager/Context.swift +++ b/SwiftCompilerSources/Sources/Optimizer/PassManager/Context.swift @@ -757,6 +757,20 @@ extension PointerToAddressInst { } } +extension CopyAddrInst { + func set(isTakeOfSource: Bool, _ context: some MutatingContext) { + context.notifyInstructionsChanged() + bridged.CopyAddrInst_setIsTakeOfSrc(isTakeOfSource) + context.notifyInstructionChanged(self) + } + + func set(isInitializationOfDestination: Bool, _ context: some MutatingContext) { + context.notifyInstructionsChanged() + bridged.CopyAddrInst_setIsInitializationOfDest(isInitializationOfDestination) + context.notifyInstructionChanged(self) + } +} + extension TermInst { func replaceBranchTarget(from fromBlock: BasicBlock, to toBlock: BasicBlock, _ context: some MutatingContext) { context.notifyBranchesChanged() diff --git a/SwiftCompilerSources/Sources/SIL/Instruction.swift b/SwiftCompilerSources/Sources/SIL/Instruction.swift index e299a2290af94..2eea59c78e607 100644 --- a/SwiftCompilerSources/Sources/SIL/Instruction.swift +++ b/SwiftCompilerSources/Sources/SIL/Instruction.swift @@ -829,7 +829,9 @@ final public class DeinitExistentialValueInst : Instruction {} final public -class OpenExistentialAddrInst : SingleValueInstruction, UnaryInstruction {} +class OpenExistentialAddrInst : SingleValueInstruction, UnaryInstruction { + public var isImmutable: Bool { bridged.OpenExistentialAddr_isImmutable() } +} final public class OpenExistentialBoxInst : SingleValueInstruction, UnaryInstruction {} @@ -1696,6 +1698,9 @@ final public class ThrowAddrInst : TermInst { } final public class YieldInst : TermInst { + public func convention(of operand: Operand) -> ArgumentConvention { + return bridged.YieldInst_getConvention(operand.bridged).convention + } } final public class UnwindInst : TermInst { diff --git a/include/swift/SIL/SILBridging.h b/include/swift/SIL/SILBridging.h index 60defb804365a..2578d0ca6d3ee 100644 --- a/include/swift/SIL/SILBridging.h +++ b/include/swift/SIL/SILBridging.h @@ -732,6 +732,7 @@ struct BridgedInstruction { BRIDGED_INLINE bool IndexAddrInst_needsStackProtection() const; SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedConformanceArray InitExistentialRefInst_getConformances() const; SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedCanType InitExistentialRefInst_getFormalConcreteType() const; + BRIDGED_INLINE bool OpenExistentialAddr_isImmutable() const; SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedGlobalVar GlobalAccessInst_getGlobal() const; SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedGlobalVar AllocGlobalInst_getGlobal() const; SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedFunction FunctionRefBaseInst_getReferencedFunction() const; @@ -791,6 +792,7 @@ struct BridgedInstruction { BRIDGED_INLINE SwiftInt BeginApplyInst_numArguments() const; BRIDGED_INLINE bool BeginApplyInst_isCalleeAllocated() const; BRIDGED_INLINE SwiftInt TryApplyInst_numArguments() const; + BRIDGED_INLINE BridgedArgumentConvention YieldInst_getConvention(BridgedOperand forOperand) const; SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedBasicBlock BranchInst_getTargetBlock() const; BRIDGED_INLINE SwiftInt SwitchEnumInst_getNumCases() const; BRIDGED_INLINE SwiftInt SwitchEnumInst_getCaseIndex(SwiftInt idx) const; @@ -807,6 +809,8 @@ struct BridgedInstruction { BRIDGED_INLINE bool BeginAccessInst_isUnsafe() const; BRIDGED_INLINE bool CopyAddrInst_isTakeOfSrc() const; BRIDGED_INLINE bool CopyAddrInst_isInitializationOfDest() const; + BRIDGED_INLINE void CopyAddrInst_setIsTakeOfSrc(bool isTakeOfSrc) const; + BRIDGED_INLINE void CopyAddrInst_setIsInitializationOfDest(bool isInitializationOfDest) const; BRIDGED_INLINE bool ExplicitCopyAddrInst_isTakeOfSrc() const; BRIDGED_INLINE bool ExplicitCopyAddrInst_isInitializationOfDest() const; BRIDGED_INLINE SwiftInt MarkUninitializedInst_getKind() const; diff --git a/include/swift/SIL/SILBridgingImpl.h b/include/swift/SIL/SILBridgingImpl.h index 96c741ed2e015..f807da6e1ab85 100644 --- a/include/swift/SIL/SILBridgingImpl.h +++ b/include/swift/SIL/SILBridgingImpl.h @@ -1144,6 +1144,13 @@ BridgedCanType BridgedInstruction::InitExistentialRefInst_getFormalConcreteType( return getAs()->getFormalConcreteType(); } +bool BridgedInstruction::OpenExistentialAddr_isImmutable() const { + switch (getAs()->getAccessKind()) { + case swift::OpenedExistentialAccess::Immutable: return true; + case swift::OpenedExistentialAccess::Mutable: return false; + } +} + BridgedGlobalVar BridgedInstruction::GlobalAccessInst_getGlobal() const { return {getAs()->getReferencedGlobal()}; } @@ -1381,6 +1388,10 @@ SwiftInt BridgedInstruction::TryApplyInst_numArguments() const { return getAs()->getNumArguments(); } +BridgedArgumentConvention BridgedInstruction::YieldInst_getConvention(BridgedOperand forOperand) const { + return castToArgumentConvention(getAs()->getArgumentConventionForOperand(*forOperand.op)); +} + BridgedBasicBlock BridgedInstruction::BranchInst_getTargetBlock() const { return {getAs()->getDestBB()}; } @@ -1446,6 +1457,15 @@ bool BridgedInstruction::CopyAddrInst_isInitializationOfDest() const { return getAs()->isInitializationOfDest(); } +void BridgedInstruction::CopyAddrInst_setIsTakeOfSrc(bool isTakeOfSrc) const { + return getAs()->setIsTakeOfSrc(isTakeOfSrc ? swift::IsTake : swift::IsNotTake); +} + +void BridgedInstruction::CopyAddrInst_setIsInitializationOfDest(bool isInitializationOfDest) const { + return getAs()->setIsInitializationOfDest( + isInitializationOfDest ? swift::IsInitialization : swift::IsNotInitialization); +} + bool BridgedInstruction::ExplicitCopyAddrInst_isTakeOfSrc() const { return getAs()->isTakeOfSrc(); } From e6b9374b49b395aa6441cea62903b1a5d44bb8b1 Mon Sep 17 00:00:00 2001 From: Erik Eckstein Date: Fri, 2 May 2025 09:37:33 +0200 Subject: [PATCH 41/51] SIL: add `AccessBase.storageIsLexical` --- .../Sources/SIL/Utilities/AccessUtils.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/SwiftCompilerSources/Sources/SIL/Utilities/AccessUtils.swift b/SwiftCompilerSources/Sources/SIL/Utilities/AccessUtils.swift index 42aa10cea05d1..26fb99731356b 100644 --- a/SwiftCompilerSources/Sources/SIL/Utilities/AccessUtils.swift +++ b/SwiftCompilerSources/Sources/SIL/Utilities/AccessUtils.swift @@ -223,6 +223,21 @@ public enum AccessBase : CustomStringConvertible, Hashable { } } + public var storageIsLexical: Bool { + switch self { + case .argument(let arg): + return arg.isLexical + case .stack(let allocStack): + return allocStack.isLexical + case .global: + return true + case .box, .class, .tail: + return reference!.referenceRoot.isLexical + case .yield, .pointer, .index, .storeBorrow, .unidentified: + return false + } + } + /// Returns true if it's guaranteed that this access has the same base address as the `other` access. /// /// `isEqual` abstracts away the projection instructions that are included as part of the AccessBase: From c6b1e3e854a3207426ed1d7bb2b708652ead994d Mon Sep 17 00:00:00 2001 From: Erik Eckstein Date: Mon, 5 May 2025 10:26:10 +0200 Subject: [PATCH 42/51] TempRValueElimination: re-implement the pass in swift Beside cleaning up the source code, the motivation for the translation into Swift is to make it easier to improve the pass for some InlineArray specific optimizations (though I'm not sure, yet if we really need those). Also, the new implementation doesn't contain the optimize-store-into-temp optimization anymore, because this is covered by redundant load elimination. --- .../Optimizer/FunctionPasses/CMakeLists.txt | 1 + .../TempRValueElimination.swift | 523 ++++++++++ .../PassManager/PassRegistration.swift | 1 + .../swift/SILOptimizer/PassManager/Passes.def | 5 +- lib/SILOptimizer/PassManager/PassPipeline.cpp | 6 +- lib/SILOptimizer/Transforms/CMakeLists.txt | 3 +- .../Transforms/TempRValueElimination.cpp | 972 ------------------ .../escape_analysis_invalidate.sil | 2 +- test/SILOptimizer/mem-behavior-cache-bug.sil | 2 +- ...il_combine_concrete_existential_ossa.swift | 2 +- test/SILOptimizer/temp_rvalue_opt.sil | 2 +- test/SILOptimizer/temp_rvalue_opt_ossa.sil | 473 +-------- test/SILOptimizer/temp_rvalue_rle.sil | 508 +++++++++ 13 files changed, 1070 insertions(+), 1430 deletions(-) create mode 100644 SwiftCompilerSources/Sources/Optimizer/FunctionPasses/TempRValueElimination.swift delete mode 100644 lib/SILOptimizer/Transforms/TempRValueElimination.cpp create mode 100644 test/SILOptimizer/temp_rvalue_rle.sil diff --git a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/CMakeLists.txt b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/CMakeLists.txt index 66aae9c7ad84c..90a41eebda83f 100644 --- a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/CMakeLists.txt +++ b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/CMakeLists.txt @@ -33,4 +33,5 @@ swift_compiler_sources(Optimizer SimplificationPasses.swift StackPromotion.swift StripObjectHeaders.swift + TempRValueElimination.swift ) diff --git a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/TempRValueElimination.swift b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/TempRValueElimination.swift new file mode 100644 index 0000000000000..130cbce430912 --- /dev/null +++ b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/TempRValueElimination.swift @@ -0,0 +1,523 @@ +//===--- TempRValueElimination.swift ---------------------------------------==// +// +// This source file is part of the Swift.org open source project +// +// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See https://swift.org/LICENSE.txt for license information +// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +// +//===----------------------------------------------------------------------===// + +import AST +import SIL + +/// Eliminates copies to `alloc_stack` "temporaries" (r-values). +/// +/// ``` +/// %temp = alloc_stack $T +/// copy_addr %src to [init] %temp -+ +/// ... | +/// %l = load %temp | no writes to %src or %temp +/// ... | +/// destroy_addr %temp -+ +/// dealloc_stack %temp +/// ``` +/// -> +/// ``` +/// %l = load %src +/// ``` +/// +/// This differs from the copy forwarding algorithm because it handles copy source and dest lifetimes +/// that are unavoidably overlapping. Instead, it finds cases in which it is easy to determine that +/// the source is unmodified during the copy destination's lifetime. Thus, the destination can be viewed +/// as a short-lived "rvalue". +/// +let tempRValueElimination = FunctionPass(name: "temp-rvalue-elimination") { + (function: Function, context: FunctionPassContext) in + + for inst in function.instructions { + if let copyAddr = inst as? CopyAddrInst { + tryEliminate(copy: copyAddr, context) + } + } +} + +private func tryEliminate(copy: CopyAddrInst, _ context: FunctionPassContext) { + // Remove identity copies which may have been created by an earlier iteration, where another `copy_addr` + // copied the `alloc_stack` back to the source location. + if copy.source == copy.destination { + context.erase(instruction: copy) + } + + guard let (allocStack, lastUseOfAllocStack) = getRemovableAllocStackDestination(of: copy, context) else { + return + } + + guard extendAccessScopes(beyond: lastUseOfAllocStack, copy: copy, context) else { + return + } + + if needToInsertDestroy(copy: copy, lastUseOfAllocStack: lastUseOfAllocStack) { + Builder.insert(after: lastUseOfAllocStack, context) { builder in + builder.createDestroyAddr(address: copy.source) + } + } + + for use in allocStack.uses { + switch use.instruction { + case is DestroyAddrInst, is DeallocStackInst: + context.erase(instruction: use.instruction) + case let cai as CopyAddrInst where cai != copy: + if cai.isTakeOfSource, !copy.isTakeOfSource { + // If the original copy is not taking its source, a `copy_addr` from the `allocStack` must + // not take its source either. + assert(cai == lastUseOfAllocStack && cai.source == allocStack) + cai.set(isTakeOfSource: false, context) + } + use.set(to: copy.source, context) + case let load as LoadInst: + if load.loadOwnership == .take, !copy.isTakeOfSource { + // If the original copy is not taking its source, a `load` from the `allocStack` must + // not take its source either. + assert(load == lastUseOfAllocStack) + load.set(ownership: .copy, context) + } + use.set(to: copy.source, context); + + default: + // Note that no operations that may be handled by this default clause can destroy the `allocStack`. + // This includes operations that load the value from memory and release it or cast the address + // before destroying it. + use.set(to: copy.source, context); + } + } + context.erase(instruction: allocStack) + context.erase(instruction: copy) +} + +/// Checks if the `copy` is copying into an `alloc_stack` which is removable: +/// ``` +/// %allocStack = alloc_stack $T +/// copy_addr %src to [init] %allocStack +/// ... +/// %lastUseOfAllocStack = load %allocStack +/// ``` +private func getRemovableAllocStackDestination( + of copy: CopyAddrInst, _ context: FunctionPassContext +) -> (allocStack: AllocStackInst, lastUseOfAllocStack: Instruction)? { + guard copy.isInitializationOfDestination, + let allocStack = copy.destination as? AllocStackInst + else { + return nil + } + + // If the `allocStack` is lexical we can eliminate it if the source of the copy is lexical and + // it is live for longer than the `allocStack`. + if allocStack.isLexical && !copy.source.accessBase.storageIsLexical { + return nil + } + + var allocStackUses = UseCollector(copy: copy, context) + defer { allocStackUses.deinitialize() } + + // Scan all uses of the `allocStack` to verify only the `copy` is writing to it and that all uses + // (except `destroy_addr` and `dealloc_stack`) are in the same basic block. + guard allocStackUses.collectUses(of: allocStack) else { + return nil + } + + // Check that there are no uses of the `allocStack` that precede the copyInst. This can happen with projections. + // TODO: We can enable this case if we clone the projections at "load" uses. + if allocStack.hasUses(before: copy, context) { + return nil + } + + // Check if the source is modified within the lifetime of the 'alloc_stack'. + guard let lastUseOfAllocStack = getLastUseWhileSourceIsNotModified(of: copy, uses: allocStackUses.uses, context) else { + return nil + } + + // We cannot insert the destroy of `copy.source` after `lastUseOfAllocStack` if `copy.source` is + // re-initialized by exactly this instruction. + // This is a corner case, but can happen if `lastUseOfAllocStack` is a `copy_addr`. Example: + // ``` + // copy_addr [take] %src to [init] %allocStack // `copy` + // copy_addr [take] %allocStack to [init] %src // `lastUseOfAllocStack` + // ``` + if copy.isTakeOfSource, + lastUseOfAllocStack != copy, + !(lastUseOfAllocStack is DestroyAddrInst), + lastUseOfAllocStack.mayWrite(toAddress: copy.source, context.aliasAnalysis) + { + return nil + } + + // Bail if in non-OSSA the `allocStack` is destroyed in a non-obvious way, e.g. by + // ``` + // %x = load %allocStack // looks like a load, but is a `load [take]` + // strong_release %x + // ``` + guard copy.parentFunction.hasOwnership || allocStack.isDestroyedOnAllPaths(context) else { + return nil + } + + return (allocStack, lastUseOfAllocStack) +} + +/// We need to insert a final destroy if the original `copy` is taking the source but the +/// `lastUseOfAllocStack` is not taking the `alloc_stack`. +private func needToInsertDestroy(copy: CopyAddrInst, lastUseOfAllocStack: Instruction) -> Bool { + if !copy.isTakeOfSource { + return false + } + switch lastUseOfAllocStack { + case copy: + return true + case let cai as CopyAddrInst: + if cai.isTakeOfSource { + assert(cai.source == copy.destination, "copy_addr must be not take a projected address") + return false + } + return true + case let li as LoadInst: + if li.loadOwnership == .take { + assert(li.address == copy.destination, "load must be not take a projected address") + return false + } + return true + default: + return true + } +} + +private extension AllocStackInst { + func hasUses(before instruction: Instruction, _ context: FunctionPassContext) -> Bool { + var useSet = InstructionSet(context) + defer { useSet.deinitialize() } + + useSet.insert(contentsOf: self.users) + for inst in InstructionList(first: self) { + if inst == instruction { + return false + } + if useSet.contains(inst) { + return true + } + } + return false + } + + /// In non-OSSA, check if the `alloc_stack` destroyed in an obvious way and not e.g. implicitly by + /// ``` + /// %x = load %allocStack // looks like a load, but is a `load [take]` + /// strong_release %x + /// ``` + func isDestroyedOnAllPaths(_ context: FunctionPassContext) -> Bool { + var liferange = InstructionRange(begin: self, context) + defer { liferange.deinitialize() } + + liferange.insert(contentsOf: uses.ignoreUsers(ofType: DeallocStackInst.self).lazy.map { $0.instruction }) + + for use in uses { + switch use.instruction { + case is DeallocStackInst, is DestroyAddrInst: + break + case let c as CopyAddrInst where c.sourceOperand == use && c.isTakeOfSource: + break + default: + if !liferange.contains(use.instruction) { + // A non-destroying instruction is at the end of the liferange -> we are missing a "real" destroy. + return false + } + } + } + return true + } +} + +/// Tries to move an `end_access` down to extend the access scope over all uses of the `alloc_stack`. +/// For example: +/// ``` +/// %a = begin_access %src +/// copy_addr %a to [init] %temp : $*T +/// end_access %a +/// use %temp +/// ``` +/// We must not replace %temp with %a after the `end_access`. Instead we try to move the `end_access` +/// after the last use. +private func extendAccessScopes(beyond lastUse: Instruction, copy: CopyAddrInst, _ context: FunctionPassContext) -> Bool { + var endAccessToMove: EndAccessInst? = nil + + for inst in InstructionList(first: copy.next) { + if let endAccess = inst as? EndAccessInst { + // To keep things simple, we can just move a single `end_access`. Also, we cannot move an + // `end_access` over a (non-aliasing) other `end_access`. + if endAccessToMove != nil { + return false + } + if context.aliasAnalysis.mayAlias(copy.source, endAccess.beginAccess.address), + // There cannot be any aliasing modifying accesses within the liverange of the `alloc_stack`, + // because we would have cought this in `getLastUseWhileSourceIsNotModified`. + // But there are cases where `aliasAnalysis.mayAlias` is less precise than `Instruction.mayWrite`. + // Therefore, just ignore any non-read accesses. + endAccess.beginAccess.accessKind == .read + { + // We cannot move instructions beyond the block's terminator. + if lastUse is TermInst { + return false + } + endAccessToMove = endAccess + } + } else if let endAccessToMove { + // We cannot move an `end_access` over a `begin_access`. This would destroy the proper nesting of accesses. + if inst is BeginAccessInst || inst is BeginUnpairedAccessInst { + return false + } + // Don't extend a read-access scope over a (potential) write. + // Note that `inst` can be a function call containing other access scopes. But doing the `inst.mayWrite` + // check, we know that the function can only contain read accesses (to the same memory location). + // So it's fine to move `endAccessToMove` even over such a function call. + if inst.mayWrite(toAddress: endAccessToMove.beginAccess.address, context.aliasAnalysis) { + return false + } + } + if inst == lastUse { + break + } + } + if let endAccessToMove { + endAccessToMove.move(before: lastUse.next!, context) + } + + return true +} + +/// Checks if the source of `copy` is not modified within the `alloc_stack`'s lifetime, i.e. is not modified +/// before the last use of `uses`. +/// +/// If there are no source modifications with the lifetime, returns the last user. Otherwise returns nil. +/// +/// Unfortunately, we cannot simply use the destroy points as the lifetime end, because they can be in a +/// different basic block. Instead we look for the last non-destroy, non-dealloc use. +private func getLastUseWhileSourceIsNotModified(of copy: CopyAddrInst, + uses: InstructionSetWithCount, + _ context: FunctionPassContext) -> Instruction? +{ + if uses.isEmpty { + return copy + } + var numUsesFound = 0 + let aliasAnalysis = context.aliasAnalysis + + // We already checked that the useful lifetime of the `alloc_stack` ends in the same block as the `copy`. + // Therefore we can limit our search to the instructions of this block. + for inst in InstructionList(first: copy.next) { + if uses.contains(inst) { + numUsesFound += 1 + } + + // If this is the last use of the `alloc_stack` we are okay. After this point, modifications to the source + // don't matter anymore. + // Note that we are assuming here that if an instruction reads and writes to the source at the same time + // (like a `copy_addr` could do), the write takes effect after the read. + if numUsesFound == uses.count { + // Function calls are an exception: in a called function a potential modification of `copy.source` + // could occur _before_ the read of the `alloc_stack`. + switch inst { + case is FullApplySite, is YieldInst: + if inst.mayWrite(toAddress: copy.source, aliasAnalysis) { + return nil + } + return inst + default: + return inst + } + } + + if inst.mayWrite(toAddress: copy.source, aliasAnalysis) { + return nil + } + } + // For some reason, not all normal uses have been seen between the copy and the end of the initialization + // block. We should never reach here. + return nil +} + +/// Collects all uses of the `alloc_stack`. +private struct UseCollector : AddressDefUseWalker { + private(set) var uses: InstructionSetWithCount + private let copy: CopyAddrInst + + init(copy: CopyAddrInst, _ context: FunctionPassContext) { + self.uses = InstructionSetWithCount(context) + self.copy = copy + } + + mutating func collectUses(of allocStack: AllocStackInst) -> Bool { + for use in allocStack.uses { + switch use.instruction { + case copy: + break + case is DeallocStackInst: + // Deallocations are allowed to be in a different block. + break + case let destroyAddr as DestroyAddrInst: + if !destroyAddr.parentFunction.hasOwnership && copy.isTakeOfSource { + // In non-OSSA mode, for the purpose of inserting the destroy of `copy.source`, we have to be + // conservative and assume that the lifetime of `allocStack` goes beyond it's last use - until + // the final `destroy_addr`. Otherwise we would risk inserting the destroy too early. Therefore we + // treat the `destroy_addr` as any other use of `allocStack` and require it to be in the same block. + if destroyAddr.parentBlock != copy.parentBlock { + return false + } + uses.insert(destroyAddr) + } + default: + if walkDown(address: use, path: UnusedWalkingPath()) == .abortWalk { + return false + } + } + } + return true + } + + public mutating func walkDown(address operand: Operand, path: UnusedWalkingPath) -> WalkResult { + if operand.instruction.parentBlock != copy.parentBlock { + // All normal uses (except destroys and `dealloc_stack`) must be in the initialization block. + return .abortWalk + } + switch operand.instruction { + case let openExistential as OpenExistentialAddrInst: + if !openExistential.isImmutable { + return.abortWalk + } + case let takeEnum as UncheckedTakeEnumDataAddrInst: + // In certain cases, `unchecked_take_enum_data_addr` invalidates the underlying memory. Therefore, + // by default` we can not look through it... but this is not true in the case of `Optional`. + // This is an important case for us to handle, so handle it here. + if !takeEnum.enum.type.isOptional { + return .abortWalk + } + case let beginAccess as BeginAccessInst: + if beginAccess.accessKind != .read { + return .abortWalk + } + // We don't have to walk down the `beginAccess` result, because the access kind "read" already + // guarantees that there are no writes to the `beginAccess` result address. But we have to register + // the `end_access`es as uses to correctly mark the end-of-lifetime of the `alloc_stack`. + // ``` + // %addr = begin_access [read] + // ... // there can be no writes to %addr here + // end_access %addr // <- This is where the use actually ends. + // ``` + for endAccess in beginAccess.endAccessInstructions { + if endAccess.parentBlock != copy.parentBlock { + return .abortWalk + } + uses.insert(endAccess) + } + return .continueWalk + default: + break + } + return walkDownDefault(address: operand, path: path) + } + + mutating func leafUse(address: Operand, path: UnusedWalkingPath) -> WalkResult { + if address.isTypeDependent { + return .continueWalk + } + + // Only allow uses that cannot destroy their operand. We need to be sure that replacing all the uses + // with the copy source doesn't destroy the source. + switch address.instruction { + case let beginApply as BeginApplyInst: + // Extend the lifetime of the `alloc_stack` to the 'end_apply'/'abort_apply'. + for tokenUse in beginApply.token.uses { + if tokenUse.instruction.parentBlock != copy.parentBlock { + return .abortWalk + } + uses.insert(tokenUse.instruction) + } + return visitApply(address: address, apply: beginApply) + + case let partialApply as PartialApplyInst: + if !partialApply.isOnStack { + return .abortWalk + } + return visitApply(address: address, apply: partialApply) + + case let apply as ApplySite: + // Remaining applies: `apply` and `try_apply` + return visitApply(address: address, apply: apply) + + case let yield as YieldInst: + if !yield.convention(of: address).isGuaranteed { + return .abortWalk + } + uses.insert(yield) + return .continueWalk + + case let addrCast as UncheckedAddrCastInst: + return walkDownUses(ofAddress: addrCast, path: UnusedWalkingPath()) + + case let load as LoadInst: + if load.loadOwnership == .take, + // Only accept `load [take]` if it takes the whole `alloc_stack`. A `load [take]` from + // a projection would destroy only a part of the `alloc_stack` and we don't handle this. + load.address != copy.destination + { + return .abortWalk + } + uses.insert(load) + return .continueWalk + + case let loadBorrow as LoadBorrowInst: + uses.insert(loadBorrow) + for end in loadBorrow.uses.endingLifetime.users { + if end.parentBlock != copy.parentBlock || end is BranchInst { + return .abortWalk + } + uses.insert(end) + } + return .continueWalk + + case let fixLifetime as FixLifetimeInst: + // After removing the `alloc_stack` the `fix_lifetime` will apply for the `copy.source`. + uses.insert(fixLifetime) + return .continueWalk + + case let copyFromStack as CopyAddrInst: + if copyFromStack.destinationOperand == address { + return .abortWalk + } + // As with `load [take]`, only accept `copy_addr [take]` if it takes the whole `alloc_stack`. + if copyFromStack.isTakeOfSource && copyFromStack.source != copy.destination { + return .abortWalk + } + uses.insert(copyFromStack) + return .continueWalk + + default: + return .abortWalk + } + } + + private mutating func visitApply(address: Operand, apply: ApplySite) -> WalkResult { + if !apply.convention(of: address)!.isGuaranteed { + return .abortWalk + } + uses.insert(apply) + return .continueWalk + } + + public mutating func unmatchedPath(address: Operand, path: UnusedWalkingPath) -> WalkResult { + return .abortWalk + } + + mutating func deinitialize() { + uses.deinitialize() + } +} diff --git a/SwiftCompilerSources/Sources/Optimizer/PassManager/PassRegistration.swift b/SwiftCompilerSources/Sources/Optimizer/PassManager/PassRegistration.swift index 8e67b5090cda0..b5a70e1a30cdb 100644 --- a/SwiftCompilerSources/Sources/Optimizer/PassManager/PassRegistration.swift +++ b/SwiftCompilerSources/Sources/Optimizer/PassManager/PassRegistration.swift @@ -100,6 +100,7 @@ private func registerSwiftPasses() { registerPass(lifetimeDependenceInsertionPass, { lifetimeDependenceInsertionPass.run($0) }) registerPass(lifetimeDependenceScopeFixupPass, { lifetimeDependenceScopeFixupPass.run($0) }) registerPass(copyToBorrowOptimization, { copyToBorrowOptimization.run($0) }) + registerPass(tempRValueElimination, { tempRValueElimination.run($0) }) registerPass(generalClosureSpecialization, { generalClosureSpecialization.run($0) }) registerPass(autodiffClosureSpecialization, { autodiffClosureSpecialization.run($0) }) diff --git a/include/swift/SILOptimizer/PassManager/Passes.def b/include/swift/SILOptimizer/PassManager/Passes.def index 0481faa2ca85c..6b9ad77cad889 100644 --- a/include/swift/SILOptimizer/PassManager/Passes.def +++ b/include/swift/SILOptimizer/PassManager/Passes.def @@ -140,6 +140,9 @@ PASS(StackPromotion, "stack-promotion", "Stack Promotion of Class Objects") PASS(UpdateBorrowedFrom, "update-borrowed-from", "Test pass for update borrowed-from instructions") +PASS(TempRValueElimination, "temp-rvalue-elimination", + "Remove short-lived immutable temporary copies") + // NOTE - ExperimentalSwiftBasedClosureSpecialization and AutodiffClosureSpecialization are a WIP PASS(ExperimentalSwiftBasedClosureSpecialization, "experimental-swift-based-closure-specialization", "General closure-specialization pass written in Swift") @@ -403,8 +406,6 @@ LEGACY_PASS(RawSILInstLowering, "raw-sil-inst-lowering", "Lower all raw SIL instructions to canonical equivalents.") LEGACY_PASS(TempLValueOpt, "temp-lvalue-opt", "Remove short-lived immutable temporary l-values") -LEGACY_PASS(TempRValueOpt, "temp-rvalue-opt", - "Remove short-lived immutable temporary copies") LEGACY_PASS(IRGenPrepare, "irgen-prepare", "Cleanup SIL in preparation for IRGen") LEGACY_PASS(SendNonSendable, "send-non-sendable", diff --git a/lib/SILOptimizer/PassManager/PassPipeline.cpp b/lib/SILOptimizer/PassManager/PassPipeline.cpp index a06683917b801..c6189ec796e41 100644 --- a/lib/SILOptimizer/PassManager/PassPipeline.cpp +++ b/lib/SILOptimizer/PassManager/PassPipeline.cpp @@ -580,7 +580,7 @@ void addFunctionPasses(SILPassPipelinePlan &P, P.addEarlyCodeMotion(); P.addReleaseHoisting(); P.addARCSequenceOpts(); - P.addTempRValueOpt(); + P.addTempRValueElimination(); P.addSimplifyCFG(); if (OpLevel == OptimizationLevelKind::LowLevel) { @@ -636,7 +636,7 @@ static void addPerfEarlyModulePassPipeline(SILPassPipelinePlan &P) { P.addDeadFunctionAndGlobalElimination(); // Cleanup after SILGen: remove trivial copies to temporaries. - P.addTempRValueOpt(); + P.addTempRValueElimination(); // Cleanup after SILGen: remove unneeded borrows/copies. if (P.getOptions().CopyPropagation == CopyPropagationOption::On) { P.addComputeSideEffects(); @@ -656,7 +656,7 @@ static void addPerfEarlyModulePassPipeline(SILPassPipelinePlan &P) { // Cleanup after SILGen: remove trivial copies to temporaries. This version of // temp-rvalue opt is here so that we can hit copies from non-ossa code that // is linked in from the stdlib. - P.addTempRValueOpt(); + P.addTempRValueElimination(); // Add the outliner pass (Osize). P.addOutliner(); diff --git a/lib/SILOptimizer/Transforms/CMakeLists.txt b/lib/SILOptimizer/Transforms/CMakeLists.txt index e2887f039b26a..cc4a35063f39a 100644 --- a/lib/SILOptimizer/Transforms/CMakeLists.txt +++ b/lib/SILOptimizer/Transforms/CMakeLists.txt @@ -33,6 +33,5 @@ target_sources(swiftSILOptimizer PRIVATE Sink.cpp SpeculativeDevirtualizer.cpp StringOptimization.cpp - TempLValueOpt.cpp - TempRValueElimination.cpp) + TempLValueOpt.cpp) diff --git a/lib/SILOptimizer/Transforms/TempRValueElimination.cpp b/lib/SILOptimizer/Transforms/TempRValueElimination.cpp deleted file mode 100644 index 33817d731505e..0000000000000 --- a/lib/SILOptimizer/Transforms/TempRValueElimination.cpp +++ /dev/null @@ -1,972 +0,0 @@ -//===--- TempRValueElimination.cpp ----------------------------------------===// -// -// This source file is part of the Swift.org open source project -// -// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors -// Licensed under Apache License v2.0 with Runtime Library Exception -// -// See https://swift.org/LICENSE.txt for license information -// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors -// -//===----------------------------------------------------------------------===// -/// -/// Eliminate temporary RValues inserted as a result of materialization by -/// SILGen. The key pattern here is that we are looking for alloc_stack that are -/// only written to once and are eventually either destroyed/taken from. -/// -//===----------------------------------------------------------------------===// - -#define DEBUG_TYPE "sil-temp-rvalue-opt" - -#include "swift/Basic/Assertions.h" -#include "swift/SIL/BasicBlockUtils.h" -#include "swift/SIL/DebugUtils.h" -#include "swift/SIL/MemAccessUtils.h" -#include "swift/SIL/NodeBits.h" -#include "swift/SIL/OSSALifetimeCompletion.h" -#include "swift/SIL/OwnershipUtils.h" -#include "swift/SIL/SILArgument.h" -#include "swift/SIL/SILBuilder.h" -#include "swift/SIL/SILVisitor.h" -#include "swift/SILOptimizer/Analysis/AliasAnalysis.h" -#include "swift/SILOptimizer/Analysis/DominanceAnalysis.h" -#include "swift/SILOptimizer/Analysis/PostOrderAnalysis.h" -#include "swift/SILOptimizer/Analysis/RCIdentityAnalysis.h" -#include "swift/SILOptimizer/Analysis/SimplifyInstruction.h" -#include "swift/SILOptimizer/PassManager/Passes.h" -#include "swift/SILOptimizer/PassManager/Transforms.h" -#include "swift/SILOptimizer/Utils/CFGOptUtils.h" -#include "swift/SILOptimizer/Utils/ValueLifetime.h" -#include "llvm/ADT/SetVector.h" -#include "llvm/ADT/Statistic.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/Debug.h" - -using namespace swift; - -//===----------------------------------------------------------------------===// -// Interface -//===----------------------------------------------------------------------===// - -namespace { - -/// Temporary RValue Optimization -/// -/// Peephole optimization to eliminate short-lived immutable temporary copies. -/// This handles a common pattern generated by SILGen where temporary RValues -/// are emitted as copies... -/// -/// %temp = alloc_stack $T -/// copy_addr %src to [init] %temp : $*T -/// // no writes to %src or %temp -/// destroy_addr %temp : $*T -/// dealloc_stack %temp : $*T -/// -/// This differs from the copy forwarding algorithm because it handles -/// copy source and dest lifetimes that are unavoidably overlapping. Instead, -/// it finds cases in which it is easy to determine that the source is -/// unmodified during the copy destination's lifetime. Thus, the destination can -/// be viewed as a short-lived "rvalue". -/// -/// As a second optimization, also stores into temporaries are handled. This is -/// a simple form of redundant-load-elimination (RLE). -/// -/// %temp = alloc_stack $T -/// store %src to [init] %temp : $*T -/// // no writes to %temp -/// %v = load [take] %temp : $*T -/// dealloc_stack %temp : $*T -/// -/// TODO: Check if we still need to handle stores when RLE supports OSSA. -class TempRValueOptPass : public SILFunctionTransform { - bool collectLoads(Operand *addressUse, CopyAddrInst *originalCopy, - InstructionSetWithSize &loadInsts); - bool collectLoadsFromProjection(SingleValueInstruction *projection, - CopyAddrInst *originalCopy, - InstructionSetWithSize &loadInsts); - - SILInstruction *getLastUseWhileSourceIsNotModified( - CopyAddrInst *copyInst, const InstructionSetWithSize &useInsts, - AliasAnalysis *aa); - - bool - checkTempObjectDestroy(AllocStackInst *tempObj, CopyAddrInst *copyInst); - - bool extendAccessScopes(CopyAddrInst *copyInst, SILInstruction *lastUseInst, - AliasAnalysis *aa); - - void tryOptimizeCopyIntoTemp(CopyAddrInst *copyInst); - SILBasicBlock::iterator tryOptimizeStoreIntoTemp(StoreInst *si); - - void run() override; -}; - -} // anonymous namespace - -bool TempRValueOptPass::collectLoadsFromProjection( - SingleValueInstruction *projection, CopyAddrInst *originalCopy, - InstructionSetWithSize &loadInsts) { - // Transitively look through projections on stack addresses. - for (auto *projUseOper : projection->getUses()) { - auto *user = projUseOper->getUser(); - if (user->isTypeDependentOperand(*projUseOper)) - continue; - - if (!collectLoads(projUseOper, originalCopy, loadInsts)) - return false; - } - return true; -} - -/// Transitively explore all data flow uses of the given \p address until -/// reaching a load or returning false. -/// -/// Any user opcode recognized by collectLoads must be replaced correctly later -/// during tryOptimizeCopyIntoTemp. If it is possible for any use to destroy the -/// value in \p address, then that use must be removed or made non-destructive -/// after the copy is removed and its operand is replaced. -/// -/// Warning: To preserve the original object lifetime, tryOptimizeCopyIntoTemp -/// must assume that there are no holes in lifetime of the temporary stack -/// location at \address. The temporary must be initialized by the original copy -/// and never written to again. Therefore, collectLoads disallows any operation -/// that may write to memory at \p address. -bool TempRValueOptPass:: -collectLoads(Operand *addressUse, CopyAddrInst *originalCopy, - InstructionSetWithSize &loadInsts) { - SILInstruction *user = addressUse->getUser(); - SILValue address = addressUse->get(); - - // All normal uses (loads) must be in the initialization block. - // (The destroy and dealloc are commonly in a different block though.) - SILBasicBlock *block = originalCopy->getParent(); - if (user->getParent() != block) - return false; - - // Only allow uses that cannot destroy their operand. We need to be sure - // that replacing all this temporary's uses with the copy source doesn't - // destroy the source. This way, we know that the destroy_addr instructions - // that we recorded cover all the temporary's lifetime termination points. - // - // Currently this includes address projections, loads, and in_guaranteed uses - // by an apply. - // - // TODO: handle non-destructive projections of enums - // (unchecked_take_enum_data_addr of Optional is nondestructive.) - switch (user->getKind()) { - default: - LLVM_DEBUG(llvm::dbgs() - << " Temp use may write/destroy its source" << *user); - return false; - case SILInstructionKind::BeginAccessInst: { - auto *beginAccess = cast(user); - if (beginAccess->getAccessKind() != SILAccessKind::Read) - return false; - - // We don't have to recursively call collectLoads for the beginAccess - // result, because a SILAccessKind::Read already guarantees that there are - // no writes to the beginAccess result address (or any projection from it). - // But we have to register the end-accesses as loads to correctly mark the - // end-of-lifetime of the tempObj. - // - // %addr = begin_access [read] - // ... // there can be no writes to %addr here - // end_access %addr // <- This is where the use actually ends. - for (EndAccessInst *endAccess : beginAccess->getEndAccesses()) { - if (endAccess->getParent() != block) - return false; - loadInsts.insert(endAccess); - } - return true; - } - case SILInstructionKind::MarkDependenceInst: { - auto mdi = cast(user); - if (mdi->getBase() == address) { - // We want to keep the original lifetime of the base. If we would eliminate - // the base alloc_stack, we risk to insert a destroy_addr too early. - return false; - } - // If the user is the value operand of the MarkDependenceInst we have to - // transitively explore its uses until we reach a load or return false - for (auto *mdiUseOper : mdi->getUses()) { - if (!collectLoads(mdiUseOper, originalCopy, loadInsts)) - return false; - } - return true; - } - case SILInstructionKind::PartialApplyInst: - if (!cast(user)->isOnStack()) - return false; - LLVM_FALLTHROUGH; - case SILInstructionKind::ApplyInst: - case SILInstructionKind::TryApplyInst: - case SILInstructionKind::BeginApplyInst: { - auto convention = ApplySite(user).getArgumentConvention(*addressUse); - if (!convention.isGuaranteedConventionInCaller()) - return false; - - loadInsts.insert(user); - if (auto *beginApply = dyn_cast(user)) { - // Register 'end_apply'/'abort_apply' as loads as well - // 'checkNoSourceModification' should check instructions until - // 'end_apply'/'abort_apply'. - for (auto *tokenUse : beginApply->getEndApplyUses()) { - auto *tokenUser = tokenUse->getUser(); - if (tokenUser->getParent() != block) - return false; - loadInsts.insert(tokenUser); - } - } - return true; - } - case SILInstructionKind::YieldInst: { - auto *yield = cast(user); - auto convention = yield->getArgumentConventionForOperand(*addressUse); - if (!convention.isGuaranteedConventionInCaller()) - return false; - - loadInsts.insert(user); - return true; - } - case SILInstructionKind::OpenExistentialAddrInst: { - // We only support open existential addr if the access is immutable. - auto *oeai = cast(user); - if (oeai->getAccessKind() != OpenedExistentialAccess::Immutable) { - LLVM_DEBUG(llvm::dbgs() << " Temp consuming use may write/destroy " - "its source" - << *user); - return false; - } - return collectLoadsFromProjection(oeai, originalCopy, loadInsts); - } - case SILInstructionKind::UncheckedTakeEnumDataAddrInst: { - // In certain cases, unchecked_take_enum_data_addr invalidates the - // underlying memory, so by default we can not look through it... but this - // is not true in the case of Optional. This is an important case for us to - // handle, so handle it here. - auto *utedai = cast(user); - if (!utedai->getOperand()->getType().getOptionalObjectType()) { - LLVM_DEBUG(llvm::dbgs() - << " Temp use may write/destroy its source" << *utedai); - return false; - } - - return collectLoadsFromProjection(utedai, originalCopy, loadInsts); - } - case SILInstructionKind::StructElementAddrInst: - case SILInstructionKind::TupleElementAddrInst: - case SILInstructionKind::UncheckedAddrCastInst: - return collectLoadsFromProjection(cast(user), - originalCopy, loadInsts); - - case SILInstructionKind::LoadInst: { - // Loads are the end of the data flow chain. The users of the load can't - // access the temporary storage. - // - // That being said, if we see a load [take] here then we must have had a - // load [take] of a projection of our temporary stack location since we skip - // all the load [take] of the top level allocation in the caller of this - // function. So if we have such a load [take], we /must/ have a - // reinitialization or an alloc_stack that does not fit the pattern we are - // expecting from SILGen. Be conservative and return false. - auto *li = cast(user); - if (li->getOwnershipQualifier() == LoadOwnershipQualifier::Take && - // Only accept load [take] if it takes the whole temporary object. - // load [take] from a projection would destroy only a part of the - // temporary and we don't handle this. - address != originalCopy->getDest()) { - return false; - } - loadInsts.insert(user); - return true; - } - case SILInstructionKind::LoadBorrowInst: { - loadInsts.insert(user); - BorrowedValue borrow(cast(user)); - auto visitEndScope = [&](Operand *op) -> bool { - auto *opUser = op->getUser(); - if (auto *endBorrow = dyn_cast(opUser)) { - if (endBorrow->getParent() != block) - return false; - loadInsts.insert(endBorrow); - return true; - } - // Don't look further if we see a reborrow. - assert(cast(opUser)); - return false; - }; - auto res = borrow.visitLocalScopeEndingUses(visitEndScope); - return res; - } - case SILInstructionKind::FixLifetimeInst: - // If we have a fixed lifetime on our alloc_stack, we can just treat it like - // a load and re-write it so that it is on the old memory or old src object. - loadInsts.insert(user); - return true; - case SILInstructionKind::CopyAddrInst: { - // copy_addr which read from the temporary are like loads. - auto *copyFromTmp = cast(user); - if (copyFromTmp->getDest() == address) { - LLVM_DEBUG(llvm::dbgs() << " Temp written or taken" << *user); - return false; - } - // As with load [take], only accept copy_addr [take] if it takes the whole - // temporary object. - if (copyFromTmp->isTakeOfSrc() && address != originalCopy->getDest()) - return false; - loadInsts.insert(copyFromTmp); - return true; - } - } -} - -/// Checks if the source of \p copyInst is not modified within the temporary's -/// lifetime, i.e. is not modified before the last use of \p useInsts. -/// -/// If there are no source modifications with the lifetime, returns the last -/// user (or copyInst if there are no uses at all). -/// Otherwise, returns a nullptr. -/// -/// Unfortunately, we cannot simply use the destroy points as the lifetime end, -/// because they can be in a different basic block (that's what SILGen -/// generates). Instead we guarantee that all normal uses are within the block -/// of the temporary and look for the last use, which effectively ends the -/// lifetime. -SILInstruction *TempRValueOptPass::getLastUseWhileSourceIsNotModified( - CopyAddrInst *copyInst, const InstructionSetWithSize &useInsts, - AliasAnalysis *aa) { - if (useInsts.empty()) - return copyInst; - unsigned numLoadsFound = 0; - SILValue copySrc = copyInst->getSrc(); - - // We already checked that the useful lifetime of the temporary ends in - // the initialization block. Iterate over the instructions of the block, - // starting at copyInst, until we get to the last user. - auto iter = std::next(copyInst->getIterator()); - auto iterEnd = copyInst->getParent()->end(); - for (; iter != iterEnd; ++iter) { - SILInstruction *inst = &*iter; - - if (useInsts.contains(inst)) - ++numLoadsFound; - - // If this is the last use of the temp we are ok. After this point, - // modifications to the source don't matter anymore. - // Note that we are assuming here that if an instruction loads and writes - // to copySrc at the same time (like a copy_addr could do), the write - // takes effect after the load. - if (numLoadsFound == useInsts.size()) { - // Function calls are an exception: in a called function a potential - // modification of copySrc could occur _before_ the read of the temporary. - if ((FullApplySite::isa(inst) || isa(inst)) && - aa->mayWriteToMemory(inst, copySrc)) { - return nullptr; - } - - return inst; - } - - if (aa->mayWriteToMemory(inst, copySrc)) { - LLVM_DEBUG(llvm::dbgs() << " Source modified by" << *iter); - return nullptr; - } - } - // For some reason, not all normal uses have been seen between the copy and - // the end of the initialization block. We should never reach here. - return nullptr; -} - -/// Tries to move an end_access down to extend the access scope over all uses -/// of the temporary. For example: -/// -/// %a = begin_access %src -/// copy_addr %a to [init] %temp : $*T -/// end_access %a -/// use %temp -/// -/// We must not replace %temp with %a after the end_access. Instead we try to -/// move the end_access after "use %temp". -bool TempRValueOptPass::extendAccessScopes( - CopyAddrInst *copyInst, SILInstruction *lastUseInst, AliasAnalysis *aa) { - - SILValue copySrc = copyInst->getSrc(); - EndAccessInst *endAccessToMove = nullptr; - auto begin = std::next(copyInst->getIterator()); - auto end = std::next(lastUseInst->getIterator()); - - for (SILInstruction &inst : make_range(begin, end)) { - if (auto *endAccess = dyn_cast(&inst)) { - // To keep things simple, we can just move a single end_access. Also, we - // cannot move an end_access over a (non-aliasing) end_access. - if (endAccessToMove) - return false; - // Is this the end of an access scope of the copy-source? - if (aa->mayAlias(copySrc, endAccess->getSource()) && - - // There cannot be any aliasing modifying accesses within the - // liverange of the temporary, because we would have cought this in - // `getLastUseWhileSourceIsNotModified`. - // But there are cases where `AliasAnalysis::isNoAlias` is less - // precise than `AliasAnalysis::mayWriteToMemory`. Therefore, just - // ignore any non-read accesses. - endAccess->getBeginAccess()->getAccessKind() == SILAccessKind::Read) { - - // Don't move instructions beyond the block's terminator. - if (isa(lastUseInst)) - return false; - - endAccessToMove = endAccess; - } - } else if (endAccessToMove) { - // We cannot move an end_access over a begin_access. This would destroy - // the proper nesting of accesses. - if (isa(&inst) || isa(inst)) - return false; - // Don't extend a read-access scope over a (potential) write. - // Note that inst can be a function call containing other access scopes. - // But doing the mayWriteToMemory check, we know that the function can - // only contain read accesses (to the same memory location). So it's fine - // to move endAccessToMove even over such a function call. - if (aa->mayWriteToMemory(&inst, endAccessToMove->getSource())) - return false; - } - } - if (endAccessToMove) - endAccessToMove->moveAfter(lastUseInst); - - return true; -} - -/// Return true if the \p tempObj, which is initialized by \p copyInst, is -/// destroyed in an orthodox way. -/// -/// When tryOptimizeCopyIntoTemp replaces all of tempObj's uses, it assumes that -/// the object is initialized by the original copy and directly destroyed on all -/// paths by one of the recognized 'destroy_addr' or 'copy_addr [take]' -/// operations. This assumption must be checked. For example, in non-OSSA, -/// it is legal to destroy an in-memory object by loading the value and -/// releasing it. Rather than detecting unbalanced load releases, simply check -/// that tempObj is destroyed directly on all paths. -bool TempRValueOptPass::checkTempObjectDestroy( - AllocStackInst *tempObj, CopyAddrInst *copyInst) { - // ValueLifetimeAnalysis is not normally used for address types. It does not - // reason about the lifetime of the in-memory object. However the utility can - // be abused here to check that the address is directly destroyed on all - // paths. collectLoads has already guaranteed that tempObj's lifetime has no - // holes/reinitializations. - SmallVector users; - for (auto result : tempObj->getResults()) { - for (Operand *operand : result->getUses()) { - SILInstruction *user = operand->getUser(); - if (user == copyInst) - continue; - if (isa(user)) - continue; - users.push_back(user); - } - } - // Find the boundary of tempObj's address lifetime, starting at copyInst. - ValueLifetimeAnalysis vla(copyInst, users); - ValueLifetimeAnalysis::Frontier tempAddressFrontier; - if (!vla.computeFrontier(tempAddressFrontier, - ValueLifetimeAnalysis::DontModifyCFG)) { - return false; - } - // Check that the lifetime boundary ends at direct destroy points. - for (SILInstruction *frontierInst : tempAddressFrontier) { - auto pos = frontierInst->getIterator(); - // If the frontier is at the head of a block, then either it is an - // unexpected lifetime exit, or the lifetime ended at a - // terminator. TempRValueOptPass does not handle either case. - if (pos == frontierInst->getParent()->begin()) - return false; - - // Look for a known destroy point as described in the function level - // comment. This allowlist can be expanded as more cases are handled in - // tryOptimizeCopyIntoTemp during copy replacement. - SILInstruction *lastUser = &*std::prev(pos); - if (isa(lastUser)) - continue; - - if (auto *cai = dyn_cast(lastUser)) { - assert(cai->getSrc() == tempObj && "collectLoads checks for writes"); - if (cai->isTakeOfSrc()) - continue; - } - return false; - } - return true; -} - -/// Tries to perform the temporary rvalue copy elimination for \p copyInst -void TempRValueOptPass::tryOptimizeCopyIntoTemp(CopyAddrInst *copyInst) { - if (!copyInst->isInitializationOfDest()) - return; - - auto *tempObj = dyn_cast(copyInst->getDest()); - if (!tempObj) - return; - - // If the temporary storage is lexical, it either came from a source-level var - // or was marked lexical because it was passed to a function that has been - // inlined. - // TODO: [begin_borrow_addr] Once we can mark addresses as being borrowed, we - // won't need to mark alloc_stacks lexical during inlining. At that - // point, the above comment should change, but the implementation - // remains the same. - // - // In either case, we can eliminate the temporary if the source of the copy is - // lexical and it is live for longer than the temporary. - if (tempObj->isLexical()) { - // TODO: Determine whether the base of the copy_addr's source is lexical and - // its live range contains the range in which the alloc_stack - // contains the value copied into it via the copy_addr. - // - // For now, only look for guaranteed arguments. - auto storage = AccessStorageWithBase::compute(copyInst->getSrc()); - if (!storage.base) - return; - if (auto *arg = dyn_cast(storage.base)) - if (!arg->getArgumentConvention().isGuaranteedConventionInCallee()) - return; - } - - bool isOSSA = copyInst->getFunction()->hasOwnership(); - - SILValue copySrc = copyInst->getSrc(); - assert(tempObj != copySrc && "can't initialize temporary with itself"); - - // If the source of the copyInst is taken, it must be deinitialized (via - // destroy_addr, load [take], copy_addr [take]). This must be done at the - // right spot: after the last use tempObj, but before any (potential) - // re-initialization of the source. - bool needFinalDeinit = copyInst->isTakeOfSrc(); - - // Scan all uses of the temporary storage (tempObj) to verify they all refer - // to the value initialized by this copy. It is sufficient to check that the - // only users that modify memory are the copy_addr [initialization] and - // destroy_addr. - InstructionSetWithSize loadInsts(getFunction()); - // Set of tempObj users - InstructionSet userSet(getFunction()); - for (auto *useOper : tempObj->getUses()) { - SILInstruction *user = useOper->getUser(); - - userSet.insert(user); - - if (user == copyInst) - continue; - - // Deallocations are allowed to be in a different block. - if (isa(user)) - continue; - - // Also, destroys are allowed to be in a different block. - if (isa(user)) { - if (!isOSSA && needFinalDeinit) { - // In non-OSSA mode, for the purpose of inserting the destroy of - // copySrc, we have to be conservative and assume that the lifetime of - // tempObj goes beyond it's last use - until the final destroy_addr. - // Otherwise we would risk of inserting the destroy too early. - // So we just treat the destroy_addr as any other use of tempObj. - if (user->getParent() != copyInst->getParent()) - return; - loadInsts.insert(user); - } - continue; - } - - if (!collectLoads(useOper, copyInst, loadInsts)) - return; - } - - // Check and return without optimization if we have any users of tempObj that - // precede the copyInst. - // This can happen with projections. - // TODO: We can enable this case if we clone the projections at "load" uses - - // All instructions in userSet are in the same block as copyInst. collectLoads - // ensures of this. - for (SILInstruction &inst : llvm::make_range(copyInst->getParent()->begin(), - copyInst->getIterator())) { - if (userSet.contains(&inst)) { - return; - } - } - - AliasAnalysis *aa = getPassManager()->getAnalysis(getFunction()); - - // Check if the source is modified within the lifetime of the temporary. - SILInstruction *lastLoadInst = - getLastUseWhileSourceIsNotModified(copyInst, loadInsts, aa); - if (!lastLoadInst) - return; - - // We cannot insert the destroy of copySrc after lastLoadInst if copySrc is - // re-initialized by exactly this instruction. - // This is a corner case, but can happen if lastLoadInst is a copy_addr. - // Example: - // copy_addr [take] %copySrc to [init] %tempObj // copyInst - // copy_addr [take] %tempObj to [init] %copySrc // lastLoadInst - if (needFinalDeinit && lastLoadInst != copyInst && - !isa(lastLoadInst) && - aa->mayWriteToMemory(lastLoadInst, copySrc)) - return; - - if (!isOSSA && !checkTempObjectDestroy(tempObj, copyInst)) - return; - - if (!extendAccessScopes(copyInst, lastLoadInst, aa)) - return; - - LLVM_DEBUG(llvm::dbgs() << " Success: replace temp" << *tempObj); - - // If copyInst's source must be deinitialized, whether that must be done via - // a newly created destroy_addr. - // - // If lastLoadInst is a load or a copy_addr, then the deinitialization can be - // done in that instruction. - // - // This is necessary for correctness: otherwise, copies of move-only values - // would be introduced. - bool needToInsertDestroy = [&]() { - if (!needFinalDeinit) - return false; - if (lastLoadInst == copyInst) - return true; - if (auto *cai = dyn_cast(lastLoadInst)) { - if (cai->getSrc() == tempObj && cai->isTakeOfSrc()) { - // This copy_addr [take] will perform the final deinitialization. - return false; - } - return true; - } - if (auto *li = dyn_cast(lastLoadInst)) { - if (li->getOperand() == tempObj && - li->getOwnershipQualifier() == LoadOwnershipQualifier::Take) { - // This load [take] will perform the final deinitialization. - return false; - } - return true; - } - return true; - }(); - if (needToInsertDestroy) { - // Compensate the [take] of the original copyInst. - SILBuilderWithScope::insertAfter(lastLoadInst, [&] (SILBuilder &builder) { - builder.createDestroyAddr(builder.getInsertionPoint()->getLoc(), copySrc); - }); - } - - // * Replace all uses of the tempObj with the copySrc. - // - // * Delete the destroy(s) of tempObj (to compensate the removal of the - // original copyInst): either by erasing the destroy_addr or by converting - // load/copy_addr [take] into copying instructions. - // - // Note: we must not delete the original copyInst because it would crash the - // instruction iteration in run(). Instead the copyInst gets identical Src and - // Dest operands. - while (!tempObj->use_empty()) { - Operand *use = *tempObj->use_begin(); - SILInstruction *user = use->getUser(); - - switch (user->getKind()) { - case SILInstructionKind::DestroyAddrInst: - case SILInstructionKind::DeallocStackInst: - user->eraseFromParent(); - break; - case SILInstructionKind::CopyAddrInst: { - auto *cai = cast(user); - if (cai != copyInst) { - assert(cai->getSrc() == tempObj); - if (cai->isTakeOfSrc() && (!needFinalDeinit || lastLoadInst != cai)) { - cai->setIsTakeOfSrc(IsNotTake); - } - } - use->set(copySrc); - break; - } - case SILInstructionKind::LoadInst: { - auto *li = cast(user); - if (li->getOwnershipQualifier() == LoadOwnershipQualifier::Take && - (!needFinalDeinit || li != lastLoadInst)) { - li->setOwnershipQualifier(LoadOwnershipQualifier::Copy); - } - use->set(copySrc); - break; - } - - // ASSUMPTION: no operations that may be handled by this default clause can - // destroy tempObj. This includes operations that load the value from memory - // and release it or cast the address before destroying it. - default: - use->set(copySrc); - break; - } - } - - tempObj->eraseFromParent(); - invalidateAnalysis(SILAnalysis::InvalidationKind::Instructions); -} - -SILBasicBlock::iterator -TempRValueOptPass::tryOptimizeStoreIntoTemp(StoreInst *si) { - // If our store is an assign, bail. - if (si->getOwnershipQualifier() == StoreOwnershipQualifier::Assign) - return std::next(si->getIterator()); - - auto *tempObj = dyn_cast(si->getDest()); - if (!tempObj) { - return std::next(si->getIterator()); - } - - // If the temporary storage is lexical, it either came from a source-level var - // or was marked lexical because it was passed to a function that has been - // inlined. - // TODO: [begin_borrow_addr] Once we can mark addresses as being borrowed, we - // won't need to mark alloc_stacks lexical during inlining. At that - // point, the above comment should change, but the implementation - // remains the same. - // - // In either case, we can eliminate the temporary if the source of the store - // is lexical and it is live for longer than the temporary. - if (tempObj->isLexical()) { - // TODO: Find the lexical root of the source, if any, and allow optimization - // if its live range contains the range in which the alloc_stack - // contains the value stored into it. - return std::next(si->getIterator()); - } - - // If our tempObj has a dynamic lifetime (meaning it is conditionally - // initialized, conditionally taken, etc), we can not convert its uses to SSA - // while eliminating it simply. So bail. - if (tempObj->hasDynamicLifetime()) { - return std::next(si->getIterator()); - } - - // Scan all uses of the temporary storage (tempObj) to verify they all refer - // to the value initialized by this copy. It is sufficient to check that the - // only users that modify memory are the copy_addr [initialization] and - // destroy_addr. - for (auto *useOper : tempObj->getUses()) { - SILInstruction *user = useOper->getUser(); - - if (user == si) - continue; - - // Bail if there is any kind of user which is not handled in the code below. - switch (user->getKind()) { - case SILInstructionKind::DestroyAddrInst: - case SILInstructionKind::DeallocStackInst: - case SILInstructionKind::LoadInst: - case SILInstructionKind::FixLifetimeInst: - break; - case SILInstructionKind::CopyAddrInst: - if (cast(user)->getDest() == tempObj) - return std::next(si->getIterator()); - break; - case SILInstructionKind::MarkDependenceInst: - if (cast(user)->getValue() == tempObj) - return std::next(si->getIterator()); - break; - default: - return std::next(si->getIterator()); - } - } - - // Since store is always a consuming operation, we do not need to worry about - // any lifetime constraints and can just replace all of the uses here. This - // contrasts with the copy_addr implementation where we need to consider the - // possibility that the source address is written to. - LLVM_DEBUG(llvm::dbgs() << " Success: replace temp" << *tempObj); - - // Do a "replaceAllUses" by either deleting the users or replacing them with - // the appropriate operation on the source value. - SmallVector toDelete; - for (auto *use : tempObj->getUses()) { - // If our store is the user, just skip it. - if (use->getUser() == si) { - continue; - } - - SILInstruction *user = use->getUser(); - switch (user->getKind()) { - case SILInstructionKind::DestroyAddrInst: { - SILBuilderWithScope builder(user); - builder.emitDestroyValueOperation(user->getLoc(), si->getSrc()); - toDelete.push_back(user); - break; - } - case SILInstructionKind::DeallocStackInst: - toDelete.push_back(user); - break; - case SILInstructionKind::CopyAddrInst: { - auto *cai = cast(user); - assert(cai->getSrc() == tempObj); - SILBuilderWithScope builder(user); - auto qualifier = cai->isInitializationOfDest() - ? StoreOwnershipQualifier::Init - : StoreOwnershipQualifier::Assign; - SILValue src = si->getSrc(); - if (!cai->isTakeOfSrc()) { - src = builder.emitCopyValueOperation(cai->getLoc(), src); - } - builder.emitStoreValueOperation(cai->getLoc(), src, cai->getDest(), - qualifier); - toDelete.push_back(cai); - break; - } - case SILInstructionKind::LoadInst: { - // Since store is always forwarding, we know that we should have our own - // value here. So, we should be able to just RAUW any load [take] and - // insert a copy + RAUW for any load [copy]. - auto *li = cast(user); - SILValue srcObject = si->getSrc(); - if (li->getOwnershipQualifier() == LoadOwnershipQualifier::Copy) { - SILBuilderWithScope builder(li); - srcObject = builder.emitCopyValueOperation(li->getLoc(), srcObject); - } - li->replaceAllUsesWith(srcObject); - toDelete.push_back(li); - break; - } - case SILInstructionKind::FixLifetimeInst: { - auto *fli = cast(user); - SILBuilderWithScope builder(fli); - builder.createFixLifetime(fli->getLoc(), si->getSrc()); - toDelete.push_back(fli); - break; - } - case SILInstructionKind::MarkDependenceInst: { - auto mdi = cast(user); - assert(mdi->getBase() == tempObj); - SILBuilderWithScope builder(user); - auto newInst = builder.createMarkDependence(user->getLoc(), - mdi->getValue(), - si->getSrc(), - mdi->dependenceKind()); - mdi->replaceAllUsesWith(newInst); - toDelete.push_back(mdi); - break; - } - // ASSUMPTION: no operations that may be handled by this default clause can - // destroy tempObj. This includes operations that load the value from memory - // and release it. - default: - llvm::errs() << "Unhandled user: " << *user; - llvm_unreachable("Unhandled case?!"); - break; - } - } - - while (!toDelete.empty()) { - auto *inst = toDelete.pop_back_val(); - inst->dropAllReferences(); - inst->eraseFromParent(); - } - auto nextIter = std::next(si->getIterator()); - si->eraseFromParent(); - tempObj->eraseFromParent(); - invalidateAnalysis(SILAnalysis::InvalidationKind::Instructions); - - return nextIter; -} - -//===----------------------------------------------------------------------===// -// High Level Entrypoint -//===----------------------------------------------------------------------===// - -/// The main entry point of the pass. -void TempRValueOptPass::run() { - auto *function = getFunction(); - - auto *da = PM->getAnalysis(); - - LLVM_DEBUG(llvm::dbgs() << "Copy Peephole in Func " << function->getName() - << "\n"); - - SmallVector valuesToComplete; - - // Find all copy_addr instructions. - llvm::SmallSetVector deadCopies; - - for (auto &block : *function) { - // Increment the instruction iterator only after calling - // tryOptimizeCopyIntoTemp because the instruction after CopyInst might be - // deleted, but copyInst itself won't be deleted until later. - for (auto ii = block.begin(); ii != block.end();) { - if (auto *copyInst = dyn_cast(&*ii)) { - // In case of success, this may delete instructions, but not the - // CopyInst itself. - tryOptimizeCopyIntoTemp(copyInst); - // Remove identity copies which either directly result from successfully - // calling tryOptimizeCopyIntoTemp or was created by an earlier - // iteration, where another copy_addr copied the temporary back to the - // source location. - if (copyInst->getSrc() == copyInst->getDest()) { - deadCopies.insert(copyInst); - } - ++ii; - continue; - } - - if (auto *si = dyn_cast(&*ii)) { - auto stored = si->getSrc(); - bool isOrHasEnum = stored->getType().isOrHasEnum(); - auto nextIter = std::next(si->getIterator()); - - ii = tryOptimizeStoreIntoTemp(si); - - // If the optimization was successful, and the stack loc was an enum - // type, collect the stored value for lifetime completion. - // This is needed because we can have incomplete address lifetimes on - // none/trivial paths for an enum type. Once we convert to value form, - // this will cause incomplete value lifetimes which can raise ownership - // verification errors, because we rely on linear lifetimes in OSSA. - if (ii == nextIter && isOrHasEnum) { - valuesToComplete.push_back(stored); - } - continue; - } - - ++ii; - } - } - - auto callbacks = InstModCallbacks().onDelete( - [](SILInstruction *instToKill) { - // SimplifyInstruction is not in the business of removing - // copy_addr. If it were, then we would need to update deadCopies. - assert(!isa(instToKill)); - instToKill->eraseFromParent(); - } - ); - - DeadEndBlocks deBlocks(function); - for (auto *deadCopy : deadCopies) { - auto *srcInst = deadCopy->getSrc()->getDefiningInstruction(); - deadCopy->eraseFromParent(); - // Simplify any access scope markers that were only used by the dead - // copy_addr and other potentially unused addresses. - if (srcInst) { - simplifyAndReplaceAllSimplifiedUsesAndErase(srcInst, callbacks, &deBlocks); - } - } - - // Call the utlity to complete ossa lifetime. - bool completedAny = false; - OSSALifetimeCompletion completion(function, da->get(function), deBlocks); - for (auto it : valuesToComplete) { - auto completed = completion.completeOSSALifetime( - it, OSSALifetimeCompletion::Boundary::Liveness); - completedAny = (completed == LifetimeCompletion::WasCompleted); - } - - if (!deadCopies.empty() || completedAny) { - invalidateAnalysis(SILAnalysis::InvalidationKind::Instructions); - } -} - -SILTransform *swift::createTempRValueOpt() { return new TempRValueOptPass(); } diff --git a/test/SILOptimizer/escape_analysis_invalidate.sil b/test/SILOptimizer/escape_analysis_invalidate.sil index 2125b5374c54a..1fbadb022939c 100644 --- a/test/SILOptimizer/escape_analysis_invalidate.sil +++ b/test/SILOptimizer/escape_analysis_invalidate.sil @@ -1,4 +1,4 @@ -// RUN: %target-sil-opt -sil-print-types %s -compute-escape-effects -compute-side-effects -temp-rvalue-opt -enable-sil-verify-all -wmo | %FileCheck %s +// RUN: %target-sil-opt -sil-print-types %s -compute-escape-effects -compute-side-effects -temp-rvalue-elimination -enable-sil-verify-all -wmo | %FileCheck %s // REQUIRES: swift_in_compiler diff --git a/test/SILOptimizer/mem-behavior-cache-bug.sil b/test/SILOptimizer/mem-behavior-cache-bug.sil index caeff7e6e62a2..a532709834568 100644 --- a/test/SILOptimizer/mem-behavior-cache-bug.sil +++ b/test/SILOptimizer/mem-behavior-cache-bug.sil @@ -1,4 +1,4 @@ -// RUN: %sil-opt -temp-rvalue-opt %s -o /dev/null +// RUN: %sil-opt -temp-rvalue-elimination %s -o /dev/null // This test exposes a bug in the MemBehavior cache invalidation mechanism. // With this bug, the optimizer aborts with a SIL memory lifetime failure diff --git a/test/SILOptimizer/sil_combine_concrete_existential_ossa.swift b/test/SILOptimizer/sil_combine_concrete_existential_ossa.swift index d42cee1a6f004..4012e8e439400 100644 --- a/test/SILOptimizer/sil_combine_concrete_existential_ossa.swift +++ b/test/SILOptimizer/sil_combine_concrete_existential_ossa.swift @@ -165,7 +165,7 @@ public struct SomeStruct: ProtoB { // CHECK-LABEL: sil @$s37sil_combine_concrete_existential_ossa16createSomeStructAA0gH0VSgyF : // CHECK: [[L:%.*]] = integer_literal $Builtin.Int64, 27 // CHECK-NEXT: [[I:%.*]] = struct $Int64 ([[L]] : $Builtin.Int64) -// CHECK-NEXT: [[S:%.*]] = struct $SomeStruct ([[I]] : $Int64) +// CHECK: [[S:%.*]] = struct $SomeStruct ([[I]] : $Int64) // CHECK-NEXT: [[O:%.*]] = enum $Optional, #Optional.some!enumelt, [[S]] : $SomeStruct // CHECK-NEXT: return [[O]] : $Optional // CHECK: } // end sil function '$s37sil_combine_concrete_existential_ossa16createSomeStructAA0gH0VSgyF' diff --git a/test/SILOptimizer/temp_rvalue_opt.sil b/test/SILOptimizer/temp_rvalue_opt.sil index 5f994a1e54283..3ddaae8dfc38d 100644 --- a/test/SILOptimizer/temp_rvalue_opt.sil +++ b/test/SILOptimizer/temp_rvalue_opt.sil @@ -1,4 +1,4 @@ -// RUN: %target-sil-opt -sil-print-types -enable-sil-verify-all %s -temp-rvalue-opt | %FileCheck %s +// RUN: %target-sil-opt -sil-print-types -enable-sil-verify-all %s -temp-rvalue-elimination | %FileCheck %s // REQUIRES: swift_in_compiler diff --git a/test/SILOptimizer/temp_rvalue_opt_ossa.sil b/test/SILOptimizer/temp_rvalue_opt_ossa.sil index 720753726f7d3..32dc0ebb382a1 100644 --- a/test/SILOptimizer/temp_rvalue_opt_ossa.sil +++ b/test/SILOptimizer/temp_rvalue_opt_ossa.sil @@ -1,4 +1,4 @@ -// RUN: %target-sil-opt -sil-print-types -enable-sil-verify-all %s -update-borrowed-from -temp-rvalue-opt | %FileCheck %s +// RUN: %target-sil-opt -sil-print-types -enable-sil-verify-all %s -update-borrowed-from -temp-rvalue-elimination | %FileCheck %s // REQUIRES: swift_in_compiler @@ -108,6 +108,30 @@ bb0(%0 : $*GS, %1 : $*GS): return %9999 : $() } +// CHECK-LABEL: sil [ossa] @multi_block : +// CHECK-NOT: alloc_stack +// CHECK-LABEL: } // end sil function 'multi_block' +sil [ossa] @multi_block : $@convention(thin) (@in_guaranteed GS, @inout GS) -> () { +bb0(%0 : $*GS, %1 : $*GS): + %2 = struct_element_addr %0 : $*GS, #GS._value + %3 = load [trivial] %2 : $*Builtin.Int64 + %4 = alloc_stack $GS + br bb1 + +bb1: + copy_addr %1 to [init] %4 : $*GS + %6 = struct_element_addr %4 : $*GS, #GS._value + %7 = load [trivial] %6 : $*Builtin.Int64 + %8 = builtin "cmp_slt_Int64"(%3 : $Builtin.Int64, %7 : $Builtin.Int64) : $Builtin.Int1 + br bb2 + +bb2: + destroy_addr %4 : $*GS + dealloc_stack %4 : $*GS + %9999 = tuple() + return %9999 : $() +} + // CHECK-LABEL: sil [ossa] @copy_from_temp // CHECK: bb0(%0 : $*GS, %1 : $*GS, %2 : $Builtin.Int64): // CHECK-NEXT: builtin @@ -810,24 +834,6 @@ bb0(%0 : $*GS): return %v : $() } -// Make sure that when we convert the load [take] to a load [copy], we hoist the -// load of src /before/ the destroy of %0. -// CHECK-LABEL: sil [ossa] @hoist_load_copy_to_src_copy_addr_site : $@convention(thin) (@owned GS) -> @owned GS { -// CHECK: bb0([[ARG:%.*]] : @owned -// CHECK: apply {{%.*}}([[ARG]]) -// CHECK: return [[ARG]] -// CHECK: } // end sil function 'hoist_load_copy_to_src_copy_addr_site' -sil [ossa] @hoist_load_copy_to_src_copy_addr_site : $@convention(thin) (@owned GS) -> @owned GS { -bb0(%0 : @owned $GS): - %f = function_ref @use_gsbase_builtinnativeobject : $@convention(thin) (@guaranteed GS) -> () - %stk = alloc_stack $GS - store %0 to [init] %stk : $*GS - %obj = load [take] %stk : $*GS - dealloc_stack %stk : $*GS - apply %f(%obj) : $@convention(thin) (@guaranteed GS) -> () - return %obj : $GS -} - // CHECK-LABEL: sil [ossa] @dont_optimize_with_load_in_different_block // CHECK: [[STK:%[0-9]+]] = alloc_stack // CHECK: copy_addr %0 to [init] [[STK]] @@ -1026,394 +1032,6 @@ bb3: // Store Tests // ///////////////// -// We do not support this today while we are bringing up store support. -// -// CHECK-LABEL: sil [ossa] @store_rvalue_simple -// CHECK: alloc_stack -// CHECK-LABEL: } // end sil function 'store_rvalue_simple' -sil [ossa] @store_rvalue_simple : $@convention(thin) (@in_guaranteed GS, @owned GS) -> () { -bb0(%0 : $*GS, %1 : @owned $GS): - %2 = struct_element_addr %0 : $*GS, #GS._value - %3 = load [trivial] %2 : $*Builtin.Int64 - %4 = alloc_stack $GS - store %1 to [init] %4 : $*GS - %6 = struct_element_addr %4 : $*GS, #GS._value - %7 = load [trivial] %6 : $*Builtin.Int64 - %8 = builtin "cmp_slt_Int64"(%3 : $Builtin.Int64, %7 : $Builtin.Int64) : $Builtin.Int1 - destroy_addr %4 : $*GS - dealloc_stack %4 : $*GS - %9999 = tuple() - return %9999 : $() -} - -// CHECK-LABEL: sil [ossa] @store_copy_from_temp : -// CHECK: bb0([[RESULT:%.*]] : $*GS, [[ARG0:%.*]] : @owned $GS, -// CHECK: builtin -// CHECK: [[ARG0_COPY:%.*]] = copy_value [[ARG0]] -// CHECK: store [[ARG0_COPY]] to [init] [[RESULT]] -// CHECK: destroy_value [[ARG0]] -// CHECK: } // end sil function 'store_copy_from_temp' -sil [ossa] @store_copy_from_temp : $@convention(thin) (@owned GS, Builtin.Int64) -> @out GS { -bb0(%0 : $*GS, %1 : @owned $GS, %2 : $Builtin.Int64): - %4 = alloc_stack $GS - store %1 to [init] %4 : $*GS - %8 = builtin "cmp_slt_Int64"(%2 : $Builtin.Int64, %2 : $Builtin.Int64) : $Builtin.Int1 - copy_addr %4 to [init] %0 : $*GS - destroy_addr %4 : $*GS - dealloc_stack %4 : $*GS - %9999 = tuple() - return %9999 : $() -} - -// We do not support this today. -// -// CHECK-LABEL: sil [ossa] @store_take_from_temp : -// CHECK: alloc_stack -// CHECK: } // end sil function 'store_take_from_temp' -sil [ossa] @store_take_from_temp : $@convention(thin) (@inout Klass, @owned GS) -> () { -bb0(%0 : $*Klass, %1 : @owned $GS): - %4 = alloc_stack $GS - store %1 to [init] %4 : $*GS - %7 = struct_element_addr %4 : $*GS, #GS._base - copy_addr [take] %7 to %0 : $*Klass - dealloc_stack %4 : $*GS - %9999 = tuple() - return %9999 : $() -} - -// CHECK-LABEL: sil [ossa] @store_load_in_wrong_block : -// CHECK: alloc_stack -// CHECK: } // end sil function 'store_load_in_wrong_block' -sil [ossa] @store_load_in_wrong_block : $@convention(thin) (@guaranteed GS) -> () { -bb0(%0 : @guaranteed $GS): - %4 = alloc_stack $GS - %1 = copy_value %0 : $GS - store %1 to [init] %4 : $*GS - %6 = struct_element_addr %4 : $*GS, #GS._value - br bb1 - -bb1: - %7 = load [trivial] %6 : $*Builtin.Int64 - %8 = builtin "cmp_slt_Int64"(%7 : $Builtin.Int64, %7 : $Builtin.Int64) : $Builtin.Int1 - destroy_addr %4 : $*GS - dealloc_stack %4 : $*GS - %9999 = tuple() - return %9999 : $() -} - -// CHECK-LABEL: sil [ossa] @store_projection_in_wrong_block : -// CHECK: bb0(%0 : @guaranteed $GS): -// CHECK: alloc_stack -// CHECK: } // end sil function 'store_projection_in_wrong_block' -sil [ossa] @store_projection_in_wrong_block : $@convention(thin) (@guaranteed GS) -> () { -bb0(%0 : @guaranteed $GS): - %4 = alloc_stack $GS - %0a = copy_value %0 : $GS - store %0a to [init] %4 : $*GS - br bb1 - -bb1: - %6 = struct_element_addr %4 : $*GS, #GS._value - %7 = load [trivial] %6 : $*Builtin.Int64 - %8 = builtin "cmp_slt_Int64"(%7 : $Builtin.Int64, %7 : $Builtin.Int64) : $Builtin.Int1 - destroy_addr %4 : $*GS - dealloc_stack %4 : $*GS - %9999 = tuple() - return %9999 : $() -} - -// CHECK-LABEL: sil [ossa] @store_store_after_load : -// CHECK: alloc_stack -// CHECK: } // end sil function 'store_store_after_load' -sil [ossa] @store_store_after_load : $@convention(thin) (@guaranteed GS, Builtin.Int64) -> () { -bb0(%1 : @guaranteed $GS, %2 : $Builtin.Int64): - %3 = struct_extract %1 : $GS, #GS._value - %4 = alloc_stack $GS - %1a = copy_value %1 : $GS - store %1a to [init] %4 : $*GS - %6 = struct_element_addr %4 : $*GS, #GS._value - %7 = load [trivial] %6 : $*Builtin.Int64 - %8 = builtin "cmp_slt_Int64"(%7 : $Builtin.Int64, %7 : $Builtin.Int64) : $Builtin.Int1 - destroy_addr %4 : $*GS - dealloc_stack %4 : $*GS - %9999 = tuple() - return %9999 : $() -} - -// TODO: We do not support this today due to the in_guaranteed parameter. Maybe -// instead we use store_borrow just around the call site? -// -// Make sure that we can eliminate temporaries passed via a temporary rvalue to -// an @guaranteed function. -// -// CHECK-LABEL: sil [ossa] @store_inguaranteed_no_result : $@convention(thin) (@guaranteed Klass) -> () { -// CHECK: bb0([[ARG:%.*]] : @guaranteed $Klass): -// CHECK: alloc_stack -// CHECK: } // end sil function 'store_inguaranteed_no_result' -sil [ossa] @store_inguaranteed_no_result : $@convention(thin) (@guaranteed Klass) -> () { -bb0(%0 : @guaranteed $Klass): - %1 = alloc_stack $Klass - %0a = copy_value %0 : $Klass - store %0a to [init] %1 : $*Klass - %5 = function_ref @inguaranteed_user_without_result : $@convention(thin) (@in_guaranteed Klass) -> () - %6 = apply %5(%1) : $@convention(thin) (@in_guaranteed Klass) -> () - destroy_addr %1 : $*Klass - dealloc_stack %1 : $*Klass - %9 = tuple () - return %9 : $() -} - -// We do not support this today since we need to make it so that we can use -// store_borrow to pass to the in_guaranteed function. -// -// CHECK-LABEL: sil [ossa] @store_try_apply_argument : $@convention(thin) (@guaranteed Klass) -> () { -// CHECK: alloc_stack -// CHECK: } // end sil function 'store_try_apply_argument' -sil [ossa] @store_try_apply_argument : $@convention(thin) (@guaranteed Klass) -> () { -bb0(%0 : @guaranteed $Klass): - %1 = alloc_stack $Klass - %0copy = copy_value %0 : $Klass - store %0copy to [init] %1 : $*Klass - %5 = function_ref @throwing_function : $@convention(thin) (@in_guaranteed Klass) -> ((), @error Error) - try_apply %5(%1) : $@convention(thin) (@in_guaranteed Klass) -> ((), @error Error), normal bb1, error bb2 - -bb1(%r : $()): - br bb3 - -bb2(%e : $Error): - br bb3 - -bb3: - destroy_addr %1 : $*Klass - dealloc_stack %1 : $*Klass - %9 = tuple () - return %9 : $() -} - -// TODO: We need to support using store_borrow to shrink the lifetime here. -// -// Make sure that we can eliminate temporaries passed via a temporary rvalue to -// an @guaranteed function. -// -// CHECK-LABEL: sil [ossa] @store_inguaranteed_with_result : $@convention(thin) (@owned Klass) -> () { -// CHECK: bb0([[ARG:%.*]] : @owned $Klass): -// CHECK: alloc_stack -// CHECK: alloc_stack -// CHECK: } // end sil function 'store_inguaranteed_with_result' -sil [ossa] @store_inguaranteed_with_result : $@convention(thin) (@owned Klass) -> () { -bb0(%0 : @owned $Klass): - %1 = alloc_stack $Klass - %1a = alloc_stack $Klass - store %0 to [init] %1 : $*Klass - %5 = function_ref @inguaranteed_user_with_result : $@convention(thin) (@in_guaranteed Klass) -> @out Klass - %6 = apply %5(%1a, %1) : $@convention(thin) (@in_guaranteed Klass) -> @out Klass - destroy_addr %1a : $*Klass - destroy_addr %1 : $*Klass - dealloc_stack %1a : $*Klass - dealloc_stack %1 : $*Klass - %9 = tuple () - return %9 : $() -} - -// TODO: Once we are able to use store_borrow to shrink lifetimes, we will have -// no alloc_stack in this function. -// -// CHECK-LABEL: sil [ossa] @store_non_overlapping_lifetime : $@convention(thin) (@owned Klass) -> () { -// CHECK: = alloc_stack -// CHECK-NOT: = alloc_stack -// CHECK: } // end sil function 'store_non_overlapping_lifetime' -sil [ossa] @store_non_overlapping_lifetime : $@convention(thin) (@owned Klass) -> () { -bb0(%0 : @owned $Klass): - %1a = alloc_stack $Klass - - %1 = alloc_stack $Klass - %2 = alloc_stack $Klass - %0a = copy_value %0 : $Klass - store %0a to [init] %2 : $*Klass - copy_addr [take] %2 to [init] %1 : $*Klass - dealloc_stack %2 : $*Klass - copy_addr %1 to [init] %1a : $*Klass - destroy_value %0 : $Klass - destroy_addr %1 : $*Klass - dealloc_stack %1 : $*Klass - - %3 = function_ref @inguaranteed_user_without_result : $@convention(thin) (@in_guaranteed Klass) -> () - apply %3(%1a) : $@convention(thin) (@in_guaranteed Klass) -> () - destroy_addr %1a : $*Klass - dealloc_stack %1a : $*Klass - %9999 = tuple() - return %9999 : $() -} - -sil [ossa] @store_$createKlass : $@convention(thin) () -> @out Klass -sil [ossa] @store_$appendKlass : $@convention(method) (@guaranteed Klass, @inout Klass) -> () - -// TODO: With time we should be able to shrink the lifetime of the first -// argument here with time. -// -// CHECK-LABEL: sil [ossa] @store_overlapping_lifetime_in_function_all : $@convention(thin) () -> @out Klass { -// CHECK: [[S1:%.*]] = alloc_stack $Klass -// CHECK: [[S2:%.*]] = alloc_stack $Klass -// CHECK: [[S1_LOADED:%.*]] = load [copy] [[S1]] -// CHECK: store [[S1_LOADED]] to [init] [[S2]] -// CHECK: apply {{%.*}}([[S2]], [[S1]]) -// CHECK: } // end sil function 'store_overlapping_lifetime_in_function_all' -sil [ossa] @store_overlapping_lifetime_in_function_all : $@convention(thin) () -> @out Klass { -bb0(%0 : $*Klass): - %1 = alloc_stack $Klass - %2 = function_ref @$createKlass : $@convention(thin) () -> @out Klass - %3 = apply %2(%1) : $@convention(thin) () -> @out Klass - %4 = alloc_stack $Klass - %2a = load [copy] %1 : $*Klass - store %2a to [init] %4 : $*Klass - %6 = function_ref @$appendKlass : $@convention(method) (@in_guaranteed Klass, @inout Klass) -> () - %7 = apply %6(%4, %1) : $@convention(method) (@in_guaranteed Klass, @inout Klass) -> () - destroy_addr %4 : $*Klass - dealloc_stack %4 : $*Klass - copy_addr [take] %1 to [init] %0 : $*Klass - dealloc_stack %1 : $*Klass - %12 = tuple () - return %12 : $() -} - -sil [ossa] @store_getP : $@convention(thin) () -> @out Optional

-sil [ossa] @store_takeGuaranteedObj : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () - -// Now that we support ossa, eliminate the alloc_stack and change the load -// [take] to a load [copy] in the process. -// -// CHECK-LABEL: sil [ossa] @store_copyWithLoadRelease : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () { -// CHECK: bb0(%0 : @guaranteed $Builtin.NativeObject): -// CHECK-NOT: alloc_stack -// CHECK-LABEL: } // end sil function 'store_copyWithLoadRelease' -sil [ossa] @store_copyWithLoadRelease : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () { -bb0(%0 : @guaranteed $Builtin.NativeObject): - %stk = alloc_stack $Builtin.NativeObject - %0copy = copy_value %0 : $Builtin.NativeObject - store %0copy to [init] %stk : $*Builtin.NativeObject - %obj = load [take] %stk : $*Builtin.NativeObject - %f = function_ref @takeGuaranteedObj : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () - %call = apply %f(%obj) : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () - destroy_value %obj : $Builtin.NativeObject - dealloc_stack %stk : $*Builtin.NativeObject - %v = tuple () - return %v : $() -} - -// Remove a copy that is released via a load. Leave the load [take] alone since -// our copy_addr is taking from source. -// -// CHECK-LABEL: sil [ossa] @store_takeWithLoadRelease : $@convention(thin) (@owned Builtin.NativeObject) -> () { -// CHECK-NOT: alloc_stack -// CHECK-LABEL: } // end sil function 'store_takeWithLoadRelease' -sil [ossa] @store_takeWithLoadRelease : $@convention(thin) (@owned Builtin.NativeObject) -> () { -bb0(%0 : @owned $Builtin.NativeObject): - %stk = alloc_stack $Builtin.NativeObject - store %0 to [init] %stk : $*Builtin.NativeObject - %obj = load [take] %stk : $*Builtin.NativeObject - %f = function_ref @takeGuaranteedObj : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () - %call = apply %f(%obj) : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () - destroy_value %obj : $Builtin.NativeObject - dealloc_stack %stk : $*Builtin.NativeObject - %v = tuple () - return %v : $() -} - -// Do not remove a copy that is released via a load of a projection. This is not -// the pattern from SILGen that we are targeting, so we reduce the state space by banning the pattern. -// -// CHECK-LABEL: sil [ossa] @store_takeWithLoadReleaseOfProjection : $@convention(thin) (@owned GS) -> () { -// CHECK: alloc_stack -// CHECK: } // end sil function 'store_takeWithLoadReleaseOfProjection' -sil [ossa] @store_takeWithLoadReleaseOfProjection : $@convention(thin) (@owned GS) -> () { -bb0(%0 : @owned $GS): - %stk = alloc_stack $GS - store %0 to [init] %stk : $*GS - %proj = struct_element_addr %stk : $*GS, #GS._base - %obj = load [take] %proj : $*Builtin.NativeObject - %f = function_ref @takeGuaranteedObj : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () - %call = apply %f(%obj) : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () - destroy_value %obj : $Builtin.NativeObject - dealloc_stack %stk : $*GS - %v = tuple () - return %v : $() -} - -// CHECK-LABEL: sil [ossa] @test_optimize_store_of_enum1 -// CHECK-NOT: alloc_stack -// CHECK: } // end sil function 'test_optimize_store_of_enum1' -sil [ossa] @test_optimize_store_of_enum1 : $@convention(method) (@guaranteed Optional) -> () { -bb0(%0 : @guaranteed $Optional): - %1 = copy_value %0 : $Optional - %32 = alloc_stack $Optional - store %1 to [init] %32 : $*Optional - switch_enum %0 : $Optional, case #Optional.some!enumelt: bb6, case #Optional.none!enumelt: bb5 - -bb5: - dealloc_stack %32 : $*Optional - br bb7 - -bb6(%50 : @guaranteed $Klass): - %53 = load [take] %32 : $*Optional - destroy_value %53 : $Optional - dealloc_stack %32 : $*Optional - br bb7 - -bb7: - %r = tuple () - return %r : $() -} - -// CHECK-LABEL: sil [ossa] @test_optimize_store_of_enum2 -// CHECK-NOT: alloc_stack -// CHECK: } // end sil function 'test_optimize_store_of_enum2' -sil [ossa] @test_optimize_store_of_enum2 : $@convention(method) (@owned Optional) -> () { -bb0(%0 : @owned $Optional): - %1 = copy_value %0 : $Optional - %32 = alloc_stack $Optional - store %0 to [init] %32 : $*Optional - switch_enum %1 : $Optional, case #Optional.some!enumelt: bb6, case #Optional.none!enumelt: bb5 - -bb5: - dealloc_stack %32 : $*Optional - br bb7 - -bb6(%50 : @owned $Klass): - %53 = load [take] %32 : $*Optional - destroy_value %53 : $Optional - destroy_value %50 : $Klass - dealloc_stack %32 : $*Optional - br bb7 - -bb7: - %r = tuple () - return %r : $() -} - -// CHECK-LABEL: sil [ossa] @store_of_enum_must_be_in_same_block -// CHECK-NOT: alloc_stack -// CHECK: } // end sil function 'store_of_enum_must_be_in_same_block' -sil [ossa] @store_of_enum_must_be_in_same_block : $@convention(method) (@guaranteed Optional) -> () { -bb0(%0 : @guaranteed $Optional): - %32 = alloc_stack $Optional - switch_enum %0 : $Optional, case #Optional.some!enumelt: bb6, case #Optional.none!enumelt: bb5 - -bb5: - dealloc_stack %32 : $*Optional - br bb7 - -bb6(%50 : @guaranteed $Klass): - %1 = copy_value %0 : $Optional - store %1 to [init] %32 : $*Optional - %53 = load [take] %32 : $*Optional - destroy_value %53 : $Optional - dealloc_stack %32 : $*Optional - br bb7 - -bb7: - %r = tuple () - return %r : $() -} //////////////////////////////////////// // Unchecked Take Enum Data Addr Inst // //////////////////////////////////////// @@ -1479,43 +1097,6 @@ bb0(%0 : $*Klass): return %9999 : $() } -// CHECK-LABEL: sil [ossa] @eliminate_fix_lifetime_on_dest_store : $@convention(thin) (@inout Klass) -> () { -// CHECK-NOT: alloc_stack -// CHECK: [[VALUE:%.*]] = load [copy] %0 -// CHECK-NEXT: fix_lifetime [[VALUE]] -// CHECK-NEXT: destroy_value [[VALUE]] -// CHECK-NOT: alloc_stack -// CHECK: } // end sil function 'eliminate_fix_lifetime_on_dest_store' -sil [ossa] @eliminate_fix_lifetime_on_dest_store : $@convention(thin) (@inout Klass) -> () { -bb0(%0 : $*Klass): - %2 = load [copy] %0 : $*Klass - %3 = alloc_stack $Klass - store %2 to [init] %3 : $*Klass - fix_lifetime %3 : $*Klass - destroy_addr %3 : $*Klass - dealloc_stack %3 : $*Klass - %9999 = tuple() - return %9999 : $() -} - -// Check that we don't crash with this. -// CHECK-LABEL: sil [ossa] @unhandled_user : $@convention(thin) (@owned Klass) -> @owned Klass { -// CHECK: alloc_stack -// CHECK: store -// CHECK: begin_access -// CHECK: load -// CHECK: } // end sil function 'unhandled_user' -sil [ossa] @unhandled_user : $@convention(thin) (@owned Klass) -> @owned Klass { -bb0(%0 : @owned $Klass): - %5 = alloc_stack $Klass - store %0 to [init] %5 : $*Klass - %104 = begin_access [read] [static] %5 : $*Klass - %105 = load [take] %104 : $*Klass - end_access %104 : $*Klass - dealloc_stack %5 : $*Klass - return %105 : $Klass -} - // CHECK-LABEL: sil [ossa] @test_yield // CHECK: [[TA:%[0-9]+]] = ref_tail_addr // CHECK-NOT: copy_addr @@ -1816,10 +1397,8 @@ entry(%instance : $*Klass): return %retval : $() } -// Lexical alloc_stacks can't be eliminated even if their source is a function -// argument if that function argument is inout. // CHECK-LABEL: sil [ossa] @copy_addr__lexical_alloc_stack_temporary__inout_function_arg : {{.*}} { -// CHECK: alloc_stack [lexical] +// CHECK-NOT: alloc_stack // CHECK-LABEL: } // end sil function 'copy_addr__lexical_alloc_stack_temporary__inout_function_arg' sil [ossa] @copy_addr__lexical_alloc_stack_temporary__inout_function_arg : $@convention(thin) (@inout NonTrivialStruct) -> () { entry(%instance : $*NonTrivialStruct): diff --git a/test/SILOptimizer/temp_rvalue_rle.sil b/test/SILOptimizer/temp_rvalue_rle.sil new file mode 100644 index 0000000000000..7566115ec4809 --- /dev/null +++ b/test/SILOptimizer/temp_rvalue_rle.sil @@ -0,0 +1,508 @@ +// RUN: %target-sil-opt %s -redundant-load-elimination -deadobject-elim | %FileCheck %s + +sil_stage canonical + +import Builtin +import Swift + +//===----------------------------------------------------------------------===// +// Tests eliminating stores to temporary "r-values", which were +// originally handled by TempRValueOpt. +//===----------------------------------------------------------------------===// + +struct GS { + var _base: Base + var _value: Builtin.Int64 +} + +class Klass { + @_hasStorage var i: Int + init() +} + +class OtherClass { + var klass: Klass +} + +struct Two { + var a: Klass + var b: Klass +} + +struct NonTrivialStruct { + var val:Klass +} + +public enum FakeOptional { + case none + case some(T) +} + +struct MOS: ~Copyable {} + +protocol P { + func foo() +} + +sil [ossa] @getKlass : $@convention(thin) () -> @owned Klass +sil [ossa] @getNonTrivialStruct : $@convention(thin) () -> @owned NonTrivialStruct +sil [ossa] @getMOS : $@convention(thin) () -> @owned MOS + +sil @unknown : $@convention(thin) () -> () +sil [readonly] [ossa] @read_only_coroutine : $@yield_once @convention(thin) () -> @yields @in_guaranteed P + +sil [ossa] @guaranteed_user : $@convention(thin) (@guaranteed Klass) -> () +sil [ossa] @guaranteed_user_with_result : $@convention(thin) (@guaranteed Klass) -> @out Klass +sil [ossa] @inguaranteed_user_without_result_NTS : $@convention(thin) (@in_guaranteed NonTrivialStruct) -> () +sil [ossa] @inguaranteed_user_without_result_MOS : $@convention(thin) (@in_guaranteed MOS) -> () + +sil @use_gsbase_builtinnativeobject : $@convention(thin) (@guaranteed GS) -> () +sil @inguaranteed_user_without_result : $@convention(thin) (@in_guaranteed Klass) -> () +sil @throwing_function : $@convention(thin) (@in_guaranteed Klass) -> ((), @error Error) +sil @inguaranteed_user_with_result : $@convention(thin) (@in_guaranteed Klass) -> @out Klass +sil @$createKlass : $@convention(thin) () -> @out Klass +sil @$appendKlass : $@convention(method) (@in_guaranteed Klass, @inout Klass) -> () +sil @takeGuaranteedObj : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () + +// Make sure that when we convert the load [take] to a load [copy], we hoist the +// load of src /before/ the destroy of %0. +// CHECK-LABEL: sil [ossa] @hoist_load_copy_to_src_copy_addr_site : $@convention(thin) (@owned GS) -> @owned GS { +// CHECK: bb0([[ARG:%.*]] : @owned +// CHECK: apply {{%.*}}([[ARG]]) +// CHECK: return [[ARG]] +// CHECK: } // end sil function 'hoist_load_copy_to_src_copy_addr_site' +sil [ossa] @hoist_load_copy_to_src_copy_addr_site : $@convention(thin) (@owned GS) -> @owned GS { +bb0(%0 : @owned $GS): + %f = function_ref @use_gsbase_builtinnativeobject : $@convention(thin) (@guaranteed GS) -> () + %stk = alloc_stack $GS + store %0 to [init] %stk : $*GS + %obj = load [take] %stk : $*GS + dealloc_stack %stk : $*GS + apply %f(%obj) : $@convention(thin) (@guaranteed GS) -> () + return %obj : $GS +} + +// We do not support this today while we are bringing up store support. +// +// CHECK-LABEL: sil [ossa] @store_rvalue_simple +// CHECK: alloc_stack +// CHECK-LABEL: } // end sil function 'store_rvalue_simple' +sil [ossa] @store_rvalue_simple : $@convention(thin) (@in_guaranteed GS, @owned GS) -> () { +bb0(%0 : $*GS, %1 : @owned $GS): + %2 = struct_element_addr %0 : $*GS, #GS._value + %3 = load [trivial] %2 : $*Builtin.Int64 + %4 = alloc_stack $GS + store %1 to [init] %4 : $*GS + %6 = struct_element_addr %4 : $*GS, #GS._value + %7 = load [trivial] %6 : $*Builtin.Int64 + %8 = builtin "cmp_slt_Int64"(%3 : $Builtin.Int64, %7 : $Builtin.Int64) : $Builtin.Int1 + destroy_addr %4 : $*GS + dealloc_stack %4 : $*GS + %9999 = tuple() + return %9999 : $() +} + +// CHECK-LABEL: sil [ossa] @store_copy_from_temp : +// CHECK: bb0([[RESULT:%.*]] : $*GS, [[ARG0:%.*]] : @owned $GS, +// CHECK: [[ARG0_COPY:%.*]] = copy_value [[ARG0]] +// CHECK: builtin +// CHECK: store [[ARG0_COPY]] to [init] [[RESULT]] +// CHECK: } // end sil function 'store_copy_from_temp' +sil [ossa] @store_copy_from_temp : $@convention(thin) (@owned GS, Builtin.Int64) -> @out GS { +bb0(%0 : $*GS, %1 : @owned $GS, %2 : $Builtin.Int64): + %4 = alloc_stack $GS + store %1 to [init] %4 : $*GS + %8 = builtin "cmp_slt_Int64"(%2 : $Builtin.Int64, %2 : $Builtin.Int64) : $Builtin.Int1 + copy_addr %4 to [init] %0 : $*GS + destroy_addr %4 : $*GS + dealloc_stack %4 : $*GS + %9999 = tuple() + return %9999 : $() +} + +// CHECK-LABEL: sil [ossa] @store_take_from_temp : +// CHECK: ([[S1:%.*]], [[S2:%.*]]) = destructure_struct %1 +// CHECK: store [[S1]] to [assign] %0 +// CHECK: } // end sil function 'store_take_from_temp' +sil [ossa] @store_take_from_temp : $@convention(thin) (@inout Klass, @owned GS) -> () { +bb0(%0 : $*Klass, %1 : @owned $GS): + %4 = alloc_stack $GS + store %1 to [init] %4 : $*GS + %7 = struct_element_addr %4 : $*GS, #GS._base + copy_addr [take] %7 to %0 : $*Klass + dealloc_stack %4 : $*GS + %9999 = tuple() + return %9999 : $() +} + +// CHECK-LABEL: sil [ossa] @store_load_in_differnt_block : +// CHECK-NOT: alloc_stack +// CHECK: } // end sil function 'store_load_in_differnt_block' +sil [ossa] @store_load_in_differnt_block : $@convention(thin) (@guaranteed GS) -> () { +bb0(%0 : @guaranteed $GS): + %4 = alloc_stack $GS + %1 = copy_value %0 : $GS + store %1 to [init] %4 : $*GS + %6 = struct_element_addr %4 : $*GS, #GS._value + br bb1 + +bb1: + %7 = load [trivial] %6 : $*Builtin.Int64 + %8 = builtin "cmp_slt_Int64"(%7 : $Builtin.Int64, %7 : $Builtin.Int64) : $Builtin.Int1 + destroy_addr %4 : $*GS + dealloc_stack %4 : $*GS + %9999 = tuple() + return %9999 : $() +} + +// CHECK-LABEL: sil [ossa] @store_projection_in_different_block : +// CHECK: bb0(%0 : @guaranteed $GS): +// CHECK-NOT: alloc_stack +// CHECK: } // end sil function 'store_projection_in_different_block' +sil [ossa] @store_projection_in_different_block : $@convention(thin) (@guaranteed GS) -> () { +bb0(%0 : @guaranteed $GS): + %4 = alloc_stack $GS + %0a = copy_value %0 : $GS + store %0a to [init] %4 : $*GS + br bb1 + +bb1: + %6 = struct_element_addr %4 : $*GS, #GS._value + %7 = load [trivial] %6 : $*Builtin.Int64 + %8 = builtin "cmp_slt_Int64"(%7 : $Builtin.Int64, %7 : $Builtin.Int64) : $Builtin.Int1 + destroy_addr %4 : $*GS + dealloc_stack %4 : $*GS + %9999 = tuple() + return %9999 : $() +} + +// CHECK-LABEL: sil [ossa] @store_store_after_load : +// CHECK-NOT: alloc_stack +// CHECK: } // end sil function 'store_store_after_load' +sil [ossa] @store_store_after_load : $@convention(thin) (@guaranteed GS, Builtin.Int64) -> () { +bb0(%1 : @guaranteed $GS, %2 : $Builtin.Int64): + %3 = struct_extract %1 : $GS, #GS._value + %4 = alloc_stack $GS + %1a = copy_value %1 : $GS + store %1a to [init] %4 : $*GS + %6 = struct_element_addr %4 : $*GS, #GS._value + %7 = load [trivial] %6 : $*Builtin.Int64 + %8 = builtin "cmp_slt_Int64"(%7 : $Builtin.Int64, %7 : $Builtin.Int64) : $Builtin.Int1 + destroy_addr %4 : $*GS + dealloc_stack %4 : $*GS + %9999 = tuple() + return %9999 : $() +} + +// TODO: We do not support this today due to the in_guaranteed parameter. Maybe +// instead we use store_borrow just around the call site? +// +// Make sure that we can eliminate temporaries passed via a temporary rvalue to +// an @guaranteed function. +// +// CHECK-LABEL: sil [ossa] @store_inguaranteed_no_result : $@convention(thin) (@guaranteed Klass) -> () { +// CHECK: bb0([[ARG:%.*]] : @guaranteed $Klass): +// CHECK: alloc_stack +// CHECK: } // end sil function 'store_inguaranteed_no_result' +sil [ossa] @store_inguaranteed_no_result : $@convention(thin) (@guaranteed Klass) -> () { +bb0(%0 : @guaranteed $Klass): + %1 = alloc_stack $Klass + %0a = copy_value %0 : $Klass + store %0a to [init] %1 : $*Klass + %5 = function_ref @inguaranteed_user_without_result : $@convention(thin) (@in_guaranteed Klass) -> () + %6 = apply %5(%1) : $@convention(thin) (@in_guaranteed Klass) -> () + destroy_addr %1 : $*Klass + dealloc_stack %1 : $*Klass + %9 = tuple () + return %9 : $() +} + +// We do not support this today since we need to make it so that we can use +// store_borrow to pass to the in_guaranteed function. +// +// CHECK-LABEL: sil [ossa] @store_try_apply_argument : $@convention(thin) (@guaranteed Klass) -> () { +// CHECK: alloc_stack +// CHECK: } // end sil function 'store_try_apply_argument' +sil [ossa] @store_try_apply_argument : $@convention(thin) (@guaranteed Klass) -> () { +bb0(%0 : @guaranteed $Klass): + %1 = alloc_stack $Klass + %0copy = copy_value %0 : $Klass + store %0copy to [init] %1 : $*Klass + %5 = function_ref @throwing_function : $@convention(thin) (@in_guaranteed Klass) -> ((), @error Error) + try_apply %5(%1) : $@convention(thin) (@in_guaranteed Klass) -> ((), @error Error), normal bb1, error bb2 + +bb1(%r : $()): + br bb3 + +bb2(%e : $Error): + br bb3 + +bb3: + destroy_addr %1 : $*Klass + dealloc_stack %1 : $*Klass + %9 = tuple () + return %9 : $() +} + +// TODO: We need to support using store_borrow to shrink the lifetime here. +// +// Make sure that we can eliminate temporaries passed via a temporary rvalue to +// an @guaranteed function. +// +// CHECK-LABEL: sil [ossa] @store_inguaranteed_with_result : $@convention(thin) (@owned Klass) -> () { +// CHECK: bb0([[ARG:%.*]] : @owned $Klass): +// CHECK: alloc_stack +// CHECK: alloc_stack +// CHECK: } // end sil function 'store_inguaranteed_with_result' +sil [ossa] @store_inguaranteed_with_result : $@convention(thin) (@owned Klass) -> () { +bb0(%0 : @owned $Klass): + %1 = alloc_stack $Klass + %1a = alloc_stack $Klass + store %0 to [init] %1 : $*Klass + %5 = function_ref @inguaranteed_user_with_result : $@convention(thin) (@in_guaranteed Klass) -> @out Klass + %6 = apply %5(%1a, %1) : $@convention(thin) (@in_guaranteed Klass) -> @out Klass + destroy_addr %1a : $*Klass + destroy_addr %1 : $*Klass + dealloc_stack %1a : $*Klass + dealloc_stack %1 : $*Klass + %9 = tuple () + return %9 : $() +} + +// TODO: Once we are able to use store_borrow to shrink lifetimes, we will have +// no alloc_stack in this function. +// +// CHECK-LABEL: sil [ossa] @store_non_overlapping_lifetime : $@convention(thin) (@owned Klass) -> () { +// CHECK: [[S:%.*]] = alloc_stack +// CHECK: [[C1:%.*]] = copy_value %0 +// CHECK: [[C2:%.*]] = copy_value [[C1]] +// CHECK: store [[C2]] to [init] [[S]] +// CHECK: } // end sil function 'store_non_overlapping_lifetime' +sil [ossa] @store_non_overlapping_lifetime : $@convention(thin) (@owned Klass) -> () { +bb0(%0 : @owned $Klass): + %1a = alloc_stack $Klass + + %1 = alloc_stack $Klass + %2 = alloc_stack $Klass + %0a = copy_value %0 : $Klass + store %0a to [init] %2 : $*Klass + copy_addr [take] %2 to [init] %1 : $*Klass + dealloc_stack %2 : $*Klass + copy_addr %1 to [init] %1a : $*Klass + destroy_value %0 : $Klass + destroy_addr %1 : $*Klass + dealloc_stack %1 : $*Klass + + %3 = function_ref @inguaranteed_user_without_result : $@convention(thin) (@in_guaranteed Klass) -> () + apply %3(%1a) : $@convention(thin) (@in_guaranteed Klass) -> () + destroy_addr %1a : $*Klass + dealloc_stack %1a : $*Klass + %9999 = tuple() + return %9999 : $() +} + +sil [ossa] @store_$createKlass : $@convention(thin) () -> @out Klass +sil [ossa] @store_$appendKlass : $@convention(method) (@guaranteed Klass, @inout Klass) -> () + +// TODO: With time we should be able to shrink the lifetime of the first +// argument here with time. +// +// CHECK-LABEL: sil [ossa] @store_overlapping_lifetime_in_function_all : $@convention(thin) () -> @out Klass { +// CHECK: [[S1:%.*]] = alloc_stack $Klass +// CHECK: [[S2:%.*]] = alloc_stack $Klass +// CHECK: [[S1_LOADED:%.*]] = load [copy] [[S1]] +// CHECK: store [[S1_LOADED]] to [init] [[S2]] +// CHECK: apply {{%.*}}([[S2]], [[S1]]) +// CHECK: } // end sil function 'store_overlapping_lifetime_in_function_all' +sil [ossa] @store_overlapping_lifetime_in_function_all : $@convention(thin) () -> @out Klass { +bb0(%0 : $*Klass): + %1 = alloc_stack $Klass + %2 = function_ref @$createKlass : $@convention(thin) () -> @out Klass + %3 = apply %2(%1) : $@convention(thin) () -> @out Klass + %4 = alloc_stack $Klass + %2a = load [copy] %1 : $*Klass + store %2a to [init] %4 : $*Klass + %6 = function_ref @$appendKlass : $@convention(method) (@in_guaranteed Klass, @inout Klass) -> () + %7 = apply %6(%4, %1) : $@convention(method) (@in_guaranteed Klass, @inout Klass) -> () + destroy_addr %4 : $*Klass + dealloc_stack %4 : $*Klass + copy_addr [take] %1 to [init] %0 : $*Klass + dealloc_stack %1 : $*Klass + %12 = tuple () + return %12 : $() +} + +sil [ossa] @store_getP : $@convention(thin) () -> @out Optional

+sil [ossa] @store_takeGuaranteedObj : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () + +// Now that we support ossa, eliminate the alloc_stack and change the load +// [take] to a load [copy] in the process. +// +// CHECK-LABEL: sil [ossa] @store_copyWithLoadRelease : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () { +// CHECK: bb0(%0 : @guaranteed $Builtin.NativeObject): +// CHECK-NOT: alloc_stack +// CHECK-LABEL: } // end sil function 'store_copyWithLoadRelease' +sil [ossa] @store_copyWithLoadRelease : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () { +bb0(%0 : @guaranteed $Builtin.NativeObject): + %stk = alloc_stack $Builtin.NativeObject + %0copy = copy_value %0 : $Builtin.NativeObject + store %0copy to [init] %stk : $*Builtin.NativeObject + %obj = load [take] %stk : $*Builtin.NativeObject + %f = function_ref @takeGuaranteedObj : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () + %call = apply %f(%obj) : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () + destroy_value %obj : $Builtin.NativeObject + dealloc_stack %stk : $*Builtin.NativeObject + %v = tuple () + return %v : $() +} + +// Remove a copy that is released via a load. Leave the load [take] alone since +// our copy_addr is taking from source. +// +// CHECK-LABEL: sil [ossa] @store_takeWithLoadRelease : $@convention(thin) (@owned Builtin.NativeObject) -> () { +// CHECK-NOT: alloc_stack +// CHECK-LABEL: } // end sil function 'store_takeWithLoadRelease' +sil [ossa] @store_takeWithLoadRelease : $@convention(thin) (@owned Builtin.NativeObject) -> () { +bb0(%0 : @owned $Builtin.NativeObject): + %stk = alloc_stack $Builtin.NativeObject + store %0 to [init] %stk : $*Builtin.NativeObject + %obj = load [take] %stk : $*Builtin.NativeObject + %f = function_ref @takeGuaranteedObj : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () + %call = apply %f(%obj) : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () + destroy_value %obj : $Builtin.NativeObject + dealloc_stack %stk : $*Builtin.NativeObject + %v = tuple () + return %v : $() +} + +// CHECK-LABEL: sil [ossa] @store_takeWithLoadReleaseOfProjection : $@convention(thin) (@owned GS) -> () { +// CHECK: ([[S1:%.*]], [[S2:%.*]]) = destructure_struct %0 +// CHECK: apply %{{[0-9]+}}([[S1]]) +// CHECK: } // end sil function 'store_takeWithLoadReleaseOfProjection' +sil [ossa] @store_takeWithLoadReleaseOfProjection : $@convention(thin) (@owned GS) -> () { +bb0(%0 : @owned $GS): + %stk = alloc_stack $GS + store %0 to [init] %stk : $*GS + %proj = struct_element_addr %stk : $*GS, #GS._base + %obj = load [take] %proj : $*Builtin.NativeObject + %f = function_ref @takeGuaranteedObj : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () + %call = apply %f(%obj) : $@convention(thin) (@guaranteed Builtin.NativeObject) -> () + destroy_value %obj : $Builtin.NativeObject + dealloc_stack %stk : $*GS + %v = tuple () + return %v : $() +} + +// We don't support liferange exits currently +// +// CHECK-LABEL: sil [ossa] @test_optimize_store_of_enum1 +// CHECK: alloc_stack +// CHECK: } // end sil function 'test_optimize_store_of_enum1' +sil [ossa] @test_optimize_store_of_enum1 : $@convention(method) (@guaranteed Optional) -> () { +bb0(%0 : @guaranteed $Optional): + %1 = copy_value %0 : $Optional + %32 = alloc_stack $Optional + store %1 to [init] %32 : $*Optional + switch_enum %0 : $Optional, case #Optional.some!enumelt: bb6, case #Optional.none!enumelt: bb5 + +bb5: + dealloc_stack %32 : $*Optional + br bb7 + +bb6(%50 : @guaranteed $Klass): + %53 = load [take] %32 : $*Optional + destroy_value %53 : $Optional + dealloc_stack %32 : $*Optional + br bb7 + +bb7: + %r = tuple () + return %r : $() +} + +// We don't support liferange exits currently +// +// CHECK-LABEL: sil [ossa] @test_optimize_store_of_enum2 +// CHECK: alloc_stack +// CHECK: } // end sil function 'test_optimize_store_of_enum2' +sil [ossa] @test_optimize_store_of_enum2 : $@convention(method) (@owned Optional) -> () { +bb0(%0 : @owned $Optional): + %1 = copy_value %0 : $Optional + %32 = alloc_stack $Optional + store %0 to [init] %32 : $*Optional + switch_enum %1 : $Optional, case #Optional.some!enumelt: bb6, case #Optional.none!enumelt: bb5 + +bb5: + dealloc_stack %32 : $*Optional + br bb7 + +bb6(%50 : @owned $Klass): + %53 = load [take] %32 : $*Optional + destroy_value %53 : $Optional + destroy_value %50 : $Klass + dealloc_stack %32 : $*Optional + br bb7 + +bb7: + %r = tuple () + return %r : $() +} + +// CHECK-LABEL: sil [ossa] @store_of_enum_must_be_in_same_block +// CHECK-NOT: alloc_stack +// CHECK: } // end sil function 'store_of_enum_must_be_in_same_block' +sil [ossa] @store_of_enum_must_be_in_same_block : $@convention(method) (@guaranteed Optional) -> () { +bb0(%0 : @guaranteed $Optional): + %32 = alloc_stack $Optional + switch_enum %0 : $Optional, case #Optional.some!enumelt: bb6, case #Optional.none!enumelt: bb5 + +bb5: + dealloc_stack %32 : $*Optional + br bb7 + +bb6(%50 : @guaranteed $Klass): + %1 = copy_value %0 : $Optional + store %1 to [init] %32 : $*Optional + %53 = load [take] %32 : $*Optional + destroy_value %53 : $Optional + dealloc_stack %32 : $*Optional + br bb7 + +bb7: + %r = tuple () + return %r : $() +} + +// CHECK-LABEL: sil [ossa] @eliminate_fix_lifetime_on_dest_store : $@convention(thin) (@inout Klass) -> () { +// CHECK-NOT: alloc_stack +// CHECK: } // end sil function 'eliminate_fix_lifetime_on_dest_store' +sil [ossa] @eliminate_fix_lifetime_on_dest_store : $@convention(thin) (@inout Klass) -> () { +bb0(%0 : $*Klass): + %2 = load [copy] %0 : $*Klass + %3 = alloc_stack $Klass + store %2 to [init] %3 : $*Klass + fix_lifetime %3 : $*Klass + destroy_addr %3 : $*Klass + dealloc_stack %3 : $*Klass + %9999 = tuple() + return %9999 : $() +} + +// Check that we don't crash with this. +// CHECK-LABEL: sil [ossa] @unhandled_user : $@convention(thin) (@owned Klass) -> @owned Klass { +// CHECK: alloc_stack +// CHECK: store +// CHECK: begin_access +// CHECK: load +// CHECK: } // end sil function 'unhandled_user' +sil [ossa] @unhandled_user : $@convention(thin) (@owned Klass) -> @owned Klass { +bb0(%0 : @owned $Klass): + %5 = alloc_stack $Klass + store %0 to [init] %5 : $*Klass + %104 = begin_access [read] [static] %5 : $*Klass + %105 = load [take] %104 : $*Klass + end_access %104 : $*Klass + dealloc_stack %5 : $*Klass + return %105 : $Klass +} + From 69c965e15ca67e19abf34474f64769ab898f504b Mon Sep 17 00:00:00 2001 From: Alastair Houghton Date: Tue, 6 May 2025 15:56:07 +0100 Subject: [PATCH 43/51] [Concurrency] Don't pass negative times to the Dispatch code. Dispatch uses unsigned times, and cannot cope with times before its clock started. As such, passing negative times from Swift through to the C++ code results in large unsigned values, which then causes us to wait forever. This is undesirable. rdar://148899609 --- stdlib/public/Concurrency/DispatchExecutor.swift | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/stdlib/public/Concurrency/DispatchExecutor.swift b/stdlib/public/Concurrency/DispatchExecutor.swift index ccc29c75f5ca6..11a372b14d1f9 100644 --- a/stdlib/public/Concurrency/DispatchExecutor.swift +++ b/stdlib/public/Concurrency/DispatchExecutor.swift @@ -161,12 +161,21 @@ enum DispatchClockID: CInt { @available(SwiftStdlib 6.2, *) extension DispatchExecutorProtocol { + func clamp(_ components: (seconds: Int64, attoseconds: Int64)) + -> (seconds: Int64, attoseconds: Int64) { + if components.seconds < 0 + || components.seconds == 0 && components.attoseconds < 0 { + return (seconds: 0, attoseconds: 0) + } + return (seconds: components.seconds, attoseconds: components.attoseconds) + } + func timestamp(for instant: C.Instant, clock: C) -> (clockID: DispatchClockID, seconds: Int64, nanoseconds: Int64) { if clock.traits.contains(.continuous) { let dispatchClock: ContinuousClock = .continuous let instant = dispatchClock.convert(instant: instant, from: clock)! - let (seconds, attoseconds) = instant._value.components + let (seconds, attoseconds) = clamp(instant._value.components) let nanoseconds = attoseconds / 1_000_000_000 return (clockID: .continuous, seconds: Int64(seconds), @@ -174,7 +183,7 @@ extension DispatchExecutorProtocol { } else { let dispatchClock: SuspendingClock = .suspending let instant = dispatchClock.convert(instant: instant, from: clock)! - let (seconds, attoseconds) = instant._value.components + let (seconds, attoseconds) = clamp(instant._value.components) let nanoseconds = attoseconds / 1_000_000_000 return (clockID: .suspending, seconds: Int64(seconds), @@ -185,7 +194,7 @@ extension DispatchExecutorProtocol { func delay(from duration: C.Duration, clock: C) -> (seconds: Int64, nanoseconds: Int64) { let swiftDuration = clock.convert(from: duration)! - let (seconds, attoseconds) = swiftDuration.components + let (seconds, attoseconds) = clamp(swiftDuration.components) let nanoseconds = attoseconds / 1_000_000_000 return (seconds: seconds, nanoseconds: nanoseconds) } From 08f4d2fa18ca791134715877a0a96c5b541b483f Mon Sep 17 00:00:00 2001 From: Alastair Houghton Date: Tue, 6 May 2025 16:52:50 +0100 Subject: [PATCH 44/51] [Concurrency][Tests] Add a test of waiting until a time before the epoch. Add a test to check that attempting to `Task.sleep(until:)` passing a time before the start of the Dispatch clocks works and doesn't wait forever. rdar://148899609 --- .../Runtime/async_task_sleep.swift | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/test/Concurrency/Runtime/async_task_sleep.swift b/test/Concurrency/Runtime/async_task_sleep.swift index ec242a1132c28..a08429c4502f0 100644 --- a/test/Concurrency/Runtime/async_task_sleep.swift +++ b/test/Concurrency/Runtime/async_task_sleep.swift @@ -14,11 +14,14 @@ import Dispatch @available(SwiftStdlib 5.1, *) @main struct Main { static let pause = 500_000_000 // 500ms - + static func main() async { await testSleepDuration() await testSleepDoesNotBlock() await testSleepHuge() + if #available(SwiftStdlib 5.7, *) { + await testSleepNegative() + } } static func testSleepDuration() async { @@ -34,7 +37,7 @@ import Dispatch static func testSleepDoesNotBlock() async { // FIXME: Should run on main executor - let task = detach { + let task = Task.detached { print("Run first") } @@ -50,10 +53,10 @@ import Dispatch static func testSleepHuge() async { // Make sure nanoseconds values about Int64.max don't get interpreted as // negative and fail to sleep. - let task1 = detach { + let task1 = Task.detached { try await Task.sleep(nanoseconds: UInt64(Int64.max) + 1) } - let task2 = detach { + let task2 = Task.detached { try await Task.sleep(nanoseconds: UInt64.max) } @@ -73,4 +76,28 @@ import Dispatch fatalError("Sleep 2 completed early.") } catch {} } + + @available(SwiftStdlib 5.7, *) + static func testSleepNegative() async { + // Make sure that "negative" times don't cause us to sleep forever + let negativeDuration = Duration(secondsComponent: -60, + attosecondsComponent: 0) + let negativeTime = unsafe unsafeBitCast(negativeDuration, + to: ContinuousClock.Instant.self) + + let task = Task.detached { + try await Task.sleep(until: negativeTime) + } + + try! await Task.sleep(nanoseconds: UInt64(pause)) + + task.cancel() + + // The sleep should complete; if they throw, this is a failure. + do { + _ = try await task.value + } catch { + fatalError("Sleep tried to wait for a negative time") + } + } } From 4b26a3d10a838b899194f8391f2895664d37c0c0 Mon Sep 17 00:00:00 2001 From: Artem Chikin Date: Mon, 5 May 2025 16:17:34 -0700 Subject: [PATCH 45/51] [Dependency Scanning] Emit a detailed error diagnostic on Clang module variant discovery In expectation, this should never happen. Such a situation means that within the same scanning action, Clang Dependency Scanner has produced two different variants of the same module. This is not supposed to happen, but we are currently hunting down the rare cases where it does, seemingly due to differences in Clang Scanner direct by-name queries and transitive header lookup queries. --- include/swift/AST/DiagnosticsFrontend.def | 10 ++++ include/swift/AST/ModuleDependencies.h | 4 +- lib/AST/ASTContext.cpp | 7 --- lib/AST/ModuleDependencies.cpp | 56 ++++++++++++++++++- .../ClangModuleDependencyScanner.cpp | 2 +- .../ModuleDependencyScanner.cpp | 14 ++--- 6 files changed, 74 insertions(+), 19 deletions(-) diff --git a/include/swift/AST/DiagnosticsFrontend.def b/include/swift/AST/DiagnosticsFrontend.def index 53235b494e1d6..206abe9eb860a 100644 --- a/include/swift/AST/DiagnosticsFrontend.def +++ b/include/swift/AST/DiagnosticsFrontend.def @@ -624,5 +624,15 @@ ERROR(ast_format_requires_dump_ast,none, ERROR(unknown_dump_ast_format,none, "unknown format '%0' requested with '-dump-ast-format'", (StringRef)) +ERROR(dependency_scan_unexpected_variant, none, + "unexpected variant during dependency scanning on module '%0'", (StringRef)) +NOTE(dependency_scan_unexpected_variant_context_hash_note, none, + "first module context hash: '%0', second module context hash: '%1'", (StringRef, StringRef)) +NOTE(dependency_scan_unexpected_variant_module_map_note, none, + "first module module map: '%0', second module module map: '%1'", (StringRef, StringRef)) +NOTE(dependency_scan_unexpected_variant_extra_arg_note, none, + "%select{first|second}0 module command-line has extra argument: '%1'", (bool, StringRef)) + + #define UNDEFINE_DIAGNOSTIC_MACROS #include "DefineDiagnosticMacros.h" diff --git a/include/swift/AST/ModuleDependencies.h b/include/swift/AST/ModuleDependencies.h index f51ead05087d7..fbe5a90170d0b 100644 --- a/include/swift/AST/ModuleDependencies.h +++ b/include/swift/AST/ModuleDependencies.h @@ -55,6 +55,7 @@ class Identifier; class CompilerInstance; class IRGenOptions; class CompilerInvocation; +class DiagnosticEngine; /// Which kind of module dependencies we are looking for. enum class ModuleDependencyKind : int8_t { @@ -1254,7 +1255,8 @@ class ModuleDependenciesCache { ModuleDependencyInfo dependencies); /// Record dependencies for the given module collection. - void recordDependencies(ModuleDependencyVector moduleDependencies); + void recordDependencies(ModuleDependencyVector moduleDependencies, + DiagnosticEngine &diags); /// Update stored dependencies for the given module. void updateDependency(ModuleDependencyID moduleID, diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 1f042b10047d3..dcec91dabadd6 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -2201,13 +2201,6 @@ Identifier ASTContext::getRealModuleName(Identifier key, ModuleAliasLookupOption return value.first; } -namespace { - static StringRef pathStringFromSearchPath( - const SearchPathOptions::SearchPath &next) { - return next.Path; - } -} - std::vector ASTContext::getDarwinImplicitFrameworkSearchPaths() const { assert(LangOpts.Target.isOSDarwin()); diff --git a/lib/AST/ModuleDependencies.cpp b/lib/AST/ModuleDependencies.cpp index d6a2c7a6b1285..4fa8bb918322c 100644 --- a/lib/AST/ModuleDependencies.cpp +++ b/lib/AST/ModuleDependencies.cpp @@ -888,11 +888,61 @@ void ModuleDependenciesCache::recordDependency( } void ModuleDependenciesCache::recordDependencies( - ModuleDependencyVector dependencies) { + ModuleDependencyVector dependencies, DiagnosticEngine &diags) { for (const auto &dep : dependencies) { - if (!hasDependency(dep.first)) + if (hasDependency(dep.first)) { + if (dep.first.Kind == ModuleDependencyKind::Clang) { + auto priorClangModuleDetails = + findKnownDependency(dep.first).getAsClangModule(); + auto newClangModuleDetails = dep.second.getAsClangModule(); + auto priorContextHash = priorClangModuleDetails->contextHash; + auto newContextHash = newClangModuleDetails->contextHash; + if (priorContextHash != newContextHash) { + // This situation means that within the same scanning action, Clang + // Dependency Scanner has produced two different variants of the same + // module. This is not supposed to happen, but we are currently + // hunting down the rare cases where it does, seemingly due to + // differences in Clang Scanner direct by-name queries and transitive + // header lookup queries. + // + // Emit a failure diagnostic here that is hopefully more actionable + // for the time being. + diags.diagnose(SourceLoc(), diag::dependency_scan_unexpected_variant, + dep.first.ModuleName); + diags.diagnose( + SourceLoc(), + diag::dependency_scan_unexpected_variant_context_hash_note, + priorContextHash, newContextHash); + diags.diagnose( + SourceLoc(), + diag::dependency_scan_unexpected_variant_module_map_note, + priorClangModuleDetails->moduleMapFile, + newClangModuleDetails->moduleMapFile); + + auto diagnoseExtraCommandLineFlags = + [&diags](const ClangModuleDependencyStorage *checkModuleDetails, + const ClangModuleDependencyStorage *baseModuleDetails, + bool isNewlyDiscovered) -> void { + std::unordered_set baseCommandLineSet( + baseModuleDetails->buildCommandLine.begin(), + baseModuleDetails->buildCommandLine.end()); + for (const auto &checkArg : checkModuleDetails->buildCommandLine) + if (baseCommandLineSet.find(checkArg) == baseCommandLineSet.end()) + diags.diagnose( + SourceLoc(), + diag::dependency_scan_unexpected_variant_extra_arg_note, + isNewlyDiscovered, checkArg); + }; + diagnoseExtraCommandLineFlags(priorClangModuleDetails, + newClangModuleDetails, true); + diagnoseExtraCommandLineFlags(newClangModuleDetails, + priorClangModuleDetails, false); + } + } + } else recordDependency(dep.first.ModuleName, dep.second); - if (dep.second.getKind() == ModuleDependencyKind::Clang) { + + if (dep.first.Kind == ModuleDependencyKind::Clang) { auto clangModuleDetails = dep.second.getAsClangModule(); addSeenClangModule(clang::tooling::dependencies::ModuleID{ dep.first.ModuleName, clangModuleDetails->contextHash}); diff --git a/lib/ClangImporter/ClangModuleDependencyScanner.cpp b/lib/ClangImporter/ClangModuleDependencyScanner.cpp index 650473f7e5299..49a523bb5613d 100644 --- a/lib/ClangImporter/ClangModuleDependencyScanner.cpp +++ b/lib/ClangImporter/ClangModuleDependencyScanner.cpp @@ -516,7 +516,7 @@ bool ClangImporter::getHeaderDependencies( [&cache](StringRef path) { return cache.getScanService().remapPath(path); }); - cache.recordDependencies(bridgedDeps); + cache.recordDependencies(bridgedDeps, Impl.SwiftContext.Diags); llvm::copy(dependencies->FileDeps, std::back_inserter(headerFileInputs)); auto bridgedDependencyIDs = diff --git a/lib/DependencyScan/ModuleDependencyScanner.cpp b/lib/DependencyScan/ModuleDependencyScanner.cpp index dbe75b944e1c6..ff006ba3444a4 100644 --- a/lib/DependencyScan/ModuleDependencyScanner.cpp +++ b/lib/DependencyScan/ModuleDependencyScanner.cpp @@ -532,7 +532,7 @@ ModuleDependencyScanner::getNamedClangModuleDependencyInfo( for (const auto &dep : moduleDependencies) discoveredClangModules.insert(dep.first); - cache.recordDependencies(moduleDependencies); + cache.recordDependencies(moduleDependencies, Diagnostics); return cache.findDependency(moduleID); } @@ -566,7 +566,7 @@ ModuleDependencyScanner::getNamedSwiftModuleDependencyInfo( if (moduleDependencies.empty()) return std::nullopt; - cache.recordDependencies(moduleDependencies); + cache.recordDependencies(moduleDependencies, Diagnostics); return cache.findDependency(moduleName); } @@ -927,7 +927,7 @@ ModuleDependencyScanner::resolveAllClangModuleDependencies( std::lock_guard guard(cacheAccessLock); moduleLookupResult.insert_or_assign(moduleName, moduleDependencies); if (!moduleDependencies.empty()) - cache.recordDependencies(moduleDependencies); + cache.recordDependencies(moduleDependencies, Diagnostics); } }; @@ -1138,7 +1138,7 @@ void ModuleDependencyScanner::resolveSwiftImportsForModule( ScanningThreadPool.wait(); auto recordResolvedModuleImport = - [&cache, &moduleLookupResult, &importedSwiftDependencies, + [this, &cache, &moduleLookupResult, &importedSwiftDependencies, moduleID](const ScannerImportStatementInfo &moduleImport) { if (moduleID.ModuleName == moduleImport.importIdentifier) return; @@ -1152,7 +1152,7 @@ void ModuleDependencyScanner::resolveSwiftImportsForModule( } else { // Cache discovered module dependencies. if (!lookupResult.value().empty()) { - cache.recordDependencies(lookupResult.value()); + cache.recordDependencies(lookupResult.value(), Diagnostics); importedSwiftDependencies.insert({moduleImport.importIdentifier, lookupResult.value()[0].first.Kind}); } @@ -1306,7 +1306,7 @@ void ModuleDependencyScanner::resolveSwiftOverlayDependenciesForModule( ScanningThreadPool.wait(); // Aggregate both previously-cached and freshly-scanned module results - auto recordResult = [&cache, &swiftOverlayLookupResult, + auto recordResult = [this, &cache, &swiftOverlayLookupResult, &swiftOverlayDependencies, moduleID](const std::string &moduleName) { auto lookupResult = swiftOverlayLookupResult[moduleName]; @@ -1318,7 +1318,7 @@ void ModuleDependencyScanner::resolveSwiftOverlayDependenciesForModule( {moduleName, cachedInfo.value()->getKind()}); } else { // Cache discovered module dependencies. - cache.recordDependencies(lookupResult.value()); + cache.recordDependencies(lookupResult.value(), Diagnostics); if (!lookupResult.value().empty()) swiftOverlayDependencies.insert({moduleName, lookupResult.value()[0].first.Kind}); } From 9ab6a627b92a0d4fcbd715549954f868d7d81011 Mon Sep 17 00:00:00 2001 From: Michael Gottesman Date: Tue, 6 May 2025 09:27:31 -0700 Subject: [PATCH 46/51] [swift-settings] Increment the module format. I forgot to do this in b34e2d72fbfebd58e11bf6af8143c3e4340b289f. This is just to be careful. --- lib/Serialization/ModuleFormat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Serialization/ModuleFormat.h b/lib/Serialization/ModuleFormat.h index e84a2fe63e032..461c59d27ad36 100644 --- a/lib/Serialization/ModuleFormat.h +++ b/lib/Serialization/ModuleFormat.h @@ -58,7 +58,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0; /// describe what change you made. The content of this comment isn't important; /// it just ensures a conflict if two people change the module format. /// Don't worry about adhering to the 80-column limit for this line. -const uint16_t SWIFTMODULE_VERSION_MINOR = 947; // @preEnumExtensibility attribute +const uint16_t SWIFTMODULE_VERSION_MINOR = 948; // remove SwiftSettings /// A standard hash seed used for all string hashes in a serialized module. /// From ced96aa5cd653f834d2a8293ead8cf46649202cb Mon Sep 17 00:00:00 2001 From: Michael Gottesman Date: Tue, 6 May 2025 08:27:46 -0700 Subject: [PATCH 47/51] [concurrency] Ensure that we treat closures that are nonisolated(nonsending) via their ActorIsolation as nonisolated(nonsending). Some notes: 1. In most cases, I think we were getting lucky with this by just inferring the closure's isolation from its decl context. In the specific case that we were looking at here, this was not true since we are returning from an @concurrent async function a nonisolated(nonsending) method that closes over self. This occurs since even when NonisolatedNonsendingByDefault we want to start importing objc async functions as nonisolated(nonsending). 2. I also discovered that in the ActorIsolationChecker we were not visiting the inner autoclosure meaning that we never set the ActorIsolation field on the closure. After some discussion with @xedin about potentially visiting the function in the ActorIsolationChecker, we came to the conclusion that this was likely to result in source stability changes. So we put in a targeted fix just for autoclosures in this specific case by setting their actor isolation in the type checker. 3. Beyond adding tests to objc_async_from_swift to make sure that when NonisolatedNonsendingByDefault is disabled we do the right thing, I noticed that we did not have any tests that actually tested the behavior around objc_async_from_swift when NonisolatedNonsendingByDefault is enabled. So I added the relevant test lines so we can be sure that we get correct behavior in such a case. rdar://150209093 --- lib/SIL/IR/SILFunctionType.cpp | 3 + lib/SILGen/SILGen.cpp | 7 + lib/Sema/CSApply.cpp | 26 +- .../usr/include/ObjCConcurrency.h | 10 + test/SILGen/objc_async_from_swift.swift | 453 +++++++++++++++--- 5 files changed, 420 insertions(+), 79 deletions(-) diff --git a/lib/SIL/IR/SILFunctionType.cpp b/lib/SIL/IR/SILFunctionType.cpp index 58a66cf2162e4..9991ac4be4099 100644 --- a/lib/SIL/IR/SILFunctionType.cpp +++ b/lib/SIL/IR/SILFunctionType.cpp @@ -2633,6 +2633,9 @@ static CanSILFunctionType getSILFunctionType( } else if (decl->getAttrs().hasAttribute()) { actorIsolation = ActorIsolation::forNonisolated(false /*unsafe*/); } + } else if (auto *closure = constant->getAbstractClosureExpr()) { + if (auto isolation = closure->getActorIsolation()) + actorIsolation = isolation; } if (!actorIsolation) { diff --git a/lib/SILGen/SILGen.cpp b/lib/SILGen/SILGen.cpp index 87c17bf3fb179..4d49783414eae 100644 --- a/lib/SILGen/SILGen.cpp +++ b/lib/SILGen/SILGen.cpp @@ -765,6 +765,13 @@ static ActorIsolation getActorIsolationForFunction(SILFunction &fn) { return ActorIsolation::forNonisolated(false); } + // If we have a closure expr, check if our type is + // nonisolated(nonsending). In that case, we use that instead. + if (auto *closureExpr = constant.getAbstractClosureExpr()) { + if (auto actorIsolation = closureExpr->getActorIsolation()) + return actorIsolation; + } + // If we have actor isolation for our constant, put the isolation onto the // function. If the isolation is unspecified, we do not return it. if (auto isolation = diff --git a/lib/Sema/CSApply.cpp b/lib/Sema/CSApply.cpp index 7745773eb3aee..73f771f7c195b 100644 --- a/lib/Sema/CSApply.cpp +++ b/lib/Sema/CSApply.cpp @@ -1346,8 +1346,32 @@ namespace { new (ctx) AutoClosureExpr(/*set body later*/ nullptr, thunkTy, dc); thunk->setParameterList(thunkParamList); thunk->setThunkKind(AutoClosureExpr::Kind::SingleCurryThunk); + + // TODO: We should do this in the ActorIsolation checker but for now it is + // too risky. This is a narrow fix for 6.2. + // + // The problem that this is working around is given an autoclosure that + // returns an autoclosure that partially applies over an instance method, + // we do not visit the inner autoclosure in the ActorIsolation checker + // meaning that we do not properly call setActorIsolation on the + // AbstractClosureExpr that we produce here. + switch (thunkTy->getIsolation().getKind()) { + case FunctionTypeIsolation::Kind::NonIsolated: + case FunctionTypeIsolation::Kind::Parameter: + case FunctionTypeIsolation::Kind::Erased: + break; + case FunctionTypeIsolation::Kind::GlobalActor: + thunk->setActorIsolation(ActorIsolation::forGlobalActor( + thunkTy->getIsolation().getGlobalActorType())); + break; + case FunctionTypeIsolation::Kind::NonIsolatedCaller: + thunk->setActorIsolation( + ActorIsolation::forCallerIsolationInheriting()); + break; + } + cs.cacheType(thunk); - + // If the `self` type is existential, it must be opened. OpaqueValueExpr *baseOpened = nullptr; Expr *origBaseExpr = baseExpr; diff --git a/test/Inputs/clang-importer-sdk/usr/include/ObjCConcurrency.h b/test/Inputs/clang-importer-sdk/usr/include/ObjCConcurrency.h index 15d4468ff8ce4..75f6652ff4109 100644 --- a/test/Inputs/clang-importer-sdk/usr/include/ObjCConcurrency.h +++ b/test/Inputs/clang-importer-sdk/usr/include/ObjCConcurrency.h @@ -123,6 +123,16 @@ typedef void (^NonsendableCompletionHandler)(NSString * _Nullable, NSString * _N __attribute__((swift_async_error(zero_argument, 3))); - (void)getIceCreamFlavorWithCompletionHandler: (void (^)(Flavor flavor, NSError *__nullable error))completionHandler; + +@property(class, strong, readonly) SlowServer *standardServer; +- (void)getValueWithKey:(NSString *)valueIdentifier + completion:(void (^)(NSString *__nullable value, + NSError *__nullable error))completionHandler; +- (void)getMainActorValueWithKey:(NSString *)valueIdentifier + completion: + (void (^)(NSString *__nullable value, + NSError *__nullable error))completionHandler + MAIN_ACTOR; @end @protocol RefrigeratorDelegate diff --git a/test/SILGen/objc_async_from_swift.swift b/test/SILGen/objc_async_from_swift.swift index b3b60d453e3a5..53d11d9c7ce93 100644 --- a/test/SILGen/objc_async_from_swift.swift +++ b/test/SILGen/objc_async_from_swift.swift @@ -1,6 +1,10 @@ -// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -Xllvm -sil-print-types -emit-silgen -I %S/Inputs/custom-modules -target %target-swift-5.1-abi-triple %s -verify | %FileCheck --implicit-check-not=hop_to_executor --check-prefix=CHECK --check-prefix=CHECK-%target-cpu %s +// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -Xllvm -sil-print-types -emit-silgen -I %S/Inputs/custom-modules -target %target-swift-5.1-abi-triple %s -verify | %FileCheck --implicit-check-not=hop_to_executor --check-prefix=CHECK --check-prefix=CHECK-%target-cpu --check-prefix CHECK-C %s + +// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-upcoming-feature NonisolatedNonsendingByDefault -Xllvm -sil-print-types -emit-silgen -I %S/Inputs/custom-modules -target %target-swift-5.1-abi-triple %s -verify | %FileCheck --implicit-check-not=hop_to_executor --check-prefix=CHECK --check-prefix=CHECK-%target-cpu --check-prefix CHECK-NN %s + // REQUIRES: concurrency // REQUIRES: objc_interop +// REQUIRES: swift_feature_NonisolatedNonsendingByDefault import Foundation import ObjCConcurrency @@ -15,42 +19,46 @@ import ObjCConcurrency // CHECK-LABEL: sil {{.*}}@{{.*}}15testSlowServing func testSlowServing(p: SlowServing) async throws { - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none - // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] : + // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK: hop_to_executor [[HOP_TARGET]] : // CHECK: objc_method {{.*}} $@convention(objc_method) <τ_0_0 where τ_0_0 : SlowServing> (@convention(block) (Int) -> (), τ_0_0) -> () - // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] : + // CHECK: hop_to_executor [[HOP_TARGET]] : let _: Int = await p.requestInt() // CHECK: objc_method {{.*}} $@convention(objc_method) <τ_0_0 where τ_0_0 : SlowServing> (@convention(block) (NSString) -> (), τ_0_0) -> () - // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] : + // CHECK: hop_to_executor [[HOP_TARGET]] : let _: String = await p.requestString() // CHECK: objc_method {{.*}} $@convention(objc_method) <τ_0_0 where τ_0_0 : SlowServing> (@convention(block) (Int, NSString) -> (), τ_0_0) -> () - // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] : + // CHECK: hop_to_executor [[HOP_TARGET]] : let _: (Int, String) = await p.requestIntAndString() // CHECK: objc_method {{.*}} $@convention(objc_method) <τ_0_0 where τ_0_0 : SlowServing> (@convention(block) (Int, Optional, Optional) -> (), τ_0_0) -> () - // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] : - // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] : + // CHECK: hop_to_executor [[HOP_TARGET]] : + // CHECK: hop_to_executor [[HOP_TARGET]] : // CHECK-NEXT: builtin "willThrow" let _: (Int, String) = try await p.tryRequestIntAndString() } // CHECK-LABEL: sil {{.*}}@{{.*}}20testSlowServingAgain func testSlowServingAgain(p: SlowServing) async throws { - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none - // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] : + // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK: hop_to_executor [[HOP_TARGET]] : // CHECK: objc_method {{.*}} $@convention(objc_method) <τ_0_0 where τ_0_0 : SlowServing> (@convention(block) (Optional, Optional) -> (), τ_0_0) -> () - // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] : - // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] : + // CHECK: hop_to_executor [[HOP_TARGET]] : + // CHECK: hop_to_executor [[HOP_TARGET]] : // CHECK-NEXT: builtin "willThrow" let _: String = try await p.tryRequestString() } class SlowSwiftServer: NSObject, SlowServing { // CHECK-LABEL: sil {{.*}} @$s21objc_async_from_swift15SlowSwiftServerC10requestIntSiyYaF - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none - // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] : + // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK: hop_to_executor [[HOP_TARGET]] : + // CHECK: } // end sil function '$s21objc_async_from_swift15SlowSwiftServerC10requestIntSiyYaF{{.*}}' // CHECK-LABEL: sil private {{.*}} @${{.*}}10requestInt{{.*}}To : // CHECK: [[BLOCK_COPY:%.*]] = copy_block %0 // CHECK: [[SELF:%.*]] = copy_value %1 @@ -66,11 +74,13 @@ class SlowSwiftServer: NSObject, SlowServing { func requestInt() async -> Int { return 0 } func requestString() async -> String { return "" } // CHECK-LABEL: sil {{.*}} @$s21objc_async_from_swift15SlowSwiftServerC13requestStringSSyYaF - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none - // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] : + // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK: hop_to_executor [[HOP_TARGET]] : // CHECK-LABEL: sil {{.*}} @$s21objc_async_from_swift15SlowSwiftServerC16tryRequestStringSSyYaKF - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none - // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] : + // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK: hop_to_executor [[HOP_TARGET]] : // CHECK-LABEL: sil shared {{.*}} @${{.*}}16tryRequestString{{.*}}U_To : // CHECK: [[BLOCK_COPY:%.*]] = copy_block %0 // CHECK: try_apply{{.*}}@async{{.*}}, normal [[NORMAL:bb[0-9]+]], error [[ERROR:bb[0-9]+]] @@ -85,13 +95,15 @@ class SlowSwiftServer: NSObject, SlowServing { func tryRequestString() async throws -> String { return "" } // CHECK-LABEL: sil {{.*}} @$s21objc_async_from_swift15SlowSwiftServerC19requestIntAndStringSi_SStyYaF - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none - // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] : + // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK: hop_to_executor [[HOP_TARGET]] : func requestIntAndString() async -> (Int, String) { return (0, "") } // CHECK-LABEL: sil {{.*}} @$s21objc_async_from_swift15SlowSwiftServerC22tryRequestIntAndStringSi_SStyYaKF - // CHECK: [[GENERIC_EXECUTOR:%.*]] = enum $Optional, #Optional.none - // CHECK: hop_to_executor [[GENERIC_EXECUTOR]] : + // CHECK-NN: bb0([[HOP_TARGET:%.*]] : @guaranteed $Optional, + // CHECK-C: [[HOP_TARGET:%.*]] = enum $Optional, #Optional.none + // CHECK: hop_to_executor [[HOP_TARGET]] : func tryRequestIntAndString() async throws -> (Int, String) { return (0, "") } } @@ -108,19 +120,30 @@ extension SlowServer: NativelySlowServing {} class SlowServerlet: SlowServer { // Native Function // - // CHECK-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC011doSomethingE8NullablyySiSSYaF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> Int - // CHECK-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional - // CHECK: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt - // CHECK: hop_to_executor [[ACTOR]] - // CHECK: // end sil function '$s21objc_async_from_swift13SlowServerletC011doSomethingE8NullablyySiSSYaF' - + // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC011doSomethingE8NullablyySiSSYaF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> Int + // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: hop_to_executor [[ACTOR]] + // CHECK-C: // end sil function '$s21objc_async_from_swift13SlowServerletC011doSomethingE8NullablyySiSSYaF' + + // CHECK-NN-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC011doSomethingE8NullablyySiSSYaF : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed String, @guaranteed SlowServerlet) -> Int { + // CHECK-NN: bb0([[ACTOR:%.*]] : @guaranteed $Optional + // CHECK-NN: hop_to_executor [[ACTOR]] + // CHECK-NN: } // end sil function '$s21objc_async_from_swift13SlowServerletC011doSomethingE8NullablyySiSSYaF' + + // TODO: We are labeling this as having caller_isolation_inheriting when NN + // is enabled... but we do not have an actor parameter. This is incorrect. + // // @objc thunk closure // // CHECK-LABEL: sil shared [thunk] [ossa] @$s21objc_async_from_swift13SlowServerletC011doSomethingE8NullablyySiSSYaFyyYacfU_To : $@convention(thin) @Sendable @async (NSString, Optional<@convention(block) @Sendable (Int) -> ()>, SlowServerlet) -> () { + // CHECK-NN: [[NONE:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK: [[STR_ARG:%.*]] = begin_borrow {{.*}} : $String // CHECK: [[SELF:%.*]] = begin_borrow {{.*}} : $SlowServerlet - // CHECK: [[FUNC:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC011doSomethingE8NullablyySiSSYaF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> Int - // CHECK: apply [[FUNC]]([[STR_ARG]], [[SELF]]) + // CHECK-C: [[FUNC:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC011doSomethingE8NullablyySiSSYaF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> Int + // CHECK-C: apply [[FUNC]]([[STR_ARG]], [[SELF]]) + // CHECK-NN: [[FUNC:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC011doSomethingE8NullablyySiSSYaF : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed String, @guaranteed SlowServerlet) -> Int + // CHECK-NN: apply [[FUNC]]([[NONE]], [[STR_ARG]], [[SELF]]) // CHECK: } // end sil function '$s21objc_async_from_swift13SlowServerletC011doSomethingE8NullablyySiSSYaFyyYacfU_To' override func doSomethingSlowNullably(_: String) async -> Int { return 0 @@ -128,18 +151,26 @@ class SlowServerlet: SlowServer { // Native function. // - // CHECK-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC18findAnswerNullablyyS2SYaF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> @owned String - // CHECK-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional - // CHECK: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt - // CHECK-NEXT: hop_to_executor [[ACTOR]] - // CHECK: } // end sil function '$s21objc_async_from_swift13SlowServerletC18findAnswerNullablyyS2SYaF' + // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC18findAnswerNullablyyS2SYaF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> @owned String + // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C-NEXT: hop_to_executor [[ACTOR]] + // CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC18findAnswerNullablyyS2SYaF' + + // CHECK-NN-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC18findAnswerNullablyyS2SYaF : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed String, @guaranteed SlowServerlet) -> @owned String { + // CHECK-NN: bb0([[ACTOR:%.*]] : @guaranteed $Optional, + // CHECK-NN: hop_to_executor [[ACTOR]] + // CHECK-NN: } // end sil function '$s21objc_async_from_swift13SlowServerletC18findAnswerNullablyyS2SYaF' // @objc closure thunk // CHECK-LABEL: sil shared [thunk] [ossa] @$s21objc_async_from_swift13SlowServerletC18findAnswerNullablyyS2SYaFyyYacfU_To : $@convention(thin) @Sendable @async (NSString, Optional<@convention(block) @Sendable (NSString) -> ()>, SlowServerlet) -> () { + // CHECK-NN: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK: [[STR_ARG:%.*]] = begin_borrow {{.*}} : $String // CHECK: [[SELF:%.*]] = begin_borrow {{.*}} : $SlowServerlet - // CHECK: [[FUNC:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC18findAnswerNullablyyS2SYaF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> @owned String - // CHECK: apply [[FUNC]]([[STR_ARG]], [[SELF]]) + // CHECK-C: [[FUNC:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC18findAnswerNullablyyS2SYaF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> @owned String + // CHECK-C: apply [[FUNC]]([[STR_ARG]], [[SELF]]) + // CHECK-NN: [[FUNC:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC18findAnswerNullablyyS2SYaF : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed String, @guaranteed SlowServerlet) -> @owned String + // CHECK-NN: apply [[FUNC]]([[ACTOR]], [[STR_ARG]], [[SELF]]) // CHECK: } // end sil function '$s21objc_async_from_swift13SlowServerletC18findAnswerNullablyyS2SYaFyyYacfU_To' override func findAnswerNullably(_ x: String) async -> String { return x @@ -147,19 +178,27 @@ class SlowServerlet: SlowServer { // Native // - // CHECK-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC28doSomethingDangerousNullablyyS2SYaKF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> (@owned String, @error any Error) - // CHECK-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional, - // CHECK: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt - // CHECK-NEXT: hop_to_executor [[ACTOR]] - // CHECK: } // end sil function '$s21objc_async_from_swift13SlowServerletC28doSomethingDangerousNullablyyS2SYaKF' + // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC28doSomethingDangerousNullablyyS2SYaKF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> (@owned String, @error any Error) + // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional, + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C-NEXT: hop_to_executor [[ACTOR]] + // CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC28doSomethingDangerousNullablyyS2SYaKF' + + // CHECK-NN-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC28doSomethingDangerousNullablyyS2SYaKF : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed String, @guaranteed SlowServerlet) -> (@owned String, @error any Error) { + // CHECK-NN: bb0([[ACTOR:%.*]] : @guaranteed $Optional, + // CHECK-NN: hop_to_executor [[ACTOR]] + // CHECK-NN: } // end sil function '$s21objc_async_from_swift13SlowServerletC28doSomethingDangerousNullablyyS2SYaKF' // @objc thunk closure // // CHECK-LABEL: sil shared [thunk] [ossa] @$s21objc_async_from_swift13SlowServerletC28doSomethingDangerousNullablyyS2SYaKFyyYacfU_To : $@convention(thin) @Sendable @async (NSString, Optional<@convention(block) @Sendable (Optional, Optional) -> ()>, SlowServerlet) -> () { + // CHECK-NN: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK: [[STR_ARG:%.*]] = begin_borrow {{.*}} : $String // CHECK: [[SELF:%.*]] = begin_borrow {{.*}} : $SlowServerlet - // CHECK: [[NATIVE:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC28doSomethingDangerousNullablyyS2SYaKF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> (@owned String, @error any Error) - // CHECK: apply [[NATIVE]]([[STR_ARG]], [[SELF]]) + // CHECK-C: [[NATIVE:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC28doSomethingDangerousNullablyyS2SYaKF : $@convention(method) @async (@guaranteed String, @guaranteed SlowServerlet) -> (@owned String, @error any Error) + // CHECK-C: apply [[NATIVE]]([[STR_ARG]], [[SELF]]) + // CHECK-NN: [[NATIVE:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC28doSomethingDangerousNullablyyS2SYaKF : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed String, @guaranteed SlowServerlet) -> (@owned String, @error any Error) + // CHECK-NN: apply [[NATIVE]]([[ACTOR]], [[STR_ARG]], [[SELF]]) // CHECK: } // end sil function '$s21objc_async_from_swift13SlowServerletC28doSomethingDangerousNullablyyS2SYaKFyyYacfU_To' override func doSomethingDangerousNullably(_ x: String) async throws -> String { return x @@ -167,17 +206,25 @@ class SlowServerlet: SlowServer { // Native // - // CHECK-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC30doSomethingUnspecifiedNullablySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error) - // CHECK-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional, - // CHECK: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt - // CHECK-NEXT: hop_to_executor [[ACTOR]] - // CHECK: } // end sil function '$s21objc_async_from_swift13SlowServerletC30doSomethingUnspecifiedNullablySSyYaKF' + // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC30doSomethingUnspecifiedNullablySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error) + // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional, + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C-NEXT: hop_to_executor [[ACTOR]] + // CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC30doSomethingUnspecifiedNullablySSyYaKF' + + // CHECK-NN-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC30doSomethingUnspecifiedNullablySSyYaKF : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed SlowServerlet) -> (@owned String, @error any Error) { + // CHECK-NN: bb0([[ACTOR:%.*]] : @guaranteed $Optional, + // CHECK-NN: hop_to_executor [[ACTOR]] + // CHECK-NN: } // end sil function '$s21objc_async_from_swift13SlowServerletC30doSomethingUnspecifiedNullablySSyYaKF' // @objc closure thunk // CHECK-LABEL: sil shared [thunk] [ossa] @$s21objc_async_from_swift13SlowServerletC30doSomethingUnspecifiedNullablySSyYaKFyyYacfU_To : $@convention(thin) @Sendable @async (Optional<@convention(block) @Sendable (Optional, Optional) -> ()>, SlowServerlet) -> () { + // CHECK-NN: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt // CHECK: [[SELF:%.*]] = begin_borrow {{.*}} : $SlowServerlet - // CHECK: [[NATIVE:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC30doSomethingUnspecifiedNullablySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error) - // CHECK: apply [[NATIVE]]([[SELF]]) + // CHECK-C: [[NATIVE:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC30doSomethingUnspecifiedNullablySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error) + // CHECK-C: try_apply [[NATIVE]]([[SELF]]) + // CHECK-NN: [[NATIVE:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC30doSomethingUnspecifiedNullablySSyYaKF : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed SlowServerlet) -> (@owned String, @error any Error) + // CHECK-NN: try_apply [[NATIVE]]([[ACTOR]], [[SELF]]) // CHECK: } // end sil function '$s21objc_async_from_swift13SlowServerletC30doSomethingUnspecifiedNullablySSyYaKFyyYacfU_To' override func doSomethingUnspecifiedNullably() async throws -> String { fatalError() @@ -185,20 +232,31 @@ class SlowServerlet: SlowServer { // Native // - // CHECK-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC17doSomethingFlaggySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error) - // CHECK-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional, - // CHECK: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt - // CHECK-NEXT: hop_to_executor [[ACTOR]] + // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC17doSomethingFlaggySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error) + // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional, + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C-NEXT: hop_to_executor [[ACTOR]] + // CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC17doSomethingFlaggySSyYaKF' + + // CHECK-NN-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC17doSomethingFlaggySSyYaKF : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed SlowServerlet) -> (@owned String, @error any Error) { + // CHECK-NN: bb0([[ACTOR:%.*]] : @guaranteed $Optional, + // CHECK-NN: hop_to_executor [[ACTOR]] + // CHECK-NN: } // end sil function '$s21objc_async_from_swift13SlowServerletC17doSomethingFlaggySSyYaKF' // @objc thunk closure // CHECK-LABEL: sil shared [thunk] [ossa] @$s21objc_async_from_swift13SlowServerletC17doSomethingFlaggySSyYaKFyyYacfU_To : $@convention(thin) @Sendable @async (@convention(block) @Sendable ({{.*}}, Optional, Optional) -> (), SlowServerlet) -> () { - // CHECK: [[SELF:%.*]] = begin_borrow {{.*}} : $SlowServerlet - // CHECK: [[NATIVE:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC17doSomethingFlaggySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error) - // CHECK: try_apply [[NATIVE]]([[SELF]]) : {{.*}}, normal [[NORMAL_BB:bb[0-9]+]], error [[ERROR_BB:bb[0-9]+]] + // CHECK-NN: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK: [[SELF:%.*]] = begin_borrow {{.*}} : $SlowServerlet + // CHECK-C: [[NATIVE:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC17doSomethingFlaggySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error) + // CHECK-C: try_apply [[NATIVE]]([[SELF]]) : {{.*}}, normal [[NORMAL_BB:bb[0-9]+]], error [[ERROR_BB:bb[0-9]+]] + // CHECK-NN: [[NATIVE:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC17doSomethingFlaggySSyYaKF : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed SlowServerlet) -> (@owned String, @error any Error) + // CHECK-NN: try_apply [[NATIVE]]([[ACTOR]], [[SELF]]) : {{.*}}, normal [[NORMAL_BB:bb[0-9]+]], error [[ERROR_BB:bb[0-9]+]] + // // CHECK: [[NORMAL_BB]]({{.*}}): - // CHECK: integer_literal {{.*}}0 + // CHECK: integer_literal {{.*}}0 + // // CHECK: [[ERROR_BB]]({{.*}}): - // CHECK: integer_literal {{.*}}1 + // CHECK: integer_literal {{.*}}1 // CHECK: } // end sil function '$s21objc_async_from_swift13SlowServerletC17doSomethingFlaggySSyYaKFyyYacfU_To' override func doSomethingFlaggy() async throws -> String { return "" @@ -206,39 +264,59 @@ class SlowServerlet: SlowServer { // Native // - // CHECK-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC21doSomethingZeroFlaggySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error) - // CHECK-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional, - // CHECK: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt - // CHECK-NEXT: hop_to_executor [[ACTOR]] - // CHECK: } // end sil function '$s21objc_async_from_swift13SlowServerletC21doSomethingZeroFlaggySSyYaKF' + // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC21doSomethingZeroFlaggySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error) + // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional, + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C-NEXT: hop_to_executor [[ACTOR]] + // CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC21doSomethingZeroFlaggySSyYaKF' + // + // CHECK-NN-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC21doSomethingZeroFlaggySSyYaKF : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed SlowServerlet) -> (@owned String, @error any Error) { + // CHECK-NN: bb0([[ACTOR:%.*]] : @guaranteed $Optional, + // CHECK-NN: hop_to_executor [[ACTOR]] + // CHECK-NN: } // end sil function '$s21objc_async_from_swift13SlowServerletC21doSomethingZeroFlaggySSyYaKF' // // @objc thunk closure // CHECK-LABEL: sil shared [thunk] [ossa] @$s21objc_async_from_swift13SlowServerletC21doSomethingZeroFlaggySSyYaKFyyYacfU_To : $@convention(thin) @Sendable @async (@convention(block) @Sendable (Optional, {{.*}}, Optional) -> (), SlowServerlet) -> () { - // CHECK: [[SELF:%.*]] = begin_borrow {{.*}} : $SlowServerlet - // CHECK: [[NATIVE:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC21doSomethingZeroFlaggySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error) - // CHECK: try_apply [[NATIVE]]([[SELF]]) : {{.*}}, normal [[NORMAL_BB:bb[0-9]+]], error [[ERROR_BB:bb[0-9]+]] + // CHECK-NN: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK: [[SELF:%.*]] = begin_borrow {{.*}} : $SlowServerlet + // CHECK-C: [[NATIVE:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC21doSomethingZeroFlaggySSyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @error any Error) + // CHECK-C: try_apply [[NATIVE]]([[SELF]]) : {{.*}}, normal [[NORMAL_BB:bb[0-9]+]], error [[ERROR_BB:bb[0-9]+]] + // CHECK-NN: [[NATIVE:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC21doSomethingZeroFlaggySSyYaKF : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed SlowServerlet) -> (@owned String, @error any Error) + // CHECK-NN: try_apply [[NATIVE]]([[ACTOR]], [[SELF]]) : {{.*}}, normal [[NORMAL_BB:bb[0-9]+]], error [[ERROR_BB:bb[0-9]+]] + // // CHECK: [[NORMAL_BB]]({{.*}}): - // CHECK: integer_literal {{.*}}1 + // CHECK: integer_literal {{.*}}1 + // // CHECK: [[ERROR_BB]]({{.*}}): - // CHECK: integer_literal {{.*}}0 + // CHECK: integer_literal {{.*}}0 override func doSomethingZeroFlaggy() async throws -> String { return "" } // Native // - // CHECK-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC28doSomethingMultiResultFlaggySS_SStyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @owned String, @error any Error) - // CHECK-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional, - // CHECK: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt - // CHECK-NEXT: hop_to_executor [[ACTOR]] - // CHECK: } // end sil function '$s21objc_async_from_swift13SlowServerletC28doSomethingMultiResultFlaggySS_SStyYaKF' + // CHECK-C-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC28doSomethingMultiResultFlaggySS_SStyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @owned String, @error any Error) + // CHECK-C-NOT: bb0([[ACTOR:%.*]] : @guaranteed $Optional, + // CHECK-C: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C-NEXT: hop_to_executor [[ACTOR]] + // CHECK-C: } // end sil function '$s21objc_async_from_swift13SlowServerletC28doSomethingMultiResultFlaggySS_SStyYaKF' + // + // CHECK-NN-LABEL: sil hidden [ossa] @$s21objc_async_from_swift13SlowServerletC28doSomethingMultiResultFlaggySS_SStyYaKF : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed SlowServerlet) -> (@owned String, @owned String, @error any Error) { + // CHECK-NN: bb0([[ACTOR:%.*]] : @guaranteed $Optional, + // CHECK-NN: hop_to_executor [[ACTOR]] + // CHECK-NN: } // end sil function '$s21objc_async_from_swift13SlowServerletC28doSomethingMultiResultFlaggySS_SStyYaKF' // // CHECK-LABEL: sil shared [thunk] [ossa] @$s21objc_async_from_swift13SlowServerletC28doSomethingMultiResultFlaggySS_SStyYaKFyyYacfU_To : $@convention(thin) @Sendable @async (@convention(block) @Sendable ({{.*}}, Optional, Optional, Optional) -> (), SlowServerlet) -> () { - // CHECK: [[SELF:%.*]] = begin_borrow {{.*}} : $SlowServerlet - // CHECK: [[NATIVE:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC28doSomethingMultiResultFlaggySS_SStyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @owned String, @error any Error) - // CHECK: try_apply [[NATIVE]]([[SELF]]) : {{.*}}, normal [[NORMAL_BB:bb[0-9]+]], error [[ERROR_BB:bb[0-9]+]] + // CHECK-NN: [[ACTOR:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK: [[SELF:%.*]] = begin_borrow {{.*}} : $SlowServerlet + // CHECK-C: [[NATIVE:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC28doSomethingMultiResultFlaggySS_SStyYaKF : $@convention(method) @async (@guaranteed SlowServerlet) -> (@owned String, @owned String, @error any Error) + // CHECK-C: try_apply [[NATIVE]]([[SELF]]) : {{.*}}, normal [[NORMAL_BB:bb[0-9]+]], error [[ERROR_BB:bb[0-9]+]] + // CHECK-NN: [[NATIVE:%.*]] = function_ref @$s21objc_async_from_swift13SlowServerletC28doSomethingMultiResultFlaggySS_SStyYaKF : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed SlowServerlet) -> (@owned String, @owned String, @error any Error) + // CHECK-NN: try_apply [[NATIVE]]([[ACTOR]], [[SELF]]) : {{.*}}, normal [[NORMAL_BB:bb[0-9]+]], error [[ERROR_BB:bb[0-9]+]] + // // CHECK: [[NORMAL_BB]]({{.*}}): // CHECK: integer_literal {{.*}}1 + // // CHECK: [[ERROR_BB]]({{.*}}): // CHECK: integer_literal {{.*}}0 // CHECK: } // end sil function '$s21objc_async_from_swift13SlowServerletC28doSomethingMultiResultFlaggySS_SStyYaKFyyYacfU_To' @@ -294,3 +372,222 @@ actor Dril: NSObject { return true } } + +// Check that we do not crash here and emit the autoclosures correctly +func testAutoclosureInStaticMethod() { + final class TestKlass { + // Default argument for method. + // + // CHECK-LABEL: sil private [ossa] @$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C8getValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZfA0_ : $@convention(thin) () -> @owned @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error) { + // + // Get standard. + // CHECK: [[METATYPE:%.*]] = metatype $@objc_metatype SlowServer.Type + // CHECK: [[GET_STANDARD_FUNC:%.*]] = objc_method %1 : $@objc_metatype SlowServer.Type, #SlowServer.standard!getter.foreign : (SlowServer.Type) -> () -> SlowServer, $@convention(objc_method) (@objc_metatype SlowServer.Type) -> @autoreleased SlowServer + // CHECK: [[STANDARD:%.*]] = apply [[GET_STANDARD_FUNC]]([[METATYPE]]) + // + // Then grab value. + // CHECK: [[GET_VALUE:%.*]] = function_ref @$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C8getValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZfA0_S2SYaKYCcSo10SlowServerCcfu_ : $@convention(thin) (@guaranteed SlowServer) -> @owned @async @callee_guaranteed (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed String) -> (@owned String, @error any Error) + // CHECK: [[RESULT:%.*]] = apply [[GET_VALUE]]([[STANDARD]]) + // + // Then we need to thunk to eliminate the implicit leading parameter. We use + // the thunk that passes in .none so this acts as a concurrent function. + // + // CHECK: [[THUNK_FN:%.*]] = function_ref @$sScA_pSgS2Ss5Error_pIegHggozo_S2SsAB_pIegHgozo_TR : $@convention(thin) @async (@guaranteed String, @guaranteed @async @callee_guaranteed (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed String) -> (@owned String, @error any Error)) -> (@owned String, @error any Error) + // CHECK: [[THUNKED:%.*]] = partial_apply [callee_guaranteed] [[THUNK_FN]]([[RESULT]]) + // CHECK: return [[THUNKED]] + // CHECK: } // end sil function '$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C8getValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZfA0_' + + // This is the first implicit closure. We close over self here. + // + // CHECK-LABEL: sil private [ossa] @$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C8getValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZfA0_S2SYaKYCcSo10SlowServerCcfu_ : $@convention(thin) (@guaranteed SlowServer) -> @owned @async @callee_guaranteed (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed String) -> (@owned String, @error any Error) { + // CHECK: bb0([[SELF:%.*]] : + // + // Close over self and return it. + // CHECK: [[SECOND_CLOSURE:%.*]] = function_ref @$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C8getValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZfA0_S2SYaKYCcSo10SlowServerCcfu_S2SYaKYCcfu0_ : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed String, @guaranteed SlowServer) -> (@owned String, @error any Error) + // CHECK: [[SELF_COPY:%.*]] = copy_value [[SELF]] + // CHECK: [[CLOSE_OVER_SELF:%.*]] = partial_apply [callee_guaranteed] [[SECOND_CLOSURE]]([[SELF_COPY]]) + // CHECK: return [[CLOSE_OVER_SELF]] + // CHECK: } // end sil function '$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C8getValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZfA0_S2SYaKYCcSo10SlowServerCcfu_' + + // The second closure. In this function we actually perform the objective-c call. + // CHECK-LABEL: sil private [ossa] @$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C8getValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZfA0_S2SYaKYCcSo10SlowServerCcfu_S2SYaKYCcfu0_ : $@convention(thin) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed String, @guaranteed SlowServer) -> (@owned String, @error any Error) { + // CHECK: bb0([[ACTOR:%.*]] : @guaranteed $Optional, [[ARG:%.*]] : @guaranteed $String, [[CAPTURE:%.*]] : @closureCapture @guaranteed $SlowServer): + // + // Hop to the actor + // CHECK: hop_to_executor [[ACTOR]] + // + // Declare result + // CHECK: [[RESULT:%.*]] = alloc_stack $String + // + // Bridge string arg. + // CHECK: [[ARG_C:%.*]] = copy_value [[ARG]] + // CHECK: [[BRIDGE_FN:%.*]] = function_ref @$sSS10FoundationE19_bridgeToObjectiveCSo8NSStringCyF : $@convention(method) (@guaranteed String) -> @owned NSString + // CHECK: [[ARG_C_B:%.*]] = begin_borrow [[ARG_C]] + // CHECK: [[NS_STRING:%.*]] = apply [[BRIDGE_FN]]([[ARG_C_B]]) + // + // ObjC Method + // CHECK: [[OBJC_METHOD:%.*]] = objc_method [[CAPTURE]] + // + // Prepare the continuation. + // CHECK: [[RAW_UNSAFE_CONT:%.*]] = get_async_continuation_addr [throws] String, [[RESULT]] + // CHECK: [[UNSAFE_CONT:%.*]] = struct $UnsafeContinuation ([[RAW_UNSAFE_CONT]] : + // CHECK: [[BLOCK_STORAGE:%.*]] = alloc_stack $@block_storage Any + // CHECK: [[PROJ_BLOCK_STORAGE:%.*]] = project_block_storage [[BLOCK_STORAGE]] + // CHECK: [[INIT_PROJ_BLOCK_STORAGE:%.*]] = init_existential_addr [[PROJ_BLOCK_STORAGE]] + // CHECK: store [[UNSAFE_CONT]] to [trivial] [[INIT_PROJ_BLOCK_STORAGE]] + // CHECK: merge_isolation_region [[BLOCK_STORAGE]] : $*@block_storage Any, [[RESULT]] + // CHECK: [[OBJC_COMPLETION_HANDLER_IMPL:%.*]] = function_ref @$sSo8NSStringCSgSo7NSErrorCSgIeyBhyy_SSTz_ : $@convention(c) @Sendable (@inout_aliasable @block_storage Any, Optional, Optional) -> () + // CHECK: [[BLOCK:%.*]] = init_block_storage_header [[BLOCK_STORAGE]] : $*@block_storage Any, invoke [[OBJC_COMPLETION_HANDLER_IMPL]] + // CHECK: merge_isolation_region [[CAPTURE]] : $SlowServer, [[BLOCK_STORAGE]] + // CHECK: apply [[OBJC_METHOD]]([[NS_STRING]], [[BLOCK]], [[CAPTURE]]) + // CHECK: await_async_continuation [[RAW_UNSAFE_CONT]] : $Builtin.RawUnsafeContinuation, resume [[RESUME_BB:bb[0-9]+]], error [[ERROR_BB:bb[0-9]+]] + // + // CHECK: [[RESUME_BB]]: + // CHECK: hop_to_executor [[ACTOR]] + // CHECK: [[LOADED_RESULT:%.*]] = load [take] [[RESULT]] + // CHECK: return [[LOADED_RESULT]] + // + // CHECK: [[ERROR_BB]]([[ERROR:%.*]] : + // CHECK: hop_to_executor [[ACTOR]] + // CHECK: throw [[ERROR]] + // CHECK: } // end sil function '$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C8getValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZfA0_S2SYaKYCcSo10SlowServerCcfu_S2SYaKYCcfu0_' + + // Actual static method + // + // We do not actually care about FileChecking this... we just need to + // FileCheck the hop_to_executor to show to FileCheck that we expect these + // hop_to_executor lines to occur in the function since we reject + // non-explicitly specified hop_to_executor lines. + // + // CHECK-C-LABEL: sil private [ossa] @$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C8getValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZ : $@convention(method) @async (@guaranteed String, @guaranteed @noescape @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error), @thick TestKlass.Type) -> @owned Optional { + // CHECK-C: bb0([[STRING:%.*]] : @guaranteed $String, [[COMPLETION:%.*]] : @guaranteed $@noescape @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error), [[METATYPE:%.*]] : $@thick TestKlass.Type) + // CHECK-C: [[EXEC_NONE:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: hop_to_executor [[EXEC_NONE]] + // CHECK-C: hop_to_executor [[EXEC_NONE]] + // CHECK-C: hop_to_executor [[EXEC_NONE]] + // CHECK-C: } // end sil function '$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C8getValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZ' + // + // CHECK-NN-LABEL: sil private [ossa] @$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C8getValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZ : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed String, @guaranteed @noescape @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error), @thick TestKlass.Type) -> @owned Optional { + // CHECK-NN: bb0([[ACTOR:%.*]] : @guaranteed $Optional, [[STRING:%.*]] : @guaranteed $String, [[COMPLETION:%.*]] : @guaranteed $@noescape @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error), [[METATYPE:%.*]] : $@thick TestKlass.Type) + // CHECK-NN: hop_to_executor [[ACTOR]] + // CHECK-NN: hop_to_executor [[ACTOR]] + // CHECK-NN: hop_to_executor [[ACTOR]] + // CHECK-NN: } // end sil function '$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C8getValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZ' + static func getValue(id: String, + valueForKey: (_ identifier: String) async throws -> String = SlowServer.standard.value(withKey:)) async -> String? { + let result: String + do { + result = try await valueForKey(id) + } catch { + return nil + } + return result + } + + // Default argument for method. + // + // CHECK-LABEL: sil private [ossa] @$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C17getMainActorValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZfA0_ : $@convention(thin) () -> @owned @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error) { + // + // Get standard. + // CHECK: [[METATYPE:%.*]] = metatype $@objc_metatype SlowServer.Type + // CHECK: [[GET_STANDARD_FUNC:%.*]] = objc_method %1 : $@objc_metatype SlowServer.Type, #SlowServer.standard!getter.foreign : (SlowServer.Type) -> () -> SlowServer, $@convention(objc_method) (@objc_metatype SlowServer.Type) -> @autoreleased SlowServer + // CHECK: [[STANDARD:%.*]] = apply [[GET_STANDARD_FUNC]]([[METATYPE]]) + // + // Then grab value. + // CHECK: [[GET_VALUE:%.*]] = function_ref @$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C17getMainActorValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZfA0_S2SYaKScMYccSo10SlowServerCcfu_ : $@convention(thin) (@guaranteed SlowServer) -> @owned @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error) + // CHECK: [[RESULT:%.*]] = apply [[GET_VALUE]]([[STANDARD]]) + // + // CHECK: return [[RESULT]] + // CHECK: } // end sil function '$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C17getMainActorValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZfA0_' + + // This is the first implicit closure. We close over self here. + // + // CHECK-LABEL: sil private [ossa] @$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C17getMainActorValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZfA0_S2SYaKScMYccSo10SlowServerCcfu_ : $@convention(thin) (@guaranteed SlowServer) -> @owned @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error) { + // CHECK: bb0([[SELF:%.*]] : + // + // Close over self and return it. + // CHECK: [[SECOND_CLOSURE:%.*]] = function_ref @$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C17getMainActorValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZfA0_S2SYaKScMYccSo10SlowServerCcfu_S2SYaKScMYccfu0_ : $@convention(thin) @async (@guaranteed String, @guaranteed SlowServer) -> (@owned String, @error any Error) + // CHECK: [[SELF_COPY:%.*]] = copy_value [[SELF]] + // CHECK: [[CLOSE_OVER_SELF:%.*]] = partial_apply [callee_guaranteed] [[SECOND_CLOSURE]]([[SELF_COPY]]) + // CHECK: return [[CLOSE_OVER_SELF]] + // CHECK: } // end sil function '$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C17getMainActorValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZfA0_S2SYaKScMYccSo10SlowServerCcfu_' + + // The second closure. In this function we actually perform the objective-c call. + // + // It is main actor isolated. + // + // CHECK-LABEL: sil private [ossa] @$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C17getMainActorValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZfA0_S2SYaKScMYccSo10SlowServerCcfu_S2SYaKScMYccfu0_ : $@convention(thin) @async (@guaranteed String, @guaranteed SlowServer) -> (@owned String, @error any Error) { + // CHECK: bb0([[ARG:%.*]] : @guaranteed $String, [[CAPTURE:%.*]] : @closureCapture @guaranteed $SlowServer): + // + // CHECK: [[ACTOR:%.*]] = apply {{%.*}}({{%.*}}) : $@convention(method) (@thick MainActor.Type) -> @owned MainActor + // + // Hop to the actor + // CHECK: [[ACTOR_B:%.*]] = begin_borrow [[ACTOR]] + // CHECK: hop_to_executor [[ACTOR_B]] + // + // Declare result + // CHECK: [[RESULT:%.*]] = alloc_stack $String + // + // Bridge string arg. + // CHECK: [[ARG_C:%.*]] = copy_value [[ARG]] + // CHECK: [[BRIDGE_FN:%.*]] = function_ref @$sSS10FoundationE19_bridgeToObjectiveCSo8NSStringCyF : $@convention(method) (@guaranteed String) -> @owned NSString + // CHECK: [[ARG_C_B:%.*]] = begin_borrow [[ARG_C]] + // CHECK: [[NS_STRING:%.*]] = apply [[BRIDGE_FN]]([[ARG_C_B]]) + // + // ObjC Method + // CHECK: [[OBJC_METHOD:%.*]] = objc_method [[CAPTURE]] + // + // Prepare the continuation. + // CHECK: [[RAW_UNSAFE_CONT:%.*]] = get_async_continuation_addr [throws] String, [[RESULT]] + // CHECK: [[UNSAFE_CONT:%.*]] = struct $UnsafeContinuation ([[RAW_UNSAFE_CONT]] : + // CHECK: [[BLOCK_STORAGE:%.*]] = alloc_stack $@block_storage Any + // CHECK: [[PROJ_BLOCK_STORAGE:%.*]] = project_block_storage [[BLOCK_STORAGE]] + // CHECK: [[INIT_PROJ_BLOCK_STORAGE:%.*]] = init_existential_addr [[PROJ_BLOCK_STORAGE]] + // CHECK: store [[UNSAFE_CONT]] to [trivial] [[INIT_PROJ_BLOCK_STORAGE]] + // CHECK: merge_isolation_region [[BLOCK_STORAGE]] : $*@block_storage Any, [[RESULT]] + // CHECK: [[OBJC_COMPLETION_HANDLER_IMPL:%.*]] = function_ref @$sSo8NSStringCSgSo7NSErrorCSgIeyBhyy_SSTz_ : $@convention(c) @Sendable (@inout_aliasable @block_storage Any, Optional, Optional) -> () + // CHECK: [[BLOCK:%.*]] = init_block_storage_header [[BLOCK_STORAGE]] : $*@block_storage Any, invoke [[OBJC_COMPLETION_HANDLER_IMPL]] + // CHECK: merge_isolation_region [[CAPTURE]] : $SlowServer, [[BLOCK_STORAGE]] + // CHECK: apply [[OBJC_METHOD]]([[NS_STRING]], [[BLOCK]], [[CAPTURE]]) + // CHECK: await_async_continuation [[RAW_UNSAFE_CONT]] : $Builtin.RawUnsafeContinuation, resume [[RESUME_BB:bb[0-9]+]], error [[ERROR_BB:bb[0-9]+]] + // + // CHECK: [[RESUME_BB]]: + // CHECK: hop_to_executor [[ACTOR_B]] + // CHECK: [[LOADED_RESULT:%.*]] = load [take] [[RESULT]] + // CHECK: return [[LOADED_RESULT]] + // + // CHECK: [[ERROR_BB]]([[ERROR:%.*]] : + // CHECK: hop_to_executor [[ACTOR_B]] + // CHECK: throw [[ERROR]] + // CHECK: } // end sil function '$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C17getMainActorValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZfA0_S2SYaKScMYccSo10SlowServerCcfu_S2SYaKScMYccfu0_' + + // Actual static method + // + // This is not main actor isolated + // + // CHECK-C-LABEL: sil private [ossa] @$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C17getMainActorValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZ : $@convention(method) @async (@guaranteed String, @guaranteed @noescape @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error), @thick TestKlass.Type) -> @owned Optional { + // CHECK-C: bb0([[STRING:%.*]] : @guaranteed $String, [[COMPLETION:%.*]] : @guaranteed $@noescape @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error), [[METATYPE:%.*]] : $@thick TestKlass.Type) + // CHECK-C: [[EXEC_NONE:%.*]] = enum $Optional, #Optional.none!enumelt + // CHECK-C: hop_to_executor [[EXEC_NONE]] + // CHECK-C: hop_to_executor [[EXEC_NONE]] + // CHECK-C: hop_to_executor [[EXEC_NONE]] + // CHECK-C: } // end sil function '$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C17getMainActorValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZ' + // + // CHECK-NN-LABEL: sil private [ossa] @$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C17getMainActorValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZ : $@convention(method) @async (@sil_isolated @sil_implicit_leading_param @guaranteed Optional, @guaranteed String, @guaranteed @noescape @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error), @thick TestKlass.Type) -> @owned Optional { + // CHECK-NN: bb0([[ACTOR:%.*]] : @guaranteed $Optional, [[STRING:%.*]] : @guaranteed $String, [[COMPLETION:%.*]] : @guaranteed $@noescape @async @callee_guaranteed (@guaranteed String) -> (@owned String, @error any Error), [[METATYPE:%.*]] : $@thick TestKlass.Type) + // CHECK-NN: hop_to_executor [[ACTOR]] + // CHECK-NN: hop_to_executor [[ACTOR]] + // CHECK-NN: hop_to_executor [[ACTOR]] + // CHECK-NN: } // end sil function '$s21objc_async_from_swift29testAutoclosureInStaticMethodyyF9TestKlassL_C17getMainActorValue2id11valueForKeySSSgSS_S2SYaKXEtYaFZ' + static func getMainActorValue(id: String, + valueForKey: (_ identifier: String) async throws -> String = SlowServer.standard.mainActorValue(withKey:)) async -> String? { + let result: String + do { + result = try await valueForKey(id) + } catch { + return nil + } + return result + } + } +} From bc22bcd820888dea478b14ba97436c51708fae8a Mon Sep 17 00:00:00 2001 From: Guillaume Lessard Date: Tue, 6 May 2025 14:47:35 -0700 Subject: [PATCH 48/51] [stdlib] remove TODOs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These TODOs aren’t particularly actionable. What we really want is a way to define `_overrideLifetime()` in a not-unsafe way, and that will probably be a `Builtin` operation. --- stdlib/public/core/LifetimeManager.swift | 6 ------ 1 file changed, 6 deletions(-) diff --git a/stdlib/public/core/LifetimeManager.swift b/stdlib/public/core/LifetimeManager.swift index c8c555efb926e..4939333732dfc 100644 --- a/stdlib/public/core/LifetimeManager.swift +++ b/stdlib/public/core/LifetimeManager.swift @@ -295,8 +295,6 @@ public func _overrideLifetime< >( _ dependent: consuming T, borrowing source: borrowing U ) -> T { - // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence - // should be expressed by a builtin that is hidden within the function body. dependent } @@ -313,8 +311,6 @@ public func _overrideLifetime< >( _ dependent: consuming T, copying source: borrowing U ) -> T { - // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence - // should be expressed by a builtin that is hidden within the function body. dependent } @@ -332,7 +328,5 @@ public func _overrideLifetime< _ dependent: consuming T, mutating source: inout U ) -> T { - // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence - // should be expressed by a builtin that is hidden within the function body. dependent } From d0445f3758179ddeba06f77959e8b4ba98cbc624 Mon Sep 17 00:00:00 2001 From: Guillaume Lessard Date: Wed, 30 Apr 2025 17:44:10 -0700 Subject: [PATCH 49/51] [test] remove more copies of `_overrideLifetime()` --- .../Inputs/lifetime_dependence.swift | 18 -------- ...licit_lifetime_dependence_specifiers.swift | 24 ----------- test/SIL/implicit_lifetime_dependence.swift | 24 ----------- ...fetime_dependence_span_lifetime_attr.swift | 24 ----------- .../addressable_dependencies.swift | 8 ---- .../dependence_insertion.swift | 13 ------ .../lifetime_dependence_mutate.swift | 42 ------------------ .../lifetime_dependence/semantics.swift | 43 ------------------- 8 files changed, 196 deletions(-) diff --git a/test/ModuleInterface/Inputs/lifetime_dependence.swift b/test/ModuleInterface/Inputs/lifetime_dependence.swift index 8c04ab6867d72..8ffdaf1e82090 100644 --- a/test/ModuleInterface/Inputs/lifetime_dependence.swift +++ b/test/ModuleInterface/Inputs/lifetime_dependence.swift @@ -1,21 +1,3 @@ -@_unsafeNonescapableResult -@_alwaysEmitIntoClient -@_transparent -@lifetime(borrow source) -internal func _overrideLifetime( - _ dependent: consuming T, borrowing source: borrowing U) -> T { - dependent -} - -@_unsafeNonescapableResult -@_alwaysEmitIntoClient -@_transparent -@lifetime(copy source) -internal func _overrideLifetime( - _ dependent: consuming T, copying source: borrowing U) -> T { - dependent -} - public struct AnotherView : ~Escapable { @usableFromInline let _ptr: UnsafeRawBufferPointer @usableFromInline let _count: Int diff --git a/test/SIL/explicit_lifetime_dependence_specifiers.swift b/test/SIL/explicit_lifetime_dependence_specifiers.swift index 1d74064d689ca..4872d19ab6a9b 100644 --- a/test/SIL/explicit_lifetime_dependence_specifiers.swift +++ b/test/SIL/explicit_lifetime_dependence_specifiers.swift @@ -8,30 +8,6 @@ import Builtin -@_unsafeNonescapableResult -@lifetime(borrow source) -internal func _overrideLifetime< - T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable ->( - _ dependent: consuming T, borrowing source: borrowing U -) -> T { - // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence - // should be expressed by a builtin that is hidden within the function body. - dependent -} - -@_unsafeNonescapableResult -@lifetime(copy source) -internal func _overrideLifetime< - T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable ->( - _ dependent: consuming T, copying source: borrowing U -) -> T { - // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence - // should be expressed by a builtin that is hidden within the function body. - dependent -} - struct BufferView : ~Escapable { let ptr: UnsafeRawBufferPointer // CHECK-LABEL: sil hidden @$s39explicit_lifetime_dependence_specifiers10BufferViewVyACSWcfC : $@convention(method) (UnsafeRawBufferPointer, @thin BufferView.Type) -> @lifetime(borrow 0) @owned BufferView { diff --git a/test/SIL/implicit_lifetime_dependence.swift b/test/SIL/implicit_lifetime_dependence.swift index 181235c3b7daa..c70d5ddccb408 100644 --- a/test/SIL/implicit_lifetime_dependence.swift +++ b/test/SIL/implicit_lifetime_dependence.swift @@ -5,30 +5,6 @@ // REQUIRES: swift_feature_LifetimeDependence -@_unsafeNonescapableResult -@lifetime(borrow source) -internal func _overrideLifetime< - T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable ->( - _ dependent: consuming T, borrowing source: borrowing U -) -> T { - // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence - // should be expressed by a builtin that is hidden within the function body. - dependent -} - -@_unsafeNonescapableResult -@lifetime(copy source) -internal func _overrideLifetime< - T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable ->( - _ dependent: consuming T, copying source: borrowing U -) -> T { - // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence - // should be expressed by a builtin that is hidden within the function body. - dependent -} - struct BufferView : ~Escapable { let ptr: UnsafeRawBufferPointer let c: Int diff --git a/test/SIL/lifetime_dependence_span_lifetime_attr.swift b/test/SIL/lifetime_dependence_span_lifetime_attr.swift index 4d478b19b2523..8771b788a3b2d 100644 --- a/test/SIL/lifetime_dependence_span_lifetime_attr.swift +++ b/test/SIL/lifetime_dependence_span_lifetime_attr.swift @@ -5,30 +5,6 @@ // REQUIRES: swift_in_compiler // REQUIRES: swift_feature_LifetimeDependence -@_unsafeNonescapableResult -@lifetime(borrow source) -internal func _overrideLifetime< - T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable ->( - _ dependent: consuming T, borrowing source: borrowing U -) -> T { - // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence - // should be expressed by a builtin that is hidden within the function body. - dependent -} - -@_unsafeNonescapableResult -@lifetime(copy source) -internal func _overrideLifetime< - T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable ->( - _ dependent: consuming T, copying source: borrowing U -) -> T { - // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence - // should be expressed by a builtin that is hidden within the function body. - dependent -} - // TODO: Use real Range public struct FakeRange { public let lowerBound: Bound diff --git a/test/SILOptimizer/addressable_dependencies.swift b/test/SILOptimizer/addressable_dependencies.swift index 2b05f43d757db..a9a54f51cdf12 100644 --- a/test/SILOptimizer/addressable_dependencies.swift +++ b/test/SILOptimizer/addressable_dependencies.swift @@ -6,14 +6,6 @@ import Builtin -// Copied from the stdlib until we have Builtin.overrideLifetime. -@_unsafeNonescapableResult -@lifetime(borrow source) -internal func _overrideLifetime( - _ dependent: consuming T, borrowing source: borrowing U) -> T { - dependent -} - struct NodeRef: ~Escapable { private var parent: UnsafePointer diff --git a/test/SILOptimizer/lifetime_dependence/dependence_insertion.swift b/test/SILOptimizer/lifetime_dependence/dependence_insertion.swift index f3cf707c6e9b4..0fc2b1578bec0 100644 --- a/test/SILOptimizer/lifetime_dependence/dependence_insertion.swift +++ b/test/SILOptimizer/lifetime_dependence/dependence_insertion.swift @@ -17,19 +17,6 @@ import Builtin -@unsafe -@_unsafeNonescapableResult -@_alwaysEmitIntoClient -@_transparent -@lifetime(borrow source) -internal func _overrideLifetime< - T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable ->( - _ dependent: consuming T, borrowing source: borrowing U -) -> T { - dependent -} - struct BV : ~Escapable { let p: UnsafeRawPointer let i: Int diff --git a/test/SILOptimizer/lifetime_dependence/lifetime_dependence_mutate.swift b/test/SILOptimizer/lifetime_dependence/lifetime_dependence_mutate.swift index e880a0dac7d07..0f7f361bd694e 100644 --- a/test/SILOptimizer/lifetime_dependence/lifetime_dependence_mutate.swift +++ b/test/SILOptimizer/lifetime_dependence/lifetime_dependence_mutate.swift @@ -8,48 +8,6 @@ // REQUIRES: swift_in_compiler // REQUIRES: swift_feature_LifetimeDependence -/// Unsafely discard any lifetime dependency on the `dependent` argument. Return -/// a value identical to `dependent` with a lifetime dependency on the caller's -/// borrow scope of the `source` argument. -@_unsafeNonescapableResult -@_transparent -@lifetime(borrow source) -internal func _overrideLifetime< - T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable ->( - _ dependent: consuming T, borrowing source: borrowing U -) -> T { - dependent -} - -/// Unsafely discard any lifetime dependency on the `dependent` argument. Return -/// a value identical to `dependent` that inherits all lifetime dependencies from -/// the `source` argument. -@_unsafeNonescapableResult -@_transparent -@lifetime(copy source) -internal func _overrideLifetime< - T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable ->( - _ dependent: consuming T, copying source: borrowing U -) -> T { - dependent -} - -/// Unsafely discard any lifetime dependency on the `dependent` argument. Return -/// a value identical to `dependent` that inherits all lifetime dependencies from -/// the `source` argument. -@_unsafeNonescapableResult -@_transparent -@lifetime(&source) -internal func _overrideLifetime< - T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable ->( - _ dependent: consuming T, mutating source: inout U -) -> T { - dependent -} - struct MutableSpan : ~Escapable, ~Copyable { let base: UnsafeMutableRawPointer let count: Int diff --git a/test/SILOptimizer/lifetime_dependence/semantics.swift b/test/SILOptimizer/lifetime_dependence/semantics.swift index 7a2e012532932..1d98624cfaabf 100644 --- a/test/SILOptimizer/lifetime_dependence/semantics.swift +++ b/test/SILOptimizer/lifetime_dependence/semantics.swift @@ -15,49 +15,6 @@ import Builtin -@_unsafeNonescapableResult -@_transparent -@lifetime(borrow source) -internal func _overrideLifetime< - T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable ->( - _ dependent: consuming T, borrowing source: borrowing U -) -> T { - // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence - // should be expressed by a builtin that is hidden within the function body. - dependent -} - -/// Unsafely discard any lifetime dependency on the `dependent` argument. Return -/// a value identical to `dependent` that inherits all lifetime dependencies from -/// the `source` argument. -@_unsafeNonescapableResult -@_transparent -@lifetime(copy source) -internal func _overrideLifetime< - T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable ->( - _ dependent: consuming T, copying source: borrowing U -) -> T { - // TODO: Remove @_unsafeNonescapableResult. Instead, the unsafe dependence - // should be expressed by a builtin that is hidden within the function body. - dependent -} - -/// Unsafely discard any lifetime dependency on the `dependent` argument. Return -/// a value identical to `dependent` that inherits all lifetime dependencies from -/// the `source` argument. -@_unsafeNonescapableResult -@_transparent -@lifetime(&source) -internal func _overrideLifetime< - T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable ->( - _ dependent: consuming T, mutating source: inout U -) -> T { - dependent -} - struct NotEscapable: ~Escapable {} // Lifetime dependence semantics by example. From 4f4141fea8546ce68d48f6aeec95b557216329b6 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Sun, 4 May 2025 05:36:10 +0100 Subject: [PATCH 50/51] Frontend: Obsolete `-fixit-all` and `-emit-fixits-path` With `ARCMigrate` and `arcmt-test` removed from clang in https://github.com/llvm/llvm-project/pull/119269 and the new code migration experience under way (see https://github.com/swiftlang/swift-evolution/pull/2673), these options are no longer relevant nor known to be in use. They were introduced long ago to support fix-it application in Xcode. For now, turn them into a no-op and emit a obsoletion warning. --- include/swift/AST/DiagnosticsFrontend.def | 2 + .../ArgsToFrontendOutputsConverter.cpp | 5 +- lib/Frontend/CompilerInvocation.cpp | 15 +- test/CMakeLists.txt | 2 - test/Constraints/argument_matching.swift | 9 + test/Constraints/bridging.swift | 22 ++ test/FixCode/batch-mode.swift | 24 -- test/FixCode/fixit-all.swift | 5 + test/FixCode/fixits-apply-all.swift | 26 -- test/FixCode/fixits-apply-all.swift.result | 26 -- test/FixCode/fixits-apply-objc.swift | 111 ------ test/FixCode/fixits-apply-objc.swift.result | 111 ------ test/FixCode/fixits-apply.swift | 318 ------------------ test/FixCode/fixits-apply.swift.result | 318 ------------------ test/FixCode/fixits-if-else.swift | 34 -- test/FixCode/fixits-if-else.swift.result | 34 -- test/Macros/macro_fixits.swift | 7 +- test/Sema/generic_specialization.swift | 5 + test/Sema/immutability.swift | 8 +- test/attr/attr_extern_fixit.swift | 5 +- test/attr/attr_extern_fixit.swift.result | 7 - test/diagnostics/verifier.swift | 10 +- .../conversions/RawRepresentable_fixits.swift | 221 ++++++++++++ test/expr/primary/literal/int.swift | 18 + test/expr/primary/selector/fixits.swift | 142 +++++++- 25 files changed, 434 insertions(+), 1051 deletions(-) delete mode 100644 test/FixCode/batch-mode.swift create mode 100644 test/FixCode/fixit-all.swift delete mode 100644 test/FixCode/fixits-apply-all.swift delete mode 100644 test/FixCode/fixits-apply-all.swift.result delete mode 100644 test/FixCode/fixits-apply-objc.swift delete mode 100644 test/FixCode/fixits-apply-objc.swift.result delete mode 100644 test/FixCode/fixits-apply.swift delete mode 100644 test/FixCode/fixits-apply.swift.result delete mode 100644 test/FixCode/fixits-if-else.swift delete mode 100644 test/FixCode/fixits-if-else.swift.result delete mode 100644 test/attr/attr_extern_fixit.swift.result create mode 100644 test/expr/conversions/RawRepresentable_fixits.swift create mode 100644 test/expr/primary/literal/int.swift diff --git a/include/swift/AST/DiagnosticsFrontend.def b/include/swift/AST/DiagnosticsFrontend.def index 53235b494e1d6..c03df5307f904 100644 --- a/include/swift/AST/DiagnosticsFrontend.def +++ b/include/swift/AST/DiagnosticsFrontend.def @@ -193,6 +193,8 @@ ERROR(cannot_emit_ir_skipping_function_bodies,none, WARNING(emit_reference_dependencies_without_primary_file,none, "ignoring -emit-reference-dependencies (requires -primary-file)", ()) +WARNING(ignoring_option_obsolete,none, + "ignoring '%0'; this option is obsolete", (StringRef)) WARNING(ignoring_option_requires_option,none, "ignoring %0 (requires %1)", (StringRef, StringRef)) WARNING(warn_ignore_option_overriden_by,none, diff --git a/lib/Frontend/ArgsToFrontendOutputsConverter.cpp b/lib/Frontend/ArgsToFrontendOutputsConverter.cpp index 512db282c3e53..21d152c029b02 100644 --- a/lib/Frontend/ArgsToFrontendOutputsConverter.cpp +++ b/lib/Frontend/ArgsToFrontendOutputsConverter.cpp @@ -317,8 +317,6 @@ SupplementaryOutputPathsComputer::getSupplementaryOutputPathsFromArguments() options::OPT_emit_reference_dependencies_path); auto serializedDiagnostics = getSupplementaryFilenamesFromArguments( options::OPT_serialize_diagnostics_path); - auto fixItsOutput = getSupplementaryFilenamesFromArguments( - options::OPT_emit_fixits_path); auto loadedModuleTrace = getSupplementaryFilenamesFromArguments( options::OPT_emit_loaded_module_trace_path); auto TBD = getSupplementaryFilenamesFromArguments(options::OPT_emit_tbd_path); @@ -343,7 +341,7 @@ SupplementaryOutputPathsComputer::getSupplementaryOutputPathsFromArguments() options::OPT_save_optimization_record_path); if (!clangHeaderOutput || !moduleOutput || !moduleDocOutput || !dependenciesFile || !referenceDependenciesFile || - !serializedDiagnostics || !fixItsOutput || !loadedModuleTrace || !TBD || + !serializedDiagnostics || !loadedModuleTrace || !TBD || !moduleInterfaceOutput || !privateModuleInterfaceOutput || !packageModuleInterfaceOutput || !moduleSourceInfoOutput || !moduleSummaryOutput || !abiDescriptorOutput || !moduleSemanticInfoOutput || !optRecordOutput) { @@ -361,7 +359,6 @@ SupplementaryOutputPathsComputer::getSupplementaryOutputPathsFromArguments() sop.DependenciesFilePath = (*dependenciesFile)[i]; sop.ReferenceDependenciesFilePath = (*referenceDependenciesFile)[i]; sop.SerializedDiagnosticsPath = (*serializedDiagnostics)[i]; - sop.FixItsOutputPath = (*fixItsOutput)[i]; sop.LoadedModuleTracePath = (*loadedModuleTrace)[i]; sop.TBDPath = (*TBD)[i]; sop.ModuleInterfaceOutputPath = (*moduleInterfaceOutput)[i]; diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 788702af76cc8..f3f151197c8eb 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -2548,7 +2548,20 @@ static bool ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args, Opts.EmitMacroExpansionFiles = !negated; } - Opts.FixitCodeForAllDiagnostics |= Args.hasArg(OPT_fixit_all); + { + OptSpecifier obsoleteOpts[] = { + OPT_fixit_all, + OPT_emit_fixits_path, + }; + + for (auto option: obsoleteOpts) { + if (auto *arg = Args.getLastArg(option)) { + Diags.diagnose(SourceLoc(), diag::ignoring_option_obsolete, + arg->getOption().getPrefixedName()); + } + } + } + Opts.SuppressWarnings |= Args.hasArg(OPT_suppress_warnings); Opts.SuppressRemarks |= Args.hasArg(OPT_suppress_remarks); for (const Arg *arg : Args.filtered(OPT_warning_treating_Group)) { diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 503a8748ae64b..82f501ebb71ec 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -114,8 +114,6 @@ function(get_test_dependencies SDK result_var_name) if(NOT SWIFT_BUILT_STANDALONE) list(APPEND deps_binaries - arcmt-test - c-arcmt-test c-index-test CASPluginTest clang diff --git a/test/Constraints/argument_matching.swift b/test/Constraints/argument_matching.swift index 9b0fba2d77952..2d653c9ac7462 100644 --- a/test/Constraints/argument_matching.swift +++ b/test/Constraints/argument_matching.swift @@ -1821,3 +1821,12 @@ struct Issue75527 { fn(0) // Make sure the argument label does not escape here. } } + +do { + func f(p: Int, _: String) {} + // FIXME: Wrong expected argument type. + // expected-error@+2:5 {{cannot convert value of type 'Int' to expected argument type 'String'}} + // expected-error@+1:8 {{cannot convert value of type 'String' to expected argument type 'Int'}} + f(0, "") + // expected-error@-1:4 {{missing argument label 'p:' in call}}{{5-5=p: }} +} diff --git a/test/Constraints/bridging.swift b/test/Constraints/bridging.swift index dd8dae4661590..2ee61c0eed737 100644 --- a/test/Constraints/bridging.swift +++ b/test/Constraints/bridging.swift @@ -367,6 +367,28 @@ func forceUniversalBridgeToAnyObject(a: T, b: U, c: An _ = z } +do { + func f(an : Any, oan: Any?) -> AnyObject? { + let a1 : AnyObject + a1 = an + // expected-error@-1:8 {{value of type 'Any' expected to be an instance of a class or class-constrained type in assignment}}{{none}} + // expected-note@-2:8 {{cast 'Any' to 'AnyObject' or use 'as!' to force downcast to a more specific type to access members}}{{12-12= as AnyObject}} + let a2 : AnyObject? + a2 = an + // expected-error@-1:10 {{value of type 'Any' expected to be an instance of a class or class-constrained type in assignment}}{{12-12= as AnyObject}} + let a3 : AnyObject! + a3 = an + // expected-error@-1:10 {{value of type 'Any' expected to be an instance of a class or class-constrained type in assignment}}{{12-12= as AnyObject}} + + let obj: AnyObject = an + // expected-error@-1:26 {{value of type 'Any' expected to be instance of class or class-constrained type}}{{none}} + // expected-note@-2:26 {{cast 'Any' to 'AnyObject' or use 'as!' to force downcast to a more specific type to access members}}{{28-28= as AnyObject}} + + return oan + // expected-error@-1:12 {{return expression of type 'Any' expected to be an instance of a class or class-constrained type}}{{15-15= as AnyObject}} + } +} + func bridgeAnyContainerToAnyObject(x: [Any], y: [NSObject: Any]) { var z: AnyObject z = x as AnyObject diff --git a/test/FixCode/batch-mode.swift b/test/FixCode/batch-mode.swift deleted file mode 100644 index affc27fa01648..0000000000000 --- a/test/FixCode/batch-mode.swift +++ /dev/null @@ -1,24 +0,0 @@ -// RUN: not %target-swift-frontend -typecheck -primary-file %s -emit-fixits-path %t.main.remap -primary-file %S/Inputs/batch-mode-helper.swift -emit-fixits-path %t.helper.remap -// RUN: %FileCheck -check-prefix=CHECK-MAIN %s < %t.main.remap -// RUN: %FileCheck -check-prefix=NEGATIVE-MAIN %s < %t.main.remap -// RUN: %FileCheck -check-prefix=CHECK-HELPER %s < %t.helper.remap -// RUN: %FileCheck -check-prefix=NEGATIVE-HELPER %s < %t.helper.remap - -// CHECK-MAIN: "file": "{{.+}}batch-mode.swift" -// CHECK-MAIN: "text": "case .a:\n<#code#>\ncase .b:\n<#code#>\ncase .c:\n<#code#>\n" -// NEGATIVE-MAIN-NOT: batch-mode-helper.swift - -// CHECK-HELPER: "file": "{{.+}}batch-mode-helper.swift" -// CHECK-HELPER: "text": "case .x:\n<#code#>\ncase .y:\n<#code#>\ncase .z:\n<#code#>\n" -// NEGATIVE-HELPER-NOT: batch-mode.swift - -enum E1 { - case a - case b - case c -} - -func fooMain(_ e: E1) { - switch e { - } -} diff --git a/test/FixCode/fixit-all.swift b/test/FixCode/fixit-all.swift new file mode 100644 index 0000000000000..00e0de2c1d7b2 --- /dev/null +++ b/test/FixCode/fixit-all.swift @@ -0,0 +1,5 @@ +// RUN: %empty-directory(%t) +// RUN: %target-swift-frontend -typecheck -fixit-all -emit-fixits-path %t.remap %s 2>&1 | %FileCheck %s + +// CHECK: :0: warning: ignoring '-fixit-all'; this option is obsolete +// CHECK: :0: warning: ignoring '-emit-fixits-path'; this option is obsolete diff --git a/test/FixCode/fixits-apply-all.swift b/test/FixCode/fixits-apply-all.swift deleted file mode 100644 index 2b7ec0310f90a..0000000000000 --- a/test/FixCode/fixits-apply-all.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This tests whether we accept fixits from warnings without filtering. -// The particular diagnostics used are not important. - -// RUN: %swift -typecheck -target %target-triple %s -fixit-all -emit-fixits-path %t.remap -// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %s.result - -func ftest1() { - let myvar = 0 -} - -func foo() -> Int { - do { - } catch var err { - goo(err) - } -} -func goo(_ e: Error) { - -} - -@warn_unused_result(message="test message") -func warn_unused_result_removal() -> Int { return 5 } - -@discardableResult func discardableResultOnVoidFunc() {} - -@discardableResult func discardableResultOnNeverFunc() -> Never { fatalError() } diff --git a/test/FixCode/fixits-apply-all.swift.result b/test/FixCode/fixits-apply-all.swift.result deleted file mode 100644 index af4204def1c16..0000000000000 --- a/test/FixCode/fixits-apply-all.swift.result +++ /dev/null @@ -1,26 +0,0 @@ -// This tests whether we accept fixits from warnings without filtering. -// The particular diagnostics used are not important. - -// RUN: %swift -typecheck -target %target-triple %s -fixit-all -emit-fixits-path %t.remap -// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %s.result - -func ftest1() { - _ = 0 -} - -func foo() -> Int { - do { - } catch let err { - goo(err) - } -} -func goo(_ e: Error) { - -} - - -func warn_unused_result_removal() -> Int { return 5 } - -func discardableResultOnVoidFunc() {} - -func discardableResultOnNeverFunc() -> Never { fatalError() } diff --git a/test/FixCode/fixits-apply-objc.swift b/test/FixCode/fixits-apply-objc.swift deleted file mode 100644 index 505bce01daccb..0000000000000 --- a/test/FixCode/fixits-apply-objc.swift +++ /dev/null @@ -1,111 +0,0 @@ -// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-objc-attr-requires-foundation-module -typecheck %s -emit-fixits-path %t.remap -// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %s.result -import ObjectiveC - -// REQUIRES: objc_interop - -@objc class Selectors { - func takeSel(_: Selector) {} - @objc func mySel() {} - func test() { - takeSel("mySel") - takeSel(Selector("mySel")) - } -} - -@objc class OtherClass { - func test(s: Selectors) { - s.takeSel("mySel") - s.takeSel(Selector("mySel")) - } -} - -@objc class Base { - @objc func baseSel() {} -} - -@objc class Outer { - func takeSel(_: Selector) {} - @objc func outerSel() {} - - @objc class Inner: Base { - func takeSel(_: Selector) {} - - @objc func innerSel() {} - - func test(s: Selectors, o: Outer) { - s.takeSel("mySel") - s.takeSel(Selector("mySel")) - - takeSel("innerSel") - takeSel(Selector("innerSel")) - - takeSel("baseSel") - takeSel(Selector("baseSel")) - - o.takeSel("outerSel") - o.takeSel(Selector("outerSel")) - } - } - - func test(s: Selectors, i: Inner) { - s.takeSel("mySel") - s.takeSel(Selector("mySel")) - - i.takeSel("innerSel") - i.takeSel(Selector("innerSel")) - - i.takeSel("baseSel") - i.takeSel(Selector("baseSel")) - - takeSel("outerSel") - takeSel(Selector("outerSel")) - } -} - -extension Outer { - func test2(s: Selectors, i: Inner) { - s.takeSel("mySel") - s.takeSel(Selector("mySel")) - - i.takeSel("innerSel") - i.takeSel(Selector("innerSel")) - - i.takeSel("baseSel") - i.takeSel(Selector("baseSel")) - - takeSel("outerSel") - takeSel(Selector("outerSel")) - } -} - -func freeTest(s: Selectors, o: Outer, i: Outer.Inner) { - s.takeSel("mySel") - s.takeSel(Selector("mySel")) - - i.takeSel("innerSel") - i.takeSel(Selector("innerSel")) - - i.takeSel("baseSel") - i.takeSel(Selector("baseSel")) - - o.takeSel("outerSel") - o.takeSel(Selector("outerSel")) -} - -func foo(an : Any) { - let a1 : AnyObject - a1 = an - let a2 : AnyObject? - a2 = an - let a3 : AnyObject! - a3 = an -} - -func foo1(_ an : Any) { - let obj: AnyObject = an -} - -func foo2(_ messageData: Any?) -> AnyObject? { - return messageData -} diff --git a/test/FixCode/fixits-apply-objc.swift.result b/test/FixCode/fixits-apply-objc.swift.result deleted file mode 100644 index d31139051bb06..0000000000000 --- a/test/FixCode/fixits-apply-objc.swift.result +++ /dev/null @@ -1,111 +0,0 @@ -// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-objc-attr-requires-foundation-module -typecheck %s -emit-fixits-path %t.remap -// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %s.result -import ObjectiveC - -// REQUIRES: objc_interop - -@objc class Selectors { - func takeSel(_: Selector) {} - @objc func mySel() {} - func test() { - takeSel(#selector(self.mySel)) - takeSel(#selector(self.mySel)) - } -} - -@objc class OtherClass { - func test(s: Selectors) { - s.takeSel(#selector(Selectors.mySel)) - s.takeSel(#selector(Selectors.mySel)) - } -} - -@objc class Base { - @objc func baseSel() {} -} - -@objc class Outer { - func takeSel(_: Selector) {} - @objc func outerSel() {} - - @objc class Inner: Base { - func takeSel(_: Selector) {} - - @objc func innerSel() {} - - func test(s: Selectors, o: Outer) { - s.takeSel(#selector(Selectors.mySel)) - s.takeSel(#selector(Selectors.mySel)) - - takeSel(#selector(self.innerSel)) - takeSel(#selector(self.innerSel)) - - takeSel(#selector(self.baseSel)) - takeSel(#selector(self.baseSel)) - - o.takeSel(#selector(Outer.outerSel)) - o.takeSel(#selector(Outer.outerSel)) - } - } - - func test(s: Selectors, i: Inner) { - s.takeSel(#selector(Selectors.mySel)) - s.takeSel(#selector(Selectors.mySel)) - - i.takeSel(#selector(Inner.innerSel)) - i.takeSel(#selector(Inner.innerSel)) - - i.takeSel(#selector(Base.baseSel)) - i.takeSel(#selector(Base.baseSel)) - - takeSel(#selector(self.outerSel)) - takeSel(#selector(self.outerSel)) - } -} - -extension Outer { - func test2(s: Selectors, i: Inner) { - s.takeSel(#selector(Selectors.mySel)) - s.takeSel(#selector(Selectors.mySel)) - - i.takeSel(#selector(Inner.innerSel)) - i.takeSel(#selector(Inner.innerSel)) - - i.takeSel(#selector(Base.baseSel)) - i.takeSel(#selector(Base.baseSel)) - - takeSel(#selector(self.outerSel)) - takeSel(#selector(self.outerSel)) - } -} - -func freeTest(s: Selectors, o: Outer, i: Outer.Inner) { - s.takeSel(#selector(Selectors.mySel)) - s.takeSel(#selector(Selectors.mySel)) - - i.takeSel(#selector(Inner.innerSel)) - i.takeSel(#selector(Inner.innerSel)) - - i.takeSel(#selector(Base.baseSel)) - i.takeSel(#selector(Base.baseSel)) - - o.takeSel(#selector(Outer.outerSel)) - o.takeSel(#selector(Outer.outerSel)) -} - -func foo(an : Any) { - let a1 : AnyObject - a1 = an as AnyObject - let a2 : AnyObject? - a2 = an as AnyObject - let a3 : AnyObject! - a3 = an as AnyObject -} - -func foo1(_ an : Any) { - let obj: AnyObject = an as AnyObject -} - -func foo2(_ messageData: Any?) -> AnyObject? { - return messageData as AnyObject -} diff --git a/test/FixCode/fixits-apply.swift b/test/FixCode/fixits-apply.swift deleted file mode 100644 index eee2c6bddbc4d..0000000000000 --- a/test/FixCode/fixits-apply.swift +++ /dev/null @@ -1,318 +0,0 @@ -// FIXME(integers): the test started to fail with the new integer protocols -// XFAIL: * - -// RUN: not %swift -typecheck -target %target-triple %s -emit-fixits-path %t.remap -I %S/Inputs -// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %s.result - -class Base {} -class Derived : Base {} - -var b : Base -b as Derived -b as Derived - -b as! Base - -var opti : Int? -// Add bang. -var i : Int = opti -// But remove unnecessary bang. -var i2 : Int = i! - -struct MyMask : OptionSet { - init(_ rawValue: UInt) {} - init(rawValue: UInt) {} - init(nilLiteral: ()) {} - - var rawValue: UInt { return 0 } - - static var allZeros: MyMask { return MyMask(0) } - static var Bingo: MyMask { return MyMask(1) } -} - -let _: MyMask = 0 - -func supported() -> MyMask { - return Int(MyMask.Bingo.rawValue) -} - -struct MyEventMask2 : OptionSet { - init(rawValue: UInt64) {} - var rawValue: UInt64 { return 0 } -} -func sendIt(_: MyEventMask2) {} -func sendItOpt(_: MyEventMask2?) {} -func sendItOpt3(_: MyEventMask2???) {} -func testMask1(a: Int) { - sendIt(a) -} -func testMask2(a: UInt64) { - sendIt(a) -} -func testMask3(a: MyEventMask2) { - testMask1(a: a) -} -func testMask4(a: MyEventMask2) { - testMask2(a: a) -} -func testMask5(a: Int) { - sendItOpt(a) -} -func testMask6(a: Int) { - sendItOpt(a) -} -func testMask7(a: Int?) { - sendItOpt(a) -} -func testMask8(a: UInt64?) { - sendItOpt(a) -} -func testMask9(a: Any) { - sendItOpt(a as? Int) -} -func testMask10(a: Int?) { - sendIt(a) // no fix, nullability mismatch. -} -func testMask11(a: MyEventMask2?) { - testMask7(a: a) -} -func testMask12(a: MyEventMask2?) { - testMask8(a: a) -} -func testMask13(a: MyEventMask2?) { - testMask1(a: a) // no fix, nullability mismatch. -} -func testMask14() { - sendIt(1) - sendItOpt(2) -} - -struct Wrapper { - typealias InnerMask = MyEventMask2 -} -func sendItInner(_: Wrapper.InnerMask) {} -func testInnerMask(a: UInt64) { - sendItInner(a) -} - -struct SomeName : RawRepresentable { - init(_ rawValue: String) {} - init(rawValue: String) {} - var rawValue: String { return "" } -} -func testPassSomeName(_: SomeName) {} -func testConvertSomeName(s: String) { - testPassSomeName("\(s)}") -} - -class WrappedClass {} -class WrappedClassSub: WrappedClass {} -struct ClassWrapper : RawRepresentable { - var rawValue: WrappedClass -} -func testPassAnyObject(_: AnyObject) {} -func testPassAnyObjectOpt(_: AnyObject?) {} -func testPassWrappedSub(_: WrappedClassSub) {} -func testConvertClassWrapper(_ x: ClassWrapper, _ sub: WrappedClassSub) { - testPassAnyObject(x) - testPassAnyObjectOpt(x) - testPassWrappedSub(x) - - let iuo: ClassWrapper! = x - testPassAnyObject(iuo) - testPassAnyObjectOpt(iuo) - - let _: ClassWrapper = sub - let _: ClassWrapper = x.rawValue - // FIXME: This one inserts 'as!', which is incorrect. - let _: ClassWrapper = sub as AnyObject -} - -enum MyEnumType : UInt32 { - case invalid -} -_ = MyEnumType(MyEnumType.invalid) - -func goo(var e : Error) { -} -func goo2(var e: Error) {} -func goo3(var e: Int) { e = 3 } -protocol A { - func bar(var s: Int) -} -extension A { - func bar(var s: Int) { - s += 5 - } -} - -func baz(var x: Int) { - x += 10 -} -func foo(let y: String, inout x: Int) { - -} - -struct Test1 : OptionSet { - init(rawValue: Int) {} - var rawValue: Int { return 0 } -} - -print("", false) - -func ftest1() { - // Don't replace the variable name with '_' - let myvar = 0 -} - -func ftest2(x x: @escaping Int -> Int) {} - -protocol SomeProt { - func protMeth(p: Int) -} -@objc protocol SomeObjCProt { - func objcprotMeth(p: Int) -} -class Test2 : SomeProt, SomeObjCProt { - func protMeth(_ p: Int) {} - - func instMeth(p: Int) {} - func instMeth2(p: Int, p2: Int) {} - func objcprotMeth(_ p: Int) {} -} -@objc class Test3 : SomeObjCProt { - func objcprotMeth(_ p: Int) {} -} -class SubTest2 : Test2 { - override func instMeth(_ p: Int) {} -} -Test2().instMeth(0) -Test2().instMeth2(0, p2:1) - -func recit(_: Int32) {} -func ftest3(_ fd: CInt) { - recit(UInt(fd)) -} -func ftest4(_ fd: UInt) { - recit(fd) -} - -func letToVar1() { - let x = 1 - if x == 2 { - x += 3 - } - let y = "" - y.append("as") - y.append("df") -} - -class Node {} -class Graph {} -var graph: Graph - -class Node2 {} -class Graph2 {} -var graph: Graph2 - -@objc protocol ObjCProt { } -class Graph3 {} -var graph: Graph3 - -class Graph4 {} -var graph: Graph4 -var graphAgain = Graph4() - -class GraphCombo {} -var graph: GraphCombo - -func evilCommas(s: String) { - _ = s[s.startIndex..<<#editorplaceholder#>] - _ = true ? s[s.startIndex..<<#editorplaceholder#>] : "" - _ = [s.startIndex..<<#editorplaceholder#>] -} - -import Empty -func testGenericSig(x: Empty) -> Empty {} - -class NonObjC {} -protocol NonObjCProtocol {} -@objc class IBIssues { - @IBOutlet static private var ibout1: IBIssues! - @IBOutlet private var ibout2: NonObjC! - @IBOutlet private var ibout3: NonObjCProtocol! - @IBOutlet private let ibout4: IBIssues! - @IBOutlet private var ibout5: [[IBIssues]]! - @IBOutlet private var ibout6: [String: String]! - @IBInspectable static private var ibinspect1: IBIssues! - @IBAction static func ibact() {} - @IBSegueAction static func ibsegact(_: String, _: IBIssues) -> IBIssues { return self } -} - -@IBDesignable extension SomeProt {} - -func attrNowOnType(foo: ()->()) {} - -class InitDynType { - init() {} - func notInit() { - self.init() - } -} - -class NoSemi { - enum Bar { case bar } - var foo: .Bar = .bar -} - -func fnWithClosure(c: @escaping ()->()) {} -func testescape(rec: ()->()) { - fnWithClosure { rec() } -} - -@warn_unused_result func testDeprecatedAttr() -> Int { return 0 } - -protocol Prot1 {} -protocol Prot2 { - associatedtype Ty = Prot1 -} -class Cls1 : Prot1 {} -func testwhere(_: T) {} - -enum E { - case abc -} -func testEnumRename() { _ = E.Abc } - -func testAnyToAnyObject(x: Any) { - x.instMeth(p: 1) -} - -func testProtocolCompositionSyntax() { - var _: protocol<> - var _: protocol - var _: protocol -} - -func disable_unnamed_param_reorder(p: Int, _: String) {} -disable_unnamed_param_reorder(0, "") // no change. - -prefix operator ***** {} - -class BoolFoo : BooleanType { - var boolValue: Bool {return false} -} -func testBoolValue(a : BoolFoo) { - if a { } - guard a {} - if a as BoolFoo {} -} - -protocol P1 {} -protocol P2 {} -var a : protocol? -var a2 : protocol= 17 - -class TestOptionalMethodFixit { - optional func test() {} -} diff --git a/test/FixCode/fixits-apply.swift.result b/test/FixCode/fixits-apply.swift.result deleted file mode 100644 index 5cb79ac3b70b3..0000000000000 --- a/test/FixCode/fixits-apply.swift.result +++ /dev/null @@ -1,318 +0,0 @@ -// RUN: not %swift -typecheck -target %target-triple %s -emit-fixits-path %t.remap -I %S/Inputs -// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %s.result - -class Base {} -class Derived : Base {} - -var b : Base -b as! Derived -b as! Derived - -b - -var opti : Int? -// Add bang. -var i : Int = opti! -// But remove unnecessary bang. -var i2 : Int = i - -struct MyMask : OptionSet { - init(_ rawValue: UInt) {} - init(rawValue: UInt) {} - init(nilLiteral: ()) {} - - var rawValue: UInt { return 0 } - - static var allZeros: MyMask { return MyMask(0) } - static var Bingo: MyMask { return MyMask(1) } -} - -let _: MyMask = [] - -func supported() -> MyMask { - return MyMask(rawValue: UInt(MyMask.Bingo)) -} - -struct MyEventMask2 : OptionSet { - init(rawValue: UInt64) {} - var rawValue: UInt64 { return 0 } -} -func sendIt(_: MyEventMask2) {} -func sendItOpt(_: MyEventMask2?) {} -func sendItOpt3(_: MyEventMask2???) {} -func testMask1(a: Int) { - sendIt(MyEventMask2(rawValue: UInt64(a))) -} -func testMask2(a: UInt64) { - sendIt(MyEventMask2(rawValue: a)) -} -func testMask3(a: MyEventMask2) { - testMask1(a: Int(a.rawValue)) -} -func testMask4(a: MyEventMask2) { - testMask2(a: a.rawValue) -} -func testMask5(a: Int) { - sendItOpt(MyEventMask2(rawValue: UInt64(a))) -} -func testMask6(a: Int) { - sendItOpt(MyEventMask2(rawValue: UInt64(a))) -} -func testMask7(a: Int?) { - sendItOpt(a.map { MyEventMask2(rawValue: UInt64($0)) }) -} -func testMask8(a: UInt64?) { - sendItOpt(a.map { MyEventMask2(rawValue: $0) }) -} -func testMask9(a: Any) { - sendItOpt((a as? Int).map { MyEventMask2(rawValue: UInt64($0)) }) -} -func testMask10(a: Int?) { - sendIt(a) // no fix, nullability mismatch. -} -func testMask11(a: MyEventMask2?) { - testMask7(a: a.map { Int($0.rawValue) }) -} -func testMask12(a: MyEventMask2?) { - testMask8(a: a.map { $0.rawValue }) -} -func testMask13(a: MyEventMask2?) { - testMask1(a: a) // no fix, nullability mismatch. -} -func testMask14() { - sendIt(MyEventMask2(rawValue: 1)) - sendItOpt(MyEventMask2(rawValue: 2)) -} - -struct Wrapper { - typealias InnerMask = MyEventMask2 -} -func sendItInner(_: Wrapper.InnerMask) {} -func testInnerMask(a: UInt64) { - sendItInner(Wrapper.InnerMask(rawValue: a)) -} - -struct SomeName : RawRepresentable { - init(_ rawValue: String) {} - init(rawValue: String) {} - var rawValue: String { return "" } -} -func testPassSomeName(_: SomeName) {} -func testConvertSomeName(s: String) { - testPassSomeName(SomeName(rawValue: "\(s)}")) -} - -class WrappedClass {} -class WrappedClassSub: WrappedClass {} -struct ClassWrapper : RawRepresentable { - var rawValue: WrappedClass -} -func testPassAnyObject(_: AnyObject) {} -func testPassAnyObjectOpt(_: AnyObject?) {} -func testPassWrappedSub(_: WrappedClassSub) {} -func testConvertClassWrapper(_ x: ClassWrapper, _ sub: WrappedClassSub) { - testPassAnyObject(x.rawValue) - testPassAnyObjectOpt(x.rawValue) - testPassWrappedSub(x) - - let iuo: ClassWrapper! = x - testPassAnyObject(iuo) - testPassAnyObjectOpt(iuo.map { $0.rawValue }) - - let _: ClassWrapper = ClassWrapper(rawValue: sub) - let _: ClassWrapper = ClassWrapper(rawValue: x.rawValue) - // FIXME: This one inserts 'as!', which is incorrect. - let _: ClassWrapper = sub as AnyObject as! ClassWrapper -} - -enum MyEnumType : UInt32 { - case invalid -} -_ = MyEnumType.invalid - -func goo(e : Error) { - var e = e -} -func goo2(e: Error) { var e = e } -func goo3(e: Int) { var e = e; e = 3 } -protocol A { - func bar(s: Int) -} -extension A { - func bar(s: Int) { - var s = s - s += 5 - } -} - -func baz(x: Int) { - var x = x - x += 10 -} -func foo(y: String, x: inout Int) { - -} - -struct Test1 : OptionSet { - init(rawValue: Int) {} - var rawValue: Int { return 0 } -} - -print("", false) - -func ftest1() { - // Don't replace the variable name with '_' - let myvar = 0 -} - -func ftest2(x: @escaping (Int) -> Int) {} - -protocol SomeProt { - func protMeth(p: Int) -} -@objc protocol SomeObjCProt { - func objcprotMeth(p: Int) -} -class Test2 : SomeProt, SomeObjCProt { - func protMeth(_ p: Int) {} - - func instMeth(p: Int) {} - func instMeth2(p: Int, p2: Int) {} - func objcprotMeth(_ p: Int) {} -} -@objc class Test3 : SomeObjCProt { - func objcprotMeth(_ p: Int) {} -} -class SubTest2 : Test2 { - override func instMeth(_ p: Int) {} -} -Test2().instMeth(0) -Test2().instMeth2(0, p2:1) - -func recit(_: Int32) {} -func ftest3(_ fd: CInt) { - recit(fd) -} -func ftest4(_ fd: UInt) { - recit(Int32(fd)) -} - -func letToVar1() { - var x = 1 - if x == 2 { - x += 3 - } - var y = "" - y.append("as") - y.append("df") -} - -class Node {} -class Graph {} -var graph: Graph - -class Node2 {} -class Graph2 {} -var graph: Graph2 - -@objc protocol ObjCProt { } -class Graph3 {} -var graph: Graph3 - -class Graph4 {} -var graph: Graph4<<#NodeType: SomeProt#>> -var graphAgain = Graph4<<#NodeType: SomeProt#>>() - -class GraphCombo {} -var graph: GraphCombo<<#NodeType: ObjCProt & SomeProt#>> - -func evilCommas(s: String) { - _ = s[s.startIndex..<<#editorplaceholder#>] - _ = true ? s[s.startIndex..<<#editorplaceholder#>] : "" - _ = [s.startIndex..<<#editorplaceholder#>] -} - -import Empty -func testGenericSig(x: Empty) -> Empty {} - -class NonObjC {} -protocol NonObjCProtocol {} -@objc class IBIssues { - @IBOutlet static private var ibout1: IBIssues! - @IBOutlet private var ibout2: NonObjC! - @IBOutlet private var ibout3: NonObjCProtocol! - @IBOutlet private let ibout4: IBIssues! - @IBOutlet private var ibout5: [[IBIssues]]! - @IBOutlet private var ibout6: [String: String]! - @IBInspectable static private var ibinspect1: IBIssues! - @IBAction static func ibact() {} - @IBSegueAction static func ibsegact(_: String, _: IBIssues) -> IBIssues { return self } -} - -@IBDesignable extension SomeProt {} - -func attrNowOnType(foo: ()->()) {} - -class InitDynType { - init() {} - func notInit() { - self.init() - } -} - -class NoSemi { - enum Bar { case bar } - var foo: .Bar = .bar -} - -func fnWithClosure(c: @escaping ()->()) {} -func testescape(rec: @escaping ()->()) { - fnWithClosure { rec() } -} - -func testDeprecatedAttr() -> Int { return 0 } - -protocol Prot1 {} -protocol Prot2 { - associatedtype Ty = Prot1 -} -class Cls1 : Prot1 {} -func testwhere(_: T) where T.Ty == Cls1 {} - -enum E { - case abc -} -func testEnumRename() { _ = E.Abc } - -func testAnyToAnyObject(x: Any) { - (x as AnyObject).instMeth(p: 1) -} - -func testProtocolCompositionSyntax() { - var _: Any - var _: Prot1 - var _: Prot1 & Prot2 -} - -func disable_unnamed_param_reorder(p: Int, _: String) {} -disable_unnamed_param_reorder(0, "") // no change. - -prefix operator ***** - -class BoolFoo : Bool { - var boolValue: Bool {return false} -} -func testBoolValue(a : BoolFoo) { - if a.boolValue { } - guard a.boolValue {} - if (a as BoolFoo).boolValue {} -} - -protocol P1 {} -protocol P2 {} -var a : (P1 & P2)? -var a2 : P1= 17 as! P1 - -class TestOptionalMethodFixit { - func test() {} -} diff --git a/test/FixCode/fixits-if-else.swift b/test/FixCode/fixits-if-else.swift deleted file mode 100644 index 1121fbbdfed3f..0000000000000 --- a/test/FixCode/fixits-if-else.swift +++ /dev/null @@ -1,34 +0,0 @@ -// RUN: not %swift -emit-sil -target %target-triple %s -emit-fixits-path %t.remap -I %S/Inputs -// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %s.result - -func something() -> Bool { return true } - -func foo1() { - if something() { - } else -} - -func foo2() { - if something() { - } else - foo1() -} - -func foo3() { - if something() { - } else something() { // all on one line, 'if' inserted - } -} - -func foo4() { - if something() { - } else something() - { - } -} - -func foo5() { - if something() { - } else something() - foo1() -} diff --git a/test/FixCode/fixits-if-else.swift.result b/test/FixCode/fixits-if-else.swift.result deleted file mode 100644 index 4b9bb9475cce0..0000000000000 --- a/test/FixCode/fixits-if-else.swift.result +++ /dev/null @@ -1,34 +0,0 @@ -// RUN: not %swift -emit-sil -target %target-triple %s -emit-fixits-path %t.remap -I %S/Inputs -// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %s.result - -func something() -> Bool { return true } - -func foo1() { - if something() { - } else -} - -func foo2() { - if something() { - } else - foo1() -} - -func foo3() { - if something() { - } else if something() { // all on one line, 'if' inserted - } -} - -func foo4() { - if something() { - } else something() - { - } -} - -func foo5() { - if something() { - } else something() - foo1() -} diff --git a/test/Macros/macro_fixits.swift b/test/Macros/macro_fixits.swift index 66d5f6de82552..13d27e26b6e22 100644 --- a/test/Macros/macro_fixits.swift +++ b/test/Macros/macro_fixits.swift @@ -7,12 +7,7 @@ // RUN: %host-build-swift -emit-library %S/Inputs/syntax_macro_definitions.swift -o %t/%target-library-name(MacroDefinition) -module-name MacroDefinition -swift-version 5 -g -no-toolchain-stdlib-rpath -// RUN: %target-swift-frontend -typecheck %s -load-plugin-library %t/%target-library-name(MacroDefinition) -swift-version 5 -serialize-diagnostics-path %t/diags.dia -fixit-all -emit-fixits-path %t/fixits.json - -// RUN: %FileCheck %s --check-prefix FIXITS-JSON < %t/fixits.json - -// FIXITS-JSON: [ -// FIXITS-JSON-NEXT: ] +// RUN: %target-swift-frontend -typecheck %s -load-plugin-library %t/%target-library-name(MacroDefinition) -swift-version 5 -serialize-diagnostics-path %t/diags.dia // RUN: c-index-test -read-diagnostics %t/diags.dia 2>&1 | %FileCheck -check-prefix DIAGS %s diff --git a/test/Sema/generic_specialization.swift b/test/Sema/generic_specialization.swift index f62873aca5193..6979d3d3c9f20 100644 --- a/test/Sema/generic_specialization.swift +++ b/test/Sema/generic_specialization.swift @@ -71,3 +71,8 @@ do { // expected-swift5-warning@-1 {{cannot explicitly specialize initializer 'init(_:)'}} // expected-swift6-error@-2 {{cannot explicitly specialize initializer 'init(_:)'}} } + +do { + // expected-error@+1:13 {{cannot specialize non-generic type 'module'}}{{none}} + func f(_: Swift) {} +} diff --git a/test/Sema/immutability.swift b/test/Sema/immutability.swift index e1125efb7dd93..bd01cb8889dc6 100644 --- a/test/Sema/immutability.swift +++ b/test/Sema/immutability.swift @@ -45,7 +45,13 @@ func passClosure() { } } - +// FIXME: No 'var x = x' fix-it. +do { + func f(x: Int) { + x = 3 // expected-error@:5 {{cannot assign to value: 'x' is a 'let' constant}}{{none}} + x += 3 // expected-error@:7 {{left side of mutating operator isn't mutable: 'x' is a 'let' constant}}{{none}} + } +} class FooClass { class let type_let = 5 // expected-error {{class stored properties not supported in classes}} diff --git a/test/attr/attr_extern_fixit.swift b/test/attr/attr_extern_fixit.swift index 001535986f6d7..8770bea429949 100644 --- a/test/attr/attr_extern_fixit.swift +++ b/test/attr/attr_extern_fixit.swift @@ -1,7 +1,6 @@ -// RUN: %target-typecheck-verify-swift -enable-experimental-feature Extern -emit-fixits-path %t.remap -fixit-all -// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %s.result +// RUN: %target-typecheck-verify-swift -enable-experimental-feature Extern // REQUIRES: swift_feature_Extern -@_extern(c) // expected-warning {{C name '+' may be invalid; explicitly specify the name in '@_extern(c)' to suppress this warning}} +@_extern(c) // expected-warning {{C name '+' may be invalid; explicitly specify the name in '@_extern(c)' to suppress this warning}}{{11-11=, "+"}}{{none}} func +(a: Int, b: Bool) -> Bool diff --git a/test/attr/attr_extern_fixit.swift.result b/test/attr/attr_extern_fixit.swift.result deleted file mode 100644 index 1572fc2d405cc..0000000000000 --- a/test/attr/attr_extern_fixit.swift.result +++ /dev/null @@ -1,7 +0,0 @@ -// RUN: %target-typecheck-verify-swift -enable-experimental-feature Extern -emit-fixits-path %t.remap -fixit-all -// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %s.result - -// REQUIRES: swift_feature_Extern - -@_extern(c, "+") // expected-warning {{C name '+' may be invalid; explicitly specify the name in '@_extern(c)' to suppress this warning}} -func +(a: Int, b: Bool) -> Bool diff --git a/test/diagnostics/verifier.swift b/test/diagnostics/verifier.swift index c281838af54e4..5ad6784a6a8dd 100644 --- a/test/diagnostics/verifier.swift +++ b/test/diagnostics/verifier.swift @@ -1,8 +1,7 @@ // RUN: %empty-directory(%t) -// RUN: not %target-swift-frontend -typecheck -verify -serialize-diagnostics-path %t/serialized.dia -emit-fixits-path %t/fixits %s 2>&1 | %FileCheck %s +// RUN: not %target-swift-frontend -typecheck -verify -serialize-diagnostics-path %t/serialized.dia %s 2>&1 | %FileCheck %s // RUN: not %target-swift-frontend -typecheck -verify -warnings-as-errors %s 2>&1 | %FileCheck %s -check-prefix CHECK-WARNINGS-AS-ERRORS // RUN: %FileCheck %s -check-prefix CHECK-SERIALIZED <%t/serialized.dia -// RUN: %FileCheck %s -check-prefix CHECK-FIXITS <%t/fixits // Wrong message let x: Int = "hello, world!" // expected-error {{foo bar baz}} @@ -45,10 +44,3 @@ extension Crap {} // expected-error {{non-nominal type 'Crap' (aka '() -> ()') c // Verify the serialized diags have the right magic at the top. // CHECK-SERIALIZED: DIA - -// Ensure the verifier doesn't interfere with -emit-fixits-path. -// CHECK-FIXITS: { -// CHECK-FIXITS: "file": -// CHECK-FIXITS: "offset": -// CHECK-FIXITS: "text": " as! Int" -// CHECK-FIXITS: } diff --git a/test/expr/conversions/RawRepresentable_fixits.swift b/test/expr/conversions/RawRepresentable_fixits.swift new file mode 100644 index 0000000000000..84ff6fd566bb5 --- /dev/null +++ b/test/expr/conversions/RawRepresentable_fixits.swift @@ -0,0 +1,221 @@ +// RUN: %target-typecheck-verify-swift + +do { + struct Mask : OptionSet { + init(_ rawValue: UInt) {} + init(rawValue: UInt) {} + + var rawValue: UInt { 0 } + + static var Bingo: Mask { Mask(1) } + } + + // FIXME: No fix-it. Could be '= Mask(rawValue: 0)' or '= []'. + let _: Mask = 0 + // expected-error@-1:17 {{cannot convert value of type 'Int' to specified type 'Mask'}}{{none}} +} + +do { + enum E: Int { + case a + } + + // TODO: A better fix-it is to remove the init call. + _ = E(E.a) + // expected-error@-1:9 {{missing argument label 'rawValue:' in call}}{{9-9=rawValue: }} + // expected-error@-2:11 {{cannot convert value of type 'E' to expected argument type 'Int'}}{{12-12=.rawValue}} +} + +// Fix-its for expectation of implicit RawRepresentable <-> RawValue cast. +do { + struct Mask : OptionSet { + init(rawValue: UInt64) {} + var rawValue: UInt64 { return 0 } + } + + // RawValue -> RawRepresentable / OptionSet. + do { + struct Mask : OptionSet { + init(rawValue: UInt64) {} + var rawValue: UInt64 { return 0 } + } + + func takeMask(_: Mask) {} + func takeMask_o(_: Mask?) {} + + let int: Int + let int_o: Int? + let uint64: UInt64 + let uint64_o: UInt64? + + // FIXME: No fix-it. Could be 'Mask(rawValue: 1)'. + let _: Mask = 1 + // expected-error@-1:19 {{cannot convert value of type 'Int' to specified type 'Mask'}}{{none}} + takeMask(1) + // expected-error@-1:14 {{cannot convert value of type 'Int' to expected argument type 'Mask'}}{{none}} + + // FIXME: No fix-it. Could be 'Mask(rawValue: UInt64(int))'. + let _: Mask = int + // expected-error@-1:19 {{cannot convert value of type 'Int' to specified type 'Mask'}}{{none}} + takeMask(int) + // expected-error@-1:14 {{cannot convert value of type 'Int' to expected argument type 'Mask'}}{{none}} + + let _: Mask = uint64 + // expected-error@-1:19 {{cannot convert value of type 'UInt64' to specified type 'Mask'}}{{19-19=Mask(rawValue: }}{{25-25=) ?? <#default value#>}} + takeMask(uint64) + // expected-error@-1:14 {{cannot convert value of type 'UInt64' to expected argument type 'Mask'}}{{14-14=Mask(rawValue: }}{{20-20=) ?? <#default value#>}} + + // FIXME: No fix-it. Could be 'Mask(rawValue: UInt64(int_o ?? <#default value#>)'. + let _: Mask = int_o + // expected-error@-1:19 {{cannot convert value of type 'Int?' to specified type 'Mask'}}{{none}} + takeMask(int_o) + // expected-error@-1:14 {{cannot convert value of type 'Int?' to expected argument type 'Mask'}}{{none}} + + // FIXME: No fix-it. Could be 'Mask(rawValue: 1)'. + let _: Mask? = 1 + // expected-error@-1:20 {{cannot convert value of type 'Int' to specified type 'Mask'}}{{none}} + takeMask_o(1) + // expected-error@-1:16 {{cannot convert value of type 'Int' to expected argument type 'Mask'}}{{none}} + + // FIXME: No fix-it. Could be 'Mask(rawValue: UInt64(int))'. + let _: Mask? = int + // expected-error@-1:20 {{cannot convert value of type 'Int' to specified type 'Mask'}}{{none}} + takeMask_o(int) + // expected-error@-1:16 {{cannot convert value of type 'Int' to expected argument type 'Mask'}}{{none}} + + // FIXME: No fix-it. Could be 'int_o.map { Mask(rawValue: UInt64($0)) }'. + let _: Mask? = int_o + // expected-error@-1:20 {{cannot convert value of type 'Int?' to specified type 'Mask?'}}{{none}} + takeMask_o(int_o) + // expected-error@-1:16 {{cannot convert value of type 'Int?' to expected argument type 'Mask?'}}{{none}} + + // FIXME: No fix-it. Could be 'uint64_o.map(Mask(rawValue:))' or 'uint64_o.map { Mask(rawValue: $0) }'. + let _: Mask? = uint64_o + // expected-error@-1:20 {{cannot convert value of type 'UInt64?' to specified type 'Mask?'}}{{none}} + takeMask_o(uint64_o) + // expected-error@-1:16 {{cannot convert value of type 'UInt64?' to expected argument type 'Mask?'}}{{none}} + + // FIXME: No fix-it. Could be '(anything as? Int).map { Mask(rawValue: UInt64($0)) }'. + let anything: Any + let _: Mask? = anything as? Int + // expected-error@-1:29 {{cannot convert value of type 'Int?' to specified type 'Mask?'}}{{none}} + takeMask_o(anything as? Int) + // expected-error@-1:25 {{cannot convert value of type 'Int?' to expected argument type 'Mask?'}}{{none}} + } + + // Try a nested OptionSet. + do { + struct Shell { + struct Mask : OptionSet { + init(rawValue: UInt64) {} + var rawValue: UInt64 { return 0 } + } + } + + // FIXME: This is an OptionSet, coelescing in the fix-it is not necessary. + let _: Shell.Mask = UInt64(0) + // expected-error@-1:25 {{cannot convert value of type 'UInt64' to specified type 'Shell.Mask'}}{{25-25=Shell.Mask(rawValue: }}{{34-34=) ?? <#default value#>}} + } + + // Try a non-integral RawValue. + do { + struct Mask : RawRepresentable { + init(rawValue: String) {} + var rawValue: String { return "" } + } + + let s: String + let _: Mask = "\(s)}" + // expected-error@-1:19 {{cannot convert value of type 'String' to specified type 'Mask'}}{{19-19=Mask(rawValue: }}{{26-26=) ?? <#default value#>}} + } + + // RawRepresentable / OptionSet -> RawValue. + do { + struct Mask : OptionSet { + init(rawValue: UInt64) {} + var rawValue: UInt64 { return 0 } + } + + func takeInt(_: Int) {} + func takeInt_o(_: Int?) {} + func takeUInt64(_: UInt64) {} + func takeUInt64_o(_: UInt64?) {} + + let mask: Mask + let mask_o: Mask? + + // FIXME: No fix-it. Could be 'Int(mask.rawValue)'. + let _: Int = mask + // expected-error@-1:18 {{cannot convert value of type 'Mask' to specified type 'Int'}}{{none}} + takeInt(mask) + // expected-error@-1:13 {{cannot convert value of type 'Mask' to expected argument type 'Int'}}{{none}} + + let _: UInt64 = mask + // expected-error@-1:21 {{cannot convert value of type 'Mask' to specified type 'UInt64'}}{{25-25=.rawValue}} + takeUInt64(mask) + // expected-error@-1:16 {{cannot convert value of type 'Mask' to expected argument type 'UInt64'}}{{20-20=.rawValue}} + + let _: UInt64 = mask_o + // expected-error@-1:21 {{cannot convert value of type 'Mask?' to specified type 'UInt64'}}{{27-27=?.rawValue ?? <#default value#>}} + takeUInt64(mask_o) + // expected-error@-1:16 {{cannot convert value of type 'Mask?' to expected argument type 'UInt64'}}{{22-22=?.rawValue ?? <#default value#>}} + + // FIXME: No fix-it. Could be 'mask_o.map { Int($0.rawValue) }'. + let _: Int? = mask_o + // expected-error@-1:19 {{cannot convert value of type 'Mask?' to specified type 'Int?'}}{{none}} + takeInt_o(mask_o) + // expected-error@-1:15 {{cannot convert value of type 'Mask?' to expected argument type 'Int?'}}{{none}} + + // FIXME: No fix-it. Could be 'mask_o?.rawValue' or 'mask_o.map { $0.rawValue }'. + let _: UInt64? = mask_o + // expected-error@-1:22 {{cannot convert value of type 'Mask?' to specified type 'UInt64?'}}{{28-28=?.rawValue}} + takeUInt64_o(mask_o) + // expected-error@-1:18 {{cannot convert value of type 'Mask?' to expected argument type 'UInt64?'}}{{none}} + } +} + +do { + class Class {} + class SubClass: Class {} + struct ClassWrapper : RawRepresentable { + var rawValue: Class + } + + func takeAnyObject(_: AnyObject) {} + func takeAnyObjectOpt(_: AnyObject?) {} + func takeSubClass(_: SubClass) {} + + do { + let classWrapper: ClassWrapper + let subClass: SubClass + + takeAnyObject(classWrapper) + // expected-error@-1:19 {{argument type 'ClassWrapper' expected to be an instance of a class or class-constrained type}}{{none}} + takeAnyObjectOpt(classWrapper) + // expected-error@-1:22 {{argument type 'ClassWrapper' expected to be an instance of a class or class-constrained type}}{{none}} + + // FIXME: Bad fix-it, will not compile + takeSubClass(classWrapper) + // expected-error@-1:18 {{cannot convert value of type 'ClassWrapper' to expected argument type 'SubClass'}}{{30-30=.rawValue}} + + let iuo: ClassWrapper! + takeAnyObject(iuo) + // expected-error@-1:19 {{argument type 'ClassWrapper?' expected to be an instance of a class or class-constrained type}}{{none}} + takeAnyObjectOpt(iuo) + // expected-error@-1:22 {{argument type 'ClassWrapper' expected to be an instance of a class or class-constrained type}}{{none}} + + let _: ClassWrapper = subClass + // expected-error@-1:27 {{cannot convert value of type 'SubClass' to specified type 'ClassWrapper'}}{{27-27=ClassWrapper(rawValue: }} {{35-35=) ?? <#default value#>}} + let _: ClassWrapper = classWrapper.rawValue + // expected-error@-1:40 {{cannot convert value of type 'Class' to specified type 'ClassWrapper'}}{{27-27=ClassWrapper(rawValue: }} {{48-48=) ?? <#default value#>}} + + // FIXME: This note replaces 'as' with 'as!', which is incorrect. + // expected-note@+3:36 {{did you mean to use 'as!' to force downcast?}}{{36-38=as!}} + // FIXME: Bad fix-it, will not compile + // expected-error@+1:36 {{cannot convert value of type 'AnyObject' to specified type 'ClassWrapper'}}{{27-27=ClassWrapper(rawValue: }} {{48-48=) ?? <#default value#>}} + let _: ClassWrapper = subClass as AnyObject + // expected-error@-1:36 {{'AnyObject' is not convertible to 'Class'}}{{none}} + } +} + + diff --git a/test/expr/primary/literal/int.swift b/test/expr/primary/literal/int.swift new file mode 100644 index 0000000000000..711d7c9dbea13 --- /dev/null +++ b/test/expr/primary/literal/int.swift @@ -0,0 +1,18 @@ +// RUN: %target-typecheck-verify-swift + +do { + func takeInt32(_: Int32) {} + + func f1(_ cint: CInt) { + takeInt32(UInt(cint)) + // expected-error@-1:15 {{cannot convert value of type 'UInt' to expected argument type 'Int32'}}{{15-15=Int32(}}{{25-25=)}} + } + func f2(_ uint: UInt) { + takeInt32(uint) + // expected-error@-1:15 {{cannot convert value of type 'UInt' to expected argument type 'Int32'}}{{15-15=Int32(}}{{19-19=)}} + + let int32: Int32 = uint + // expected-error@-1:24 {{cannot convert value of type 'UInt' to specified type 'Int32'}}{{24-24=Int32(}}{{28-28=)}} + } +} + diff --git a/test/expr/primary/selector/fixits.swift b/test/expr/primary/selector/fixits.swift index 6608e39fdf123..3ba21c9f0a0cc 100644 --- a/test/expr/primary/selector/fixits.swift +++ b/test/expr/primary/selector/fixits.swift @@ -14,22 +14,6 @@ // Make sure we get the right diagnostics. // RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t.overlays) -typecheck %s -verify -// Copy the source, apply the Fix-Its, and compile it again, making -// sure that we've cleaned up all of the deprecation warnings. -// RUN: %empty-directory(%t.sources) -// RUN: %empty-directory(%t.remapping) -// RUN: cp %s %t.sources/fixits.swift -// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t.overlays) -typecheck %t.sources/fixits.swift -fixit-all -emit-fixits-path %t.remapping/fixits.remap -// RUN: %{python} %utils/apply-fixit-edits.py %t.remapping -// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t.overlays) -typecheck %t.sources/fixits.swift -diagnostic-style llvm 2> %t.result - -// RUN: %FileCheck %s < %t.result -// RUN: grep -c "warning:" %t.result | grep 3 - -// CHECK: warning: no method declared with Objective-C selector 'unknownMethodWithValue:label:' -// CHECK: warning: string literal is not a valid Objective-C selector -// CHECK: warning: string literal is not a valid Objective-C selector - import Foundation import Helper @@ -83,3 +67,129 @@ func testSelectorConstruction() { // Note: from Foundation _ = Selector("initWithArray:") // expected-warning{{use '#selector' instead of explicitly constructing a 'Selector'}}{{7-33=#selector(NSSet.init(array:))}} } + +@objc class Selectors: NSObject { + func takeSel(_: Selector) {} + @objc func mySel() {} + func test() { + takeSel("mySel") + // expected-warning@-1 {{use of string literal for Objective-C selectors is deprecated; use '#selector' instead}}{{13-20=#selector(self.mySel)}} + takeSel(Selector("mySel")) + // expected-warning@-1 {{use '#selector' instead of explicitly constructing a 'Selector'}}{{13-30=#selector(self.mySel)}} + } +} + +@objc class OtherClass: NSObject { + func test(s: Selectors) { + s.takeSel("mySel") + // expected-warning@-1 {{use of string literal for Objective-C selectors is deprecated; use '#selector' instead}}{{15-22=#selector(Selectors.mySel)}} + s.takeSel(Selector("mySel")) + // expected-warning@-1 {{use '#selector' instead of explicitly constructing a 'Selector'}}{{15-32=#selector(Selectors.mySel)}} + } +} + +@objc class Base: NSObject { + @objc func baseSel() {} +} + +@objc class Outer: NSObject { + func takeSel(_: Selector) {} + @objc func outerSel() {} + + @objc class Inner: Base { + func takeSel(_: Selector) {} + + @objc func innerSel() {} + + func test(s: Selectors, o: Outer) { + s.takeSel("mySel") + // expected-warning@-1 {{use of string literal for Objective-C selectors is deprecated; use '#selector' instead}}{{17-24=#selector(Selectors.mySel)}} + s.takeSel(Selector("mySel")) + // expected-warning@-1 {{use '#selector' instead of explicitly constructing a 'Selector'}}{{17-34=#selector(Selectors.mySel)}} + + takeSel("innerSel") + // expected-warning@-1 {{use of string literal for Objective-C selectors is deprecated; use '#selector' instead}}{{15-25=#selector(self.innerSel)}} + takeSel(Selector("innerSel")) + // expected-warning@-1 {{use '#selector' instead of explicitly constructing a 'Selector'}}{{15-35=#selector(self.innerSel)}} + + takeSel("baseSel") + // expected-warning@-1 {{use of string literal for Objective-C selectors is deprecated; use '#selector' instead}}{{15-24=#selector(self.baseSel)}} + takeSel(Selector("baseSel")) + // expected-warning@-1 {{use '#selector' instead of explicitly constructing a 'Selector'}}{{15-34=#selector(self.baseSel)}} + + o.takeSel("outerSel") + // expected-warning@-1 {{use of string literal for Objective-C selectors is deprecated; use '#selector' instead}}{{17-27=#selector(Outer.outerSel)}} + o.takeSel(Selector("outerSel")) + // expected-warning@-1 {{use '#selector' instead of explicitly constructing a 'Selector'}}{{17-37=#selector(Outer.outerSel)}} + } + } + + func test(s: Selectors, i: Inner) { + s.takeSel("mySel") + // expected-warning@-1 {{use of string literal for Objective-C selectors is deprecated; use '#selector' instead}}{{15-22=#selector(Selectors.mySel)}} + s.takeSel(Selector("mySel")) + // expected-warning@-1 {{use '#selector' instead of explicitly constructing a 'Selector'}}{{15-32=#selector(Selectors.mySel)}} + + i.takeSel("innerSel") + // expected-warning@-1 {{use of string literal for Objective-C selectors is deprecated; use '#selector' instead}}{{15-25=#selector(Inner.innerSel)}} + i.takeSel(Selector("innerSel")) + // expected-warning@-1 {{use '#selector' instead of explicitly constructing a 'Selector'}}{{15-35=#selector(Inner.innerSel)}} + + i.takeSel("baseSel") + // expected-warning@-1 {{use of string literal for Objective-C selectors is deprecated; use '#selector' instead}}{{15-24=#selector(Base.baseSel)}} + i.takeSel(Selector("baseSel")) + // expected-warning@-1 {{use '#selector' instead of explicitly constructing a 'Selector'}}{{15-34=#selector(Base.baseSel)}} + + takeSel("outerSel") + // expected-warning@-1 {{use of string literal for Objective-C selectors is deprecated; use '#selector' instead}}{{13-23=#selector(self.outerSel)}} + takeSel(Selector("outerSel")) + // expected-warning@-1 {{use '#selector' instead of explicitly constructing a 'Selector'}}{{13-33=#selector(self.outerSel)}} + } +} + +extension Outer { + func test2(s: Selectors, i: Inner) { + s.takeSel("mySel") + // expected-warning@-1 {{use of string literal for Objective-C selectors is deprecated; use '#selector' instead}}{{15-22=#selector(Selectors.mySel)}} + s.takeSel(Selector("mySel")) + // expected-warning@-1 {{use '#selector' instead of explicitly constructing a 'Selector'}}{{15-32=#selector(Selectors.mySel)}} + + i.takeSel("innerSel") + // expected-warning@-1 {{use of string literal for Objective-C selectors is deprecated; use '#selector' instead}}{{15-25=#selector(Inner.innerSel)}} + i.takeSel(Selector("innerSel")) + // expected-warning@-1 {{use '#selector' instead of explicitly constructing a 'Selector'}}{{15-35=#selector(Inner.innerSel)}} + + i.takeSel("baseSel") + // expected-warning@-1 {{use of string literal for Objective-C selectors is deprecated; use '#selector' instead}}{{15-24=#selector(Base.baseSel)}} + i.takeSel(Selector("baseSel")) + // expected-warning@-1 {{use '#selector' instead of explicitly constructing a 'Selector'}}{{15-34=#selector(Base.baseSel)}} + + takeSel("outerSel") + // expected-warning@-1 {{use of string literal for Objective-C selectors is deprecated; use '#selector' instead}}{{13-23=#selector(self.outerSel)}} + takeSel(Selector("outerSel")) + // expected-warning@-1 {{use '#selector' instead of explicitly constructing a 'Selector'}}{{13-33=#selector(self.outerSel)}} + } +} + +func freeTest(s: Selectors, o: Outer, i: Outer.Inner) { + s.takeSel("mySel") + // expected-warning@-1 {{use of string literal for Objective-C selectors is deprecated; use '#selector' instead}}{{13-20=#selector(Selectors.mySel)}} + s.takeSel(Selector("mySel")) + // expected-warning@-1 {{use '#selector' instead of explicitly constructing a 'Selector'}}{{13-30=#selector(Selectors.mySel)}} + + // FIXME: Fix-it should be 'Outer.Inner.innerSel'. + i.takeSel("innerSel") + // expected-warning@-1 {{use of string literal for Objective-C selectors is deprecated; use '#selector' instead}}{{13-23=#selector(Inner.innerSel)}} + i.takeSel(Selector("innerSel")) + // expected-warning@-1 {{use '#selector' instead of explicitly constructing a 'Selector'}}{{13-33=#selector(Inner.innerSel)}} + + i.takeSel("baseSel") + // expected-warning@-1 {{use of string literal for Objective-C selectors is deprecated; use '#selector' instead}}{{13-22=#selector(Base.baseSel)}} + i.takeSel(Selector("baseSel")) + // expected-warning@-1 {{use '#selector' instead of explicitly constructing a 'Selector'}}{{13-32=#selector(Base.baseSel)}} + + o.takeSel("outerSel") + // expected-warning@-1 {{use of string literal for Objective-C selectors is deprecated; use '#selector' instead}}{{13-23=#selector(Outer.outerSel)}} + o.takeSel(Selector("outerSel")) + // expected-warning@-1 {{use '#selector' instead of explicitly constructing a 'Selector'}}{{13-33=#selector(Outer.outerSel)}} +} From b0b0cff3179c1296446840e1b62e6969dc2b5ed1 Mon Sep 17 00:00:00 2001 From: Anthony Latsis Date: Tue, 18 Mar 2025 05:24:37 +0000 Subject: [PATCH 51/51] [NFC][test] Move scattered `DiagnosticVerifier` tests into subdirectory --- .../{ => DiagnosticVerifier}/Inputs/broken-c-module/broken_c.h | 0 .../Inputs/broken-c-module/module.modulemap | 0 .../broken-c-module.swift} | 0 .../{verify-fixits.swift => DiagnosticVerifier/fixits.swift} | 0 .../multiple_prefix_invalid.swift} | 0 .../multiple_prefix_negative.swift} | 0 .../multiple_prefix_positive.swift} | 0 .../DiagnosticVerifier/verify-apply-fixes.swift} | 0 .../DiagnosticVerifier/verify-apply-fixes.swift.result} | 0 test/Frontend/{ => DiagnosticVerifier}/verify.swift | 0 .../verifier.swift => Frontend/DiagnosticVerifier/verify2.swift} | 0 11 files changed, 0 insertions(+), 0 deletions(-) rename test/Frontend/{ => DiagnosticVerifier}/Inputs/broken-c-module/broken_c.h (100%) rename test/Frontend/{ => DiagnosticVerifier}/Inputs/broken-c-module/module.modulemap (100%) rename test/Frontend/{verify-broken-c-module.swift => DiagnosticVerifier/broken-c-module.swift} (100%) rename test/Frontend/{verify-fixits.swift => DiagnosticVerifier/fixits.swift} (100%) rename test/Frontend/{diagnostic_verifier_multiple_prefix_invalid.swift => DiagnosticVerifier/multiple_prefix_invalid.swift} (100%) rename test/Frontend/{diagnostic_verifier_multiple_prefix_negative.swift => DiagnosticVerifier/multiple_prefix_negative.swift} (100%) rename test/Frontend/{diagnostic_verifier_multiple_prefix_positive.swift => DiagnosticVerifier/multiple_prefix_positive.swift} (100%) rename test/{FixCode/verify-fixits.swift => Frontend/DiagnosticVerifier/verify-apply-fixes.swift} (100%) rename test/{FixCode/verify-fixits.swift.result => Frontend/DiagnosticVerifier/verify-apply-fixes.swift.result} (100%) rename test/Frontend/{ => DiagnosticVerifier}/verify.swift (100%) rename test/{diagnostics/verifier.swift => Frontend/DiagnosticVerifier/verify2.swift} (100%) diff --git a/test/Frontend/Inputs/broken-c-module/broken_c.h b/test/Frontend/DiagnosticVerifier/Inputs/broken-c-module/broken_c.h similarity index 100% rename from test/Frontend/Inputs/broken-c-module/broken_c.h rename to test/Frontend/DiagnosticVerifier/Inputs/broken-c-module/broken_c.h diff --git a/test/Frontend/Inputs/broken-c-module/module.modulemap b/test/Frontend/DiagnosticVerifier/Inputs/broken-c-module/module.modulemap similarity index 100% rename from test/Frontend/Inputs/broken-c-module/module.modulemap rename to test/Frontend/DiagnosticVerifier/Inputs/broken-c-module/module.modulemap diff --git a/test/Frontend/verify-broken-c-module.swift b/test/Frontend/DiagnosticVerifier/broken-c-module.swift similarity index 100% rename from test/Frontend/verify-broken-c-module.swift rename to test/Frontend/DiagnosticVerifier/broken-c-module.swift diff --git a/test/Frontend/verify-fixits.swift b/test/Frontend/DiagnosticVerifier/fixits.swift similarity index 100% rename from test/Frontend/verify-fixits.swift rename to test/Frontend/DiagnosticVerifier/fixits.swift diff --git a/test/Frontend/diagnostic_verifier_multiple_prefix_invalid.swift b/test/Frontend/DiagnosticVerifier/multiple_prefix_invalid.swift similarity index 100% rename from test/Frontend/diagnostic_verifier_multiple_prefix_invalid.swift rename to test/Frontend/DiagnosticVerifier/multiple_prefix_invalid.swift diff --git a/test/Frontend/diagnostic_verifier_multiple_prefix_negative.swift b/test/Frontend/DiagnosticVerifier/multiple_prefix_negative.swift similarity index 100% rename from test/Frontend/diagnostic_verifier_multiple_prefix_negative.swift rename to test/Frontend/DiagnosticVerifier/multiple_prefix_negative.swift diff --git a/test/Frontend/diagnostic_verifier_multiple_prefix_positive.swift b/test/Frontend/DiagnosticVerifier/multiple_prefix_positive.swift similarity index 100% rename from test/Frontend/diagnostic_verifier_multiple_prefix_positive.swift rename to test/Frontend/DiagnosticVerifier/multiple_prefix_positive.swift diff --git a/test/FixCode/verify-fixits.swift b/test/Frontend/DiagnosticVerifier/verify-apply-fixes.swift similarity index 100% rename from test/FixCode/verify-fixits.swift rename to test/Frontend/DiagnosticVerifier/verify-apply-fixes.swift diff --git a/test/FixCode/verify-fixits.swift.result b/test/Frontend/DiagnosticVerifier/verify-apply-fixes.swift.result similarity index 100% rename from test/FixCode/verify-fixits.swift.result rename to test/Frontend/DiagnosticVerifier/verify-apply-fixes.swift.result diff --git a/test/Frontend/verify.swift b/test/Frontend/DiagnosticVerifier/verify.swift similarity index 100% rename from test/Frontend/verify.swift rename to test/Frontend/DiagnosticVerifier/verify.swift diff --git a/test/diagnostics/verifier.swift b/test/Frontend/DiagnosticVerifier/verify2.swift similarity index 100% rename from test/diagnostics/verifier.swift rename to test/Frontend/DiagnosticVerifier/verify2.swift