diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index 8c0917c0a73c1..065aefcd95f4c 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -5487,6 +5487,13 @@ cloneBaseMemberDecl(ValueDecl *decl, DeclContext *newContext) { (fn->getClangDecl() && isa(fn->getClangDecl()))) return nullptr; + if (auto cxxMethod = + dyn_cast_or_null(fn->getClangDecl())) { + // FIXME: if this function has rvalue this, we won't be able to synthesize + // the accessor correctly (https://github.com/apple/swift/issues/69745). + if (cxxMethod->getRefQualifier() == clang::RefQualifierKind::RQ_RValue) + return nullptr; + } ASTContext &context = decl->getASTContext(); auto out = FuncDecl::createImplicit( @@ -7070,6 +7077,11 @@ static bool isSufficientlyTrivial(const clang::CXXRecordDecl *decl) { /// Checks if a record provides the required value type lifetime operations /// (copy and destroy). static bool hasCopyTypeOperations(const clang::CXXRecordDecl *decl) { + // Hack for a base type of std::optional from the Microsoft standard library. + if (decl->isInStdNamespace() && decl->getIdentifier() && + decl->getName() == "_Optional_construct_base") + return true; + // If we have no way of copying the type we can't import the class // at all because we cannot express the correct semantics as a swift // struct. diff --git a/lib/ClangImporter/ImportDecl.cpp b/lib/ClangImporter/ImportDecl.cpp index de33788992971..a79e0e5dc5045 100644 --- a/lib/ClangImporter/ImportDecl.cpp +++ b/lib/ClangImporter/ImportDecl.cpp @@ -2292,56 +2292,6 @@ namespace { } if (auto MD = dyn_cast(member)) { - if (auto cxxMethod = dyn_cast(m)) { - ImportedName methodImportedName = - Impl.importFullName(cxxMethod, getActiveSwiftVersion()); - auto cxxOperatorKind = cxxMethod->getOverloadedOperator(); - - if (cxxOperatorKind == clang::OverloadedOperatorKind::OO_PlusPlus) { - // Make sure the type is not a foreign reference type. - // We cannot handle `operator++` for those types, since the - // current implementation creates a new instance of the type. - if (cxxMethod->param_empty() && !isa(result)) { - // This is a pre-increment operator. We synthesize a - // non-mutating function called `successor() -> Self`. - FuncDecl *successorFunc = synthesizer.makeSuccessorFunc(MD); - result->addMember(successorFunc); - - Impl.markUnavailable(MD, "use .successor()"); - } else { - Impl.markUnavailable(MD, "unable to create .successor() func"); - } - MD->overwriteAccess(AccessLevel::Private); - } - // Check if this method _is_ an overloaded operator but is not a - // call / subscript / dereference / increment. Those - // operators do not need static versions. - else if (cxxOperatorKind != - clang::OverloadedOperatorKind::OO_None && - cxxOperatorKind != - clang::OverloadedOperatorKind::OO_PlusPlus && - cxxOperatorKind != - clang::OverloadedOperatorKind::OO_Call && - !methodImportedName.isSubscriptAccessor() && - !methodImportedName.isDereferenceAccessor()) { - - auto opFuncDecl = synthesizer.makeOperator(MD, cxxMethod); - - Impl.addAlternateDecl(MD, opFuncDecl); - - auto msg = "use " + std::string{clang::getOperatorSpelling(cxxOperatorKind)} + " instead"; - Impl.markUnavailable(MD,msg); - - // Make the actual member operator private. - MD->overwriteAccess(AccessLevel::Private); - - // Make sure the synthesized decl can be found by lookupDirect. - result->addMemberToLookupTable(opFuncDecl); - - addEntryToLookupTable(*Impl.findLookupTable(decl), cxxMethod, - Impl.getNameImporter()); - } - } methods.push_back(MD); continue; } @@ -2695,6 +2645,31 @@ namespace { // SemaLookup.cpp). if (!decl->isBeingDefined() && !decl->isDependentContext() && areRecordFieldsComplete(decl)) { + if (decl->hasInheritedConstructor() && + Impl.isCxxInteropCompatVersionAtLeast( + version::getUpcomingCxxInteropCompatVersion())) { + for (auto member : decl->decls()) { + if (auto usingDecl = dyn_cast(member)) { + for (auto usingShadowDecl : usingDecl->shadows()) { + if (auto ctorUsingShadowDecl = + dyn_cast( + usingShadowDecl)) { + auto baseCtorDecl = dyn_cast( + ctorUsingShadowDecl->getTargetDecl()); + if (!baseCtorDecl || baseCtorDecl->isDeleted()) + continue; + auto derivedCtorDecl = clangSema.findInheritingConstructor( + clang::SourceLocation(), baseCtorDecl, + ctorUsingShadowDecl); + if (!derivedCtorDecl->isDefined() && + !derivedCtorDecl->isDeleted()) + clangSema.DefineInheritingConstructor( + clang::SourceLocation(), derivedCtorDecl); + } + } + } + } + } if (decl->needsImplicitDefaultConstructor()) { clang::CXXConstructorDecl *ctor = clangSema.DeclareImplicitDefaultConstructor( @@ -2977,6 +2952,21 @@ namespace { if (isSpecializationDepthGreaterThan(def, 8)) return nullptr; + // For class template instantiations, we need to add their member + // operators to the lookup table to make them discoverable with + // unqualified lookup. This makes it possible to implement a Swift + // protocol requirement with an instantiation of a C++ member operator. + // This cannot be done when building the lookup table, + // because templates are instantiated lazily. + for (auto member : def->decls()) { + if (auto method = dyn_cast(member)) { + if (method->isOverloadedOperator()) { + addEntryToLookupTable(*Impl.findLookupTable(decl), method, + Impl.getNameImporter()); + } + } + } + return VisitCXXRecordDecl(def); } @@ -3234,6 +3224,108 @@ namespace { llvm::None); } + /// Handles special functions such as subscripts and dereference operators. + bool + processSpecialImportedFunc(FuncDecl *func, ImportedName importedName, + clang::OverloadedOperatorKind cxxOperatorKind) { + if (cxxOperatorKind == clang::OverloadedOperatorKind::OO_None) + return true; + + auto dc = func->getDeclContext(); + auto typeDecl = dc->getSelfNominalTypeDecl(); + if (!typeDecl) + return true; + + if (importedName.isSubscriptAccessor()) { + assert(func->getParameters()->size() == 1); + auto parameter = func->getParameters()->get(0); + auto parameterType = parameter->getTypeInContext(); + if (!typeDecl || !parameterType) + return false; + if (parameter->isInOut()) + // Subscripts with inout parameters are not allowed in Swift. + return false; + // Subscript setter is marked as mutating in Swift even if the + // C++ `operator []` is `const`. + if (importedName.getAccessorKind() == + ImportedAccessorKind::SubscriptSetter && + !dc->isModuleScopeContext() && + !typeDecl->getDeclaredType()->isForeignReferenceType()) + func->setSelfAccessKind(SelfAccessKind::Mutating); + + auto &getterAndSetter = Impl.cxxSubscripts[{typeDecl, parameterType}]; + + switch (importedName.getAccessorKind()) { + case ImportedAccessorKind::SubscriptGetter: + getterAndSetter.first = func; + break; + case ImportedAccessorKind::SubscriptSetter: + getterAndSetter.second = func; + break; + default: + llvm_unreachable("invalid subscript kind"); + } + + Impl.markUnavailable(func, "use subscript"); + return true; + } + + if (importedName.isDereferenceAccessor()) { + auto &getterAndSetter = Impl.cxxDereferenceOperators[typeDecl]; + + switch (importedName.getAccessorKind()) { + case ImportedAccessorKind::DereferenceGetter: + getterAndSetter.first = func; + break; + case ImportedAccessorKind::DereferenceSetter: + getterAndSetter.second = func; + break; + default: + llvm_unreachable("invalid dereference operator kind"); + } + + Impl.markUnavailable(func, "use .pointee property"); + return true; + } + + if (cxxOperatorKind == clang::OverloadedOperatorKind::OO_PlusPlus) { + // Make sure the type is not a foreign reference type. + // We cannot handle `operator++` for those types, since the + // current implementation creates a new instance of the type. + if (func->getParameters()->size() == 0 && !isa(typeDecl)) { + // This is a pre-increment operator. We synthesize a + // non-mutating function called `successor() -> Self`. + FuncDecl *successorFunc = synthesizer.makeSuccessorFunc(func); + typeDecl->addMember(successorFunc); + + Impl.markUnavailable(func, "use .successor()"); + } else { + Impl.markUnavailable(func, "unable to create .successor() func"); + } + func->overwriteAccess(AccessLevel::Private); + return true; + } + + // Check if this method _is_ an overloaded operator but is not a + // call / subscript / dereference / increment. Those + // operators do not need static versions. + if (cxxOperatorKind != clang::OverloadedOperatorKind::OO_Call) { + auto opFuncDecl = synthesizer.makeOperator(func, cxxOperatorKind); + Impl.addAlternateDecl(func, opFuncDecl); + + Impl.markUnavailable( + func, (Twine("use ") + clang::getOperatorSpelling(cxxOperatorKind) + + " instead") + .str()); + + // Make sure the synthesized decl can be found by lookupDirect. + typeDecl->addMemberToLookupTable(opFuncDecl); + return true; + } + + return true; + } + Decl *importFunctionDecl( const clang::FunctionDecl *decl, ImportedName importedName, llvm::Optional correctSwiftName, @@ -3554,62 +3646,15 @@ namespace { func->setImportAsStaticMember(); } } + // Someday, maybe this will need to be 'open' for C++ virtual methods. + func->setAccess(AccessLevel::Public); - bool makePrivate = false; - - if (importedName.isSubscriptAccessor() && !importFuncWithoutSignature) { - assert(func->getParameters()->size() == 1); - auto typeDecl = dc->getSelfNominalTypeDecl(); - auto parameter = func->getParameters()->get(0); - auto parameterType = parameter->getTypeInContext(); - if (!typeDecl || !parameterType) - return nullptr; - if (parameter->isInOut()) - // Subscripts with inout parameters are not allowed in Swift. + if (!importFuncWithoutSignature) { + bool success = processSpecialImportedFunc( + func, importedName, decl->getOverloadedOperator()); + if (!success) return nullptr; - - auto &getterAndSetter = Impl.cxxSubscripts[{ typeDecl, - parameterType }]; - - switch (importedName.getAccessorKind()) { - case ImportedAccessorKind::SubscriptGetter: - getterAndSetter.first = func; - break; - case ImportedAccessorKind::SubscriptSetter: - getterAndSetter.second = func; - break; - default: - llvm_unreachable("invalid subscript kind"); - } - - Impl.markUnavailable(func, "use subscript"); } - - if (importedName.isDereferenceAccessor() && - !importFuncWithoutSignature) { - auto typeDecl = dc->getSelfNominalTypeDecl(); - auto &getterAndSetter = Impl.cxxDereferenceOperators[typeDecl]; - - switch (importedName.getAccessorKind()) { - case ImportedAccessorKind::DereferenceGetter: - getterAndSetter.first = func; - break; - case ImportedAccessorKind::DereferenceSetter: - getterAndSetter.second = func; - break; - default: - llvm_unreachable("invalid dereference operator kind"); - } - - Impl.markUnavailable(func, "use .pointee property"); - makePrivate = true; - } - - if (makePrivate) - func->setAccess(AccessLevel::Private); - else - // Someday, maybe this will need to be 'open' for C++ virtual methods. - func->setAccess(AccessLevel::Public); } result->setIsObjC(false); @@ -3922,18 +3967,31 @@ namespace { } Decl *VisitUsingDecl(const clang::UsingDecl *decl) { - // Using declarations are not imported. + // See VisitUsingShadowDecl below. return nullptr; } Decl *VisitUsingShadowDecl(const clang::UsingShadowDecl *decl) { - // Only import types for now. - if (!isa(decl->getUnderlyingDecl())) + // Only import: + // 1. Types + // 2. C++ methods from privately inherited base classes + if (!isa(decl->getTargetDecl()) && + !(isa(decl->getTargetDecl()) && + Impl.isCxxInteropCompatVersionAtLeast( + version::getUpcomingCxxInteropCompatVersion()))) + return nullptr; + // Constructors (e.g. `using BaseClass::BaseClass`) are handled in + // VisitCXXRecordDecl, since we need them to determine whether a struct + // can be imported into Swift. + if (isa(decl->getTargetDecl())) return nullptr; ImportedName importedName; llvm::Optional correctSwiftName; std::tie(importedName, correctSwiftName) = importFullName(decl); + // Don't import something that doesn't have a name. + if (importedName.getDeclName().isSpecial()) + return nullptr; auto Name = importedName.getDeclName().getBaseIdentifier(); if (Name.empty()) return nullptr; @@ -3944,30 +4002,73 @@ namespace { return importCompatibilityTypeAlias(decl, importedName, *correctSwiftName); - auto DC = + auto importedDC = Impl.importDeclContextOf(decl, importedName.getEffectiveContext()); - if (!DC) + if (!importedDC) return nullptr; - Decl *SwiftDecl = Impl.importDecl(decl->getUnderlyingDecl(), getActiveSwiftVersion()); - if (!SwiftDecl) - return nullptr; + // While importing the DeclContext, we might have imported the decl + // itself. + auto known = Impl.importDeclCached(decl, getVersion()); + if (known.has_value()) + return known.value(); - const TypeDecl *SwiftTypeDecl = dyn_cast(SwiftDecl); - if (!SwiftTypeDecl) - return nullptr; + if (isa(decl->getTargetDecl())) { + Decl *SwiftDecl = Impl.importDecl(decl->getUnderlyingDecl(), getActiveSwiftVersion()); + if (!SwiftDecl) + return nullptr; - auto Loc = Impl.importSourceLoc(decl->getLocation()); - auto Result = Impl.createDeclWithClangNode( - decl, - AccessLevel::Public, - Impl.importSourceLoc(decl->getBeginLoc()), - SourceLoc(), Name, - Loc, - /*genericparams*/nullptr, DC); - Result->setUnderlyingType(SwiftTypeDecl->getDeclaredInterfaceType()); + const TypeDecl *SwiftTypeDecl = dyn_cast(SwiftDecl); + if (!SwiftTypeDecl) + return nullptr; - return Result; + auto Loc = Impl.importSourceLoc(decl->getLocation()); + auto Result = Impl.createDeclWithClangNode( + decl, + AccessLevel::Public, + Impl.importSourceLoc(decl->getBeginLoc()), + SourceLoc(), Name, + Loc, + /*genericparams*/nullptr, importedDC); + Result->setUnderlyingType(SwiftTypeDecl->getDeclaredInterfaceType()); + + return Result; + } + if (auto targetMethod = + dyn_cast(decl->getTargetDecl())) { + auto dc = dyn_cast(decl->getDeclContext()); + + auto targetDC = targetMethod->getDeclContext(); + auto targetRecord = dyn_cast(targetDC); + if (!targetRecord) + return nullptr; + + // If this struct is not inherited from the struct where the method is + // defined, bail. + if (!dc->isDerivedFrom(targetRecord)) + return nullptr; + + auto importedBaseMethod = dyn_cast_or_null( + Impl.importDecl(targetMethod, getActiveSwiftVersion())); + // This will be nullptr for a protected method of base class that is + // made public with a using declaration in a derived class. This is + // valid in C++ but we do not import such using declarations now. + // TODO: make this work for protected base methods. + if (!importedBaseMethod) + return nullptr; + auto clonedMethod = dyn_cast_or_null( + Impl.importBaseMemberDecl(importedBaseMethod, importedDC)); + if (!clonedMethod) + return nullptr; + + bool success = processSpecialImportedFunc( + clonedMethod, importedName, targetMethod->getOverloadedOperator()); + if (!success) + return nullptr; + + return clonedMethod; + } + return nullptr; } /// Add an @objc(name) attribute with the given, optional name expressed as @@ -8352,11 +8453,17 @@ ClangImporter::Implementation::importDeclImpl(const clang::NamedDecl *ClangDecl, if (Result && (!Result->getDeclContext()->isModuleScopeContext() || isa(Result->getDeclContext()))) { + // For using declarations that expose a method of a base class, the Clang + // decl is synthesized lazily when the method is actually used from Swift. + bool hasSynthesizedClangNode = + isa(ClangDecl) && isa(Result); + // Either the Swift declaration was from stdlib, // or we imported the underlying decl of the typedef, // or we imported the decl itself. bool ImportedCorrectly = !Result->getClangDecl() || SkippedOverTypedef || + hasSynthesizedClangNode || Result->getClangDecl()->getCanonicalDecl() == Canon; // Or the other type is a typedef, @@ -8379,7 +8486,7 @@ ClangImporter::Implementation::importDeclImpl(const clang::NamedDecl *ClangDecl, } assert(ImportedCorrectly); } - assert(Result->hasClangNode()); + assert(Result->hasClangNode() || hasSynthesizedClangNode); } #else (void)SkippedOverTypedef; diff --git a/lib/ClangImporter/ImportName.cpp b/lib/ClangImporter/ImportName.cpp index 8a2bfdd10a51f..f1e40a2a4df54 100644 --- a/lib/ClangImporter/ImportName.cpp +++ b/lib/ClangImporter/ImportName.cpp @@ -1523,6 +1523,17 @@ ImportedName NameImporter::importNameImpl(const clang::NamedDecl *D, return ImportedName(); result.effectiveContext = effectiveCtx; + // If this is a using declaration, import the name of the shadowed decl and + // adjust the context. + if (auto usingShadowDecl = dyn_cast(D)) { + auto targetDecl = usingShadowDecl->getTargetDecl(); + if (isa(targetDecl)) { + ImportedName baseName = importName(targetDecl, version, givenName); + baseName.effectiveContext = effectiveCtx; + return baseName; + } + } + // Gather information from the swift_async attribute, if there is one. llvm::Optional completionHandlerParamIndex; bool completionHandlerFlagIsZeroOnError = false; diff --git a/lib/ClangImporter/ImportType.cpp b/lib/ClangImporter/ImportType.cpp index fe915dd30a9dc..23dcd3283f29a 100644 --- a/lib/ClangImporter/ImportType.cpp +++ b/lib/ClangImporter/ImportType.cpp @@ -2101,10 +2101,11 @@ ImportedType ClangImporter::Implementation::importFunctionReturnType( // C++ operators +=, -=, *=, /= may return a reference to self. This is not // idiomatic in Swift, let's drop these return values. clang::OverloadedOperatorKind op = clangDecl->getOverloadedOperator(); - if (op == clang::OverloadedOperatorKind::OO_PlusEqual || - op == clang::OverloadedOperatorKind::OO_MinusEqual || - op == clang::OverloadedOperatorKind::OO_StarEqual || - op == clang::OverloadedOperatorKind::OO_SlashEqual) + if ((op == clang::OverloadedOperatorKind::OO_PlusEqual || + op == clang::OverloadedOperatorKind::OO_MinusEqual || + op == clang::OverloadedOperatorKind::OO_StarEqual || + op == clang::OverloadedOperatorKind::OO_SlashEqual) && + clangDecl->getReturnType()->isReferenceType()) return {SwiftContext.getVoidType(), false}; // Fix up optionality. diff --git a/lib/ClangImporter/ImporterImpl.h b/lib/ClangImporter/ImporterImpl.h index 4933d8c758a08..b91363a75615a 100644 --- a/lib/ClangImporter/ImporterImpl.h +++ b/lib/ClangImporter/ImporterImpl.h @@ -663,9 +663,9 @@ class LLVM_LIBRARY_VISIBILITY ClangImporter::Implementation llvm::DenseMap, ValueDecl *> clonedBaseMembers; +public: ValueDecl *importBaseMemberDecl(ValueDecl *decl, DeclContext *newContext); -public: static size_t getImportedBaseMemberDeclArity(const ValueDecl *valueDecl); // Cache for already-specialized function templates and any thunks they may diff --git a/lib/ClangImporter/SwiftDeclSynthesizer.cpp b/lib/ClangImporter/SwiftDeclSynthesizer.cpp index 404602372cb2b..a4c099e1fa6dc 100644 --- a/lib/ClangImporter/SwiftDeclSynthesizer.cpp +++ b/lib/ClangImporter/SwiftDeclSynthesizer.cpp @@ -1899,9 +1899,7 @@ synthesizeOperatorMethodBody(AbstractFunctionDecl *afd, void *context) { FuncDecl * SwiftDeclSynthesizer::makeOperator(FuncDecl *operatorMethod, - clang::CXXMethodDecl *clangOperator) { - clang::OverloadedOperatorKind opKind = clangOperator->getOverloadedOperator(); - + clang::OverloadedOperatorKind opKind) { assert(opKind != clang::OverloadedOperatorKind::OO_None && "expected a C++ operator"); @@ -1959,7 +1957,8 @@ SwiftDeclSynthesizer::makeOperator(FuncDecl *operatorMethod, operatorMethod); // If this is a unary prefix operator (e.g. `!`), add a `prefix` attribute. - if (clangOperator->param_empty()) { + size_t numParams = operatorMethod->getParameters()->size(); + if (numParams == 0 || (operatorMethod->isStatic() && numParams == 1)) { topLevelStaticFuncDecl->getAttrs().add(new (ctx) PrefixAttr(SourceLoc())); } diff --git a/lib/ClangImporter/SwiftDeclSynthesizer.h b/lib/ClangImporter/SwiftDeclSynthesizer.h index ccc94dd541f20..46f3296247ea1 100644 --- a/lib/ClangImporter/SwiftDeclSynthesizer.h +++ b/lib/ClangImporter/SwiftDeclSynthesizer.h @@ -285,7 +285,7 @@ class SwiftDeclSynthesizer { FuncDecl *makeSuccessorFunc(FuncDecl *incrementFunc); FuncDecl *makeOperator(FuncDecl *operatorMethod, - clang::CXXMethodDecl *clangOperator); + clang::OverloadedOperatorKind opKind); VarDecl *makeComputedPropertyFromCXXMethods(FuncDecl *getter, FuncDecl *setter); diff --git a/lib/ClangImporter/SwiftLookupTable.cpp b/lib/ClangImporter/SwiftLookupTable.cpp index beb18b7748f18..d584dcb0de343 100644 --- a/lib/ClangImporter/SwiftLookupTable.cpp +++ b/lib/ClangImporter/SwiftLookupTable.cpp @@ -1991,6 +1991,12 @@ void importer::addEntryToLookupTable(SwiftLookupTable &table, } } } + if (auto usingDecl = dyn_cast(named)) { + for (auto usingShadowDecl : usingDecl->shadows()) { + if (isa(usingShadowDecl->getTargetDecl())) + addEntryToLookupTable(table, usingShadowDecl, nameImporter); + } + } } /// Returns the nearest parent of \p module that is marked \c explicit in its diff --git a/lib/IRGen/GenCall.cpp b/lib/IRGen/GenCall.cpp index c92ac7e86887c..bba57f7fe227e 100644 --- a/lib/IRGen/GenCall.cpp +++ b/lib/IRGen/GenCall.cpp @@ -24,6 +24,7 @@ #include "swift/SIL/SILModule.h" #include "swift/SIL/SILType.h" #include "clang/AST/ASTContext.h" +#include "clang/AST/GlobalDecl.h" #include "clang/AST/RecordLayout.h" #include "clang/Basic/TargetInfo.h" #include "clang/CodeGen/CodeGenABITypes.h" @@ -266,7 +267,10 @@ static void addIndirectValueParameterAttributes(IRGenModule &IGM, llvm::AttrBuilder b(IGM.getLLVMContext()); // Value parameter pointers can't alias or be captured. b.addAttribute(llvm::Attribute::NoAlias); - b.addAttribute(llvm::Attribute::NoCapture); + // Bitwise takable value types are guaranteed not to capture + // a pointer into itself. + if (ti.isBitwiseTakable(ResilienceExpansion::Maximal)) + b.addAttribute(llvm::Attribute::NoCapture); // The parameter must reference dereferenceable memory of the type. addDereferenceableAttributeToBuilder(IGM, b, ti); @@ -278,9 +282,11 @@ static void addPackParameterAttributes(IRGenModule &IGM, llvm::AttributeList &attrs, unsigned argIndex) { llvm::AttrBuilder b(IGM.getLLVMContext()); - // Pack parameter pointers can't alias or be captured. + // Pack parameter pointers can't alias. + // Note: they are not marked `nocapture` as one + // pack parameter could be a value type (e.g. a C++ type) + // that captures its own pointer in itself. b.addAttribute(llvm::Attribute::NoAlias); - b.addAttribute(llvm::Attribute::NoCapture); // TODO: we could mark this dereferenceable when the pack has fixed // components. // TODO: add an alignment attribute @@ -301,8 +307,10 @@ static void addInoutParameterAttributes(IRGenModule &IGM, SILType paramSILType, // attribute if it's a pointer being passed inout. b.addAttribute(llvm::Attribute::NoAlias); } - // Aliasing inouts can't be captured without doing unsafe stuff. - b.addAttribute(llvm::Attribute::NoCapture); + // Bitwise takable value types are guaranteed not to capture + // a pointer into itself. + if (ti.isBitwiseTakable(ResilienceExpansion::Maximal)) + b.addAttribute(llvm::Attribute::NoCapture); // The inout must reference dereferenceable memory of the type. addDereferenceableAttributeToBuilder(IGM, b, ti); @@ -341,13 +349,20 @@ llvm::CallingConv::ID irgen::expandCallingConv(IRGenModule &IGM, static void addIndirectResultAttributes(IRGenModule &IGM, llvm::AttributeList &attrs, unsigned paramIndex, bool allowSRet, - llvm::Type *storageType) { + llvm::Type *storageType, + const TypeInfo &typeInfo, + bool useInReg = false) { llvm::AttrBuilder b(IGM.getLLVMContext()); b.addAttribute(llvm::Attribute::NoAlias); - b.addAttribute(llvm::Attribute::NoCapture); + // Bitwise takable value types are guaranteed not to capture + // a pointer into itself. + if (typeInfo.isBitwiseTakable(ResilienceExpansion::Maximal)) + b.addAttribute(llvm::Attribute::NoCapture); if (allowSRet) { assert(storageType); b.addStructRetAttr(storageType); + if (useInReg) + b.addAttribute(llvm::Attribute::InReg); } attrs = attrs.addParamAttributes(IGM.getLLVMContext(), paramIndex, b); } @@ -409,6 +424,10 @@ namespace { IRGenModule &IGM; CanSILFunctionType FnType; bool forStaticCall = false; // Used for objc_method (direct call or not). + + // Indicates this is a c++ constructor call. + const clang::CXXConstructorDecl *cxxCtorDecl = nullptr; + public: SmallVector ParamIRTypes; llvm::Type *ResultIRType = nullptr; @@ -423,8 +442,10 @@ namespace { FunctionPointerKind FnKind; SignatureExpansion(IRGenModule &IGM, CanSILFunctionType fnType, - FunctionPointerKind fnKind, bool forStaticCall = false) - : IGM(IGM), FnType(fnType), forStaticCall(forStaticCall), FnKind(fnKind) {} + FunctionPointerKind fnKind, bool forStaticCall = false, + const clang::CXXConstructorDecl *cxxCtorDecl = nullptr) + : IGM(IGM), FnType(fnType), forStaticCall(forStaticCall), + cxxCtorDecl(cxxCtorDecl), FnKind(fnKind) {} /// Expand the components of the primary entrypoint of the function type. void expandFunctionType( @@ -449,7 +470,7 @@ namespace { private: const TypeInfo &expand(SILParameterInfo param); - llvm::Type *addIndirectResult(); + llvm::Type *addIndirectResult(SILType resultType, bool useInReg = false); SILFunctionConventions getSILFuncConventions() const { return SILFunctionConventions(FnType, IGM.getSILModule()); @@ -503,13 +524,12 @@ namespace { } // end namespace irgen } // end namespace swift -llvm::Type *SignatureExpansion::addIndirectResult() { - auto resultType = getSILFuncConventions().getSILResultType( - IGM.getMaximalTypeExpansionContext()); +llvm::Type *SignatureExpansion::addIndirectResult(SILType resultType, + bool useInReg) { const TypeInfo &resultTI = IGM.getTypeInfo(resultType); auto storageTy = resultTI.getStorageType(); addIndirectResultAttributes(IGM, Attrs, ParamIRTypes.size(), claimSRet(), - storageTy); + storageTy, resultTI, useInReg); addPointerParameter(storageTy); return IGM.VoidTy; } @@ -568,11 +588,12 @@ void SignatureExpansion::expandIndirectResults() { auto useSRet = claimSRet(); // We need to use opaque types or non fixed size storage types because llvm // does type based analysis based on the type of sret arguments. - if (useSRet && !isa(IGM.getTypeInfo(indirectResultType))) { + const TypeInfo &typeInfo = IGM.getTypeInfo(indirectResultType); + if (useSRet && !isa(typeInfo)) { storageTy = IGM.OpaqueTy; } addIndirectResultAttributes(IGM, Attrs, ParamIRTypes.size(), useSRet, - storageTy); + storageTy, typeInfo); addPointerParameter(storageTy); } } @@ -901,7 +922,7 @@ SignatureExpansion::expandDirectResult() { auto &ti = IGM.getTypeInfo(resultType); auto &native = ti.nativeReturnValueSchema(IGM); if (native.requiresIndirect()) - return std::make_pair(addIndirectResult(), nullptr); + return std::make_pair(addIndirectResult(resultType), nullptr); // Disable the use of sret if we have a non-trivial direct result. if (!native.empty()) CanUseSRet = false; @@ -1333,9 +1354,21 @@ static bool doesClangExpansionMatchSchema(IRGenModule &IGM, void SignatureExpansion::expandExternalSignatureTypes() { assert(FnType->getLanguage() == SILFunctionLanguage::C); - // Convert the SIL result type to a Clang type. - auto clangResultTy = - IGM.getClangType(FnType->getFormalCSemanticResult(IGM.getSILModule())); + auto SILResultTy = [&]() { + if (FnType->getNumResults() == 0) + return SILType::getPrimitiveObjectType(IGM.Context.TheEmptyTupleType); + + return SILType::getPrimitiveObjectType( + FnType->getSingleResult().getReturnValueType( + IGM.getSILModule(), FnType, TypeExpansionContext::minimal())); + }(); + + // Convert the SIL result type to a Clang type. If this is for a c++ + // constructor, use 'void' as the return type to arrange the function type. + auto clangResultTy = IGM.getClangType( + cxxCtorDecl + ? SILType::getPrimitiveObjectType(IGM.Context.TheEmptyTupleType) + : SILResultTy); // Now convert the parameters to Clang types. auto params = FnType->getParameters(); @@ -1343,16 +1376,6 @@ void SignatureExpansion::expandExternalSignatureTypes() { SmallVector paramTys; auto const &clangCtx = IGM.getClangASTContext(); - bool formalIndirectResult = FnType->getNumResults() > 0 && - FnType->getSingleResult().isFormalIndirect(); - if (formalIndirectResult) { - auto resultType = getSILFuncConventions().getSingleSILResultType( - IGM.getMaximalTypeExpansionContext()); - auto clangTy = - IGM.getClangASTContext().getPointerType(IGM.getClangType(resultType)); - paramTys.push_back(clangTy); - } - switch (FnType->getRepresentation()) { case SILFunctionTypeRepresentation::ObjCMethod: { // ObjC methods take their 'self' argument first, followed by an @@ -1381,7 +1404,11 @@ void SignatureExpansion::expandExternalSignatureTypes() { } case SILFunctionTypeRepresentation::CFunctionPointer: - // No implicit arguments. + if (cxxCtorDecl) { + auto clangTy = IGM.getClangASTContext().getPointerType( + IGM.getClangType(SILResultTy)); + paramTys.push_back(clangTy); + } break; case SILFunctionTypeRepresentation::Thin: @@ -1405,9 +1432,16 @@ void SignatureExpansion::expandExternalSignatureTypes() { // Generate function info for this signature. auto extInfo = clang::FunctionType::ExtInfo(); - auto &FI = clang::CodeGen::arrangeFreeFunctionCall(IGM.ClangCodeGen->CGM(), - clangResultTy, paramTys, extInfo, - clang::CodeGen::RequiredArgs::All); + + bool isCXXMethod = + FnType->getRepresentation() == SILFunctionTypeRepresentation::CXXMethod; + auto &FI = isCXXMethod ? + clang::CodeGen::arrangeCXXMethodCall(IGM.ClangCodeGen->CGM(), + clangResultTy, paramTys, extInfo, {}, + clang::CodeGen::RequiredArgs::All) : + clang::CodeGen::arrangeFreeFunctionCall(IGM.ClangCodeGen->CGM(), + clangResultTy, paramTys, extInfo, {}, + clang::CodeGen::RequiredArgs::All); ForeignInfo.ClangInfo = &FI; assert(FI.arg_size() == paramTys.size() && @@ -1415,6 +1449,14 @@ void SignatureExpansion::expandExternalSignatureTypes() { auto &returnInfo = FI.getReturnInfo(); +#ifndef NDEBUG + bool formalIndirectResult = FnType->getNumResults() > 0 && + FnType->getSingleResult().isFormalIndirect(); + assert( + (cxxCtorDecl || !formalIndirectResult || returnInfo.isIndirect()) && + "swift and clang disagree on whether the result is returned indirectly"); +#endif + // Does the result need an extension attribute? if (returnInfo.isExtend()) { bool signExt = clangResultTy->hasSignedIntegerRepresentation(); @@ -1459,7 +1501,7 @@ void SignatureExpansion::expandExternalSignatureTypes() { param, IGM.getMaximalTypeExpansionContext()); auto ¶mTI = cast(IGM.getTypeInfo(paramTy)); addIndirectResultAttributes(IGM, Attrs, getCurParamIndex(), claimSRet(), - paramTI.getStorageType()); + paramTI.getStorageType(), paramTI); break; } } @@ -1519,16 +1561,16 @@ void SignatureExpansion::expandExternalSignatureTypes() { // If we return indirectly, that is the first parameter type. if (returnInfo.isIndirect()) { - if (IGM.Triple.isWindowsMSVCEnvironment() && - FnType->getRepresentation() == - SILFunctionTypeRepresentation::CXXMethod) { + auto resultType = getSILFuncConventions().getSingleSILResultType( + IGM.getMaximalTypeExpansionContext()); + if (returnInfo.isSRetAfterThis()) { // Windows ABI places `this` before the // returned indirect values. emitArg(0); firstParamToLowerNormally = 1; - addIndirectResult(); + addIndirectResult(resultType, returnInfo.getInReg()); } else - addIndirectResult(); + addIndirectResult(resultType, returnInfo.getInReg()); } // Use a special IR type for passing block pointers. @@ -1542,7 +1584,12 @@ void SignatureExpansion::expandExternalSignatureTypes() { for (auto i : indices(paramTys).slice(firstParamToLowerNormally)) emitArg(i); - if (returnInfo.isIndirect() || returnInfo.isIgnore()) { + if (cxxCtorDecl) { + ResultIRType = cast(IGM.getAddrOfClangGlobalDecl( + {cxxCtorDecl, clang::Ctor_Complete}, + (ForDefinition_t) false)) + ->getReturnType(); + } else if (returnInfo.isIndirect() || returnInfo.isIgnore()) { ResultIRType = IGM.VoidTy; } else { ResultIRType = returnInfo.getCoerceToType(); @@ -1862,7 +1909,7 @@ void SignatureExpansion::expandAsyncEntryType() { auto &ti = IGM.getTypeInfo(resultType); auto &native = ti.nativeReturnValueSchema(IGM); if (native.requiresIndirect()) - addIndirectResult(); + addIndirectResult(resultType); // Add the indirect result types. expandIndirectResults(); @@ -2023,10 +2070,11 @@ Signature SignatureExpansion::getSignature() { Signature Signature::getUncached(IRGenModule &IGM, CanSILFunctionType formalType, - FunctionPointerKind fpKind, - bool forStaticCall) { + FunctionPointerKind fpKind, bool forStaticCall, + const clang::CXXConstructorDecl *cxxCtorDecl) { GenericContextScope scope(IGM, formalType->getInvocationGenericSignature()); - SignatureExpansion expansion(IGM, formalType, fpKind, forStaticCall); + SignatureExpansion expansion(IGM, formalType, fpKind, forStaticCall, + cxxCtorDecl); expansion.expandFunctionType(); return expansion.getSignature(); } @@ -2362,11 +2410,12 @@ class SyncCallEmission final : public CallEmission { // Windows ABI places `this` before the // returned indirect values. - bool isThisFirst = IGF.IGM.Triple.isWindowsMSVCEnvironment(); - if (!isThisFirst) + auto &returnInfo = + getCallee().getForeignInfo().ClangInfo->getReturnInfo(); + if (returnInfo.isIndirect() && !returnInfo.isSRetAfterThis()) passIndirectResults(); adjusted.add(arg); - if (isThisFirst) + if (returnInfo.isIndirect() && returnInfo.isSRetAfterThis()) passIndirectResults(); } @@ -2906,9 +2955,10 @@ void CallEmission::emitToUnmappedMemory(Address result) { assert(LastArgWritten == 1 && "emitting unnaturally to indirect result"); Args[0] = result.getAddress(); - if (IGF.IGM.Triple.isWindowsMSVCEnvironment() && - getCallee().getRepresentation() == - SILFunctionTypeRepresentation::CXXMethod && + + auto *FI = getCallee().getForeignInfo().ClangInfo; + if (FI && FI->getReturnInfo().isIndirect() && + FI->getReturnInfo().isSRetAfterThis() && Args[1] == getCallee().getCXXMethodSelf()) { // C++ methods in MSVC ABI pass `this` before the // indirectly returned value. @@ -3071,7 +3121,13 @@ llvm::CallBase *IRBuilder::CreateCallOrInvoke( for (unsigned argIndex = 0; argIndex < func->arg_size(); ++argIndex) { if (func->hasParamAttribute(argIndex, llvm::Attribute::StructRet)) { llvm::AttrBuilder builder(func->getContext()); - builder.addStructRetAttr(func->getParamStructRetType(argIndex)); + // See if there is a sret parameter in the signature. There are cases + // where the called function has a sret parameter, but the signature + // doesn't (e.g., noreturn functions). + llvm::Type *ty = attrs.getParamStructRetType(argIndex); + if (!ty) + ty = func->getParamStructRetType(argIndex); + builder.addStructRetAttr(ty); attrs = attrs.addParamAttributes(func->getContext(), argIndex, builder); } if (func->hasParamAttribute(argIndex, llvm::Attribute::ByVal)) { @@ -3285,10 +3341,10 @@ void CallEmission::emitToExplosion(Explosion &out, bool isOutlined) { emitToMemory(temp, substResultTI, isOutlined); return; } - if (IGF.IGM.Triple.isWindowsMSVCEnvironment() && - getCallee().getRepresentation() == - SILFunctionTypeRepresentation::CXXMethod && - substResultType.isVoid()) { + + auto *FI = getCallee().getForeignInfo().ClangInfo; + if (FI && FI->getReturnInfo().isIndirect() && + FI->getReturnInfo().isSRetAfterThis() && substResultType.isVoid()) { // Some C++ methods return a value but are imported as // returning `Void` (e.g. `operator +=`). In this case // we should allocate the correct temp indirect return @@ -3785,11 +3841,13 @@ static void externalizeArguments(IRGenFunction &IGF, const Callee &callee, params = params.drop_back(); } - if (fnType->getNumResults() > 0 && - fnType->getSingleResult().isFormalIndirect()) { - // Ignore the indirect result parameter. + bool formalIndirectResult = fnType->getNumResults() > 0 && + fnType->getSingleResult().isFormalIndirect(); + + // If clang returns directly and swift returns indirectly, this must be a c++ + // constructor call. In that case, skip the "self" param. + if (!FI.getReturnInfo().isIndirect() && formalIndirectResult) firstParam += 1; - } for (unsigned i = firstParam; i != paramEnd; ++i) { auto clangParamTy = FI.arg_begin()[i].type; diff --git a/lib/IRGen/GenDecl.cpp b/lib/IRGen/GenDecl.cpp index fe4fd82b0579c..e5b0d30c04bd0 100644 --- a/lib/IRGen/GenDecl.cpp +++ b/lib/IRGen/GenDecl.cpp @@ -3332,6 +3332,10 @@ llvm::Constant *swift::irgen::emitCXXConstructorThunkIfNeeded( return ctorAddress; } + // Check whether we've created the thunk already. + if (auto *thunkFn = IGM.Module.getFunction(name)) + return thunkFn; + llvm::Function *thunk = llvm::Function::Create( assumedFnType, llvm::Function::PrivateLinkage, name, &IGM.Module); @@ -3372,7 +3376,10 @@ llvm::Constant *swift::irgen::emitCXXConstructorThunkIfNeeded( emitCXXConstructorCall(subIGF, ctor, ctorFnType, ctorAddress, Args); if (isa(call)) IGM.emittedForeignFunctionThunksWithExceptionTraps.insert(thunk); - subIGF.Builder.CreateRetVoid(); + if (ctorFnType->getReturnType()->isVoidTy()) + subIGF.Builder.CreateRetVoid(); + else + subIGF.Builder.CreateRet(call); return thunk; } @@ -3412,10 +3419,15 @@ llvm::Function *IRGenModule::getAddrOfSILFunction( LinkEntity entity = LinkEntity::forSILFunction(f, shouldCallPreviousImplementation); - // Check whether we've created the function already. + auto clangDecl = f->getClangDecl(); + auto cxxCtor = dyn_cast_or_null(clangDecl); + + // Check whether we've created the function already. If the function is a C++ + // constructor, don't return the constructor here as a thunk might be needed + // to call the constructor. // FIXME: We should integrate this into the LinkEntity cache more cleanly. llvm::Function *fn = Module.getFunction(entity.mangleAsString()); - if (fn) { + if (fn && !cxxCtor) { if (forDefinition) { updateLinkageForDefinition(*this, fn, entity); } @@ -3427,7 +3439,7 @@ llvm::Function *IRGenModule::getAddrOfSILFunction( // the insert-before point. llvm::Constant *clangAddr = nullptr; bool isObjCDirect = false; - if (auto clangDecl = f->getClangDecl()) { + if (clangDecl) { // If we have an Objective-C Clang declaration, it must be a direct // method and we want to generate the IR declaration ourselves. if (auto objcDecl = dyn_cast(clangDecl)) { @@ -3438,8 +3450,8 @@ llvm::Function *IRGenModule::getAddrOfSILFunction( clangAddr = getAddrOfClangGlobalDecl(globalDecl, forDefinition); } - if (auto ctor = dyn_cast(clangDecl)) { - Signature signature = getSignature(f->getLoweredFunctionType()); + if (cxxCtor) { + Signature signature = getSignature(f->getLoweredFunctionType(), cxxCtor); // The thunk has private linkage, so it doesn't need to have a predictable // mangled name -- we just need to make sure the name is unique. @@ -3448,7 +3460,7 @@ llvm::Function *IRGenModule::getAddrOfSILFunction( stream << "__swift_cxx_ctor"; entity.mangle(stream); - clangAddr = emitCXXConstructorThunkIfNeeded(*this, signature, ctor, name, + clangAddr = emitCXXConstructorThunkIfNeeded(*this, signature, cxxCtor, name, clangAddr); } } diff --git a/lib/IRGen/GenFunc.cpp b/lib/IRGen/GenFunc.cpp index 0d2cd436ca16d..a883b85dcb3bb 100644 --- a/lib/IRGen/GenFunc.cpp +++ b/lib/IRGen/GenFunc.cpp @@ -125,11 +125,15 @@ namespace { const CanSILFunctionType FormalType; mutable Signature TheSignature; + mutable Signature TheCXXConstructorSignature; public: FuncSignatureInfo(CanSILFunctionType formalType) : FormalType(formalType) {} + Signature + getCXXConstructorSignature(const clang::CXXConstructorDecl *cxxCtorDecl, + IRGenModule &IGM) const; Signature getSignature(IRGenModule &IGM) const; }; @@ -677,6 +681,20 @@ Signature FuncSignatureInfo::getSignature(IRGenModule &IGM) const { return TheSignature; } +Signature FuncSignatureInfo::getCXXConstructorSignature( + const clang::CXXConstructorDecl *cxxCtorDecl, IRGenModule &IGM) const { + // If it's already been filled in, we're done. + if (TheCXXConstructorSignature.isValid()) + return TheCXXConstructorSignature; + + // Update the cache and return. + TheCXXConstructorSignature = + Signature::getUncached(IGM, FormalType, FunctionPointerKind(FormalType), + /*forStaticCall*/ false, cxxCtorDecl); + assert(TheCXXConstructorSignature.isValid()); + return TheCXXConstructorSignature; +} + Signature ObjCFuncSignatureInfo::getDirectSignature(IRGenModule &IGM) const { // If it's already been filled in, we're done. if (TheDirectSignature.isValid()) @@ -711,13 +729,17 @@ getFuncSignatureInfoForLowered(IRGenModule &IGM, CanSILFunctionType type) { llvm_unreachable("bad function type representation"); } -Signature IRGenModule::getSignature(CanSILFunctionType type) { - return getSignature(type, FunctionPointerKind(type)); +Signature +IRGenModule::getSignature(CanSILFunctionType type, + const clang::CXXConstructorDecl *cxxCtorDecl) { + return getSignature(type, FunctionPointerKind(type), /*forStaticCall*/ false, + cxxCtorDecl); } -Signature IRGenModule::getSignature(CanSILFunctionType type, - FunctionPointerKind kind, - bool forStaticCall) { +Signature +IRGenModule::getSignature(CanSILFunctionType type, FunctionPointerKind kind, + bool forStaticCall, + const clang::CXXConstructorDecl *cxxCtorDecl) { // Don't bother caching if we're working with a special kind. if (kind.isSpecial()) return Signature::getUncached(*this, type, kind); @@ -729,6 +751,10 @@ Signature IRGenModule::getSignature(CanSILFunctionType type, auto &objcSigInfo = static_cast(sigInfo); return objcSigInfo.getDirectSignature(*this); } + + if (cxxCtorDecl) + return sigInfo.getCXXConstructorSignature(cxxCtorDecl, *this); + return sigInfo.getSignature(*this); } diff --git a/lib/IRGen/GenStruct.cpp b/lib/IRGen/GenStruct.cpp index a5f8cf070c1c0..4cfba8185d89b 100644 --- a/lib/IRGen/GenStruct.cpp +++ b/lib/IRGen/GenStruct.cpp @@ -628,7 +628,7 @@ namespace { auto clangFnAddr = IGF.IGM.getAddrOfClangGlobalDecl(globalDecl, NotForDefinition); auto callee = cast(clangFnAddr->stripPointerCasts()); - Signature signature = IGF.IGM.getSignature(fnType); + Signature signature = IGF.IGM.getSignature(fnType, copyConstructor); std::string name = "__swift_cxx_copy_ctor" + callee->getName().str(); auto *origClangFnAddr = clangFnAddr; clangFnAddr = emitCXXConstructorThunkIfNeeded( diff --git a/lib/IRGen/IRGenModule.h b/lib/IRGen/IRGenModule.h index b02d70567b496..ef7a803032f9d 100644 --- a/lib/IRGen/IRGenModule.h +++ b/lib/IRGen/IRGenModule.h @@ -1513,10 +1513,13 @@ private: \ void finalizeClangCodeGen(); void finishEmitAfterTopLevel(); - Signature getSignature(CanSILFunctionType fnType); - Signature getSignature(CanSILFunctionType fnType, - FunctionPointerKind kind, - bool forStaticCall = false); + Signature + getSignature(CanSILFunctionType fnType, + const clang::CXXConstructorDecl *cxxCtorDecl = nullptr); + Signature + getSignature(CanSILFunctionType fnType, FunctionPointerKind kind, + bool forStaticCall = false, + const clang::CXXConstructorDecl *cxxCtorDecl = nullptr); llvm::FunctionType *getFunctionType(CanSILFunctionType type, llvm::AttributeList &attrs, ForeignFunctionInfo *foreignInfo=nullptr); diff --git a/lib/IRGen/IRGenSIL.cpp b/lib/IRGen/IRGenSIL.cpp index 9fe46a49b372c..5ec07d2f989d5 100644 --- a/lib/IRGen/IRGenSIL.cpp +++ b/lib/IRGen/IRGenSIL.cpp @@ -2892,8 +2892,13 @@ void IRGenSILFunction::visitFunctionRefBaseInst(FunctionRefBaseInst *i) { auto fnType = fn->getLoweredFunctionType(); auto fpKind = irgen::classifyFunctionPointerKind(fn); + const clang::CXXConstructorDecl *cxxCtorDecl = nullptr; - auto sig = IGM.getSignature(fnType, fpKind, true /*forStaticCall*/); + if (auto *clangFnDecl = fn->getClangDecl()) + cxxCtorDecl = dyn_cast(clangFnDecl); + + auto sig = + IGM.getSignature(fnType, fpKind, true /*forStaticCall*/, cxxCtorDecl); // Note that the pointer value returned by getAddrOfSILFunction doesn't // necessarily have element type sig.getType(), e.g. if it's imported. diff --git a/lib/IRGen/Signature.h b/lib/IRGen/Signature.h index ba10c45199684..878aa7d962999 100644 --- a/lib/IRGen/Signature.h +++ b/lib/IRGen/Signature.h @@ -31,6 +31,7 @@ namespace llvm { } namespace clang { + class CXXConstructorDecl; namespace CodeGen { class CGFunctionInfo; } @@ -202,9 +203,10 @@ class Signature { /// This is a private detail of the implementation of /// IRGenModule::getSignature(CanSILFunctionType), which is what /// clients should generally be using. - static Signature getUncached(IRGenModule &IGM, CanSILFunctionType formalType, - FunctionPointerKind kind, - bool forStaticCall = false); + static Signature + getUncached(IRGenModule &IGM, CanSILFunctionType formalType, + FunctionPointerKind kind, bool forStaticCall = false, + const clang::CXXConstructorDecl *cxxCtorDecl = nullptr); static SignatureExpansionABIDetails getUncachedABIDetails(IRGenModule &IGM, CanSILFunctionType formalType, diff --git a/test/AutoDiff/IRGen/runtime.swift b/test/AutoDiff/IRGen/runtime.swift index 8a753356212a8..51df2fe15005f 100644 --- a/test/AutoDiff/IRGen/runtime.swift +++ b/test/AutoDiff/IRGen/runtime.swift @@ -12,7 +12,7 @@ func test_context_builtins_with_type(t: T) { UnsafeMutableRawPointer(newBuffer).storeBytes(of: t, as: T.self) } -// CHECK-LABEL: define{{.*}}@test_context_builtins_with_type(ptr noalias nocapture %0, ptr %T) +// CHECK-LABEL: define{{.*}}@test_context_builtins_with_type(ptr noalias %0, ptr %T) // CHECK: entry: // CHECK: [[CTX:%.*]] = call swiftcc ptr @swift_autoDiffCreateLinearMapContextWithType(ptr %T) // CHECK: call swiftcc ptr @swift_autoDiffProjectTopLevelSubcontext(ptr [[CTX]]) diff --git a/test/DebugInfo/inlined-generics-basic.swift b/test/DebugInfo/inlined-generics-basic.swift index fe96e84013edb..42ebf137a0407 100644 --- a/test/DebugInfo/inlined-generics-basic.swift +++ b/test/DebugInfo/inlined-generics-basic.swift @@ -44,7 +44,7 @@ public class C { // SIL-LABEL: // C.f(_:) // IR-LABEL: define {{.*}} @"$s1A1CC1fyyqd__lF" - // IR-SAME: nocapture %[[ARG_0:.*]], {{.*}} %[[ARG_S:.*]], + // IR-SAME: %[[ARG_0:.*]], {{.*}} %[[ARG_S:.*]], #sourceLocation(file: "f.swift", line: 1) public func f(_ s: S) { // SIL: debug_value %0 : $*S, let, name "s", argno 1, expr op_deref, {{.*}} scope [[F]] diff --git a/test/DebugInfo/move_function_dbginfo.swift b/test/DebugInfo/move_function_dbginfo.swift index 02ff1d2a3c49b..b17a1963be400 100644 --- a/test/DebugInfo/move_function_dbginfo.swift +++ b/test/DebugInfo/move_function_dbginfo.swift @@ -218,7 +218,7 @@ public func copyableVarArgTest(_ k: inout Klass) { k.doSomething() } -// CHECK-LABEL: define swiftcc void @"$s21move_function_dbginfo20addressOnlyValueTestyyxAA1PRzlF"(ptr noalias nocapture %0, ptr %T, ptr %T.P) +// CHECK-LABEL: define swiftcc void @"$s21move_function_dbginfo20addressOnlyValueTestyyxAA1PRzlF"(ptr noalias %0, ptr %T, ptr %T.P) // CHECK: @llvm.dbg.addr(metadata ptr %{{.*}}, metadata ![[K_ADDR_LET_METADATA:[0-9]+]], metadata !DIExpression()), !dbg ![[ADDR_LOC:[0-9]*]] // CHECK-NEXT: br // CHECK: @llvm.dbg.value(metadata ptr undef, metadata ![[K_ADDR_LET_METADATA]], metadata !DIExpression()), !dbg ![[ADDR_LOC]] @@ -308,7 +308,7 @@ public func addressOnlyValueArgTest(_ k: __owned T) { m.doSomething() } -// CHECK-LABEL: define swiftcc void @"$s21move_function_dbginfo18addressOnlyVarTestyyxAA1PRzlF"(ptr noalias nocapture %0, ptr %T, ptr %T.P) +// CHECK-LABEL: define swiftcc void @"$s21move_function_dbginfo18addressOnlyVarTestyyxAA1PRzlF"(ptr noalias %0, ptr %T, ptr %T.P) // CHECK: @llvm.dbg.addr(metadata ptr %{{.*}}, metadata ![[K_ADDRONLY_VAR_METADATA:[0-9]+]], metadata !DIExpression()), !dbg ![[ADDR_LOC:[0-9]*]] // CHECK-NEXT: br // CHECK: @llvm.dbg.value(metadata ptr undef, metadata ![[K_ADDRONLY_VAR_METADATA]], metadata !DIExpression()), !dbg ![[ADDR_LOC]] diff --git a/test/DebugInfo/struct_resilience.swift b/test/DebugInfo/struct_resilience.swift index e1735721ceb50..40b558ea96fa4 100644 --- a/test/DebugInfo/struct_resilience.swift +++ b/test/DebugInfo/struct_resilience.swift @@ -11,8 +11,8 @@ // import resilient_struct -// CHECK-LABEL: define{{.*}} swiftcc void @"$s17struct_resilience9takesSizeyy010resilient_A00D0VF"(ptr noalias nocapture %0) -// CHECK-LLDB-LABEL: define{{.*}} swiftcc void @"$s17struct_resilience9takesSizeyy010resilient_A00D0VF"(ptr noalias nocapture dereferenceable({{8|16}}) %0) +// CHECK-LABEL: define{{.*}} swiftcc void @"$s17struct_resilience9takesSizeyy010resilient_A00D0VF"(ptr noalias %0) +// CHECK-LLDB-LABEL: define{{.*}} swiftcc void @"$s17struct_resilience9takesSizeyy010resilient_A00D0VF"(ptr noalias dereferenceable({{8|16}}) %0) public func takesSize(_ s: Size) {} diff --git a/test/Distributed/distributed_actor_accessor_thunks_64bit.swift b/test/Distributed/distributed_actor_accessor_thunks_64bit.swift index d170f9d77b4bd..2fde2462e2598 100644 --- a/test/Distributed/distributed_actor_accessor_thunks_64bit.swift +++ b/test/Distributed/distributed_actor_accessor_thunks_64bit.swift @@ -94,7 +94,7 @@ public distributed actor MyOtherActor { // CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple1yySiYaKFTE" -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple1yySiYaKFTETF"(ptr swiftasync %0, ptr nocapture %1, ptr %2, ptr %3, {{.*}}, ptr [[ACTOR:%.*]], ptr [[DECODER_TYPE:%.*]], ptr [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple1yySiYaKFTETF"(ptr swiftasync %0, ptr %1, ptr %2, ptr %3, {{.*}}, ptr [[ACTOR:%.*]], ptr [[DECODER_TYPE:%.*]], ptr [[DECODER_PROTOCOL_WITNESS:%.*]]) /// Read the current offset and cast an element to `Int` @@ -116,7 +116,7 @@ public distributed actor MyOtherActor { // CHECK: missing-witness1: // CHECK-NEXT: call void @llvm.trap() // CHECK-NEXT: unreachable -// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(ptr noalias nocapture sret(%swift.opaque) [[ARG_0_VALUE_BUF]], ptr %arg_type, ptr [[ENCODABLE_WITNESS]], ptr [[DECODABLE_WITNESS]], ptr swiftself [[DECODER]], ptr noalias nocapture swifterror dereferenceable(8) %swifterror) +// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(ptr noalias sret(%swift.opaque) [[ARG_0_VALUE_BUF]], ptr %arg_type, ptr [[ENCODABLE_WITNESS]], ptr [[DECODABLE_WITNESS]], ptr swiftself [[DECODER]], ptr noalias 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 @@ -192,7 +192,7 @@ public distributed actor MyOtherActor { // CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple3ySiSSYaKFTE" /// !!! in `simple3` interesting bits are: argument value extraction (because string is exploded into N arguments) and call to distributed thunk -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple3ySiSSYaKFTETF"(ptr swiftasync %0, ptr nocapture [[ARG_DECODER:%.*]], ptr [[ARG_TYPES:%.*]], ptr [[RESULT_BUFF:%.*]], ptr [[SUBS:%.*]], ptr [[WITNESS_TABLES:%.*]], i64 [[NUM_WITNESS_TABLES:%.*]], ptr [[ACTOR]], ptr [[DECODER_TYPE:%.*]], ptr [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7simple3ySiSSYaKFTETF"(ptr swiftasync %0, ptr [[ARG_DECODER:%.*]], ptr [[ARG_TYPES:%.*]], ptr [[RESULT_BUFF:%.*]], ptr [[SUBS:%.*]], ptr [[WITNESS_TABLES:%.*]], i64 [[NUM_WITNESS_TABLES:%.*]], ptr [[ACTOR]], ptr [[DECODER_TYPE:%.*]], ptr [[DECODER_PROTOCOL_WITNESS:%.*]]) // CHECK: [[ARG_SIZE:%.*]] = and i64 {{.*}}, -16 @@ -232,7 +232,7 @@ public distributed actor MyOtherActor { // CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC16single_case_enumyAA7SimpleEOAFYaKFTE" -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC16single_case_enumyAA7SimpleEOAFYaKFTETF"(ptr swiftasync %0, ptr nocapture [[ARG_DECODER:%.*]], ptr [[ARG_TYPES:%.*]], ptr [[RESULT_BUFF:%.*]], ptr [[SUBS:%.*]], ptr [[WITNESS_TABLES:%.*]], i64 [[NUM_WITNESS_TABLES:%.*]], ptr [[ACTOR]], ptr [[DECODER_TYPE]], ptr [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC16single_case_enumyAA7SimpleEOAFYaKFTETF"(ptr swiftasync %0, ptr [[ARG_DECODER:%.*]], ptr [[ARG_TYPES:%.*]], ptr [[RESULT_BUFF:%.*]], ptr [[SUBS:%.*]], ptr [[WITNESS_TABLES:%.*]], i64 [[NUM_WITNESS_TABLES:%.*]], ptr [[ACTOR]], ptr [[DECODER_TYPE]], ptr [[DECODER_PROTOCOL_WITNESS:%.*]]) /// Let's check that the call doesn't have any arguments and returns nothing. @@ -272,7 +272,7 @@ public distributed actor MyOtherActor { // CHECK: define hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7complexyAA11LargeStructVSaySiG_AA3ObjCSSSgAFtYaKFTE" -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7complexyAA11LargeStructVSaySiG_AA3ObjCSSSgAFtYaKFTETF"(ptr swiftasync {{.*}}, ptr nocapture [[ARG_DECODER:%.*]], ptr [[ARG_TYPES:%.*]], ptr [[RESULT_BUFF:%.*]], ptr [[SUBS:%.*]], ptr [[WITNESS_TABLES:%.*]], i64 [[NUM_WITNESS_TABLES:%.*]], ptr [[ACTOR]], ptr [[DECODER_TYPE:%.*]], ptr [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC7complexyAA11LargeStructVSaySiG_AA3ObjCSSSgAFtYaKFTETF"(ptr swiftasync {{.*}}, ptr [[ARG_DECODER:%.*]], ptr [[ARG_TYPES:%.*]], ptr [[RESULT_BUFF:%.*]], ptr [[SUBS:%.*]], ptr [[WITNESS_TABLES:%.*]], i64 [[NUM_WITNESS_TABLES:%.*]], ptr [[ACTOR]], ptr [[DECODER_TYPE:%.*]], ptr [[DECODER_PROTOCOL_WITNESS:%.*]]) /// First, let's check that all of the different argument types here are loaded correctly. @@ -319,7 +319,7 @@ public distributed actor MyOtherActor { /// ---> Accessor for `genericArgs` -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC11genericArgsyyx_Sayq_GtYaKSeRzSERzSeR_SER_r0_lFTETF"(ptr swiftasync %0, ptr nocapture [[ARG_DECODER:%.*]], ptr [[ARG_TYPES:%.*]], ptr [[RESULT_BUF:%.*]], ptr [[GENERIC_SUBS:%.*]], ptr [[WITNESS_TABLES:%.*]], i64 [[NUM_WITNESS_TABLES:%.*]], ptr [[ACTOR:%.*]], ptr [[DECODER_TYPE:%.*]], ptr [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors7MyActorC11genericArgsyyx_Sayq_GtYaKSeRzSERzSeR_SER_r0_lFTETF"(ptr swiftasync %0, ptr [[ARG_DECODER:%.*]], ptr [[ARG_TYPES:%.*]], ptr [[RESULT_BUF:%.*]], ptr [[GENERIC_SUBS:%.*]], ptr [[WITNESS_TABLES:%.*]], i64 [[NUM_WITNESS_TABLES:%.*]], ptr [[ACTOR:%.*]], ptr [[DECODER_TYPE:%.*]], ptr [[DECODER_PROTOCOL_WITNESS:%.*]]) /// ---> Load `T` @@ -368,7 +368,7 @@ public distributed actor MyOtherActor { /// Let's check that there is argument decoding since parameter list is empty -// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors12MyOtherActorC5emptyyyYaKFTETF"(ptr swiftasync {{.*}}, ptr nocapture [[ARG_DECODER:%.*]], ptr [[ARG_TYPES:%.*]], ptr [[RESULT_BUFF:%.*]], ptr [[SUBS:%.*]], ptr [[WITNESS_TABLES:%.*]], i64 [[NUM_WITNESS_TABLES:%.*]], ptr {{.*}}, ptr [[DECODER_TYPE:%.*]], ptr [[DECODER_PROTOCOL_WITNESS:%.*]]) +// CHECK: define linkonce_odr hidden swift{{(tail)?}}cc void @"$s27distributed_actor_accessors12MyOtherActorC5emptyyyYaKFTETF"(ptr swiftasync {{.*}}, ptr [[ARG_DECODER:%.*]], ptr [[ARG_TYPES:%.*]], ptr [[RESULT_BUFF:%.*]], ptr [[SUBS:%.*]], ptr [[WITNESS_TABLES:%.*]], i64 [[NUM_WITNESS_TABLES:%.*]], ptr {{.*}}, ptr [[DECODER_TYPE:%.*]], ptr [[DECODER_PROTOCOL_WITNESS:%.*]]) // CHECK-NEXT: entry: // CHECK-NEXT: {{.*}} = alloca ptr // CHECK-NEXT: %swifterror = alloca swifterror ptr diff --git a/test/IRGen/TestABIInaccessible.swift b/test/IRGen/TestABIInaccessible.swift index 29aea912c115b..a0a3a8346e913 100644 --- a/test/IRGen/TestABIInaccessible.swift +++ b/test/IRGen/TestABIInaccessible.swift @@ -8,7 +8,7 @@ public struct AnotherType { } // Don't pass the metadata of Private to AnotherType's outlined destroy. -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s4main4copyyAA11AnotherTypeVyxGAElF"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture %1, ptr %T) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s4main4copyyAA11AnotherTypeVyxGAElF"(ptr noalias sret({{.*}}) %0, ptr noalias %1, ptr %T) // CHECK: [[MD:%.*]] = call swiftcc %swift.metadata_response @"$s4main11AnotherTypeVMa"(i{{.*}} 0, ptr %T) // CHECK: [[MD1:%.*]] = extractvalue %swift.metadata_response [[MD]], 0 // CHECK: [[MD2:%.*]] = call swiftcc %swift.metadata_response @"$s4main6PublicVMa"(i{{.*}} 0, ptr %T) diff --git a/test/IRGen/archetype_resilience.sil b/test/IRGen/archetype_resilience.sil index 3f92aacf11b9e..e67f5382cc625 100644 --- a/test/IRGen/archetype_resilience.sil +++ b/test/IRGen/archetype_resilience.sil @@ -16,7 +16,7 @@ public enum EnumWithClassArchetypeAndDynamicSize { case B(Size) } -// CHECK-LABEL: define swiftcc void @copyDynamicMultiEnum(ptr %"EnumWithClassArchetypeAndDynamicSize", ptr %U, ptr noalias nocapture swiftself %0) +// CHECK-LABEL: define swiftcc void @copyDynamicMultiEnum(ptr %"EnumWithClassArchetypeAndDynamicSize", ptr %U, ptr noalias swiftself %0) // CHECK: call ptr @"$s20archetype_resilience36EnumWithClassArchetypeAndDynamicSizeOyxGRlzCr0_lWOc"(ptr %0, ptr {{.*}}, ptr %"EnumWithClassArchetypeAndDynamicSize") // CHECK: ret void sil [ossa] @copyDynamicMultiEnum : $@convention(method) (@in_guaranteed EnumWithClassArchetypeAndDynamicSize) -> () { diff --git a/test/IRGen/argument_attrs.sil b/test/IRGen/argument_attrs.sil index cd2972d128e32..ee82eb7eb4ddb 100644 --- a/test/IRGen/argument_attrs.sil +++ b/test/IRGen/argument_attrs.sil @@ -4,49 +4,49 @@ import Builtin struct Huge { var x, y, z, w, a, b, c, d, e, f: Builtin.Int32 } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def(ptr nocapture dereferenceable(4) %0, ptr noalias nocapture dereferenceable(4) %1, ptr noalias nocapture dereferenceable(4) %2, ptr noalias nocapture dereferenceable(40) %3, ptr noalias nocapture %4, ptr noalias nocapture %5, ptr %T) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def(ptr nocapture dereferenceable(4) %0, ptr noalias nocapture dereferenceable(4) %1, ptr noalias nocapture dereferenceable(4) %2, ptr noalias nocapture dereferenceable(40) %3, ptr noalias %4, ptr noalias nocapture %5, ptr %T) sil @arguments_in_def : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () { entry(%1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*Builtin.Int32, %4 : $Huge, %5 : $*T, %6 : $*()): - // CHECK: call swiftcc void @arguments_in_decl(ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias nocapture {{%.*}}, ptr noalias nocapture {{%.*}}, ptr %T) + // CHECK: call swiftcc void @arguments_in_decl(ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias nocapture {{%.*}}, ptr %T) %f = function_ref @arguments_in_decl : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () %x = apply %f(%1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () - // CHECK: call swiftcc void @arguments_in_def(ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias nocapture {{%.*}}, ptr noalias nocapture {{%.*}}, ptr %T) + // CHECK: call swiftcc void @arguments_in_def(ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias nocapture {{%.*}}, ptr %T) %g = function_ref @arguments_in_def : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () %y = apply %g(%1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () return undef : $() } -// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl(ptr nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(40), ptr noalias nocapture, ptr noalias nocapture, ptr) +// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl(ptr nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) sil @arguments_in_decl : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> () -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_out(ptr noalias nocapture sret({{.*}}) %0, ptr nocapture dereferenceable(4) %1, ptr noalias nocapture dereferenceable(4) %2, ptr noalias nocapture dereferenceable(4) %3, ptr noalias nocapture dereferenceable(40) %4, ptr noalias nocapture %5, ptr noalias nocapture %6, ptr %T) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_out(ptr noalias nocapture sret({{.*}}) %0, ptr nocapture dereferenceable(4) %1, ptr noalias nocapture dereferenceable(4) %2, ptr noalias nocapture dereferenceable(4) %3, ptr noalias nocapture dereferenceable(40) %4, ptr noalias %5, ptr noalias nocapture %6, ptr %T) sil @arguments_in_def_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 { entry(%0 : $*Builtin.Int32, %1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*Builtin.Int32, %4 : $Huge, %5 : $*T, %6 : $*()): - // CHECK: call swiftcc void @arguments_in_decl_out(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias nocapture {{%.*}}, ptr noalias nocapture {{%.*}}, ptr {{%.*}}) + // CHECK: call swiftcc void @arguments_in_decl_out(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias nocapture {{%.*}}, ptr {{%.*}}) %f = function_ref @arguments_in_decl_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 %x = apply %f(%0, %1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 - // CHECK: call swiftcc void @arguments_in_def_out(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias nocapture {{%.*}}, ptr noalias nocapture {{%.*}}, ptr {{%.*}}) + // CHECK: call swiftcc void @arguments_in_def_out(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias nocapture {{%.*}}, ptr {{%.*}}) %g = function_ref @arguments_in_def_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 %y = apply %g(%0, %1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 return undef : $() } -// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_out(ptr noalias nocapture sret({{.*}}), ptr nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(40), ptr noalias nocapture, ptr noalias nocapture, ptr) +// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_out(ptr noalias nocapture sret({{.*}}), ptr nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) sil @arguments_in_decl_out : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> @out Builtin.Int32 -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_huge_ret(ptr noalias nocapture sret({{.*}}) %0, ptr nocapture dereferenceable(4) %1, ptr noalias nocapture dereferenceable(4) %2, ptr noalias nocapture dereferenceable(4) %3, ptr noalias nocapture dereferenceable(40) %4, ptr noalias nocapture %5, ptr noalias nocapture %6, ptr %T) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @arguments_in_def_huge_ret(ptr noalias nocapture sret({{.*}}V) %0, ptr nocapture dereferenceable(4) %1, ptr noalias nocapture dereferenceable(4) %2, ptr noalias nocapture dereferenceable(4) %3, ptr noalias nocapture dereferenceable(40) %4, ptr noalias %5, ptr noalias nocapture %6, ptr %T) sil @arguments_in_def_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge { entry(%1 : $*Builtin.Int32, %2 : $*Builtin.Int32, %3 : $*Builtin.Int32, %4 : $Huge, %5 : $*T, %6 : $*()): %f = function_ref @arguments_in_decl_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge - // CHECK: call swiftcc void @arguments_in_decl_huge_ret(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias nocapture {{%.*}}, ptr noalias nocapture {{%.*}}, ptr {{%.*}}) + // CHECK: call swiftcc void @arguments_in_decl_huge_ret(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias nocapture {{%.*}}, ptr {{%.*}}) %x = apply %f(%1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge - // CHECK: call swiftcc void @arguments_in_def_huge_ret(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias nocapture {{%.*}}, ptr noalias nocapture {{%.*}}, ptr {{%.*}}) + // CHECK: call swiftcc void @arguments_in_def_huge_ret(ptr noalias nocapture sret({{.*}}) {{%.*}}, ptr nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(4) {{%.*}}, ptr noalias nocapture dereferenceable(40) {{%.*}}, ptr noalias {{%.*}}, ptr noalias nocapture {{%.*}}, ptr {{%.*}}) %g = function_ref @arguments_in_def_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge %y = apply %g(%1, %2, %3, %4, %5, %6) : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge return %y : $Huge } -// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_huge_ret(ptr noalias nocapture sret({{.*}}), ptr nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(40), ptr noalias nocapture, ptr noalias nocapture, ptr) +// CHECK-LABEL: declare{{( dllimport)?}} swiftcc void @arguments_in_decl_huge_ret(ptr noalias nocapture sret({{.*}}), ptr nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(4), ptr noalias nocapture dereferenceable(40), ptr noalias, ptr noalias nocapture, ptr) sil @arguments_in_decl_huge_ret : $@convention(thin) (@inout Builtin.Int32, @in Builtin.Int32, @in_guaranteed Builtin.Int32, Huge, @in T, @in ()) -> Huge diff --git a/test/IRGen/associated_types.swift b/test/IRGen/associated_types.swift index e62d22240952b..b1e6d45abff82 100644 --- a/test/IRGen/associated_types.swift +++ b/test/IRGen/associated_types.swift @@ -30,7 +30,7 @@ struct Owl { class Pussycat { init() {} - // CHECK: define hidden swiftcc void @"$s16associated_types8PussycatC3eat{{[_0-9a-zA-Z]*}}F"(ptr noalias nocapture %0, ptr noalias nocapture %1, ptr noalias nocapture %2, ptr swiftself %3) + // CHECK: define hidden swiftcc void @"$s16associated_types8PussycatC3eat{{[_0-9a-zA-Z]*}}F"(ptr noalias %0, ptr noalias %1, ptr noalias %2, ptr swiftself %3) func eat(_ what: T.RuncerType.Runcee, and: T.RuncerType, with: T) { } } @@ -71,7 +71,7 @@ func testFastRuncible(_ t: T, u: U) U.RuncerType.Runcee.accelerate() } -// CHECK: define hidden swiftcc void @"$s16associated_types16testFastRuncible_1uyx_q_tAA0E0RzAA0dE0R_10RuncerTypeQy_AFRtzr0_lF"(ptr noalias nocapture %0, ptr noalias nocapture %1, ptr %T, ptr %U, ptr %T.Runcible, ptr %U.FastRuncible) {{.*}} { +// CHECK: define hidden swiftcc void @"$s16associated_types16testFastRuncible_1uyx_q_tAA0E0RzAA0dE0R_10RuncerTypeQy_AFRtzr0_lF"(ptr noalias %0, ptr noalias %1, ptr %T, ptr %U, ptr %T.Runcible, ptr %U.FastRuncible) {{.*}} { // 1. Get the type metadata for U.RuncerType.Runcee. // 1a. Get the type metadata for U.RuncerType. // Note that we actually look things up in T, which is going to prove unfortunate. diff --git a/test/IRGen/async/builtins.sil b/test/IRGen/async/builtins.sil index 2444150be4697..fd054fc195f6b 100644 --- a/test/IRGen/async/builtins.sil +++ b/test/IRGen/async/builtins.sil @@ -141,7 +141,7 @@ bb0: // CHECK-LABEL: define{{.*}} swiftcc void @testRunInline( -// CHECK-SAME: ptr noalias nocapture sret(%swift.opaque) [[RESULT:%[^,]+]], +// CHECK-SAME: ptr noalias sret(%swift.opaque) [[RESULT:%[^,]+]], // CHECK-SAME: ptr [[CLOSURE:%[^,]+]], // CHECK-SAME: ptr [[CLOSURE_CONTEXT:%[^,]+]], // CHECK-SAME: ptr [[FUTURE_RESULT_TYPE:%[^,]+]]) diff --git a/test/IRGen/async/class_resilience.swift b/test/IRGen/async/class_resilience.swift index 669944dbf785a..77857cbf8e7ad 100644 --- a/test/IRGen/async/class_resilience.swift +++ b/test/IRGen/async/class_resilience.swift @@ -41,7 +41,7 @@ open class MyBaseClass { // CHECK-LABEL: @"$s16class_resilience9MyDerivedCMn" = hidden constant // CHECK-SAME: ptr @"$s16class_resilience9MyDerivedC4waitSiyYaF010resilient_A09BaseClassCADxyYaFTVTu" -// CHECK-LABEL: define {{(dllexport )?}}{{(protected )?}}swift{{(tail)?}}cc void @"$s16class_resilience14callsAwaitableyx010resilient_A09BaseClassCyxGYalF"(ptr noalias nocapture %0, ptr swiftasync %1{{.*}}) +// CHECK-LABEL: define {{(dllexport )?}}{{(protected )?}}swift{{(tail)?}}cc void @"$s16class_resilience14callsAwaitableyx010resilient_A09BaseClassCyxGYalF"(ptr noalias %0, ptr swiftasync %1{{.*}}) // CHECK-DIRECT: ptr @"$s15resilient_class9BaseClassC4waitxyYaFTjTu" // CHECK-INDIRECT: [[LOAD:%[0-9]+]] = load ptr, ptr inttoptr (i64 and (i64 add (i64 ptrtoint (ptr @"\01__imp_$s15resilient_class9BaseClassC4waitxyYaFTjTu" to i64), i64 1), i64 -2) to ptr), align {{4|8}} // CHECK-INDIRECT-NEXT: select i1 icmp eq (i64 and (i64 add (i64 ptrtoint (ptr @"\01__imp_$s15resilient_class9BaseClassC4waitxyYaFTjTu" to i64), i64 1), i64 1), i64 0), @@ -52,7 +52,7 @@ public func callsAwaitable(_ c: BaseClass) async -> T { return await c.wait() } -// CHECK-LABEL: define {{(dllexport )?}}{{(protected )?}}swift{{(tail)?}}cc void @"$s16class_resilience11MyBaseClassC4waitxyYaFTj"(ptr noalias nocapture %0, ptr swiftasync %1, ptr swiftself %2) {{#([0-9]+)}} { +// CHECK-LABEL: define {{(dllexport )?}}{{(protected )?}}swift{{(tail)?}}cc void @"$s16class_resilience11MyBaseClassC4waitxyYaFTj"(ptr noalias %0, ptr swiftasync %1, ptr swiftself %2) {{#([0-9]+)}} { class MyDerived : BaseClass { override func wait() async -> Int { diff --git a/test/IRGen/async/protocol_resilience.swift b/test/IRGen/async/protocol_resilience.swift index 758533cf65ce8..c91a7d61297cb 100644 --- a/test/IRGen/async/protocol_resilience.swift +++ b/test/IRGen/async/protocol_resilience.swift @@ -26,7 +26,7 @@ public protocol MyAwaitable { // CHECK-LABEL: @"$s19protocol_resilience19ConformsToAwaitableVyxG010resilient_A00E0AAMc" = hidden constant // CHECK-SAME: ptr @"$s19protocol_resilience19ConformsToAwaitableVyxG010resilient_A00E0AaeFP4wait6ResultQzyYaFTWTu" -// CHECK-LABEL: define {{(dllexport )?}}{{(protected )?}}swift{{(tail)?}}cc void @"$s19protocol_resilience14callsAwaitabley6ResultQzxYa010resilient_A00D0RzlF"(ptr noalias nocapture %0, ptr swiftasync %1, ptr noalias nocapture %2, ptr %T, ptr %T.Awaitable) +// CHECK-LABEL: define {{(dllexport )?}}{{(protected )?}}swift{{(tail)?}}cc void @"$s19protocol_resilience14callsAwaitabley6ResultQzxYa010resilient_A00D0RzlF"(ptr noalias %0, ptr swiftasync %1, ptr noalias %2, ptr %T, ptr %T.Awaitable) // CHECK-DIRECT: ptr @"$s18resilient_protocol9AwaitableP4wait6ResultQzyYaFTjTu" // CHECK-INDIRECT: [[LOAD:%[0-9]+]] = load ptr, ptr inttoptr (i64 and (i64 add (i64 ptrtoint (ptr @"\01__imp_$s18resilient_protocol9AwaitableP4wait6ResultQzyYaFTjTu" to i64), i64 1), i64 -2) to ptr), align {{4|8}} // CHECK-INDIRECT: select i1 icmp eq (i64 and (i64 add (i64 ptrtoint (ptr @"\01__imp_$s18resilient_protocol9AwaitableP4wait6ResultQzyYaFTjTu" to i64), i64 1), i64 1), i64 0), @@ -37,7 +37,7 @@ public func callsAwaitable(_ t: T) async -> T.Result { return await t.wait() } -// CHECK-LABEL: define {{(dllexport )?}}{{(protected )?}}swift{{(tail)?}}cc void @"$s19protocol_resilience11MyAwaitableP4wait6ResultQzyYaFTj"(ptr noalias nocapture %0, ptr swiftasync %1, ptr noalias nocapture swiftself %2, ptr %3, ptr %4) +// CHECK-LABEL: define {{(dllexport )?}}{{(protected )?}}swift{{(tail)?}}cc void @"$s19protocol_resilience11MyAwaitableP4wait6ResultQzyYaFTj"(ptr noalias %0, ptr swiftasync %1, ptr noalias swiftself %2, ptr %3, ptr %4) struct ConformsToAwaitable : Awaitable { var value: T diff --git a/test/IRGen/big_types_corner_cases.swift b/test/IRGen/big_types_corner_cases.swift index f67fcc00dfeac..bfae61ac71aee 100644 --- a/test/IRGen/big_types_corner_cases.swift +++ b/test/IRGen/big_types_corner_cases.swift @@ -66,7 +66,7 @@ public func f3_uses_f2() { } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases10f3_uses_f2yyF"() -// CHECK: call swiftcc void @"$s22big_types_corner_cases9BigStructVACycfC"(ptr noalias nocapture sret({{.*}}) +// CHECK: call swiftcc void @"$s22big_types_corner_cases9BigStructVACycfC"(ptr noalias nocapture sret({{.*}}) // CHECK: call swiftcc { ptr, ptr } @"$s22big_types_corner_cases13f2_returns_f1AA9BigStructVADcyF"() // CHECK: call swiftcc void {{.*}}(ptr noalias nocapture sret({{.*}}) {{.*}}, ptr noalias nocapture dereferenceable({{.*}}) {{.*}}, ptr swiftself {{.*}}) // CHECK: ret void @@ -96,7 +96,7 @@ public class BigClass { } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} hidden swiftcc void @"$s22big_types_corner_cases8BigClassC03useE6Struct0aH0yAA0eH0V_tF"(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr swiftself %1) -// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr swiftself +// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture dereferenceable({{.*}}) %0, ptr swiftself // CHECK: ret void public struct MyStruct { @@ -178,8 +178,8 @@ public struct MUseStruct { internal let callInternalLet: () -> BigStruct? } -// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases18stringAndSubstringSS_s0G0VtyF"(ptr noalias nocapture sret({{.*}}) %0) #0 { -// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases18stringAndSubstringSS_s0G0VtyF"(ptr noalias nocapture sret({{.*}}) %0) #0 { +// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases18stringAndSubstringSS_s0G0VtyF"(ptr noalias sret({{.*}}) %0) #0 { +// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases18stringAndSubstringSS_s0G0VtyF"(ptr noalias sret({{.*}}) %0) #0 { // CHECK: alloca %TSs // CHECK: alloca %TSs // CHECK: ret void @@ -202,7 +202,7 @@ public func testGetFunc() { // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} hidden swiftcc void @"$s22big_types_corner_cases7TestBigC4testyyF"(ptr swiftself %0) // CHECK: [[CALL1:%.*]] = call {{.*}} @__swift_instantiateConcreteTypeFromMangledName({{.*}} @"$sSayy22big_types_corner_cases9BigStructVcSgGMD" // CHECK: [[CALL2:%.*]] = call ptr @"$sSayy22big_types_corner_cases9BigStructVcSgGSayxGSlsWl -// CHECK: call swiftcc void @"$sSlsE10firstIndex5where0B0QzSgSb7ElementQzKXE_tKF"(ptr noalias nocapture sret({{.*}}) %{{[0-9]+}}, ptr @"$s22big_types_corner_cases7TestBig{{.*}}", ptr null, ptr %{{[0-9]+}}, ptr [[CALL2]] +// CHECK: call swiftcc void @"$sSlsE10firstIndex5where0B0QzSgSb7ElementQzKXE_tKF"(ptr noalias sret({{.*}}) %{{[0-9]+}}, ptr @"$s22big_types_corner_cases7TestBig{{.*}}", ptr null, ptr %{{[0-9]+}}, ptr [[CALL2]] class TestBig { typealias Handler = (BigStruct) -> Void @@ -286,8 +286,8 @@ public protocol QueryHandler: ProtoQueryHandler { public extension QueryHandler { -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_15queryyqd___tAA0E0Rd__lF"(ptr noalias nocapture %0, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %1) -// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture {{.*}}, ptr swiftself {{.*}}) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_15queryyqd___tAA0E0Rd__lF"(ptr noalias %0, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias swiftself %1) +// CHECK: call swiftcc void {{.*}}(ptr noalias {{.*}}, ptr swiftself {{.*}}) // CHECK: ret void func forceHandle_1(query: Q) -> Void { guard let body = handle_1 as? (Q) -> Void else { @@ -296,9 +296,9 @@ public extension QueryHandler { body(query) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_25query8ReturnedQyd___AA9BigStructVSgtqd___tAA0E0Rd__lF"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture %1, ptr noalias nocapture %2, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %3) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_25query8ReturnedQyd___AA9BigStructVSgtqd___tAA0E0Rd__lF"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias %1, ptr noalias %2, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias swiftself %3) // CHECK: [[ALLOC:%.*]] = alloca %T22big_types_corner_cases9BigStructVSg -// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture sret({{.*}}) [[ALLOC]], ptr noalias nocapture {{.*}}, ptr noalias nocapture {{.*}}, ptr swiftself {{.*}}) +// CHECK: call swiftcc void {{.*}}(ptr noalias nocapture sret({{.*}}) [[ALLOC]], ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}) // CHECK: ret void func forceHandle_2(query: Q) -> (Q.Returned, BigStruct?) { guard let body = handle_2 as? (Q) -> (Q.Returned, BigStruct?) else { @@ -307,12 +307,12 @@ public extension QueryHandler { return body(query) } -// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_35query8ReturnedQyd___SbAA9BigStructVcSgtqd___tAA0E0Rd__lF"(ptr noalias nocapture %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2) -// CHECK-64: {{.*}} = call swiftcc { i64, i64 } {{.*}}(ptr noalias nocapture {{.*}}, ptr noalias nocapture {{.*}}, ptr swiftself {{.*}}) +// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_35query8ReturnedQyd___SbAA9BigStructVcSgtqd___tAA0E0Rd__lF"(ptr noalias %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2) +// CHECK-64: {{.*}} = call swiftcc { i64, i64 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}) // CHECK-64: ret { i64, i64 } -// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_35query8ReturnedQyd___SbAA9BigStructVcSgtqd___tAA0E0Rd__lF"(ptr noalias nocapture %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2) -// CHECK-32: {{.*}} = call swiftcc { i32, i32 } {{.*}}(ptr noalias nocapture {{.*}}, ptr noalias nocapture {{.*}}, ptr swiftself {{.*}}) +// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_35query8ReturnedQyd___SbAA9BigStructVcSgtqd___tAA0E0Rd__lF"(ptr noalias %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2) +// CHECK-32: {{.*}} = call swiftcc { i32, i32 } {{.*}}(ptr noalias {{.*}}, ptr noalias nocapture {{.*}}, ptr swiftself {{.*}}) // CHECK-32: ret { i32, i32 } func forceHandle_3(query: Q) -> (Q.Returned, Filter?) { guard let body = handle_3 as? (Q) -> (Q.Returned, Filter?) else { @@ -321,12 +321,12 @@ public extension QueryHandler { return body(query) } -// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0E0Rd__lF"(ptr noalias nocapture %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2, ptr swifterror %3) -// CHECK-64: {{.*}} = call swiftcc { i64, i64 } {{.*}}(ptr noalias nocapture {{.*}}, ptr noalias nocapture {{.*}}, ptr swiftself {{.*}}, ptr noalias nocapture swifterror {{.*}}) +// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0E0Rd__lF"(ptr noalias %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2, ptr swifterror %3) +// CHECK-64: {{.*}} = call swiftcc { i64, i64 } {{.*}}(ptr noalias {{.*}}, ptr noalias {{.*}}, ptr swiftself {{.*}}, ptr noalias nocapture swifterror {{.*}}) // CHECK-64: ret { i64, i64 } -// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0E0Rd__lF"(ptr noalias nocapture %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2, ptr swifterror %3) -// CHECK-32: {{.*}} = call swiftcc { i32, i32 } {{.*}}(ptr noalias nocapture {{.*}}, ptr noalias nocapture {{.*}}, ptr swiftself {{.*}}, ptr noalias nocapture {{.*}}) +// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$s22big_types_corner_cases12QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0E0Rd__lF"(ptr noalias %0, ptr noalias nocapture %1, ptr{{.*}}, ptr{{.*}}, ptr {{.*}}.QueryHandler, ptr {{.*}}.Query, ptr noalias nocapture swiftself %2, ptr swifterror %3) +// CHECK-32: {{.*}} = call swiftcc { i32, i32 } {{.*}}(ptr noalias {{.*}}, ptr noalias nocapture {{.*}}, ptr swiftself {{.*}}, ptr noalias nocapture {{.*}}) // CHECK-32: ret { i32, i32 } func forceHandle_4(query: Q) throws -> (Q.Returned, Filter?) { guard let body = handle_4 as? (Q) throws -> (Q.Returned, Filter?) else { diff --git a/test/IRGen/boxed_existential.sil b/test/IRGen/boxed_existential.sil index ea5e21eaae11a..9fcac60aed3d6 100644 --- a/test/IRGen/boxed_existential.sil +++ b/test/IRGen/boxed_existential.sil @@ -18,7 +18,7 @@ entry(%e : $Error): return undef : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @alloc_boxed_existential(ptr noalias nocapture %0, ptr %T, ptr %T.Error) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @alloc_boxed_existential(ptr noalias %0, ptr %T, ptr %T.Error) sil @alloc_boxed_existential : $@convention(thin) (@in T) -> @owned Error { entry(%x : $*T): // CHECK: [[BOX_PAIR:%.*]] = call swiftcc { ptr, ptr } @swift_allocError(ptr %T, ptr %T.Error, ptr null, i1 false) diff --git a/test/IRGen/builtins.swift b/test/IRGen/builtins.swift index 24fd75fe0754c..1d5ecf9da4994 100644 --- a/test/IRGen/builtins.swift +++ b/test/IRGen/builtins.swift @@ -449,7 +449,7 @@ func destroyNonPODArray(_ array: Builtin.RawPointer, count: Builtin.Word) { Builtin.destroyArray(C.self, array, count) } -// CHECK-LABEL: define hidden {{.*}}void @"$s8builtins15destroyGenArray_5count_yBp_BwxtlF"(ptr %0, i64 %1, ptr noalias nocapture %2, ptr %T) +// CHECK-LABEL: define hidden {{.*}}void @"$s8builtins15destroyGenArray_5count_yBp_BwxtlF"(ptr %0, i64 %1, ptr noalias %2, ptr %T) // CHECK-NOT: loop: // CHECK: call void @swift_arrayDestroy func destroyGenArray(_ array: Builtin.RawPointer, count: Builtin.Word, _: T) { @@ -527,7 +527,7 @@ func copyNonPODArray(_ dest: Builtin.RawPointer, src: Builtin.RawPointer, count: Builtin.assignTakeArray(W.self, dest, src, count) } -// CHECK-LABEL: define hidden {{.*}}void @"$s8builtins12copyGenArray{{[_0-9a-zA-Z]*}}F"(ptr %0, ptr %1, i64 %2, ptr noalias nocapture %3, ptr %T) +// CHECK-LABEL: define hidden {{.*}}void @"$s8builtins12copyGenArray{{[_0-9a-zA-Z]*}}F"(ptr %0, ptr %1, i64 %2, ptr noalias %3, ptr %T) // CHECK-NOT: loop: // CHECK: call void @swift_arrayInitWithCopy // CHECK-NOT: loop: diff --git a/test/IRGen/class_bounded_generics.swift b/test/IRGen/class_bounded_generics.swift index 850bbd9a225fc..ecb5d56460187 100644 --- a/test/IRGen/class_bounded_generics.swift +++ b/test/IRGen/class_bounded_generics.swift @@ -113,7 +113,7 @@ func call_class_bounded_archetype(_ x: ConcreteClass) -> ConcreteClass { // CHECK: ret ptr [[OUT_ORIG]] } -// CHECK: define hidden swiftcc void @"$s22class_bounded_generics04not_a1_B10_archetype{{[_0-9a-zA-Z]*}}F"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture %1, ptr %T, ptr %T.NotClassBound) +// CHECK: define hidden swiftcc void @"$s22class_bounded_generics04not_a1_B10_archetype{{[_0-9a-zA-Z]*}}F"(ptr noalias sret({{.*}}) %0, ptr noalias %1, ptr %T, ptr %T.NotClassBound) func not_class_bounded_archetype(_ x: T) -> T { return x } diff --git a/test/IRGen/class_resilience_thunks.swift b/test/IRGen/class_resilience_thunks.swift index 7b1b26d9e4667..52f1a8ee21532 100644 --- a/test/IRGen/class_resilience_thunks.swift +++ b/test/IRGen/class_resilience_thunks.swift @@ -6,10 +6,10 @@ import resilient_class_thunks -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s23class_resilience_thunks21testDispatchThunkBase1b1ty010resilient_a1_C00G0CyxG_xtlF"(ptr %0, ptr noalias nocapture %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s23class_resilience_thunks21testDispatchThunkBase1b1ty010resilient_a1_C00G0CyxG_xtlF"(ptr %0, ptr noalias %1) public func testDispatchThunkBase(b: Base, t: T) { - // CHECK: call swiftcc void @"$s22resilient_class_thunks4BaseC6takesTyyxFTj"(ptr noalias nocapture {{%.*}}, ptr swiftself %0) + // CHECK: call swiftcc void @"$s22resilient_class_thunks4BaseC6takesTyyxFTj"(ptr noalias {{%.*}}, ptr swiftself %0) b.takesT(t) // CHECK: call swiftcc void @"$s22resilient_class_thunks4BaseC8takesIntyySiFTj"([[INT]] 0, ptr swiftself %0) @@ -24,7 +24,7 @@ public func testDispatchThunkBase(b: Base, t: T) { // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s23class_resilience_thunks24testDispatchThunkDerived1dy010resilient_a1_C00G0C_tF"(ptr %0) public func testDispatchThunkDerived(d: Derived) { - // CHECK: call swiftcc void @"$s22resilient_class_thunks4BaseC6takesTyyxFTj"(ptr noalias nocapture {{%.*}}, ptr swiftself {{%.*}}) + // CHECK: call swiftcc void @"$s22resilient_class_thunks4BaseC6takesTyyxFTj"(ptr noalias {{%.*}}, ptr swiftself {{%.*}}) d.takesT(0) // CHECK: call swiftcc void @"$s22resilient_class_thunks7DerivedC8takesIntyySiSgFTj"([[INT]] 0, i8 1, ptr swiftself %0) diff --git a/test/IRGen/closure.swift b/test/IRGen/closure.swift index 03912171f727e..e4401af6ad20c 100644 --- a/test/IRGen/closure.swift +++ b/test/IRGen/closure.swift @@ -31,7 +31,7 @@ func b(seq seq: T) -> (Int) -> Int { // CHECK: } // -- Closure entry point -// CHECK: define internal swiftcc i64 @"$s7closure1b3seqS2icx_tAA9OrdinableRzlFS2icfU_"(i64 %0, ptr noalias nocapture %1, ptr %T, ptr %T.Ordinable) {{.*}} { +// CHECK: define internal swiftcc i64 @"$s7closure1b3seqS2icx_tAA9OrdinableRzlFS2icfU_"(i64 %0, ptr noalias %1, ptr %T, ptr %T.Ordinable) {{.*}} { // -- partial_apply stub // CHECK: define internal swiftcc i64 @"$s7closure1b3seqS2icx_tAA9OrdinableRzlFS2icfU_TA"(i64 %0, ptr swiftself %1) {{.*}} { @@ -40,12 +40,12 @@ func b(seq seq: T) -> (Int) -> Int { // 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 -// CHECK: [[RES:%.*]] = tail call swiftcc i64 @"$s7closure1b3seqS2icx_tAA9OrdinableRzlFS2icfU_"(i64 %0, ptr noalias nocapture {{.*}}, ptr [[TYPE]], ptr [[WITNESS]]) +// CHECK: [[RES:%.*]] = tail call swiftcc i64 @"$s7closure1b3seqS2icx_tAA9OrdinableRzlFS2icfU_"(i64 %0, ptr noalias {{.*}}, ptr [[TYPE]], ptr [[WITNESS]]) // CHECK: ret i64 [[RES]] // CHECK: } // -- Boxing of tuples with generic elements -// CHECK: define hidden swiftcc { ptr, ptr } @"$s7closure14captures_tuple1xx_q_tycx_q_t_tr0_lF"(ptr noalias nocapture %0, ptr noalias nocapture %1, ptr %T, ptr %U) +// CHECK: define hidden swiftcc { ptr, ptr } @"$s7closure14captures_tuple1xx_q_tycx_q_t_tr0_lF"(ptr noalias %0, ptr noalias %1, ptr %T, ptr %U) func captures_tuple(x x: (T, U)) -> () -> (T, U) { // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @swift_getTupleTypeMetadata2(i64 0, ptr %T, ptr %U, ptr null, ptr null) // CHECK-NEXT: [[METADATA:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 diff --git a/test/IRGen/conformance_resilience.swift b/test/IRGen/conformance_resilience.swift index 5a1fc4b996bae..0ffa3063841db 100644 --- a/test/IRGen/conformance_resilience.swift +++ b/test/IRGen/conformance_resilience.swift @@ -5,24 +5,24 @@ import resilient_protocol -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22conformance_resilience14useConformanceyyx18resilient_protocol22OtherResilientProtocolRzlF"(ptr noalias nocapture %0, ptr %T, ptr %T.OtherResilientProtocol) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22conformance_resilience14useConformanceyyx18resilient_protocol22OtherResilientProtocolRzlF"(ptr noalias %0, ptr %T, ptr %T.OtherResilientProtocol) public func useConformance(_: T) {} -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22conformance_resilience14getConformanceyy18resilient_protocol7WrapperVyxGlF"(ptr noalias nocapture %0, ptr %T) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22conformance_resilience14getConformanceyy18resilient_protocol7WrapperVyxGlF"(ptr noalias %0, ptr %T) public func getConformance(_ w: Wrapper) { // CHECK: [[RESPONSE:%.*]] = call swiftcc %swift.metadata_response @"$s18resilient_protocol7WrapperVMa"([[INT]] 0, ptr %T) // CHECK: [[META:%.*]] = extractvalue %swift.metadata_response [[RESPONSE]], 0 // CHECK: [[WTABLE:%.*]] = call ptr @swift_getWitnessTable(ptr @"$s18resilient_protocol7WrapperVyxGAA22OtherResilientProtocolAAMc", ptr [[META]], ptr undef) - // CHECK: call swiftcc void @"$s22conformance_resilience14useConformanceyyx18resilient_protocol22OtherResilientProtocolRzlF"(ptr noalias nocapture %0, ptr [[META]], ptr [[WTABLE]]) + // CHECK: call swiftcc void @"$s22conformance_resilience14useConformanceyyx18resilient_protocol22OtherResilientProtocolRzlF"(ptr noalias %0, ptr [[META]], ptr [[WTABLE]]) // CHECK: ret void useConformance(w) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22conformance_resilience14getConformanceyy18resilient_protocol15ConcreteWrapperVF"(ptr noalias nocapture %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s22conformance_resilience14getConformanceyy18resilient_protocol15ConcreteWrapperVF"(ptr noalias %0) public func getConformance(_ w: ConcreteWrapper) { // CHECK: [[RESPONSE:%.*]] = call swiftcc %swift.metadata_response @"$s18resilient_protocol15ConcreteWrapperVMa"([[INT]] 0) // CHECK: [[META:%.*]] = extractvalue %swift.metadata_response [[RESPONSE]], 0 - // CHECK: call swiftcc void @"$s22conformance_resilience14useConformanceyyx18resilient_protocol22OtherResilientProtocolRzlF"(ptr noalias nocapture %0, ptr [[META]], ptr @"$s18resilient_protocol15ConcreteWrapperVAA22OtherResilientProtocolAAWP") + // CHECK: call swiftcc void @"$s22conformance_resilience14useConformanceyyx18resilient_protocol22OtherResilientProtocolRzlF"(ptr noalias %0, ptr [[META]], ptr @"$s18resilient_protocol15ConcreteWrapperVAA22OtherResilientProtocolAAWP") // CHECK: ret void useConformance(w) } diff --git a/test/IRGen/dynamic_self_cast.swift b/test/IRGen/dynamic_self_cast.swift index 79dc4e962578a..da6e67d24372a 100644 --- a/test/IRGen/dynamic_self_cast.swift +++ b/test/IRGen/dynamic_self_cast.swift @@ -12,7 +12,7 @@ public class SelfCasts { return s as! Self } - // CHECK-LABEL: define {{(dllexport )?}}{{(protected )?}}swiftcc ptr @"$s17dynamic_self_cast9SelfCastsC09genericToD0yACXDxlFZ"(ptr noalias nocapture %0, ptr %T, ptr swiftself %1) + // CHECK-LABEL: define {{(dllexport )?}}{{(protected )?}}swiftcc ptr @"$s17dynamic_self_cast9SelfCastsC09genericToD0yACXDxlFZ"(ptr noalias %0, ptr %T, ptr swiftself %1) // CHECK: call zeroext i1 @swift_dynamicCast(ptr {{%.*}}, ptr {{%.*}}, ptr %T, ptr %1, {{.*}}) // CHECK: ret public static func genericToSelf(_ s: T) -> Self { @@ -26,7 +26,7 @@ public class SelfCasts { return s as! Self } - // CHECK-LABEL: define {{(dllexport )?}}{{(protected )?}}swiftcc void @"$s17dynamic_self_cast9SelfCastsC011genericFromD0xylFZ"(ptr noalias nocapture sret({{.*}}) %0, ptr %T, ptr swiftself %1) + // CHECK-LABEL: define {{(dllexport )?}}{{(protected )?}}swiftcc void @"$s17dynamic_self_cast9SelfCastsC011genericFromD0xylFZ"(ptr noalias sret({{.*}}) %0, ptr %T, ptr swiftself %1) // CHECK: call zeroext i1 @swift_dynamicCast(ptr {{%.*}}, ptr {{%.*}}, ptr %1, ptr %T, {{.*}}) // CHECK: ret public static func genericFromSelf() -> T { @@ -49,7 +49,7 @@ public class SelfCasts { return s as? Self } - // CHECK-LABEL: define {{(dllexport )?}}{{(protected )?}}swiftcc {{i32|i64}} @"$s17dynamic_self_cast9SelfCastsC09genericToD11ConditionalyACXDSgxlFZ"(ptr noalias nocapture %0, ptr %T, ptr swiftself %1) + // CHECK-LABEL: define {{(dllexport )?}}{{(protected )?}}swiftcc {{i32|i64}} @"$s17dynamic_self_cast9SelfCastsC09genericToD11ConditionalyACXDSgxlFZ"(ptr noalias %0, ptr %T, ptr swiftself %1) // CHECK: call zeroext i1 @swift_dynamicCast(ptr {{%.*}}, ptr {{%.*}}, ptr %T, ptr %1, {{.*}}) // CHECK: ret public static func genericToSelfConditional(_ s: T) -> Self? { @@ -63,7 +63,7 @@ public class SelfCasts { return s as? Self } - // CHECK-LABEL: define {{(dllexport )?}}{{(protected )?}}swiftcc void @"$s17dynamic_self_cast9SelfCastsC011genericFromD11ConditionalxSgylFZ"(ptr noalias nocapture sret({{.*}}) %0, ptr %T, ptr swiftself %1) + // CHECK-LABEL: define {{(dllexport )?}}{{(protected )?}}swiftcc void @"$s17dynamic_self_cast9SelfCastsC011genericFromD11ConditionalxSgylFZ"(ptr noalias sret({{.*}}) %0, ptr %T, ptr swiftself %1) // CHECK: call zeroext i1 @swift_dynamicCast(ptr {{%.*}}, ptr {{%.*}}, ptr %1, ptr %T, {{.*}}) // CHECK: ret public static func genericFromSelfConditional() -> T? { diff --git a/test/IRGen/enum.sil b/test/IRGen/enum.sil index c7a2baada88ad..22ad8968aa9cd 100644 --- a/test/IRGen/enum.sil +++ b/test/IRGen/enum.sil @@ -198,7 +198,7 @@ enum DynamicSingleton { } // CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch(i64 %0, i64 %1) {{.*}} { -// CHECK-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch(ptr noalias nocapture dereferenceable(16) %0) {{.*}} { +// CHECK-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch(ptr noalias dereferenceable(16) %0) {{.*}} { sil @singleton_switch : $(Singleton) -> () { // CHECK-64: entry: // CHECK-32: entry: @@ -217,7 +217,7 @@ dest: } // CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_arg(i64 %0, i64 %1) {{.*}} { -// CHECK-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_arg(ptr noalias nocapture dereferenceable(16) %0) {{.*}} { +// CHECK-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_arg(ptr noalias dereferenceable(16) %0) {{.*}} { sil @singleton_switch_arg : $(Singleton) -> () { // CHECK-64: entry: // CHECK-32: entry: @@ -259,7 +259,7 @@ dest: // CHECK-64: [[B:%.*]] = insertvalue { i64, i64 } [[A]], i64 %1, 1 // CHECK-64: ret { i64, i64 } [[B]] // CHECK-64: } -// CHECK-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_inject(ptr noalias nocapture sret({{.*}}) %0, i64 %1, i64 %2) {{.*}} { +// CHECK-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_inject(ptr noalias sret({{.*}}) %0, i64 %1, i64 %2) {{.*}} { // CHECK-32: entry: // CHECK-32: [[GEP1:%.*]] = getelementptr inbounds <{ i64, i64 }>, ptr %0, i32 0, i32 0 // CHECK-32: store i64 %1, ptr [[GEP1]] @@ -752,7 +752,7 @@ enum AggregateSinglePayload2 { } // CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @aggregate_single_payload_unpack_2([[WORD]] %0, [[WORD]] %1, [[WORD]] %2, [[WORD]] %3) {{.*}} { -// CHECK-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @aggregate_single_payload_unpack_2(ptr noalias nocapture dereferenceable(16) %0) {{.*}} { +// CHECK-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @aggregate_single_payload_unpack_2(ptr noalias dereferenceable(16) %0) {{.*}} { sil @aggregate_single_payload_unpack_2 : $@convention(thin) (AggregateSinglePayload2) -> () { entry(%u : $AggregateSinglePayload2): switch_enum %u : $AggregateSinglePayload2, case #AggregateSinglePayload2.x!enumelt: x_dest, default default_dest @@ -783,7 +783,7 @@ end: // CHECK-64: %9 = insertvalue { [[WORD]], [[WORD]], [[WORD]], [[WORD]] } %8, [[WORD]] %3, 3 // CHECK-64: ret { [[WORD]], [[WORD]], [[WORD]], [[WORD]] } %9 -// CHECK-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @aggregate_single_payload_2_inject(ptr noalias nocapture sret({{.*}}) %0, i32 %1, i32 %2, i32 %3, i32 %4) {{.*}} { +// CHECK-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @aggregate_single_payload_2_inject(ptr noalias sret({{.*}}) %0, i32 %1, i32 %2, i32 %3, i32 %4) {{.*}} { // CHECK-32: [[TRUNC:%.*]] = trunc i32 %1 to i21 // CHECK-32: [[ZEXT:%.*]] = zext i21 [[TRUNC]] to i32 // CHECK-32: [[GEP:%.*]] = getelementptr inbounds {{.*}} %0, i32 0, i32 0 @@ -1217,7 +1217,7 @@ enum DynamicSinglePayload { case w } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_switch(ptr noalias nocapture %0, ptr %T) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_switch(ptr noalias %0, ptr %T) {{.*}} { // CHECK: [[TMP2:%.*]] = getelementptr inbounds ptr, ptr %T, i{{.*}} -1 // CHECK: [[VWT:%.*]] = load ptr, ptr [[TMP2]] // CHECK: [[ENUMADDR:%.*]] = getelementptr inbounds ptr, ptr [[VWT]], i32 6 @@ -1245,7 +1245,7 @@ end: return %v : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_inject_x(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture %1, ptr %T) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_inject_x(ptr noalias sret({{.*}}) %0, ptr noalias %1, ptr %T) {{.*}} { // CHECK: [[TMP2:%.*]] = getelementptr inbounds ptr, ptr %T, i{{.*}} -1 // CHECK: [[VWT:%.*]] = load ptr, ptr [[TMP2]] // CHECK: [[ENUMADDR:%.*]] = getelementptr inbounds ptr, ptr [[VWT]], i32 7 @@ -1258,7 +1258,7 @@ entry(%r : $*DynamicSinglePayload, %t : $*T): return %v : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_inject_y(ptr noalias nocapture sret({{.*}}) %0, ptr %T) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_inject_y(ptr noalias sret({{.*}}) %0, ptr %T) {{.*}} { // CHECK: [[TMP2:%.*]] = getelementptr inbounds ptr, ptr %T, i{{.*}} -1 // CHECK: [[VWT:%.*]] = load ptr, ptr [[TMP2]] // CHECK: [[ENUMADDR:%.*]] = getelementptr inbounds ptr, ptr [[VWT]], i32 7 @@ -2345,7 +2345,7 @@ enum MultiPayloadAddressOnlySpareBits { case Y(AddressOnlySpareBitsPayload) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_address_only_spare_bits(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_address_only_spare_bits(ptr noalias dereferenceable({{.*}}) %0) sil @multi_payload_address_only_spare_bits : $@convention(thin) (@in MultiPayloadAddressOnlySpareBits) -> () { entry(%m : $*MultiPayloadAddressOnlySpareBits): destroy_addr %m : $*MultiPayloadAddressOnlySpareBits @@ -2374,7 +2374,7 @@ typealias AllConcreteTestEnums = ( sil_global @x : $AllConcreteTestEnums -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_singleton_switch_indirect(ptr noalias nocapture %0, ptr %T) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_singleton_switch_indirect(ptr noalias %0, ptr %T) {{.*}} { // CHECK: ret void // CHECK: } sil @dynamic_singleton_switch_indirect : $ (@in DynamicSingleton) -> () { @@ -2480,7 +2480,7 @@ struct StructWithWeakVar { weak var delegate: delegateProtocol? } -// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @weak_optional(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @weak_optional(ptr noalias dereferenceable({{.*}}) %0) sil @weak_optional : $@convention(thin) (@in StructWithWeakVar?) -> () { entry(%x : $*StructWithWeakVar?): // CHECK-64: icmp eq [[WORD]] {{%.*}}, 0 diff --git a/test/IRGen/enum_dynamic_multi_payload.sil b/test/IRGen/enum_dynamic_multi_payload.sil index a721b48496c6f..11703b89e67b2 100644 --- a/test/IRGen/enum_dynamic_multi_payload.sil +++ b/test/IRGen/enum_dynamic_multi_payload.sil @@ -256,7 +256,7 @@ entry: } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_inject -// CHECK: (ptr noalias nocapture sret({{.*}}) %0, ptr %T) +// CHECK: (ptr noalias sret({{.*}}) %0, ptr %T) sil @dynamic_inject : $@convention(thin) () -> @out EitherOr { entry(%e : $*EitherOr): // CHECK: call void @swift_storeEnumTagMultiPayload(ptr {{%.*}}, ptr [[TYPE:%.*]], i32 0) @@ -272,7 +272,7 @@ entry(%e : $*EitherOr): } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_project -// CHECK: (ptr noalias nocapture sret({{.*}}) %0, ptr %T) +// CHECK: (ptr noalias sret({{.*}}) %0, ptr %T) sil @dynamic_project : $@convention(thin) () -> @out EitherOr { entry(%e : $*EitherOr): %l = unchecked_take_enum_data_addr %e : $*EitherOr, #EitherOr.Left!enumelt @@ -282,7 +282,7 @@ entry(%e : $*EitherOr): } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_switch -// CHECK: (ptr noalias nocapture sret({{.*}}) %0, ptr %T) +// CHECK: (ptr noalias sret({{.*}}) %0, ptr %T) sil @dynamic_switch : $@convention(thin) () -> @out EitherOr { entry(%e : $*EitherOr): // CHECK: [[TAG:%.*]] = call i32 @swift_getEnumCaseMultiPayload @@ -323,7 +323,7 @@ next(%x : $Builtin.Int8): } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_value_semantics -// CHECK: (ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture %1, ptr %T) +// CHECK: (ptr noalias sret({{.*}}) %0, ptr noalias %1, ptr %T) sil @dynamic_value_semantics : $@convention(thin) (@in EitherOr) -> @out EitherOr { entry(%a : $*EitherOr, %b : $*EitherOr): // CHECK: [[TAG:%.*]] = call i32 @swift_getEnumCaseMultiPayload @@ -361,7 +361,7 @@ entry(%a : $*EitherOr, %b : $*EitherOr): } // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_value_semantics2 -// CHECK: (ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture %1, ptr %T) +// CHECK: (ptr noalias sret({{.*}}) %0, ptr noalias %1, ptr %T) sil @dynamic_value_semantics2 : $@convention(thin) (@in EitherOr) -> @out EitherOr { entry(%a : $*EitherOr, %b : $*EitherOr): // CHECK: [[TAG:%.*]] = call i32 @swift_getEnumCaseMultiPayload diff --git a/test/IRGen/enum_future.sil b/test/IRGen/enum_future.sil index 68819d7a4424e..0418359d96bcf 100644 --- a/test/IRGen/enum_future.sil +++ b/test/IRGen/enum_future.sil @@ -202,7 +202,7 @@ enum DynamicSingleton { } // CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch(i64 %0, i64 %1) {{.*}} { -// CHECK-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch(ptr noalias nocapture dereferenceable(16) %0) {{.*}} { +// CHECK-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch(ptr noalias dereferenceable(16) %0) {{.*}} { sil @singleton_switch : $(Singleton) -> () { // CHECK-64: entry: // CHECK-32: entry: @@ -221,7 +221,7 @@ dest: } // CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_arg(i64 %0, i64 %1) {{.*}} { -// CHECK-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_arg(ptr noalias nocapture dereferenceable(16) %0) {{.*}} { +// CHECK-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_switch_arg(ptr noalias dereferenceable(16) %0) {{.*}} { sil @singleton_switch_arg : $(Singleton) -> () { // CHECK-64: entry: // CHECK-32: entry: @@ -263,7 +263,7 @@ dest: // CHECK-64: [[B:%.*]] = insertvalue { i64, i64 } [[A]], i64 %1, 1 // CHECK-64: ret { i64, i64 } [[B]] // CHECK-64: } -// CHECK-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_inject(ptr noalias nocapture sret({{.*}}) %0, i64 %1, i64 %2) {{.*}} { +// CHECK-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @singleton_inject(ptr noalias sret({{.*}}) %0, i64 %1, i64 %2) {{.*}} { // CHECK-32: entry: // CHECK-32: [[GEP1:%.*]] = getelementptr inbounds <{ i64, i64 }>, ptr %0, i32 0, i32 0 // CHECK-32: store i64 %1, ptr [[GEP1]] @@ -756,7 +756,7 @@ enum AggregateSinglePayload2 { } // CHECK-64: define{{( dllexport)?}}{{( protected)?}} swiftcc void @aggregate_single_payload_unpack_2([[WORD]] %0, [[WORD]] %1, [[WORD]] %2, [[WORD]] %3) {{.*}} { -// CHECK-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @aggregate_single_payload_unpack_2(ptr noalias nocapture dereferenceable(16) %0) {{.*}} { +// CHECK-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @aggregate_single_payload_unpack_2(ptr noalias dereferenceable(16) %0) {{.*}} { sil @aggregate_single_payload_unpack_2 : $@convention(thin) (AggregateSinglePayload2) -> () { entry(%u : $AggregateSinglePayload2): switch_enum %u : $AggregateSinglePayload2, case #AggregateSinglePayload2.x!enumelt: x_dest, default default_dest @@ -787,7 +787,7 @@ end: // CHECK-64: %9 = insertvalue { [[WORD]], [[WORD]], [[WORD]], [[WORD]] } %8, [[WORD]] %3, 3 // CHECK-64: ret { [[WORD]], [[WORD]], [[WORD]], [[WORD]] } %9 -// CHECK-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @aggregate_single_payload_2_inject(ptr noalias nocapture sret({{.*}}) %0, i32 %1, i32 %2, i32 %3, i32 %4) {{.*}} { +// CHECK-32: define{{( dllexport)?}}{{( protected)?}} swiftcc void @aggregate_single_payload_2_inject(ptr noalias sret({{.*}}) %0, i32 %1, i32 %2, i32 %3, i32 %4) {{.*}} { // CHECK-32: [[TRUNC:%.*]] = trunc i32 %1 to i21 // CHECK-32: [[ZEXT:%.*]] = zext i21 [[TRUNC]] to i32 // CHECK-32: [[GEP:%.*]] = getelementptr inbounds {{.*}} %0, i32 0, i32 0 @@ -1221,7 +1221,7 @@ enum DynamicSinglePayload { case w } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_switch(ptr noalias nocapture %0, ptr %T) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_switch(ptr noalias %0, ptr %T) {{.*}} { // CHECK: [[TMP2:%.*]] = getelementptr inbounds ptr, ptr %T, i{{.*}} -1 // CHECK: [[VWT:%.*]] = load ptr, ptr [[TMP2]] // CHECK: [[ENUMADDR:%.*]] = getelementptr inbounds ptr, ptr [[VWT]], i32 6 @@ -1249,7 +1249,7 @@ end: return %v : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_inject_x(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture %1, ptr %T) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_inject_x(ptr noalias sret({{.*}}) %0, ptr noalias %1, ptr %T) {{.*}} { // CHECK: [[TMP2:%.*]] = getelementptr inbounds ptr, ptr %T, i{{.*}} -1 // CHECK: [[VWT:%.*]] = load ptr, ptr [[TMP2]] // CHECK: [[ENUMADDR:%.*]] = getelementptr inbounds ptr, ptr [[VWT]], i32 7 @@ -1262,7 +1262,7 @@ entry(%r : $*DynamicSinglePayload, %t : $*T): return %v : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_inject_y(ptr noalias nocapture sret({{.*}}) %0, ptr %T) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_single_payload_inject_y(ptr noalias sret({{.*}}) %0, ptr %T) {{.*}} { // CHECK: [[TMP2:%.*]] = getelementptr inbounds ptr, ptr %T, i{{.*}} -1 // CHECK: [[VWT:%.*]] = load ptr, ptr [[TMP2]] // CHECK: [[ENUMADDR:%.*]] = getelementptr inbounds ptr, ptr [[VWT]], i32 7 @@ -2349,7 +2349,7 @@ enum MultiPayloadAddressOnlySpareBits { case Y(AddressOnlySpareBitsPayload) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_address_only_spare_bits(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @multi_payload_address_only_spare_bits(ptr noalias dereferenceable({{.*}}) %0) sil @multi_payload_address_only_spare_bits : $@convention(thin) (@in MultiPayloadAddressOnlySpareBits) -> () { entry(%m : $*MultiPayloadAddressOnlySpareBits): destroy_addr %m : $*MultiPayloadAddressOnlySpareBits @@ -2378,7 +2378,7 @@ typealias AllConcreteTestEnums = ( sil_global @x : $AllConcreteTestEnums -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_singleton_switch_indirect(ptr noalias nocapture %0, ptr %T) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @dynamic_singleton_switch_indirect(ptr noalias %0, ptr %T) {{.*}} { // CHECK: ret void // CHECK: } sil @dynamic_singleton_switch_indirect : $ (@in DynamicSingleton) -> () { @@ -2484,7 +2484,7 @@ struct StructWithWeakVar { weak var delegate: delegateProtocol? } -// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @weak_optional(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-64-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @weak_optional(ptr noalias dereferenceable({{.*}}) %0) sil @weak_optional : $@convention(thin) (@in StructWithWeakVar?) -> () { entry(%x : $*StructWithWeakVar?): // CHECK-64: icmp eq [[WORD]] {{%.*}}, 0 diff --git a/test/IRGen/enum_objc.sil b/test/IRGen/enum_objc.sil index 1e4bac166b6dc..b492f69cab7af 100644 --- a/test/IRGen/enum_objc.sil +++ b/test/IRGen/enum_objc.sil @@ -109,7 +109,7 @@ struct StructWithWeakVar { weak var delegate: delegateProtocol? } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @weak_optional(ptr noalias nocapture dereferenceable({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @weak_optional(ptr noalias dereferenceable({{.*}}) %0) sil @weak_optional : $@convention(thin) (@in StructWithWeakVar?) -> () { entry(%x : $*StructWithWeakVar?): // CHECK: icmp eq [[WORD:i32|i64]] {{%.*}}, 0 diff --git a/test/IRGen/enum_resilience.swift b/test/IRGen/enum_resilience.swift index a51fa73339ab1..1a43ee1f96dd6 100644 --- a/test/IRGen/enum_resilience.swift +++ b/test/IRGen/enum_resilience.swift @@ -72,7 +72,7 @@ enum InternalEither { case Right(ReferenceFast) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s15enum_resilience25functionWithResilientEnumy010resilient_A06MediumOAEF"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s15enum_resilience25functionWithResilientEnumy010resilient_A06MediumOAEF"(ptr noalias sret({{.*}}) %0, ptr noalias %1) public func functionWithResilientEnum(_ m: Medium) -> Medium { // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s14resilient_enum6MediumOMa"([[INT]] 0) @@ -90,7 +90,7 @@ public func functionWithResilientEnum(_ m: Medium) -> Medium { return m } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s15enum_resilience33functionWithIndirectResilientEnumy010resilient_A00E8ApproachOAEF"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s15enum_resilience33functionWithIndirectResilientEnumy010resilient_A00E8ApproachOAEF"(ptr noalias sret({{.*}}) %0, ptr noalias %1) public func functionWithIndirectResilientEnum(_ ia: IndirectApproach) -> IndirectApproach { // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s14resilient_enum16IndirectApproachOMa"([[INT]] 0) @@ -172,7 +172,7 @@ public func constructResilientEnumPayload(_ s: Size) -> Medium { return Medium.Postcard(s) } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc {{i32|i64}} @"$s15enum_resilience19resilientSwitchTestySi0c1_A06MediumOF"(ptr noalias nocapture %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc {{i32|i64}} @"$s15enum_resilience19resilientSwitchTestySi0c1_A06MediumOF"(ptr noalias %0) // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s14resilient_enum6MediumOMa"([[INT]] 0) // CHECK: [[METADATA:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 // CHECK: [[VWT_ADDR:%.*]] = getelementptr inbounds ptr, ptr [[METADATA]], [[INT]] -1 @@ -250,7 +250,7 @@ public func resilientEnumPartialApply(_ f: (Medium) -> Int) { // CHECK: ret void } -// CHECK-LABEL: define internal swiftcc void @"$s14resilient_enum6MediumOSiIgnd_ACSiIegnr_TRTA"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture %1, ptr swiftself %2) +// CHECK-LABEL: define internal swiftcc void @"$s14resilient_enum6MediumOSiIgnd_ACSiIegnr_TRTA"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias %1, ptr swiftself %2) // Enums with resilient payloads from a different resilience domain @@ -296,7 +296,7 @@ public func getResilientEnumType() -> Any.Type { // from metadata -- make sure we can do that extension ResilientMultiPayloadGenericEnum { -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @"$s14resilient_enum32ResilientMultiPayloadGenericEnumO0B11_resilienceE16getTypeParameterxmyF"(ptr %"ResilientMultiPayloadGenericEnum", ptr noalias nocapture swiftself %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @"$s14resilient_enum32ResilientMultiPayloadGenericEnumO0B11_resilienceE16getTypeParameterxmyF"(ptr %"ResilientMultiPayloadGenericEnum", ptr noalias swiftself %0) // CHECK: [[T_ADDR:%.*]] = getelementptr inbounds ptr, ptr %"ResilientMultiPayloadGenericEnum", [[INT]] 2 // CHECK-NEXT: [[T:%.*]] = load ptr, ptr [[T_ADDR]] public func getTypeParameter() -> T.Type { @@ -304,7 +304,7 @@ extension ResilientMultiPayloadGenericEnum { } } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s15enum_resilience39constructExhaustiveWithResilientMembers010resilient_A011SimpleShapeOyF"(ptr noalias nocapture sret({{.*}}) %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s15enum_resilience39constructExhaustiveWithResilientMembers010resilient_A011SimpleShapeOyF"(ptr noalias sret({{.*}}) %0) // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s16resilient_struct4SizeVMa"([[INT]] 0) // CHECK-NEXT: [[METADATA:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 // CHECK-NEXT: [[WITNESSTABLE_ADDR:%[0-9]+]] = getelementptr inbounds ptr, ptr [[METADATA]], {{(i64|i32)}} -1 diff --git a/test/IRGen/error_self_conformance.sil b/test/IRGen/error_self_conformance.sil index 7a7139fd26513..d9d7a4b76ebe5 100644 --- a/test/IRGen/error_self_conformance.sil +++ b/test/IRGen/error_self_conformance.sil @@ -8,7 +8,7 @@ sil @take_any_error : $@convention(thin) (@in T) -> () sil @test : $@convention(thin) (@in Error) -> () { entry(%0 : $*Error): // CHECK: [[ERROR_METADATA:%.*]] = call {{.*}}@"$ss5Error_pMD" - // CHECK-NEXT: call swiftcc void @take_any_error(ptr noalias nocapture %0, ptr [[ERROR_METADATA]], ptr @"$ss5ErrorWS") + // CHECK-NEXT: call swiftcc void @take_any_error(ptr noalias %0, ptr [[ERROR_METADATA]], ptr @"$ss5ErrorWS") // CHECK-NEXT: ret void %take = function_ref @take_any_error : $@convention(thin) (@in T) -> () apply %take(%0) : $@convention(thin) (@in T) -> () diff --git a/test/IRGen/existentials.sil b/test/IRGen/existentials.sil index 9e73947b2dd3b..f2789a537a036 100644 --- a/test/IRGen/existentials.sil +++ b/test/IRGen/existentials.sil @@ -47,7 +47,7 @@ entry(%s : $CP): return %z : $CP } -// CHECK-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @class_existential_weak(ptr noalias nocapture sret({{.*}}) %0, i64 %1, i64 %2) +// CHECK-DAG: define{{( dllexport)?}}{{( protected)?}} swiftcc void @class_existential_weak(ptr noalias sret({{.*}}) %0, i64 %1, i64 %2) sil @class_existential_weak : $@convention(thin) (@owned CP?) -> @out @sil_weak CP? { entry(%w : $*@sil_weak CP?, %a : $CP?): // CHECK: [[V:%.*]] = alloca { %swift.weak, ptr } diff --git a/test/IRGen/existentials_objc.sil b/test/IRGen/existentials_objc.sil index bb851baac7924..35bb3b5813f8b 100644 --- a/test/IRGen/existentials_objc.sil +++ b/test/IRGen/existentials_objc.sil @@ -97,7 +97,7 @@ entry(%s : $CP): return %z : $CP } -// CHECK-DAG: define{{( protected)?}} swiftcc void @class_existential_weak(ptr noalias nocapture sret({{.*}}) %0, i64 %1, i64 %2) +// CHECK-DAG: define{{( protected)?}} swiftcc void @class_existential_weak(ptr noalias sret({{.*}}) %0, i64 %1, i64 %2) sil @class_existential_weak : $@convention(thin) (@owned CP?) -> @out @sil_weak CP? { entry(%w : $*@sil_weak CP?, %a : $CP?): // CHECK: [[V:%.*]] = alloca { %swift.weak, ptr } diff --git a/test/IRGen/frozen_protocols.swift b/test/IRGen/frozen_protocols.swift index fbbb114c8e9c4..944104999d825 100644 --- a/test/IRGen/frozen_protocols.swift +++ b/test/IRGen/frozen_protocols.swift @@ -39,10 +39,10 @@ public struct ConformsToFrozenProtocol : FrozenProtocol { // Requirements in @_fixed_layout protocols are called by direct witness // table lookup -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s16frozen_protocols23callOtherProtocolMethodyyx18resilient_protocol0d6FrozenE0RzlF"(ptr noalias nocapture %0, ptr %T, ptr %T.OtherFrozenProtocol) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s16frozen_protocols23callOtherProtocolMethodyyx18resilient_protocol0d6FrozenE0RzlF"(ptr noalias %0, ptr %T, ptr %T.OtherFrozenProtocol) // CHECK: [[ADDR:%.*]] = getelementptr inbounds ptr, ptr %T.OtherFrozenProtocol, i32 1 // CHECK: [[FN:%.*]] = load ptr, ptr [[ADDR]] -// CHECK: call swiftcc void [[FN]](ptr noalias nocapture swiftself %0, ptr %T, ptr %T.OtherFrozenProtocol) +// CHECK: call swiftcc void [[FN]](ptr noalias swiftself %0, ptr %T, ptr %T.OtherFrozenProtocol) // CHECK: ret void // @_fixed_layout protocols still emit method dispatch thunks though, which diff --git a/test/IRGen/generic_casts.swift b/test/IRGen/generic_casts.swift index 0f68d2a2a2029..4e6b0a9952dd9 100644 --- a/test/IRGen/generic_casts.swift +++ b/test/IRGen/generic_casts.swift @@ -33,7 +33,7 @@ import gizmo // CHECK: @_PROTOCOL__TtP13generic_casts10ObjCProto1_ // CHECK: } -// CHECK: define hidden swiftcc i64 @"$s13generic_casts8allToIntySixlF"(ptr noalias nocapture %0, ptr %T) +// CHECK: define hidden swiftcc i64 @"$s13generic_casts8allToIntySixlF"(ptr noalias %0, ptr %T) func allToInt(_ x: T) -> Int { return x as! Int // CHECK: [[INT_TEMP:%.*]] = alloca %TSi, @@ -49,7 +49,7 @@ func allToInt(_ x: T) -> Int { // CHECK: ret i64 [[INT_RESULT]] } -// CHECK: define hidden swiftcc void @"$s13generic_casts8intToAllyxSilF"(ptr noalias nocapture sret({{.*}}) %0, i64 %1, ptr %T) {{.*}} { +// 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 @@ -91,7 +91,7 @@ func protoCast(_ x: ObjCClass) -> ObjCProto1 & NSRuncing { // // Class existential to opaque archetype cast -// CHECK: define hidden swiftcc void @"$s13generic_casts33classExistentialToOpaqueArchetypeyxAA10ObjCProto1_plF"(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %T) +// CHECK: define hidden swiftcc void @"$s13generic_casts33classExistentialToOpaqueArchetypeyxAA10ObjCProto1_plF"(ptr noalias sret({{.*}}) %0, ptr %1, ptr %T) func classExistentialToOpaqueArchetype(_ x: ObjCProto1) -> T { var x = x // CHECK: [[X:%.*]] = alloca %T13generic_casts10ObjCProto1P diff --git a/test/IRGen/generic_metatypes.swift b/test/IRGen/generic_metatypes.swift index 2b0a4df448f43..8d7031d7461c9 100644 --- a/test/IRGen/generic_metatypes.swift +++ b/test/IRGen/generic_metatypes.swift @@ -23,7 +23,7 @@ public func type(of value: T) -> Metatype { never() } -// CHECK: define hidden swiftcc ptr [[GENERIC_TYPEOF:@"\$s17generic_metatypes0A6TypeofyxmxlF"]](ptr noalias nocapture %0, ptr [[TYPE:%.*]]) +// CHECK: define hidden swiftcc ptr [[GENERIC_TYPEOF:@"\$s17generic_metatypes0A6TypeofyxmxlF"]](ptr noalias %0, ptr [[TYPE:%.*]]) func genericTypeof(_ x: T) -> T.Type { // CHECK: [[METATYPE:%.*]] = call ptr @swift_getDynamicType(ptr {{.*}}, ptr [[TYPE]], i1 false) // CHECK: ret ptr [[METATYPE]] @@ -37,10 +37,10 @@ class Bar {} func remapToSubstitutedMetatypes(_ x: Foo, y: Bar) -> (Foo.Type, Bar.Type) { - // CHECK: call swiftcc ptr [[GENERIC_TYPEOF]](ptr noalias nocapture undef, ptr {{.*}} @"$s17generic_metatypes3FooVMf", {{.*}}) + // CHECK: call swiftcc ptr [[GENERIC_TYPEOF]](ptr noalias undef, ptr {{.*}} @"$s17generic_metatypes3FooVMf", {{.*}}) // CHECK: [[BAR_REQUEST:%.*]] = call {{.*}}@"$s17generic_metatypes3BarCMa" // CHECK: [[BAR:%.*]] = extractvalue {{.*}} [[BAR_REQUEST]] - // CHECK: [[BAR_META:%.*]] = call swiftcc ptr [[GENERIC_TYPEOF]](ptr noalias nocapture {{%.*}}, ptr [[BAR]]) + // CHECK: [[BAR_META:%.*]] = call swiftcc ptr [[GENERIC_TYPEOF]](ptr noalias {{%.*}}, ptr [[BAR]]) // CHECK: ret ptr [[BAR_META]] return (genericTypeof(x), genericTypeof(y)) } diff --git a/test/IRGen/generic_metatypes_future.swift b/test/IRGen/generic_metatypes_future.swift index 001b97098ba14..7c37e70cf0015 100644 --- a/test/IRGen/generic_metatypes_future.swift +++ b/test/IRGen/generic_metatypes_future.swift @@ -24,7 +24,7 @@ public func type(of value: T) -> Metatype { never() } -// CHECK: define hidden swiftcc ptr [[GENERIC_TYPEOF:@"\$s17generic_metatypes0A6TypeofyxmxlF"]](ptr noalias nocapture %0, ptr [[TYPE:%.*]]) +// CHECK: define hidden swiftcc ptr [[GENERIC_TYPEOF:@"\$s17generic_metatypes0A6TypeofyxmxlF"]](ptr noalias %0, ptr [[TYPE:%.*]]) func genericTypeof(_ x: T) -> T.Type { // CHECK: [[METATYPE:%.*]] = call ptr @swift_getDynamicType(ptr {{.*}}, ptr [[TYPE]], i1 false) // CHECK: ret ptr [[METATYPE]] @@ -38,10 +38,10 @@ class Bar {} func remapToSubstitutedMetatypes(_ x: Foo, y: Bar) -> (Foo.Type, Bar.Type) { - // CHECK: call swiftcc ptr [[GENERIC_TYPEOF]](ptr noalias nocapture undef, ptr {{.*}} @"$s17generic_metatypes3FooVMf", {{.*}}) + // CHECK: call swiftcc ptr [[GENERIC_TYPEOF]](ptr noalias undef, ptr {{.*}} @"$s17generic_metatypes3FooVMf", {{.*}}) // CHECK: [[BAR_REQUEST:%.*]] = call {{.*}}@"$s17generic_metatypes3BarCMa" // CHECK: [[BAR:%.*]] = extractvalue {{.*}} [[BAR_REQUEST]] - // CHECK: [[BAR_META:%.*]] = call swiftcc ptr [[GENERIC_TYPEOF]](ptr noalias nocapture {{%.*}}, ptr [[BAR]]) + // CHECK: [[BAR_META:%.*]] = call swiftcc ptr [[GENERIC_TYPEOF]](ptr noalias {{%.*}}, ptr [[BAR]]) // CHECK: ret ptr [[BAR_META]] return (genericTypeof(x), genericTypeof(y)) } diff --git a/test/IRGen/generic_ternary.swift b/test/IRGen/generic_ternary.swift index d9297cf58fad7..f44288913f1b2 100644 --- a/test/IRGen/generic_ternary.swift +++ b/test/IRGen/generic_ternary.swift @@ -4,7 +4,7 @@ // struct OptionalStreamAdaptor { - // CHECK: define hidden swiftcc void @"$s15generic_ternary21OptionalStreamAdaptorV4next{{[_0-9a-zA-Z]*}}F"(ptr noalias nocapture sret({{.*}}) %0, ptr %"OptionalStreamAdaptor", ptr nocapture swiftself dereferenceable({{.*}}) %1) + // CHECK: define hidden swiftcc void @"$s15generic_ternary21OptionalStreamAdaptorV4next{{[_0-9a-zA-Z]*}}F"(ptr noalias sret({{.*}}) %0, ptr %"OptionalStreamAdaptor", ptr nocapture swiftself dereferenceable({{.*}}) %1) mutating func next() -> Optional { return x[0].next() diff --git a/test/IRGen/generic_tuples.swift b/test/IRGen/generic_tuples.swift index abf567d935075..b1ad0a699daa8 100644 --- a/test/IRGen/generic_tuples.swift +++ b/test/IRGen/generic_tuples.swift @@ -10,7 +10,7 @@ // CHECK-DAG: %swift.tuple_element_type = type { ptr, i32 } func dup(_ x: T) -> (T, T) { var x = x; return (x,x) } -// CHECK: define hidden swiftcc void @"$s14generic_tuples3dupyx_xtxlF"(ptr noalias nocapture %0, ptr noalias nocapture %1, ptr noalias nocapture %2, ptr %T) +// CHECK: define hidden swiftcc void @"$s14generic_tuples3dupyx_xtxlF"(ptr noalias %0, ptr noalias %1, ptr noalias %2, ptr %T) // CHECK: entry: // Allocate a local variable for 'x'. // CHECK: [[VWT_ADDR:%.*]] = getelementptr inbounds ptr, ptr %T, i64 -1 @@ -62,22 +62,22 @@ func callDupC(_ c: C) { _ = dupC(c) } // CHECK-NEXT: call void @swift_release(ptr [[LEFT]]) // CHECK-NEXT: ret void -// CHECK: define hidden swiftcc i64 @"$s14generic_tuples4lumpySi_xxtxlF"(ptr noalias nocapture %0, ptr noalias nocapture %1, ptr noalias nocapture %2, ptr %T) +// CHECK: define hidden swiftcc i64 @"$s14generic_tuples4lumpySi_xxtxlF"(ptr noalias %0, ptr noalias %1, ptr noalias %2, ptr %T) func lump(_ x: T) -> (Int, T, T) { return (0,x,x) } -// CHECK: define hidden swiftcc { i64, i64 } @"$s14generic_tuples5lump2ySi_SixtxlF"(ptr noalias nocapture %0, ptr noalias nocapture %1, ptr %T) +// CHECK: define hidden swiftcc { i64, i64 } @"$s14generic_tuples5lump2ySi_SixtxlF"(ptr noalias %0, ptr noalias %1, ptr %T) func lump2(_ x: T) -> (Int, Int, T) { return (0,0,x) } -// CHECK: define hidden swiftcc void @"$s14generic_tuples5lump3yx_xxtxlF"(ptr noalias nocapture %0, ptr noalias nocapture %1, ptr noalias nocapture %2, ptr noalias nocapture %3, ptr %T) +// CHECK: define hidden swiftcc void @"$s14generic_tuples5lump3yx_xxtxlF"(ptr noalias %0, ptr noalias %1, ptr noalias %2, ptr noalias %3, ptr %T) func lump3(_ x: T) -> (T, T, T) { return (x,x,x) } -// CHECK: define hidden swiftcc i64 @"$s14generic_tuples5lump4yx_SixtxlF"(ptr noalias nocapture %0, ptr noalias nocapture %1, ptr noalias nocapture %2, ptr %T) +// CHECK: define hidden swiftcc i64 @"$s14generic_tuples5lump4yx_SixtxlF"(ptr noalias %0, ptr noalias %1, ptr noalias %2, ptr %T) func lump4(_ x: T) -> (T, Int, T) { return (x,0,x) } -// CHECK: define hidden swiftcc i64 @"$s14generic_tuples6unlumpyS2i_xxt_tlF"(i64 %0, ptr noalias nocapture %1, ptr noalias nocapture %2, ptr %T) +// CHECK: define hidden swiftcc i64 @"$s14generic_tuples6unlumpyS2i_xxt_tlF"(i64 %0, ptr noalias %1, ptr noalias %2, ptr %T) func unlump(_ x: (Int, T, T)) -> Int { return x.0 } -// CHECK: define hidden swiftcc void @"$s14generic_tuples7unlump1yxSi_xxt_tlF"(ptr noalias nocapture sret({{.*}}) %0, i64 %1, ptr noalias nocapture %2, ptr noalias nocapture %3, ptr %T) +// CHECK: define hidden swiftcc void @"$s14generic_tuples7unlump1yxSi_xxt_tlF"(ptr noalias sret({{.*}}) %0, i64 %1, ptr noalias %2, ptr noalias %3, ptr %T) func unlump1(_ x: (Int, T, T)) -> T { return x.1 } -// CHECK: define hidden swiftcc void @"$s14generic_tuples7unlump2yxx_Sixt_tlF"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture %1, i64 %2, ptr noalias nocapture %3, ptr %T) +// CHECK: define hidden swiftcc void @"$s14generic_tuples7unlump2yxx_Sixt_tlF"(ptr noalias sret({{.*}}) %0, ptr noalias %1, i64 %2, ptr noalias %3, ptr %T) func unlump2(_ x: (T, Int, T)) -> T { return x.0 } -// CHECK: define hidden swiftcc i64 @"$s14generic_tuples7unlump3ySix_Sixt_tlF"(ptr noalias nocapture %0, i64 %1, ptr noalias nocapture %2, ptr %T) +// CHECK: define hidden swiftcc i64 @"$s14generic_tuples7unlump3ySix_Sixt_tlF"(ptr noalias %0, i64 %1, ptr noalias %2, ptr %T) func unlump3(_ x: (T, Int, T)) -> Int { return x.1 } diff --git a/test/IRGen/indexing.sil b/test/IRGen/indexing.sil index 58d98f1d79951..a908a84d15d9e 100644 --- a/test/IRGen/indexing.sil +++ b/test/IRGen/indexing.sil @@ -38,7 +38,7 @@ entry(%p : $*(), %i: $Builtin.Word): return undef : $() } -// CHECK: define{{( protected)?}} {{.*}}void @dynamic_size(ptr noalias nocapture %0, i64 %1, ptr %T) {{.*}} { +// 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 diff --git a/test/IRGen/infinite_archetype.swift b/test/IRGen/infinite_archetype.swift index 599a1415523fe..b3aa3c1523b58 100644 --- a/test/IRGen/infinite_archetype.swift +++ b/test/IRGen/infinite_archetype.swift @@ -6,5 +6,5 @@ protocol Fooable { associatedtype Foo } -// CHECK: define hidden swiftcc void @"$s18infinite_archetype3foo{{[_0-9a-zA-Z]*}}F"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture %1, ptr %T, ptr %T.Fooable) +// CHECK: define hidden swiftcc void @"$s18infinite_archetype3foo{{[_0-9a-zA-Z]*}}F"(ptr noalias sret({{.*}}) %0, ptr noalias %1, ptr %T, ptr %T.Fooable) func foo(x: T) -> T where T == T.Foo { return x } diff --git a/test/IRGen/lifetime.sil b/test/IRGen/lifetime.sil index 2aa302b07e98a..a1d537b55cb93 100644 --- a/test/IRGen/lifetime.sil +++ b/test/IRGen/lifetime.sil @@ -14,7 +14,7 @@ bb0(%x : $*T): %0 = tuple () return %0 : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @generic(ptr noalias nocapture %0, ptr %T) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @generic(ptr noalias %0, ptr %T) {{.*}} { // Allocate it. // CHECK: [[VWT_ADDR:%.*]] = getelementptr inbounds ptr, ptr %T, {{(i32|i64)}} -1 // CHECK-NEXT: [[VWT:%.*]] = load ptr, ptr [[VWT_ADDR]] @@ -51,7 +51,7 @@ bb0(%x : $*T): %0 = tuple () return %0 : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @generic_with_reuse(ptr noalias nocapture %0, ptr %T) {{.*}} { +// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @generic_with_reuse(ptr noalias %0, ptr %T) {{.*}} { // Allocate it. // CHECK: [[VWT_ADDR:%.*]] = getelementptr inbounds ptr, ptr %T, {{(i32|i64)}} -1 // CHECK-NEXT: [[VWT:%.*]] = load ptr, ptr [[VWT_ADDR]] diff --git a/test/IRGen/marker_protocol.swift b/test/IRGen/marker_protocol.swift index 5a49a145464c0..e19e98c8b9118 100644 --- a/test/IRGen/marker_protocol.swift +++ b/test/IRGen/marker_protocol.swift @@ -54,7 +54,7 @@ public func markerInDictionary() -> Any { } // Note: no witness tables -// CHECK: swiftcc void @"$s15marker_protocol7genericyyxAA1PRzlF"(ptr noalias nocapture %0, ptr %T) +// CHECK: swiftcc void @"$s15marker_protocol7genericyyxAA1PRzlF"(ptr noalias %0, ptr %T) public func generic(_: T) { } public struct GenericType { } diff --git a/test/IRGen/non_fixed_return.swift b/test/IRGen/non_fixed_return.swift index 087c0c1bf82c7..18d08cf30a91f 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 nocapture 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 nocapture sret(%swift.opaque) %0, ptr noalias nocapture %1, ptr %T) -// CHECK: call swiftcc void @"$s16non_fixed_return1CVACyxGycfC"(ptr noalias nocapture 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 nocapture 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 %Ts6UInt32VSg, ptr [[BASE]], i64 0, i32 1 // OPT: store i1 true, ptr [[ADDR2]] diff --git a/test/IRGen/objc_enum_multi_file.swift b/test/IRGen/objc_enum_multi_file.swift index 37ebc5bb431bd..560dd49f72eaa 100644 --- a/test/IRGen/objc_enum_multi_file.swift +++ b/test/IRGen/objc_enum_multi_file.swift @@ -34,7 +34,7 @@ func useFoo(_ x: Foo) -> Int32 { } // CHECK: [[DEFAULT]]: - // CHECK: call swiftcc void @"$ss32_diagnoseUnexpectedEnumCaseValue{{.+}}"(ptr @"$s{{.+}}3FooON", ptr noalias nocapture %{{.+}}, ptr @"$ss5Int32VN") + // CHECK: call swiftcc void @"$ss32_diagnoseUnexpectedEnumCaseValue{{.+}}"(ptr @"$s{{.+}}3FooON", ptr noalias %{{.+}}, ptr @"$ss5Int32VN") // CHECK-NEXT: unreachable // CHECK: [[FINAL]]: @@ -68,7 +68,7 @@ func useBar(_ x: Bar) -> Int32 { } // CHECK: [[DEFAULT]]: - // CHECK: call swiftcc void @"$ss32_diagnoseUnexpectedEnumCaseValue{{.+}}"(ptr @"$s{{.+}}3BarON", ptr noalias nocapture %{{.+}}, ptr @"$ss5Int32VN") + // CHECK: call swiftcc void @"$ss32_diagnoseUnexpectedEnumCaseValue{{.+}}"(ptr @"$s{{.+}}3BarON", ptr noalias %{{.+}}, ptr @"$ss5Int32VN") // CHECK-NEXT: unreachable // CHECK: [[FINAL]]: diff --git a/test/IRGen/opaque_values_irgen.sil b/test/IRGen/opaque_values_irgen.sil index 7d8be23b76415..60682ab7c1edb 100644 --- a/test/IRGen/opaque_values_irgen.sil +++ b/test/IRGen/opaque_values_irgen.sil @@ -4,7 +4,7 @@ import Builtin sil_stage raw -// CHECK: define hidden swiftcc void @f010_irgen_identity(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture %1, ptr %T) +// CHECK: define hidden swiftcc void @f010_irgen_identity(ptr noalias sret({{.*}}) %0, ptr noalias %1, ptr %T) // CHECK: entry: // CHECK-NOT: call // CHECK-NOT: call diff --git a/test/IRGen/open_boxed_existential.sil b/test/IRGen/open_boxed_existential.sil index 681376b32f838..429a9dd2b955d 100644 --- a/test/IRGen/open_boxed_existential.sil +++ b/test/IRGen/open_boxed_existential.sil @@ -14,7 +14,7 @@ entry(%b : $Error): // CHECK: [[WITNESS:%.*]] = load {{.*}} [[OUT_WITNESS]] %o = open_existential_box %b : $Error to $*@opened("01234567-89AB-CDEF-0123-000000000000", Error) Self %m = witness_method $@opened("01234567-89AB-CDEF-0123-000000000000", Error) Self, #Error._code!getter, %o : $*@opened("01234567-89AB-CDEF-0123-000000000000", Error) Self : $@convention(witness_method: Error) (@in_guaranteed Self) -> Int - // CHECK: [[RESULT:%.*]] = call swiftcc [[INT:i[0-9]+]] @"$ss5ErrorP5_codeSivgTj"(ptr noalias nocapture swiftself [[ADDR]], ptr [[TYPE]], ptr [[WITNESS]]) + // CHECK: [[RESULT:%.*]] = call swiftcc [[INT:i[0-9]+]] @"$ss5ErrorP5_codeSivgTj"(ptr noalias swiftself [[ADDR]], ptr [[TYPE]], ptr [[WITNESS]]) %c = apply %m<@opened("01234567-89AB-CDEF-0123-000000000000", Error) Self>(%o) : $@convention(witness_method: Error) (@in_guaranteed Self) -> Int // CHECK: ret [[INT]] [[RESULT]] return %c : $Int diff --git a/test/IRGen/outlined_copy_addr.swift b/test/IRGen/outlined_copy_addr.swift index e8129522e460c..895b91e796195 100644 --- a/test/IRGen/outlined_copy_addr.swift +++ b/test/IRGen/outlined_copy_addr.swift @@ -18,7 +18,7 @@ public struct StructWithBaseStruct { var elem2: BaseStruct } -// CHECK-LABEL: define hidden swiftcc void @"$s11outcopyaddr010StructWithbc4BaseB0V4elemAA0bcdB0VyxGvg"(ptr noalias nocapture sret({{.*}}) %0, ptr %"StructWithStructWithBaseStruct", ptr noalias nocapture swiftself %1) +// CHECK-LABEL: define hidden swiftcc void @"$s11outcopyaddr010StructWithbc4BaseB0V4elemAA0bcdB0VyxGvg"(ptr noalias sret({{.*}}) %0, ptr %"StructWithStructWithBaseStruct", ptr noalias swiftself %1) // CHECK: call ptr @"$s11outcopyaddr014StructWithBaseB0VyxGAA9ChildProtRzlWOc" public struct StructWithStructWithBaseStruct { public typealias Element = T @@ -36,7 +36,7 @@ struct OtherInternal { struct MyPrivate { var otherHelper: OtherInternal? = nil - // CHECK-LABEL: define hidden swiftcc {{i32|i64}} @"$s11outcopyaddr9MyPrivateVyACyxGxcfC"(ptr noalias nocapture %0, ptr %T, ptr %T.P) {{.*}} { + // CHECK-LABEL: define hidden swiftcc {{i32|i64}} @"$s11outcopyaddr9MyPrivateVyACyxGxcfC"(ptr noalias %0, ptr %T, ptr %T.P) {{.*}} { // CHECK: call ptr @"$s11outcopyaddr9MyPrivateVyxGAA1PRzlWOh"(ptr {{%.*}}) // CHECK: ret init(_: T) { } diff --git a/test/IRGen/partial_apply.sil b/test/IRGen/partial_apply.sil index 84471993b5e62..6ebfac8e03a82 100644 --- a/test/IRGen/partial_apply.sil +++ b/test/IRGen/partial_apply.sil @@ -272,7 +272,7 @@ bb0(%x : $*SwiftClassPair): sil public_external @captured_fixed_and_dependent_params : $@convention(thin) (@guaranteed SwiftClass, @in A, Int) -> () -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_non_fixed_layout(ptr %0, ptr noalias nocapture %1, i64 %2, ptr %T) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_indirect_non_fixed_layout(ptr %0, ptr noalias %1, i64 %2, ptr %T) // -- Round the base offset for the T field up to T's alignment. // CHECK: [[T_VWTABLE_ADDR:%.*]] = getelementptr {{.*}} %T, [[WORD:i[0-9]+]] -1 // CHECK: [[T_VWTABLE:%.*]] = load {{.*}} [[T_VWTABLE_ADDR]] @@ -340,8 +340,8 @@ bb0(%x : $*T): return %p : $@callee_owned () -> @out T } -// CHECK-LABEL: define internal swiftcc void @"$s28captured_dependent_out_paramTA"(ptr noalias nocapture sret({{.*}}) %0, ptr swiftself %1) {{.*}} { -// CHECK: call swiftcc void @captured_dependent_out_param(ptr noalias nocapture sret({{.*}}) +// CHECK-LABEL: define internal swiftcc void @"$s28captured_dependent_out_paramTA"(ptr noalias sret({{.*}}) %0, ptr swiftself %1) {{.*}} { +// CHECK: call swiftcc void @captured_dependent_out_param(ptr noalias sret({{.*}}) sil @partial_apply_dynamic_with_out_param : $@convention(thin) (Int32, @owned @callee_owned (Int32) -> @out T) -> @callee_owned () -> @out T { bb0(%x : $Int32, %f : $@callee_owned (Int32) -> @out T): @@ -352,7 +352,7 @@ bb0(%x : $Int32, %f : $@callee_owned (Int32) -> @out T): // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @partial_apply_dynamic_with_out_param // CHECK: insertvalue {{.*}} [[FORWARDER:@"\$sTA[A-Za-z0-9_]*"]] // CHECK: define internal swiftcc void [[FORWARDER]] -// CHECK: call swiftcc void {{%.*}}(ptr noalias nocapture sret({{.*}}) +// CHECK: call swiftcc void {{%.*}}(ptr noalias sret({{.*}}) class Base { } @@ -501,7 +501,7 @@ sil public_external @generic_indirect_return2 : $@convention(thin) (Int) -> // CHECK: ret { ptr, ptr } [[R2]] // CHECK-LABEL: define internal swiftcc void @"$s24generic_indirect_return2TA"(ptr noalias nocapture sret({{.*}}) %0, ptr swiftself %1) -// CHECK: call swiftcc void @generic_indirect_return2(ptr noalias nocapture sret({{.*}}) %0, +// CHECK: call swiftcc void @generic_indirect_return2(ptr noalias sret({{.*}}) %0, // CHECK: ret void sil @partial_apply_generic_indirect_return2 : $@convention(thin) (Int) -> @callee_owned () -> @owned GenericEnum2 { bb0(%0 : $Int): @@ -670,7 +670,7 @@ bb0(%x : $*SwiftClassPair): sil public_external @closure : $@convention(thin) (@in_guaranteed ResilientInt, @guaranteed SwiftClass) -> () // Make sure that we use the heap header size (16) for the initial offset. -// CHECK-LABEL: define{{.*}} swiftcc void @test_initial_offset(ptr noalias nocapture %0, ptr %1) +// CHECK-LABEL: define{{.*}} swiftcc void @test_initial_offset(ptr noalias %0, ptr %1) // CHECK: [[T0:%.*]] = call swiftcc %swift.metadata_response @"$s16resilient_struct12ResilientIntVMa" // CHECK: [[MD:%.*]] = extractvalue %swift.metadata_response [[T0]], 0 // CHECK: [[VWT_PTR:%.*]] = getelementptr inbounds ptr, ptr [[MD]], i64 -1 @@ -702,7 +702,7 @@ struct SomeType : Proto2 { sil @foo : $@convention(thin) <Ï„_0_0, Ï„_0_1 where Ï„_0_0 : Proto1, Ï„_0_1 : Proto2> (@in_guaranteed Ï„_0_0, @in_guaranteed Ï„_0_1) -> () -// CHECK-64-LABEL: define{{.*}} swiftcc void @empty_followed_by_non_fixed(ptr noalias nocapture %0) +// CHECK-64-LABEL: define{{.*}} swiftcc void @empty_followed_by_non_fixed(ptr noalias %0) // CHECK-64: [[FLAGS:%.*]] = load i32, ptr // CHECK-64: [[FLAGS2:%.*]] = zext i32 [[FLAGS]] to i64 // CHECK-64: [[ALIGNMASK:%.*]] = and i64 [[FLAGS2]], 255 diff --git a/test/IRGen/partial_apply_forwarder.sil b/test/IRGen/partial_apply_forwarder.sil index a36215941f56a..c4c5e37395ca9 100644 --- a/test/IRGen/partial_apply_forwarder.sil +++ b/test/IRGen/partial_apply_forwarder.sil @@ -77,7 +77,7 @@ sil hidden_external @takingQ : $@convention(thin) <Ï„_0_0 where Ï„_0_0 : Q> (@o sil hidden_external @takingQAndEmpty : $@convention(thin) <Ï„_0_0 where Ï„_0_0 : Q> (@owned WeakBox<Ï„_0_0>, EmptyType) -> () sil hidden_external @takingEmptyAndQ : $@convention(thin) <Ï„_0_0 where Ï„_0_0 : Q> (EmptyType, @owned WeakBox<Ï„_0_0>) -> () -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @bind_polymorphic_param_from_context(ptr noalias nocapture %0, ptr %"\CF\84_0_1") +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @bind_polymorphic_param_from_context(ptr noalias %0, ptr %"\CF\84_0_1") // CHECK: entry: // CHECK: [[TMP:%.*]] = call swiftcc %swift.metadata_response @"$s23partial_apply_forwarder12BaseProducerVMa"([[INT]] 255, ptr %"\CF\84_0_1") // CHECK: [[BPTYPE:%.*]] = extractvalue %swift.metadata_response [[TMP]], 0 @@ -104,7 +104,7 @@ bb0(%0 : $*Ï„_0_1): return %9 : $@callee_owned () -> () } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @bind_polymorphic_param_from_context_2(ptr noalias nocapture %0, ptr %"\CF\84_0_1") +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @bind_polymorphic_param_from_context_2(ptr noalias %0, ptr %"\CF\84_0_1") // CHECK: [[OBJ:%.*]] = call {{.*}} @swift_allocObject // CHECK: [[REF:%.*]] = call {{.*}} @swift_allocObject // CHECK: [[CLOSURE:%.*]] = insertvalue { ptr, ptr } { ptr @"$s15takingQAndEmptyTA{{(\.ptrauth)?}}", ptr undef }, ptr [[REF]], 1 @@ -117,7 +117,7 @@ bb0(%0 : $*Ï„_0_1, %2: $EmptyType): return %9 : $@callee_owned () -> () } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @bind_polymorphic_param_from_context_3(ptr noalias nocapture %0, ptr %"\CF\84_0_1") +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @bind_polymorphic_param_from_context_3(ptr noalias %0, ptr %"\CF\84_0_1") // CHECK: [[OBJ:%.*]] = call {{.*}} @swift_allocObject // CHECK: [[REF:%.*]] = call {{.*}} @swift_allocObject // CHECK: [[CLOSURE:%.*]] = insertvalue { ptr, ptr } { ptr @"$s15takingEmptyAndQTA{{(\.ptrauth)?}}", ptr undef }, ptr [[REF]], 1 @@ -131,7 +131,7 @@ bb0(%0 : $*Ï„_0_1, %2: $EmptyType): return %9 : $@callee_owned () -> () } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @bind_polymorphic_param_from_forwarder_parameter(ptr noalias nocapture %0, ptr %"\CF\84_0_1") +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @bind_polymorphic_param_from_forwarder_parameter(ptr noalias %0, ptr %"\CF\84_0_1") // CHECK: entry: // CHECK: [[TMP:%.*]] = call swiftcc %swift.metadata_response @"$s23partial_apply_forwarder12BaseProducerVMa"([[INT]] 255, ptr %"\CF\84_0_1") // CHECK: [[BPTY:%.*]] = extractvalue %swift.metadata_response [[TMP]], 0 @@ -160,7 +160,7 @@ struct S { sil hidden_external @takingQAndS : $@convention(thin) <Ï„_0_0 where Ï„_0_0 : Q> (S, @owned WeakBox<Ï„_0_0>) -> () -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc {{.*}} @bind_polymorphic_param_from_context_with_layout(ptr noalias nocapture %0, i64 %1, ptr %"\CF\84_0_1") +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc {{.*}} @bind_polymorphic_param_from_context_with_layout(ptr noalias %0, i64 %1, ptr %"\CF\84_0_1") // CHECK: entry: // CHECK: [[TMP:%.*]] = call swiftcc %swift.metadata_response @"$s23partial_apply_forwarder12BaseProducerVMa"([[INT]] 255, ptr %"\CF\84_0_1") // CHECK: [[BPTY:%.*]] = extractvalue %swift.metadata_response [[TMP]], 0 diff --git a/test/IRGen/partial_apply_generic.swift b/test/IRGen/partial_apply_generic.swift index aae066167c2e7..20796c87214f0 100644 --- a/test/IRGen/partial_apply_generic.swift +++ b/test/IRGen/partial_apply_generic.swift @@ -38,7 +38,7 @@ var x = seq ~> split // // CHECK-LABEL: define internal swiftcc { ptr, ptr } @"$s21partial_apply_generic5split{{[_0-9a-zA-Z]*}}FTA"(ptr noalias nocapture %0, ptr swiftself %1) -// CHECK: tail call swiftcc { ptr, ptr } @"$s21partial_apply_generic5split{{[_0-9a-zA-Z]*}}F"(ptr noalias nocapture %0, +// CHECK: tail call swiftcc { ptr, ptr } @"$s21partial_apply_generic5split{{[_0-9a-zA-Z]*}}F"(ptr noalias %0, struct HugeStruct { var a, b, c, d: Int } struct S { diff --git a/test/IRGen/prespecialized-metadata/class-fileprivate-2argument-1_distinct_use-1st_argument_generic_class-2nd_argument_distinct_generic_class.swift b/test/IRGen/prespecialized-metadata/class-fileprivate-2argument-1_distinct_use-1st_argument_generic_class-2nd_argument_distinct_generic_class.swift index 1baaeca7918b5..669befcdf4315 100644 --- a/test/IRGen/prespecialized-metadata/class-fileprivate-2argument-1_distinct_use-1st_argument_generic_class-2nd_argument_distinct_generic_class.swift +++ b/test/IRGen/prespecialized-metadata/class-fileprivate-2argument-1_distinct_use-1st_argument_generic_class-2nd_argument_distinct_generic_class.swift @@ -109,7 +109,7 @@ func consume(_ t: T) { // CHECK: [[METADATA_RESPONSE:%[0-9]+]] = call swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_4:[0-9A-Z_]+]]LLCyAA9Argument1ACLLCySiGAA9Argument2ACLLCySSGGMb"([[INT]] 0) // CHECK: [[METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[METADATA_RESPONSE]], 0 // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[METADATA]]) // CHECK: } func doit() { diff --git a/test/IRGen/prespecialized-metadata/class-fileprivate-2argument-1_distinct_use-1st_argument_generic_class-2nd_argument_same_generic_class_different_value.swift b/test/IRGen/prespecialized-metadata/class-fileprivate-2argument-1_distinct_use-1st_argument_generic_class-2nd_argument_same_generic_class_different_value.swift index 67c65f0d164a2..4768fd3af5954 100644 --- a/test/IRGen/prespecialized-metadata/class-fileprivate-2argument-1_distinct_use-1st_argument_generic_class-2nd_argument_same_generic_class_different_value.swift +++ b/test/IRGen/prespecialized-metadata/class-fileprivate-2argument-1_distinct_use-1st_argument_generic_class-2nd_argument_same_generic_class_different_value.swift @@ -101,7 +101,7 @@ func consume(_ t: T) { // CHECK: [[METADATA_RESPONSE:%[0-9]+]] = call swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_4:[0-9A-Z_]+]]LLCyAA9Argument1ACLLCySiGAFySSGGMb"([[INT]] 0) // CHECK: [[METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[METADATA_RESPONSE]], 0 // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[METADATA]]) // CHECK: } func doit() { diff --git a/test/IRGen/prespecialized-metadata/class-fileprivate-2argument-1_distinct_use-1st_argument_generic_class-2nd_argument_same_generic_class_same_value.swift b/test/IRGen/prespecialized-metadata/class-fileprivate-2argument-1_distinct_use-1st_argument_generic_class-2nd_argument_same_generic_class_same_value.swift index 18172eba21d57..1c39ba896d90e 100644 --- a/test/IRGen/prespecialized-metadata/class-fileprivate-2argument-1_distinct_use-1st_argument_generic_class-2nd_argument_same_generic_class_same_value.swift +++ b/test/IRGen/prespecialized-metadata/class-fileprivate-2argument-1_distinct_use-1st_argument_generic_class-2nd_argument_same_generic_class_same_value.swift @@ -100,7 +100,7 @@ func consume(_ t: T) { // CHECK: [[METADATA_RESPONSE:%[0-9]+]] = call swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_4:[0-9A-Z_]+]]LLCyAA9Argument1ACLLCySiGAGGMb"([[INT]] 0) // CHECK: [[METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[METADATA_RESPONSE]], 0 // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[METADATA]]) // CHECK: } func doit() { diff --git a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_con_int-2nd_anc_gen-1st-arg_con_double.swift b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_con_int-2nd_anc_gen-1st-arg_con_double.swift index 470f90e874d84..fa6d2aeb409b9 100644 --- a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_con_int-2nd_anc_gen-1st-arg_con_double.swift +++ b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_con_int-2nd_anc_gen-1st-arg_con_double.swift @@ -114,7 +114,7 @@ func consume(_ t: T) { // CHECK: [[METADATA_RESPONSE:%[0-9]+]] = call swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]CySSGMb"([[INT]] 0) // CHECK: [[METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[METADATA_RESPONSE]], 0 // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[METADATA]]) // CHECK: } func doit() { diff --git a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_con_int-2nd_anc_gen-1st-arg_subclass_arg.swift b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_con_int-2nd_anc_gen-1st-arg_subclass_arg.swift index bbe7e9d2ee864..1a59f41d03ac0 100644 --- a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_con_int-2nd_anc_gen-1st-arg_subclass_arg.swift +++ b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_con_int-2nd_anc_gen-1st-arg_subclass_arg.swift @@ -112,7 +112,7 @@ func consume(_ t: T) { // CHECK: [[METADATA_RESPONSE:%[0-9]+]] = call swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]CySSGMb"([[INT]] 0) // CHECK: [[METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[METADATA_RESPONSE]], 0 // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[METADATA]]) // CHECK: } func doit() { diff --git a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_subclass_arg-2nd_anc_gen-1st-arg_con_int.swift b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_subclass_arg-2nd_anc_gen-1st-arg_con_int.swift index 45372e338f0e3..09e1dbeef4440 100644 --- a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_subclass_arg-2nd_anc_gen-1st-arg_con_int.swift +++ b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_subclass_arg-2nd_anc_gen-1st-arg_con_int.swift @@ -112,7 +112,7 @@ func consume(_ t: T) { // CHECK: [[METADATA_RESPONSE:%[0-9]+]] = call swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]LLCySSGMb"([[INT]] 0) // CHECK: [[METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[METADATA_RESPONSE]], 0 // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[METADATA]]) // CHECK: } func doit() { diff --git a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_subcls_arg-2nd_anc_gen-1st-arg_subcls_arg.swift b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_subcls_arg-2nd_anc_gen-1st-arg_subcls_arg.swift index bdcd47afa2044..17cd4e844ded1 100644 --- a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_subcls_arg-2nd_anc_gen-1st-arg_subcls_arg.swift +++ b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1arg-2ancs-1distinct_use-1st_anc_gen-1arg-1st_arg_subcls_arg-2nd_anc_gen-1st-arg_subcls_arg.swift @@ -110,7 +110,7 @@ func consume(_ t: T) { // CHECK: [[METADATA_RESPONSE:%[0-9]+]] = call swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_1]]LLCySiGMb"([[INT]] 0) // CHECK: [[METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[METADATA_RESPONSE]], 0 // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[METADATA]]) // CHECK: } func doit() { diff --git a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use.swift index 086c6b7d3cf39..a357b2b5e5025 100644 --- a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use.swift @@ -77,7 +77,7 @@ func consume(_ t: T) { // CHECK: [[METADATA_RESPONSE:%[0-9]+]] = call swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_4:[0-9A-Z_]+]]CySiGMb"([[INT]] 0) // CHECK: [[METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[METADATA_RESPONSE]], 0 // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[METADATA]]) // CHECK: } func doit() { diff --git a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_class.swift b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_class.swift index 27f44facf8832..5fccc4b0b8168 100644 --- a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_class.swift +++ b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_class.swift @@ -36,11 +36,11 @@ func consume(_ t: T) { // CHECK: [[METADATA:%[0-9]+]] = call ptr @__swift_instantiateConcreteTypeFromMangledName( // CHECK-SAME: @"$s4main5Value[[UNIQUE_ID_1:[A-Za-z0-9_]+]]LLCyAA3BoxACLLCGMD" // CHECK: {{%[0-9]+}} = call swiftcc ptr @"$s4main5Value[[UNIQUE_ID_1]]LLC5firstADyxGx_tcfC"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr swiftself [[METADATA]] // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[METADATA]]) // CHECK: } func doit() { diff --git a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_function.swift b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_function.swift index 52d8b90c2d0ea..32939479724dd 100644 --- a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_function.swift +++ b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_function.swift @@ -26,11 +26,11 @@ func consume(_ t: T) { // CHECK: [[METADATA:%[0-9]+]] = call ptr @__swift_instantiateConcreteTypeFromMangledName( // CHECK-SAME: @"$s4main5Value[[UNIQUE_ID_1:[A-Za-z0-9_]+]]LLCySSSicGMD" // CHECK: {{%[0-9]+}} = call swiftcc ptr @"$s4main5Value[[UNIQUE_ID_1]]LLC5firstADyxGx_tcfC"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr swiftself [[METADATA]] // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[METADATA]]) // CHECK: } func doit() { diff --git a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_generic_class.swift b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_generic_class.swift index c51c81eae31c2..3d1a8f7ad0878 100644 --- a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_generic_class.swift +++ b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_generic_class.swift @@ -92,7 +92,7 @@ func consume(_ t: T) { // CHECK: [[METADATA_RESPONSE:%[0-9]+]] = call swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_4:[0-9A-Z_]+]]LLCyAA3BoxACLLCySiGGMb"([[INT]] 0) // CHECK: [[METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[METADATA_RESPONSE]], 0 // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[METADATA]]) // CHECK: } func doit() { diff --git a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_generic_class_specialized_at_generic_class.swift b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_generic_class_specialized_at_generic_class.swift index 39bc325a9e8ab..72f398fb65412 100644 --- a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_generic_class_specialized_at_generic_class.swift +++ b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_generic_class_specialized_at_generic_class.swift @@ -101,7 +101,7 @@ func consume(_ t: T) { // CHECK: [[METADATA_RESPONSE:%[0-9]+]] = call swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_4:[0-9A-Z_]+]]LLCyAA3BoxACLLCyAA5InnerACLLCySiGGGMb"([[INT]] 0) // CHECK: [[METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[METADATA_RESPONSE]], 0 // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[METADATA]]) // CHECK: } func doit() { diff --git a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_generic_enum.swift b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_generic_enum.swift index be14b785f6869..6d112b3f5d8af 100644 --- a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_generic_enum.swift +++ b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_generic_enum.swift @@ -117,7 +117,7 @@ func consume(_ t: T) { // CHECK: [[METADATA_RESPONSE:%[0-9]+]] = call swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_4:[0-9A-Z_]+]]CyAA6EitherACLLOySiGGMb"([[INT]] 0) // CHECK: [[METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[METADATA_RESPONSE]], 0 // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[METADATA]]) // CHECK: } func doit() { diff --git a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_generic_struct.swift b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_generic_struct.swift index ea5697f70f7bf..6e005b7735b0e 100644 --- a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_generic_struct.swift +++ b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_generic_struct.swift @@ -88,7 +88,7 @@ func consume(_ t: T) { // CHECK: [[METADATA_RESPONSE:%[0-9]+]] = call swiftcc %swift.metadata_response @"$s4main5Value[[UNIQUE_ID_4:[0-9A-Z_]+]]CyAA4LeftACLLVySiGGMb"([[INT]] 0) // CHECK: [[METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[METADATA_RESPONSE]], 0 // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[METADATA]]) // CHECK: } func doit() { diff --git a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_tuple.swift b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_tuple.swift index ad4d6d7dfe416..b8b5fba6ab306 100644 --- a/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_tuple.swift +++ b/test/IRGen/prespecialized-metadata/class-fileprivate-inmodule-1argument-1distinct_use_tuple.swift @@ -26,11 +26,11 @@ func consume(_ t: T) { // CHECK: [[METADATA:%[0-9]+]] = call ptr @__swift_instantiateConcreteTypeFromMangledName( // CHECK-SAME: @"$s4main5Value[[UNIQUE_ID_1:[A-Za-z0-9_]+]]LLCySi_SStGMD" // CHECK: {{%[0-9]+}} = call swiftcc ptr @"$s4main5Value[[UNIQUE_ID_1]]LLC5firstADyxGx_tcfC"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr swiftself [[METADATA]] // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[METADATA]]) // CHECK: } func doit() { diff --git a/test/IRGen/prespecialized-metadata/class-inmodule-0argument-within-class-1argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/class-inmodule-0argument-within-class-1argument-1distinct_use.swift index 8d7b6b7773a50..dc5e80430489c 100644 --- a/test/IRGen/prespecialized-metadata/class-inmodule-0argument-within-class-1argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/class-inmodule-0argument-within-class-1argument-1distinct_use.swift @@ -25,7 +25,7 @@ func consume(_ t: T) { // CHECK: entry: // CHECK: [[METADATA_RESPONSE:%[0-9]+]] = call swiftcc %swift.metadata_response @"$s4main9NamespaceCA2A4ZangCRszlE19ExtensionNonGenericCyAE_GMa"([[INT]] 0) // CHECK: [[METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[METADATA_RESPONSE]], 0 -// CHECK: call swiftcc void @"$s4main7consumeyyxlF"(ptr noalias nocapture {{%.*}}, ptr [[METADATA]]) +// CHECK: call swiftcc void @"$s4main7consumeyyxlF"(ptr noalias {{%.*}}, ptr [[METADATA]]) // CHECK: } func doit() { consume( Namespace.ExtensionNonGeneric() ) diff --git a/test/IRGen/prespecialized-metadata/enum-fileprivate-inmodule-1argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/enum-fileprivate-inmodule-1argument-1distinct_use.swift index 696b3ffea1868..bc6194a1ab7b7 100644 --- a/test/IRGen/prespecialized-metadata/enum-fileprivate-inmodule-1argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/enum-fileprivate-inmodule-1argument-1distinct_use.swift @@ -31,7 +31,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5Value[[UNIQUE_ID_1]]OySiGMf diff --git a/test/IRGen/prespecialized-metadata/enum-inmodule-0argument-within-class-1argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/enum-inmodule-0argument-within-class-1argument-1distinct_use.swift index e3eea1010b51b..b28cf83983c1f 100644 --- a/test/IRGen/prespecialized-metadata/enum-inmodule-0argument-within-class-1argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/enum-inmodule-0argument-within-class-1argument-1distinct_use.swift @@ -38,7 +38,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main9NamespaceC5ValueOySi_GMf diff --git a/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1conformance-1distinct_use.swift b/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1conformance-1distinct_use.swift index 53e80ddee8fd4..58eb75c03eb2c 100644 --- a/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1conformance-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1conformance-1distinct_use.swift @@ -37,7 +37,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueOySiGMf diff --git a/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1conformance-external_nonresilient-1distinct_use.swift b/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1conformance-external_nonresilient-1distinct_use.swift index b6b678ec366f9..36bf3dc544c95 100644 --- a/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1conformance-external_nonresilient-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1conformance-external_nonresilient-1distinct_use.swift @@ -31,7 +31,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueOyS2i10TestModule1PAAyHCg_GMf diff --git a/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1conformance-external_resilient-1distinct_use.swift b/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1conformance-external_resilient-1distinct_use.swift index 1edc30ea5a39c..4a51083dba89e 100644 --- a/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1conformance-external_resilient-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1conformance-external_resilient-1distinct_use.swift @@ -33,7 +33,7 @@ func consume(_ t: T) { // CHECK: [[DEMANGLED_TYPE:%[0-9]+]] = call ptr @__swift_instantiateConcreteTypeFromMangledName( // CHECK-SAME: $s4main5ValueOyS2i10TestModule1PAAyHCg_GMD // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr [[DEMANGLED_TYPE]] // CHECK-SAME: ) // CHECK: } diff --git a/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1conformance-public-1distinct_use.swift b/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1conformance-public-1distinct_use.swift index 21369407deaff..bb089101b2c89 100644 --- a/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1conformance-public-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1conformance-public-1distinct_use.swift @@ -37,7 +37,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueOySiGMf diff --git a/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1distinct_generic_use.swift b/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1distinct_generic_use.swift index 53ee406d2e0a1..2338b4e045cc0 100644 --- a/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1distinct_generic_use.swift +++ b/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1distinct_generic_use.swift @@ -35,7 +35,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5OuterOyAA5InnerVySiGGMf diff --git a/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1distinct_use.swift index 01cbd4aebf33d..5342ad4b3ae36 100644 --- a/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-1distinct_use.swift @@ -47,7 +47,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: $s4main5ValueOySiGMf // CHECK-SAME: ) // CHECK: } diff --git a/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-within-class-1argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-within-class-1argument-1distinct_use.swift index 5729753f8fd83..bf4736c0c565e 100644 --- a/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-within-class-1argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-within-class-1argument-1distinct_use.swift @@ -35,7 +35,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main9NamespaceC5ValueOySS_SiGMf diff --git a/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-within-enum-1argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-within-enum-1argument-1distinct_use.swift index 6d628ecf42d6b..a008f2386ad8c 100644 --- a/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-within-enum-1argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-within-enum-1argument-1distinct_use.swift @@ -35,7 +35,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main9NamespaceO5ValueOySS_SiGMf diff --git a/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-within-struct-1argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-within-struct-1argument-1distinct_use.swift index 4b599e42a1233..9744757beaae3 100644 --- a/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-within-struct-1argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/enum-inmodule-1argument-within-struct-1argument-1distinct_use.swift @@ -35,7 +35,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main9NamespaceV5ValueOySS_SiGMf diff --git a/test/IRGen/prespecialized-metadata/enum-inmodule-2argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/enum-inmodule-2argument-1distinct_use.swift index 6eb25d005315a..be98d0074de45 100644 --- a/test/IRGen/prespecialized-metadata/enum-inmodule-2argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/enum-inmodule-2argument-1distinct_use.swift @@ -50,7 +50,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueOyS2iGMf{{[^,]}} diff --git a/test/IRGen/prespecialized-metadata/enum-inmodule-3argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/enum-inmodule-3argument-1distinct_use.swift index 6ded60f343274..77cb0f2fd207e 100644 --- a/test/IRGen/prespecialized-metadata/enum-inmodule-3argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/enum-inmodule-3argument-1distinct_use.swift @@ -52,7 +52,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueOyS3iGMf diff --git a/test/IRGen/prespecialized-metadata/enum-inmodule-4argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/enum-inmodule-4argument-1distinct_use.swift index 3f124178b158e..b5b50b429cc06 100644 --- a/test/IRGen/prespecialized-metadata/enum-inmodule-4argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/enum-inmodule-4argument-1distinct_use.swift @@ -54,7 +54,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueOyS4iGMf diff --git a/test/IRGen/prespecialized-metadata/enum-inmodule-5argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/enum-inmodule-5argument-1distinct_use.swift index 5162b0649d341..a0cc215c63be3 100644 --- a/test/IRGen/prespecialized-metadata/enum-inmodule-5argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/enum-inmodule-5argument-1distinct_use.swift @@ -52,7 +52,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueOyS5iGMf diff --git a/test/IRGen/prespecialized-metadata/enum-inmodule-evolution-1argument-1distinct_use-external_resilient-frozen.swift b/test/IRGen/prespecialized-metadata/enum-inmodule-evolution-1argument-1distinct_use-external_resilient-frozen.swift index b4e45d1aebc5a..87af5dd5e438b 100644 --- a/test/IRGen/prespecialized-metadata/enum-inmodule-evolution-1argument-1distinct_use-external_resilient-frozen.swift +++ b/test/IRGen/prespecialized-metadata/enum-inmodule-evolution-1argument-1distinct_use-external_resilient-frozen.swift @@ -37,7 +37,7 @@ enum Value { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueOy10TestModule7IntegerVGMf diff --git a/test/IRGen/prespecialized-metadata/enum-inmodule-evolution-1argument-1distinct_use-external_resilient-nonfrozen.swift b/test/IRGen/prespecialized-metadata/enum-inmodule-evolution-1argument-1distinct_use-external_resilient-nonfrozen.swift index 172d8736b8c0b..5fd3bcb80f122 100644 --- a/test/IRGen/prespecialized-metadata/enum-inmodule-evolution-1argument-1distinct_use-external_resilient-nonfrozen.swift +++ b/test/IRGen/prespecialized-metadata/enum-inmodule-evolution-1argument-1distinct_use-external_resilient-nonfrozen.swift @@ -25,7 +25,7 @@ enum Value { // CHECK: [[DEMANGLED_TYPE:%[0-9]+]] = call ptr @__swift_instantiateConcreteTypeFromMangledName( // CHECK-SAME: $s4main5ValueOy10TestModule7IntegerVGMD // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr [[DEMANGLED_TYPE]] // CHECK-SAME: ) // CHECK: } diff --git a/test/IRGen/prespecialized-metadata/enum-inmodule-evolution-1argument-1distinct_use-payload_size.swift b/test/IRGen/prespecialized-metadata/enum-inmodule-evolution-1argument-1distinct_use-payload_size.swift index eabab6ee9584f..1a123165c6e88 100644 --- a/test/IRGen/prespecialized-metadata/enum-inmodule-evolution-1argument-1distinct_use-payload_size.swift +++ b/test/IRGen/prespecialized-metadata/enum-inmodule-evolution-1argument-1distinct_use-payload_size.swift @@ -49,7 +49,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueOySiGMf diff --git a/test/IRGen/prespecialized-metadata/enum-outmodule-1argument-1distinct_use-struct-inmodule.swift b/test/IRGen/prespecialized-metadata/enum-outmodule-1argument-1distinct_use-struct-inmodule.swift index e01edaaf46c3a..0f158c37dbe54 100644 --- a/test/IRGen/prespecialized-metadata/enum-outmodule-1argument-1distinct_use-struct-inmodule.swift +++ b/test/IRGen/prespecialized-metadata/enum-outmodule-1argument-1distinct_use-struct-inmodule.swift @@ -54,7 +54,7 @@ struct TheArgument { // CHECK-SAME: ) // CHECK-NEXT: [[CANONICALIZED_METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[CANONICALIZED_METADATA_RESPONSE]], 0 // CHECK-NEXT: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[CANONICALIZED_METADATA]] // CHECK-SAME: ) // CHECK: } diff --git a/test/IRGen/prespecialized-metadata/struct-fileprivate-inmodule-1argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-fileprivate-inmodule-1argument-1distinct_use.swift index 0f2d2117ca3de..e73a67887e78c 100644 --- a/test/IRGen/prespecialized-metadata/struct-fileprivate-inmodule-1argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-fileprivate-inmodule-1argument-1distinct_use.swift @@ -34,7 +34,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5Value[[UNIQUE_ID_1]]VySiGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-0argument-within-class-1argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-0argument-within-class-1argument-1distinct_use.swift index d43bb84a8356d..80d4fb78c8ae7 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-0argument-within-class-1argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-0argument-within-class-1argument-1distinct_use.swift @@ -37,7 +37,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main9NamespaceC5ValueVySi_GMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-0argument.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-0argument.swift index 30fc49a068390..ff245a5fe2a5f 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-0argument.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-0argument.swift @@ -17,7 +17,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: <{ // CHECK-SAME: ptr, diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-1conformance-1distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-1conformance-1distinct_use.swift index 7e7855ecf927f..23c3570886abb 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-1conformance-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-1conformance-1distinct_use.swift @@ -40,7 +40,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySiGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-1distinct_generic_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-1distinct_generic_use.swift index fd5c64a7bffe6..11fc651e033be 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-1distinct_generic_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-1distinct_generic_use.swift @@ -24,8 +24,8 @@ func consume(_ t: T) { // themselves generic (Outer>, here), a direct reference to // the prespecialized metadata should be emitted here. // CHECK: call swiftcc void @"$s4main5OuterV5firstACyxGx_tcfC"( -// CHECK-SAME: ptr noalias nocapture sret({{.*}}) %{{[0-9]+}}, -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias sret({{.*}}) %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5InnerVySiGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-1distinct_use.swift index 03422eca17bbb..3daf8073fb062 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-1distinct_use.swift @@ -34,7 +34,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySiGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-2conformance-1distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-2conformance-1distinct_use.swift index 524a91a1848a0..3db214ef11f18 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-2conformance-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-2conformance-1distinct_use.swift @@ -44,7 +44,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySiGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-2distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-2distinct_use.swift index f9bd6b4dacfe4..95ff4c046e2d7 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-2distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-2distinct_use.swift @@ -51,7 +51,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySiGMf @@ -60,7 +60,7 @@ func consume(_ t: T) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySdGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-3conformance-1distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-3conformance-1distinct_use.swift index 3d8d97367092e..ea856289c9aee 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-3conformance-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-3conformance-1distinct_use.swift @@ -48,7 +48,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySiGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-3distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-3distinct_use.swift index 3440c5bc39f69..a9d72b817d128 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-3distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-3distinct_use.swift @@ -62,7 +62,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySiGMf @@ -71,7 +71,7 @@ func consume(_ t: T) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySdGMf @@ -80,7 +80,7 @@ func consume(_ t: T) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySSGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-4conformance-1distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-4conformance-1distinct_use.swift index 336dc20fca9ec..95edfb7095d10 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-4conformance-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-4conformance-1distinct_use.swift @@ -52,7 +52,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySiGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-4distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-4distinct_use.swift index 36aa26a6338b6..402a57af7f11f 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-4distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-4distinct_use.swift @@ -74,7 +74,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySiGMf @@ -83,7 +83,7 @@ func consume(_ t: T) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySdGMf @@ -92,7 +92,7 @@ func consume(_ t: T) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySSGMf @@ -101,7 +101,7 @@ func consume(_ t: T) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVys5UInt8VGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-5conformance-1distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-5conformance-1distinct_use.swift index 74bbe4b9b09ef..de1efc39e47f5 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-5conformance-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-5conformance-1distinct_use.swift @@ -56,7 +56,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySiGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-5distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-5distinct_use.swift index 27e3dddfc6755..d4b65536d7169 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-5distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-5distinct_use.swift @@ -110,7 +110,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySiGMf @@ -119,7 +119,7 @@ func consume(_ t: T) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySdGMf @@ -128,7 +128,7 @@ func consume(_ t: T) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySSGMf @@ -137,7 +137,7 @@ func consume(_ t: T) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVys5UInt8VGMf @@ -146,7 +146,7 @@ func consume(_ t: T) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVys4Int8VGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-clang_node-1distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-clang_node-1distinct_use.swift index 6244d782844c9..8105f233e71f2 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-clang_node-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-clang_node-1distinct_use.swift @@ -28,7 +28,7 @@ struct Value { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: [[TYPE:%[0-9]+]] = call ptr @__swift_instantiateConcreteTypeFromMangledName(ptr @"$s4main5ValueVySo12NSDictionaryCGMD") // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%.*}}, +// CHECK-SAME: ptr noalias {{%.*}}, // CHECK-SAME: ptr [[TYPE]]) // CHECK: } func doit() { diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-within-class-1argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-within-class-1argument-1distinct_use.swift index d33c70b2b3b38..c4cd3202d353f 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-within-class-1argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-within-class-1argument-1distinct_use.swift @@ -38,7 +38,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main9NamespaceC5ValueVySS_SiGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-within-enum-1argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-within-enum-1argument-1distinct_use.swift index 2ffc8393ea873..e5d5506066ca9 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-within-enum-1argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-within-enum-1argument-1distinct_use.swift @@ -38,7 +38,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main9NamespaceO5ValueVySS_SiGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-within-struct-1argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-within-struct-1argument-1distinct_use.swift index c838e3327c53e..4d19b773f96e3 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-within-struct-1argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-within-struct-1argument-1distinct_use.swift @@ -38,7 +38,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main9NamespaceV5ValueVySS_SiGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-within-struct-2argument-constrained_extension-equal_arguments-1distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-within-struct-2argument-constrained_extension-equal_arguments-1distinct_use.swift index c753f1850441f..d65e92c976b49 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-within-struct-2argument-constrained_extension-equal_arguments-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-1argument-within-struct-2argument-constrained_extension-equal_arguments-1distinct_use.swift @@ -45,7 +45,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main9NamespaceVAAq_RszrlE5ValueVyS2i_SSGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-1distinct_use.swift index b0b90887e11b8..4b293b59fd6c3 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-1distinct_use.swift @@ -43,7 +43,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVyS2iGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-2distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-2distinct_use.swift index c94a45ea632b1..a1aee0bcdf8ef 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-2distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-2distinct_use.swift @@ -69,7 +69,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVyS2iGMf @@ -78,7 +78,7 @@ func consume(_ t: T) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySdSiGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-3distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-3distinct_use.swift index 86bbd300225d2..a9c7c567a98e3 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-3distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-3distinct_use.swift @@ -95,7 +95,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVyS2iGMf @@ -104,7 +104,7 @@ func consume(_ t: T) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySdSiGMf @@ -113,7 +113,7 @@ func consume(_ t: T) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySSSdGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-4distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-4distinct_use.swift index b0e0f846518a3..c040cdac82dc3 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-4distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-4distinct_use.swift @@ -121,7 +121,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVyS2iGMf @@ -130,7 +130,7 @@ func consume(_ t: T) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySdSiGMf @@ -139,7 +139,7 @@ func consume(_ t: T) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySSSdGMf @@ -148,7 +148,7 @@ func consume(_ t: T) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVys5UInt8VSSGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-5distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-5distinct_use.swift index d0c2fe82a28d5..72673ebc7cdd3 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-5distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-5distinct_use.swift @@ -203,7 +203,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVyS2iGMf @@ -212,7 +212,7 @@ func consume(_ t: T) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySdSiGMf @@ -221,7 +221,7 @@ func consume(_ t: T) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySSSdGMf @@ -230,7 +230,7 @@ func consume(_ t: T) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVys5UInt8VSSGMf @@ -239,7 +239,7 @@ func consume(_ t: T) { // CHECK-SAME: ) // CHECK-SAME: ) // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVys4Int8Vs5UInt8VGMf diff --git a/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-within-class-1argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-within-class-1argument-1distinct_use.swift index 478f5c5989056..cf39590dc2168 100644 --- a/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-within-class-1argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-inmodule-2argument-within-class-1argument-1distinct_use.swift @@ -46,7 +46,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main9NamespaceC5ValueVySS_SiSdGMf diff --git a/test/IRGen/prespecialized-metadata/struct-outmodule-1argument-1distinct_use-struct-inmodule.swift b/test/IRGen/prespecialized-metadata/struct-outmodule-1argument-1distinct_use-struct-inmodule.swift index 8c607eeb72238..85e9dacf666f3 100644 --- a/test/IRGen/prespecialized-metadata/struct-outmodule-1argument-1distinct_use-struct-inmodule.swift +++ b/test/IRGen/prespecialized-metadata/struct-outmodule-1argument-1distinct_use-struct-inmodule.swift @@ -61,7 +61,7 @@ struct TheArgument { // CHECK-SAME: ) // CHECK-NEXT: [[CANONICALIZED_METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[CANONICALIZED_METADATA_RESPONSE]], 0 // CHECK-NEXT: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[CANONICALIZED_METADATA]] // CHECK-SAME: ) // CHECK: } diff --git a/test/IRGen/prespecialized-metadata/struct-outmodule-1argument-1distinct_use-struct-outmodule-othermodule.swift b/test/IRGen/prespecialized-metadata/struct-outmodule-1argument-1distinct_use-struct-outmodule-othermodule.swift index 16304a03e5b1a..dfa08ca44f158 100644 --- a/test/IRGen/prespecialized-metadata/struct-outmodule-1argument-1distinct_use-struct-outmodule-othermodule.swift +++ b/test/IRGen/prespecialized-metadata/struct-outmodule-1argument-1distinct_use-struct-outmodule-othermodule.swift @@ -55,7 +55,7 @@ import Argument // CHECK-SAME: $s7Generic11OneArgumentVy0C07IntegerVGMJ // CHECK-NEXT: [[CANONICALIZED_METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[CANONICALIZED_METADATA_RESPONSE]], 0 // CHECK-NEXT: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[CANONICALIZED_METADATA]] // CHECK-SAME: ) // CHECK: } diff --git a/test/IRGen/prespecialized-metadata/struct-outmodule-1argument-1distinct_use-struct-outmodule-samemodule.swift b/test/IRGen/prespecialized-metadata/struct-outmodule-1argument-1distinct_use-struct-outmodule-samemodule.swift index 60bff8f5d1a27..9455bb8c90726 100644 --- a/test/IRGen/prespecialized-metadata/struct-outmodule-1argument-1distinct_use-struct-outmodule-samemodule.swift +++ b/test/IRGen/prespecialized-metadata/struct-outmodule-1argument-1distinct_use-struct-outmodule-samemodule.swift @@ -51,7 +51,7 @@ import Argument // CHECK-SAME: $s8Argument03OneA0VyAA7IntegerVGMJ // CHECK-NEXT: [[CANONICALIZED_METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[CANONICALIZED_METADATA_RESPONSE]], 0 // CHECK-NEXT: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[CANONICALIZED_METADATA]] // CHECK-SAME: ) // CHECK: } diff --git a/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_protocol_inmodule.swift b/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_protocol_inmodule.swift index 49432bb9f5d1c..8827a32ea96c0 100644 --- a/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_protocol_inmodule.swift +++ b/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_protocol_inmodule.swift @@ -55,7 +55,7 @@ import Argument // CHECK-SAME: ) // CHECK-NEXT: [[CANONICALIZED_METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[CANONICALIZED_METADATA_RESPONSE]], 0 // CHECK-NEXT: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[CANONICALIZED_METADATA]] // CHECK-SAME: ) // CHECK: } diff --git a/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_protocol_outmodule_othermodule.swift b/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_protocol_outmodule_othermodule.swift index 6c986deb99393..4e9836168dcc7 100644 --- a/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_protocol_outmodule_othermodule.swift +++ b/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_protocol_outmodule_othermodule.swift @@ -51,7 +51,7 @@ import Argument // CHECK-SAME: ) // CHECK-NEXT: [[CANONICALIZED_METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[CANONICALIZED_METADATA_RESPONSE]], 0 // CHECK-NEXT: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[CANONICALIZED_METADATA]] // CHECK-SAME: ) // CHECK: } diff --git a/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_protocol_outmodule_samemodule.swift b/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_protocol_outmodule_samemodule.swift index c5c4e52a516e0..905e3c113d629 100644 --- a/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_protocol_outmodule_samemodule.swift +++ b/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_protocol_outmodule_samemodule.swift @@ -49,7 +49,7 @@ import Argument // CHECK-SAME: ) // CHECK-NEXT: [[CANONICALIZED_METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[CANONICALIZED_METADATA_RESPONSE]], 0 // CHECK-NEXT: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[CANONICALIZED_METADATA]] // CHECK-SAME: ) // CHECK: } diff --git a/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_struct_inmodule.swift b/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_struct_inmodule.swift index 7c5d1b3a85902..7a8c3d47ec577 100644 --- a/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_struct_inmodule.swift +++ b/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_struct_inmodule.swift @@ -60,7 +60,7 @@ struct AnotherArgument { // CHECK-SAME: ) // CHECK-NEXT: [[CANONICALIZED_METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[CANONICALIZED_METADATA_RESPONSE]], 0 // CHECK-NEXT: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[CANONICALIZED_METADATA]] // CHECK-SAME: ) // CHECK: } diff --git a/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_struct_outmodule_othermodule.swift b/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_struct_outmodule_othermodule.swift index 9d89c6b46d0a1..ed53e2f7d5a9f 100644 --- a/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_struct_outmodule_othermodule.swift +++ b/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_struct_outmodule_othermodule.swift @@ -53,7 +53,7 @@ import Argument // CHECK-SAME: ) // CHECK-NEXT: [[CANONICALIZED_METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[CANONICALIZED_METADATA_RESPONSE]], 0 // CHECK-NEXT: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[CANONICALIZED_METADATA]] // CHECK-SAME: ) // CHECK: } diff --git a/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_struct_outmodule_samemodule.swift b/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_struct_outmodule_samemodule.swift index 5ea3fb5902a80..0ccc2af8d4c1e 100644 --- a/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_struct_outmodule_samemodule.swift +++ b/test/IRGen/prespecialized-metadata/struct-outmodule-2argument-1du-1arg_struct_outmodule_samemodule-2arg_struct_outmodule_samemodule.swift @@ -56,7 +56,7 @@ import Argument // CHECK-SAME: ) // CHECK-NEXT: [[CANONICALIZED_METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[CANONICALIZED_METADATA_RESPONSE]], 0 // CHECK-NEXT: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[CANONICALIZED_METADATA]] // CHECK-SAME: ) // CHECK: } diff --git a/test/IRGen/prespecialized-metadata/struct-outmodule-frozen-1argument-1distinct_use-struct-inmodule.swift b/test/IRGen/prespecialized-metadata/struct-outmodule-frozen-1argument-1distinct_use-struct-inmodule.swift index 3f096357d9cce..c91f2fdfbf411 100644 --- a/test/IRGen/prespecialized-metadata/struct-outmodule-frozen-1argument-1distinct_use-struct-inmodule.swift +++ b/test/IRGen/prespecialized-metadata/struct-outmodule-frozen-1argument-1distinct_use-struct-inmodule.swift @@ -59,7 +59,7 @@ struct TheArgument { // CHECK-SAME: ) // CHECK-NEXT: [[CANONICALIZED_METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[CANONICALIZED_METADATA_RESPONSE]], 0 // CHECK-NEXT: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[CANONICALIZED_METADATA]] // CHECK-SAME: ) // CHECK: } diff --git a/test/IRGen/prespecialized-metadata/struct-outmodule-frozen-1argument-1distinct_use-struct-outmodule-frozen-othermodule.swift b/test/IRGen/prespecialized-metadata/struct-outmodule-frozen-1argument-1distinct_use-struct-outmodule-frozen-othermodule.swift index a39ff66d95eb0..cfabc650a5048 100644 --- a/test/IRGen/prespecialized-metadata/struct-outmodule-frozen-1argument-1distinct_use-struct-outmodule-frozen-othermodule.swift +++ b/test/IRGen/prespecialized-metadata/struct-outmodule-frozen-1argument-1distinct_use-struct-outmodule-frozen-othermodule.swift @@ -54,7 +54,7 @@ import Argument // CHECK-SAME: ) // CHECK-NEXT: [[CANONICALIZED_METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[CANONICALIZED_METADATA_RESPONSE]], 0 // CHECK-NEXT: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[CANONICALIZED_METADATA]] // CHECK-SAME: ) // CHECK: } diff --git a/test/IRGen/prespecialized-metadata/struct-outmodule-frozen-1argument-1distinct_use-struct-outmodule-frozen-samemodule.swift b/test/IRGen/prespecialized-metadata/struct-outmodule-frozen-1argument-1distinct_use-struct-outmodule-frozen-samemodule.swift index 86959146659a2..e12083e039daf 100644 --- a/test/IRGen/prespecialized-metadata/struct-outmodule-frozen-1argument-1distinct_use-struct-outmodule-frozen-samemodule.swift +++ b/test/IRGen/prespecialized-metadata/struct-outmodule-frozen-1argument-1distinct_use-struct-outmodule-frozen-samemodule.swift @@ -52,7 +52,7 @@ import Generic // CHECK-SAME: ) // CHECK-NEXT: [[CANONICALIZED_METADATA:%[0-9]+]] = extractvalue %swift.metadata_response [[CANONICALIZED_METADATA_RESPONSE]], 0 // CHECK-NEXT: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture {{%[0-9]+}}, +// CHECK-SAME: ptr noalias {{%[0-9]+}}, // CHECK-SAME: ptr [[CANONICALIZED_METADATA]] // CHECK-SAME: ) // CHECK: } diff --git a/test/IRGen/prespecialized-metadata/struct-outmodule-frozen-1argument-1distinct_use-struct-outmodule-resilient-othermodule.swift b/test/IRGen/prespecialized-metadata/struct-outmodule-frozen-1argument-1distinct_use-struct-outmodule-resilient-othermodule.swift index 047d0178134db..fdf587386a0fa 100644 --- a/test/IRGen/prespecialized-metadata/struct-outmodule-frozen-1argument-1distinct_use-struct-outmodule-resilient-othermodule.swift +++ b/test/IRGen/prespecialized-metadata/struct-outmodule-frozen-1argument-1distinct_use-struct-outmodule-resilient-othermodule.swift @@ -21,7 +21,7 @@ import Argument // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: [[METADATA:%[0-9]+]] = call ptr @__swift_instantiateConcreteTypeFromMangledName(ptr @"$s7Generic11OneArgumentVy0C07IntegerVGMD") -// CHECK: call swiftcc void @"$s4main7consumeyyxlF"(ptr noalias nocapture {{%[0-9]+}}, ptr [[METADATA]]) +// CHECK: call swiftcc void @"$s4main7consumeyyxlF"(ptr noalias {{%[0-9]+}}, ptr [[METADATA]]) // CHECK: } func doit() { consume( OneArgument(Integer(13)) ) diff --git a/test/IRGen/prespecialized-metadata/struct-outmodule-frozen-1argument-1distinct_use-struct-outmodule-resilient-samemodule.swift b/test/IRGen/prespecialized-metadata/struct-outmodule-frozen-1argument-1distinct_use-struct-outmodule-resilient-samemodule.swift index 9ddd6ef077828..a9ad475f097e5 100644 --- a/test/IRGen/prespecialized-metadata/struct-outmodule-frozen-1argument-1distinct_use-struct-outmodule-resilient-samemodule.swift +++ b/test/IRGen/prespecialized-metadata/struct-outmodule-frozen-1argument-1distinct_use-struct-outmodule-resilient-samemodule.swift @@ -19,7 +19,7 @@ import Generic // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: [[METADATA:%[0-9]+]] = call ptr @__swift_instantiateConcreteTypeFromMangledName(ptr @"$s7Generic11OneArgumentVyAA7IntegerVGMD") -// CHECK: call swiftcc void @"$s4main7consumeyyxlF"(ptr noalias nocapture {{%[0-9]+}}, ptr [[METADATA]]) +// CHECK: call swiftcc void @"$s4main7consumeyyxlF"(ptr noalias {{%[0-9]+}}, ptr [[METADATA]]) // CHECK: } func doit() { consume( OneArgument(Integer(13)) ) diff --git a/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-inmodule.swift b/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-inmodule.swift index cffdab3c0b1f6..dabfd461bb6ea 100644 --- a/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-inmodule.swift +++ b/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-inmodule.swift @@ -23,7 +23,7 @@ struct TheArgument { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: [[METADATA:%[0-9]+]] = call ptr @__swift_instantiateConcreteTypeFromMangledName(ptr @"$s7Generic11OneArgumentVy4main03TheC0VGMD") -// CHECK: call swiftcc void @"$s4main7consumeyyxlF"(ptr noalias nocapture {{%[0-9]+}}, ptr [[METADATA]]) +// CHECK: call swiftcc void @"$s4main7consumeyyxlF"(ptr noalias {{%[0-9]+}}, ptr [[METADATA]]) // CHECK: } func doit() { consume( OneArgument(TheArgument(value: 13)) ) diff --git a/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-outmodule-frozen-othermodule.swift b/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-outmodule-frozen-othermodule.swift index 5b27d8a167c02..d1b212c54f338 100644 --- a/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-outmodule-frozen-othermodule.swift +++ b/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-outmodule-frozen-othermodule.swift @@ -21,7 +21,7 @@ import Argument // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: [[METADATA:%[0-9]+]] = call ptr @__swift_instantiateConcreteTypeFromMangledName(ptr @"$s7Generic11OneArgumentVy0C07IntegerVGMD") -// CHECK: call swiftcc void @"$s4main7consumeyyxlF"(ptr noalias nocapture {{%[0-9]+}}, ptr [[METADATA]]) +// CHECK: call swiftcc void @"$s4main7consumeyyxlF"(ptr noalias {{%[0-9]+}}, ptr [[METADATA]]) // CHECK: } func doit() { consume( OneArgument(Integer(13)) ) diff --git a/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-outmodule-frozen-samemodule.swift b/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-outmodule-frozen-samemodule.swift index c8d6dd13ed78c..0ef64d10cba37 100644 --- a/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-outmodule-frozen-samemodule.swift +++ b/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-outmodule-frozen-samemodule.swift @@ -19,7 +19,7 @@ import Generic // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: [[METADATA:%[0-9]+]] = call ptr @__swift_instantiateConcreteTypeFromMangledName(ptr @"$s7Generic11OneArgumentVyAA7IntegerVGMD") -// CHECK: call swiftcc void @"$s4main7consumeyyxlF"(ptr noalias nocapture {{%[0-9]+}}, ptr [[METADATA]]) +// CHECK: call swiftcc void @"$s4main7consumeyyxlF"(ptr noalias {{%[0-9]+}}, ptr [[METADATA]]) // CHECK: } func doit() { consume( OneArgument(Integer(13)) ) diff --git a/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-outmodule-othermodule.swift b/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-outmodule-othermodule.swift index b00db8bf47aa2..4511a39f30c52 100644 --- a/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-outmodule-othermodule.swift +++ b/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-outmodule-othermodule.swift @@ -21,7 +21,7 @@ import Argument // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: [[METADATA:%[0-9]+]] = call ptr @__swift_instantiateConcreteTypeFromMangledName(ptr @"$s7Generic11OneArgumentVy0C07IntegerVGMD") -// CHECK: call swiftcc void @"$s4main7consumeyyxlF"(ptr noalias nocapture {{%[0-9]+}}, ptr [[METADATA]]) +// CHECK: call swiftcc void @"$s4main7consumeyyxlF"(ptr noalias {{%[0-9]+}}, ptr [[METADATA]]) // CHECK: } func doit() { consume( OneArgument(Integer(13)) ) diff --git a/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-outmodule-resilient-othermodule.swift b/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-outmodule-resilient-othermodule.swift index 788d6c5a2fe00..7bac2a4771bad 100644 --- a/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-outmodule-resilient-othermodule.swift +++ b/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-outmodule-resilient-othermodule.swift @@ -21,7 +21,7 @@ import Argument // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: [[METADATA:%[0-9]+]] = call ptr @__swift_instantiateConcreteTypeFromMangledName(ptr @"$s7Generic11OneArgumentVy0C07IntegerVGMD") -// CHECK: call swiftcc void @"$s4main7consumeyyxlF"(ptr noalias nocapture {{%[0-9]+}}, ptr [[METADATA]]) +// CHECK: call swiftcc void @"$s4main7consumeyyxlF"(ptr noalias {{%[0-9]+}}, ptr [[METADATA]]) // CHECK: } func doit() { consume( OneArgument(Integer(13)) ) diff --git a/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-outmodule-resilient-samemodule.swift b/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-outmodule-resilient-samemodule.swift index 9fca340d3c03a..ccadd40a53a4f 100644 --- a/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-outmodule-resilient-samemodule.swift +++ b/test/IRGen/prespecialized-metadata/struct-outmodule-resilient-1argument-1distinct_use-struct-outmodule-resilient-samemodule.swift @@ -19,7 +19,7 @@ import Generic // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: [[METADATA:%[0-9]+]] = call ptr @__swift_instantiateConcreteTypeFromMangledName(ptr @"$s7Generic11OneArgumentVyAA7IntegerVGMD") -// CHECK: call swiftcc void @"$s4main7consumeyyxlF"(ptr noalias nocapture {{%[0-9]+}}, ptr [[METADATA]]) +// CHECK: call swiftcc void @"$s4main7consumeyyxlF"(ptr noalias {{%[0-9]+}}, ptr [[METADATA]]) // CHECK: } func doit() { consume( OneArgument(Integer(13)) ) diff --git a/test/IRGen/prespecialized-metadata/struct-public-inmodule-1argument-1distinct_use.swift b/test/IRGen/prespecialized-metadata/struct-public-inmodule-1argument-1distinct_use.swift index 08e1b5fb92886..afdfe16a87b56 100644 --- a/test/IRGen/prespecialized-metadata/struct-public-inmodule-1argument-1distinct_use.swift +++ b/test/IRGen/prespecialized-metadata/struct-public-inmodule-1argument-1distinct_use.swift @@ -35,7 +35,7 @@ func consume(_ t: T) { // CHECK: define hidden swiftcc void @"$s4main4doityyF"() #{{[0-9]+}} { // CHECK: call swiftcc void @"$s4main7consumeyyxlF"( -// CHECK-SAME: ptr noalias nocapture %{{[0-9]+}}, +// CHECK-SAME: ptr noalias %{{[0-9]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: $s4main5ValueVySiGMf diff --git a/test/IRGen/protocol_resilience.sil b/test/IRGen/protocol_resilience.sil index ee4627d7f63ba..5df9a936bf575 100644 --- a/test/IRGen/protocol_resilience.sil +++ b/test/IRGen/protocol_resilience.sil @@ -136,7 +136,7 @@ protocol InternalProtocol { // CHECK-SAME: } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @defaultC(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @defaultC(ptr noalias swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: sil @defaultC : $@convention(witness_method: ResilientProtocol) (@in_guaranteed Self) -> () { bb0(%0 : $*Self): @@ -147,7 +147,7 @@ bb0(%0 : $*Self): return %result : $() } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @defaultD(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @defaultD(ptr noalias swiftself %0, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: sil @defaultD : $@convention(witness_method: ResilientProtocol) (@in_guaranteed Self) -> () { @@ -156,7 +156,7 @@ bb0(%0 : $*Self): // Make sure we can emit direct references to other default implementations // CHECK-NEXT: %[[SELF:.*]] = alloca ptr // CHECK-NEXT: store ptr %Self, ptr %[[SELF]] - // CHECK-NEXT: call swiftcc void @defaultC(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) + // CHECK-NEXT: call swiftcc void @defaultC(ptr noalias swiftself %0, ptr %Self, ptr %SelfWitnessTable) %fn1 = function_ref @defaultC : $@convention(witness_method: ResilientProtocol) (@in_guaranteed Self) -> () %ignore1 = apply %fn1(%0) : $@convention(witness_method: ResilientProtocol) (@in_guaranteed Self) -> () @@ -165,7 +165,7 @@ bb0(%0 : $*Self): // CHECK-NEXT: [[WITNESS_ADDR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 5 // CHECK-NEXT: [[WITNESS_FN:%.*]] = load ptr, ptr [[WITNESS_ADDR]] - // CHECK: call swiftcc void [[WITNESS_FN]](ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) + // CHECK: call swiftcc void [[WITNESS_FN]](ptr noalias swiftself %0, ptr %Self, ptr %SelfWitnessTable) %fn2 = witness_method $Self, #ResilientProtocol.defaultC : $@convention(witness_method: ResilientProtocol) (@in_guaranteed Self) -> () %ignore2 = apply %fn2(%0) : $@convention(witness_method: ResilientProtocol) (@in_guaranteed Self) -> () @@ -271,7 +271,7 @@ bb0(%0 : $*ConformingStruct): // Make sure we can emit direct references to default implementations with a // concrete Self type. - // CHECK-NEXT: call swiftcc void @defaultC(ptr noalias nocapture swiftself %0, ptr %Self, ptr %SelfWitnessTable) + // CHECK-NEXT: call swiftcc void @defaultC(ptr noalias swiftself %0, ptr %Self, ptr %SelfWitnessTable) %fn1 = function_ref @defaultC : $@convention(witness_method: ResilientProtocol) (@in_guaranteed Self) -> () %ignore1 = apply %fn1(%0) : $@convention(witness_method: ResilientProtocol) (@in_guaranteed Self) -> () @@ -317,7 +317,7 @@ sil_witness_table ConformingStruct : ResilientProtocol module protocol_resilienc // Make sure resilient conformances are accessed with an accessor function // -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @doSomething(ptr noalias nocapture %0, ptr %T, ptr %T.OtherResilientProtocol) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @doSomething(ptr noalias %0, ptr %T, ptr %T.OtherResilientProtocol) sil @doSomething : $@convention(thin) (@in T) -> () { bb0(%0 : $*T): %result = tuple () @@ -330,7 +330,7 @@ bb0(%0 : $*ResilientConformingType): // CHECK-NEXT: entry: // CHECK-NEXT: [[WTABLE:%.*]] = call ptr @"$s19protocol_resilience23ResilientConformingTypeVAC010resilient_A005OtherC8ProtocolAAWl"() - // CHECK-NEXT: call swiftcc void @doSomething(ptr noalias nocapture %0, ptr getelementptr inbounds ({{.*}} @"$s19protocol_resilience23ResilientConformingTypeVMf", i32 0, i32 2), ptr [[WTABLE]]) + // CHECK-NEXT: call swiftcc void @doSomething(ptr noalias %0, ptr getelementptr inbounds ({{.*}} @"$s19protocol_resilience23ResilientConformingTypeVMf", i32 0, i32 2), ptr [[WTABLE]]) %fn = function_ref @doSomething : $@convention(thin) (@in T) -> () %ignore = apply %fn(%0) : $@convention(thin) (@in T) -> () @@ -374,7 +374,7 @@ sil_witness_table AnotherConformingStruct : RefinesOtherResilientProtocol module sil_witness_table hidden AnotherConformingStruct: OtherResilientProtocol module protocol_resilience { } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @doSomethingRefined(ptr noalias nocapture %0, ptr %T, ptr %T.RefinesOtherResilientProtocol) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @doSomethingRefined(ptr noalias %0, ptr %T, ptr %T.RefinesOtherResilientProtocol) sil @doSomethingRefined : $@convention(thin) (@in T) -> () { bb0(%0 : $*T): %result = tuple () @@ -387,7 +387,7 @@ bb0(%0 : $*AnotherConformingStruct): // CHECK-NEXT: entry: // CHECK-NEXT: [[WTABLE:%.*]] = call ptr @"$s19protocol_resilience23AnotherConformingStructVAcA29RefinesOtherResilientProtocolAAWl"() - // CHECK-NEXT: call swiftcc void @doSomethingRefined(ptr noalias nocapture %0, ptr getelementptr inbounds ({{.*}} @"$s19protocol_resilience23AnotherConformingStructVMf", i32 0, i32 2), ptr [[WTABLE]]) + // CHECK-NEXT: call swiftcc void @doSomethingRefined(ptr noalias %0, ptr getelementptr inbounds ({{.*}} @"$s19protocol_resilience23AnotherConformingStructVMf", i32 0, i32 2), ptr [[WTABLE]]) %fn = function_ref @doSomethingRefined : $@convention(thin) (@in T) -> () %ignore = apply %fn(%0) : $@convention(thin) (@in T) -> () @@ -417,7 +417,7 @@ sil_witness_table ConformsWithResilientAssoc : HasResilientAssoc module protocol associated_type T: ResilientConformingType } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @doSomethingAssoc(ptr noalias nocapture %0, ptr %T, ptr %T.HasResilientAssoc) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @doSomethingAssoc(ptr noalias %0, ptr %T, ptr %T.HasResilientAssoc) sil @doSomethingAssoc : $@convention(thin) (@in T) -> () { bb0(%0 : $*T): %result = tuple () @@ -430,7 +430,7 @@ bb0(%0 : $*ConformsWithResilientAssoc): // CHECK-NEXT: entry: // CHECK-NEXT: [[WTABLE:%.*]] = call ptr @"$s19protocol_resilience26ConformsWithResilientAssocVAcA03HaseF0AAWl - // CHECK-NEXT: call swiftcc void @doSomethingAssoc(ptr noalias nocapture %0, ptr getelementptr inbounds ({{.*}} @"$s19protocol_resilience26ConformsWithResilientAssocVMf", i32 0, i32 2), ptr [[WTABLE]]) + // CHECK-NEXT: call swiftcc void @doSomethingAssoc(ptr noalias %0, ptr getelementptr inbounds ({{.*}} @"$s19protocol_resilience26ConformsWithResilientAssocVMf", i32 0, i32 2), ptr [[WTABLE]]) %fn = function_ref @doSomethingAssoc : $@convention(thin) (@in T) -> () %ignore = apply %fn(%0) : $@convention(thin) (@in T) -> () diff --git a/test/IRGen/protocol_resilience_thunks.swift b/test/IRGen/protocol_resilience_thunks.swift index b3057faf71007..7317d671b3690 100644 --- a/test/IRGen/protocol_resilience_thunks.swift +++ b/test/IRGen/protocol_resilience_thunks.swift @@ -16,8 +16,8 @@ import resilient_protocol // CHECK-LABEL: @"$s26protocol_resilience_thunks19MyResilientProtocolP8propertySbvsTq" ={{( dllexport)?}}{{( protected)?}} alias %swift.protocol_requirement, getelementptr inbounds (<{{.*}}>, ptr @"$s26protocol_resilience_thunks19MyResilientProtocolMp", i32 0, i32 12) // CHECK-LABEL: @"$s26protocol_resilience_thunks19MyResilientProtocolP8propertySbvMTq" ={{( dllexport)?}}{{( protected)?}} alias %swift.protocol_requirement, getelementptr inbounds (<{{.*}}>, ptr @"$s26protocol_resilience_thunks19MyResilientProtocolMp", i32 0, i32 13) -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks26callResilientWitnessMethodyyx010resilient_A00E12BaseProtocolRzlF"(ptr noalias nocapture %0, ptr %T, ptr %T.ResilientBaseProtocol) -// CHECK: call swiftcc {{.*}} @"$s18resilient_protocol21ResilientBaseProtocolP11requirementSiyFTj"(ptr noalias nocapture swiftself %0, ptr %T, ptr %T.ResilientBaseProtocol) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks26callResilientWitnessMethodyyx010resilient_A00E12BaseProtocolRzlF"(ptr noalias %0, ptr %T, ptr %T.ResilientBaseProtocol) +// CHECK: call swiftcc {{.*}} @"$s18resilient_protocol21ResilientBaseProtocolP11requirementSiyFTj"(ptr noalias swiftself %0, ptr %T, ptr %T.ResilientBaseProtocol) // CHECK: ret void public func callResilientWitnessMethod(_ value: T) { _ = value.requirement() @@ -36,66 +36,66 @@ public protocol MyResilientProtocol { var property: Bool { get set } } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP11returnsVoid1xySb_tFTj"(i1 %0, ptr noalias nocapture swiftself %1, ptr %2, ptr %3) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP11returnsVoid1xySb_tFTj"(i1 %0, ptr noalias swiftself %1, ptr %2, ptr %3) // CHECK: [[WITNESS_GEP:%.*]] = getelementptr inbounds ptr, ptr %3, i32 1 // CHECK: [[WITNESS:%.*]] = load ptr, ptr [[WITNESS_GEP]] // CHECK-arm64e-NEXT: ptrtoint ptr [[WITNESS_GEP]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend -// CHECK-NEXT: call swiftcc void [[WITNESS]](i1 %0, ptr noalias nocapture swiftself %1, ptr %2, ptr %3) +// CHECK-NEXT: call swiftcc void [[WITNESS]](i1 %0, ptr noalias swiftself %1, ptr %2, ptr %3) // CHECK-NEXT: ret void -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc i1 @"$s26protocol_resilience_thunks19MyResilientProtocolP11returnsBoolSbyFTj"(ptr noalias nocapture swiftself %0, ptr %1, ptr %2) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc i1 @"$s26protocol_resilience_thunks19MyResilientProtocolP11returnsBoolSbyFTj"(ptr noalias swiftself %0, ptr %1, ptr %2) // CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds ptr, ptr %2, i32 2 // CHECK-NEXT: [[WITNESS:%.*]] = load ptr, ptr [[WITNESS_ADDR]] // CHECK-arm64e-NEXT: ptrtoint ptr [[WITNESS_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend -// CHECK-NEXT: [[RESULT:%.*]] = call swiftcc i1 [[WITNESS]](ptr noalias nocapture swiftself %0, ptr %1, ptr %2) +// CHECK-NEXT: [[RESULT:%.*]] = call swiftcc i1 [[WITNESS]](ptr noalias swiftself %0, ptr %1, ptr %2) // CHECK-NEXT: ret i1 [[RESULT]] -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP10returnsAnyypyFTj"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture swiftself %1, ptr %2, ptr %3) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP10returnsAnyypyFTj"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias swiftself %1, ptr %2, ptr %3) // CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds ptr, ptr %3, i32 3 // CHECK-NEXT: [[WITNESS:%.*]] = load ptr, ptr [[WITNESS_ADDR]] // CHECK-arm64e-NEXT: ptrtoint ptr [[WITNESS_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend -// CHECK-NEXT: call swiftcc void [[WITNESS]](ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture swiftself %1, ptr %2, ptr %3) +// CHECK-NEXT: call swiftcc void [[WITNESS]](ptr noalias nocapture sret({{.*}}) %0, ptr noalias swiftself %1, ptr %2, ptr %3) // CHECK-NEXT: ret void -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP12throwingFuncyyKFTj"(ptr noalias nocapture swiftself %0, ptr{{( noalias nocapture( swifterror)? dereferenceable\(.\))?}} %1, ptr %2, ptr %3) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP12throwingFuncyyKFTj"(ptr noalias swiftself %0, ptr{{( noalias nocapture( swifterror)? dereferenceable\(.\))?}} %1, ptr %2, ptr %3) // CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds ptr, ptr %3, i32 4 // CHECK-NEXT: [[WITNESS:%.*]] = load ptr, ptr [[WITNESS_ADDR]] // CHECK-arm64e-NEXT: ptrtoint ptr [[WITNESS_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend -// CHECK-NEXT: call swiftcc void [[WITNESS]](ptr noalias nocapture swiftself %0, ptr{{( noalias nocapture( swifterror)? dereferenceable\(.\))?}} %1, ptr %2, ptr %3) +// CHECK-NEXT: call swiftcc void [[WITNESS]](ptr noalias swiftself %0, ptr{{( noalias nocapture( swifterror)? dereferenceable\(.\))?}} %1, ptr %2, ptr %3) // CHECK-NEXT: ret void -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP11genericFuncyqd__qd__lFTj"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture %1, ptr %2, ptr noalias nocapture swiftself %3, ptr %4, ptr %5) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP11genericFuncyqd__qd__lFTj"(ptr noalias sret({{.*}}) %0, ptr noalias %1, ptr %2, ptr noalias swiftself %3, ptr %4, ptr %5) // CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds ptr, ptr %5, i32 5 // CHECK-NEXT: [[WITNESS:%.*]] = load ptr, ptr [[WITNESS_ADDR]] // CHECK-arm64e-NEXT: ptrtoint ptr [[WITNESS_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend -// CHECK-NEXT: call swiftcc void [[WITNESS]](ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture %1, ptr %2, ptr noalias nocapture swiftself %3, ptr %4, ptr %5) +// CHECK-NEXT: call swiftcc void [[WITNESS]](ptr noalias sret({{.*}}) %0, ptr noalias %1, ptr %2, ptr noalias swiftself %3, ptr %4, ptr %5) // CHECK-NEXT: ret void -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc i1 @"$s26protocol_resilience_thunks19MyResilientProtocolP8propertySbvgTj"(ptr noalias nocapture swiftself %0, ptr %1, ptr %2) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc i1 @"$s26protocol_resilience_thunks19MyResilientProtocolP8propertySbvgTj"(ptr noalias swiftself %0, ptr %1, ptr %2) // CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds ptr, ptr %2, i32 6 // CHECK-NEXT: [[WITNESS:%.*]] = load ptr, ptr [[WITNESS_ADDR]] // CHECK-arm64e-NEXT: ptrtoint ptr [[WITNESS_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend -// CHECK-NEXT: [[RESULT:%.*]] = call swiftcc i1 [[WITNESS]](ptr noalias nocapture swiftself %0, ptr %1, ptr %2) +// CHECK-NEXT: [[RESULT:%.*]] = call swiftcc i1 [[WITNESS]](ptr noalias swiftself %0, ptr %1, ptr %2) // CHECK-NEXT: ret i1 [[RESULT]] -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP8propertySbvsTj"(i1 %0, ptr nocapture swiftself %1, ptr %2, ptr %3) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s26protocol_resilience_thunks19MyResilientProtocolP8propertySbvsTj"(i1 %0, ptr swiftself %1, ptr %2, ptr %3) // CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds ptr, ptr %3, i32 7 // CHECK-NEXT: [[WITNESS:%.*]] = load ptr, ptr [[WITNESS_ADDR]] // CHECK-arm64e-NEXT: ptrtoint ptr [[WITNESS_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend -// CHECK-NEXT: call swiftcc void [[WITNESS]](i1 %0, ptr nocapture swiftself %1, ptr %2, ptr %3) +// CHECK-NEXT: call swiftcc void [[WITNESS]](i1 %0, ptr swiftself %1, ptr %2, ptr %3) // CHECK-NEXT: ret void -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @"$s26protocol_resilience_thunks19MyResilientProtocolP8propertySbvMTj"(ptr noalias dereferenceable({{16|32}}) %0, ptr nocapture swiftself %1, ptr %2, ptr %3) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { ptr, ptr } @"$s26protocol_resilience_thunks19MyResilientProtocolP8propertySbvMTj"(ptr noalias dereferenceable({{16|32}}) %0, ptr swiftself %1, ptr %2, ptr %3) // CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds ptr, ptr %3, i32 8 // CHECK-NEXT: [[WITNESS:%.*]] = load ptr, ptr [[WITNESS_ADDR]] // CHECK-arm64e-NEXT: ptrtoint ptr [[WITNESS_ADDR]] to i64 // CHECK-arm64e-NEXT: call i64 @llvm.ptrauth.blend -// CHECK-NEXT: [[RESULT:%.*]] = call swiftcc { ptr, ptr } [[WITNESS]](ptr noalias dereferenceable({{16|32}}) %0, ptr nocapture swiftself %1, ptr %2, ptr %3) +// CHECK-NEXT: [[RESULT:%.*]] = call swiftcc { ptr, ptr } [[WITNESS]](ptr noalias dereferenceable({{16|32}}) %0, ptr swiftself %1, ptr %2, ptr %3) // CHECK-NEXT: ret { ptr, ptr } [[RESULT]] diff --git a/test/IRGen/relative_protocol_witness_table.swift b/test/IRGen/relative_protocol_witness_table.swift index 61d9f6c6c0437..d32fde8dba4b8 100644 --- a/test/IRGen/relative_protocol_witness_table.swift +++ b/test/IRGen/relative_protocol_witness_table.swift @@ -200,7 +200,7 @@ func instantiate_conditional_conformance_2nd(_ t : T) where T: Sub, T.S == T // Simple witness entry access. -// CHECK: define{{.*}} swiftcc void @"$s1A14requireWitnessyyxAA8FuncOnlyRzlF"(ptr noalias nocapture {{%.*}}, ptr {{%.*}}, ptr [[PWT:%.*]]) +// CHECK: define{{.*}} swiftcc void @"$s1A14requireWitnessyyxAA8FuncOnlyRzlF"(ptr noalias {{%.*}}, ptr {{%.*}}, ptr [[PWT:%.*]]) // CHECK:[[ENTRY:.*]]: // CHECK: [[T4:%.*]] = call ptr @"__swift_relative_protocol_witness_table_access_1_$s1A8FuncOnlyP1ayyFTq"(ptr [[PWT]]) // CHECK: call{{.*}} swiftcc void [[T4]] @@ -232,7 +232,7 @@ func instantiate_conditional_conformance_2nd(_ t : T) where T: Sub, T.S == T // Parent witness entry access. -// CHECK: define hidden swiftcc void @"$s1A15requireWitness2yyxAA9InheritedRzlF"(ptr noalias nocapture {{%.*}}, ptr {{%.*}}, ptr [[T_INHERITED:%.*]]) +// CHECK: define hidden swiftcc void @"$s1A15requireWitness2yyxAA9InheritedRzlF"(ptr noalias {{%.*}}, ptr {{%.*}}, ptr [[T_INHERITED:%.*]]) // CHECK: [[T_FUNCONLY:%.*]] = call ptr @__swift_relative_protocol_witness_table_parent_1(ptr [[T_INHERITED]]) // CHECK: call ptr @"__swift_relative_protocol_witness_table_access_1_$s1A8FuncOnlyP1ayyFTq"(ptr [[T_FUNCONLY]]) diff --git a/test/IRGen/signature_conformances_multifile.swift b/test/IRGen/signature_conformances_multifile.swift index 6b2277584e1d7..26716c09bc4de 100644 --- a/test/IRGen/signature_conformances_multifile.swift +++ b/test/IRGen/signature_conformances_multifile.swift @@ -8,7 +8,7 @@ func passQ() { // CHECK: call swiftcc void @"$s32signature_conformances_multifile12AlsoConformsVACyxGycfC"(ptr @"$sSiN") // CHECK: %0 = call {{.*}} @"$s32signature_conformances_multifile12AlsoConformsVySiGMD" // CHECK: %1 = call ptr @"$s32signature_conformances_multifile12AlsoConformsVySiGACyxGAA1QAAWl"() - // CHECK: call swiftcc void @"$s32signature_conformances_multifile6takesQyyxAA1QRzlF"(ptr noalias nocapture undef, ptr %0, ptr %1) + // CHECK: call swiftcc void @"$s32signature_conformances_multifile6takesQyyxAA1QRzlF"(ptr noalias undef, ptr %0, ptr %1) takesQ(AlsoConforms()) // CHECK: ret void @@ -19,7 +19,7 @@ func passP() { // CHECK: call swiftcc void @"$s32signature_conformances_multifile8ConformsVACyxq_GycfC"(ptr @"$sSiN", ptr @"$sSSN") // CHECK: %0 = call {{.*}} @"$s32signature_conformances_multifile8ConformsVySiSSGMD" // CHECK: %1 = call ptr @"$s32signature_conformances_multifile8ConformsVySiSSGACyxq_GAA1PAAWl"() - // CHECK: call swiftcc void @"$s32signature_conformances_multifile6takesPyyxAA1PRzlF"(ptr noalias nocapture undef, ptr %0, ptr %1) + // CHECK: call swiftcc void @"$s32signature_conformances_multifile6takesPyyxAA1PRzlF"(ptr noalias undef, ptr %0, ptr %1) takesP(Conforms()) // CHECK: ret void diff --git a/test/IRGen/signature_conformances_multifile_future.swift b/test/IRGen/signature_conformances_multifile_future.swift index e95bfa274b5e3..6dd6fb23bfb67 100644 --- a/test/IRGen/signature_conformances_multifile_future.swift +++ b/test/IRGen/signature_conformances_multifile_future.swift @@ -14,7 +14,7 @@ func passQ() { // CHECK: [[METADATA:%[0-9]+]] = call ptr @__swift_instantiateConcreteTypeFromMangledName(ptr @"$s39signature_conformances_multifile_future12AlsoConformsVySiGMD") // CHECK: [[WITNESS_TABLE:%[0-9]+]] = call ptr @"$s39signature_conformances_multifile_future12AlsoConformsVySiGACyxGAA1QAAWl"() // CHECK: call swiftcc void @"$s39signature_conformances_multifile_future6takesQyyxAA1QRzlF"( - // CHECK-SAME: ptr noalias nocapture undef, + // CHECK-SAME: ptr noalias undef, // CHECK-SAME: ptr [[METADATA]], // CHECK-SAME: ptr [[WITNESS_TABLE]] // CHECK-SAME: ) @@ -29,7 +29,7 @@ func passP() { // CHECK: [[METADATA:%[0-9]+]] = call ptr @__swift_instantiateConcreteTypeFromMangledName(ptr @"$s39signature_conformances_multifile_future8ConformsVySiSSGMD") // CHECK: [[WITNESS_TABLE:%[0-9]+]] = call ptr @"$s39signature_conformances_multifile_future8ConformsVySiSSGACyxq_GAA1PAAWl"() // CHECK: call swiftcc void @"$s39signature_conformances_multifile_future6takesPyyxAA1PRzlF"( - // CHECK-SAME: ptr noalias nocapture undef, + // CHECK-SAME: ptr noalias undef, // CHECK-SAME: ptr [[METADATA]], // CHECK-SAME: ptr [[WITNESS_TABLE]] // CHECK-SAME: ) diff --git a/test/IRGen/sil_generic_witness_methods.swift b/test/IRGen/sil_generic_witness_methods.swift index e87b53ff58152..a9c80505798c9 100644 --- a/test/IRGen/sil_generic_witness_methods.swift +++ b/test/IRGen/sil_generic_witness_methods.swift @@ -13,7 +13,7 @@ protocol P { struct S {} -// CHECK-LABEL: define hidden swiftcc void @"$s27sil_generic_witness_methods05call_D0{{[_0-9a-zA-Z]*}}F"(ptr noalias nocapture %0, ptr noalias nocapture %1, ptr %T, ptr %U, ptr %T.P) +// CHECK-LABEL: define hidden swiftcc void @"$s27sil_generic_witness_methods05call_D0{{[_0-9a-zA-Z]*}}F"(ptr noalias %0, ptr noalias %1, ptr %T, ptr %U, ptr %T.P) func call_methods(_ x: T, y: S, z: U) { // CHECK: [[STATIC_METHOD_ADDR:%.*]] = getelementptr inbounds ptr, ptr %T.P, i32 2 // CHECK: [[STATIC_METHOD_PTR:%.*]] = load ptr, ptr [[STATIC_METHOD_ADDR]], align 8 @@ -22,15 +22,15 @@ func call_methods(_ x: T, y: S, z: U) { // CHECK: [[CONCRETE_METHOD_PTR_GEP:%.*]] = getelementptr inbounds ptr, ptr %T.P, i32 1 // CHECK: [[CONCRETE_METHOD_PTR:%.*]] = load ptr, ptr [[CONCRETE_METHOD_PTR_GEP]] - // CHECK: call swiftcc void [[CONCRETE_METHOD_PTR]](ptr noalias nocapture swiftself {{%.*}}, ptr %T, ptr %T.P) + // CHECK: call swiftcc void [[CONCRETE_METHOD_PTR]](ptr noalias swiftself {{%.*}}, ptr %T, ptr %T.P) x.concrete_method() // CHECK: [[GENERIC_METHOD_ADDR:%.*]] = getelementptr inbounds ptr, ptr %T.P, i32 3 // CHECK: [[GENERIC_METHOD_PTR:%.*]] = load ptr, ptr [[GENERIC_METHOD_ADDR]], align 8 - // CHECK: call swiftcc void [[GENERIC_METHOD_PTR]](ptr noalias nocapture {{.*}}, ptr {{.*}} @"$s27sil_generic_witness_methods1SVMf", {{.*}} ptr noalias nocapture swiftself {{.*}}, ptr %T, ptr %T.P) + // CHECK: call swiftcc void [[GENERIC_METHOD_PTR]](ptr noalias {{.*}}, ptr {{.*}} @"$s27sil_generic_witness_methods1SVMf", {{.*}} ptr noalias swiftself {{.*}}, ptr %T, ptr %T.P) x.generic_method(y) // CHECK: [[GENERIC_METHOD_ADDR:%.*]] = getelementptr inbounds ptr, ptr %T.P, i32 3 // CHECK: [[GENERIC_METHOD_PTR:%.*]] = load ptr, ptr [[GENERIC_METHOD_ADDR]], align 8 - // CHECK: call swiftcc void [[GENERIC_METHOD_PTR]](ptr noalias nocapture {{.*}}, ptr %U, ptr noalias nocapture swiftself {{.*}}, ptr %T, ptr %T.P) + // CHECK: call swiftcc void [[GENERIC_METHOD_PTR]](ptr noalias {{.*}}, ptr %U, ptr noalias swiftself {{.*}}, ptr %T, ptr %T.P) x.generic_method(z) } @@ -42,7 +42,7 @@ func call_existential_methods(_ x: P, y: S) { // 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 nocapture swiftself {{%.*}}, ptr [[METADATA]], ptr [[WTABLE]]) + // 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 @@ -51,6 +51,6 @@ func call_existential_methods(_ x: P, y: S) { // 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 - // CHECK: call swiftcc void [[GENERIC_METHOD_PTR]](ptr noalias nocapture {{.*}}, ptr {{.*}} @"$s27sil_generic_witness_methods1SVMf", {{.*}} ptr noalias nocapture swiftself {{%.*}}, ptr [[METADATA]], ptr [[WTABLE]]) + // CHECK: call swiftcc void [[GENERIC_METHOD_PTR]](ptr noalias {{.*}}, ptr {{.*}} @"$s27sil_generic_witness_methods1SVMf", {{.*}} ptr noalias swiftself {{%.*}}, ptr [[METADATA]], ptr [[WTABLE]]) x.generic_method(y) } diff --git a/test/IRGen/sil_witness_methods.sil b/test/IRGen/sil_witness_methods.sil index 7cc52e5884a4d..2c2594a76940b 100644 --- a/test/IRGen/sil_witness_methods.sil +++ b/test/IRGen/sil_witness_methods.sil @@ -87,14 +87,14 @@ entry(%x : $@thick Bar.Type): // TODO: %Self Type arg is redundant for class method witness -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @concrete_type_generic_method_witness(ptr noalias nocapture %0, ptr %Z, ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @concrete_type_generic_method_witness(ptr noalias %0, ptr %Z, ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) sil @concrete_type_generic_method_witness : $@convention(witness_method: P) (@in Z, @in Foo) -> @thick Foo.Type { entry(%z : $*Z, %x : $*Foo): %m = metatype $@thick Foo.Type return %m : $@thick Foo.Type } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @generic_type_generic_method_witness(ptr noalias nocapture %0, ptr %Z, ptr noalias nocapture swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @generic_type_generic_method_witness(ptr noalias %0, ptr %Z, ptr noalias nocapture swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) sil @generic_type_generic_method_witness : $@convention(witness_method: P) (@in Z, @in Bar) -> @thick Bar.Type { entry(%z : $*Z, %x : $*Bar): %t = metatype $@thick T.Type @@ -105,14 +105,14 @@ entry(%z : $*Z, %x : $*Bar): return %m : $@thick Bar.Type } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @concrete_type_generic_static_method_witness(ptr noalias nocapture %0, ptr %Z, ptr swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @concrete_type_generic_static_method_witness(ptr noalias %0, ptr %Z, ptr swiftself %1, ptr %Self, ptr %SelfWitnessTable) sil @concrete_type_generic_static_method_witness : $@convention(witness_method: P) (@in Z, @thick Foo.Type) -> @thick Foo.Type { entry(%z : $*Z, %x : $@thick Foo.Type): %m = metatype $@thick Foo.Type return %m : $@thick Foo.Type } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @generic_type_generic_static_method_witness(ptr noalias nocapture %0, ptr %Z, ptr swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc ptr @generic_type_generic_static_method_witness(ptr noalias %0, ptr %Z, ptr swiftself %1, ptr %Self, ptr %SelfWitnessTable) sil @generic_type_generic_static_method_witness : $@convention(witness_method: P) (@in Z, @thick Bar.Type) -> @thick Bar.Type { entry(%z : $*Z, %x : $@thick Bar.Type): %t = metatype $@thick T.Type diff --git a/test/IRGen/struct_resilience.swift b/test/IRGen/struct_resilience.swift index 536ba153e2c50..aa7c79d97fbc1 100644 --- a/test/IRGen/struct_resilience.swift +++ b/test/IRGen/struct_resilience.swift @@ -14,7 +14,7 @@ import resilient_enum // Resilient structs from outside our resilience domain are manipulated via // value witnesses -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience30functionWithResilientTypesSize_1f010resilient_A00G0VAFn_A2FnXEtF"(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture %1, ptr %2, ptr %3) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience30functionWithResilientTypesSize_1f010resilient_A00G0VAFn_A2FnXEtF"(ptr noalias sret({{.*}}) %0, ptr noalias %1, ptr %2, ptr %3) public func functionWithResilientTypesSize(_ s: __owned Size, f: (__owned Size) -> Size) -> Size { // CHECK: entry: @@ -31,7 +31,7 @@ public func functionWithResilientTypesSize(_ s: __owned Size, f: (__owned Size) // CHECK: [[WITNESS:%.*]] = load ptr, ptr [[WITNESS_PTR]] // CHECK: [[STRUCT_LOC:%.*]] = call ptr [[WITNESS]](ptr noalias [[ALLOCA]], ptr noalias %1, ptr [[METADATA]]) -// CHECK: call swiftcc void %2(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture [[ALLOCA]], ptr swiftself %3) +// CHECK: call swiftcc void %2(ptr noalias sret({{.*}}) %0, ptr noalias [[ALLOCA]], ptr swiftself %3) // CHECK: [[WITNESS_PTR:%.*]] = getelementptr inbounds ptr, ptr [[VWT]], i32 1 // CHECK: [[WITNESS:%.*]] = load ptr, ptr [[WITNESS_PTR]] @@ -51,7 +51,7 @@ public func functionWithResilientTypesSize(_ s: __owned Size, f: (__owned Size) // Make sure we use a type metadata accessor function, and load indirect // field offsets from it. -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience35functionWithResilientTypesRectangleyy010resilient_A00G0VF"(ptr noalias nocapture %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience35functionWithResilientTypesRectangleyy010resilient_A00G0VF"(ptr noalias %0) public func functionWithResilientTypesRectangle(_ r: Rectangle) { // CHECK: entry: // CHECK: [[TMP:%.*]] = call swiftcc %swift.metadata_response @"$s16resilient_struct9RectangleVMa"([[INT]] 0) @@ -168,7 +168,7 @@ public func partialApplyOfResilientMethod(r: ResilientStructWithMethod) { // Type is address-only in SIL, and resilient in IRGen -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience29partialApplyOfResilientMethod1sy010resilient_A04SizeV_tF"(ptr noalias nocapture %0) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s17struct_resilience29partialApplyOfResilientMethod1sy010resilient_A04SizeV_tF"(ptr noalias %0) public func partialApplyOfResilientMethod(s: Size) { _ = s.method } @@ -179,7 +179,7 @@ public func resilientAny(s : ResilientWeakRef) { wantsAny(s) } -// CHECK-LABEL: define{{.*}} swiftcc void @"$s17struct_resilience12resilientAny1sy0c1_A016ResilientWeakRefV_tF"(ptr noalias nocapture %0) +// CHECK-LABEL: define{{.*}} swiftcc void @"$s17struct_resilience12resilientAny1sy0c1_A016ResilientWeakRefV_tF"(ptr noalias %0) // CHECK: entry: // CHECK: [[ANY:%.*]] = alloca %Any // CHECK: [[META:%.*]] = call swiftcc %swift.metadata_response @"$s16resilient_struct16ResilientWeakRefVMa"([[INT]] 0) diff --git a/test/IRGen/synthesized_conformance.swift b/test/IRGen/synthesized_conformance.swift index 7f670f5d7d0b2..108151752ba00 100644 --- a/test/IRGen/synthesized_conformance.swift +++ b/test/IRGen/synthesized_conformance.swift @@ -34,10 +34,10 @@ func doEquality(_: T) {} // CHECK-LABEL: define{{( dllexport| protected)?}} swiftcc void @"$s23synthesized_conformance8equalityyyF"() public func equality() { // CHECK: [[Struct_Equatable:%.*]] = call ptr @"$s23synthesized_conformance6StructVySiGACyxGSQAASQRzlWl"() - // CHECK-NEXT: call swiftcc void @"$s23synthesized_conformance10doEqualityyyxSQRzlF"(ptr noalias nocapture {{%.*}}, ptr {{%.*}}, ptr [[Struct_Equatable]]) + // CHECK-NEXT: call swiftcc void @"$s23synthesized_conformance10doEqualityyyxSQRzlF"(ptr noalias {{%.*}}, ptr {{%.*}}, ptr [[Struct_Equatable]]) doEquality(Struct(x: 1)) // CHECK: [[Enum_Equatable:%.*]] = call ptr @"$s23synthesized_conformance4EnumOySiGACyxGSQAASQRzlWl"() - // CHECK-NEXT: call swiftcc void @"$s23synthesized_conformance10doEqualityyyxSQRzlF"(ptr noalias nocapture {{%.*}}, ptr {{%.*}}, ptr [[Enum_Equatable]]) + // CHECK-NEXT: call swiftcc void @"$s23synthesized_conformance10doEqualityyyxSQRzlF"(ptr noalias {{%.*}}, ptr {{%.*}}, ptr [[Enum_Equatable]]) doEquality(Enum.a(1)) } @@ -45,15 +45,15 @@ func doEncodable(_: T) {} // CHECK-LABEL: define{{( dllexport| protected)?}} swiftcc void @"$s23synthesized_conformance9encodableyyF"() public func encodable() { // CHECK: [[Struct_Encodable:%.*]] = call ptr @"$s23synthesized_conformance6StructVySiGACyxGSEAASeRzSERzlWl"() - // CHECK-NEXT: call swiftcc void @"$s23synthesized_conformance11doEncodableyyxSERzlF"(ptr noalias nocapture {{%.*}}, ptr {{%.*}}, ptr [[Struct_Encodable]]) + // CHECK-NEXT: call swiftcc void @"$s23synthesized_conformance11doEncodableyyxSERzlF"(ptr noalias {{%.*}}, ptr {{%.*}}, ptr [[Struct_Encodable]]) doEncodable(Struct(x: 1)) // CHECK: [[Enum_Encodable:%.*]] = call ptr @"$s23synthesized_conformance4EnumOySiGACyxGSEAASeRzSERzlWl"() - // CHECK-NEXT: call swiftcc void @"$s23synthesized_conformance11doEncodableyyxSERzlF"(ptr noalias nocapture {{%.*}}, ptr {{%.*}}, ptr [[Enum_Encodable]]) + // CHECK-NEXT: call swiftcc void @"$s23synthesized_conformance11doEncodableyyxSERzlF"(ptr noalias {{%.*}}, ptr {{%.*}}, ptr [[Enum_Encodable]]) doEncodable(Enum.a(1)) // CHECK: [[Final_Encodable:%.*]] = call ptr @"$s23synthesized_conformance5FinalCySiGACyxGSEAASERzlWl"() - // CHECK-NEXT: call swiftcc void @"$s23synthesized_conformance11doEncodableyyxSERzlF"(ptr noalias nocapture {{%.*}}, ptr {{%.*}}, ptr [[Final_Encodable]]) + // CHECK-NEXT: call swiftcc void @"$s23synthesized_conformance11doEncodableyyxSERzlF"(ptr noalias {{%.*}}, ptr {{%.*}}, ptr [[Final_Encodable]]) doEncodable(Final(x: 1)) // CHECK: [[Nonfinal_Encodable:%.*]] = call ptr @"$s23synthesized_conformance8NonfinalCySiGACyxGSEAASERzlWl"() - // CHECK-NEXT: call swiftcc void @"$s23synthesized_conformance11doEncodableyyxSERzlF"(ptr noalias nocapture {{%.*}}, ptr {{%.*}}, ptr [[Nonfinal_Encodable]]) + // CHECK-NEXT: call swiftcc void @"$s23synthesized_conformance11doEncodableyyxSERzlF"(ptr noalias {{%.*}}, ptr {{%.*}}, ptr [[Nonfinal_Encodable]]) doEncodable(Nonfinal(x: 1)) } diff --git a/test/IRGen/synthesized_conformance_future.swift b/test/IRGen/synthesized_conformance_future.swift index 09b6908e363ef..38ca16d1a6040 100644 --- a/test/IRGen/synthesized_conformance_future.swift +++ b/test/IRGen/synthesized_conformance_future.swift @@ -39,10 +39,10 @@ func doEquality(_: T) {} // CHECK-LABEL: define{{( dllexport| protected)?}} swiftcc void @"$s30synthesized_conformance_future8equalityyyF"() public func equality() { // CHECK: [[TMP:%.*]] = alloca %TSi - // CHECK: call swiftcc void @"$s30synthesized_conformance_future6StructV1xACyxGx_tcfC"(ptr noalias nocapture {{[^,]*}}, ptr noalias nocapture [[TMP]], ptr @"$sSiN") + // CHECK: call swiftcc void @"$s30synthesized_conformance_future6StructV1xACyxGx_tcfC"(ptr noalias {{[^,]*}}, ptr noalias [[TMP]], ptr @"$sSiN") // CHECK: [[Struct_Equatable:%.*]] = call ptr @"$s30synthesized_conformance_future6StructVySiGACyxGSQAASQRzlWl"() // CHECK-NEXT: call swiftcc void @"$s30synthesized_conformance_future10doEqualityyyxSQRzlF"( - // CHECK-SAME: ptr noalias nocapture {{[^,]*}}, + // CHECK-SAME: ptr noalias {{[^,]*}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: ptr @"$s30synthesized_conformance_future6StructVySiGMf", @@ -54,7 +54,7 @@ public func equality() { doEquality(Struct(x: 1)) // CHECK: [[Enum_Equatable:%.*]] = call ptr @"$s30synthesized_conformance_future4EnumOySiGACyxGSQAASQRzlWl"() // CHECK-NEXT: call swiftcc void @"$s30synthesized_conformance_future10doEqualityyyxSQRzlF"( - // CHECK-SAME: ptr noalias nocapture {{%[^,]+}}, + // CHECK-SAME: ptr noalias {{%[^,]+}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: ptr @"$s30synthesized_conformance_future4EnumOySiGMf", @@ -71,7 +71,7 @@ func doEncodable(_: T) {} public func encodable() { // CHECK: [[Struct_Encodable:%.*]] = call ptr @"$s30synthesized_conformance_future6StructVySiGACyxGSEAASeRzSERzlWl"() // CHECK-NEXT: call swiftcc void @"$s30synthesized_conformance_future11doEncodableyyxSERzlF"( - // CHECK-SAME: ptr noalias nocapture {{[^,]*}}, + // CHECK-SAME: ptr noalias {{[^,]*}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: ptr @"$s30synthesized_conformance_future6StructVySiGMf", @@ -83,7 +83,7 @@ public func encodable() { doEncodable(Struct(x: 1)) // CHECK: [[Enum_Encodable:%.*]] = call ptr @"$s30synthesized_conformance_future4EnumOySiGACyxGSEAASeRzSERzlWl"() // CHECK-NEXT: call swiftcc void @"$s30synthesized_conformance_future11doEncodableyyxSERzlF"( - // CHECK-SAME: ptr noalias nocapture {{[^,]*}}, + // CHECK-SAME: ptr noalias {{[^,]*}}, // CHECK-SAME: ptr getelementptr inbounds ( // CHECK-SAME: %swift.full_type, // CHECK-SAME: ptr @"$s30synthesized_conformance_future4EnumOySiGMf" @@ -94,9 +94,9 @@ public func encodable() { // CHECK-SAME: ) doEncodable(Enum.a(1)) // CHECK: [[Final_Encodable:%.*]] = call ptr @"$s30synthesized_conformance_future5FinalCySiGACyxGSEAASERzlWl"() - // CHECK-NEXT: call swiftcc void @"$s30synthesized_conformance_future11doEncodableyyxSERzlF"(ptr noalias nocapture {{%.*}}, ptr {{%.*}}, ptr [[Final_Encodable]]) + // CHECK-NEXT: call swiftcc void @"$s30synthesized_conformance_future11doEncodableyyxSERzlF"(ptr noalias {{%.*}}, ptr {{%.*}}, ptr [[Final_Encodable]]) doEncodable(Final(x: 1)) // CHECK: [[Nonfinal_Encodable:%.*]] = call ptr @"$s30synthesized_conformance_future8NonfinalCySiGACyxGSEAASERzlWl"() - // CHECK-NEXT: call swiftcc void @"$s30synthesized_conformance_future11doEncodableyyxSERzlF"(ptr noalias nocapture {{%.*}}, ptr {{%.*}}, ptr [[Nonfinal_Encodable]]) + // CHECK-NEXT: call swiftcc void @"$s30synthesized_conformance_future11doEncodableyyxSERzlF"(ptr noalias {{%.*}}, ptr {{%.*}}, ptr [[Nonfinal_Encodable]]) doEncodable(Nonfinal(x: 1)) } diff --git a/test/IRGen/unmanaged_objc_throw_func.swift b/test/IRGen/unmanaged_objc_throw_func.swift index 123c150e1cb66..2e8d62ba207df 100644 --- a/test/IRGen/unmanaged_objc_throw_func.swift +++ b/test/IRGen/unmanaged_objc_throw_func.swift @@ -51,7 +51,7 @@ import Foundation // CHECK: [[L6]]: ; preds = %[[L5]] // CHECK-NEXT: %[[T9:.+]] = phi ptr [ %[[T8]], %[[L5]] ] // CHECK-NEXT: %[[T10:.+]] = call swiftcc ptr @"$s10Foundation22_convertErrorToNSErrorySo0E0Cs0C0_pF"(ptr %[[T6]]) #{{[0-9]+}} -// CHECK: call swiftcc void @"$sSA7pointeexvs"(ptr noalias nocapture %{{.+}}, ptr %[[T9]], ptr %{{.+}}) #{{[0-9]+}} +// CHECK: call swiftcc void @"$sSA7pointeexvs"(ptr noalias %{{.+}}, ptr %[[T9]], ptr %{{.+}}) #{{[0-9]+}} // CHECK: call void @swift_errorRelease(ptr %[[T6]]) #{{[0-9]+}} // CHECK-NEXT: br label %[[L7:.+]] diff --git a/test/IRGen/variadic_generic_captures.swift b/test/IRGen/variadic_generic_captures.swift index 0ce897108c4c4..edca2eae4a93e 100644 --- a/test/IRGen/variadic_generic_captures.swift +++ b/test/IRGen/variadic_generic_captures.swift @@ -6,7 +6,7 @@ public func has_metadata_pack(t: repeat each T) -> () -> () { return { _ = (repeat each T).self } } -// CHECK-LABEL: define{{( protected)?}}{{( dllexport)?}} swiftcc { ptr, ptr } @"$s25variadic_generic_captures17has_metadata_pack1tyycxxQp_tRvzlF"(ptr noalias nocapture %0, i{{32|64}} %1, ptr %"each T") #0 { +// CHECK-LABEL: define{{( protected)?}}{{( dllexport)?}} swiftcc { ptr, ptr } @"$s25variadic_generic_captures17has_metadata_pack1tyycxxQp_tRvzlF"(ptr noalias %0, i{{32|64}} %1, ptr %"each T") #0 { // CHECK: [[CONTEXT0:%.*]] = call noalias ptr @swift_allocObject( // CHECK: [[GENERIC_ARGS_ADDR:%.*]] = getelementptr inbounds {{.*}} [[CONTEXT0]], i32 0, i32 {{(1|2)}} @@ -34,7 +34,7 @@ public func has_metadata_pack_noescape(t: repeat each T) { takesNoEscape { _ = (repeat each T).self } } -// CHECK-LABEL: define{{( protected)?}}{{( dllexport)?}} swiftcc void @"$s25variadic_generic_captures26has_metadata_pack_noescape1tyxxQp_tRvzlF"(ptr noalias nocapture %0, i{{32|64}} %1, ptr %"each T") #0 { +// CHECK-LABEL: define{{( protected)?}}{{( dllexport)?}} swiftcc void @"$s25variadic_generic_captures26has_metadata_pack_noescape1tyxxQp_tRvzlF"(ptr noalias %0, i{{32|64}} %1, ptr %"each T") #0 { // CHECK: [[CONTEXT0:%.*]] = alloca i8, [[INT]] // CHECK: [[GENERIC_ARGS:%.*]] = getelementptr inbounds {{.*}} [[CONTEXT0]], i32 0, i32 {{(1|2)}} diff --git a/test/IRGen/variadic_generic_fulfillment.swift b/test/IRGen/variadic_generic_fulfillment.swift index a5dc65fc300dc..7253a2c07a133 100644 --- a/test/IRGen/variadic_generic_fulfillment.swift +++ b/test/IRGen/variadic_generic_fulfillment.swift @@ -10,7 +10,7 @@ public struct GG { } } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s28variadic_generic_fulfillment2GGV7doStuff5inputyxxQp_tF"(ptr noalias nocapture %0, ptr %"GG", ptr noalias nocapture swiftself %1) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$s28variadic_generic_fulfillment2GGV7doStuff5inputyxxQp_tF"(ptr noalias %0, ptr %"GG", ptr noalias swiftself %1) // CHECK: [[T_PTR:%.*]] = getelementptr inbounds ptr, ptr %"GG" // CHECK: [[T:%.*]] = load ptr, ptr [[T_PTR]] diff --git a/test/IRGen/variadic_generic_functions.swift b/test/IRGen/variadic_generic_functions.swift index 3bc13718c7b33..a721e599d4f4b 100644 --- a/test/IRGen/variadic_generic_functions.swift +++ b/test/IRGen/variadic_generic_functions.swift @@ -2,17 +2,17 @@ // REQUIRES: PTRSIZE=64 -// CHECK-LABEL: define hidden swiftcc void @"$s26variadic_generic_functions2f11tyxxQp_tRvzlF"(ptr noalias nocapture %0, i64 %1, ptr %"each T") +// CHECK-LABEL: define hidden swiftcc void @"$s26variadic_generic_functions2f11tyxxQp_tRvzlF"(ptr noalias %0, i64 %1, ptr %"each T") func f1(t: repeat each T) {} -// CHECK-LABEL: define hidden swiftcc void @"$s26variadic_generic_functions2f21t1uyxxQp_q_q_QptRvzRv_r0_lF"(ptr noalias nocapture %0, ptr noalias nocapture %1, i64 %2, i64 %3, ptr %"each T", ptr %"each U") +// CHECK-LABEL: define hidden swiftcc void @"$s26variadic_generic_functions2f21t1uyxxQp_q_q_QptRvzRv_r0_lF"(ptr noalias %0, ptr noalias %1, i64 %2, i64 %3, ptr %"each T", ptr %"each U") func f2(t: repeat each T, u: repeat each U) {} -// CHECK-LABEL: define hidden swiftcc void @"$s26variadic_generic_functions2f31t1uyxxQp_q_xQptRvzRv_q_Rhzr0_lF"(ptr noalias nocapture %0, ptr noalias nocapture %1, i64 %2, ptr %"each T", ptr %"each U") +// CHECK-LABEL: define hidden swiftcc void @"$s26variadic_generic_functions2f31t1uyxxQp_q_xQptRvzRv_q_Rhzr0_lF"(ptr noalias %0, ptr noalias %1, i64 %2, ptr %"each T", ptr %"each U") func f3(t: repeat each T, u: repeat each U) where (repeat (each T, each U)): Any {} protocol P {} -// CHECK-LABEL: define {{.*}}void @f4(ptr noalias nocapture %0, i64 %1, ptr %"each T", ptr %"each T.P") +// CHECK-LABEL: define {{.*}}void @f4(ptr noalias %0, i64 %1, ptr %"each T", ptr %"each T.P") @_silgen_name("f4") func f4(t: repeat each T) {} diff --git a/test/IRGen/variadic_generics.sil b/test/IRGen/variadic_generics.sil index 1c5f698a68414..3fb598b5e6b8c 100644 --- a/test/IRGen/variadic_generics.sil +++ b/test/IRGen/variadic_generics.sil @@ -141,14 +141,14 @@ entry(%addr : $*T): } // CHECK-LABEL: define {{.*}}@test_tuple_pack_element_addr_1( -// CHECK-SAME: ptr nocapture [[TUPLE_ADDR:%[^,]+]], i{{(64|32)}} [[INDEX:%[^,]+]] +// CHECK-SAME: ptr [[TUPLE_ADDR:%[^,]+]], i{{(64|32)}} [[INDEX:%[^,]+]] // CHECK: [[ELT_TYPE:%.*]] = phi ptr [ // CHECK: [[RESPONSE:%[^,]+]] = call swiftcc %swift.metadata_response @swift_getTupleTypeMetadata // CHECK: [[UNCAST_METADATA:%[^,]+]] = extractvalue %swift.metadata_response [[RESPONSE]], 0 // CHECK: [[OFFSET_PTR:%[^,]+]] = getelementptr inbounds %swift.tuple_type, ptr [[UNCAST_METADATA]], i{{(64|32)}} 0, i32 3, i{{(64|32)}} [[INDEX]] // CHECK: [[OFFSET:%[^,]+]] = load i32, ptr [[OFFSET_PTR]], align // CHECK: [[UNCAST_ELEMENT_ADDR:%[^,]+]] = getelementptr inbounds i8, ptr [[TUPLE_ADDR]], i32 [[OFFSET]] -// CHECK: call swiftcc void @borrow(ptr noalias nocapture [[UNCAST_ELEMENT_ADDR]], ptr [[ELT_TYPE]]) +// CHECK: call swiftcc void @borrow(ptr noalias [[UNCAST_ELEMENT_ADDR]], ptr [[ELT_TYPE]]) sil @test_tuple_pack_element_addr_1 : $ (@inout (String, T, U, Int), Builtin.Word) -> () { bb0(%tuple : $*(String, T, U, Int), %i : $Builtin.Word): %index = dynamic_pack_index %i of $Pack{Float, T, U, Float} diff --git a/test/IRGen/variadic_vanishing_tuple.swift b/test/IRGen/variadic_vanishing_tuple.swift index 2ea673eeba273..62ee85acdcf03 100644 --- a/test/IRGen/variadic_vanishing_tuple.swift +++ b/test/IRGen/variadic_vanishing_tuple.swift @@ -6,7 +6,7 @@ public func makeTuple(_ t: repeat each T) { takesMetatype((repeat each T).self) } -// CHECK-LABEL: define {{(protected )?}}{{(dllexport )?}}swiftcc void @"$s24variadic_vanishing_tuple9makeTupleyyxxQpRvzlF"(ptr noalias nocapture %0, {{i32|i64}} %1, ptr %"each T") +// CHECK-LABEL: define {{(protected )?}}{{(dllexport )?}}swiftcc void @"$s24variadic_vanishing_tuple9makeTupleyyxxQpRvzlF"(ptr noalias %0, {{i32|i64}} %1, ptr %"each T") // CHECK: [[CMP:%.*]] = icmp eq [[INT]] %1, 1 // CHECK: br i1 [[CMP]], label %vanishing-tuple, label %actual-tuple diff --git a/test/IRGen/weak.sil b/test/IRGen/weak.sil index 06f56ec66cbb1..153d6337cc9c1 100644 --- a/test/IRGen/weak.sil +++ b/test/IRGen/weak.sil @@ -36,7 +36,7 @@ bb0(%0 : $*A, %1 : $Optional): %4 = tuple () return %4 : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test_weak_load_store(ptr nocapture dereferenceable({{.*}}) %0, i64 %1) {{.*}} { +// 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-NEXT: [[T0:%.*]] = call ptr @swift_weakLoadStrong(ptr [[X]]) // CHECK-NEXT: %3 = ptrtoint ptr %2 to i64 @@ -59,7 +59,7 @@ bb0(%0 : $*B, %1 : $Optional

): %4 = tuple () return %4 : $() } -// CHECK: define{{( dllexport)?}}{{( protected)?}} swiftcc void @test_weak_load_store_proto(ptr nocapture dereferenceable({{.*}}) %0, i64 %1, i64 %2) +// 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-NEXT: [[T1:%.*]] = call ptr @swift_unknownObjectWeakLoadStrong(ptr [[T0]]) diff --git a/test/IRGen/weak_class_protocol.sil b/test/IRGen/weak_class_protocol.sil index af24c93b261eb..b2bd4418c6c3c 100644 --- a/test/IRGen/weak_class_protocol.sil +++ b/test/IRGen/weak_class_protocol.sil @@ -6,7 +6,7 @@ import Swift protocol Foo: class { } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @store_weak(ptr noalias nocapture sret({{.*}}) %0, i64 %1, i64 %2) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @store_weak(ptr noalias sret({{.*}}) %0, i64 %1, i64 %2) {{.*}} { // CHECK: entry: // CHECK-objc: [[INSTANCE:%.*]] = inttoptr i64 %1 to ptr // CHECK-native: [[INSTANCE:%.*]] = inttoptr i64 %1 to ptr diff --git a/test/IRGen/weak_import_availability.swift b/test/IRGen/weak_import_availability.swift index 990c606ed9b8e..d1fc0559d705e 100644 --- a/test/IRGen/weak_import_availability.swift +++ b/test/IRGen/weak_import_availability.swift @@ -110,8 +110,8 @@ public func useConditionallyAvailableMethod(s: ConditionallyAvailableStruct) { s.conditionallyAvailableMethod() } -// CHECK-OLD-LABEL: declare extern_weak swiftcc void @"$s31weak_import_availability_helper28ConditionallyAvailableStructV013conditionallyF6MethodyyF"(ptr noalias nocapture swiftself) -// CHECK-NEW-LABEL: declare swiftcc void @"$s31weak_import_availability_helper28ConditionallyAvailableStructV013conditionallyF6MethodyyF"(ptr noalias nocapture swiftself) +// CHECK-OLD-LABEL: declare extern_weak swiftcc void @"$s31weak_import_availability_helper28ConditionallyAvailableStructV013conditionallyF6MethodyyF"(ptr noalias swiftself) +// CHECK-NEW-LABEL: declare swiftcc void @"$s31weak_import_availability_helper28ConditionallyAvailableStructV013conditionallyF6MethodyyF"(ptr noalias swiftself) @available(macOS, unavailable) public func useUnavailableStruct() { @@ -125,4 +125,4 @@ public func useUnavailableMethod(s: UnvailableStruct) { s.unavailableMethod() } -// CHECK-LABEL: declare extern_weak swiftcc void @"$s31weak_import_availability_helper16UnvailableStructV17unavailableMethodyyF"(ptr noalias nocapture swiftself) +// CHECK-LABEL: declare extern_weak swiftcc void @"$s31weak_import_availability_helper16UnvailableStructV17unavailableMethodyyF"(ptr noalias swiftself) diff --git a/test/IRGen/weak_import_native.swift b/test/IRGen/weak_import_native.swift index b6a18f3716b4d..0e51167a2cb99 100644 --- a/test/IRGen/weak_import_native.swift +++ b/test/IRGen/weak_import_native.swift @@ -10,7 +10,7 @@ import weak_import_native_helper // CHECK-DAG: @"$s25weak_import_native_helper23ProtocolWithWeakMembersP1TAC_AA05OtherE0Tn" = extern_weak global %swift.protocol_requirement // CHECK-DAG: @"$s1T25weak_import_native_helper23ProtocolWithWeakMembersPTl" = extern_weak global %swift.protocol_requirement // CHECK-DAG: @"$s25weak_import_native_helper23ProtocolWithWeakMembersP1fyyFTq" = extern_weak global %swift.method_descriptor -// CHECK-DAG: declare extern_weak swiftcc void @"$s25weak_import_native_helper23ProtocolWithWeakMembersPAAE1fyyF"(ptr, ptr, ptr noalias nocapture swiftself) +// CHECK-DAG: declare extern_weak swiftcc void @"$s25weak_import_native_helper23ProtocolWithWeakMembersPAAE1fyyF"(ptr, ptr, ptr noalias swiftself) struct ConformsToProtocolWithWeakMembers : ProtocolWithWeakMembers {} func testTopLevel() { diff --git a/test/IRGen/witness_method.sil b/test/IRGen/witness_method.sil index 0fd715be6d095..83158ff57addc 100644 --- a/test/IRGen/witness_method.sil +++ b/test/IRGen/witness_method.sil @@ -9,7 +9,7 @@ protocol DefCon { } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @defcon(ptr noalias nocapture sret({{.*}}) %0, ptr %1, ptr %T, ptr %T.DefCon) {{.*}} { +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @defcon(ptr noalias sret({{.*}}) %0, ptr %1, ptr %T, ptr %T.DefCon) {{.*}} { sil @defcon : $@convention(thin) (@thick T.Type) -> @out T { entry(%0: $*T, %1: $@thick T.Type): @@ -60,7 +60,7 @@ struct SyncUp : Synergy { } } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testGenericWitnessMethod(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture %1, ptr %T) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testGenericWitnessMethod(ptr noalias sret({{.*}}) %0, ptr noalias %1, ptr %T) // CHECK: entry: // CHECK: [[TMP:%.*]] = call swiftcc %swift.metadata_response @"$s14witness_method6SyncUpVMa"([[INT]] 255, ptr %T) // CHECK: [[METADATA:%.*]] = extractvalue %swift.metadata_response [[TMP]], 0 @@ -69,7 +69,7 @@ struct SyncUp : Synergy { // CHECK: [[WITNESS_FN:%.*]] = load ptr, ptr [[WITNESS_ADDR]] // CHECK: [[TMP:%.*]] = call swiftcc %swift.metadata_response @swift_checkMetadataState([[INT]] 0, ptr [[METADATA]]) // CHECK: [[METADATA:%.*]] = extractvalue %swift.metadata_response [[TMP]], 0 -// CHECK: call swiftcc void [[WITNESS_FN]](ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture swiftself %1, ptr [[METADATA]], ptr [[WTABLE]]) +// CHECK: call swiftcc void [[WITNESS_FN]](ptr noalias sret({{.*}}) %0, ptr noalias swiftself %1, ptr [[METADATA]], ptr [[WTABLE]]) // CHECK: ret void sil @testGenericWitnessMethod : $@convention(thin) (@in SyncUp) -> @out T { @@ -87,11 +87,11 @@ protocol Strategy { func disrupt() -> GrowthHack } -// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testArchetypeWitnessMethod(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture %1, ptr %T, ptr %T.Strategy) +// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testArchetypeWitnessMethod(ptr noalias sret({{.*}}) %0, ptr noalias %1, ptr %T, ptr %T.Strategy) // CHECK: entry: // CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds ptr, ptr %T.Strategy, i32 3 // CHECK: [[WITNESS_FN:%.*]] = load ptr, ptr [[WITNESS_ADDR]] -// CHECK: call swiftcc void [[WITNESS_FN]](ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture swiftself %1, ptr %T, ptr %T.Strategy) +// CHECK: call swiftcc void [[WITNESS_FN]](ptr noalias sret({{.*}}) %0, ptr noalias swiftself %1, ptr %T, ptr %T.Strategy) // CHECK: ret void sil @testArchetypeWitnessMethod : $@convention(thin) (@in T) -> @out T.GrowthHack { @@ -121,7 +121,7 @@ entry(%self : $*T): // CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @testClassArchetypeWitnessMethod(ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture dereferenceable({{4|8}}) %1, ptr %T, ptr %CoverSheet) // CHECK: entry: // CHECK: [[WITNESS_FN:%.*]] = load ptr, ptr getelementptr inbounds (ptr, ptr @"$s14witness_method9TPSReportCyxGAA8StrategyAAWP", i32 3) -// CHECK: call swiftcc void [[WITNESS_FN]](ptr noalias nocapture sret({{.*}}) %0, ptr noalias nocapture swiftself %1, ptr %T, ptr @"$s14witness_method9TPSReportCyxGAA8StrategyAAWP") +// CHECK: call swiftcc void [[WITNESS_FN]](ptr noalias sret({{.*}}) %0, ptr noalias swiftself %1, ptr %T, ptr @"$s14witness_method9TPSReportCyxGAA8StrategyAAWP") // CHECK: ret void sil @testClassArchetypeWitnessMethod : $@convention(thin) > (@in_guaranteed T) -> (@out T.GrowthHack) { diff --git a/test/IRGen/witness_table_objc_associated_type.swift b/test/IRGen/witness_table_objc_associated_type.swift index 62b9986441ed4..8c54f286a08d7 100644 --- a/test/IRGen/witness_table_objc_associated_type.swift +++ b/test/IRGen/witness_table_objc_associated_type.swift @@ -33,7 +33,7 @@ struct SO: C { // CHECK: ptr {{.*}}@"$s34witness_table_objc_associated_type2SOVAA1CA2aDP3fooyyFTW{{(\.ptrauth)?}}" // CHECK: ] -// CHECK-LABEL: define hidden swiftcc void @"$s34witness_table_objc_associated_type0A25OffsetAfterAssociatedTypeyyxAA1BRzlF"(ptr noalias nocapture %0, ptr %T, ptr %T.B) +// CHECK-LABEL: define hidden swiftcc void @"$s34witness_table_objc_associated_type0A25OffsetAfterAssociatedTypeyyxAA1BRzlF"(ptr noalias %0, ptr %T, ptr %T.B) func witnessOffsetAfterAssociatedType(_ x: T) { // CHECK: [[FOO_ADDR:%.*]] = getelementptr inbounds ptr, ptr %T.B, i32 3 // CHECK: [[FOO:%.*]] = load {{.*}} [[FOO_ADDR]] @@ -41,7 +41,7 @@ func witnessOffsetAfterAssociatedType(_ x: T) { x.foo() } -// CHECK-LABEL: define hidden swiftcc void @"$s34witness_table_objc_associated_type0A29OffsetAfterAssociatedTypeObjCyyxAA1CRzlF"(ptr noalias nocapture %0, ptr %T, ptr %T.C) {{.*}} { +// CHECK-LABEL: define hidden swiftcc void @"$s34witness_table_objc_associated_type0A29OffsetAfterAssociatedTypeObjCyyxAA1CRzlF"(ptr noalias %0, ptr %T, ptr %T.C) {{.*}} { func witnessOffsetAfterAssociatedTypeObjC(_ x: T) { // CHECK: [[FOO_ADDR:%.*]] = getelementptr inbounds ptr, ptr %T.C, i32 2 // CHECK: [[FOO:%.*]] = load {{.*}} [[FOO_ADDR]] diff --git a/test/Inputs/conditional_conformance_basic_conformances.swift b/test/Inputs/conditional_conformance_basic_conformances.swift index 385cca09bb3d5..40e8cc66b3c40 100644 --- a/test/Inputs/conditional_conformance_basic_conformances.swift +++ b/test/Inputs/conditional_conformance_basic_conformances.swift @@ -30,13 +30,13 @@ extension Single: P1 where A: P2 { // witness method for Single.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias nocapture %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2_i8star:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 // CHECK-NEXT: [[A_PTR:%.*]] = getelementptr inbounds ptr, ptr %Self, i64 2 // CHECK-NEXT: [[A:%.*]] = load ptr, ptr [[A_PTR]], align 8 -// CHECK-NEXT: call swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVA2A2P2RzlE7genericyyqd__AA2P3Rd__lF"(ptr noalias nocapture %0, ptr [[A]], ptr %"\CF\84_1_0", ptr [[A_P2_i8star]], ptr %"\CF\84_1_0.P3") +// CHECK-NEXT: call swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVA2A2P2RzlE7genericyyqd__AA2P3Rd__lF"(ptr noalias %0, ptr [[A]], ptr %"\CF\84_1_0", ptr [[A_P2_i8star]], ptr %"\CF\84_1_0.P3") // CHECK-NEXT: ret void // CHECK-NEXT: } @@ -208,7 +208,7 @@ extension Double: P1 where B: P2, C: P3 { // witness method for Double.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP7genericyyqd__AaGRd__lFTW"(ptr noalias nocapture %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP7genericyyqd__AaGRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 @@ -223,7 +223,7 @@ extension Double: P1 where B: P2, C: P3 { // CHECK-NEXT: [[C_PTR:%.*]] = getelementptr inbounds ptr, ptr %Self, i64 3 // CHECK-NEXT: [[C:%.*]] = load ptr, ptr [[C_PTR]], align 8 -// CHECK-NEXT: call swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVA2A2P2RzAA2P3R_rlE7genericyyqd__AaERd__lF"(ptr noalias nocapture %0, ptr [[B]], ptr [[C]], ptr %"\CF\84_1_0", ptr [[B_P2_i8star]], ptr [[C_P3_i8star]], ptr %"\CF\84_1_0.P3") +// CHECK-NEXT: call swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVA2A2P2RzAA2P3R_rlE7genericyyqd__AaERd__lF"(ptr noalias %0, ptr [[B]], ptr [[C]], ptr %"\CF\84_1_0", ptr [[B_P2_i8star]], ptr [[C_P3_i8star]], ptr %"\CF\84_1_0.P3") // CHECK-NEXT: ret void // CHECK-NEXT: } diff --git a/test/Inputs/conditional_conformance_basic_conformances_future.swift b/test/Inputs/conditional_conformance_basic_conformances_future.swift index b3e02f5258a0f..e867a340524c7 100644 --- a/test/Inputs/conditional_conformance_basic_conformances_future.swift +++ b/test/Inputs/conditional_conformance_basic_conformances_future.swift @@ -30,13 +30,13 @@ extension Single: P1 where A: P2 { // witness method for Single.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias nocapture %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2_i8star:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 // CHECK-NEXT: [[A_PTR:%.*]] = getelementptr inbounds ptr, ptr %Self, i64 2 // CHECK-NEXT: [[A:%.*]] = load ptr, ptr [[A_PTR]], align 8 -// CHECK-NEXT: call swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVA2A2P2RzlE7genericyyqd__AA2P3Rd__lF"(ptr noalias nocapture %0, ptr [[A]], ptr %"\CF\84_1_0", ptr [[A_P2_i8star]], ptr %"\CF\84_1_0.P3") +// CHECK-NEXT: call swiftcc void @"$s42conditional_conformance_basic_conformances6SingleVA2A2P2RzlE7genericyyqd__AA2P3Rd__lF"(ptr noalias %0, ptr [[A]], ptr %"\CF\84_1_0", ptr [[A_P2_i8star]], ptr %"\CF\84_1_0.P3") // CHECK-NEXT: ret void // CHECK-NEXT: } @@ -187,7 +187,7 @@ extension Double: P1 where B: P2, C: P3 { // witness method for Double.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP7genericyyqd__AaGRd__lFTW"(ptr noalias nocapture %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVyxq_GAA2P1A2A2P2RzAA2P3R_rlAaEP7genericyyqd__AaGRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 @@ -202,7 +202,7 @@ extension Double: P1 where B: P2, C: P3 { // CHECK-NEXT: [[C_PTR:%.*]] = getelementptr inbounds ptr, ptr %Self, i64 3 // CHECK-NEXT: [[C:%.*]] = load ptr, ptr [[C_PTR]], align 8 -// CHECK-NEXT: call swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVA2A2P2RzAA2P3R_rlE7genericyyqd__AaERd__lF"(ptr noalias nocapture %0, ptr [[B]], ptr [[C]], ptr %"\CF\84_1_0", ptr [[B_P2_i8star]], ptr [[C_P3_i8star]], ptr %"\CF\84_1_0.P3") +// CHECK-NEXT: call swiftcc void @"$s42conditional_conformance_basic_conformances6DoubleVA2A2P2RzAA2P3R_rlE7genericyyqd__AaERd__lF"(ptr noalias %0, ptr [[B]], ptr [[C]], ptr %"\CF\84_1_0", ptr [[B_P2_i8star]], ptr [[C_P3_i8star]], ptr %"\CF\84_1_0.P3") // CHECK-NEXT: ret void // CHECK-NEXT: } diff --git a/test/Inputs/conditional_conformance_subclass.swift b/test/Inputs/conditional_conformance_subclass.swift index 87b7f8ca49911..de35a0d82cc72 100644 --- a/test/Inputs/conditional_conformance_subclass.swift +++ b/test/Inputs/conditional_conformance_subclass.swift @@ -27,12 +27,12 @@ extension Base: P1 where A: P2 { // witness method for Base.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias nocapture %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 // CHECK-NEXT: [[SELF:%.]] = load ptr, ptr %1, align 8 -// CHECK-NEXT: call swiftcc void @"$s32conditional_conformance_subclass4BaseCA2A2P2RzlE7genericyyqd__AA2P3Rd__lF"(ptr noalias nocapture %0, ptr %"\CF\84_1_0", ptr [[A_P2]], ptr %"\CF\84_1_0.P3", ptr swiftself [[SELF]]) +// CHECK-NEXT: call swiftcc void @"$s32conditional_conformance_subclass4BaseCA2A2P2RzlE7genericyyqd__AA2P3Rd__lF"(ptr noalias %0, ptr %"\CF\84_1_0", ptr [[A_P2]], ptr %"\CF\84_1_0.P3", ptr swiftself [[SELF]]) // CHECK-NEXT: ret void // CHECK-NEXT: } diff --git a/test/Inputs/conditional_conformance_subclass_future.swift b/test/Inputs/conditional_conformance_subclass_future.swift index 92bf4482a0a81..4f1a59e28b3f4 100644 --- a/test/Inputs/conditional_conformance_subclass_future.swift +++ b/test/Inputs/conditional_conformance_subclass_future.swift @@ -27,12 +27,12 @@ extension Base: P1 where A: P2 { // witness method for Base.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias nocapture %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s32conditional_conformance_subclass4BaseCyxGAA2P1A2A2P2RzlAaEP7genericyyqd__AA2P3Rd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself dereferenceable(8) %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[A_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[A_P2:%.*]] = load ptr, ptr [[A_P2_PTR]], align 8 // CHECK-NEXT: [[SELF:%.]] = load ptr, ptr %1, align 8 -// CHECK-NEXT: call swiftcc void @"$s32conditional_conformance_subclass4BaseCA2A2P2RzlE7genericyyqd__AA2P3Rd__lF"(ptr noalias nocapture %0, ptr %"\CF\84_1_0", ptr [[A_P2]], ptr %"\CF\84_1_0.P3", ptr swiftself [[SELF]]) +// CHECK-NEXT: call swiftcc void @"$s32conditional_conformance_subclass4BaseCA2A2P2RzlE7genericyyqd__AA2P3Rd__lF"(ptr noalias %0, ptr %"\CF\84_1_0", ptr [[A_P2]], ptr %"\CF\84_1_0.P3", ptr swiftself [[SELF]]) // CHECK-NEXT: ret void // CHECK-NEXT: } diff --git a/test/Inputs/conditional_conformance_with_assoc.swift b/test/Inputs/conditional_conformance_with_assoc.swift index 5f705f5d9459d..1aeffe8f2cf56 100644 --- a/test/Inputs/conditional_conformance_with_assoc.swift +++ b/test/Inputs/conditional_conformance_with_assoc.swift @@ -67,7 +67,7 @@ extension Double: P1 where B.AT2: P2, C: P3, B.AT2.AT2.AT3: P3 { // witness method for Double.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP7genericyyqd__AaFRd__lFTW"(ptr noalias nocapture %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP7genericyyqd__AaFRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[C_P3:%.*]] = load ptr, ptr [[C_P3_PTR]], align 8 @@ -87,7 +87,7 @@ extension Double: P1 where B.AT2: P2, C: P3, B.AT2.AT2.AT3: P3 { // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %Self, i64 4 // CHECK-NEXT: %"\CF\84_0_0.P2" = load ptr, ptr [[B_P2_PTR]], align 8 -// CHECK-NEXT: call swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVA2A2P3R_AA2P23AT2RpzAadF_AfaEP3AT3RPzrlE7genericyyqd__AaDRd__lF"(ptr noalias nocapture %0, ptr %"\CF\84_0_0", ptr %"\CF\84_0_1", ptr %"\CF\84_1_0", ptr %"\CF\84_0_0.P2", ptr [[C_P3]], ptr %"\CF\84_1_0.P3", ptr [[B_AT2_P2]], ptr [[B_AT2_AT2_AT3_P3]]) +// CHECK-NEXT: call swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVA2A2P3R_AA2P23AT2RpzAadF_AfaEP3AT3RPzrlE7genericyyqd__AaDRd__lF"(ptr noalias %0, ptr %"\CF\84_0_0", ptr %"\CF\84_0_1", ptr %"\CF\84_1_0", ptr %"\CF\84_0_0.P2", ptr [[C_P3]], ptr %"\CF\84_1_0.P3", ptr [[B_AT2_P2]], ptr [[B_AT2_AT2_AT3_P3]]) // CHECK-NEXT: ret void // CHECK-NEXT: } diff --git a/test/Inputs/conditional_conformance_with_assoc_future.swift b/test/Inputs/conditional_conformance_with_assoc_future.swift index 4540f3d5bceaa..5dee20e72d072 100644 --- a/test/Inputs/conditional_conformance_with_assoc_future.swift +++ b/test/Inputs/conditional_conformance_with_assoc_future.swift @@ -67,7 +67,7 @@ extension Double: P1 where B.AT2: P2, C: P3, B.AT2.AT2.AT3: P3 { // witness method for Double.generic -// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP7genericyyqd__AaFRd__lFTW"(ptr noalias nocapture %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) +// CHECK-LABEL: define linkonce_odr hidden swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVyxq_GAA2P1A2A2P3R_AA2P23AT2RpzAafH_AhaGP3AT3RPzrlAaEP7genericyyqd__AaFRd__lFTW"(ptr noalias %0, ptr %"\CF\84_1_0", ptr %"\CF\84_1_0.P3", ptr noalias nocapture swiftself %1, ptr %Self, ptr %SelfWitnessTable) // CHECK-NEXT: entry: // CHECK-NEXT: [[C_P3_PTR:%.*]] = getelementptr inbounds ptr, ptr %SelfWitnessTable, i32 -1 // CHECK-NEXT: [[C_P3:%.*]] = load ptr, ptr [[C_P3_PTR]], align 8 @@ -87,7 +87,7 @@ extension Double: P1 where B.AT2: P2, C: P3, B.AT2.AT2.AT3: P3 { // CHECK-NEXT: [[B_P2_PTR:%.*]] = getelementptr inbounds ptr, ptr %Self, i64 4 // CHECK-NEXT: %"\CF\84_0_0.P2" = load ptr, ptr [[B_P2_PTR]], align 8 -// CHECK-NEXT: call swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVA2A2P3R_AA2P23AT2RpzAadF_AfaEP3AT3RPzrlE7genericyyqd__AaDRd__lF"(ptr noalias nocapture %0, ptr %"\CF\84_0_0", ptr %"\CF\84_0_1", ptr %"\CF\84_1_0", ptr %"\CF\84_0_0.P2", ptr [[C_P3]], ptr %"\CF\84_1_0.P3", ptr [[B_AT2_P2]], ptr [[B_AT2_AT2_AT3_P3]]) +// CHECK-NEXT: call swiftcc void @"$s34conditional_conformance_with_assoc6DoubleVA2A2P3R_AA2P23AT2RpzAadF_AfaEP3AT3RPzrlE7genericyyqd__AaDRd__lF"(ptr noalias %0, ptr %"\CF\84_0_0", ptr %"\CF\84_0_1", ptr %"\CF\84_1_0", ptr %"\CF\84_0_0.P2", ptr [[C_P3]], ptr %"\CF\84_1_0.P3", ptr [[B_AT2_P2]], ptr [[B_AT2_AT2_AT3_P3]]) // CHECK-NEXT: ret void // CHECK-NEXT: } diff --git a/test/Interop/Cxx/class/Inputs/constructors.h b/test/Interop/Cxx/class/Inputs/constructors.h index 7493fc91cf785..252a5451ac8f0 100644 --- a/test/Interop/Cxx/class/Inputs/constructors.h +++ b/test/Interop/Cxx/class/Inputs/constructors.h @@ -80,10 +80,4 @@ struct DeletedCopyConstructor { DeletedCopyConstructor(const DeletedCopyConstructor &) = delete; }; -// TODO: we should be able to import this constructor correctly. Until we can, -// make sure not to crash. -struct UsingBaseConstructor : ConstructorWithParam { - using ConstructorWithParam::ConstructorWithParam; -}; - #endif // TEST_INTEROP_CXX_CLASS_INPUTS_CONSTRUCTORS_H diff --git a/test/Interop/Cxx/class/constructors-irgen-macosx.swift b/test/Interop/Cxx/class/constructors-irgen-macosx.swift index f7b8acfcc5100..120d681030cb6 100644 --- a/test/Interop/Cxx/class/constructors-irgen-macosx.swift +++ b/test/Interop/Cxx/class/constructors-irgen-macosx.swift @@ -9,7 +9,7 @@ import Constructors import TypeClassification public func createHasVirtualBase() -> HasVirtualBase { - // ITANIUM_X64: define swiftcc void @"$s7MySwift20createHasVirtualBaseSo0deF0VyF"(ptr noalias nocapture sret({{.*}}) %0) + // ITANIUM_X64: define swiftcc void @"$s7MySwift20createHasVirtualBaseSo0deF0VyF"(ptr noalias sret({{.*}}) %0) // ITANIUM_X64-NOT: define // ITANIUM_X64: call void @_ZN14HasVirtualBaseC1E7ArgType(ptr %{{[0-9]+}}, i32 %{{[0-9]+}}) return HasVirtualBase(ArgType()) diff --git a/test/Interop/Cxx/class/constructors-irgen-windows.swift b/test/Interop/Cxx/class/constructors-irgen-windows.swift index e9284c7867abb..4239aedce8ad6 100644 --- a/test/Interop/Cxx/class/constructors-irgen-windows.swift +++ b/test/Interop/Cxx/class/constructors-irgen-windows.swift @@ -9,10 +9,13 @@ import Constructors import TypeClassification public func createHasVirtualBase() -> HasVirtualBase { - // MICROSOFT_X64: define dllexport swiftcc void @"$s7MySwift20createHasVirtualBaseSo0{{bcD0VyF|deF0VyF}}"(ptr noalias nocapture sret({{.*}}) %0) + // MICROSOFT_X64: define dllexport swiftcc void @"$s7MySwift20createHasVirtualBaseSo0{{bcD0VyF|deF0VyF}}"(ptr noalias sret({{.*}}) [[V0:%.*]]) // MICROSOFT_X64-NOT: define // Note `this` return type and implicit "most derived" argument. - // MICROSOFT_X64: call ptr @"??0HasVirtualBase@@QEAA@UArgType@@@Z"(ptr %{{[0-9]+}}, i32 %{{[0-9]+}}, i32 1) + // MICROSOFT_X64: [[V1:%.*]] = alloca %{{.*}}, align 8 + // MICROSOFT_X64: call ptr @"??0HasVirtualBase@@QEAA@UArgType@@@Z"(ptr [[V1]], i32 %{{[0-9]+}}, i32 1) + // MICROSOFT_X64: call ptr @"??0HasVirtualBase@@QEAA@UArgType@@@Z"(ptr [[V0]], i32 %{{[0-9]+}}, i32 1) + let _ : HasVirtualBase = HasVirtualBase(ArgType()) return HasVirtualBase(ArgType()) } diff --git a/test/Interop/Cxx/class/inheritance/Inputs/functions.h b/test/Interop/Cxx/class/inheritance/Inputs/functions.h index 98093678f71be..eb49d60398819 100644 --- a/test/Interop/Cxx/class/inheritance/Inputs/functions.h +++ b/test/Interop/Cxx/class/inheritance/Inputs/functions.h @@ -22,6 +22,10 @@ struct Base { __attribute__((swift_attr("import_unsafe"))) { return "Base::constInBase"; } + inline const char *rvalueThisInBase() const&& + __attribute__((swift_attr("import_unsafe"))) { + return "Base::rvalueThisInBase"; + } // TODO: if these are unnamed we hit an (unrelated) SILGen bug. Same for // subscripts. inline const char *takesArgsInBase(int a, int b, int c) const diff --git a/test/Interop/Cxx/class/inheritance/Inputs/module.modulemap b/test/Interop/Cxx/class/inheritance/Inputs/module.modulemap index f3638d85acbe5..ec5f16a09d0fa 100644 --- a/test/Interop/Cxx/class/inheritance/Inputs/module.modulemap +++ b/test/Interop/Cxx/class/inheritance/Inputs/module.modulemap @@ -28,6 +28,11 @@ module TypeAliases { header "type-aliases.h" } +module UsingBaseMembers { + header "using-base-members.h" + requires cplusplus +} + module VirtualMethods { header "virtual-methods.h" requires cplusplus diff --git a/test/Interop/Cxx/class/inheritance/Inputs/using-base-members.h b/test/Interop/Cxx/class/inheritance/Inputs/using-base-members.h new file mode 100644 index 0000000000000..f526d40aa0b53 --- /dev/null +++ b/test/Interop/Cxx/class/inheritance/Inputs/using-base-members.h @@ -0,0 +1,47 @@ +struct PublicBase { +private: + int value = 123; + +public: + int publicGetter() const { return value; } + void publicSetter(int v) { value = v; } + void notExposed() const {} +}; + +struct PublicBasePrivateInheritance : private PublicBase { + using PublicBase::publicGetter; + using PublicBase::publicSetter; +}; + +struct PublicBaseProtectedInheritance : protected PublicBase { + using PublicBase::publicGetter; + using PublicBase::publicSetter; +}; + +struct IntBox { + int value; + IntBox(int value) : value(value) {} + IntBox(unsigned value) : value(value) {} +}; + +struct UsingBaseConstructorWithParam : IntBox { + using IntBox::IntBox; +}; + +struct Empty {}; + +struct UsingBaseConstructorEmpty : private Empty { + using Empty::Empty; + + int value = 456; +}; + +// TODO: make this work for protected base methods as well +//struct ProtectedBase { +//protected: +// int protectedGetter() const { return 456; } +//}; +// +//struct ProtectedMemberPrivateInheritance : private ProtectedBase { +// using ProtectedBase::protectedGetter; +//}; diff --git a/test/Interop/Cxx/class/inheritance/functions-irgen.swift b/test/Interop/Cxx/class/inheritance/functions-irgen.swift index 860da674a0858..03937148e3d36 100644 --- a/test/Interop/Cxx/class/inheritance/functions-irgen.swift +++ b/test/Interop/Cxx/class/inheritance/functions-irgen.swift @@ -9,7 +9,7 @@ func testGetX() -> CInt { let _ = testGetX() -// CHECK: define {{.*}} swiftcc i32 @"$sSo018CopyTrackedDerivedC5ClassV4getXs5Int32VyF"(ptr noalias nocapture swiftself dereferenceable(8) %[[SELF_PTR:.*]]) +// CHECK: define {{.*}} swiftcc i32 @"$sSo018CopyTrackedDerivedC5ClassV4getXs5Int32VyF"(ptr noalias swiftself dereferenceable(8) %[[SELF_PTR:.*]]) // CHECK: = call i32 @[[SYNTH_METHOD:.*]](ptr %[[SELF_PTR]]) // CHECK: define {{.*}}linkonce_odr{{.*}} i32 @[[SYNTH_METHOD]](ptr {{.*}} %[[THIS_PTR:.*]]) diff --git a/test/Interop/Cxx/class/inheritance/functions-module-interface.swift b/test/Interop/Cxx/class/inheritance/functions-module-interface.swift index ec2bcab27de1f..e834042adcfba 100644 --- a/test/Interop/Cxx/class/inheritance/functions-module-interface.swift +++ b/test/Interop/Cxx/class/inheritance/functions-module-interface.swift @@ -15,6 +15,8 @@ // CHECK-NEXT: @discardableResult // CHECK-NEXT: func constInBase() -> UnsafePointer! // CHECK-NEXT: @discardableResult +// CHECK-NEXT: func rvalueThisInBase() -> UnsafePointer! +// CHECK-NEXT: @discardableResult // CHECK-NEXT: func takesArgsInBase(_ a: Int32, _ b: Int32, _ c: Int32) -> UnsafePointer! // CHECK-NEXT: @discardableResult // CHECK-NEXT: func takesNonTrivialInBase(_ a: NonTrivial) -> UnsafePointer! diff --git a/test/Interop/Cxx/class/inheritance/functions-typechecker.swift b/test/Interop/Cxx/class/inheritance/functions-typechecker.swift index 2f9462ca370e3..d4e97a4d3c24c 100644 --- a/test/Interop/Cxx/class/inheritance/functions-typechecker.swift +++ b/test/Interop/Cxx/class/inheritance/functions-typechecker.swift @@ -17,3 +17,6 @@ Derived().sameMethodNameSameSignature() Derived().sameMethodDifferentSignature(1) // ok, this is the base class method. Derived().sameMethodDifferentSignature() + +// FIXME: we should import this (https://github.com/apple/swift/issues/69745): +Derived().rvalueThisInBase() // expected-error {{value of type 'Derived' has no member 'rvalueThisInBase'}} diff --git a/test/Interop/Cxx/class/inheritance/using-base-members-module-interface.swift b/test/Interop/Cxx/class/inheritance/using-base-members-module-interface.swift new file mode 100644 index 0000000000000..36a09ff1a9fd3 --- /dev/null +++ b/test/Interop/Cxx/class/inheritance/using-base-members-module-interface.swift @@ -0,0 +1,33 @@ +// RUN: %target-swift-ide-test -print-module -module-to-print=UsingBaseMembers -I %S/Inputs -source-filename=x -cxx-interoperability-mode=upcoming-swift | %FileCheck %s + +// CHECK: struct PublicBase { +// CHECK-NEXT: init() +// CHECK-NEXT: func publicGetter() -> Int32 +// CHECK-NEXT: mutating func publicSetter(_ v: Int32) +// CHECK-NEXT: func notExposed() +// CHECK-NEXT: } + +// CHECK: struct PublicBasePrivateInheritance { +// CHECK-NEXT: init() +// CHECK-NEXT: func publicGetter() -> Int32 +// CHECK-NEXT: mutating func publicSetter(_ v: Int32) +// CHECK-NEXT: } + +// CHECK: struct PublicBaseProtectedInheritance { +// CHECK-NEXT: init() +// CHECK-NEXT: func publicGetter() -> Int32 +// CHECK-NEXT: mutating func publicSetter(_ v: Int32) +// CHECK-NEXT: } + +// CHECK: struct UsingBaseConstructorWithParam { +// CHECK-NEXT: init(_: IntBox) +// CHECK-NEXT: init(_: UInt32) +// CHECK-NEXT: init(_: Int32) +// CHECK-NEXT: var value: Int32 +// CHECK-NEXT: } + +// CHECK: struct UsingBaseConstructorEmpty { +// CHECK-NEXT: init() +// CHECK-NEXT: init(_: Empty) +// CHECK-NEXT: var value: Int32 +// CHECK-NEXT: } diff --git a/test/Interop/Cxx/class/inheritance/using-base-members-typechecker.swift b/test/Interop/Cxx/class/inheritance/using-base-members-typechecker.swift new file mode 100644 index 0000000000000..5fda933fe9c04 --- /dev/null +++ b/test/Interop/Cxx/class/inheritance/using-base-members-typechecker.swift @@ -0,0 +1,16 @@ +// RUN: %target-typecheck-verify-swift -verify-ignore-unknown -I %S/Inputs -cxx-interoperability-mode=upcoming-swift + +import UsingBaseMembers + +let a = PublicBasePrivateInheritance() +let _ = a.publicGetter() +a.notExposed() // expected-error {{value of type 'PublicBasePrivateInheritance' has no member 'notExposed'}} + +let b = PublicBaseProtectedInheritance() +let _ = b.publicGetter() +b.notExposed() // expected-error {{value of type 'PublicBaseProtectedInheritance' has no member 'notExposed'}} + +let _ = UsingBaseConstructorWithParam(566 as Int32) +let _ = UsingBaseConstructorWithParam(566 as UInt32) + +let _ = UsingBaseConstructorEmpty() diff --git a/test/Interop/Cxx/class/inheritance/using-base-members.swift b/test/Interop/Cxx/class/inheritance/using-base-members.swift new file mode 100644 index 0000000000000..7c4b30bef8730 --- /dev/null +++ b/test/Interop/Cxx/class/inheritance/using-base-members.swift @@ -0,0 +1,36 @@ +// RUN: %target-run-simple-swift(-I %S/Inputs/ -Xfrontend -cxx-interoperability-mode=upcoming-swift) +// +// REQUIRES: executable_test + +import StdlibUnittest +import UsingBaseMembers + +var UsingBaseTestSuite = TestSuite("Using Base Members") + +UsingBaseTestSuite.test("PublicBasePrivateInheritance") { + var p = PublicBasePrivateInheritance() + expectEqual(123, p.publicGetter()) + p.publicSetter(456) + expectEqual(456, p.publicGetter()) +} + +UsingBaseTestSuite.test("PublicBaseProtectedInheritance") { + var p = PublicBaseProtectedInheritance() + expectEqual(123, p.publicGetter()) + p.publicSetter(987) + expectEqual(987, p.publicGetter()) +} + +UsingBaseTestSuite.test("UsingBaseConstructorWithParam") { + let p1 = UsingBaseConstructorWithParam(566 as Int32) + expectEqual(566, p1.value) + let p2 = UsingBaseConstructorWithParam(987 as UInt32) + expectEqual(987, p2.value) +} + +UsingBaseTestSuite.test("UsingBaseConstructorEmpty") { + let p = UsingBaseConstructorEmpty() + expectEqual(456, p.value) +} + +runAllTests() diff --git a/test/Interop/Cxx/class/method/Inputs/inreg-sret.h b/test/Interop/Cxx/class/method/Inputs/inreg-sret.h new file mode 100644 index 0000000000000..45111faa42f8d --- /dev/null +++ b/test/Interop/Cxx/class/method/Inputs/inreg-sret.h @@ -0,0 +1,11 @@ +#ifndef TEST_INTEROP_CXX_CLASS_METHOD_INREG_SRET_H +#define TEST_INTEROP_CXX_CLASS_METHOD_INREG_SRET_H + +struct OptionalBridgedBasicBlock { +}; + +struct BridgedFunction { + OptionalBridgedBasicBlock getFirstBlock() const { return {}; } +}; + +#endif // TEST_INTEROP_CXX_CLASS_METHOD_INREG_SRET_H diff --git a/test/Interop/Cxx/class/method/Inputs/module.modulemap b/test/Interop/Cxx/class/method/Inputs/module.modulemap index 20e5779e5a331..4d4f4b7bead1d 100644 --- a/test/Interop/Cxx/class/method/Inputs/module.modulemap +++ b/test/Interop/Cxx/class/method/Inputs/module.modulemap @@ -14,3 +14,8 @@ module UnsafeProjections { export * } + +module InRegSRet { + header "inreg-sret.h" + requires cplusplus +} diff --git a/test/Interop/Cxx/class/method/inreg-sret.swift b/test/Interop/Cxx/class/method/inreg-sret.swift new file mode 100644 index 0000000000000..1188f2f358d8a --- /dev/null +++ b/test/Interop/Cxx/class/method/inreg-sret.swift @@ -0,0 +1,28 @@ +// RUN: %target-swift-emit-irgen -I %S/Inputs -cxx-interoperability-mode=default %s | %FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-%target-cpu + +// REQUIRES: OS=windows-msvc + +import InRegSRet + +final public class BasicBlock { +} + +extension OptionalBridgedBasicBlock { + public var block: BasicBlock? { nil } +} + +final public class Function { + public var bridged: BridgedFunction { + BridgedFunction() + } + + public var firstBlock : BasicBlock? { bridged.getFirstBlock().block } +} + +// Check that inreg on the sret isn't missing + +// CHECK-x86_64: call void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}}, ptr noalias nocapture sret(%TSo25OptionalBridgedBasicBlockV) {{.*}}) +// CHECK-aarch64: call void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}}, ptr inreg noalias nocapture sret(%TSo25OptionalBridgedBasicBlockV) {{.*}}) + +// CHECK-x86_64: define {{.*}} void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}} %{{.*}}, ptr noalias sret(%struct.OptionalBridgedBasicBlock) {{.*}} %{{.*}}) +// CHECK-aarch64: define {{.*}} void @"?getFirstBlock@BridgedFunction@@QEBA?AUOptionalBridgedBasicBlock@@XZ"(ptr {{.*}} %{{.*}}, ptr inreg noalias sret(%struct.OptionalBridgedBasicBlock) {{.*}} %{{.*}}) diff --git a/test/Interop/Cxx/class/method/methods-this-and-indirect-return-irgen-itanium.swift b/test/Interop/Cxx/class/method/methods-this-and-indirect-return-irgen-itanium.swift index c77654b8c7aec..cc722ffb5e9d9 100644 --- a/test/Interop/Cxx/class/method/methods-this-and-indirect-return-irgen-itanium.swift +++ b/test/Interop/Cxx/class/method/methods-this-and-indirect-return-irgen-itanium.swift @@ -12,6 +12,6 @@ public func use() -> CInt { // CHECK: %[[instance:.*]] = alloca %TSo10HasMethodsV // CHECK: %[[result:.*]] = alloca %TSo19NonTrivialInWrapperV -// CHECK: call void @_ZN10HasMethods28nonConstPassThroughAsWrapperEi(ptr sret(%struct.NonTrivialInWrapper) %[[result]], ptr %[[instance]], i32 42) +// CHECK: call void @_ZN10HasMethods28nonConstPassThroughAsWrapperEi(ptr noalias sret(%TSo19NonTrivialInWrapperV) %[[result]], ptr %[[instance]], i32 42) // CHECK: define {{.*}} void @_ZN10HasMethods28nonConstPassThroughAsWrapperEi(ptr noalias sret(%struct.NonTrivialInWrapper) {{.*}} %{{.*}}, ptr {{.*}} %{{.*}}, i32 noundef %{{.*}}) diff --git a/test/Interop/Cxx/class/method/methods-this-and-indirect-return-irgen-msvc.swift b/test/Interop/Cxx/class/method/methods-this-and-indirect-return-irgen-msvc.swift index e8f0a6d96e398..63c886b7addb7 100644 --- a/test/Interop/Cxx/class/method/methods-this-and-indirect-return-irgen-msvc.swift +++ b/test/Interop/Cxx/class/method/methods-this-and-indirect-return-irgen-msvc.swift @@ -12,6 +12,7 @@ public func use() -> CInt { // CHECK: %[[instance:.*]] = alloca %TSo10HasMethodsV // CHECK: %[[result:.*]] = alloca %TSo19NonTrivialInWrapperV -// CHECK: call void @"?nonConstPassThroughAsWrapper@HasMethods@@QEAA?AUNonTrivialInWrapper@@H@Z"(ptr %[[instance]], ptr sret(%struct.NonTrivialInWrapper) %[[result]], i32 42) +// CHECK-x86_64: call void @"?nonConstPassThroughAsWrapper@HasMethods@@QEAA?AUNonTrivialInWrapper@@H@Z"(ptr %[[instance]], ptr noalias sret(%TSo19NonTrivialInWrapperV) %[[result]], i32 42) +// CHECK-aarch64: call void @"?nonConstPassThroughAsWrapper@HasMethods@@QEAA?AUNonTrivialInWrapper@@H@Z"(ptr %[[instance]], ptr inreg noalias sret(%TSo19NonTrivialInWrapperV) %[[result]], i32 42) // CHECK: define {{.*}} void @"?nonConstPassThroughAsWrapper@HasMethods@@QEAA?AUNonTrivialInWrapper@@H@Z"(ptr {{.*}} %{{.*}}, ptr noalias sret(%struct.NonTrivialInWrapper) {{.*}} %{{.*}}, i32 noundef %{{.*}}) diff --git a/test/Interop/Cxx/class/method/msvc-abi-return-indirect-trivial-record.swift b/test/Interop/Cxx/class/method/msvc-abi-return-indirect-trivial-record.swift index dd29bd4aca466..d4b73c3ab3fee 100644 --- a/test/Interop/Cxx/class/method/msvc-abi-return-indirect-trivial-record.swift +++ b/test/Interop/Cxx/class/method/msvc-abi-return-indirect-trivial-record.swift @@ -57,7 +57,7 @@ public func test(_ result: VecStr) -> CInt { } // CHECK: swiftcc i32 @"$s4Test4testys5Int32VSo0014vecstr_yuJCataVF"({{.*}} %[[RESULT:.*]]) -// CHECK: call void @"?begin@?$vec@Vstr@@@@QEBA?AVIt@@XZ"(ptr %[[RESULT]], ptr sret{{.*}} +// CHECK: call void @"?begin@?$vec@Vstr@@@@QEBA?AVIt@@XZ"(ptr %[[RESULT]], ptr {{.*}} sret{{.*}} public func passTempForIndirectRetToVoidCall() { var lhs = LoadableIntWrapper(value: 2) @@ -65,6 +65,7 @@ public func passTempForIndirectRetToVoidCall() { lhs += rhs } -// CHECK: void @"$sSo18LoadableIntWrapperV2peoiyyABz_ABtFZ"(ptr -// CHECK: %[[OPRESULT:.*]] = alloca %struct.LoadableIntWrapper, align 16 -// CHECK: call void @"??YLoadableIntWrapper@@QEAA?AU0@U0@@Z"(ptr {{.*}}, ptr sret(%struct.LoadableIntWrapper) %[[OPRESULT]], i32 +// CHECK: i32 @"$sSo18LoadableIntWrapperV2peoiyA2Bz_ABtFZ"(ptr +// CHECK: %[[OPRESULT:.*]] = alloca %TSo18LoadableIntWrapperV, align 4 +// CHECK-x86_64: call void @"??YLoadableIntWrapper@@QEAA?AU0@U0@@Z"(ptr {{.*}}, ptr {{.*}} sret(%TSo18LoadableIntWrapperV) %[[OPRESULT]], i32 +// CHECK-aarch64: call void @"??YLoadableIntWrapper@@QEAA?AU0@U0@@Z"(ptr {{.*}}, ptr {{.*}} sret(%TSo18LoadableIntWrapperV) %[[OPRESULT]], i64 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 1e6ba121304d0..ad62ecb3174d5 100644 --- a/test/Interop/Cxx/class/type-classification-non-trivial-irgen.swift +++ b/test/Interop/Cxx/class/type-classification-non-trivial-irgen.swift @@ -62,7 +62,7 @@ public func testStructWithCopyConstructorAndSubobjectCopyConstructorAndValue() return obj.member.value == 42 } -// CHECK-LABEL: define {{.*}}i1 @"$s4main4test3objSbSo33StructWithCopyConstructorAndValueV_tF"(ptr noalias nocapture dereferenceable(4) %0) +// 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: [[LHS:%.*]] = load i32, ptr [[VAL_VAL]] @@ -72,7 +72,7 @@ public func test(obj: StructWithCopyConstructorAndValue) -> Bool { return obj.value == 42 } -// CHECK-LABEL: define {{.*}}i1 @"$s4main4test3objSbSo42StructWithSubobjectCopyConstructorAndValueV_tF"(ptr noalias nocapture dereferenceable(4) %0) +// 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 @@ -84,7 +84,7 @@ public func test(obj: StructWithSubobjectCopyConstructorAndValue) -> Bool { return obj.member.value == 42 } -// CHECK-LABEL: define {{.*}}i1 @"$s4main4test3objSbSo037StructWithCopyConstructorAndSubobjectfgH5ValueV_tF"(ptr noalias nocapture dereferenceable(4) %0) +// 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 diff --git a/test/Interop/Cxx/foreign-reference/member-inheritance.swift b/test/Interop/Cxx/foreign-reference/member-inheritance.swift index 12dcb928e70a5..62ae5023ec677 100644 --- a/test/Interop/Cxx/foreign-reference/member-inheritance.swift +++ b/test/Interop/Cxx/foreign-reference/member-inheritance.swift @@ -49,7 +49,7 @@ FunctionsTestSuite.test("base member FRT subscript access") { FunctionsTestSuite.test("base member FRT subscript accessing reference FRT") { let copyCounter = getCopyCounter().pointee - let base = makeBaseReturningFRTFromSubscript()! + var base = makeBaseReturningFRTFromSubscript()! var frt = base[1] expectEqual(frt.getX(), 1) diff --git a/test/Interop/Cxx/objc-correctness/sret.swift b/test/Interop/Cxx/objc-correctness/sret.swift new file mode 100644 index 0000000000000..fc5ac35a74142 --- /dev/null +++ b/test/Interop/Cxx/objc-correctness/sret.swift @@ -0,0 +1,71 @@ +// RUN: %empty-directory(%t) +// RUN: split-file %s %t + +// RUN: %target-swift-emit-ir -I %t/Inputs -cxx-interoperability-mode=default %t/test.swift -target arm64-apple-macos12 -enable-experimental-feature SymbolLinkageMarkers | %FileCheck %s + +// REQUIRES: objc_interop + +//--- Inputs/header.h + +class S { +public: + int a; + ~S(); + S getS(int) const; + static S getSStatic(int); +}; + +S getS(int); + +@interface C ++(S)getS:(int)a; +-(S)getS:(int)a; +@end + +//--- Inputs/module.modulemap + +module SRet { + header "header.h" + requires cplusplus + export * +} + +//--- test.swift + +import SRet + +@_used +func test(c : C, s : S) { + let _ : S = c.getS(1) + let _ : S = C.getS(1) + let _ : S = S() + let _ : S = getS(1) + let _ : S = s.getS(1) + let _ : S = S.getSStatic(1) +} + +// CHECK: %[[TSO1SV:.*]] = type <{ %[[TS5INT32V:.*]] }> +// CHECK: %[[TS5INT32V]] = type <{ i32 }> + +// CHECK: define hidden swiftcc void @"$s4testAA1c1sySo1CC_So1SVtF"(ptr %[[V0:.*]], ptr {{.*}}%[[V1:.*]]) +// CHECK: %[[V2:.*]] = alloca %[[TSO1SV]], align 4 +// CHECK: %[[V3:.*]] = alloca %[[TSO1SV]], align 4 +// CHECK: %[[V4:.*]] = alloca %[[TSO1SV]], align 4 +// CHECK: %[[V5:.*]] = alloca %[[TSO1SV]], align 4 +// CHECK: %[[V6:.*]] = alloca %[[TSO1SV]], align 4 +// CHECK: %[[V7:.*]] = alloca %[[TSO1SV]], align 4 +// CHECK: call void @llvm.lifetime.start.p0(i64 4, ptr %[[V2]]) +// CHECK: %[[V8:.*]] = load ptr, ptr @"\01L_selector(getS:)", align 8 +// CHECK: invoke void @objc_msgSend(ptr noalias sret(%[[TSO1SV]]) %[[V2]], ptr %[[V0]], ptr %[[V8]], i32 1) + +// CHECK: %[[V10:.*]] = load ptr, ptr @"OBJC_CLASS_REF_$_C", align 8 +// CHECK: %[[V11:.*]] = call ptr @objc_opt_self(ptr %[[V10]]) +// CHECK: %[[V12:.*]] = load ptr, ptr @"\01L_selector(getS:)", align 8 +// CHECK: invoke void @objc_msgSend(ptr noalias sret(%[[TSO1SV]]) %[[V3]], ptr %[[V11]], ptr %[[V12]], i32 1) + +// CHECK: %[[V14:.*]] = call ptr @_ZN1SC1Ev(ptr %[[V4]]) +// CHECK: invoke void @_Z4getSi(ptr noalias sret(%[[TSO1SV]]) %[[V5]], i32 1) + +// CHECK: invoke void @_ZNK1S4getSEi(ptr noalias sret(%[[TSO1SV]]) %[[V6]], ptr %[[V1]], i32 1) + +// CHECK: invoke void @_ZN1S10getSStaticEi(ptr noalias sret(%[[TSO1SV]]) %[[V7]], i32 1) diff --git a/test/Interop/Cxx/operators/Inputs/member-inline.h b/test/Interop/Cxx/operators/Inputs/member-inline.h index 2f07261258636..cc2eebb8a10c0 100644 --- a/test/Interop/Cxx/operators/Inputs/member-inline.h +++ b/test/Interop/Cxx/operators/Inputs/member-inline.h @@ -418,4 +418,38 @@ struct DerivedFromConstIterator : public ConstIterator {}; struct DerivedFromConstIteratorPrivately : private ConstIterator {}; +class SubscriptSetterConst { +public: + using T = int; + + SubscriptSetterConst() : p(new T[10]) {} + + T& operator[](int i) const { + return p[i]; + } +private: + T *p; +}; + +struct DerivedFromConstIteratorPrivatelyWithUsingDecl : private ConstIterator { + using ConstIterator::operator*; +}; + +struct DerivedFromAmbiguousOperatorStarPrivatelyWithUsingDecl + : private AmbiguousOperatorStar { + using AmbiguousOperatorStar::operator*; +}; + +struct DerivedFromLoadableIntWrapperWithUsingDecl : private LoadableIntWrapper { + using LoadableIntWrapper::operator-; + using LoadableIntWrapper::operator+=; + + int getValue() const { + return value; + } + void setValue(int v) { + this->value = v; + } +}; + #endif diff --git a/test/Interop/Cxx/operators/member-inline-module-interface.swift b/test/Interop/Cxx/operators/member-inline-module-interface.swift index f1de99999db39..6b0693b83704c 100644 --- a/test/Interop/Cxx/operators/member-inline-module-interface.swift +++ b/test/Interop/Cxx/operators/member-inline-module-interface.swift @@ -1,4 +1,4 @@ -// RUN: %target-swift-ide-test -print-module -module-to-print=MemberInline -I %S/Inputs -source-filename=x -enable-experimental-cxx-interop | %FileCheck %s +// RUN: %target-swift-ide-test -print-module -module-to-print=MemberInline -I %S/Inputs -source-filename=x -cxx-interoperability-mode=upcoming-swift | %FileCheck %s // CHECK: struct LoadableIntWrapper { // CHECK: func successor() -> LoadableIntWrapper @@ -242,3 +242,38 @@ // CHECK-NEXT: @available(*, unavailable, message: "use .pointee property") // CHECK-NEXT: func __operatorStar() -> UnsafePointer // CHECK-NEXT: } + +// CHECK: struct DerivedFromConstIterator { +// CHECK-NEXT: init() +// TODO: @available(*, unavailable, message: "use .pointee property") +// CHECK-NEXT: func __operatorStar() -> UnsafePointer +// TODO: `var pointee` should be printed here +// CHECK-NEXT: } + +// CHECK: struct DerivedFromConstIteratorPrivatelyWithUsingDecl { +// CHECK-NEXT: init() +// CHECK-NEXT: var pointee: Int32 { get } +// CHECK-NEXT: @available(*, unavailable, message: "use .pointee property") +// CHECK-NEXT: func __operatorStar() -> UnsafePointer +// CHECK-NEXT: } + +// CHECK: struct DerivedFromAmbiguousOperatorStarPrivatelyWithUsingDecl { +// CHECK-NEXT: init() +// CHECK-NEXT: var pointee: Int32 +// CHECK-NEXT: @available(*, unavailable, message: "use .pointee property") +// CHECK-NEXT: mutating func __operatorStar() -> UnsafeMutablePointer +// CHECK-NEXT: @available(*, unavailable, message: "use .pointee property") +// CHECK-NEXT: func __operatorStar() -> UnsafePointer +// CHECK-NEXT: } + +// CHECK: struct DerivedFromLoadableIntWrapperWithUsingDecl { +// CHECK-NEXT: init() +// CHECK-NEXT: static func - (lhs: inout DerivedFromLoadableIntWrapperWithUsingDecl, rhs: LoadableIntWrapper) -> LoadableIntWrapper +// CHECK-NEXT: @available(*, unavailable, message: "use - instead") +// CHECK-NEXT: mutating func __operatorMinus(_ rhs: LoadableIntWrapper) -> LoadableIntWrapper +// CHECK-NEXT: static func += (lhs: inout DerivedFromLoadableIntWrapperWithUsingDecl, rhs: LoadableIntWrapper) +// CHECK-NEXT: @available(*, unavailable, message: "use += instead") +// CHECK-NEXT: mutating func __operatorPlusEqual(_ rhs: LoadableIntWrapper) +// CHECK-NEXT: func getValue() -> Int32 +// CHECK-NEXT: mutating func setValue(_ v: Int32) +// CHECK-NEXT: } diff --git a/test/Interop/Cxx/operators/member-inline-typechecker.swift b/test/Interop/Cxx/operators/member-inline-typechecker.swift index b115bac1ae0b4..150eb0ba9ae77 100644 --- a/test/Interop/Cxx/operators/member-inline-typechecker.swift +++ b/test/Interop/Cxx/operators/member-inline-typechecker.swift @@ -1,4 +1,4 @@ -// RUN: %target-typecheck-verify-swift -I %S/Inputs -enable-experimental-cxx-interop +// RUN: %target-typecheck-verify-swift -I %S/Inputs -cxx-interoperability-mode=upcoming-swift import MemberInline @@ -70,3 +70,9 @@ let immortalIncrement = myCounter.successor() // expected-error {{value of type let derivedConstIter = DerivedFromConstIteratorPrivately() derivedConstIter.pointee // expected-error {{value of type 'DerivedFromConstIteratorPrivately' has no member 'pointee'}} + +let derivedConstIterWithUD = DerivedFromConstIteratorPrivatelyWithUsingDecl() +let _ = derivedConstIterWithUD.pointee + +var derivedIntWrapper = DerivedFromLoadableIntWrapperWithUsingDecl() +derivedIntWrapper += LoadableIntWrapper() diff --git a/test/Interop/Cxx/operators/member-inline.swift b/test/Interop/Cxx/operators/member-inline.swift index 7c2586c5492c9..67e3b8f35615a 100644 --- a/test/Interop/Cxx/operators/member-inline.swift +++ b/test/Interop/Cxx/operators/member-inline.swift @@ -1,4 +1,4 @@ -// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-experimental-cxx-interop) +// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -cxx-interoperability-mode=upcoming-swift) // // REQUIRES: executable_test @@ -378,4 +378,30 @@ OperatorsTestSuite.test("DerivedFromConstIterator.pointee") { expectEqual(234, res) } +OperatorsTestSuite.test("SubscriptSetterConst") { + var setterConst = SubscriptSetterConst() + setterConst[0] = 10 +} + +OperatorsTestSuite.test("DerivedFromConstIteratorPrivatelyWithUsingDecl.pointee") { + let stars = DerivedFromConstIteratorPrivatelyWithUsingDecl() + let res = stars.pointee + expectEqual(234, res) +} + +OperatorsTestSuite.test("DerivedFromAmbiguousOperatorStarPrivatelyWithUsingDecl.pointee") { + let stars = DerivedFromAmbiguousOperatorStarPrivatelyWithUsingDecl() + let res = stars.pointee + expectEqual(567, res) +} + +OperatorsTestSuite.test("DerivedFromLoadableIntWrapperWithUsingDecl") { + var d = DerivedFromLoadableIntWrapperWithUsingDecl() + d.setValue(123) + var d1 = LoadableIntWrapper() + d1.value = 543 + d += d1 + expectEqual(666, d.getValue()) +} + runAllTests() diff --git a/test/Interop/Cxx/stdlib/use-std-optional.swift b/test/Interop/Cxx/stdlib/use-std-optional.swift index f25fc01ba1034..c2e5a3c7644d7 100644 --- a/test/Interop/Cxx/stdlib/use-std-optional.swift +++ b/test/Interop/Cxx/stdlib/use-std-optional.swift @@ -1,7 +1,6 @@ -// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-experimental-cxx-interop -Xcc -std=c++17) +// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -cxx-interoperability-mode=upcoming-swift -Xcc -std=c++17) // // REQUIRES: executable_test -// REQUIRES: SR68068 import StdlibUnittest import StdOptional diff --git a/test/Interop/Cxx/value-witness-table/custom-destructors-virtual.swift b/test/Interop/Cxx/value-witness-table/custom-destructors-virtual.swift index cb92fb50735f4..8ec9bd748fe92 100644 --- a/test/Interop/Cxx/value-witness-table/custom-destructors-virtual.swift +++ b/test/Interop/Cxx/value-witness-table/custom-destructors-virtual.swift @@ -6,7 +6,6 @@ // RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-experimental-cxx-interop -Xcc -fno-rtti -O) // // REQUIRES: executable_test -// XFAIL: OS=windows-msvc import CustomDestructor import StdlibUnittest diff --git a/test/SILOptimizer/eager_specialize.sil b/test/SILOptimizer/eager_specialize.sil index a977cb3789f87..9993541f976eb 100644 --- a/test/SILOptimizer/eager_specialize.sil +++ b/test/SILOptimizer/eager_specialize.sil @@ -716,7 +716,7 @@ bb0(%0 : $*Self, %1 : $*Self, %2 : $@thick Self.Type): // Check that a specialization for _Trivial does not call the 'destroy' value witness, // because it is known that the object is Trivial, i.e. contains no references. -// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize19copyValueAndReturn2_1sxx_xztlFxxxRlzTlIetilr_Tp5"(ptr noalias nocapture sret(%swift.opaque) %0, ptr noalias nocapture %1, ptr nocapture %2, ptr %S +// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize19copyValueAndReturn2_1sxx_xztlFxxxRlzTlIetilr_Tp5"(ptr noalias sret(%swift.opaque) %0, ptr noalias %1, ptr %2, ptr %S // CHECK-IRGEN-NEXT: entry: // CHECK-IRGEN: %3 = getelementptr inbounds ptr, ptr %S, i{{.*}} -1 // CHECK-IRGEN-NEXT: %S.valueWitnesses = load ptr, ptr %3 diff --git a/test/SILOptimizer/eager_specialize_ossa.sil b/test/SILOptimizer/eager_specialize_ossa.sil index c1aa9af2e9c8d..7f3ce28041614 100644 --- a/test/SILOptimizer/eager_specialize_ossa.sil +++ b/test/SILOptimizer/eager_specialize_ossa.sil @@ -904,7 +904,7 @@ bb0(%0 : $*Self, %1 : $*Self, %2 : $@thick Self.Type): // Check that a specialization for _Trivial does not call the 'destroy' value witness, // because it is known that the object is Trivial, i.e. contains no references. -// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize19copyValueAndReturn2_1sxx_xztlFxxxRlzTlIetilr_Tp5"(ptr noalias nocapture sret(%swift.opaque) %0, ptr noalias nocapture %1, ptr nocapture %2, ptr %S +// CHECK-IRGEN-LABEL: define linkonce_odr hidden swiftcc void @"$s16eager_specialize19copyValueAndReturn2_1sxx_xztlFxxxRlzTlIetilr_Tp5"(ptr noalias sret(%swift.opaque) %0, ptr noalias %1, ptr %2, ptr %S // CHECK-IRGEN-NEXT: entry: // CHECK-IRGEN: %3 = getelementptr inbounds ptr, ptr %S, i{{.*}} -1 // CHECK-IRGEN-NEXT: %S.valueWitnesses = load ptr, ptr %3 diff --git a/tools/swift-ide-test/swift-ide-test.cpp b/tools/swift-ide-test/swift-ide-test.cpp index e676be519090f..f75a098b768ea 100644 --- a/tools/swift-ide-test/swift-ide-test.cpp +++ b/tools/swift-ide-test/swift-ide-test.cpp @@ -796,6 +796,11 @@ static llvm::cl::opt llvm::cl::desc("Enable C++ interop."), llvm::cl::cat(Category), llvm::cl::init(false)); +static llvm::cl::opt + CxxInteropVersion("cxx-interoperability-mode", + llvm::cl::desc("C++ interop mode."), + llvm::cl::cat(Category)); + static llvm::cl::opt CxxInteropGettersSettersAsProperties("cxx-interop-getters-setters-as-properties", llvm::cl::desc("Imports getters and setters as computed properties."), @@ -4383,6 +4388,14 @@ int main(int argc, char *argv[]) { if (options::EnableCxxInterop) { InitInvok.getLangOptions().EnableCXXInterop = true; } + if (!options::CxxInteropVersion.empty()) { + InitInvok.getLangOptions().EnableCXXInterop = true; + if (options::CxxInteropVersion == "upcoming-swift") + InitInvok.getLangOptions().cxxInteropCompatVersion = + version::Version({version::getUpcomingCxxInteropCompatVersion()}); + else + llvm::errs() << "invalid CxxInteropVersion\n"; + } if (options::CxxInteropGettersSettersAsProperties) { InitInvok.getLangOptions().CxxInteropGettersSettersAsProperties = true; }