diff --git a/docs/SIL.rst b/docs/SIL.rst index cf613fe386cd2..e1d23ef2953f8 100644 --- a/docs/SIL.rst +++ b/docs/SIL.rst @@ -5783,15 +5783,15 @@ Creates a reference to a `dynamically_replacable` SIL function. A For the following Swift code:: - dynamic func test_dynamically_replaceable() {} + dynamic func test_dynamically_replacable() {} func test_dynamic_call() { - test_dynamically_replaceable() + test_dynamically_replacable() } We will generate:: - sil [dynamically_replacable] @test_dynamically_replaceable : $@convention(thin) () -> () { + sil [dynamically_replacable] @test_dynamically_replacable : $@convention(thin) () -> () { bb0: %0 = tuple () return %0 : $() @@ -5799,7 +5799,7 @@ We will generate:: sil @test_dynamic_call : $@convention(thin) () -> () { bb0: - %0 = dynamic_function_ref @test_dynamically_replaceable : $@convention(thin) () -> () + %0 = dynamic_function_ref @test_dynamically_replacable : $@convention(thin) () -> () %1 = apply %0() : $@convention(thin) () -> () %2 = tuple () return %2 : $() @@ -5820,14 +5820,14 @@ function. For the following Swift code:: - @_dynamicReplacement(for: test_dynamically_replaceable()) + @_dynamicReplacement(for: test_dynamically_replacable()) func test_replacement() { - test_dynamically_replaceable() // calls previous implementation + test_dynamically_replacable() // calls previous implementation } We will generate:: - sil [dynamic_replacement_for "test_dynamically_replaceable"] @test_replacement : $@convention(thin) () -> () { + sil [dynamic_replacement_for "test_dynamically_replacable"] @test_replacement : $@convention(thin) () -> () { bb0: %0 = prev_dynamic_function_ref @test_replacement : $@convention(thin) () -> () %1 = apply %0() : $@convention(thin) () -> () diff --git a/include/swift-c/DependencyScan/DependencyScan.h b/include/swift-c/DependencyScan/DependencyScan.h index 4e2132cdbc021..790c6ad8ae40f 100644 --- a/include/swift-c/DependencyScan/DependencyScan.h +++ b/include/swift-c/DependencyScan/DependencyScan.h @@ -741,7 +741,7 @@ swiftscan_cache_replay_instance_create(int argc, const char **argv, SWIFTSCAN_PUBLIC void swiftscan_cache_replay_instance_dispose(swiftscan_cache_replay_instance_t); -/// Replay the cached compilation using cached compliation replay instance. +/// Replay the cached compilation using cached compilation replay instance. /// Returns replay result or nullptr if output not found or error occurs. If /// error, the error message is returned via \c error parameter and its caller /// needs to free the message using `swiftscan_string_dispose`. diff --git a/include/swift/ABI/GenericContext.h b/include/swift/ABI/GenericContext.h index bd99a173d2051..13efe81e113f5 100644 --- a/include/swift/ABI/GenericContext.h +++ b/include/swift/ABI/GenericContext.h @@ -179,25 +179,25 @@ class TargetGenericRequirementDescriptor { return Protocol; } - /// Retreive the raw value of the Protocol requirement pointer. + /// Retrieve the raw value of the Protocol requirement pointer. int32_t getUnresolvedProtocolAddress() const { assert(getKind() == GenericRequirementKind::Protocol); return Protocol.getUnresolvedProtocolAddress(); } - /// Retreive the offset to the Protocol field + /// Retrieve the offset to the Protocol field constexpr inline auto getProtocolOffset() const -> typename Runtime::StoredSize { return offsetof(typename std::remove_reference::type, Protocol); } - /// Retreive the offset to the Type field + /// Retrieve the offset to the Type field constexpr inline auto getSameTypeNameOffset() const -> typename Runtime::StoredSize { return offsetof(typename std::remove_reference::type, Type); } - /// Retreive the offset to the Param field + /// Retrieve the offset to the Param field constexpr inline auto getParamOffset() const -> typename Runtime::StoredSize { return offsetof(typename std::remove_reference::type, Param); diff --git a/include/swift/ABI/MetadataValues.h b/include/swift/ABI/MetadataValues.h index 5e271adfeb8c2..aaa90065de406 100644 --- a/include/swift/ABI/MetadataValues.h +++ b/include/swift/ABI/MetadataValues.h @@ -2135,7 +2135,7 @@ enum class GenericRequirementKind : uint8_t { /// A requirement stating which invertible protocol checks are /// inverted. /// - /// This is more of an "anti-requirement", specifing which checks don't need + /// This is more of an "anti-requirement", specifying which checks don't need /// to happen for a given type. InvertedProtocols = 5, /// A layout requirement. diff --git a/include/swift/ABI/Task.h b/include/swift/ABI/Task.h index 1cefd0f45077d..77a8d5ff59339 100644 --- a/include/swift/ABI/Task.h +++ b/include/swift/ABI/Task.h @@ -562,7 +562,7 @@ class AsyncTask : public Job { } /// Returns true if the current task has any task preference record, - /// including if it has an initial task preference record or onces + /// including if it has an initial task preference record or one /// set during the lifetime of the task. bool hasTaskExecutorPreferenceRecord() const; diff --git a/include/swift/APIDigester/ModuleAnalyzerNodes.h b/include/swift/APIDigester/ModuleAnalyzerNodes.h index 9f69ce420c4fc..e2e3e3fb4440b 100644 --- a/include/swift/APIDigester/ModuleAnalyzerNodes.h +++ b/include/swift/APIDigester/ModuleAnalyzerNodes.h @@ -115,7 +115,7 @@ enum class NodeMatchReason: uint8_t { // a type declaration. Sequential, - // The first node is a function and it chanaged to a property as the second + // The first node is a function and it changed to a property as the second // node. FuncToProperty, @@ -362,7 +362,7 @@ class SDKNodeDecl: public SDKNode { uint8_t ReferenceOwnership; StringRef GenericSig; // In ABI mode, this field is populated as a user-friendly version of GenericSig. - // Diagnostic preferes the sugared versions if they differ as well. + // Diagnostic prefers the sugared versions if they differ as well. StringRef SugaredGenericSig; std::optional FixedBinaryOrder; PlatformIntroVersion introVersions; diff --git a/include/swift/AST/ASTContext.h b/include/swift/AST/ASTContext.h index 45d55a9f1fbfd..dbe11ae80ed44 100644 --- a/include/swift/AST/ASTContext.h +++ b/include/swift/AST/ASTContext.h @@ -849,7 +849,7 @@ class ASTContext final { AvailabilityContext getSwiftAvailability(unsigned major, unsigned minor) const; // For each feature defined in FeatureAvailability, define two functions; - // the latter, with the suffix RuntimeAvailabilty, is for use with + // the latter, with the suffix RuntimeAvailability, is for use with // AvailabilityContext::forRuntimeTarget(), and only looks at the Swift // runtime version. #define FEATURE(N, V) \ diff --git a/include/swift/AST/ASTSynthesis.h b/include/swift/AST/ASTSynthesis.h index d4ee25064e87f..c6b3d805faf00 100644 --- a/include/swift/AST/ASTSynthesis.h +++ b/include/swift/AST/ASTSynthesis.h @@ -205,7 +205,7 @@ inline synthesizeMetatypeRepresentation(RepresentationSynthesizer rep) { switch (rep) { case _thin: return MetatypeRepresentation::Thin; case _thick: return MetatypeRepresentation::Thick; - // TOOD: maybe add _objc? + // TODO: maybe add _objc? } llvm_unreachable("bad kind"); } diff --git a/include/swift/AST/AccessScope.h b/include/swift/AST/AccessScope.h index 892df6fff6d9b..1ed9fea3e32fe 100644 --- a/include/swift/AST/AccessScope.h +++ b/include/swift/AST/AccessScope.h @@ -39,7 +39,7 @@ class AccessScope { /// Private private /// /// For example, if a decl with `public` access level is referenced outside of - /// its defining module, it will be maped to the pair during + /// its defining module, it will be mapped to the pair during /// the access scope check. This pair is determined based on the decl's access /// level in \c getAccessScopeForFormalAccess and passed to /// \c checkAccessUsingAccessScope which compares access scope of the diff --git a/include/swift/AST/AutoDiff.h b/include/swift/AST/AutoDiff.h index d4d2574882b6c..a3ba5a9a3f4cb 100644 --- a/include/swift/AST/AutoDiff.h +++ b/include/swift/AST/AutoDiff.h @@ -407,7 +407,7 @@ class DerivativeFunctionTypeError enum class Kind { /// Original function type has no semantic results. NoSemanticResults, - /// Differentiability parmeter indices are empty. + /// Differentiability parameter indices are empty. NoDifferentiabilityParameters, /// A differentiability parameter does not conform to `Differentiable`. NonDifferentiableDifferentiabilityParameter, diff --git a/include/swift/AST/Availability.h b/include/swift/AST/Availability.h index 8e21d27137197..75fa807f2a97c 100644 --- a/include/swift/AST/Availability.h +++ b/include/swift/AST/Availability.h @@ -384,21 +384,21 @@ class AvailabilityInference { /// For the attribute's introduction version, update the platform and version /// values to the re-mapped platform's, if using a fallback platform. - /// Returns `true` if a remap occured. + /// Returns `true` if a remap occurred. static bool updateIntroducedPlatformForFallback( const AvailableAttr *attr, const ASTContext &Ctx, llvm::StringRef &Platform, llvm::VersionTuple &PlatformVer); /// For the attribute's deprecation version, update the platform and version /// values to the re-mapped platform's, if using a fallback platform. - /// Returns `true` if a remap occured. + /// Returns `true` if a remap occurred. static bool updateDeprecatedPlatformForFallback( const AvailableAttr *attr, const ASTContext &Ctx, llvm::StringRef &Platform, llvm::VersionTuple &PlatformVer); /// For the attribute's obsoletion version, update the platform and version /// values to the re-mapped platform's, if using a fallback platform. - /// Returns `true` if a remap occured. + /// Returns `true` if a remap occurred. static bool updateObsoletedPlatformForFallback( const AvailableAttr *attr, const ASTContext &Ctx, llvm::StringRef &Platform, llvm::VersionTuple &PlatformVer); @@ -409,7 +409,7 @@ class AvailabilityInference { /// For the attribute's before version, update the platform and version /// values to the re-mapped platform's, if using a fallback platform. - /// Returns `true` if a remap occured. + /// Returns `true` if a remap occurred. static bool updateBeforePlatformForFallback(const BackDeployedAttr *attr, const ASTContext &Ctx, llvm::StringRef &Platform, diff --git a/include/swift/AST/Decl.h b/include/swift/AST/Decl.h index d4eb6ba0821a8..a1a2a0a52e0ca 100644 --- a/include/swift/AST/Decl.h +++ b/include/swift/AST/Decl.h @@ -1269,7 +1269,7 @@ class alignas(1 << DeclAlignInBits) Decl : public ASTAllocated { llvm::TinyPtrVector getAllImplementedObjCDecls() const; /// If this is the ObjC interface of a declaration implemented in Swift, - /// returns the implementating declaration. Otherwise return \c nullptr. + /// returns the implementing declaration. Otherwise return \c nullptr. /// /// \seeAlso ExtensionDecl::isObjCInterface() Decl *getObjCImplementationDecl() const; @@ -1387,7 +1387,7 @@ class alignas(1 << DeclAlignInBits) Decl : public ASTAllocated { std::optional> getSemanticUnavailableAttr(bool ignoreAppExtensions = false) const; - /// Returns true if code associated with this declaration should be considerd + /// Returns true if code associated with this declaration should be considered /// unreachable at runtime because the declaration is unavailable in all /// execution contexts in which the code may run. bool isUnreachableAtRuntime() const; @@ -5706,11 +5706,11 @@ enum class StorageMutability { /// to nor passed inout. Immutable, - /// The storage is mutable, meaning that it can be assigned and pased + /// The storage is mutable, meaning that it can be assigned and passed /// inout. Mutable, - /// The storage is immutable, but can be asigned for the purposes of + /// The storage is immutable, but can be assigned for the purposes of /// initialization. Initializable }; diff --git a/include/swift/AST/DeclAttr.def b/include/swift/AST/DeclAttr.def index 49ff70582ac0a..6075047301068 100644 --- a/include/swift/AST/DeclAttr.def +++ b/include/swift/AST/DeclAttr.def @@ -46,7 +46,7 @@ #define LAST_DECL_ATTR(CLASS) #endif -// Declaration Attributes and Modifers +// Declaration Attributes and Modifiers DECL_ATTR(_silgen_name, SILGenName, OnAbstractFunction | OnVar | LongAttribute | UserInaccessible | ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove, 0) diff --git a/include/swift/AST/DiagnosticsFrontend.def b/include/swift/AST/DiagnosticsFrontend.def index 361bd1cddbaf7..1438086f76158 100644 --- a/include/swift/AST/DiagnosticsFrontend.def +++ b/include/swift/AST/DiagnosticsFrontend.def @@ -167,7 +167,7 @@ WARNING(emit_reference_dependencies_without_primary_file,none, WARNING(ignoring_option_requires_option,none, "ignoring %0 (requires %1)", (StringRef, StringRef)) WARNING(warn_ignore_option_overriden_by,none, - "ignoring %0 (overriden by %1)", (StringRef, StringRef)) + "ignoring %0 (overridden by %1)", (StringRef, StringRef)) WARNING(warn_implicit_concurrency_import_failed,none, "unable to perform implicit import of \"_Concurrency\" module: no such module found", ()) diff --git a/include/swift/AST/DiagnosticsParse.def b/include/swift/AST/DiagnosticsParse.def index 4e8361ca23b17..43990aeae87bf 100644 --- a/include/swift/AST/DiagnosticsParse.def +++ b/include/swift/AST/DiagnosticsParse.def @@ -829,7 +829,7 @@ ERROR(function_type_argument_label,none, "function types cannot have argument labels; use '_' before %0", (Identifier)) ERROR(expected_dynamic_func_attr,none, - "expected a dynamically_replaceable function", ()) + "expected a dynamically_replacable function", ()) ERROR(async_after_throws,none, "%select{'async'|'reasync'}0 must precede %select{'throws'|'rethrows'}1", (bool, bool)) diff --git a/include/swift/AST/DiagnosticsSIL.def b/include/swift/AST/DiagnosticsSIL.def index 93c6f042ce328..8a257648c910f 100644 --- a/include/swift/AST/DiagnosticsSIL.def +++ b/include/swift/AST/DiagnosticsSIL.def @@ -376,7 +376,7 @@ ERROR(bad_attr_on_non_const_global,none, ERROR(global_must_be_compile_time_const,none, "global variable must be a compile-time constant", ()) ERROR(non_final_generic_class_function,none, - "classes cannot have non-final generic fuctions in embedded Swift", ()) + "classes cannot have non-final generic functions in embedded Swift", ()) ERROR(cannot_specialize_class,none, "cannot specialize %0 because class definition is not available (make sure to build with -wmo)", (Type)) ERROR(embedded_swift_existential_type,none, diff --git a/include/swift/AST/DiagnosticsSema.def b/include/swift/AST/DiagnosticsSema.def index 36ee69ec13bef..cc36d79518056 100644 --- a/include/swift/AST/DiagnosticsSema.def +++ b/include/swift/AST/DiagnosticsSema.def @@ -4317,7 +4317,7 @@ ERROR(diff_params_clause_param_not_differentiable,none, "can only differentiate with respect to parameters that conform to " "'Differentiable', but %0 does not conform to 'Differentiable'", (Type)) -// completionHanderAsync attribute +// completionHandlerAsync attribute WARNING(warn_use_async_alternative,none, "consider using asynchronous alternative function",()) @@ -7919,7 +7919,7 @@ ERROR(lifetime_dependence_only_on_function_method_init_result, none, ERROR(lifetime_dependence_invalid_type, none, "lifetime dependence can only be specified on ~Escapable types", ()) ERROR(lifetime_dependence_cannot_infer_ambiguous_candidate, none, - "cannot infer lifetime dependence %0, multiple parameters qualifiy as a candidate", (StringRef)) + "cannot infer lifetime dependence %0, multiple parameters qualify as a candidate", (StringRef)) ERROR(lifetime_dependence_cannot_infer_no_candidates, none, "cannot infer lifetime dependence%0, no parameters found that are either " "~Escapable or Escapable with a borrowing ownership", (StringRef)) diff --git a/include/swift/AST/Expr.h b/include/swift/AST/Expr.h index 05a7498dd9916..1831ed91ba6a9 100644 --- a/include/swift/AST/Expr.h +++ b/include/swift/AST/Expr.h @@ -3529,7 +3529,7 @@ class ActorIsolationErasureExpr : public ImplicitConversionExpr { class ExtractFunctionIsolationExpr : public Expr { /// The function value expression from which to extract the /// isolation. The type of `fnExpr` must be an ``@isolated(any)` - /// funciton. + /// function. Expr *fnExpr; /// The source location of `.isolation` diff --git a/include/swift/AST/FileUnit.h b/include/swift/AST/FileUnit.h index 95d34e8c6e8ac..4a8e7a58cc82d 100644 --- a/include/swift/AST/FileUnit.h +++ b/include/swift/AST/FileUnit.h @@ -39,7 +39,7 @@ class FileUnit : public DeclContext, public ASTAllocated { friend class DirectOperatorLookupRequest; friend class DirectPrecedenceGroupLookupRequest; - // The pointer is FileUnit insted of SynthesizedFileUnit to break circularity. + // The pointer is FileUnit instead of SynthesizedFileUnit to break circularity. llvm::PointerIntPair SynthesizedFileAndKind; protected: @@ -326,7 +326,7 @@ class FileUnit : public DeclContext, public ASTAllocated { /// The 'real name' is the actual binary name of the module, which can be different from the 'name' /// if module aliasing was used (via -module-alias flag). /// - /// This is usually the module real name which can be overriden by an + /// This is usually the module real name which can be overridden by an /// `export_as` definition of a clang module, or `-export-as` flag on an /// imported Swift module. Swift modules built from source do not apply /// their own `-export-as` flag, this way the swiftinterface can be diff --git a/include/swift/AST/ModuleDependencies.h b/include/swift/AST/ModuleDependencies.h index 7961e5ada019a..c90b6f87187ef 100644 --- a/include/swift/AST/ModuleDependencies.h +++ b/include/swift/AST/ModuleDependencies.h @@ -91,7 +91,7 @@ enum class ModuleDependencyKind : int8_t { LastKind = SwiftPlaceholder + 1 }; -/// This is used to idenfity a specific macro plugin dependency. +/// This is used to identify a specific macro plugin dependency. struct MacroPluginDependency { std::string LibraryPath; std::string ExecutablePath; @@ -672,7 +672,7 @@ class ModuleDependencyInfo { return storage->optionalModuleImports; } - /// Retreive the module-level dependencies. + /// Retrieve the module-level dependencies. const ArrayRef getDirectModuleDependencies() const { assert(storage->resolved); return storage->resolvedDirectModuleDependencies; diff --git a/include/swift/AST/PotentialMacroExpansions.h b/include/swift/AST/PotentialMacroExpansions.h index 104ada84ba822..70a0c42b51eae 100644 --- a/include/swift/AST/PotentialMacroExpansions.h +++ b/include/swift/AST/PotentialMacroExpansions.h @@ -44,7 +44,7 @@ class PotentialMacroExpansions { return Storage.getPointer(); } - /// Get or create a nam + /// Get or create a name NameSet &getOrCreateIntroducedNames() { if (auto nameSet = Storage.getPointer()) return *nameSet; @@ -121,7 +121,7 @@ class PotentialMacroExpansions { /// Determine whether one should expand any macros in this context because /// they could introduce a declaration with the given name. bool shouldExpandForName(DeclName name) const { - // If any macro produces arbitraty names, we need to expand it. + // If any macro produces arbitrary names, we need to expand it. if (introducesArbitraryNames()) return true; diff --git a/include/swift/AST/ProtocolConformance.h b/include/swift/AST/ProtocolConformance.h index e415b08ead62d..4b4ce753c988f 100644 --- a/include/swift/AST/ProtocolConformance.h +++ b/include/swift/AST/ProtocolConformance.h @@ -653,7 +653,7 @@ class NormalProtocolConformance : public RootProtocolConformance, return Bits.NormalProtocolConformance.HasComputedAssociatedConformances; } - /// Mark this conformance as having computed the assocaited conformance array. + /// Mark this conformance as having computed the associated conformance array. void setHasComputedAssociatedConformances() { Bits.NormalProtocolConformance.HasComputedAssociatedConformances = true; } diff --git a/include/swift/AST/SourceFile.h b/include/swift/AST/SourceFile.h index 079a75c4da4c3..9757c5a5728ea 100644 --- a/include/swift/AST/SourceFile.h +++ b/include/swift/AST/SourceFile.h @@ -226,7 +226,7 @@ class SourceFile final : public FileUnit { /// All the \c #if source ranges in this file. std::vector Ranges; - /// Whether the elemnts in \c Ranges are sorted in source order within + /// Whether the elements in \c Ranges are sorted in source order within /// this file. We flip this to \c false any time a new range gets recorded, /// and lazily do the sorting when doing a query. bool IsSorted = false; diff --git a/include/swift/AST/TypeCheckRequests.h b/include/swift/AST/TypeCheckRequests.h index 3c9ce269a95d6..9a09e1503afd0 100644 --- a/include/swift/AST/TypeCheckRequests.h +++ b/include/swift/AST/TypeCheckRequests.h @@ -1811,7 +1811,7 @@ class StoredPropertiesAndMissingMembersRequest : bool isCached() const { return true; } }; -/// Request to obtain a list of computed properties with init accesors +/// Request to obtain a list of computed properties with init accessors /// in the given nominal type. class InitAccessorPropertiesRequest : public SimpleRequestgetDeclContext()->getSelfNominalType(). - /// Passed as a parameter in here so this request doesn't tigger self nominal + /// Passed as a parameter in here so this request doesn't trigger self nominal /// type computation. evaluator::SideEffect evaluate(Evaluator &evaluator, ValueDecl *VD, NominalTypeDecl *SelfNominalType) const; diff --git a/include/swift/AST/TypeRepr.h b/include/swift/AST/TypeRepr.h index 99fcff91d1531..45c43f9dba9cc 100644 --- a/include/swift/AST/TypeRepr.h +++ b/include/swift/AST/TypeRepr.h @@ -1014,7 +1014,7 @@ class CompositionTypeRepr final : public TypeRepr, SourceRange getCompositionRange() const { return CompositionRange; } /// 'Any' is understood as CompositionTypeRepr by the compiler but its type array will be empty - /// becasue it is a nonspecific type + /// because it is a nonspecific type bool isTypeReprAny() { return getTypes().size() == 0 ? true : false; } diff --git a/include/swift/AST/Types.h b/include/swift/AST/Types.h index 4677bdf6f239f..390066ee01164 100644 --- a/include/swift/AST/Types.h +++ b/include/swift/AST/Types.h @@ -6108,7 +6108,7 @@ class ProtocolCompositionType final : public TypeBase, /// given set of members. /// /// This presents a syntactic view of the world, where an empty composition - /// has implicit Copyable and Escapable members, unless they are supressed + /// has implicit Copyable and Escapable members, unless they are suppressed /// with the Inverses field. /// /// The list of members consists of zero or more ProtocolType, diff --git a/include/swift/Basic/Assertions.h b/include/swift/Basic/Assertions.h index d8155add80baf..a8b8d9e57a9d6 100644 --- a/include/swift/Basic/Assertions.h +++ b/include/swift/Basic/Assertions.h @@ -129,11 +129,11 @@ extern int CONDITIONAL_ASSERT_Global_enable_flag; // You should mostly avoid this except for occasional experiments in your // local tree. It can be useful in two situations: // -// * Assertions that are known to mis-fire. +// * Assertions that are known to misfire. // Such assertions should not be `ASSERT` (since that will cause unnecessary // broken compiles) and `CONDITIONAL_ASSERT` gets enabled a lot by people who // are not compiler experts. So `DEBUG_ASSERT` is appropriate there until the -// check can be fixed so it doesn't mis-fire. +// check can be fixed so it doesn't misfire. // // * Inner loops that can run billions of times. // For these, even the cost of testing whether `CONDITIONAL_ASSERT` is enabled diff --git a/include/swift/Basic/Features.def b/include/swift/Basic/Features.def index b758de2ae4b79..c16b4e024652d 100644 --- a/include/swift/Basic/Features.def +++ b/include/swift/Basic/Features.def @@ -287,7 +287,7 @@ EXPERIMENTAL_FEATURE(AdditiveArithmeticDerivedConformances, false) /// @Sendable. EXPERIMENTAL_FEATURE(SendableCompletionHandlers, false) -/// Enables opaque type erasure without also enabling implict dynamic +/// Enables opaque type erasure without also enabling implicit dynamic EXPERIMENTAL_FEATURE(OpaqueTypeErasure, true) /// Whether to perform round-trip testing of the Swift Swift parser. diff --git a/include/swift/Basic/LangOptions.h b/include/swift/Basic/LangOptions.h index e0ba5ff38442c..aa8d48c40987a 100644 --- a/include/swift/Basic/LangOptions.h +++ b/include/swift/Basic/LangOptions.h @@ -205,7 +205,7 @@ namespace swift { /// Should access control be respected? bool EnableAccessControl = true; - /// Enable loading a package interface if both client and depdency module are in the + /// Enable loading a package interface if both client and dependency module are in the /// same package determined by `package-name` flag. bool EnablePackageInterfaceLoad = false; @@ -400,7 +400,7 @@ namespace swift { /// Enable experimental eager Clang module diagnostics. bool EnableExperimentalEagerClangModuleDiagnostics = false; - /// Force ClangImporter's import-as-member extensions to load thier members + /// Force ClangImporter's import-as-member extensions to load their members /// immediately, bypassing their SwiftLookupTables. This emulates an /// implementation quirk of previous compilers. bool DisableNamedLazyImportAsMemberLoading = false; @@ -915,7 +915,7 @@ namespace swift { /// Defer typechecking of declarations to their use at runtime bool DeferToRuntime = false; - /// Allow request evalutation to perform type checking lazily, instead of + /// Allow request evaluation to perform type checking lazily, instead of /// eagerly typechecking source files after parsing. bool EnableLazyTypecheck = false; }; diff --git a/include/swift/Basic/MathUtils.h b/include/swift/Basic/MathUtils.h index 583ee155e6a3f..d9bbf52b8b601 100644 --- a/include/swift/Basic/MathUtils.h +++ b/include/swift/Basic/MathUtils.h @@ -41,7 +41,7 @@ static inline size_t roundUpToAlignMask(size_t size, size_t alignMask) { static inline unsigned popcount(unsigned value) { #if SWIFT_COMPILER_IS_MSVC && (defined(_M_IX86) || defined(_M_X64)) - // The __popcnt intrinsic is only available when targetting x86{_64} with MSVC. + // The __popcnt intrinsic is only available when targeting x86{_64} with MSVC. return __popcnt(value); #elif __has_builtin(__builtin_popcount) return __builtin_popcount(value); diff --git a/include/swift/Basic/SourceManager.h b/include/swift/Basic/SourceManager.h index 2dd444e56832e..8a6505b6f956a 100644 --- a/include/swift/Basic/SourceManager.h +++ b/include/swift/Basic/SourceManager.h @@ -223,7 +223,7 @@ class SourceManager { const GeneratedSourceInfo *getGeneratedSourceInfo(unsigned bufferID) const; /// Retrieve the list of ancestors of the given source buffer, starting with - /// the root buffer and proceding to the given buffer ID at the end. + /// the root buffer and proceeding to the given buffer ID at the end. /// /// The scratch parameter will be used to avoid allocation in the case where /// the given buffer ID is the top-level buffer, in which case bufferID will @@ -457,7 +457,7 @@ class SourceManager { void verifyAllBuffers() const; /// Translate line and column pair to the offset. - /// If the column number is the maximum unsinged int, return the offset of the end of the line. + /// If the column number is the maximum unsigned int, return the offset of the end of the line. std::optional resolveFromLineCol(unsigned BufferId, unsigned Line, unsigned Col) const; diff --git a/include/swift/DependencyScan/DependencyScanningTool.h b/include/swift/DependencyScan/DependencyScanningTool.h index 71f3160f063cf..53206936fff23 100644 --- a/include/swift/DependencyScan/DependencyScanningTool.h +++ b/include/swift/DependencyScan/DependencyScanningTool.h @@ -117,7 +117,7 @@ class DependencyScanningTool { void resetCache(); /// Query diagnostics consumed so far. std::vector getDiagnostics(); - /// Discared the collection of diagnostics encountered so far. + /// Discard the collection of diagnostics encountered so far. void resetDiagnostics(); /// Using the specified invocation command, instantiate a CompilerInstance diff --git a/include/swift/Frontend/DiagnosticHelper.h b/include/swift/Frontend/DiagnosticHelper.h index dfdb6538e4812..29177a197398c 100644 --- a/include/swift/Frontend/DiagnosticHelper.h +++ b/include/swift/Frontend/DiagnosticHelper.h @@ -32,7 +32,7 @@ class DiagnosticHelper { public: /// Create a DiagnosticHelper class to emit diagnostics from frontend actions. /// OS is the stream to print diagnostics. useQuasiPID determines if using - /// real PID when priting parseable output. + /// real PID when printing parseable output. static DiagnosticHelper create(CompilerInstance &instance, llvm::raw_pwrite_stream &OS = llvm::errs(), bool useQuasiPID = false); diff --git a/include/swift/Frontend/Frontend.h b/include/swift/Frontend/Frontend.h index 63541128977ad..9aae22ff9d8c4 100644 --- a/include/swift/Frontend/Frontend.h +++ b/include/swift/Frontend/Frontend.h @@ -683,7 +683,7 @@ class CompilerInstance { /// Whether this compiler instance supports caching. bool supportCaching() const; - /// Whether errors during interface verification can be downgrated + /// Whether errors during interface verification can be downgraded /// to warnings. bool downgradeInterfaceVerificationErrors() const; diff --git a/include/swift/IDE/CancellableResult.h b/include/swift/IDE/CancellableResult.h index 73345caeb46ee..4156f7cf0d161 100644 --- a/include/swift/IDE/CancellableResult.h +++ b/include/swift/IDE/CancellableResult.h @@ -147,7 +147,7 @@ class CancellableResult { /// \p Handle with either the transformed value or the failure or cancelled /// result. /// The \c async part of the map means that the transform might happen - /// asyncronously. This function does not introduce asynchronicity by itself. + /// asynchronously. This function does not introduce asynchronicity by itself. /// \p Transform might also invoke the callback synchronously. template void diff --git a/include/swift/IDE/CodeCompletionResultType.h b/include/swift/IDE/CodeCompletionResultType.h index 90832f7be4d3c..6741f6317b9ab 100644 --- a/include/swift/IDE/CodeCompletionResultType.h +++ b/include/swift/IDE/CodeCompletionResultType.h @@ -310,7 +310,7 @@ class CodeCompletionResultType { /// It would be nice if we could use a SmallVector to store those types /// instead but \c CodeCompletionResultType is allocated in a bump /// allocator and freeing the bump allocator does not call the - /// SmallVecotor's destructor, leaking potential heap memory. Since we only + /// SmallVector's destructor, leaking potential heap memory. Since we only /// need two result types at the moment, I decided to implement it in a /// hacky way with two pointers. /// The \c getResultTypes and \c isApplicable methods mask away this diff --git a/include/swift/IDE/CompletionLookup.h b/include/swift/IDE/CompletionLookup.h index ae0fbe8e65583..7553386ad5698 100644 --- a/include/swift/IDE/CompletionLookup.h +++ b/include/swift/IDE/CompletionLookup.h @@ -530,7 +530,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer { /// Add code completion results after an expression of type \p ExprType. /// This includes members as well as call patterns if \p ExprType is a /// function type. - /// If \p IsDeclUnapplied is \c true, we are completing after a refernce to + /// If \p IsDeclUnapplied is \c true, we are completing after a reference to /// \p VD that hasn't been called yet. Thus, \p VD has type \p ExprType and we /// can use \p VD to enrich call pattern completions of \p ExprType. void getValueExprCompletions(Type ExprType, ValueDecl *VD = nullptr, @@ -614,7 +614,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer { void getPoundAvailablePlatformCompletions(); - /// \p Loc is the location of the code completin token. + /// \p Loc is the location of the code completion token. /// \p isForDeclResult determines if were are spelling out the result type /// of a declaration. void getSelfTypeCompletionInDeclContext(SourceLoc Loc, bool isForDeclResult); diff --git a/include/swift/IDE/IDEBridging.h b/include/swift/IDE/IDEBridging.h index dbbed37e48cbb..60c2574a0858a 100644 --- a/include/swift/IDE/IDEBridging.h +++ b/include/swift/IDE/IDEBridging.h @@ -79,7 +79,7 @@ struct ResolvedLoc { /// - Declaration labels contain the first name and the second name, excluding /// the trivia on their sides /// - For function arguments that don't have a label, this is an empty range - /// that points to the start of the argument (exculding trivia). + /// that points to the start of the argument (excluding trivia). /// /// See documentation on `DeclNameLocation.Argument` in swift-syntax for more /// background. diff --git a/include/swift/IDE/PostfixCompletion.h b/include/swift/IDE/PostfixCompletion.h index 0e7953b5baf50..a07c28f75fe17 100644 --- a/include/swift/IDE/PostfixCompletion.h +++ b/include/swift/IDE/PostfixCompletion.h @@ -38,7 +38,7 @@ class PostfixCompletionCallback : public TypeCheckCompletionCallback { /// If the expression we are completing on statically refers to a metatype, /// that is if it's something like 'MyType'. In such cases we want to offer - /// constructor call pattern completions and don't want to suggeste + /// constructor call pattern completions and don't want to suggest /// operators that work on metatypes. bool BaseIsStaticMetaType; @@ -53,7 +53,7 @@ class PostfixCompletionCallback : public TypeCheckCompletionCallback { /// If the code completion expression occurs as e.g a single statement in a /// single-expression closure, where the return is implied. In such cases /// we don't want to disfavor results that produce 'Void' because the user - /// might intend to make the closure a multi-statment closure, in which case + /// might intend to make the closure a multi-statement closure, in which case /// this expression is no longer implicitly returned. bool IsImpliedResult; @@ -90,7 +90,7 @@ class PostfixCompletionCallback : public TypeCheckCompletionCallback { /// \c sawSolution for each solution formed. void fallbackTypeCheck(DeclContext *DC) override; - /// Deliver code completion results that were discoverd by \c sawSolution to + /// Deliver code completion results that were discovered by \c sawSolution to /// \p Consumer. /// \param DotLoc If we are completing after a dot, the location of the dot, /// otherwise an invalid SourceLoc. diff --git a/include/swift/IDE/SyntaxModel.h b/include/swift/IDE/SyntaxModel.h index 23aefae92bc43..fe93a9189c67c 100644 --- a/include/swift/IDE/SyntaxModel.h +++ b/include/swift/IDE/SyntaxModel.h @@ -53,7 +53,7 @@ enum class SyntaxNodeKind : uint8_t { PoundDirectiveKeyword, /// Any occurrence of '@' anywhere. AttributeId, - /// A "resolved/active" attribute. Mis-applied attributes will be AttributeId. + /// A "resolved/active" attribute. Misapplied attributes will be AttributeId. AttributeBuiltin, /// An editor placeholder string <#like this#>. EditorPlaceholder, diff --git a/include/swift/IDE/Utils.h b/include/swift/IDE/Utils.h index eb697d0615e1e..4f6c11cb2b814 100644 --- a/include/swift/IDE/Utils.h +++ b/include/swift/IDE/Utils.h @@ -395,7 +395,7 @@ struct ResolvedRangeInfo { CommonExprParent(CommonExprParent) {} ResolvedRangeInfo(ArrayRef TokensInRange) : ResolvedRangeInfo(RangeKind::Invalid, {nullptr, ExitState::Unsure}, - TokensInRange, nullptr, /*Commom Expr Parent*/nullptr, + TokensInRange, nullptr, /*Common Expr Parent*/nullptr, /*Single entry*/true, /*UnhandledEffects*/{}, OrphanKind::None, {}, {}, {}) {} ResolvedRangeInfo(): ResolvedRangeInfo(ArrayRef()) {} diff --git a/include/swift/IDETool/IDEInspectionInstance.h b/include/swift/IDETool/IDEInspectionInstance.h index 0f3ab25f7f09b..5ee3c6664cc79 100644 --- a/include/swift/IDETool/IDEInspectionInstance.h +++ b/include/swift/IDETool/IDEInspectionInstance.h @@ -129,7 +129,7 @@ class IDEInspectionInstance { Callback); /// Calls \p Callback with new \c CompilerInstance for the completion - /// request. The \c CompilerInstace passed to the callback already performed + /// request. The \c CompilerInstance passed to the callback already performed /// the first pass. /// Returns \c false if it fails to setup the \c CompilerInstance. void performNewOperation( @@ -143,7 +143,7 @@ class IDEInspectionInstance { Callback); /// Calls \p Callback with a \c CompilerInstance which is prepared for the - /// second pass. \p Callback is resposible to perform the second pass on it. + /// second pass. \p Callback is responsible to perform the second pass on it. /// The \c CompilerInstance may be reused from the previous completions, /// and may be cached for the next completion. /// In case of failure or cancellation, the callback receives the @@ -152,7 +152,7 @@ class IDEInspectionInstance { /// If \p CancellationFlag is not \c nullptr, code completion can be cancelled /// by setting the flag to \c true. /// IMPORTANT: If \p CancellationFlag is not \c nullptr, then completion might - /// be cancelled in the secon pass that's invoked inside \p Callback. + /// be cancelled in the second pass that's invoked inside \p Callback. /// Therefore, \p Callback MUST check whether completion was cancelled before /// interpreting the results, since invalid results may be returned in case /// of cancellation. diff --git a/include/swift/Option/Options.td b/include/swift/Option/Options.td index 422a8c1f9a78a..553480d9a9954 100644 --- a/include/swift/Option/Options.td +++ b/include/swift/Option/Options.td @@ -1026,7 +1026,7 @@ def ExperimentalPackageCMO : Flag<["-"], "experimental-package-cmo">, def PackageCMO : Flag<["-"], "package-cmo">, Flags<[FrontendOption]>, - HelpText<"Enable optimization to perform defalut CMO within a package boundary">; + HelpText<"Enable optimization to perform default CMO within a package boundary">; def EnableDefaultCMO : Flag<["-"], "enable-default-cmo">, Flags<[HelpHidden, FrontendOption]>, diff --git a/include/swift/Parse/IDEInspectionCallbacks.h b/include/swift/Parse/IDEInspectionCallbacks.h index f1f160429c996..b6236cfca7e1e 100644 --- a/include/swift/Parse/IDEInspectionCallbacks.h +++ b/include/swift/Parse/IDEInspectionCallbacks.h @@ -31,7 +31,7 @@ enum class ObjCSelectorContext { /// Attributes that have syntax which can't be modelled using a function call. /// This can't be \c DeclAttrKind because '@freestandig' and '@attached' have -/// the same attribute kind but take different macro roles as arguemnts. +/// the same attribute kind but take different macro roles as arguments. enum class CustomSyntaxAttributeKind { Available, FreestandingMacro, diff --git a/include/swift/Parse/Parser.h b/include/swift/Parse/Parser.h index 68eb6c4c3aa13..90062ae7674f0 100644 --- a/include/swift/Parse/Parser.h +++ b/include/swift/Parse/Parser.h @@ -612,7 +612,7 @@ class Parser { SourceLoc consumeAttributeLParen(); /// If the next token is a '(' that's not on a new line consume it, and error - /// (Swift 6) or warn (Swift <6) that the attribute must not be separted from + /// (Swift 6) or warn (Swift <6) that the attribute must not be separated from /// the '(' by a space. /// /// If the next token is not '(' or it's on a new line, return false. diff --git a/include/swift/Refactoring/RenameLoc.h b/include/swift/Refactoring/RenameLoc.h index 2f4d5c2b82f17..41bc1e3207199 100644 --- a/include/swift/Refactoring/RenameLoc.h +++ b/include/swift/Refactoring/RenameLoc.h @@ -62,7 +62,7 @@ struct RenameLoc { /// How the identifier is being used (call, reference, definition, unknown). /// - /// Used to decide whether a given occurance should be renamed and/or if its + /// Used to decide whether a given occurrence should be renamed and/or if its /// argument labels should be renamed. RenameLocUsage Usage; diff --git a/include/swift/RemoteInspection/RuntimeHeaders/llvm-c/Types.h b/include/swift/RemoteInspection/RuntimeHeaders/llvm-c/Types.h index 4e9967372d79f..c628c59982801 100644 --- a/include/swift/RemoteInspection/RuntimeHeaders/llvm-c/Types.h +++ b/include/swift/RemoteInspection/RuntimeHeaders/llvm-c/Types.h @@ -127,7 +127,7 @@ typedef struct LLVMOpaqueModuleProvider *LLVMModuleProviderRef; typedef struct LLVMOpaquePassManager *LLVMPassManagerRef; /** - * Used to get the users and usees of a Value. + * Used to get the users and uses of a Value. * * @see llvm::Use */ typedef struct LLVMOpaqueUse *LLVMUseRef; diff --git a/include/swift/RemoteInspection/RuntimeHeaders/llvm/Support/BinaryByteStream.h b/include/swift/RemoteInspection/RuntimeHeaders/llvm/Support/BinaryByteStream.h index 474a8df3ab381..1ee3a14283069 100644 --- a/include/swift/RemoteInspection/RuntimeHeaders/llvm/Support/BinaryByteStream.h +++ b/include/swift/RemoteInspection/RuntimeHeaders/llvm/Support/BinaryByteStream.h @@ -4,7 +4,7 @@ // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception //===----------------------------------------------------------------------===// -// A BinaryStream which stores data in a single continguous memory buffer. +// A BinaryStream which stores data in a single contiguous memory buffer. //===----------------------------------------------------------------------===// #ifndef LLVM_SUPPORT_BINARYBYTESTREAM_H diff --git a/include/swift/RemoteInspection/RuntimeHeaders/llvm/Support/ConvertUTF.h b/include/swift/RemoteInspection/RuntimeHeaders/llvm/Support/ConvertUTF.h index c892bb3c03cb5..25d46178457d6 100644 --- a/include/swift/RemoteInspection/RuntimeHeaders/llvm/Support/ConvertUTF.h +++ b/include/swift/RemoteInspection/RuntimeHeaders/llvm/Support/ConvertUTF.h @@ -47,7 +47,7 @@ Conversions between UTF32, UTF-16, and UTF-8. Header file. - Several funtions are included here, forming a complete set of + Several functions are included here, forming a complete set of conversions between the three formats. UTF-7 is not included here, but is handled in a separate source file. diff --git a/include/swift/RemoteInspection/TypeRefBuilder.h b/include/swift/RemoteInspection/TypeRefBuilder.h index 6f24e2c42b313..1e9bb01c448fb 100644 --- a/include/swift/RemoteInspection/TypeRefBuilder.h +++ b/include/swift/RemoteInspection/TypeRefBuilder.h @@ -1001,7 +1001,7 @@ class TypeRefBuilder { // Soundness: Verify that the generic params per level add // up exactly to the number of args we were provided, and - // that we don't have a rediculous number of either one + // that we don't have a ridiculous number of either one auto genericParamsPerLevel = *maybeGenericParamsPerLevel; if (genericParamsPerLevel.size() > 1000 || args.size() > 1000) { return nullptr; @@ -1712,7 +1712,7 @@ class TypeRefBuilder { } auto protocolNameOffset = (const uint32_t *)protocolNameOffsetBytes.get(); - // Using the offset above, compute the address of the name field itsel + // Using the offset above, compute the address of the name field itself // and read it. auto protocolNameAddress = detail::applyRelativeOffset((const char *)protocolNameOffsetAddress, diff --git a/include/swift/Runtime/Metadata.h b/include/swift/Runtime/Metadata.h index 0b69f2d9723bf..4a44ee137984a 100644 --- a/include/swift/Runtime/Metadata.h +++ b/include/swift/Runtime/Metadata.h @@ -676,7 +676,7 @@ void swift_initStructMetadataWithLayoutString(StructMetadata *self, enum LayoutStringFlags : uint64_t { Empty = 0, - // TODO: Track other useful information tha can be used to optimize layout + // TODO: Track other useful information that can be used to optimize layout // strings, like different reference kinds contained in the string // number of ref counting operations (maybe up to 4), so we can // use witness functions optimized for these cases. diff --git a/include/swift/SIL/DebugUtils.h b/include/swift/SIL/DebugUtils.h index 0b8c6aa46a678..278031887460c 100644 --- a/include/swift/SIL/DebugUtils.h +++ b/include/swift/SIL/DebugUtils.h @@ -66,7 +66,7 @@ inline void deleteAllDebugUses(SILInstruction *inst) { /// This iterator filters out any debug (or non-debug) instructions from a range /// of uses, provided by the underlying ValueBaseUseIterator. /// If \p nonDebugInsts is true, then the iterator provides a view to all non- -/// debug instructions. Otherwise it provides a view ot all debug-instructions. +/// debug instructions. Otherwise it provides a view to all debug-instructions. template class DebugUseIterator { public: using iterator_category = std::forward_iterator_tag; @@ -252,7 +252,7 @@ bool hasNonTrivialNonDebugTransitiveUsers( /// information about a VarDecl. This allows one to write high level code over /// the set of such instructions with greater correctness by using exhaustive /// switches, methods, and keeping it light weight by using *, -> operators to -/// access functionality from the underlying instruction when eneded. +/// access functionality from the underlying instruction when ended. class VarDeclCarryingInst { public: enum class Kind : uint8_t { diff --git a/include/swift/SIL/InstructionUtils.h b/include/swift/SIL/InstructionUtils.h index 88a2621c172b5..ffffe277c152e 100644 --- a/include/swift/SIL/InstructionUtils.h +++ b/include/swift/SIL/InstructionUtils.h @@ -221,7 +221,7 @@ SILValue getStaticOverloadForSpecializedPolymorphicBuiltin(BuiltinInst *bi); /// a tree of tuples. /// /// If visitor returns false, we stop processing early. We return true if we -/// visited all of the tuple elements without the visitor returing false. +/// visited all of the tuple elements without the visitor returning false. bool visitExplodedTupleType(SILType type, llvm::function_ref callback); @@ -229,7 +229,7 @@ bool visitExplodedTupleType(SILType type, /// a tree of tuples. /// /// If visitor returns false, we stop processing early. We return true if we -/// visited all of the tuple elements without the visitor returing false. +/// visited all of the tuple elements without the visitor returning false. bool visitExplodedTupleValue(SILValue value, llvm::function_ref)> callback); diff --git a/include/swift/SIL/OSSALifetimeCompletion.h b/include/swift/SIL/OSSALifetimeCompletion.h index 42a0fc3f6b882..cac96f500a250 100644 --- a/include/swift/SIL/OSSALifetimeCompletion.h +++ b/include/swift/SIL/OSSALifetimeCompletion.h @@ -46,7 +46,7 @@ class OSSALifetimeCompletion { DeadEndBlocks &deadEndBlocks; - // Cache intructions already handled by the recursive algorithm to avoid + // Cache instructions already handled by the recursive algorithm to avoid // recomputing their lifetimes. ValueSet completedValues; @@ -88,7 +88,7 @@ class OSSALifetimeCompletion { /// values or borrow introducers. /// /// Currently \p boundary == {Boundary::Availability} is used by Mem2Reg and - /// TempRValueOpt and PredicatbleMemOpt to complete lexical enum values on + /// TempRValueOpt and PredictableMemOpt to complete lexical enum values on /// trivial paths. /// /// Returns true if any new instructions were created to complete the diff --git a/include/swift/SIL/OwnershipUseVisitor.h b/include/swift/SIL/OwnershipUseVisitor.h index 9fdca1f5bebe0..e643904368917 100644 --- a/include/swift/SIL/OwnershipUseVisitor.h +++ b/include/swift/SIL/OwnershipUseVisitor.h @@ -205,7 +205,7 @@ bool OwnershipUseVisitor::visitLifetimeEndingUses(SILValue ssaDef) { case OwnershipKind::Any: case OwnershipKind::None: case OwnershipKind::Unowned: - llvm_unreachable("requires an owned or guaranteed orignalDef"); + llvm_unreachable("requires an owned or guaranteed originalDef"); } return true; } @@ -361,7 +361,7 @@ bool OwnershipUseVisitor::visitInteriorUses(SILValue ssaDef) { case OwnershipKind::Any: case OwnershipKind::None: case OwnershipKind::Unowned: - llvm_unreachable("requires an owned or guaranteed orignalDef"); + llvm_unreachable("requires an owned or guaranteed originalDef"); } } diff --git a/include/swift/SIL/OwnershipUtils.h b/include/swift/SIL/OwnershipUtils.h index 25d1930f15c7a..f52bb37c0f4ae 100644 --- a/include/swift/SIL/OwnershipUtils.h +++ b/include/swift/SIL/OwnershipUtils.h @@ -630,7 +630,7 @@ struct BorrowedValue { /// Add this scope's live blocks into the PrunedLiveness result. This /// includes reborrow scopes that are reachable from this borrow scope but not - /// necessarilly dominated by the borrow scope. + /// necessarily dominated by the borrow scope. void computeTransitiveLiveness(MultiDefPrunedLiveness &liveness) const; /// Returns true if \p uses are completely within this borrow introducer's @@ -717,7 +717,7 @@ struct BorrowedValue { } // Helpers to allow a BorrowedValue to easily be used as a SILValue - // programatically. + // programmatically. SILValue operator->() { return value; } SILValue operator->() const { return value; } SILValue operator*() { return value; } diff --git a/include/swift/SIL/Projection.h b/include/swift/SIL/Projection.h index 2e952732907b7..54892f3b5123f 100644 --- a/include/swift/SIL/Projection.h +++ b/include/swift/SIL/Projection.h @@ -955,7 +955,7 @@ class ProjectionTree { void getLiveLeafTypes(llvm::SmallVectorImpl &OutArray) const { for (unsigned LeafIndex : LiveLeafIndices) { const ProjectionTreeNode *Node = getNode(LeafIndex); - assert(Node->IsLive && "We are only interested in leafs that are live"); + assert(Node->IsLive && "We are only interested in leaves that are live"); OutArray.push_back(Node->getType()); } } @@ -964,20 +964,20 @@ class ProjectionTree { llvm::SmallVectorImpl &Out) const { for (unsigned LeafIndex : LiveLeafIndices) { const ProjectionTreeNode *Node = getNode(LeafIndex); - assert(Node->IsLive && "We are only interested in leafs that are live"); + assert(Node->IsLive && "We are only interested in leaves that are live"); Out.push_back(Node); } } - /// Return the number of live leafs in the projection. + /// Return the number of live leaves in the projection. unsigned getLiveLeafCount() const { return LiveLeafIndices.size(); } void createTreeFromValue(SILBuilder &B, SILLocation Loc, SILValue NewBase, - llvm::SmallVectorImpl &Leafs) const; + llvm::SmallVectorImpl &Leaves) const; void replaceValueUsesWithLeafUses(SILBuilder &B, SILLocation Loc, - llvm::SmallVectorImpl &Leafs); + llvm::SmallVectorImpl &Leaves); void getUsers(SmallPtrSetImpl &users) const; diff --git a/include/swift/SIL/PrunedLiveness.h b/include/swift/SIL/PrunedLiveness.h index 58ababe190355..e1b4df974cbde 100644 --- a/include/swift/SIL/PrunedLiveness.h +++ b/include/swift/SIL/PrunedLiveness.h @@ -231,7 +231,7 @@ class PrunedLiveBlocks { /// Update this liveness result for a single use. /// - /// \p isUseBeforeDef is true if \p user occures before the first def in this + /// \p isUseBeforeDef is true if \p user occurs before the first def in this /// block. This indicates "liveness holes" inside the block, causing liveness /// to propagate to predecessors. IsLive updateForUse(SILInstruction *user, bool isUseBeforeDef) { @@ -775,7 +775,7 @@ class SSAPrunedLiveness : public PrunedLiveRange { /// then the resulting liveness does not includes potentially non-dominated /// uses within the reborrow scope. If the summary returns something other /// than AddressUseKind::NonEscaping, then the resulting liveness does not - /// necessarilly encapsulate value ownership. + /// necessarily encapsulate value ownership. /// /// Warning: If OSSA lifetimes are incomplete, then destroy_values might not /// jointly-post dominate if dead-end blocks are present. Nested scopes may @@ -865,7 +865,7 @@ class MultiDefPrunedLiveness : public PrunedLiveRange { /// then the resulting liveness does not includes potentially non-dominated /// uses within the reborrow scope. If the summary returns something other /// than AddressUseKind::NonEscaping, then the resulting liveness does not - /// necessarilly encapsulate value ownership. + /// necessarily encapsulate value ownership. /// /// Warning: If OSSA lifetimes are incomplete, then destroy_values might not /// jointly-post dominate if dead-end blocks are present. Nested scopes may diff --git a/include/swift/SIL/SILBitfield.h b/include/swift/SIL/SILBitfield.h index ee46097540747..bb647a0b850df 100644 --- a/include/swift/SIL/SILBitfield.h +++ b/include/swift/SIL/SILBitfield.h @@ -158,7 +158,7 @@ class KnownSizeSet { /// BitfieldRef container; /// /// void performWithContainer(SILFunction *function) { -/// BitfieldRef::StackState state(container, functon); +/// BitfieldRef::StackState state(container, function); /// /// assert(container->isValid()); /// } diff --git a/include/swift/SIL/SILBuilder.h b/include/swift/SIL/SILBuilder.h index bdb73dd0f0b2d..57b2a6261e859 100644 --- a/include/swift/SIL/SILBuilder.h +++ b/include/swift/SIL/SILBuilder.h @@ -662,7 +662,7 @@ class SILBuilder { } // Creates a dynamic_function_ref or function_ref depending on whether f is - // dynamically_replaceable. + // dynamically_replacable. FunctionRefBaseInst *createFunctionRefFor(SILLocation Loc, SILFunction *f) { if (f->isDynamicallyReplaceable()) return createDynamicFunctionRef(Loc, f); diff --git a/include/swift/SIL/SILCloner.h b/include/swift/SIL/SILCloner.h index 51b191233992c..fe054bb9f75d5 100644 --- a/include/swift/SIL/SILCloner.h +++ b/include/swift/SIL/SILCloner.h @@ -418,7 +418,7 @@ class SILCloner : protected SILInstructionVisitor { return bbIter->second != OrigBB; } - /// Return the new block within the cloned region analagous to the given + /// Return the new block within the cloned region analogous to the given /// original block. /// /// Assumes that `isBlockCloned` is true. diff --git a/include/swift/SIL/SILInstruction.h b/include/swift/SIL/SILInstruction.h index 160fbab75bd7d..436e06d518826 100644 --- a/include/swift/SIL/SILInstruction.h +++ b/include/swift/SIL/SILInstruction.h @@ -428,7 +428,7 @@ class SILInstruction : public llvm::ilist_node { /// Total number of created and deleted SILInstructions. /// - /// Ideally, those counters would be inside SILModules to allow mutiple + /// Ideally, those counters would be inside SILModules to allow multiple /// SILModules (e.g. in different threads). static int NumCreatedInstructions; static int NumDeletedInstructions; @@ -872,7 +872,7 @@ class SILInstruction : public llvm::ilist_node { bool isTriviallyDuplicatable() const; /// Returns true if the instruction is only relevant for debug - /// informations and has no other impact on program semantics. + /// information and has no other impact on program semantics. bool isDebugInstruction() const { return getKind() == SILInstructionKind::DebugValueInst; } @@ -5200,7 +5200,7 @@ class AssignOrInitInst VarDecl *Property; /// Marks all of the properties in `initializes(...)` list that - /// have been initialized before this intruction to help Raw SIL + /// have been initialized before this instruction to help Raw SIL /// lowering to emit destroys. llvm::BitVector Assignments; @@ -5740,7 +5740,7 @@ class ExplicitCopyAddrInst /// memory region, before binding it to a contiguous region of type $T. This /// token has no purpose unless it is consumed be a rebind_memory instruction. /// -/// Semantics: changes the type information assocated with a memory region. This +/// Semantics: changes the type information associated with a memory region. This /// affects all memory operations that alias with the given region of memory, /// regardless of their type or address provenance. For optimizations that query /// side effects, this is equivalent to writing and immediately reading an @@ -8007,7 +8007,7 @@ class PackLengthInst final /// All of these instructions produce a Builtin.PackIndex value which /// can only be used in packs with a specific shape class. In /// principle, that shape class could be reflected into the result type, -/// but we actually need more structue than that in order to get the +/// but we actually need more structure than that in order to get the /// type-safety properties we want. It therefore makes more sense to /// enforce structural properties on pack-index derivation than try /// to go all-in on dependent types. @@ -9851,7 +9851,7 @@ class TermInst : public NonValueInstruction { /// the payload. /// /// Postcondition: if the result is non-null, then each successor has zero or - /// one block arguments which represents the forwaded result. + /// one block arguments which represents the forwarded result. const Operand *forwardedOperand() const; Operand *forwardedOperand() { diff --git a/include/swift/SIL/SILLinkage.h b/include/swift/SIL/SILLinkage.h index ee238d86f8fe4..851db17c15cfd 100644 --- a/include/swift/SIL/SILLinkage.h +++ b/include/swift/SIL/SILLinkage.h @@ -171,7 +171,7 @@ enum SerializedKind_t : uint8_t { /// It's also used to determine during SIL deserialization whether loadable /// types in a serialized function can be allowed in the client module that /// imports the module built with Package CMO. If the client contains a [serialized] - /// function due to `@inlinable`, funtions with [serialized_for_package] from + /// function due to `@inlinable`, functions with [serialized_for_package] from /// the imported module are not allowed being inlined into the client function, /// which is the correct behavior. IsSerializedForPackage @@ -306,7 +306,7 @@ inline bool hasPublicVisibility(SILLinkage linkage) { /// Opt in package linkage for visibility in case Package CMO is enabled. /// Used in SIL verification and other checks that determine inlinability to -/// accomodate for the optimization. +/// accommodate for the optimization. inline bool hasPublicOrPackageVisibility(SILLinkage linkage, bool includePackage) { switch (linkage) { case SILLinkage::Public: diff --git a/include/swift/SIL/SILNodes.def b/include/swift/SIL/SILNodes.def index 44dd495b2bf28..3ce754d1c99c2 100644 --- a/include/swift/SIL/SILNodes.def +++ b/include/swift/SIL/SILNodes.def @@ -13,7 +13,7 @@ /// \file /// /// This file defines macros used for macro-metaprogramming with SIL nodes. It -/// supports changing how macros expand by #defining an auxillary variable +/// supports changing how macros expand by #defining an auxiliary variable /// before including SILNodes.def as summarized in the chart below: /// /// | #define | Operation | diff --git a/include/swift/SIL/SILValue.h b/include/swift/SIL/SILValue.h index 9e5d40ac2af1d..97f7fcb1eadc3 100644 --- a/include/swift/SIL/SILValue.h +++ b/include/swift/SIL/SILValue.h @@ -331,7 +331,7 @@ struct ValueOwnershipKind { /// Returns true if \p Other can be merged successfully with this, implying /// that the two ownership kinds are "compatible". /// - /// The reason why we do not compare directy is to allow for + /// The reason why we do not compare directly is to allow for /// OwnershipKind::None to merge into other forms of ValueOwnershipKind. bool isCompatibleWith(ValueOwnershipKind other) const { return bool(merge(other)); diff --git a/include/swift/SIL/ScopedAddressUtils.h b/include/swift/SIL/ScopedAddressUtils.h index 1935fc68c1258..489601b20e78f 100644 --- a/include/swift/SIL/ScopedAddressUtils.h +++ b/include/swift/SIL/ScopedAddressUtils.h @@ -87,7 +87,7 @@ struct ScopedAddressValue { SWIFT_DEBUG_DUMP { print(llvm::dbgs()); } // Helpers to allow a ScopedAddressValue to easily be used as a SILValue - // programatically. + // programmatically. SILValue operator->() { return value; } SILValue operator->() const { return value; } SILValue operator*() { return value; } diff --git a/include/swift/SIL/Test.h b/include/swift/SIL/Test.h index 7acac7d5f862e..53de16ec6d5c3 100644 --- a/include/swift/SIL/Test.h +++ b/include/swift/SIL/Test.h @@ -254,7 +254,7 @@ class FunctionTest final { private: /// Functions for getting tools that are visible in the SIL library. /// - /// The implementation is provided in the SILOptimizer libary where analyses + /// The implementation is provided in the SILOptimizer library where analyses /// are visible: TestRunner::FunctionTestDependenciesImpl. struct Dependencies { virtual DominanceInfo *getDominanceInfo() = 0; diff --git a/include/swift/SILOptimizer/Analysis/Reachability.h b/include/swift/SILOptimizer/Analysis/Reachability.h index 89432bf195383..47ab797d5c8f6 100644 --- a/include/swift/SILOptimizer/Analysis/Reachability.h +++ b/include/swift/SILOptimizer/Analysis/Reachability.h @@ -339,7 +339,7 @@ class IterativeBackwardReachability final { /// Step 4 (Optional): Visit each barrier instruction, phi, and block. /// - /// Effects are requeried. + /// Effects are required. /// /// A barrier block here means the target block of a barrier edge. /// diff --git a/include/swift/SILOptimizer/Analysis/RegionAnalysis.h b/include/swift/SILOptimizer/Analysis/RegionAnalysis.h index ce34620c38766..972b83537a913 100644 --- a/include/swift/SILOptimizer/Analysis/RegionAnalysis.h +++ b/include/swift/SILOptimizer/Analysis/RegionAnalysis.h @@ -102,7 +102,7 @@ class BlockPartitionState { /// whether this changed the exit partition. /// /// NOTE: This method ignored errors that arise. We process separately later - /// to discover if an error occured. + /// to discover if an error occurred. bool recomputeExitFromEntry(PartitionOpTranslator &translator); }; @@ -302,7 +302,7 @@ class RegionAnalysisValueMap { public: RegionAnalysisValueMap(SILFunction *fn) : fn(fn) { } - /// Returns the value for this instruction if it isn't a fake "represenative + /// Returns the value for this instruction if it isn't a fake "representative /// value" to inject actor isolatedness. Asserts in such a case. SILValue getRepresentative(Element trackableValueID) const; diff --git a/include/swift/SILOptimizer/OptimizerBridging.h b/include/swift/SILOptimizer/OptimizerBridging.h index 95c1a3d0b430c..a94d7cd683251 100644 --- a/include/swift/SILOptimizer/OptimizerBridging.h +++ b/include/swift/SILOptimizer/OptimizerBridging.h @@ -112,11 +112,11 @@ struct BridgedCalleeAnalysis { SWIFT_IMPORT_UNSAFE CalleeList getDestructors(BridgedType type, bool isExactType) const; typedef bool (* _Nonnull IsDeinitBarrierFn)(BridgedInstruction, BridgedCalleeAnalysis bca); - typedef BridgedMemoryBehavior (* _Nonnull GetMemBehvaiorFn)( + typedef BridgedMemoryBehavior (* _Nonnull GetMemBehaviorFn)( BridgedInstruction apply, bool observeRetains, BridgedCalleeAnalysis bca); static void registerAnalysis(IsDeinitBarrierFn isDeinitBarrierFn, - GetMemBehvaiorFn getEffectsFn); + GetMemBehaviorFn getEffectsFn); }; struct BridgedDeadEndBlocksAnalysis { @@ -421,7 +421,7 @@ void SILCombine_registerInstructionPass(BridgedStringRef instClassName, BridgedInstructionPassRunFn runFn); #ifndef PURE_BRIDGING_MODE -// In _not_ PURE_BRIDGING_MODE, briding functions are inlined and therefore inluded in the header file. +// In _not_ PURE_BRIDGING_MODE, briding functions are inlined and therefore included in the header file. #include "OptimizerBridgingImpl.h" #else // For fflush and stdout diff --git a/include/swift/SILOptimizer/Utils/InstructionDeleter.h b/include/swift/SILOptimizer/Utils/InstructionDeleter.h index d758c01274179..225b18aba8f16 100644 --- a/include/swift/SILOptimizer/Utils/InstructionDeleter.h +++ b/include/swift/SILOptimizer/Utils/InstructionDeleter.h @@ -87,7 +87,7 @@ /// Note that the forceDelete* APIs only invoke notifyWillBeDeletedFunc() when /// an operand's definition will become dead after force-deleting the specified /// instruction. Some clients force-delete related instructions one at a -/// time. It is the client's responsiblity to invoke notifyWillBeDeletedFunc() +/// time. It is the client's responsibility to invoke notifyWillBeDeletedFunc() /// on those explicitly deleted instructions if needed. /// //===----------------------------------------------------------------------===// diff --git a/include/swift/SILOptimizer/Utils/PartitionUtils.h b/include/swift/SILOptimizer/Utils/PartitionUtils.h index 04d173c366bf1..0a91b8a705fc1 100644 --- a/include/swift/SILOptimizer/Utils/PartitionUtils.h +++ b/include/swift/SILOptimizer/Utils/PartitionUtils.h @@ -414,7 +414,7 @@ struct TransferringOperandState { /// The dynamic isolation history at this point. IsolationHistory isolationHistory; - /// Set to true if the element associated with the operand's vlaue is closure + /// Set to true if the element associated with the operand's value is closure /// captured by the user. In such a case, if our element is a sendable var of /// a non-Sendable type, we cannot access it since we could race against an /// assignment to the var in a closure. @@ -763,7 +763,7 @@ class Partition { /// for. /// /// NOTE: This can only be used if one has cleared transfer state using - /// Partition::clearTransferState or constructed a new Partiton using + /// Partition::clearTransferState or constructed a new Partition using /// Partition::withoutTransferState(). This is because history rewinding /// doesn't use transfer information so just to be careful around potential /// invariants being broken, we just require the elimination of the transfer @@ -806,7 +806,7 @@ class Partition { /// Return a vector of the transferred values in this partition. std::vector getTransferredVals() const { - // For effeciency, this could return an iterator not a vector. + // For efficiency, this could return an iterator not a vector. std::vector transferredVals; for (auto [i, _] : elementToRegionMap) if (isTransferred(i)) @@ -817,7 +817,7 @@ class Partition { /// Return a vector of the non-transferred regions in this partition, each /// represented as a vector of values. std::vector> getNonTransferredRegions() const { - // For effeciency, this could return an iterator not a vector. + // For efficiency, this could return an iterator not a vector. std::map> buckets; for (auto [i, label] : elementToRegionMap) @@ -908,7 +908,7 @@ class Partition { /// Pop one history node. Multiple history nodes can make up one PartitionOp /// worth of history, so this is called by popHistory. /// - /// Returns true if we succesfully popped a single history node. + /// Returns true if we successfully popped a single history node. bool popHistoryOnce(SmallVectorImpl &foundJoinHistoryNodes); /// A canonical region is defined to have its region number as equal to the @@ -1252,7 +1252,7 @@ struct PartitionOpEvaluator { // Next see if we are disconnected and have the same isolation. In such a // case, we do not transfer since the disconnected value is allowed to be - // resued after we return. + // reused after we return. if (transferredRegionIsolation.isDisconnected() && calleeIsolationInfo && transferredRegionIsolation.hasSameIsolation(calleeIsolationInfo)) return; @@ -1544,7 +1544,7 @@ struct PartitionOpEvaluatorBaseImpl : PartitionOpEvaluator { SILFunctionArgument *destValue, Element srcElement, SILValue srcValue, SILDynamicMergedIsolationInfo srcIsolationRegionInfo) const {} - /// Used to signify an "unknown code pattern" has occured while performing + /// Used to signify an "unknown code pattern" has occurred while performing /// dataflow. /// /// DISCUSSION: Our dataflow cannot emit errors itself so this is a callback diff --git a/include/swift/Sema/ConstraintLocator.h b/include/swift/Sema/ConstraintLocator.h index 631e84cdcc24d..c77c1f012eb42 100644 --- a/include/swift/Sema/ConstraintLocator.h +++ b/include/swift/Sema/ConstraintLocator.h @@ -80,7 +80,7 @@ enum ContextualTypePurpose : uint8_t { ///< is expected to conform to 'Sequence' protocol. CTP_ForEachSequence, ///< Sequence expression associated with `for-in` loop, /// this element acts slightly differently compared to - /// \c CTP_ForEachStmt in a sence that it would + /// \c CTP_ForEachStmt in a sense that it would /// produce conformance constraints. CTP_WrappedProperty, ///< Property type expected to match 'wrappedValue' type CTP_ComposedPropertyWrapper, ///< Composed wrapper type expected to match diff --git a/include/swift/Sema/ConstraintSystem.h b/include/swift/Sema/ConstraintSystem.h index 2bb21e86d0677..cc9486ff27a8b 100644 --- a/include/swift/Sema/ConstraintSystem.h +++ b/include/swift/Sema/ConstraintSystem.h @@ -5105,7 +5105,7 @@ class ConstraintSystem { /// Solving this constraint is delayed until the element type is fully /// resolved with no type variables. The element type is then mapped out /// of the opened element context and into the context of the surrounding - /// function, effecively substituting opened element archetypes with their + /// function, effectively substituting opened element archetypes with their /// corresponding pack archetypes, and bound to the second type. SolutionKind simplifyPackElementOfConstraint(Type first, Type second, diff --git a/include/swift/Sema/IDETypeChecking.h b/include/swift/Sema/IDETypeChecking.h index 97464ca523722..7542afef6a1ad 100644 --- a/include/swift/Sema/IDETypeChecking.h +++ b/include/swift/Sema/IDETypeChecking.h @@ -136,7 +136,7 @@ namespace swift { ASTContext &Ctx, DeclContext *DC, CompletionTypeCheckKind kind, Expr *&parsedExpr, ConcreteDeclRef &referencedDecl); - /// Type check a function body element which is at \p TagetLoc. + /// Type check a function body element which is at \p TargetLoc. bool typeCheckASTNodeAtLoc(TypeCheckASTNodeAtLocContext TypeCheckCtx, SourceLoc TargetLoc); diff --git a/include/swift/Serialization/ScanningLoaders.h b/include/swift/Serialization/ScanningLoaders.h index d3419e1269233..b46644be20d8a 100644 --- a/include/swift/Serialization/ScanningLoaders.h +++ b/include/swift/Serialization/ScanningLoaders.h @@ -39,7 +39,7 @@ class SwiftModuleScanner : public SerializedModuleLoaderBase { InterfaceSubContextDelegate &astDelegate; - /// Location where pre-built moduels are to be built into. + /// Location where pre-built modules are to be built into. std::string moduleOutputPath; public: diff --git a/include/swift/Subsystems.h b/include/swift/Subsystems.h index d9264c9c414bd..de6c065412a73 100644 --- a/include/swift/Subsystems.h +++ b/include/swift/Subsystems.h @@ -412,7 +412,7 @@ namespace swift { /// after forming the ASTContext. void registerClangImporterRequestFunctions(Evaluator &evaluator); - /// Register constant value extraction request functons with the evaluator. + /// Register constant value extraction request functions with the evaluator. void registerConstExtractRequestFunctions(Evaluator &evaluator); /// Register SILOptimizer passes necessary for IRGen. diff --git a/include/swift/Threading/Impl/chrono_utils.h b/include/swift/Threading/Impl/chrono_utils.h index d2e7d7093960c..a0674f6943475 100644 --- a/include/swift/Threading/Impl/chrono_utils.h +++ b/include/swift/Threading/Impl/chrono_utils.h @@ -12,7 +12,7 @@ // // Specifically, we want ceil() for these types, but that's only available in // C++17, and we need to build with C++14, so... include a version of the -// necesary code here. +// necessary code here. // //===----------------------------------------------------------------------===// diff --git a/lib/AST/ASTBridging.cpp b/lib/AST/ASTBridging.cpp index d8fee0be9ac68..b60cd8333f267 100644 --- a/lib/AST/ASTBridging.cpp +++ b/lib/AST/ASTBridging.cpp @@ -32,7 +32,7 @@ #ifdef PURE_BRIDGING_MODE // In PURE_BRIDGING_MODE, bridging functions are not inlined and therefore -// inluded in the cpp file. +// included in the cpp file. #include "swift/AST/ASTBridgingImpl.h" #endif diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index c091fbea9b606..88ab44c9346df 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -742,7 +742,7 @@ ASTContext *ASTContext::get( symbolgraphgen::SymbolGraphOptions &SymbolGraphOpts, CASOptions &casOpts, SourceManager &SourceMgr, DiagnosticEngine &Diags, llvm::IntrusiveRefCntPtr OutputBackend) { - // If more than two data structures are concatentated, then the aggregate + // If more than two data structures are concatenated, then the aggregate // size math needs to become more complicated due to per-struct alignment // constraints. auto align = std::max(alignof(ASTContext), alignof(Implementation)); @@ -4224,7 +4224,7 @@ ExistentialMetatypeType * ExistentialMetatypeType::get(Type T, std::optional repr, const ASTContext &ctx) { // If we're creating an existential metatype from an - // existential type, wrap the constraint type direcly. + // existential type, wrap the constraint type directly. if (auto existential = T->getAs()) T = existential->getConstraintType(); diff --git a/lib/AST/ASTPrinter.cpp b/lib/AST/ASTPrinter.cpp index 4c3387262e03f..9940e80919441 100644 --- a/lib/AST/ASTPrinter.cpp +++ b/lib/AST/ASTPrinter.cpp @@ -3432,7 +3432,7 @@ void PrintAST::visitAssociatedTypeDecl(AssociatedTypeDecl *decl) { void PrintAST::visitEnumDecl(EnumDecl *decl) { if (const auto *namespaceDecl = dyn_cast_or_null(decl->getClangDecl())) { - // Enum that correponds to the C++ namespace should only be printed once. + // Enum that corresponds to the C++ namespace should only be printed once. if (!Printer.shouldPrintRedeclaredClangDecl( namespaceDecl->getOriginalNamespace())) return; @@ -6894,7 +6894,7 @@ class TypePrinter : public TypeVisitor { // FIXME: The desugared type is used here only to support // existential types with protocol typealiases in Swift // interfaces. Verifying that the underlying type of a - // protocol typealias is a constriant type is fundamentally + // protocol typealias is a constraint type is fundamentally // circular, so the desugared type should be written in source. if (Options.DesugarExistentialConstraint && !T->isAnyObject()) { visit(T->getConstraintType()->getDesugaredType()); diff --git a/lib/AST/ASTWalker.cpp b/lib/AST/ASTWalker.cpp index c87d63bbe3750..9c51aab4b8586 100644 --- a/lib/AST/ASTWalker.cpp +++ b/lib/AST/ASTWalker.cpp @@ -1736,7 +1736,7 @@ class Traversal : public ASTVisitor(p: P) where P.Failure == Never diff --git a/lib/AST/NameLookup.cpp b/lib/AST/NameLookup.cpp index e1e51ad6256d9..5ed71b106e18b 100644 --- a/lib/AST/NameLookup.cpp +++ b/lib/AST/NameLookup.cpp @@ -3616,7 +3616,7 @@ createOpaqueParameterGenericParams(GenericContext *genericContext, GenericParamL if (!typeRepr) continue; - // Plain protocols should imply 'some' with experimetal feature + // Plain protocols should imply 'some' with experimental feature CollectedOpaqueReprs typeReprs; typeReprs = collectOpaqueTypeReprs(typeRepr, ctx, dc); diff --git a/lib/AST/RequirementMachine/HomotopyReduction.cpp b/lib/AST/RequirementMachine/HomotopyReduction.cpp index 4670672a46756..9db5a88347e9f 100644 --- a/lib/AST/RequirementMachine/HomotopyReduction.cpp +++ b/lib/AST/RequirementMachine/HomotopyReduction.cpp @@ -91,7 +91,7 @@ using namespace rewriting; /// /// [P:X].[P2:Y].[Q] => [P:X].[P2:Y] /// -/// Furthermore, if [P:X].[P2:Y] simplies to some other term, such as [P:Z], +/// Furthermore, if [P:X].[P2:Y] simplifies to some other term, such as [P:Z], /// there will be yet another rule added by completion: /// /// [P:Z].[Q] => [P:Z] diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 4da2d40182aeb..fa3628133b534 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -3657,9 +3657,9 @@ UUID ElementArchetypeType::getOpenedElementID() const { CanExistentialType CanExistentialType::get(CanType constraint) { assert(!(constraint->isAny() || constraint->isAnyObject()) && - "Any(Object) may not apppear as canonical constraint type"); + "Any(Object) may not appear as canonical constraint type"); assert(!constraint->is() && - "Existential metatype may not apppear as canonical constraint type"); + "Existential metatype may not appear as canonical constraint type"); return CanExistentialType( ExistentialType::get(constraint)->castTo()); } diff --git a/lib/ASTGen/Package.swift b/lib/ASTGen/Package.swift index 96ccb3e21d62e..55268dd505853 100644 --- a/lib/ASTGen/Package.swift +++ b/lib/ASTGen/Package.swift @@ -25,7 +25,7 @@ let swiftSourceDirectory = #filePath .dropLast(3) // Remove 'lib', 'ASTGen', 'Package.swift' .joined(separator: "/") -let swiftSetttings: [SwiftSetting] = [ +let swiftSettings: [SwiftSetting] = [ .interoperabilityMode(.Cxx), .unsafeFlags([ "-Xcc", "-DCOMPILED_WITH_SWIFT", @@ -69,7 +69,7 @@ let package = Package( "_CompilerRegexParser", ], path: "Sources/ASTGen", - swiftSettings: swiftSetttings + swiftSettings: swiftSettings ), .target( name: "swiftIDEUtilsBridging", @@ -79,13 +79,13 @@ let package = Package( .product(name: "SwiftSyntax", package: "swift-syntax"), ], path: "Sources/SwiftIDEUtilsBridging", - swiftSettings: swiftSetttings + swiftSettings: swiftSettings ), .target( name: "_CompilerRegexParser", dependencies: [], path: "_RegexParser_Sources", - swiftSettings: swiftSetttings + swiftSettings: swiftSettings ), ], cxxLanguageStandard: .cxx17 diff --git a/lib/ASTGen/Sources/ASTGen/DeclAttrs.swift b/lib/ASTGen/Sources/ASTGen/DeclAttrs.swift index eeab952eba627..3b7c40a9f2064 100644 --- a/lib/ASTGen/Sources/ASTGen/DeclAttrs.swift +++ b/lib/ASTGen/Sources/ASTGen/DeclAttrs.swift @@ -262,7 +262,7 @@ extension ASTGenVisitor { return self.generateSimpleDeclAttr(attribute: node, kind: attrKind) - // Modifers. + // Modifiers. case .accessControl: // TODO: Diagnose and generateAccessControl(). fatalError("unimplemented") diff --git a/lib/ASTGen/Sources/ASTGen/DiagnosticsBridge.swift b/lib/ASTGen/Sources/ASTGen/DiagnosticsBridge.swift index ad87a70d610c8..c9e689c5664f5 100644 --- a/lib/ASTGen/Sources/ASTGen/DiagnosticsBridge.swift +++ b/lib/ASTGen/Sources/ASTGen/DiagnosticsBridge.swift @@ -352,7 +352,7 @@ extension BridgedDiagnosticSeverity { } } -/// Register a source file wih the queued diagnostics. +/// Register a source file with the queued diagnostics. @_cdecl("swift_ASTGen_addQueuedSourceFile") public func addQueuedSourceFile( queuedDiagnosticsPtr: UnsafeMutableRawPointer, diff --git a/lib/ASTGen/Sources/ASTGen/Macros.swift b/lib/ASTGen/Sources/ASTGen/Macros.swift index 5831b23dd89ac..cb6e8427c2d0a 100644 --- a/lib/ASTGen/Sources/ASTGen/Macros.swift +++ b/lib/ASTGen/Sources/ASTGen/Macros.swift @@ -530,7 +530,7 @@ func expandFreestandingMacroImpl( expandedSource = _expandedSource diagnostics = _diagnostics default: - throw PluginError.invalidReponseKind + throw PluginError.invalidResponseKind } // Process the result. @@ -825,7 +825,7 @@ func expandAttachedMacroImpl( diagnostics = _diagnostics break default: - throw PluginError.invalidReponseKind + throw PluginError.invalidResponseKind } // Process the result. diff --git a/lib/ASTGen/Sources/ASTGen/PluginHost.swift b/lib/ASTGen/Sources/ASTGen/PluginHost.swift index 3771e4de452f0..b3c4d80eef140 100644 --- a/lib/ASTGen/Sources/ASTGen/PluginHost.swift +++ b/lib/ASTGen/Sources/ASTGen/PluginHost.swift @@ -19,7 +19,7 @@ enum PluginError: String, Error, CustomStringConvertible { case stalePlugin = "plugin is stale" case failedToSendMessage = "failed to send request to plugin" case failedToReceiveMessage = "failed to receive result from plugin" - case invalidReponseKind = "plugin returned invalid result" + case invalidResponseKind = "plugin returned invalid result" var description: String { rawValue } } @@ -73,7 +73,7 @@ func swift_ASTGen_pluginServerLoadLibraryPlugin( .loadPluginLibrary(libraryPath: libraryPath, moduleName: moduleName) ) guard case .loadPluginLibraryResult(let loaded, let diagnostics) = result else { - throw PluginError.invalidReponseKind + throw PluginError.invalidResponseKind } if loaded { assert(diagnostics.isEmpty) @@ -160,7 +160,7 @@ struct CompilerPlugin { let request = HostToPluginMessage.getCapability(capability: hostCapability) let response = try self.sendMessageAndWaitWithoutLock(request) guard case .getCapabilityResult(let capability) = response else { - throw PluginError.invalidReponseKind + throw PluginError.invalidResponseKind } deinitializePluginCapabilityIfExist() diff --git a/lib/ASTGen/Sources/ASTGen/Regex.swift b/lib/ASTGen/Sources/ASTGen/Regex.swift index 1a31848766ae4..b4df441b581e5 100644 --- a/lib/ASTGen/Sources/ASTGen/Regex.swift +++ b/lib/ASTGen/Sources/ASTGen/Regex.swift @@ -29,7 +29,7 @@ import BasicBridging /// lexed past. /// - mustBeRegex: A bool value whether an error during lexing should be /// considered a regex literal, or some thing else. If true -/// advace the curPtrPtr and emit the diagnostic. If false, +/// advance the curPtrPtr and emit the diagnostic. If false, /// curPtrPtr won't be modified. /// - bridgedDiagnosticEngine: Diagnostic engine to emit diagnostics. /// diff --git a/lib/Basic/BasicBridging.cpp b/lib/Basic/BasicBridging.cpp index 976f04564501f..e0b511cf4f712 100644 --- a/lib/Basic/BasicBridging.cpp +++ b/lib/Basic/BasicBridging.cpp @@ -18,7 +18,7 @@ #ifdef PURE_BRIDGING_MODE // In PURE_BRIDGING_MODE, bridging functions are not inlined and therefore -// inluded in the cpp file. +// included in the cpp file. #include "swift/Basic/BasicBridgingImpl.h" #endif diff --git a/lib/Basic/Program.cpp b/lib/Basic/Program.cpp index 1d53cdef6b300..36a106440825d 100644 --- a/lib/Basic/Program.cpp +++ b/lib/Basic/Program.cpp @@ -86,7 +86,7 @@ struct Pipe { Pipe() { int fds[2]; if (pipe(fds) == -1) { - read = write = -1; // '-1' to inidicate the failure. + read = write = -1; // '-1' to indicate the failure. } read = fds[0]; write = fds[1]; diff --git a/lib/ClangImporter/ClangAdapter.h b/lib/ClangImporter/ClangAdapter.h index 9110a2e80adb7..0c676f91becb8 100644 --- a/lib/ClangImporter/ClangAdapter.h +++ b/lib/ClangImporter/ClangAdapter.h @@ -129,7 +129,7 @@ clang::TypedefNameDecl *findSwiftNewtype(const clang::NamedDecl *decl, bool isNSString(const clang::Type *); bool isNSString(clang::QualType); -/// Wehther the passed type is `NSNotificationName` typealias +/// Whether the passed type is `NSNotificationName` typealias bool isNSNotificationName(clang::QualType); /// Whether the given declaration was exported from Swift. diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index a51205a216873..e22c090d4213c 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -1024,7 +1024,7 @@ void ClangImporter::addClangInvovcationDependencies( addFiles(invocation.getHeaderSearchOpts().VFSOverlayFiles); // FIXME: Should not depend on working directory. Build system/swift driver // should not pass working directory here but if that option is passed, - // repect that and add that into CASFS. + // respect that and add that into CASFS. auto CWD = invocation.getFileSystemOpts().WorkingDir; if (!CWD.empty()) files.push_back(CWD); @@ -7694,7 +7694,7 @@ bool IsSafeUseOfCxxDecl::evaluate(Evaluator &evaluator, if (isForeignReferenceType(method->getReturnType())) return true; - // begin and end methods likely return an interator, so they're unsafe. This + // begin and end methods likely return an iterator, so they're unsafe. This // is required so that automatic the conformance to RAC works properly. if (method->getNameAsString() == "begin" || method->getNameAsString() == "end") @@ -7737,7 +7737,7 @@ bool IsSafeUseOfCxxDecl::evaluate(Evaluator &evaluator, } // A projection of a view type (such as a string_view) from a self - // contained parent is a proejction (unsafe). + // contained parent is a projection (unsafe). if (!anySubobjectsSelfContained(cxxRecordReturnType) && isViewType(cxxRecordReturnType)) { return !parentIsSelfContained; diff --git a/lib/ClangImporter/ImportType.cpp b/lib/ClangImporter/ImportType.cpp index b1fd26459fde0..f6b557a5205ae 100644 --- a/lib/ClangImporter/ImportType.cpp +++ b/lib/ClangImporter/ImportType.cpp @@ -2228,7 +2228,7 @@ ImportedType ClangImporter::Implementation::importFunctionReturnType( // any nullability specifiers from their return type, and preserves it on the // declared return type. Thus, in C mode the imported return type of such // functions is always optional. However, in C++ interop mode, the return type - // of builtin functions can preseve the nullability specifiers on their return + // of builtin functions can preserve the nullability specifiers on their return // type, and thus the imported return type of such functions can be // non-optional, if the type is annotated with // `_Nonnull`. The difference between these two modes can break cross-module diff --git a/lib/ClangImporter/ImporterImpl.h b/lib/ClangImporter/ImporterImpl.h index 5ff37189b875c..f39c13087c025 100644 --- a/lib/ClangImporter/ImporterImpl.h +++ b/lib/ClangImporter/ImporterImpl.h @@ -1456,7 +1456,7 @@ class LLVM_LIBRARY_VISIBILITY ClangImporter::Implementation /// Import a parameter type /// - /// \param param The underlaying parameter declaraction. + /// \param param The underlying parameter declaraction. /// \param optionalityOfParam The kind of optionality for the parameter /// being imported. /// \param allowNSUIntegerAsInt If true, NSUInteger will be import as Int diff --git a/lib/DependencyScan/ModuleDependencyScanner.cpp b/lib/DependencyScan/ModuleDependencyScanner.cpp index 67044e291f006..2f07d56d23b52 100644 --- a/lib/DependencyScan/ModuleDependencyScanner.cpp +++ b/lib/DependencyScan/ModuleDependencyScanner.cpp @@ -109,7 +109,7 @@ diagnoseScannerFailure(const ScannerImportStatementInfo &moduleImport, if (dependencyOf.has_value()) { auto path = findPathToDependency(dependencyOf.value(), cache); // We may fail to construct a path in some cases, such as a Swift overlay of - // a Clang module dependnecy. + // a Clang module dependency. if (path.empty()) path = {dependencyOf.value()}; @@ -629,7 +629,7 @@ void ModuleDependencyScanner::resolveImportDependencies( }; // ACTDOO: Import refactor - // Enque asynchronous lookup tasks + // Enqueue asynchronous lookup tasks for (const auto &dependsOn : moduleDependencyInfo->getModuleImports()) { bool underlyingClangModuleLookup = moduleID.ModuleName == dependsOn.importIdentifier; bool isTestable = moduleDependencyInfo->isTestableImport(dependsOn.importIdentifier); @@ -701,7 +701,7 @@ void ModuleDependencyScanner::resolveImportDependencies( // `/Foo.framework/Modules/module.modulemap`. // Which means that lookup of `Bar` alone from Swift will not be able to // locate the module in it. However, the lookup of Foo will itself bring in - // the auxiliary module becuase the Clang scanner instance scanning for clang + // the auxiliary module because the Clang scanner instance scanning for clang // module Foo will be able to find it in the corresponding framework module's // modulemap and register it as a dependency which means it will be registered // with the scanner's cache in the step above. To handle such cases, we @@ -792,7 +792,7 @@ void ModuleDependencyScanner::resolveSwiftOverlayDependencies( swiftOverlayLookupResult.insert_or_assign(moduleName, moduleDependencies); }; - // Enque asynchronous lookup tasks + // Enqueue asynchronous lookup tasks for (const auto &clangDep : clangDependencies) ScanningThreadPool.async(scanForSwiftDependency, getModuleImportIdentifier(clangDep)); ScanningThreadPool.wait(); diff --git a/lib/Frontend/CASOutputBackends.cpp b/lib/Frontend/CASOutputBackends.cpp index 713a9e06253f7..0c8b9b79efaf3 100644 --- a/lib/Frontend/CASOutputBackends.cpp +++ b/lib/Frontend/CASOutputBackends.cpp @@ -231,7 +231,7 @@ Error SwiftCASOutputBackend::Implementation::finalizeCacheKeysFor( [](auto &LHS, auto &RHS) { return LHS.first < RHS.first; }); std::optional Result; - // Use a clang compatible result CAS object schema when emiting PCM. + // Use a clang compatible result CAS object schema when emitting PCM. if (Action == FrontendOptions::ActionType::EmitPCM) { clang::cas::CompileJobCacheResult::Builder Builder; diff --git a/lib/Frontend/CachingUtils.cpp b/lib/Frontend/CachingUtils.cpp index 28167be9a4896..5624571812d57 100644 --- a/lib/Frontend/CachingUtils.cpp +++ b/lib/Frontend/CachingUtils.cpp @@ -194,7 +194,7 @@ bool replayCachedCompilerOutputs( ObjFile = OutputPath->second; if (Kind == file_types::ID::TY_CachedDiagnostics) { - assert(!DiagnosticsOutput && "more than 1 diagnotics found"); + assert(!DiagnosticsOutput && "more than 1 diagnostics found"); DiagnosticsOutput = OutputEntry{OutputPath->second, OutID, *Proxy}; } else OutputProxies.emplace_back( diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index a7bb0d1f6be86..891c0329022f8 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -2049,14 +2049,14 @@ static void ParseSymbolGraphArgs(symbolgraphgen::SymbolGraphOptions &Opts, static bool validateSwiftModuleFileArgumentAndAdd(const std::string &swiftModuleArgument, DiagnosticEngine &Diags, std::vector> &ExplicitSwiftModuleInputs) { - std::size_t foundDelimeterPos = swiftModuleArgument.find_first_of("="); - if (foundDelimeterPos == std::string::npos) { + std::size_t foundDelimiterPos = swiftModuleArgument.find_first_of("="); + if (foundDelimiterPos == std::string::npos) { Diags.diagnose(SourceLoc(), diag::error_swift_module_file_requires_delimeter, swiftModuleArgument); return true; } - std::string moduleName = swiftModuleArgument.substr(0, foundDelimeterPos), - modulePath = swiftModuleArgument.substr(foundDelimeterPos+1); + std::string moduleName = swiftModuleArgument.substr(0, foundDelimiterPos), + modulePath = swiftModuleArgument.substr(foundDelimiterPos+1); if (!Lexer::isIdentifier(moduleName)) { Diags.diagnose(SourceLoc(), diag::error_bad_module_name, moduleName, false); return true; diff --git a/lib/Frontend/DiagnosticHelper.cpp b/lib/Frontend/DiagnosticHelper.cpp index dc1ede3a49153..439a6d50af43c 100644 --- a/lib/Frontend/DiagnosticHelper.cpp +++ b/lib/Frontend/DiagnosticHelper.cpp @@ -328,7 +328,7 @@ static swift::file_types::ID computeFileTypeForPath(const StringRef Path) { if (FileType == swift::file_types::ID::TY_INVALID) { auto PathStem = llvm::sys::path::stem(Path); // If this path has a multiple '.' extension (e.g. .abi.json), - // then iterate over all preceeding possible extension variants. + // then iterate over all preceding possible extension variants. while (llvm::sys::path::has_extension(PathStem)) { auto NextExtension = llvm::sys::path::extension(PathStem); PathStem = llvm::sys::path::stem(PathStem); diff --git a/lib/Frontend/ModuleInterfaceLoader.cpp b/lib/Frontend/ModuleInterfaceLoader.cpp index 6002546fd8a57..521ee416a02b4 100644 --- a/lib/Frontend/ModuleInterfaceLoader.cpp +++ b/lib/Frontend/ModuleInterfaceLoader.cpp @@ -1942,7 +1942,7 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl( // explicit Swift module build tasks will not rely on them and they may be // source-target-context-specific and hinder module sharing across // compilation source targets. - // Clang module dependecies of this Swift dependency will be distinguished + // Clang module dependencies of this Swift dependency will be distinguished // by their context hash for different variants, so would still cause a // difference in the Swift compile commands, when different. inheritedParentContextClangArgs = diff --git a/lib/Frontend/ModuleInterfaceSupport.cpp b/lib/Frontend/ModuleInterfaceSupport.cpp index 10985b12c8230..817795322171d 100644 --- a/lib/Frontend/ModuleInterfaceSupport.cpp +++ b/lib/Frontend/ModuleInterfaceSupport.cpp @@ -325,7 +325,7 @@ static void printImports(raw_ostream &out, M->getImportedModules(publicImports, allImportFilter); publicImportSet.insert(publicImports.begin(), publicImports.end()); - // Used to determine whether `package import` should be overriden below. + // Used to determine whether `package import` should be overridden below. llvm::SmallSet packageOnlyImportSet; if (Opts.printPackageInterface()) { SmallVector packageOnlyImports; diff --git a/lib/FrontendTool/FrontendTool.cpp b/lib/FrontendTool/FrontendTool.cpp index d23a6c0afcc2e..ba81856067de5 100644 --- a/lib/FrontendTool/FrontendTool.cpp +++ b/lib/FrontendTool/FrontendTool.cpp @@ -366,7 +366,7 @@ static bool buildModuleFromInterface(CompilerInstance &Instance) { // If an explicit interface build was requested, bypass the creation of a new // sub-instance from the interface which will build it in a separate thread, - // and isntead directly use the current \c Instance for compilation. + // and instead directly use the current \c Instance for compilation. // // FIXME: -typecheck-module-from-interface is the exception here because // currently we need to ensure it still reads the flags written out @@ -2055,7 +2055,7 @@ int swift::performFrontend(ArrayRef Args, CompilerInstance::HashingBackendPtrTy HashBackend = nullptr; if (Invocation.getFrontendOptions().DeterministicCheck) { - // Setup a verfication instance to run. + // Setup a verification instance to run. std::unique_ptr VerifyInstance = std::make_unique(); std::string InstanceSetupError; diff --git a/lib/IDE/CodeCompletion.cpp b/lib/IDE/CodeCompletion.cpp index 95640f4a47d39..015cd2973dc0b 100644 --- a/lib/IDE/CodeCompletion.cpp +++ b/lib/IDE/CodeCompletion.cpp @@ -1330,21 +1330,21 @@ void swift::ide::collectCompletionResults( llvm::SmallPtrSet seenModuleNames; std::vector RequestedModules; - SmallPtrSet explictlyImportedModules; + SmallPtrSet explicitlyImportedModules; { // Collect modules directly imported in this SourceFile. SmallVector directImport; SF.getImportedModules(directImport, ModuleDecl::getImportFilterLocal()); for (auto import : directImport) - explictlyImportedModules.insert(import.importedModule); + explicitlyImportedModules.insert(import.importedModule); // Exclude modules implicitly imported in the current module. auto implicitImports = SF.getParentModule()->getImplicitImports(); for (auto import : implicitImports.imports) - explictlyImportedModules.erase(import.module.importedModule); + explicitlyImportedModules.erase(import.module.importedModule); // Consider the current module "explicit". - explictlyImportedModules.insert(SF.getParentModule()); + explicitlyImportedModules.insert(SF.getParentModule()); } for (auto &Request: Lookup.RequestedCachedResults) { @@ -1407,7 +1407,7 @@ void swift::ide::collectCompletionResults( auto TheModuleName = TheModule->getName(); if (Request.Filter.contains(CodeCompletionFilterFlag::Module) && (!Lookup.isHiddenModuleName(TheModuleName) || - explictlyImportedModules.contains(TheModule)) && + explicitlyImportedModules.contains(TheModule)) && seenModuleNames.insert(TheModuleName).second) Lookup.addModuleName(TheModule); } diff --git a/lib/IDE/CodeCompletionCache.cpp b/lib/IDE/CodeCompletionCache.cpp index 1b659bb2499f2..35e7aedae5704 100644 --- a/lib/IDE/CodeCompletionCache.cpp +++ b/lib/IDE/CodeCompletionCache.cpp @@ -369,15 +369,15 @@ static void writeCachedModule(llvm::raw_ostream &out, if (found != knownTypes.end()) { return found->second; } - std::vector supertypeIndicies; - // IMPORTANT: To compute the supertype indicies, we might need to add + std::vector supertypeIndices; + // IMPORTANT: To compute the supertype indices, we might need to add // entries to the type table by calling addType recursively. Thus, we must // perform this calculation before writing any bytes of this type to the // types table. auto supertypes = type->getSupertypes(); - supertypeIndicies.reserve(supertypes.size()); + supertypeIndices.reserve(supertypes.size()); for (auto supertype : supertypes) { - supertypeIndicies.push_back(addType(supertype)); + supertypeIndices.push_back(addType(supertype)); } auto size = types.tell(); @@ -385,8 +385,8 @@ static void writeCachedModule(llvm::raw_ostream &out, StringRef USR = type->getUSR(); LE.write(static_cast(USR.size())); types << USR; - LE.write(static_cast(supertypeIndicies.size())); - for (auto supertypeIndex : supertypeIndicies) { + LE.write(static_cast(supertypeIndices.size())); + for (auto supertypeIndex : supertypeIndices) { LE.write(static_cast(supertypeIndex)); } OptionSet customAttributeKinds = diff --git a/lib/IDE/CodeCompletionContext.cpp b/lib/IDE/CodeCompletionContext.cpp index 78320962ed98d..d40c92b7a308f 100644 --- a/lib/IDE/CodeCompletionContext.cpp +++ b/lib/IDE/CodeCompletionContext.cpp @@ -153,7 +153,7 @@ void CodeCompletionContext::addResultsFromModules( CachedResults.reserve(Sink.Results.size()); // Instead of copying the context free results out of the sink's allocator // retain the sink's entire allocator (which also includes the contextual - // properities) and simply store pointers to the context free results that + // properties) and simply store pointers to the context free results that // back the contextual results. for (auto Result : Sink.Results) { assert( diff --git a/lib/IDE/CodeCompletionDiagnostics.cpp b/lib/IDE/CodeCompletionDiagnostics.cpp index b9187c8aebb01..04dd793206d73 100644 --- a/lib/IDE/CodeCompletionDiagnostics.cpp +++ b/lib/IDE/CodeCompletionDiagnostics.cpp @@ -121,8 +121,8 @@ bool CodeCompletionDiagnostics::getDiagnosticForDeprecated( // '100000' is used as a version number in API that will be deprecated in an // upcoming release. This number is to match the 'API_TO_BE_DEPRECATED' // macro defined in Darwin platforms. - static llvm::VersionTuple DISTANT_FUTURE_VESION(100000); - bool isDistantFuture = DeprecatedVersion >= DISTANT_FUTURE_VESION; + static llvm::VersionTuple DISTANT_FUTURE_VERSION(100000); + bool isDistantFuture = DeprecatedVersion >= DISTANT_FUTURE_VERSION; if (Attr->Message.empty() && Attr->Rename.empty()) { getDiagnostics(severity, Out, diag::ide_availability_softdeprecated, diff --git a/lib/IDE/CodeCompletionDiagnostics.h b/lib/IDE/CodeCompletionDiagnostics.h index a07c0462560dd..6a5cf21fb0b54 100644 --- a/lib/IDE/CodeCompletionDiagnostics.h +++ b/lib/IDE/CodeCompletionDiagnostics.h @@ -22,7 +22,7 @@ class ValueDecl; namespace ide { /// Populate \p severity and \p Out with the context-free diagnostics for \p D. -/// See \c NotRecommendedReason for an explaination of context-free vs. +/// See \c NotRecommendedReason for an explanation of context-free vs. /// contextual diagnostics. /// Returns \c true if it fails to generate the diagnostics. bool getContextFreeCompletionDiagnostics( @@ -33,7 +33,7 @@ bool getContextFreeCompletionDiagnostics( /// \p NameForDiagnostic is the name of the decl that produced this diagnostic. /// \p Ctx is a context that's purely used to have a reference to a diagnostic /// engine. -/// See \c NotRecommendedReason for an explaination of context-free vs. +/// See \c NotRecommendedReason for an explanation of context-free vs. /// contextual diagnostics. /// Returns \c true if it fails to generate the diagnostics. bool getContextualCompletionDiagnostics( diff --git a/lib/IDE/CodeCompletionResultPrinter.cpp b/lib/IDE/CodeCompletionResultPrinter.cpp index b47ad66b3abea..f2cb0a14210f5 100644 --- a/lib/IDE/CodeCompletionResultPrinter.cpp +++ b/lib/IDE/CodeCompletionResultPrinter.cpp @@ -107,7 +107,7 @@ class AnnotatingResultPrinter { /// Print \p content enclosing with \p tag. void printWithTag(StringRef tag, StringRef content) { - // Trim whitepsaces around the non-whitespace characters. + // Trim whitespaces around the non-whitespace characters. // (i.e. " something " -> " something ". auto ltrimIdx = content.find_first_not_of(' '); auto rtrimIdx = content.find_last_not_of(' ') + 1; diff --git a/lib/IDE/CompletionLookup.cpp b/lib/IDE/CompletionLookup.cpp index 4ec2915f18810..5bf73cd627c48 100644 --- a/lib/IDE/CompletionLookup.cpp +++ b/lib/IDE/CompletionLookup.cpp @@ -1169,7 +1169,7 @@ void CompletionLookup::addPoundKeyPath(bool needPound) { SemanticContextKind CompletionLookup::getSemanticContextKind(const ValueDecl *VD) { - // FIXME: to get the corect semantic context we need to know how lookup + // FIXME: to get the correct semantic context we need to know how lookup // would have found the VD. For now, just infer a reasonable semantics. if (!VD) @@ -1383,8 +1383,8 @@ void CompletionLookup::addMethodCall(const FuncDecl *FD, trivialTrailingClosure = hasTrivialTrailingClosure(FD, AFT); std::optional NotRecommended; - bool implictlyAsync = false; - analyzeActorIsolation(FD, AFT, implictlyAsync, NotRecommended); + bool implicitlyAsync = false; + analyzeActorIsolation(FD, AFT, implicitlyAsync, NotRecommended); // Add the method, possibly including any default arguments. auto addMethodImpl = [&](bool includeDefaultArgs = true, @@ -1425,14 +1425,14 @@ void CompletionLookup::addMethodCall(const FuncDecl *FD, Builder.addRightParen(); } else if (trivialTrailingClosure) { Builder.addBraceStmtWithCursor(" { code }"); - addEffectsSpecifiers(Builder, AFT, FD, implictlyAsync); + addEffectsSpecifiers(Builder, AFT, FD, implicitlyAsync); } else { Builder.addLeftParen(); addCallArgumentPatterns(Builder, AFT, FD->getParameters(), FD->getGenericSignatureOfContext(), includeDefaultArgs); Builder.addRightParen(); - addEffectsSpecifiers(Builder, AFT, FD, implictlyAsync); + addEffectsSpecifiers(Builder, AFT, FD, implicitlyAsync); } // Build type annotation. @@ -1644,8 +1644,8 @@ void CompletionLookup::addSubscriptCall(const SubscriptDecl *SD, return; std::optional NotRecommended; - bool implictlyAsync = false; - analyzeActorIsolation(SD, subscriptType, implictlyAsync, NotRecommended); + bool implicitlyAsync = false; + analyzeActorIsolation(SD, subscriptType, implicitlyAsync, NotRecommended); CodeCompletionResultBuilder Builder = makeResultBuilder(CodeCompletionResultKind::Declaration, @@ -1678,7 +1678,7 @@ void CompletionLookup::addSubscriptCall(const SubscriptDecl *SD, resultTy = OptionalType::get(resultTy); } - if (implictlyAsync) + if (implicitlyAsync) Builder.addAnnotatedAsync(); addTypeAnnotation(Builder, resultTy, SD->getGenericSignatureOfContext()); @@ -3355,13 +3355,13 @@ void CompletionLookup::getToplevelCompletions(CodeCompletionFilter Filter) { NeedLeadingDot = false; // If we have 'addinitstotoplevel' enabled, calling `foundDecl` on `this` - // can cause macros to get expanded, which can then cause new members ot get + // can cause macros to get expanded, which can then cause new members to get // added to 'TopLevelValues', invalidating iterator over `TopLevelDecls` in // `SourceLookupCache::lookupVisibleDecls`. // // Technically `foundDecl` should not expand macros or discover new top level // members in any way because those newly discovered decls will not be added - // to the code completion results. However, it's preferrable to miss results + // to the code completion results. However, it's preferable to miss results // than to silently invalidate a collection, resulting in hard-to-diagnose // crashes. // Thus, store all the decls found by `CurrModule->lookupVisibleDecls` in a diff --git a/lib/IDE/CompletionOverrideLookup.cpp b/lib/IDE/CompletionOverrideLookup.cpp index 09778c67cc63e..59e91aa4aabe2 100644 --- a/lib/IDE/CompletionOverrideLookup.cpp +++ b/lib/IDE/CompletionOverrideLookup.cpp @@ -84,7 +84,7 @@ Type CompletionOverrideLookup::getOpaqueResultType( auto genericSig = VD->getDeclContext()->getGenericSignatureOfContext(); if (genericSig->isConcreteType(ResultT)) - // If it has same type requrement, we will emit the concrete type. + // If it has same type requirement, we will emit the concrete type. return nullptr; auto upperBound = genericSig->getUpperBound( diff --git a/lib/IDE/CursorInfo.cpp b/lib/IDE/CursorInfo.cpp index 48dc8d3662172..04bf02621ab51 100644 --- a/lib/IDE/CursorInfo.cpp +++ b/lib/IDE/CursorInfo.cpp @@ -405,7 +405,7 @@ class CursorInfoDoneParsingCallback : public DoneParsingCallback { std::vector getResult(ASTNode Node, DeclContext *DC, SourceFile *SrcFile, NodeFinder &Finder) const { - // Type check the statemnt containing E and listen for solutions. + // Type check the statement containing E and listen for solutions. CursorInfoTypeCheckSolutionCallback Callback(*DC, RequestedLoc); { llvm::SaveAndRestore CompletionCollector( diff --git a/lib/IDE/ExprContextAnalysis.cpp b/lib/IDE/ExprContextAnalysis.cpp index 458ff11db8891..1dc89a69fb935 100644 --- a/lib/IDE/ExprContextAnalysis.cpp +++ b/lib/IDE/ExprContextAnalysis.cpp @@ -1,4 +1,4 @@ -//===--- ExprContextAnalysis.cpp - Expession context analysis -------------===// +//===--- ExprContextAnalysis.cpp - Expression context analysis ------------===// // // This source file is part of the Swift.org open source project // @@ -89,7 +89,7 @@ class ExprFinder : public ASTWalker { SourceRange TargetRange; Expr *FoundExpr = nullptr; - template bool isInterstingRange(NodeType *Node) { + template bool isInterestingRange(NodeType *Node) { return SM.rangeContains(Node->getSourceRange(), TargetRange); } @@ -130,15 +130,15 @@ class ExprFinder : public ASTWalker { FoundExpr = E; return Action::Stop(); } - return Action::VisitNodeIf(isInterstingRange(E), E); + return Action::VisitNodeIf(isInterestingRange(E), E); } PreWalkResult walkToPatternPre(Pattern *P) override { - return Action::VisitNodeIf(isInterstingRange(P), P); + return Action::VisitNodeIf(isInterestingRange(P), P); } PreWalkResult walkToStmtPre(Stmt *S) override { - return Action::VisitNodeIf(isInterstingRange(S), S); + return Action::VisitNodeIf(isInterestingRange(S), S); } PreWalkAction walkToTypeReprPre(TypeRepr *T) override { diff --git a/lib/IDE/ExprContextAnalysis.h b/lib/IDE/ExprContextAnalysis.h index 17f31412b6999..e2f80f884d66c 100644 --- a/lib/IDE/ExprContextAnalysis.h +++ b/lib/IDE/ExprContextAnalysis.h @@ -1,4 +1,4 @@ -//===--- ExprContextAnalysis.h - Expession context analysis ---------------===// +//===--- ExprContextAnalysis.h - Expression context analysis --------------===// // // This source file is part of the Swift.org open source project // diff --git a/lib/IDE/Formatting.cpp b/lib/IDE/Formatting.cpp index 482719401fd8b..251e4909e7a8c 100644 --- a/lib/IDE/Formatting.cpp +++ b/lib/IDE/Formatting.cpp @@ -168,7 +168,7 @@ struct IndentContext { /// The location to indent relative to. SourceLoc ContextLoc; - /// Indicates whether to indent relative to the extact column of ContextLoc + /// Indicates whether to indent relative to the exact column of ContextLoc /// (Exact) or to the start of the content of the line it appears on (LineStart). ContextKind Kind; @@ -1482,7 +1482,7 @@ class FormatWalker : public ASTWalker { ISL->forEachSegment(SF.getASTContext(), [&](bool IsInterpolation, CallExpr *CE) { if (IsInterpolation) { - // Handle the preceeding string segment. + // Handle the preceding string segment. CharSourceRange StringRange(SM, PrevStringStart, CE->getStartLoc()); if (StringRange.contains(TargetLocation)) { StringLiteralRange = diff --git a/lib/IDE/IDETypeChecking.cpp b/lib/IDE/IDETypeChecking.cpp index 1b4c5bb4aab31..bf0e51a9bac1a 100644 --- a/lib/IDE/IDETypeChecking.cpp +++ b/lib/IDE/IDETypeChecking.cpp @@ -688,7 +688,7 @@ class ExpressionTypeCollector: public SourceEntityWalker { } // If we have already reported types for this source range, we shouldn't - // report again. This makes sure we always report the outtermost type of + // report again. This makes sure we always report the outermost type of // several overlapping expressions. auto &Bucket = AllPrintedTypes[Offset]; if (Bucket.find(Length) != Bucket.end()) diff --git a/lib/IDE/ModuleInterfacePrinting.cpp b/lib/IDE/ModuleInterfacePrinting.cpp index f5120af1e865c..8397469e49c8d 100644 --- a/lib/IDE/ModuleInterfacePrinting.cpp +++ b/lib/IDE/ModuleInterfacePrinting.cpp @@ -578,7 +578,7 @@ void swift::ide::printModuleInterface( for (auto redecl : namespaceDecl->redecls()) { if (redecl->decls_empty()) continue; - // Namespace redecls may exist across mutliple modules. We want to + // Namespace redecls may exist across multiple modules. We want to // add the decl "D" to every module that has a redecl. But we only // want to add "D" once to prevent duplicate printing. clang::SourceLocation loc = redecl->getLocation(); diff --git a/lib/IDE/PostfixCompletion.cpp b/lib/IDE/PostfixCompletion.cpp index 1202429ec91d9..e60b53722deb5 100644 --- a/lib/IDE/PostfixCompletion.cpp +++ b/lib/IDE/PostfixCompletion.cpp @@ -92,7 +92,7 @@ void PostfixCompletionCallback::fallbackTypeCheck(DeclContext *DC) { SyntacticElementTarget completionTarget(fallbackExpr, fallbackDC, CTP_Unused, Type(), - /*isDiscared=*/true); + /*isDiscarded=*/true); typeCheckForCodeCompletion(completionTarget, /*needsPrecheck*/ true, [&](const Solution &S) { sawSolution(S); }); @@ -268,7 +268,7 @@ struct OperatorResultTypes { } }; -/// Builds a constriant system that tries applying the operator \p op on a LHS +/// Builds a constraint system that tries applying the operator \p op on a LHS /// of type \p LHSType. If that succeeds, returns the result type of the /// operator call and (in case of binary operators) the expected type for the /// RHS. diff --git a/lib/IDE/SyntaxModel.cpp b/lib/IDE/SyntaxModel.cpp index 12e2c9d4c8ff9..b2eedfd731305 100644 --- a/lib/IDE/SyntaxModel.cpp +++ b/lib/IDE/SyntaxModel.cpp @@ -1207,7 +1207,7 @@ bool ModelASTWalker::handleSpecialDeclAttribute(const DeclAttribute *D, if (!passNode({SyntaxNodeKind::AttributeBuiltin, Next.Range})) return false; } else { - // Only mispelled attributes, corrected in the AST but not + // Only misspelled attributes, corrected in the AST but not // recognised or present in TokenNodes should get us here. // E.g. @availability(...) comes through as if @available(...) was // specified, but there's no TokenNode because we don't highlight them diff --git a/lib/IDE/TypeCheckCompletionCallback.cpp b/lib/IDE/TypeCheckCompletionCallback.cpp index 5e2f9201e7298..59c326ddc1419 100644 --- a/lib/IDE/TypeCheckCompletionCallback.cpp +++ b/lib/IDE/TypeCheckCompletionCallback.cpp @@ -39,7 +39,7 @@ void TypeCheckCompletionCallback::fallbackTypeCheck(DeclContext *DC) { SyntacticElementTarget completionTarget(fallback->E, fallback->DC, CTP_Unused, Type(), - /*isDiscared=*/true); + /*isDiscarded=*/true); typeCheckForCodeCompletion(completionTarget, /*needsPrecheck=*/true, [&](const Solution &S) { sawSolution(S); }); } @@ -168,7 +168,7 @@ bool swift::ide::isContextAsync(const constraints::Solution &S, return true; } - // - the decl context is sync but it's used in a context that expectes an + // - the decl context is sync but it's used in a context that expects an // async function. This happens if the code completion token is in a // closure that doesn't contain any async calles. Thus the closure is // type-checked as non-async, but it might get converted to an async diff --git a/lib/IDE/TypeContextInfo.cpp b/lib/IDE/TypeContextInfo.cpp index bd587f2005c20..41774d4ba3276 100644 --- a/lib/IDE/TypeContextInfo.cpp +++ b/lib/IDE/TypeContextInfo.cpp @@ -161,7 +161,7 @@ void ContextInfoCallbacks::getImplicitMembers( Type T; SmallVectorImpl &Result; - bool canBeImplictMember(ValueDecl *VD) { + bool canBeImplicitMember(ValueDecl *VD) { if (VD->isOperator()) return false; @@ -189,7 +189,7 @@ void ContextInfoCallbacks::getImplicitMembers( void foundDecl(ValueDecl *VD, DeclVisibilityKind Reason, DynamicLookupInfo) override { - if (canBeImplictMember(VD) && !VD->shouldHideFromEditor()) + if (canBeImplicitMember(VD) && !VD->shouldHideFromEditor()) Result.push_back(VD); } diff --git a/lib/IDE/Utils.cpp b/lib/IDE/Utils.cpp index a053c41f6ab4f..26e8384fac541 100644 --- a/lib/IDE/Utils.cpp +++ b/lib/IDE/Utils.cpp @@ -1013,7 +1013,7 @@ bool swift::ide::isDeclOverridable(ValueDecl *D) { if (!NTD) return false; - // Only classes and protocols support overridding by subtypes. + // Only classes and protocols support overriding by subtypes. if (!(isa(NTD) || isa(NTD))) return false; diff --git a/lib/IDETool/CompileInstance.cpp b/lib/IDETool/CompileInstance.cpp index 3230cbf8fbb3d..3835bb27b4d3a 100644 --- a/lib/IDETool/CompileInstance.cpp +++ b/lib/IDETool/CompileInstance.cpp @@ -55,14 +55,14 @@ struct ModInfo { static bool collectModifiedFunctions(ArrayRef r1, ArrayRef r2, llvm::SmallVectorImpl &result) { assert(r1.size() == r2.size() && - "interface fingerprint matches but diffrent number of children"); + "interface fingerprint matches but different number of children"); for (auto i1 = r1.begin(), i2 = r2.begin(), e1 = r1.end(), e2 = r2.end(); i1 != e1 && i2 != e2; ++i1, ++i2) { auto &d1 = *i1, &d2 = *i2; assert(d1->getKind() == d2->getKind() && - "interface fingerprint matches but diffrent structure"); + "interface fingerprint matches but different structure"); /// FIXME: Nested types. /// func foo() { @@ -233,10 +233,10 @@ bool CompileInstance::performCachedSemaIfPossible(DiagnosticConsumer *DiagC) { // Collect modified function body. SmallVector modifiedFuncDecls; - bool isNotResuable = CI->forEachFileToTypeCheck([&](SourceFile &oldSF) { + bool isNotReusable = CI->forEachFileToTypeCheck([&](SourceFile &oldSF) { return getModifiedFunctionDeclList(oldSF, tmpSM, modifiedFuncDecls); }); - if (isNotResuable) + if (isNotReusable) return true; // OK, we can reuse the AST. diff --git a/lib/IDETool/DependencyChecking.cpp b/lib/IDETool/DependencyChecking.cpp index e3af609adce64..e495217ea3cf6 100644 --- a/lib/IDETool/DependencyChecking.cpp +++ b/lib/IDETool/DependencyChecking.cpp @@ -48,7 +48,7 @@ forEachDependencyUntilTrue(CompilerInstance &CI, } } - // Check other non-system depenencies (e.g. modules, headers). + // Check other non-system dependencies (e.g. modules, headers). for (auto &dep : CI.getDependencyTracker()->getDependencies()) { if (callback(dep)) return true; @@ -78,7 +78,7 @@ static void cacheDependencyHashIfNeeded(CompilerInstance &CI, if (!stat) return false; - // We will check the hash only if the modification time of the dependecy + // We will check the hash only if the modification time of the dependency // is zero. See 'areAnyDependentFilesInvalidated() below'. if (stat->getLastModificationTime() != llvm::sys::TimePoint<>()) return false; diff --git a/lib/IDETool/IDEInspectionInstance.cpp b/lib/IDETool/IDEInspectionInstance.cpp index 7a8835190ef0e..148d55f145aa3 100644 --- a/lib/IDETool/IDEInspectionInstance.cpp +++ b/lib/IDETool/IDEInspectionInstance.cpp @@ -272,7 +272,7 @@ bool IDEInspectionInstance::performCachedOperationIfPossible( switch (newInfo.Kind) { case IDEInspectionDelayedDeclKind::FunctionBody: { // If the interface has changed, AST must be refreshed. - // See if the inteface of the function and types visible from a function + // See if the interface of the function and types visible from a function // body has changed since the last completion. If they haven't changed, // completion can reuse the existing AST of the source file. // \c getInterfaceHash() is not enough because it doesn't take the interface @@ -300,7 +300,7 @@ bool IDEInspectionInstance::performCachedOperationIfPossible( if (!DC || !isa(DC)) return false; - // OK, we can perform fast completion for this. Update the orignal delayed + // OK, we can perform fast completion for this. Update the original delayed // decl state. // Fast completion keeps the buffer in memory for multiple completions. diff --git a/lib/IRGen/BitPatternBuilder.h b/lib/IRGen/BitPatternBuilder.h index f9b2651f551fa..d50dc5b4978b8 100644 --- a/lib/IRGen/BitPatternBuilder.h +++ b/lib/IRGen/BitPatternBuilder.h @@ -64,7 +64,7 @@ class BitPatternBuilder { // Little-endian byte order implies that elements should be // appended to the most significant bit. If this flag is false - // then elements should be appended to the least signficant + // then elements should be appended to the least significant // bit (big-endian byte order). bool LittleEndian; diff --git a/lib/IRGen/ClassLayout.cpp b/lib/IRGen/ClassLayout.cpp index 2f65d04590b23..6306b8c356368 100644 --- a/lib/IRGen/ClassLayout.cpp +++ b/lib/IRGen/ClassLayout.cpp @@ -65,7 +65,7 @@ Size ClassLayout::getInstanceStart() const { // of the constant ivar offset for the empty field from 0 to 16. However // the field offset for empty fields is assume to be zero and the runtime // does not compute a different value for the empty field and so the field - // offset for the empty field stays 0. The runtime then trys to reconcile + // offset for the empty field stays 0. The runtime then tries to reconcile // the field offset and the ivar offset trying to write to the ivar // offset. However, the ivar offset is marked as constant and so we // crashed. diff --git a/lib/IRGen/Field.h b/lib/IRGen/Field.h index 0b6eba19a2a53..fcb763f31330a 100644 --- a/lib/IRGen/Field.h +++ b/lib/IRGen/Field.h @@ -89,7 +89,7 @@ struct Field { /// Return the interface type of this concrete field. Type getInterfaceType(IRGenModule &IGM) const; - /// Return the nam eof this concrete field. + /// Return the name eof this concrete field. llvm::StringRef getName() const; bool operator==(Field other) const { return declOrKind == other.declOrKind; } diff --git a/lib/IRGen/GenCall.cpp b/lib/IRGen/GenCall.cpp index fc053208df9d3..90567ecdb5ccf 100644 --- a/lib/IRGen/GenCall.cpp +++ b/lib/IRGen/GenCall.cpp @@ -757,7 +757,7 @@ void SignatureExpansion::expandCoroutineResult(bool forContinuation) { case SILCoroutineKind::None: llvm_unreachable("should have been filtered out before here"); - // Yield-once coroutines may optionaly return a value from the continuation. + // Yield-once coroutines may optionally return a value from the continuation. case SILCoroutineKind::YieldOnce: { // Ensure that no parameters were added before to correctly record their ABI // details. @@ -4424,7 +4424,7 @@ void CallEmission::externalizeArguments(IRGenFunction &IGF, const Callee &callee Address forwardFromAddr = getForwardableAlloca(ti, isForwardableArgument, in); // Try to forward the address from a `load` instruction "immediately" - // preceeding the apply. + // preceding the apply. if (isForwardableArgument && forwardFromAddr.isValid()) { ti.initializeWithTake(IGF, addr, forwardFromAddr, paramType.getAddressType(), isOutlined, diff --git a/lib/IRGen/GenConstant.cpp b/lib/IRGen/GenConstant.cpp index 84eb7553e6650..7c39c40421597 100644 --- a/lib/IRGen/GenConstant.cpp +++ b/lib/IRGen/GenConstant.cpp @@ -236,7 +236,7 @@ static bool isPowerOfTwo(unsigned x) { } /// Replace i24, i40, i48 and i56 constants in `e` with the corresponding byte values. -/// Such unaligned integer constants are not correctly layed out in the data section. +/// Such unaligned integer constants are not correctly laid out in the data section. static Explosion replaceUnalignedIntegerValues(IRGenModule &IGM, Explosion e) { Explosion out; while (!e.empty()) { diff --git a/lib/IRGen/GenCoverage.cpp b/lib/IRGen/GenCoverage.cpp index b028db3987008..875c0046fbd0b 100644 --- a/lib/IRGen/GenCoverage.cpp +++ b/lib/IRGen/GenCoverage.cpp @@ -229,7 +229,7 @@ void IRGenerator::emitCoverageMapping() { // parallel IRGen, where N is the number of output object files. // // Note we don't just dump all the coverage maps into the primary IGM as - // that would require creating unecessary name data entries, since the name + // that would require creating unnecessary name data entries, since the name // data is likely to already be present in the IGM that contains the entity // being profiled (unless it has been optimized out). Matching the coverage // map to its originating SourceFile also matches the behavior of a debug diff --git a/lib/IRGen/GenDecl.cpp b/lib/IRGen/GenDecl.cpp index d7b65ebbbf4a4..037b97cf03c07 100644 --- a/lib/IRGen/GenDecl.cpp +++ b/lib/IRGen/GenDecl.cpp @@ -547,7 +547,7 @@ emitGlobalList(IRGenModule &IGM, ArrayRef handles, if (IGM.IRGen.Opts.ConditionalRuntimeRecords) { // Allow dead-stripping `var` (the runtime record from the global list) - // when `handle` / `elt` (the underlaying entity) is not referenced. + // when `handle` / `elt` (the underlying entity) is not referenced. IGM.appendLLVMUsedConditionalEntry(var, elt->stripPointerCasts()); } } @@ -3673,7 +3673,7 @@ static llvm::GlobalVariable *createGOTEquivalent(IRGenModule &IGM, global, llvm::Twine("got.") + globalName); - // rdar://problem/53836960: i386 ld64 also mis-links relative references + // rdar://problem/53836960: i386 ld64 also mislinks relative references // to GOT entries. // rdar://problem/59782487: issue with on-device JITd expressions. // The JIT gets confused by private vars accessed across object files. diff --git a/lib/IRGen/GenMeta.cpp b/lib/IRGen/GenMeta.cpp index 3fa5b0a3040fc..179f54672a42b 100644 --- a/lib/IRGen/GenMeta.cpp +++ b/lib/IRGen/GenMeta.cpp @@ -1335,7 +1335,7 @@ namespace { B.addInt(IGM.Int16Ty, protocols.rawBits()); // Create placeholders for the counts of the conditional requirements - // for each conditional conformance to a supressible protocol. + // for each conditional conformance to a suppressible protocol. unsigned numProtocols = countBitsUsed(protocols.rawBits()); using PlaceholderPosition = ConstantAggregateBuilderBase::PlaceholderPosition; @@ -6554,7 +6554,7 @@ namespace { // // As of Swift 5.1, the runtime will fill in a default VWT during // allocation of foreign class metadata. We rely on this for correctness - // on COFF, where we can't necessarily reference the stanard VWT from the + // on COFF, where we can't necessarily reference the standard VWT from the // metadata candidate, but it is a good optimization everywhere. // // The default VWT uses ObjC-compatible reference counting if ObjC interop diff --git a/lib/IRGen/GenObjC.cpp b/lib/IRGen/GenObjC.cpp index 58b9ad03f3135..6f238d87829b8 100644 --- a/lib/IRGen/GenObjC.cpp +++ b/lib/IRGen/GenObjC.cpp @@ -539,7 +539,7 @@ static void updateProtocolRefs(IRGenModule &IGM, static_cast(astContext.getClangModuleLoader()); assert(clangImporter && "Must have a clang importer"); - // Get the array containining the protocol refs. + // Get the array containing the protocol refs. unsigned protocolRefsSize = getProtocolRefsList(protocol).first; unsigned currentIdx = 0; auto inheritedObjCProtocols = getRuntimeProtocolList(objcProtocol->protocols()); diff --git a/lib/IRGen/GenPack.cpp b/lib/IRGen/GenPack.cpp index d8ea0a6461863..e4ebd47174f9f 100644 --- a/lib/IRGen/GenPack.cpp +++ b/lib/IRGen/GenPack.cpp @@ -841,7 +841,7 @@ llvm::Value *irgen::emitTypeMetadataPackElementRef( // ----%inner---> ^^^ // // In fact, we won't ever materialize %outer into any register. Instead, we - // can just brach to materializing the metadata (and witness tables) once + // can just branch to materializing the metadata (and witness tables) once // we've determined which outer element's range contains %index. // // As for %inner, it will only be materialized in those blocks corresponding @@ -910,7 +910,7 @@ llvm::Value *irgen::emitTypeMetadataPackElementRef( } IGF.Builder.SetInsertPoint(current); - // The previous checkBounds' block's comparision of %index. Use it to emit a + // The previous checkBounds' block's comparison of %index. Use it to emit a // branch to the current block or the previous block's metadata/wtable // emission block. llvm::Value *previousCondition = nullptr; @@ -1311,7 +1311,7 @@ irgen::emitDynamicTupleTypeLabels(IRGenFunction &IGF, CanTupleType type, // The number of bytes to copy; add one for the space at the end. length = elt.getName().getLength() + 1; - // Desposit the label for this element in the dynamic label string. + // Deposit the label for this element in the dynamic label string. IGF.Builder.CreateMemCpy(eltAddr, srcAddr, Size(length)); sawLabel = true; diff --git a/lib/IRGen/GenProto.cpp b/lib/IRGen/GenProto.cpp index d94dd60af60ca..4867dfdc99c92 100644 --- a/lib/IRGen/GenProto.cpp +++ b/lib/IRGen/GenProto.cpp @@ -1703,7 +1703,7 @@ class AccessorConformanceInfo : public ConformanceInfo { /// A resilient witness table consists of a list of descriptor/witness pairs, /// and a runtime function builds the actual witness table in memory, placing - /// entries in the correct oder and filling in default implementations as + /// entries in the correct order and filling in default implementations as /// needed. class ResilientWitnessTableBuilder : public WitnessTableBuilderBase { public: @@ -2590,7 +2590,7 @@ void IRGenModule::emitSILWitnessTable(SILWitnessTable *wt) { #ifndef NDEBUG wt->dump(); #endif - llvm::report_fatal_error("use of relative protcol witness tables not supported"); + llvm::report_fatal_error("use of relative protocol witness tables not supported"); }}); } if (!isResilient) { diff --git a/lib/IRGen/IRABIDetailsProvider.cpp b/lib/IRGen/IRABIDetailsProvider.cpp index 07005778e0a32..452195bddc1e8 100644 --- a/lib/IRGen/IRABIDetailsProvider.cpp +++ b/lib/IRGen/IRABIDetailsProvider.cpp @@ -229,8 +229,8 @@ class IRABIDetailsProviderImpl { return MethodDispatchInfo::direct(); // If this is an override of an existing method, then lookup // its base method in its base class. - if (auto *overridenDecl = funcDecl->getOverriddenDecl()) - funcDecl = overridenDecl; + if (auto *overriddenDecl = funcDecl->getOverriddenDecl()) + funcDecl = overriddenDecl; auto *parentClass = dyn_cast(funcDecl->getDeclContext()); if (!parentClass) return MethodDispatchInfo::direct(); diff --git a/lib/IRGen/IRGen.cpp b/lib/IRGen/IRGen.cpp index 9d108690a617a..bacf619ed3559 100644 --- a/lib/IRGen/IRGen.cpp +++ b/lib/IRGen/IRGen.cpp @@ -341,7 +341,7 @@ void swift::performLLVMOptimizations(const IRGenOptions &Opts, if (Opts.shouldOptimize()) { PB.registerPipelineStartEPCallback( [](ModulePassManager &MPM, OptimizationLevel level) { - // Run this before SROA to avoid un-neccessary expansion of dead + // Run this before SROA to avoid un-necessary expansion of dead // loads. MPM.addPass(createModuleToFunctionPassAdaptor(DCEPass())); }); diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index 311df366fb1c9..d7a60c72759c8 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -1127,7 +1127,7 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo { /// Creates debug info for a generic struct or class with archetypes (e.g.: /// Pair<τ_0_0, τ_0_1>). For types with unsubstituted generic type parameters, - /// debug info generation doesn't attempt to emit the size and aligment of + /// debug info generation doesn't attempt to emit the size and alignment of /// the type, as in the general case those are all dependent on substituting /// the type parameters in (some exceptions exist, like generic types that are /// class constrained). It also doesn't attempt to emit the offset of the diff --git a/lib/IRGen/IRGenFunction.h b/lib/IRGen/IRGenFunction.h index 869abd5bd330e..933951329dbaa 100644 --- a/lib/IRGen/IRGenFunction.h +++ b/lib/IRGen/IRGenFunction.h @@ -827,7 +827,7 @@ class IRGenFunction { LocalTypeDataCache const *getLocalTypeData() { return LocalTypeData; } #endif - /// A forwardable argument is a load that is immediately preceeds the apply it + /// A forwardable argument is a load that is immediately precedes the apply it /// is used as argument to. If there is no side-effecting instructions between /// said load and the apply, we can memcpy the loads address to the apply's /// indirect argument alloca. diff --git a/lib/IRGen/IRGenSIL.cpp b/lib/IRGen/IRGenSIL.cpp index 18a8e4606b034..9b7107062724e 100644 --- a/lib/IRGen/IRGenSIL.cpp +++ b/lib/IRGen/IRGenSIL.cpp @@ -4265,7 +4265,7 @@ void IRGenSILFunction::visitUnreachableInst(swift::UnreachableInst *i) { } void IRGenFunction::emitCoroutineOrAsyncExit(bool isUnwind) { - // LLVM's retcon lowering is a bit imcompatible with Swift + // LLVM's retcon lowering is a bit incompatible with Swift // model. Essentially it assumes that unwind destination is kind of terminal - // it cannot return back to caller and must somehow terminate the process / // thread. Therefore we are always use normal LLVM coroutine termination. @@ -5582,7 +5582,7 @@ static Address canForwardIndirectResultAlloca(const TypeInfo &TI, Explosion &argSrc, llvm::Instruction * &insertPt) { // Check that the store stores the result of and apply instruction immediately - // preceeding the store. + // preceding the store. auto *apply = dyn_cast(store->getSrc()); auto *allocStack = dyn_cast(store->getDest()); if (!apply || !allocStack || apply->getParent() != store->getParent() || @@ -6333,7 +6333,7 @@ void IRGenSILFunction::visitAllocRefInst(swift::AllocRefInst *i) { SmallVector, 4> TailArrays; buildTailArrays(*this, TailArrays, i); - llvm::Value *alloced = emitClassAllocation(*this, i->getType(), i->isObjC(), i->isBare(), + llvm::Value *allocated = emitClassAllocation(*this, i->getType(), i->isObjC(), i->isBare(), StackAllocSize, TailArrays); if (StackAllocSize >= 0) { // Remember that this alloc_ref allocates the object on the stack. @@ -6342,7 +6342,7 @@ void IRGenSILFunction::visitAllocRefInst(swift::AllocRefInst *i) { EstimatedStackSize += StackAllocSize; } Explosion e; - e.add(alloced); + e.add(allocated); setLoweredExplosion(i, e); } @@ -6360,7 +6360,7 @@ void IRGenSILFunction::visitAllocRefDynamicInst(swift::AllocRefDynamicInst *i) { Explosion metadata = getLoweredExplosion(i->getMetatypeOperand()); auto metadataValue = metadata.claimNext(); - llvm::Value *alloced = emitClassAllocationDynamic(*this, metadataValue, + llvm::Value *allocated = emitClassAllocationDynamic(*this, metadataValue, i->getType(), i->isObjC(), StackAllocSize, TailArrays); @@ -6372,7 +6372,7 @@ void IRGenSILFunction::visitAllocRefDynamicInst(swift::AllocRefDynamicInst *i) { } Explosion e; - e.add(alloced); + e.add(allocated); setLoweredExplosion(i, e); } diff --git a/lib/IRGen/Linking.cpp b/lib/IRGen/Linking.cpp index 416105ce056f5..eda394796bbb0 100644 --- a/lib/IRGen/Linking.cpp +++ b/lib/IRGen/Linking.cpp @@ -1244,7 +1244,7 @@ bool LinkEntity::isText() const { return false; // The following cases do not currently generate linkable symbols // through TBDGen. The full enumeration is captured to ensure - // that as more LinkEntity kind's are created their segement assignment + // that as more LinkEntity kind's are created their segment assignment // will be known. case Kind::ObjCMetadataUpdateFunction: case Kind::NominalTypeDescriptorRecord: diff --git a/lib/IRGen/LoadableByAddress.cpp b/lib/IRGen/LoadableByAddress.cpp index 5287dcd744ac5..79c97c344af8e 100644 --- a/lib/IRGen/LoadableByAddress.cpp +++ b/lib/IRGen/LoadableByAddress.cpp @@ -2629,7 +2629,7 @@ void LoadableByAddress::recreateSingleApply( // Change the type of the Closure auto partialApplyConvention = castedApply->getCalleeConvention(); auto resultIsolation = castedApply->getResultIsolation(); - // We do need to update the closure's funtion type to match with the other + // We do need to update the closure's function type to match with the other // uses inside of the binary. Pointer auth cares about the SIL function // type. if (callee->getType().castTo()->getExtInfo().getRepresentation() == @@ -4341,7 +4341,7 @@ static void runPeepholesAndReg2Mem(SILPassManager *pm, SILModule *silMod, // Assign addresses to basic block arguments. // Store alloc_stack's we created that need to be initialized after we - // proccess the original instructions in the function. + // process the original instructions in the function. SmallVector, 8> largeArguments; SmallVector, 8> largeTryApplyResults; @@ -4404,7 +4404,7 @@ static void runPeepholesAndReg2Mem(SILPassManager *pm, SILModule *silMod, } } - // Asign addresses to non-address SSA values. + // Assign addresses to non-address SSA values. PostOrderFunctionInfo postorderInfo(&currF); for (auto *BB : postorderInfo.getReversePostOrder()) { SmallVector origInsts; diff --git a/lib/IRGen/TBDGen.cpp b/lib/IRGen/TBDGen.cpp index 4e461cdacbc71..24c52dcd058a4 100644 --- a/lib/IRGen/TBDGen.cpp +++ b/lib/IRGen/TBDGen.cpp @@ -340,10 +340,10 @@ void TBDGenVisitor::addLinkerDirectiveSymbolsLdPrevious( llvm::SmallString<64> Buffer; llvm::raw_svector_ostream OS(Buffer); // Empty compatible version indicates using the current compatible version. - StringRef ComptibleVersion = ""; + StringRef CompatibleVersion = ""; OS << "$ld$previous$"; OS << InstallName << "$"; - OS << ComptibleVersion << "$"; + OS << CompatibleVersion << "$"; OS << std::to_string(static_cast(PlatformNumber)) << "$"; static auto getMinor = [](std::optional Minor) { return Minor.has_value() ? *Minor : 0; @@ -569,8 +569,8 @@ enum DylibVersionKind_t: unsigned { /// └───────────────────┴──────────┴──────────┘ /// /// If an individual component is greater than the highest number that can be -/// represented in its alloted space, it will be truncated to the maximum value -/// that fits in the alloted space, which matches the behavior of the linker. +/// represented in its allotted space, it will be truncated to the maximum value +/// that fits in the allotted space, which matches the behavior of the linker. static std::optional parsePackedVersion(DylibVersionKind_t kind, StringRef versionString, ASTContext &ctx) { diff --git a/lib/IRGen/TypeLayout.cpp b/lib/IRGen/TypeLayout.cpp index 468cf68390b55..b9e572e973a90 100644 --- a/lib/IRGen/TypeLayout.cpp +++ b/lib/IRGen/TypeLayout.cpp @@ -38,7 +38,7 @@ namespace irgen { enum class LayoutStringFlags : uint64_t { Empty = 0, - // TODO: Track other useful information tha can be used to optimize layout + // TODO: Track other useful information that can be used to optimize layout // strings, like different reference kinds contained in the string // number of ref counting operations (maybe up to 4), so we can // use witness functions optimized for these cases. diff --git a/lib/LLVMPasses/LLVMMergeFunctions.cpp b/lib/LLVMPasses/LLVMMergeFunctions.cpp index c28b36157f0bd..11fcb3f39ba55 100644 --- a/lib/LLVMPasses/LLVMMergeFunctions.cpp +++ b/lib/LLVMPasses/LLVMMergeFunctions.cpp @@ -505,7 +505,7 @@ class SwiftMergeFunctions { return ConstantInt::get(Type::getInt32Ty(module->getContext()), ptrAuthKey); } - /// Returns the value of function \p FuncIdx, and signes it if required. + /// Returns the value of function \p FuncIdx, and signs it if required. Constant *getSignedValue(const ParamInfo &PI, unsigned FuncIdx) { Constant *value = PI.Values[FuncIdx]; if (!PI.needsPointerSigning) diff --git a/lib/Localization/LocalizationFormat.cpp b/lib/Localization/LocalizationFormat.cpp index 24402cb723bd0..da983f2ae97a9 100644 --- a/lib/Localization/LocalizationFormat.cpp +++ b/lib/Localization/LocalizationFormat.cpp @@ -270,7 +270,7 @@ void StringsLocalizationProducer::readStringsFile( continue; } - // Leading `"` has been comsumed. + // Leading `"` has been consumed. assert(i > 0); // Let's check whether this `"` is escaped, and if so - continue diff --git a/lib/Macros/Sources/ObservationMacros/Extensions.swift b/lib/Macros/Sources/ObservationMacros/Extensions.swift index 9873ac9e414df..fdf9faf51f2a8 100644 --- a/lib/Macros/Sources/ObservationMacros/Extensions.swift +++ b/lib/Macros/Sources/ObservationMacros/Extensions.swift @@ -211,7 +211,7 @@ extension DeclGroupSyntax { return standins } - func hasMemberFunction(equvalentTo other: FunctionDeclSyntax) -> Bool { + func hasMemberFunction(equivalentTo other: FunctionDeclSyntax) -> Bool { for member in memberBlock.members { if let function = member.decl.as(FunctionDeclSyntax.self) { if function.isEquivalent(to: other) { @@ -245,7 +245,7 @@ extension DeclGroupSyntax { func addIfNeeded(_ decl: DeclSyntax?, to declarations: inout [DeclSyntax]) { guard let decl else { return } if let fn = decl.as(FunctionDeclSyntax.self) { - if !hasMemberFunction(equvalentTo: fn) { + if !hasMemberFunction(equivalentTo: fn) { declarations.append(decl) } } else if let property = decl.as(VariableDeclSyntax.self) { diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index a3f764bccaf8b..36d21fb6e754f 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -2540,7 +2540,7 @@ Parser::parseMacroRoleAttribute( return makeParserError(); } - // Parse the argments. + // Parse the arguments. SourceLoc lParenLoc = consumeAttributeLParen(); SourceLoc rParenLoc; std::optional role; @@ -2572,7 +2572,7 @@ Parser::parseMacroRoleAttribute( } } - // Parse the argment label, if there is one. + // Parse the argument label, if there is one. Identifier fieldName; SourceLoc fieldNameLoc; parseOptionalArgumentLabel(fieldName, fieldNameLoc); @@ -2651,7 +2651,7 @@ Parser::parseMacroRoleAttribute( return status; } - // If the field name is empty and we haved seen "names", or the field + // If the field name is empty and we have seen "names", or the field // name is "names" but we've already seen the argument label, complain. if (fieldName.empty() != sawNames) { diagnose(fieldNameLoc.isValid() ? fieldNameLoc : Tok.getLoc(), diff --git a/lib/Parse/ParsePattern.cpp b/lib/Parse/ParsePattern.cpp index 7cc17513f3e5d..7ea10ab0575c3 100644 --- a/lib/Parse/ParsePattern.cpp +++ b/lib/Parse/ParsePattern.cpp @@ -1185,7 +1185,7 @@ ParserResult Parser::parsePattern() { diagnose(varLoc, diag::let_pattern_in_immutable_context); // In our recursive parse, remember that we're in a let/var/inout - // pattern. We default to var if we don't have an immediate pattern bidning + // pattern. We default to var if we don't have an immediate pattern binding // state. llvm::SaveAndRestore T( InBindingPattern, newBindingState.getPatternBindingStateForIntroducer( diff --git a/lib/PrintAsClang/ClangSyntaxPrinter.h b/lib/PrintAsClang/ClangSyntaxPrinter.h index 38f84f2acc241..157019324a816 100644 --- a/lib/PrintAsClang/ClangSyntaxPrinter.h +++ b/lib/PrintAsClang/ClangSyntaxPrinter.h @@ -51,7 +51,7 @@ class ClangSyntaxPrinter { ClangSyntaxPrinter(raw_ostream &os) : os(os) {} - /// Print a given identifier. If the identifer conflicts with a keyword, add a + /// Print a given identifier. If the identifier conflicts with a keyword, add a /// trailing underscore. void printIdentifier(StringRef name) const; diff --git a/lib/PrintAsClang/ModuleContentsWriter.cpp b/lib/PrintAsClang/ModuleContentsWriter.cpp index 8e9644d05dace..8eefd4f91f6b8 100644 --- a/lib/PrintAsClang/ModuleContentsWriter.cpp +++ b/lib/PrintAsClang/ModuleContentsWriter.cpp @@ -907,7 +907,7 @@ class ModuleWriter { vd->getASTContext().getErrorDecl() == vd); }), removedVDList.end()); - // Sort the unavaiable decls by their name and kind. + // Sort the unavailable decls by their name and kind. llvm::sort(removedVDList, [](const ValueDecl *lhs, const ValueDecl *rhs) { auto getSortKey = [](const ValueDecl *vd) { std::string sortKey; diff --git a/lib/PrintAsClang/PrintClangFunction.cpp b/lib/PrintAsClang/PrintClangFunction.cpp index 24cae35f1d0c9..571a39fa9eb40 100644 --- a/lib/PrintAsClang/PrintClangFunction.cpp +++ b/lib/PrintAsClang/PrintClangFunction.cpp @@ -1397,7 +1397,7 @@ void DeclAndTypeClangFunctionPrinter::printCxxThunkBody( os << ')'; }; - // Values types are returned either direcly in their C representation, or + // Values types are returned either directly in their C representation, or // indirectly by a pointer. if (!isKnownCxxType(resultTy, typeMapping) && !hasKnownOptionalNullableCxxMapping(resultTy)) { diff --git a/lib/PrintAsClang/PrintClangValueType.cpp b/lib/PrintAsClang/PrintClangValueType.cpp index 93c2af4990536..110f69301c385 100644 --- a/lib/PrintAsClang/PrintClangValueType.cpp +++ b/lib/PrintAsClang/PrintClangValueType.cpp @@ -368,7 +368,7 @@ void ClangValueTypePrinter::printValueTypeDecl( } else { os << "() noexcept {}\n"; } - // Print out '_make' function which returns an unitialized instance for + // Print out '_make' function which returns an uninitialized instance for // passing to Swift. os << " static "; printer.printInlineForThunk(); diff --git a/lib/Refactoring/Async/AsyncConverter.cpp b/lib/Refactoring/Async/AsyncConverter.cpp index 50e093c50be8d..2ed4a99ee5261 100644 --- a/lib/Refactoring/Async/AsyncConverter.cpp +++ b/lib/Refactoring/Async/AsyncConverter.cpp @@ -337,12 +337,12 @@ void AsyncConverter::convertPattern(const Pattern *P) { addRange(LastAddedLoc, P->getEndLoc(), /*ToEndOfToken*/ true); } -void AsyncConverter::wrapScopeInContinationIfNecessary(ASTNode Node) { +void AsyncConverter::wrapScopeInContinuationIfNecessary(ASTNode Node) { if (NestedExprCount != 0) { // We can't start a continuation in the middle of an expression return; } - if (Scopes.back().isWrappedInContination()) { + if (Scopes.back().isWrappedInContinuation()) { // We are already in a continuation. No need to add another one. return; } @@ -393,7 +393,7 @@ bool AsyncConverter::walkToDeclPre(Decl *D, CharSourceRange Range) { if (isa(D)) { // We can't hoist a closure inside a PatternBindingDecl. If it contains // a call to the completion handler, wrap it in a continuation. - wrapScopeInContinationIfNecessary(D); + wrapScopeInContinuationIfNecessary(D); NestedExprCount++; return true; } @@ -465,7 +465,7 @@ bool AsyncConverter::walkToExprPre(Expr *E) { [&]() { OS << newNameFor(D, true); }); } } else if (CallExpr *CE = TopHandler.getAsHandlerCall(E)) { - if (Scopes.back().isWrappedInContination()) { + if (Scopes.back().isWrappedInContinuation()) { return addCustom(E->getSourceRange(), [&]() { convertHandlerToContinuationResume(CE); }); } else if (NestedExprCount == 0) { @@ -478,7 +478,7 @@ bool AsyncConverter::walkToExprPre(Expr *E) { // middle of an expression) // - the current scope is wrapped in a continuation (we can't have await // calls in the continuation block) - if (NestedExprCount == 0 && !Scopes.back().isWrappedInContination()) { + if (NestedExprCount == 0 && !Scopes.back().isWrappedInContinuation()) { // If the refactoring is on the call itself, do not require the callee // to have the @available attribute or a completion-like name. auto HandlerDesc = AsyncHandlerParamDesc::find( @@ -502,7 +502,7 @@ bool AsyncConverter::walkToExprPre(Expr *E) { // We didn't do any special conversion for this expression. If needed, wrap // it in a continuation. - wrapScopeInContinationIfNecessary(E); + wrapScopeInContinuationIfNecessary(E); NestedExprCount++; return true; @@ -574,10 +574,10 @@ bool AsyncConverter::walkToStmtPre(Stmt *S) { bool AsyncConverter::walkToStmtPost(Stmt *S) { if (startsNewScope(S)) { bool ClosedScopeWasWrappedInContinuation = - Scopes.back().isWrappedInContination(); + Scopes.back().isWrappedInContinuation(); Scopes.pop_back(); if (ClosedScopeWasWrappedInContinuation && - !Scopes.back().isWrappedInContination()) { + !Scopes.back().isWrappedInContinuation()) { // The nested scope was wrapped in a continuation but the current one // isn't anymore. Add the '}' that corresponds to the call to // withChecked(Throwing)Continuation. @@ -942,7 +942,7 @@ void AsyncConverter::convertHandlerToContinuationResume(const CallExpr *CE) { void AsyncConverter::convertHandlerToContinuationResumeImpl( const CallExpr *CE, HandlerResult Result) { - assert(Scopes.back().isWrappedInContination()); + assert(Scopes.back().isWrappedInContinuation()); std::vector Args; StringRef ResumeArgumentLabel; @@ -987,7 +987,7 @@ void AsyncConverter::convertHandlerToContinuationResumeImpl( } } if (Args.size() == 1) { - // We only have a single result. 'result' seems a resonable name. + // We only have a single result. 'result' seems a reasonable name. return createUniqueName("result"); } else { // We are returning a tuple. Name the result elements 'result' + diff --git a/lib/Refactoring/Async/AsyncRefactoring.h b/lib/Refactoring/Async/AsyncRefactoring.h index a754d4ee02e7a..529d9bd675de9 100644 --- a/lib/Refactoring/Async/AsyncRefactoring.h +++ b/lib/Refactoring/Async/AsyncRefactoring.h @@ -274,7 +274,7 @@ enum class ConditionType { IS_TRUE, // if b IS_FALSE, // if !b SUCCESS_PATTERN, // case .success - FAILURE_PATTEN // case .failure + FAILURE_PATTERN // case .failure }; /// Indicates whether a condition describes a success or failure path. For @@ -311,7 +311,7 @@ struct CallbackCondition { /// - `let bind = try? .get()` CallbackCondition(const Pattern *P, const Expr *Init); - /// Initializes a `CallbackCondtion` from a case statement inside a switch + /// Initializes a `CallbackCondition` from a case statement inside a switch /// on `Subject` with `Result` type, ie. /// ``` /// switch { @@ -714,7 +714,7 @@ struct ClassifiedBlocks { ClassifiedBlock ErrorBlock; }; -/// Classifer of callback closure statements that that have either multiple +/// Classifier of callback closure statements that that have either multiple /// non-Result parameters or a single Result parameter and return Void. /// /// It performs a (possibly incorrect) best effort and may give up in certain @@ -834,7 +834,7 @@ class ReferenceCollector : private SourceEntityWalker { /// references that we don't want to shadow with hoisted declarations. /// /// Also collect all declarations that are \c DeclContexts, which is an - /// over-appoximation but let's us ignore them elsewhere. + /// over-approximation but let's us ignore them elsewhere. static void collect(ASTNode Target, BraceStmt *Scope, SourceFile &SF, llvm::DenseSet &Decls); @@ -953,7 +953,7 @@ class AsyncConverter : private SourceEntityWalker { : Names(), ContinuationName(ContinuationName) {} /// Whether this scope is wrapped in a \c withChecked(Throwing)Continuation. - bool isWrappedInContination() const { return !ContinuationName.empty(); } + bool isWrappedInContinuation() const { return !ContinuationName.empty(); } }; SourceFile *SF; SourceManager &SM; @@ -980,7 +980,7 @@ class AsyncConverter : private SourceEntityWalker { llvm::DenseSet Placeholders; // Mapping from decl -> name, used as the name of possible new local - // declarations of old completion handler parametes, as well as the + // declarations of old completion handler parameters, as well as the // replacement for other hoisted declarations and their references llvm::DenseMap Names; @@ -1116,14 +1116,14 @@ class AsyncConverter : private SourceEntityWalker { /// /// Wrapping a node in a continuation is necessary if the following conditions /// are satisfied: - /// - It contains a reference to the \c TopHandler's completion hander, + /// - It contains a reference to the \c TopHandler's completion handler, /// because these completion handler calls need to be promoted to \c return /// statements in the refactored method, but /// - We cannot hoist the completion handler of \p Node, because it doesn't /// have an async alternative by our heuristics (e.g. because of a /// completion handler name mismatch or because it also returns a value /// synchronously). - void wrapScopeInContinationIfNecessary(ASTNode Node); + void wrapScopeInContinuationIfNecessary(ASTNode Node); bool walkToPatternPre(Pattern *P) override; @@ -1174,7 +1174,7 @@ class AsyncConverter : private SourceEntityWalker { /// depending on it. /// \p AddConvertedHandlerCall needs to add the converted version of the /// completion handler. Depending on the given \c HandlerResult, it must be - /// intepreted as a success or error call. + /// interpreted as a success or error call. /// \p AddConvertedErrorCall must add the converted equivalent of returning an /// error. The passed \c StringRef contains the name of a variable that is of /// type 'Error'. @@ -1333,7 +1333,7 @@ class AsyncConverter : private SourceEntityWalker { void addDefaultValueOrPlaceholder(Type T); /// Adds the \c Index -th parameter to the completion handler described by \p - /// HanderDesc. + /// HandlerDesc. /// If \p ResultName is not empty, it is assumed that a variable with that /// name contains the result returned from the async alternative. If the /// callback also takes an error parameter, \c nil passed to the completion diff --git a/lib/Refactoring/Async/CallbackClassifier.cpp b/lib/Refactoring/Async/CallbackClassifier.cpp index b6c9c26fef8ad..0fef93f1be9f0 100644 --- a/lib/Refactoring/Async/CallbackClassifier.cpp +++ b/lib/Refactoring/Async/CallbackClassifier.cpp @@ -199,7 +199,7 @@ CallbackClassifier::classifyCallbackCondition(const CallbackCondition &Cond, return std::nullopt; break; case ConditionType::SUCCESS_PATTERN: - case ConditionType::FAILURE_PATTEN: + case ConditionType::FAILURE_PATTERN: if (SubjectParam != Params.getResultParam()) return std::nullopt; break; @@ -216,7 +216,7 @@ CallbackClassifier::classifyCallbackCondition(const CallbackCondition &Cond, switch (CondType) { case ConditionType::NIL: case ConditionType::IS_FALSE: - case ConditionType::FAILURE_PATTEN: + case ConditionType::FAILURE_PATTERN: Path = flippedConditionPath(Path); break; case ConditionType::IS_TRUE: diff --git a/lib/Refactoring/Async/CallbackCondition.cpp b/lib/Refactoring/Async/CallbackCondition.cpp index 0812166bcf647..e4a420d7cd4fc 100644 --- a/lib/Refactoring/Async/CallbackCondition.cpp +++ b/lib/Refactoring/Async/CallbackCondition.cpp @@ -120,7 +120,7 @@ void CallbackCondition::initFromEnumPattern(const Decl *D, if (!eedTy || !eedTy->isResult()) return; if (EED->getNameStr() == StringRef("failure")) { - Type = ConditionType::FAILURE_PATTEN; + Type = ConditionType::FAILURE_PATTERN; } else { Type = ConditionType::SUCCESS_PATTERN; } diff --git a/lib/Refactoring/ConvertToSwitchStmt.cpp b/lib/Refactoring/ConvertToSwitchStmt.cpp index a3e954d8aa36b..04899ae15312c 100644 --- a/lib/Refactoring/ConvertToSwitchStmt.cpp +++ b/lib/Refactoring/ConvertToSwitchStmt.cpp @@ -62,9 +62,9 @@ bool RefactoringActionConvertToSwitchStmt::isApplicable( } }; - class SwitchConvertable { + class SwitchConvertible { public: - SwitchConvertable(const ResolvedRangeInfo &Info) : Info(Info) {} + SwitchConvertible(const ResolvedRangeInfo &Info) : Info(Info) {} bool isApplicable() { if (Info.Kind != RangeKind::SingleStatement) @@ -114,7 +114,7 @@ bool RefactoringActionConvertToSwitchStmt::isApplicable( return checker.allCheckPassed(); } }; - return SwitchConvertable(Info).isApplicable(); + return SwitchConvertible(Info).isApplicable(); } bool RefactoringActionConvertToSwitchStmt::performChange() { diff --git a/lib/Refactoring/FillProtocolStubs.cpp b/lib/Refactoring/FillProtocolStubs.cpp index 8e5286e406a11..6e9f1596614b8 100644 --- a/lib/Refactoring/FillProtocolStubs.cpp +++ b/lib/Refactoring/FillProtocolStubs.cpp @@ -26,7 +26,7 @@ class FillProtocolStubContext { getUnsatisfiedRequirements(const IterableDeclContext *IDC); /// Context in which the content should be filled; this could be either a - /// nominal type declaraion or an extension declaration. + /// nominal type declaration or an extension declaration. DeclContext *DC; /// The type that adopts the required protocol stubs. For nominal type decl, diff --git a/lib/Refactoring/TrailingClosure.cpp b/lib/Refactoring/TrailingClosure.cpp index 9c1dd789c8d7f..ffa76a94b80c5 100644 --- a/lib/Refactoring/TrailingClosure.cpp +++ b/lib/Refactoring/TrailingClosure.cpp @@ -19,7 +19,7 @@ using namespace swift::refactoring; static CallExpr *findTrailingClosureTarget(SourceManager &SM, ResolvedCursorInfoPtr CursorInfo) { if (CursorInfo->getKind() == CursorInfoKind::StmtStart) - // StmtStart postion can't be a part of CallExpr. + // StmtStart position can't be a part of CallExpr. return nullptr; // Find inner most CallExpr diff --git a/lib/SIL/IR/AbstractionPattern.cpp b/lib/SIL/IR/AbstractionPattern.cpp index 0b4ba5b9d91ff..4b5d22bd044a8 100644 --- a/lib/SIL/IR/AbstractionPattern.cpp +++ b/lib/SIL/IR/AbstractionPattern.cpp @@ -2016,7 +2016,7 @@ bool AbstractionPattern::hasSameBasicTypeStructure(CanType l, CanType r) { if (lObject && rObject) { return hasSameBasicTypeStructure(lObject, rObject); } else if (lObject || rObject) { - // Allow optionality mis-matches, but require the underlying types to match. + // Allow optionality mismatches, but require the underlying types to match. return hasSameBasicTypeStructure(lObject ? lObject : l, rObject ? rObject : r); } diff --git a/lib/SIL/IR/SILFunction.cpp b/lib/SIL/IR/SILFunction.cpp index 3947ef08b36fe..aa01a63c4dd97 100644 --- a/lib/SIL/IR/SILFunction.cpp +++ b/lib/SIL/IR/SILFunction.cpp @@ -204,7 +204,7 @@ static BridgedFunction::WriteFn writeFunction = nullptr; static BridgedFunction::ParseFn parseFunction = nullptr; static BridgedFunction::CopyEffectsFn copyEffectsFunction = nullptr; static BridgedFunction::GetEffectInfoFn getEffectInfoFunction = nullptr; -static BridgedFunction::GetMemBehaviorFn getMemBehvaiorFunction = nullptr; +static BridgedFunction::GetMemBehaviorFn getMemBehaviorFunction = nullptr; static BridgedFunction::ArgumentMayReadFn argumentMayReadFunction = nullptr; SILFunction::SILFunction( @@ -943,7 +943,7 @@ bool SILFunction::canBeInlinedIntoCaller(SerializedKind_t callerSerializedKind) // If Package-CMO is enabled, we serialize package, public, // and @usableFromInline decls as [serialized_for_package]. // Their bodies must not, however, leak into @inlinable - // functons (that are [serialized]) since they are inlined + // functions (that are [serialized]) since they are inlined // outside of their defining module. // // If this callee is [serialized_for_package], the caller @@ -1048,7 +1048,7 @@ bool SILFunction::shouldBePreservedForDebugger() const { if (getLinkage() == SILLinkage::Shared) return false; - // Don't preserve anything markes as always emit into client. + // Don't preserve anything marked as always emit into client. if (markedAsAlwaysEmitIntoClient()) return false; @@ -1176,7 +1176,7 @@ void BridgedFunction::registerBridging(SwiftMetatype metatype, parseFunction = parseFn; copyEffectsFunction = copyEffectsFn; getEffectInfoFunction = effectInfoFn; - getMemBehvaiorFunction = memBehaviorFn; + getMemBehaviorFunction = memBehaviorFn; argumentMayReadFunction = argumentMayReadFn; } @@ -1264,10 +1264,10 @@ visitArgEffects(std::function c) const { } MemoryBehavior SILFunction::getMemoryBehavior(bool observeRetains) { - if (!getMemBehvaiorFunction) + if (!getMemBehaviorFunction) return MemoryBehavior::MayHaveSideEffects; - auto b = getMemBehvaiorFunction({this}, observeRetains); + auto b = getMemBehaviorFunction({this}, observeRetains); return (MemoryBehavior)b; } diff --git a/lib/SIL/IR/SILProfiler.cpp b/lib/SIL/IR/SILProfiler.cpp index 3a24532a05b60..c5cb791a86e11 100644 --- a/lib/SIL/IR/SILProfiler.cpp +++ b/lib/SIL/IR/SILProfiler.cpp @@ -99,7 +99,7 @@ static bool shouldProfile(SILDeclRef Constant) { // Do not profile generated code. This includes macro expansions, which we // otherwise consider to be "written by the user", because they wrote the - // macro attribute or expr. We may want to revist this in the future. We'll + // macro attribute or expr. We may want to revisit this in the future. We'll // need to figure out how we'll be writing out the macro expansions though, // such that they can be referenced by llvm-cov. // Note we check `getSourceFileContainingLocation` instead of @@ -1132,7 +1132,7 @@ struct CoverageMapping : public ASTWalker { /// Mark \c S as a terminator, starting a zero region. void terminateRegion(ASTNode S) { - assert(!RegionStack.empty() && "Cannot terminate non-existant region"); + assert(!RegionStack.empty() && "Cannot terminate non-existent region"); // Walk up the region stack and cut short regions until we reach a region // for an AST node. This ensures we correctly handle new regions that have @@ -1550,7 +1550,7 @@ struct CoverageMapping : public ASTWalker { // all. This is inconsistent with property initializers, which are // effectively default values too. Seems like coverage doesn't offer much // benefit in these cases, as they're unlikely to have side effects, and - // the values can be exercized explicitly, but we should probably at least + // the values can be exercised explicitly, but we should probably at least // have a consistent behavior for both no matter what we choose here. return Action::SkipNode(); } diff --git a/lib/SIL/IR/TypeLowering.cpp b/lib/SIL/IR/TypeLowering.cpp index 3f74cc5abc2a5..22cb71c97cc3e 100644 --- a/lib/SIL/IR/TypeLowering.cpp +++ b/lib/SIL/IR/TypeLowering.cpp @@ -3051,7 +3051,7 @@ void TypeConverter::verifyLexicalLowering(const TypeLowering &lowering, if (tyLowering.isTrivial()) return true; - // We're visiting a non-trival leaf of a type whose lowering is + // We're visiting a non-trivial leaf of a type whose lowering is // not lexical. The leaf must be annotated @_eagerMove. // Otherwise, the whole type would be lexical. @@ -4631,7 +4631,7 @@ TypeConverter::checkForABIDifferences(SILModule &M, // Async/synchronous conversions always need a thunk. if (fnTy1->isAsync() != fnTy2->isAsync()) return ABIDifference::NeedsThunk; - // Usin an async function without an error result in place of an async + // Using an async function without an error result in place of an async // function that needs an error result is not ABI compatible. if (fnTy2->isAsync() && !fnTy1->hasErrorResult() && fnTy2->hasErrorResult()) diff --git a/lib/SIL/Parser/ParseTestSpecification.cpp b/lib/SIL/Parser/ParseTestSpecification.cpp index 4849f84a090c1..074fea207d695 100644 --- a/lib/SIL/Parser/ParseTestSpecification.cpp +++ b/lib/SIL/Parser/ParseTestSpecification.cpp @@ -39,7 +39,7 @@ void findAndDeleteTraceValues(SILFunction *function, } } -bool isDeleteableTestInstruction(SILInstruction const *instruction) { +bool isDeletableTestInstruction(SILInstruction const *instruction) { if (auto *dvi = dyn_cast(instruction)) return dvi->hasTrace(); if (isa(instruction)) @@ -50,11 +50,11 @@ bool isDeleteableTestInstruction(SILInstruction const *instruction) { SILInstruction *findAnchorInstructionAfter(SpecifyTestInst *tsi) { for (auto *instruction = tsi->getNextInstruction(); instruction; instruction = instruction->getNextInstruction()) { - if (!isDeleteableTestInstruction(instruction)) + if (!isDeletableTestInstruction(instruction)) return instruction; } // This can't happen because a SpecifyTestInst isn't a terminator itself - // nor are any deleteable instructions. + // nor are any deletable instructions. llvm_unreachable("found no anchor after SpecifyTestInst!?"); } diff --git a/lib/SIL/Utils/FieldSensitivePrunedLiveness.cpp b/lib/SIL/Utils/FieldSensitivePrunedLiveness.cpp index 0258cf5856e06..65b9995cb1e84 100644 --- a/lib/SIL/Utils/FieldSensitivePrunedLiveness.cpp +++ b/lib/SIL/Utils/FieldSensitivePrunedLiveness.cpp @@ -1128,7 +1128,7 @@ void FieldSensitivePrunedLiveRange::computeBoundary( FieldSensitivePrunedLivenessBoundary &boundary) const { assert(asImpl().isInitialized()); - PRUNED_LIVENESS_LOG(llvm::dbgs() << "Liveness Boundary Compuation!\n"); + PRUNED_LIVENESS_LOG(llvm::dbgs() << "Liveness Boundary Computation!\n"); using IsLive = FieldSensitivePrunedLiveBlocks::IsLive; SmallVector isLiveTmp; diff --git a/lib/SIL/Utils/MemAccessUtils.cpp b/lib/SIL/Utils/MemAccessUtils.cpp index ef9ec6fd332e7..4e351026033f3 100644 --- a/lib/SIL/Utils/MemAccessUtils.cpp +++ b/lib/SIL/Utils/MemAccessUtils.cpp @@ -2606,7 +2606,7 @@ static void visitBuiltinAddress(BuiltinInst *builtin, case BuiltinValueKind::WillThrow: return; - // Buitins that affect memory but can't be formal accesses. + // Builtins that affect memory but can't be formal accesses. case BuiltinValueKind::AssumeTrue: case BuiltinValueKind::UnexpectedError: case BuiltinValueKind::ErrorInMain: diff --git a/lib/SIL/Utils/OSSALifetimeCompletion.cpp b/lib/SIL/Utils/OSSALifetimeCompletion.cpp index ae6f82f01badd..6f617bcd76bbd 100644 --- a/lib/SIL/Utils/OSSALifetimeCompletion.cpp +++ b/lib/SIL/Utils/OSSALifetimeCompletion.cpp @@ -201,7 +201,7 @@ class AvailabilityBoundaryVisitor { void computeRegion(const SSAPrunedLiveness &liveness); /// Iterative dataflow to determine availability for each block in `region`. - void propagateAvailablity(Result &result); + void propagateAvailability(Result &result); /// Visit the terminators of blocks on the boundary of availability. void visitAvailabilityBoundary(Result const &result, Visit visit); @@ -254,7 +254,7 @@ void AvailabilityBoundaryVisitor::visit(const SSAPrunedLiveness &liveness, Result &result, Visit visit) { computeRegion(liveness); - propagateAvailablity(result); + propagateAvailability(result); visitAvailabilityBoundary(result, visit); } @@ -316,7 +316,7 @@ void AvailabilityBoundaryVisitor::computeRegion( } } -void AvailabilityBoundaryVisitor::propagateAvailablity(Result &result) { +void AvailabilityBoundaryVisitor::propagateAvailability(Result &result) { // Initialize per-block state. // - all blocks outside of the region are ::Unavailable (automatically // initialized) diff --git a/lib/SIL/Utils/OptimizationRemark.cpp b/lib/SIL/Utils/OptimizationRemark.cpp index d98a19a0e408f..b3519a739c78e 100644 --- a/lib/SIL/Utils/OptimizationRemark.cpp +++ b/lib/SIL/Utils/OptimizationRemark.cpp @@ -174,7 +174,7 @@ static SourceLoc getLocForPresentation(SILLocation loc, llvm_unreachable("covered switch"); } -static bool instHasInferrableLoc(SILInstruction &inst) { +static bool instHasInferableLoc(SILInstruction &inst) { if (isa(inst) || isa(inst) || isa(inst) || isa(inst) || isa(inst) || isa(inst)) @@ -195,7 +195,7 @@ inferOptRemarkSearchForwards(SILInstruction &i, SourceLocPresentationKind presentationKind) { for (auto &inst : llvm::make_range(std::next(i.getIterator()), i.getParent()->end())) { - if (!instHasInferrableLoc(inst)) + if (!instHasInferableLoc(inst)) continue; // Skip instructions without a loc we care about since we move it around. auto newLoc = getLocForPresentation(inst.getLoc(), presentationKind); @@ -219,7 +219,7 @@ inferOptRemarkSearchBackwards(SILInstruction &i, SourceLocPresentationKind presentationKind) { for (auto &inst : llvm::make_range(std::next(i.getReverseIterator()), i.getParent()->rend())) { - if (!instHasInferrableLoc(inst)) + if (!instHasInferableLoc(inst)) continue; auto loc = inst.getLoc(); if (auto inlinedLoc = inst.getDebugScope()->getOutermostInlineLocation()) diff --git a/lib/SIL/Utils/OwnershipUtils.cpp b/lib/SIL/Utils/OwnershipUtils.cpp index 3a970e4d328d8..17ea01aff7a26 100644 --- a/lib/SIL/Utils/OwnershipUtils.cpp +++ b/lib/SIL/Utils/OwnershipUtils.cpp @@ -1742,7 +1742,7 @@ void swift::visitExtendedGuaranteedForwardingPhiBaseValuePairs( /// /// Return true \p visitOperand was called at least once. /// -/// \p visitOperand should always recheck for Guaranteed owernship if it +/// \p visitOperand should always recheck for Guaranteed ownership if it /// matters, in case a cast forwards a trivial type to a nontrivial type. /// /// This intentionally does not handle phis, which require recursive traversal diff --git a/lib/SIL/Utils/Projection.cpp b/lib/SIL/Utils/Projection.cpp index bfde1fb0fe5a9..5d3def8e4b25a 100644 --- a/lib/SIL/Utils/Projection.cpp +++ b/lib/SIL/Utils/Projection.cpp @@ -1334,7 +1334,7 @@ computeUsesAndLiveness(SILValue Base) { } // Then setup the leaf list by iterating through our Nodes looking for live - // leafs. We use a DFS order, always processing the left leafs first so that + // leaves. We use a DFS order, always processing the left leaves first so that // we match the order in which we will lay out arguments. llvm::SmallVector Worklist; Worklist.push_back(getRoot()); @@ -1358,11 +1358,11 @@ computeUsesAndLiveness(SILValue Base) { } #ifndef NDEBUG - LLVM_DEBUG(llvm::dbgs() << "Final Leafs: \n"); + LLVM_DEBUG(llvm::dbgs() << "Final Leaves: \n"); llvm::SmallVector LeafTypes; getLiveLeafTypes(LeafTypes); - for (SILType Leafs : LeafTypes) { - LLVM_DEBUG(llvm::dbgs() << " " << Leafs << "\n"); + for (SILType Leaves : LeafTypes) { + LLVM_DEBUG(llvm::dbgs() << " " << Leaves << "\n"); } #endif } @@ -1370,7 +1370,7 @@ computeUsesAndLiveness(SILValue Base) { void ProjectionTree:: createTreeFromValue(SILBuilder &B, SILLocation Loc, SILValue NewBase, - llvm::SmallVectorImpl &Leafs) const { + llvm::SmallVectorImpl &Leaves) const { LLVM_DEBUG(llvm::dbgs() << "Recreating tree from value: " << NewBase); using WorklistEntry = @@ -1411,7 +1411,7 @@ createTreeFromValue(SILBuilder &B, SILLocation Loc, SILValue NewBase, // Otherwise add it to our leaf list. LLVM_DEBUG(llvm::dbgs() << " Is a Leaf! Adding to leaf list\n"); - Leafs.push_back(V); + Leaves.push_back(V); } } } @@ -1453,18 +1453,18 @@ getNextValidNode(llvm::SmallVectorImpl &Worklist, void ProjectionTree:: replaceValueUsesWithLeafUses(SILBuilder &Builder, SILLocation Loc, - llvm::SmallVectorImpl &Leafs) { - assert(Leafs.size() == LiveLeafIndices.size() && "Leafs and leaf indices must " + llvm::SmallVectorImpl &Leaves) { + assert(Leaves.size() == LiveLeafIndices.size() && "Leaves and leaf indices must " "equal in size."); NewAggregateBuilderMap AggBuilderMap(Builder, Loc); llvm::SmallVector Worklist; - LLVM_DEBUG(llvm::dbgs() << "Replacing all uses in callee with leafs!\n"); + LLVM_DEBUG(llvm::dbgs() << "Replacing all uses in callee with leaves!\n"); // For each Leaf we have as input... - for (unsigned i = 0, e = Leafs.size(); i != e; ++i) { - SILValue Leaf = Leafs[i]; + for (unsigned i = 0, e = Leaves.size(); i != e; ++i) { + SILValue Leaf = Leaves[i]; ProjectionTreeNode *Node = getNode(LiveLeafIndices[i]); LLVM_DEBUG(llvm::dbgs() << " Visiting leaf: " << Leaf); diff --git a/lib/SIL/Utils/SILBridging.cpp b/lib/SIL/Utils/SILBridging.cpp index 12b7dd0d7e71b..a59d0b2f49a1f 100644 --- a/lib/SIL/Utils/SILBridging.cpp +++ b/lib/SIL/Utils/SILBridging.cpp @@ -13,7 +13,7 @@ #include "swift/SIL/SILBridging.h" #ifdef PURE_BRIDGING_MODE -// In PURE_BRIDGING_MODE, briding functions are not inlined and therefore inluded in the cpp file. +// In PURE_BRIDGING_MODE, briding functions are not inlined and therefore included in the cpp file. #include "swift/SIL/SILBridgingImpl.h" #endif diff --git a/lib/SIL/Verifier/SILVerifier.cpp b/lib/SIL/Verifier/SILVerifier.cpp index f4cdd1545210f..204704e614e62 100644 --- a/lib/SIL/Verifier/SILVerifier.cpp +++ b/lib/SIL/Verifier/SILVerifier.cpp @@ -2485,18 +2485,18 @@ class SILVerifier : public SILVerifierBase { if (isa(FRI)) require( !RefF->isDynamicallyReplaceable(), - "function_ref cannot reference a [dynamically_replaceable] function"); + "function_ref cannot reference a [dynamically_replacable] function"); else if (isa(FRI)) { require(!RefF->isDynamicallyReplaceable(), "previous_function_ref cannot reference a " - "[dynamically_replaceable] function"); + "[dynamically_replacable] function"); require(RefF->getDynamicallyReplacedFunction(), "previous_function_ref must reference a " "[dynamic_replacement_for:...] function"); } else if (isa(FRI)) require(RefF->isDynamicallyReplaceable(), "dynamic_function_ref must reference a " - "[dynamically_replaceable] function"); + "[dynamically_replacable] function"); // In canonical SIL, direct reference to a shared_external declaration // is an error; we should have deserialized a body. In raw SIL, including @@ -6215,7 +6215,7 @@ class SILVerifier : public SILVerifierBase { /// components must have the same shape as the pack substitutions. /// The lowered element type is a valid type for this index if, for /// each component of this shape, there is a substitution which - /// (optionally) replaces archetypes in S with the correponding + /// (optionally) replaces archetypes in S with the corresponding /// component type (pattern types for expansions) of the pack /// substitution to get the corresponding component type (pattern /// type for expansions) of the pack operand. @@ -6536,7 +6536,7 @@ class SILVerifier : public SILVerifierBase { // Address-type drop_deinit has no special structural requirements. It just // sits there and blocks optimization on the allocation and downstream uses // of the address. If we want to optimize around address-type drop_deinit, - // then we need a seperate verifier for its requirements. + // then we need a separate verifier for its requirements. if (ddi->getType().isAddress()) return; @@ -7001,7 +7001,7 @@ class SILVerifier : public SILVerifierBase { if (SI.getLoc().getKind() == SILLocation::CleanupKind) continue; // FIXME: These still leave holes in the scopes. We should make them - // inherit the sourrounding scope in IRGenSIL. + // inherit the surrounding scope in IRGenSIL. if (SI.getLoc().getKind() == SILLocation::MandatoryInlinedKind) continue; // FIXME: There are situations where the execution legitimately goes @@ -7110,12 +7110,12 @@ class SILVerifier : public SILVerifierBase { visitSILBasicBlock(&BB); } - verifyPredecessorSucessorStructure(F); + verifyPredecessorSuccessorStructure(F); } // Make sure that each of the successors/predecessors of a basic block // have this basic block in its predecessor/successor list. - void verifyPredecessorSucessorStructure(SILFunction *f) { + void verifyPredecessorSuccessorStructure(SILFunction *f) { using PredSuccPair = std::pair; llvm::DenseSet foundSuccessors; llvm::DenseSet foundPredecessors; diff --git a/lib/SILGen/ManagedValue.h b/lib/SILGen/ManagedValue.h index 2242afea7bc94..146147d8aec17 100644 --- a/lib/SILGen/ManagedValue.h +++ b/lib/SILGen/ManagedValue.h @@ -288,7 +288,7 @@ class ManagedValue { /// this value to a call that consumes the argument. bool isPlusOne(SILGenFunction &SGF) const; - /// Returns true if this managed value can be forwarded without necessarilly + /// Returns true if this managed value can be forwarded without necessarily /// destroying the original. /// /// This is true if either isPlusOne is true or the value is trivial. Unlike diff --git a/lib/SILGen/RValue.h b/lib/SILGen/RValue.h index a34b13bf6050e..eed9d9db63ca3 100644 --- a/lib/SILGen/RValue.h +++ b/lib/SILGen/RValue.h @@ -263,7 +263,7 @@ class RValue { /// deinitializes the memory regardless of whether the value has ownership. bool isPlusOne(SILGenFunction &SGF) const &; - /// Returns true if this rvalue can be forwarded without necessarilly + /// Returns true if this rvalue can be forwarded without necessarily /// destroying the original. /// /// This is true if either isPlusOne is true or the value is trivial. A diff --git a/lib/SILGen/SILGen.cpp b/lib/SILGen/SILGen.cpp index f3cb67c1b1a1b..48f00cea66642 100644 --- a/lib/SILGen/SILGen.cpp +++ b/lib/SILGen/SILGen.cpp @@ -482,7 +482,7 @@ FuncDecl *SILGenModule::getExit() { if (!exitFunction) { // No go, look for it in any loaded module. Several of the internal // Swift modules or swift-corelibs modules may have absorbed - // when buliding without fully specified clang modules in the OS/SDK. + // when building without fully specified clang modules in the OS/SDK. for (const auto &loadedModuleVector : C.getLoadedModules()) { if (loadedModuleVector.first == mostLikelyIdentifier) { continue; diff --git a/lib/SILGen/SILGenApply.cpp b/lib/SILGen/SILGenApply.cpp index fb3f0776d7ffd..4433d6510c432 100644 --- a/lib/SILGen/SILGenApply.cpp +++ b/lib/SILGen/SILGenApply.cpp @@ -1248,7 +1248,7 @@ class SILGenApply : public Lowering::ExprVisitor { constant, captureInfo, subs); // Check whether we have to dispatch to the original implementation of a - // dynamically_replaceable inside of a dynamic_replacement(for:) function. + // dynamically_replacable inside of a dynamic_replacement(for:) function. ApplyExpr *thisCallSite = (selfApply ? selfApply : callSite); bool isObjCReplacementSelfCall = false; auto *unaryArg = thisCallSite->getArgs()->getUnaryExpr(); @@ -2998,7 +2998,7 @@ static void emitDelayedArguments(SILGenFunction &SGF, // If any of the delayed arguments are isolated default arguments, // argument evaluation happens in the following order: // - // 1. Left-to-right evalution of explicit r-value arguments + // 1. Left-to-right evaluation of explicit r-value arguments // 2. Left-to-right evaluation of formal access arguments // 3. Hop to the callee's isolation domain // 4. Left-to-right evaluation of default arguments diff --git a/lib/SILGen/SILGenConcurrency.cpp b/lib/SILGen/SILGenConcurrency.cpp index 5ad1aacccf3f9..d7d3d09ac570f 100644 --- a/lib/SILGen/SILGenConcurrency.cpp +++ b/lib/SILGen/SILGenConcurrency.cpp @@ -597,7 +597,7 @@ static bool isCheckExpectedExecutorIntrinsicAvailable(SILGenModule &SGM) { if (!checkExecutor) return false; - // Forego a check if instrinsic is unavailable, this could happen + // Forego a check if intrinsic is unavailable, this could happen // in main-actor context. auto &C = checkExecutor->getASTContext(); if (!C.LangOpts.DisableAvailabilityChecking) { diff --git a/lib/SILGen/SILGenConstructor.cpp b/lib/SILGen/SILGenConstructor.cpp index 8cbd54010aacd..b43320ffc27d0 100644 --- a/lib/SILGen/SILGenConstructor.cpp +++ b/lib/SILGen/SILGenConstructor.cpp @@ -411,7 +411,7 @@ static void emitImplicitValueConstructor(SILGenFunction &SGF, if (initializedViaAccessor.count(field)) continue; - // Handle situations where this stored propery is initialized + // Handle situations where this stored property is initialized // via a call to an init accessor on some other property. if (auto *initAccessor = field->getAccessor(AccessorKind::Init)) { if (field->isMemberwiseInitialized(/*preferDeclaredProperties=*/true)) { diff --git a/lib/SILGen/SILGenFunction.h b/lib/SILGen/SILGenFunction.h index 5ef441318ba55..b58392bb75a32 100644 --- a/lib/SILGen/SILGenFunction.h +++ b/lib/SILGen/SILGenFunction.h @@ -784,7 +784,7 @@ class LLVM_LIBRARY_VISIBILITY SILGenFunction SmallVectorImpl &directResultsBuffer, SmallVectorImpl &cleanups); - /// Check to see if an initalization for a SingleValueStmtExpr is active, and + /// Check to see if an initialization for a SingleValueStmtExpr is active, and /// if the provided expression is for one of its branches. If so, returns the /// initialization to use for the expression. Otherwise returns \c nullptr. std::unique_ptr getSingleValueStmtInit(Expr *E); @@ -878,7 +878,7 @@ class LLVM_LIBRARY_VISIBILITY SILGenFunction /// Generates code for the given init accessor represented by AccessorDecl. /// This emits the body code and replaces all `self.` references - /// with either argument (if property appears in `acesses` list`) or result + /// with either argument (if property appears in `accesses` list`) or result /// value assignment. void emitInitAccessor(AccessorDecl *accessor); @@ -1004,7 +1004,7 @@ class LLVM_LIBRARY_VISIBILITY SILGenFunction /// /// \param isPreconcurrency If the conformance is marked as `@preconcurrency` /// instead of a hop (when entering isolation) emit a dynamic check to make - /// sure that witness has been unsed in the expected context. + /// sure that witness has been used in the expected context. void emitProtocolWitness(AbstractionPattern reqtOrigTy, CanAnyFunctionType reqtSubstTy, SILDeclRef requirement, SubstitutionMap reqtSubs, @@ -2900,7 +2900,7 @@ class LLVM_LIBRARY_VISIBILITY SILGenFunction /// The first parameter is the current index within the expansion /// component, a value of type Builtin.Word. The second parameter is /// that index as a pack indexing instruction that indexes into packs - /// with the shape of the pack expasion. The third parameter is the + /// with the shape of the pack expansion. The third parameter is the /// current pack index within the overall pack, a pack indexing instruction /// that indexes into packs with the shape of formalPackType. /// diff --git a/lib/SILGen/SILGenLValue.cpp b/lib/SILGen/SILGenLValue.cpp index 217a8c1848cf0..31558402b5299 100644 --- a/lib/SILGen/SILGenLValue.cpp +++ b/lib/SILGen/SILGenLValue.cpp @@ -1822,7 +1822,7 @@ namespace { // Stores the address of the storage property. ManagedValue proj; - // TODO: revist minimal + // TODO: revisit minimal SILType varStorageType = SGF.SGM.Types.getSubstitutedStorageType( TypeExpansionContext::minimal(), backingVar, ValType->getCanonicalType()); diff --git a/lib/SILGen/SILGenPattern.cpp b/lib/SILGen/SILGenPattern.cpp index 9aa58f50d9631..d901f61ced5b9 100644 --- a/lib/SILGen/SILGenPattern.cpp +++ b/lib/SILGen/SILGenPattern.cpp @@ -319,7 +319,7 @@ struct RowToSpecialize { /// Whether the row will be irrefutable after this specialization. bool Irrefutable; - /// Profile Count of hte row we intend to specialize. + /// Profile Count of the row we intend to specialize. ProfileCounter Count; }; diff --git a/lib/SILGen/SILGenPoly.cpp b/lib/SILGen/SILGenPoly.cpp index b00bde72b13a9..0949bbc62f8fa 100644 --- a/lib/SILGen/SILGenPoly.cpp +++ b/lib/SILGen/SILGenPoly.cpp @@ -2347,7 +2347,7 @@ ExpandedTupleInputGenerator::projectPackComponent(SILGenFunction &SGF, assert(isComponentExpansion == isa( formalPackType.getElementType(componentIndex))); - // Deactive the cleanup for the outer pack value. + // Deactivate the cleanup for the outer pack value. CleanupCloner cloner(SGF, packValue); auto packAddr = packValue.forward(SGF); diff --git a/lib/SILGen/SILGenProlog.cpp b/lib/SILGen/SILGenProlog.cpp index 53a1fe05ce0c5..17f5d3f373e87 100644 --- a/lib/SILGen/SILGenProlog.cpp +++ b/lib/SILGen/SILGenProlog.cpp @@ -1383,7 +1383,7 @@ void SILGenFunction::emitProlog( emitExpectedExecutor(); // IMPORTANT: This block should be the last one in `emitProlog`, - // since it terminates BB and no instructions should be insterted after it. + // since it terminates BB and no instructions should be inserted after it. // Emit an unreachable instruction if a parameter type is // uninhabited if (paramList) { diff --git a/lib/SILGen/SILGenTopLevel.h b/lib/SILGen/SILGenTopLevel.h index f48d6d9965f9b..70fde5d140994 100644 --- a/lib/SILGen/SILGenTopLevel.h +++ b/lib/SILGen/SILGenTopLevel.h @@ -41,7 +41,7 @@ class SILGenTopLevel : public ASTVisitor { /// The `SILGenFunction` where toplevel code is emitted SILGenFunction &SGF; - /// Walks type declarations to scan for instances where unitialized global + /// Walks type declarations to scan for instances where uninitialized global /// variables are captured by function declarations and emits /// `mark_function_escape` SIL instructions for these escape points as needed class TypeVisitor : public TypeMemberVisitor { diff --git a/lib/SILGen/SILGenType.cpp b/lib/SILGen/SILGenType.cpp index 9b0d4ceb4d403..b35a7c8c1ebac 100644 --- a/lib/SILGen/SILGenType.cpp +++ b/lib/SILGen/SILGenType.cpp @@ -858,7 +858,7 @@ SILFunction *SILGenModule::emitProtocolWitness( // If the conformance is marked as `@preconcurrency` instead of // emitting a hop to the executor (when needed) emit a dynamic check - // to make sure that witness has been unsed in the expected context. + // to make sure that witness has been used in the expected context. bool isPreconcurrency = false; if (conformance.isConcrete()) { if (auto *C = diff --git a/lib/SILGen/TupleGenerators.h b/lib/SILGen/TupleGenerators.h index cfbe84273e8fe..2ed6c566b2752 100644 --- a/lib/SILGen/TupleGenerators.h +++ b/lib/SILGen/TupleGenerators.h @@ -82,7 +82,7 @@ class PackGeneratorRef { /// individual element of the substituted tuple type. This makes /// this generator more appropriate for use cases where the elements /// must all be visited, such as when iterating the elements of two -/// tuples in paralle. +/// tuples in parallel. /// /// In order to properly handle pack expansions within tuples, /// especially any empty pack expansions in the original tuple type, diff --git a/lib/SILOptimizer/Analysis/BasicCalleeAnalysis.cpp b/lib/SILOptimizer/Analysis/BasicCalleeAnalysis.cpp index 697138d339ee9..ba7fed9fef1c4 100644 --- a/lib/SILOptimizer/Analysis/BasicCalleeAnalysis.cpp +++ b/lib/SILOptimizer/Analysis/BasicCalleeAnalysis.cpp @@ -58,18 +58,18 @@ void BasicCalleeAnalysis::print(llvm::raw_ostream &os) const { //===----------------------------------------------------------------------===// static BridgedCalleeAnalysis::IsDeinitBarrierFn instructionIsDeinitBarrierFunction; -static BridgedCalleeAnalysis::GetMemBehvaiorFn getMemBehvaiorFunction = nullptr; +static BridgedCalleeAnalysis::GetMemBehaviorFn getMemBehaviorFunction = nullptr; void BridgedCalleeAnalysis::registerAnalysis(IsDeinitBarrierFn instructionIsDeinitBarrierFn, - GetMemBehvaiorFn getMemBehvaiorFn) { + GetMemBehaviorFn getMemBehaviorFn) { instructionIsDeinitBarrierFunction = instructionIsDeinitBarrierFn; - getMemBehvaiorFunction = getMemBehvaiorFn; + getMemBehaviorFunction = getMemBehaviorFn; } MemoryBehavior BasicCalleeAnalysis:: getMemoryBehavior(FullApplySite as, bool observeRetains) { - if (getMemBehvaiorFunction) { - auto b = getMemBehvaiorFunction({as.getInstruction()->asSILNode()}, + if (getMemBehaviorFunction) { + auto b = getMemBehaviorFunction({as.getInstruction()->asSILNode()}, observeRetains, {this}); return (MemoryBehavior)b; diff --git a/lib/SILOptimizer/Analysis/RegionAnalysis.cpp b/lib/SILOptimizer/Analysis/RegionAnalysis.cpp index 19a3dcf28fc09..c93e39ec70cb4 100644 --- a/lib/SILOptimizer/Analysis/RegionAnalysis.cpp +++ b/lib/SILOptimizer/Analysis/RegionAnalysis.cpp @@ -1217,7 +1217,7 @@ struct PartitionOpBuilder { lookupValueID(srcOperand->get()), srcOperand)); } - /// Mark \p value artifically as being part of an actor isolated region by + /// Mark \p value artificially as being part of an actor isolated region by /// introducing a new fake actor introducing representative and merging them. void addActorIntroducingInst(SILValue sourceValue, Operand *sourceOperand, SILIsolationInfo actorIsolation) { @@ -1321,7 +1321,7 @@ enum class TranslationSemantics { /// their behavior depending on some state on the instruction itself. Special, - /// An instruction that is a full apply site. Can cause transfering or + /// An instruction that is a full apply site. Can cause transferring or /// untransferring of regions. Apply, @@ -1641,7 +1641,7 @@ class PartitionOpTranslator { SmallVector, 8> assignOperands; SmallVector assignResults; - // A helper we use to emit an unknown patten error if our merge is + // A helper we use to emit an unknown pattern error if our merge is // invalid. This ensures we guarantee that if we find an actor merge error, // the compiler halts. Importantly this lets our users know 100% that if the // compiler exits successfully, actor merge errors could not have happened. @@ -1664,7 +1664,7 @@ class PartitionOpTranslator { // If we fail to merge, then we have an incompatibility in between some // of our arguments (consider isolated to different actors) or with the - // isolationInfo we specified. Emit an unknown patten error. + // isolationInfo we specified. Emit an unknown pattern error. if (!mergedInfo) { REGIONBASEDISOLATION_LOG( llvm::dbgs() << "Merge Failure!\n" @@ -1691,7 +1691,7 @@ class PartitionOpTranslator { // We only get back result if it is non-Sendable. if (auto nonSendableValue = initializeTrackedValue(result, resultIsolationInfoOverride)) { - // If we did not insert, emit an unknown patten error. + // If we did not insert, emit an unknown pattern error. if (!nonSendableValue->second) { builder.addUnknownPatternError(result); } @@ -2688,7 +2688,7 @@ CONSTANT_TRANSLATION(InitExistentialValueInst, LookThrough) // // These are treated as stores - meaning that they could write values into -// memory. The beahvior of this depends on whether the tgt addr is aliased, +// memory. The behavior of this depends on whether the tgt addr is aliased, // but conservative behavior is to treat these as merges of the regions of // the src value and tgt addr CONSTANT_TRANSLATION(CopyAddrInst, Store) @@ -3328,7 +3328,7 @@ bool BlockPartitionState::recomputeExitFromEntry( transferringOpToStateMap); for (const auto &partitionOp : blockPartitionOps) { // By calling apply without providing any error handling callbacks, errors - // will be surpressed. will be suppressed + // will be suppressed. will be suppressed eval.apply(partitionOp); } REGIONBASEDISOLATION_LOG(llvm::dbgs() << " Working Partition: "; diff --git a/lib/SILOptimizer/Differentiation/JVPCloner.cpp b/lib/SILOptimizer/Differentiation/JVPCloner.cpp index 8e5d1c81dbb72..37dca13299981 100644 --- a/lib/SILOptimizer/Differentiation/JVPCloner.cpp +++ b/lib/SILOptimizer/Differentiation/JVPCloner.cpp @@ -1447,8 +1447,8 @@ JVPCloner::~JVPCloner() { delete &impl; } void JVPCloner::Implementation::initializeDifferentialTupleElements( SILBasicBlock *origBB, SILInstructionResultArray values) { - auto *diffTupleTyple = differentialInfo.getLinearMapTupleType(origBB); - assert(diffTupleTyple->getNumElements() == values.size() && + auto *diffTupleType = differentialInfo.getLinearMapTupleType(origBB); + assert(diffTupleType->getNumElements() == values.size() && "The number of differential tuple fields must equal the number of " "differential struct element values"); auto res = differentialTupleElements.insert({origBB, values}); diff --git a/lib/SILOptimizer/Differentiation/LinearMapInfo.cpp b/lib/SILOptimizer/Differentiation/LinearMapInfo.cpp index 2a1627d8ff923..679a305187d67 100644 --- a/lib/SILOptimizer/Differentiation/LinearMapInfo.cpp +++ b/lib/SILOptimizer/Differentiation/LinearMapInfo.cpp @@ -348,7 +348,7 @@ void LinearMapInfo::generateDifferentiationDataStructures( // // Now we need to be very careful as we're having a very subtle // chicken-and-egg problem. We need lowered branch trace enum type for the - // linear map typle type. However branch trace enum type lowering depends on + // linear map tuple type. However branch trace enum type lowering depends on // the lowering of its elements (at very least, the type classification of // being trivial / non-trivial). As the lowering is cached we need to ensure // we compute lowered type for the branch trace enum when the corresponding diff --git a/lib/SILOptimizer/Differentiation/PullbackCloner.cpp b/lib/SILOptimizer/Differentiation/PullbackCloner.cpp index bfb6ebef88c46..ada6c12e7cd50 100644 --- a/lib/SILOptimizer/Differentiation/PullbackCloner.cpp +++ b/lib/SILOptimizer/Differentiation/PullbackCloner.cpp @@ -169,8 +169,8 @@ class PullbackCloner::Implementation final void initializePullbackTupleElements(SILBasicBlock *origBB, SILInstructionResultArray values) { - auto *pbTupleTyple = getPullbackInfo().getLinearMapTupleType(origBB); - assert(pbTupleTyple->getNumElements() == values.size() && + auto *pbTupleType = getPullbackInfo().getLinearMapTupleType(origBB); + assert(pbTupleType->getNumElements() == values.size() && "The number of pullback tuple fields must equal the number of " "pullback tuple element values"); auto res = pullbackTupleElements.insert({origBB, { values.begin(), values.end() }}); @@ -180,8 +180,8 @@ class PullbackCloner::Implementation final void initializePullbackTupleElements(SILBasicBlock *origBB, const llvm::ArrayRef &values) { - auto *pbTupleTyple = getPullbackInfo().getLinearMapTupleType(origBB); - assert(pbTupleTyple->getNumElements() == values.size() && + auto *pbTupleType = getPullbackInfo().getLinearMapTupleType(origBB); + assert(pbTupleType->getNumElements() == values.size() && "The number of pullback tuple fields must equal the number of " "pullback tuple element values"); auto res = pullbackTupleElements.insert({origBB, { values.begin(), values.end() }}); diff --git a/lib/SILOptimizer/Differentiation/VJPCloner.cpp b/lib/SILOptimizer/Differentiation/VJPCloner.cpp index 2eb0eefea0709..d3ccbb4dd66c4 100644 --- a/lib/SILOptimizer/Differentiation/VJPCloner.cpp +++ b/lib/SILOptimizer/Differentiation/VJPCloner.cpp @@ -1253,7 +1253,7 @@ SILFunction *VJPCloner::Implementation::createEmptyPullback() { } if (pullbackInfo.hasHeapAllocatedContext()) { - // Accept a `AutoDiffLinarMapContext` heap object if there are loops. + // Accept a `AutoDiffLinearMapContext` heap object if there are loops. pbParams.push_back({ getASTContext().TheNativeObjectType, ParameterConvention::Direct_Guaranteed diff --git a/lib/SILOptimizer/IPO/ClosureSpecializer.cpp b/lib/SILOptimizer/IPO/ClosureSpecializer.cpp index 80fab2a69ef16..e5e3067053fc9 100644 --- a/lib/SILOptimizer/IPO/ClosureSpecializer.cpp +++ b/lib/SILOptimizer/IPO/ClosureSpecializer.cpp @@ -96,7 +96,7 @@ STATISTIC(NumPropagatedClosuresNotEliminated, llvm::cl::opt EliminateDeadClosures( "closure-specialize-eliminate-dead-closures", llvm::cl::init(true), llvm::cl::desc("Do not eliminate dead closures after closure " - "specialization. This is meant ot be used when testing.")); + "specialization. This is meant to be used when testing.")); //===----------------------------------------------------------------------===// // Utility @@ -1147,7 +1147,7 @@ static void markReabstractionPartialApplyAsUsed( return markReabstractionPartialApplyAsUsed(FirstClosure, MD->getValue(), UsedReabstractionClosure); } - llvm_unreachable("Unexpect instruction"); + llvm_unreachable("Unexpected instruction"); } /// Returns true if the \p closureArgIdx argument of \p callee is called in diff --git a/lib/SILOptimizer/IPO/CrossModuleOptimization.cpp b/lib/SILOptimizer/IPO/CrossModuleOptimization.cpp index d2c6604d6208b..f737205111f70 100644 --- a/lib/SILOptimizer/IPO/CrossModuleOptimization.cpp +++ b/lib/SILOptimizer/IPO/CrossModuleOptimization.cpp @@ -211,7 +211,7 @@ bool CrossModuleOptimization::isPackageOrPublic(AccessLevel accessLevel) { /// is otherwise illegal. It's also used to determine during SIL deserialization whether /// loadable types in a serialized function can be allowed in the client module that /// imports the module built with Package CMO. If the client contains a [serialized] -/// function due to `@inlinable`, funtions with [serialized_for_package] from +/// function due to `@inlinable`, functions with [serialized_for_package] from /// the imported module are not allowed being inlined into the client function, which /// is the correct behavior. bool CrossModuleOptimization::isSerializedWithRightKind(const SILModule &mod, @@ -291,7 +291,7 @@ void CrossModuleOptimization::trySerializeFunctions( } void CrossModuleOptimization::serializeFunctionsInModule(SILPassManager *manager) { - // Reorder SIL funtions in the module bottom up so we can serialize + // Reorder SIL functions in the module bottom up so we can serialize // the most nested referenced functions first and avoid unnecessary // recursive checks. BasicCalleeAnalysis *BCA = manager->getAnalysis(); @@ -318,7 +318,7 @@ void CrossModuleOptimization::serializeWitnessTablesInModule() { // references. If they are serialized, they are set to // a shared linkage. If they can't be serialized, we set // the linkage to package so that the witness table itself - // can still be serialized, thus giving a chance for entires + // can still be serialized, thus giving a chance for entries // that _are_ serialized to be accessed directly. for (const SILWitnessTable::Entry &entry: unserializedWTMethodRange) { if (entry.getMethodWitness().Witness->getLinkage() == SILLinkage::Private) @@ -835,7 +835,7 @@ void CrossModuleOptimization::makeDeclUsableFromInline(ValueDecl *decl) { // resulting in an internal type getting @usableFromInline, which is // incorrect. // For example, for `let q = P() as? Q`, where Q is an internal class - // inherting a public class P, Q is not visited in the canSerialize* + // inheriting a public class P, Q is not visited in the canSerialize* // checks, thus resulting in `@usableFromInline class Q`; this is not // the intended behavior in the conservative mode as it modifies AST. // diff --git a/lib/SILOptimizer/LoopTransforms/ForEachLoopUnroll.cpp b/lib/SILOptimizer/LoopTransforms/ForEachLoopUnroll.cpp index 5db55087240c3..ebf0dae6de609 100644 --- a/lib/SILOptimizer/LoopTransforms/ForEachLoopUnroll.cpp +++ b/lib/SILOptimizer/LoopTransforms/ForEachLoopUnroll.cpp @@ -31,7 +31,7 @@ // - There are no forEach calls on the array. // - The array is too large to unroll forEach calls. This check uses // SILModule::UnrollThreshold parameter. -// If none of the above conditions hold, procede to unrolling every forEach +// If none of the above conditions hold, proceed to unrolling every forEach // call on the array (Step 3). Step 2 is implemented in the function: // `tryUnrollForEachCallsOverArrayLiteral`. // diff --git a/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp b/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp index 8cfc50b28a833..deab6dbfeb9b9 100644 --- a/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp +++ b/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp @@ -2251,12 +2251,12 @@ bool LifetimeChecker::diagnoseReturnWithoutInitializingStoredProperties( const StructDecl *theStruct = selfTy->getStructOrBoundGenericStruct(); assert(theStruct); - bool fullyUnitialized; - (void)isInitializedAtUse(Use, nullptr, nullptr, &fullyUnitialized); + bool fullyUninitialized; + (void)isInitializedAtUse(Use, nullptr, nullptr, &fullyUninitialized); diagnose(Module, loc, diag::designated_init_in_cross_module_extension, - selfTy, !fullyUnitialized, + selfTy, !fullyUninitialized, theStruct->getParentModule()->getName(), theStruct->hasClangNode()); } else { diff --git a/lib/SILOptimizer/Mandatory/DiagnoseLifetimeIssues.cpp b/lib/SILOptimizer/Mandatory/DiagnoseLifetimeIssues.cpp index cf7af2628a892..0516b9056c161 100644 --- a/lib/SILOptimizer/Mandatory/DiagnoseLifetimeIssues.cpp +++ b/lib/SILOptimizer/Mandatory/DiagnoseLifetimeIssues.cpp @@ -60,7 +60,7 @@ class DiagnoseLifetimeIssues { IsStoredWeakly }; - /// To avoid quadratic complexity in the rare corener case of very deep + /// To avoid quadratic complexity in the rare corner case of very deep /// callgraphs, with pass down references. static constexpr int maxCallDepth = 8; diff --git a/lib/SILOptimizer/Mandatory/DiagnoseUnreachable.cpp b/lib/SILOptimizer/Mandatory/DiagnoseUnreachable.cpp index 5a77b142ed65c..42a90e0904885 100644 --- a/lib/SILOptimizer/Mandatory/DiagnoseUnreachable.cpp +++ b/lib/SILOptimizer/Mandatory/DiagnoseUnreachable.cpp @@ -935,7 +935,7 @@ static bool eliminateSwitchDispatchOnUnavailableElements( // Since at least one case was removed, we need to add a default case that // traps if there isn't already an existing default case. The resulting SIL // will have a structure that matches what SILGen would have produced for a - // switch statment that was written in source with unavailable cases + // switch statement that was written in source with unavailable cases // unhandled. SILBasicBlock *DefaultBB = SWI.getDefaultBBOrNull().getPtrOrNull(); bool DidCreateDefault = false; diff --git a/lib/SILOptimizer/Mandatory/FlowIsolation.cpp b/lib/SILOptimizer/Mandatory/FlowIsolation.cpp index 26cd098062d61..d55c8d15545c1 100644 --- a/lib/SILOptimizer/Mandatory/FlowIsolation.cpp +++ b/lib/SILOptimizer/Mandatory/FlowIsolation.cpp @@ -698,7 +698,7 @@ void AnalysisInfo::analyze(const SILArgument *selfParam) { break; } - // Look through certian kinds of single-value instructions. + // Look through certain kinds of single-value instructions. case SILInstructionKind::CopyValueInst: // TODO: If we had some actual escape analysis information, we could // avoid marking a trivial copy as a nonisolated use, since it doesn't diff --git a/lib/SILOptimizer/Mandatory/IRGenPrepare.cpp b/lib/SILOptimizer/Mandatory/IRGenPrepare.cpp index 3cd326141d311..521332234d3a5 100644 --- a/lib/SILOptimizer/Mandatory/IRGenPrepare.cpp +++ b/lib/SILOptimizer/Mandatory/IRGenPrepare.cpp @@ -14,7 +14,7 @@ /// /// Cleanup SIL to make it suitable for IRGen. /// -/// We perform the following canonicalizations: +/// We perform the following canonicalization: /// /// 1. We remove calls to Builtin.poundAssert() and Builtin.staticReport(), /// which are not needed post SIL. diff --git a/lib/SILOptimizer/Mandatory/MoveOnlyAddressCheckerUtils.cpp b/lib/SILOptimizer/Mandatory/MoveOnlyAddressCheckerUtils.cpp index aefd6517832e7..b22ce38521486 100644 --- a/lib/SILOptimizer/Mandatory/MoveOnlyAddressCheckerUtils.cpp +++ b/lib/SILOptimizer/Mandatory/MoveOnlyAddressCheckerUtils.cpp @@ -3194,7 +3194,7 @@ void MoveOnlyAddressCheckerPImpl::insertDestroysOnBoundary( << " Lifetime ending use! Recording final consume!\n"); // If we have a consuming use, when we stop at the consuming use we want // the value to still be around. We only want the value to be - // invalidated once the consume operation has occured. Thus we always + // invalidated once the consume operation has occurred. Thus we always // place the debug_value undef strictly after the consuming operation. if (auto *ti = dyn_cast(inst)) { for (auto *succBlock : ti->getSuccessorBlocks()) { @@ -3293,7 +3293,7 @@ void MoveOnlyAddressCheckerPImpl::insertDestroysOnBoundary( // check was an init but not consumable, then do not destroy that // def. This is b/c we are in some sort of class initialization and we are // looking at the initial part of the live range before the initialization - // has occured. This is our way of makinmg this fit the model that the + // has occurred. This is our way of makinmg this fit the model that the // checker expects (which is that values are always initialized at the def // point). if (markedValue && markedValue->getCheckKind() == @@ -3432,7 +3432,7 @@ void MoveOnlyAddressCheckerPImpl::rewriteUses( // destroy_value and use then to create a new load_borrow scope. SILBuilderWithScope builder(li); auto *lbi = builder.createLoadBorrow(li->getLoc(), li->getOperand()); - // We use this auxillary list to avoid iterator invalidation of + // We use this auxiliary list to avoid iterator invalidation of // li->getConsumingUse(); StackList toDelete(lbi->getFunction()); for (auto *consumeUse : li->getConsumingUses()) { diff --git a/lib/SILOptimizer/Mandatory/MoveOnlyBorrowToDestructureUtils.cpp b/lib/SILOptimizer/Mandatory/MoveOnlyBorrowToDestructureUtils.cpp index 730cc68bcabd3..9903757d01c7e 100644 --- a/lib/SILOptimizer/Mandatory/MoveOnlyBorrowToDestructureUtils.cpp +++ b/lib/SILOptimizer/Mandatory/MoveOnlyBorrowToDestructureUtils.cpp @@ -1480,7 +1480,7 @@ void Implementation::cleanup() { while (!interface.createdPhiArguments.empty()) { auto *arg = interface.createdPhiArguments.pop_back_val(); - // If we have a trivial argument, we do not ened to add any compensating + // If we have a trivial argument, we do not need to add any compensating // destroys. if (arg->getType().isTrivial(*fn)) continue; @@ -1655,7 +1655,7 @@ bool BorrowToDestructureTransform::transform() { impl.blockToAvailableValues.emplace(impl.liveness); impl.rewriteUses(); - // Now that we have done our rewritting, we need to do a few cleanups starting + // Now that we have done our rewriting, we need to do a few cleanups starting // by inserting compensating destroys for all of our inserted // phis/destructures/initial value copy. impl.cleanup(); diff --git a/lib/SILOptimizer/Mandatory/MoveOnlyDiagnostics.h b/lib/SILOptimizer/Mandatory/MoveOnlyDiagnostics.h index b2099b893f930..8fdbe9a59ccc9 100644 --- a/lib/SILOptimizer/Mandatory/MoveOnlyDiagnostics.h +++ b/lib/SILOptimizer/Mandatory/MoveOnlyDiagnostics.h @@ -48,7 +48,7 @@ class DiagnosticEmitter { /// A count of the total diagnostics emitted so that callers of routines that /// take a diagnostic emitter can know if the emitter emitted additional - /// diagnosics while running a callee. + /// diagnostics while running a callee. unsigned diagnosticCount = 0; bool emittedCheckerDoesntUnderstandDiagnostic = false; diff --git a/lib/SILOptimizer/Mandatory/OSLogOptimization.cpp b/lib/SILOptimizer/Mandatory/OSLogOptimization.cpp index ca6b3e2fbe89e..429148be5c85d 100644 --- a/lib/SILOptimizer/Mandatory/OSLogOptimization.cpp +++ b/lib/SILOptimizer/Mandatory/OSLogOptimization.cpp @@ -808,7 +808,7 @@ getEndPointsOfDataDependentChain(SingleValueInstruction *value, SILFunction *fun SmallVector transitiveUsers; // Get transitive users of value, ignoring use-def chain going through // branches. These transitive users define the end points of the constant - // evaluation. Igoring use-def chains through branches causes constant + // evaluation. Ignoring use-def chains through branches causes constant // evaluation to miss some constant folding opportunities. This can be // relaxed in the future, if necessary. getTransitiveUsers(value, transitiveUsers); diff --git a/lib/SILOptimizer/Mandatory/PerformanceDiagnostics.cpp b/lib/SILOptimizer/Mandatory/PerformanceDiagnostics.cpp index cdcf43f93bea0..97c5efb2ea509 100644 --- a/lib/SILOptimizer/Mandatory/PerformanceDiagnostics.cpp +++ b/lib/SILOptimizer/Mandatory/PerformanceDiagnostics.cpp @@ -73,7 +73,7 @@ class PerformanceDiagnostics { struct LocWithParent { SourceLoc loc; - /// Null if this is the top-leve location. + /// Null if this is the top-level location. LocWithParent *parent; LocWithParent(SourceLoc loc, LocWithParent *parent) : diff --git a/lib/SILOptimizer/Mandatory/PredictableMemOpt.cpp b/lib/SILOptimizer/Mandatory/PredictableMemOpt.cpp index 3f299b5bc5140..b6ab079dfb920 100644 --- a/lib/SILOptimizer/Mandatory/PredictableMemOpt.cpp +++ b/lib/SILOptimizer/Mandatory/PredictableMemOpt.cpp @@ -578,7 +578,7 @@ bool AvailableValueAggregator::canTake(SILType loadTy, }); } - // Otherwise, fail. The value is not fully available at its leafs. We can not + // Otherwise, fail. The value is not fully available at its leaves. We can not // perform a take. return false; } @@ -1379,7 +1379,7 @@ class AvailableValueDataflowContext { /// Try to compute available values for "TheMemory" at the instruction \p /// StartingFrom. We only compute the values for set bits in \p - /// RequiredElts. We return the vailable values in \p Result. If any available + /// RequiredElts. We return the available values in \p Result. If any available /// values were found, return true. Otherwise, return false. bool computeAvailableValues(SILInstruction *StartingFrom, unsigned FirstEltOffset, diff --git a/lib/SILOptimizer/Mandatory/TransferNonSendable.cpp b/lib/SILOptimizer/Mandatory/TransferNonSendable.cpp index 19e8681c01fa0..713c7dc2b0282 100644 --- a/lib/SILOptimizer/Mandatory/TransferNonSendable.cpp +++ b/lib/SILOptimizer/Mandatory/TransferNonSendable.cpp @@ -443,7 +443,7 @@ void RequireLiveness::process(Collection requireInstList) { // the transferInst... processDefBlock(); - // If we found /any/ requries after the transferInst, we can bail early since + // If we found /any/ requires after the transferInst, we can bail early since // that is guaranteed to dominate all further requires. if (!finalRequires.empty()) { REGIONBASEDISOLATION_LOG( @@ -1685,7 +1685,7 @@ class TransferNonTransferrableDiagnosticInferrer { /// Gathers diagnostics. Returns false if we emitted a "I don't understand /// error". If we emit such an error, we should bail without emitting any /// further diagnostics, since we may not have any diagnostics or be in an - /// inconcistent state. + /// inconsistent state. bool run(); private: diff --git a/lib/SILOptimizer/PassManager/PassManager.cpp b/lib/SILOptimizer/PassManager/PassManager.cpp index 397ac6fa1e666..c430a0f6bd56d 100644 --- a/lib/SILOptimizer/PassManager/PassManager.cpp +++ b/lib/SILOptimizer/PassManager/PassManager.cpp @@ -1614,7 +1614,7 @@ llvm::cl::list llvm::cl::desc("Simplify instruction of specified kind(s)")); #ifdef PURE_BRIDGING_MODE -// In PURE_BRIDGING_MODE, briding functions are not inlined and therefore inluded in the cpp file. +// In PURE_BRIDGING_MODE, briding functions are not inlined and therefore included in the cpp file. #include "swift/SILOptimizer/OptimizerBridgingImpl.h" #endif diff --git a/lib/SILOptimizer/SILCombiner/SILCombinerCastVisitors.cpp b/lib/SILOptimizer/SILCombiner/SILCombinerCastVisitors.cpp index f5fad794cc4e4..e410288b2a1f3 100644 --- a/lib/SILOptimizer/SILCombiner/SILCombinerCastVisitors.cpp +++ b/lib/SILOptimizer/SILCombiner/SILCombinerCastVisitors.cpp @@ -68,7 +68,7 @@ SILCombiner::visitRefToRawPointerInst(RefToRawPointerInst *rrpi) { return urci->use_empty() ? eraseInstFromFunction(*urci) : nullptr; } - // Otherwise, we ened to use an unchecked_trivial_bit_cast insert it at + // Otherwise, we need to use an unchecked_trivial_bit_cast insert it at // urci. // // (ref_to_raw_pointer (unchecked_ref_cast x)) @@ -347,7 +347,7 @@ visitPointerToAddressInst(PointerToAddressInst *PTAI) { } } - // The rest of these canonicalizations optimize the code around + // The rest of these canonicalization optimize the code around // pointer_to_address by leave in a pointer_to_address meaning that we do not // need to worry about moving addresses out of interior pointer scopes. diff --git a/lib/SILOptimizer/SemanticARC/OwnedToGuaranteedPhiOpt.cpp b/lib/SILOptimizer/SemanticARC/OwnedToGuaranteedPhiOpt.cpp index f5eb05f87997f..6ec1b398a8351 100644 --- a/lib/SILOptimizer/SemanticARC/OwnedToGuaranteedPhiOpt.cpp +++ b/lib/SILOptimizer/SemanticARC/OwnedToGuaranteedPhiOpt.cpp @@ -225,7 +225,7 @@ bool swift::semanticarc::tryConvertOwnedPhisToGuaranteedPhis(Context &ctx) { // results since we are deleting one of our stashed values. auto iter = find(originalIncomingValues, cvi); if (iter != originalIncomingValues.end()) { - // We use an auxillary array here so we can continue to bisect on + // We use an auxiliary array here so we can continue to bisect on // original incoming values. Once we are done processing here, we will // not need that property anymore. unsigned updateOffset = diff --git a/lib/SILOptimizer/SemanticARC/SemanticARCOpts.cpp b/lib/SILOptimizer/SemanticARC/SemanticARCOpts.cpp index a773c140f2ca9..ec2021ed3eb0c 100644 --- a/lib/SILOptimizer/SemanticARC/SemanticARCOpts.cpp +++ b/lib/SILOptimizer/SemanticARC/SemanticARCOpts.cpp @@ -31,7 +31,7 @@ static llvm::cl::list TransformsToPerform( llvm::cl::values( clEnumValN(ARCTransformKind::AllPeepholes, "sil-semantic-arc-peepholes-all", - "Perform All ARC canonicalizations and peepholes"), + "Perform All ARC canonicalization and peepholes"), clEnumValN(ARCTransformKind::LoadCopyToLoadBorrowPeephole, "sil-semantic-arc-peepholes-loadcopy-to-loadborrow", "Perform the load [copy] to load_borrow peephole"), diff --git a/lib/SILOptimizer/Transforms/ARCCodeMotion.cpp b/lib/SILOptimizer/Transforms/ARCCodeMotion.cpp index 58d4769043585..aba4cd17f7a77 100644 --- a/lib/SILOptimizer/Transforms/ARCCodeMotion.cpp +++ b/lib/SILOptimizer/Transforms/ARCCodeMotion.cpp @@ -1257,7 +1257,7 @@ class ARCCodeMotion : public SILFunctionTransform { } if (EdgeChanged) { - // We splitted critical edges. + // We split critical edges. invalidateAnalysis(SILAnalysis::InvalidationKind::FunctionBody); return; } diff --git a/lib/SILOptimizer/Transforms/AccessEnforcementDom.cpp b/lib/SILOptimizer/Transforms/AccessEnforcementDom.cpp index e49aca5416515..5ee091099f675 100644 --- a/lib/SILOptimizer/Transforms/AccessEnforcementDom.cpp +++ b/lib/SILOptimizer/Transforms/AccessEnforcementDom.cpp @@ -136,7 +136,7 @@ class DominatedAccessAnalysis { private: // The data flow state for each block. It is only valid between the time at - // least one predecesor block has been finished and before its own block + // least one predecessor block has been finished and before its own block // has been finished. // // The isBottom flag allows the analysis to avoid quadratic behavior where diff --git a/lib/SILOptimizer/Transforms/AccessEnforcementOpts.cpp b/lib/SILOptimizer/Transforms/AccessEnforcementOpts.cpp index 8c515f5489010..ba46d9a86319b 100644 --- a/lib/SILOptimizer/Transforms/AccessEnforcementOpts.cpp +++ b/lib/SILOptimizer/Transforms/AccessEnforcementOpts.cpp @@ -1157,7 +1157,7 @@ struct AccessEnforcementOpts : public SILFunctionTransform { invalidateAnalysis(SILAnalysis::InvalidationKind::Instructions); // Perform the access merging - // The inital version of the optimization requires a postDomTree + // The initial version of the optimization requires a postDomTree PostDominanceAnalysis *postDomAnalysis = getAnalysis(); PostDominanceInfo *postDomTree = postDomAnalysis->get(F); diff --git a/lib/SILOptimizer/Transforms/CSE.cpp b/lib/SILOptimizer/Transforms/CSE.cpp index 79b4f7b633156..a0f320aa28e2b 100644 --- a/lib/SILOptimizer/Transforms/CSE.cpp +++ b/lib/SILOptimizer/Transforms/CSE.cpp @@ -94,7 +94,7 @@ SILValue tryLookThroughOwnershipInsts(const Operand *op) { // OSSA RAUW does not lifetime extend base value for an escaped value. // Don't look through ownership instructions for such values. - // Theoritically, it should be possible to look through ownership instructions + // Theoretically, it should be possible to look through ownership instructions // for a bitwise escape, barring any dependent instructions like // mark_dependence. Not doing it here to be conservative. if (opOwnership == OperandOwnership::PointerEscape || diff --git a/lib/SILOptimizer/Transforms/DestroyAddrHoisting.cpp b/lib/SILOptimizer/Transforms/DestroyAddrHoisting.cpp index a1009241b0bb0..b819e2ab58284 100644 --- a/lib/SILOptimizer/Transforms/DestroyAddrHoisting.cpp +++ b/lib/SILOptimizer/Transforms/DestroyAddrHoisting.cpp @@ -750,7 +750,7 @@ bool HoistDestroys::checkFoldingBarrier( // We found a relevant instruction that is operating on a projection out // of the root storage which would be folded if folding were possible. // Find its nontrivial product leaves and remove them from the set of - // leaves of the root storage which we're wating to see. + // leaves of the root storage which we're waiting to see. bool alreadySawLeaf = false; bool alreadySawTrivialSubleaf = false; auto succeeded = visitProductLeafAccessPathNodes( diff --git a/lib/SILOptimizer/Transforms/SILMem2Reg.cpp b/lib/SILOptimizer/Transforms/SILMem2Reg.cpp index a2f3d4d9bf153..76021faf89219 100644 --- a/lib/SILOptimizer/Transforms/SILMem2Reg.cpp +++ b/lib/SILOptimizer/Transforms/SILMem2Reg.cpp @@ -462,7 +462,7 @@ static bool isAddressForLoad(SILInstruction *load, SILBasicBlock *&singleBlock, // transformed into a sequence of destructure instructions, followed by a // sequence of structure instructions where all the original values are // kept in place but the taken value is "knocked out" and replaced with - // undef. The running value would then be set to the newly structed + // undef. The running value would then be set to the newly structured // "knockout" value. // // Alternatively, a new copy of the running value could be created and a new diff --git a/lib/SILOptimizer/Transforms/StringOptimization.cpp b/lib/SILOptimizer/Transforms/StringOptimization.cpp index bb64c45981197..0d4684dde70e6 100644 --- a/lib/SILOptimizer/Transforms/StringOptimization.cpp +++ b/lib/SILOptimizer/Transforms/StringOptimization.cpp @@ -79,7 +79,7 @@ class StringOptimization { /// Caches the analysis result for an alloc_stack or an inout function /// argument, whether it is an "identifiable" object. - /// See mayWriteToIdentifyableObject(). + /// See mayWriteToIdentifiableObject(). llvm::DenseMap identifiableObjectsCache; public: @@ -97,7 +97,7 @@ class StringOptimization { static ApplyInst *isSemanticCall(SILInstruction *inst, StringRef attr, unsigned numArgs); - StoreInst *isStringStoreToIdentifyableObject(SILInstruction *inst); + StoreInst *isStringStoreToIdentifiableObject(SILInstruction *inst); static void invalidateModifiedObjects(SILInstruction *inst, llvm::DenseMap &storedStrings); static StringInfo getStringInfo(SILValue value); @@ -136,7 +136,7 @@ bool StringOptimization::optimizeBlock(SILBasicBlock &block) { for (auto iter = block.begin(); iter != block.end();) { SILInstruction *inst = &*iter++; - if (StoreInst *store = isStringStoreToIdentifyableObject(inst)) { + if (StoreInst *store = isStringStoreToIdentifiableObject(inst)) { storedStrings[store->getDest()] = store->getSrc(); continue; } @@ -405,7 +405,7 @@ ApplyInst *StringOptimization::isSemanticCall(SILInstruction *inst, /// let the object address escape in some unexpected way (like address /// projections), we'll just ignore that object and will not treat it as /// "identifiable" object. -static bool mayWriteToIdentifyableObject(SILInstruction *inst) { +static bool mayWriteToIdentifiableObject(SILInstruction *inst) { // For simplicity, only handle store and apply. This is sufficient for most // case, especially for string interpolation. return isa(inst) || isa(inst); @@ -414,7 +414,7 @@ static bool mayWriteToIdentifyableObject(SILInstruction *inst) { /// Returns the store instruction if \p inst is a store of a String to an /// identifiable object. StoreInst *StringOptimization:: -isStringStoreToIdentifyableObject(SILInstruction *inst) { +isStringStoreToIdentifiableObject(SILInstruction *inst) { auto *store = dyn_cast(inst); if (!store) return nullptr; @@ -446,7 +446,7 @@ isStringStoreToIdentifyableObject(SILInstruction *inst) { break; LLVM_FALLTHROUGH; default: - if (!mayWriteToIdentifyableObject(user)) { + if (!mayWriteToIdentifiableObject(user)) { // We don't handle user. It is some instruction which may write to // destAddr or let destAddr "escape" (like an address projection). identifiableObjectsCache[destAddr] = false; @@ -466,8 +466,8 @@ void StringOptimization::invalidateModifiedObjects(SILInstruction *inst, // Ignore non-writing instructions, like "load", "dealloc_stack". // Note that identifiable objects (= keys in storedStrings) can only have // certain kind of instructions as users: all instruction which we handle in - // isStringStoreToIdentifyableObject(). - if (!mayWriteToIdentifyableObject(inst)) + // isStringStoreToIdentifiableObject(). + if (!mayWriteToIdentifiableObject(inst)) return; for (Operand &op : inst->getAllOperands()) { @@ -588,7 +588,7 @@ StringOptimization::getStringFromStaticLet(SILValue value) { if (globalAddr) { // The global accessor is inlined. - // Usually the global_addr is immediately preceeded by a call to + // Usually the global_addr is immediately preceded by a call to // `builtin "once"` which initializes the global. SILInstruction *prev = globalAddr->getPreviousInstruction(); if (!prev) diff --git a/lib/SILOptimizer/Transforms/TempRValueElimination.cpp b/lib/SILOptimizer/Transforms/TempRValueElimination.cpp index 0d5666f7b784e..2cff80f85b976 100644 --- a/lib/SILOptimizer/Transforms/TempRValueElimination.cpp +++ b/lib/SILOptimizer/Transforms/TempRValueElimination.cpp @@ -405,7 +405,7 @@ bool TempRValueOptPass::extendAccessScopes( if (aa->mayAlias(copySrc, endAccess->getSource()) && // There cannot be any aliasing modifying accesses within the - // liverange of the temporary, because we would have cought this in + // liverange of the temporary, because we would have caught this in // `getLastUseWhileSourceIsNotModified`. // But there are cases where `AliasAnalysis::isNoAlias` is less // precise than `AliasAnalysis::mayWriteToMemory`. Therefore, just @@ -962,7 +962,7 @@ void TempRValueOptPass::run() { invalidateAnalysis(SILAnalysis::InvalidationKind::Instructions); } - // Call the utlity to complete ossa lifetime. + // Call the utility to complete ossa lifetime. OSSALifetimeCompletion completion(function, da->get(function), deBlocks); for (auto it : valuesToComplete) { completion.completeOSSALifetime(it, diff --git a/lib/SILOptimizer/Utils/CFGOptUtils.cpp b/lib/SILOptimizer/Utils/CFGOptUtils.cpp index 1b4d7599f0c0c..47c354736df73 100644 --- a/lib/SILOptimizer/Utils/CFGOptUtils.cpp +++ b/lib/SILOptimizer/Utils/CFGOptUtils.cpp @@ -295,7 +295,7 @@ SILBasicBlock *swift::splitBasicBlockAndBranch(SILBuilder &builder, auto origBBDTNode = domInfo->getNode(origBB); if (origBBDTNode) { // Change the immediate dominators of the children of the block we - // splitted to the splitted block. + // split to the split block. SmallVector Adoptees(origBBDTNode->begin(), origBBDTNode->end()); diff --git a/lib/SILOptimizer/Utils/CanonicalizeInstruction.cpp b/lib/SILOptimizer/Utils/CanonicalizeInstruction.cpp index 42e9c1c220b94..772cfbdce857f 100644 --- a/lib/SILOptimizer/Utils/CanonicalizeInstruction.cpp +++ b/lib/SILOptimizer/Utils/CanonicalizeInstruction.cpp @@ -402,7 +402,7 @@ broadenSingleElementStores(StoreInst *storeInst, // If the struct is a move-only type, even though the single element in // the struct is trivial, the struct would be non-trivial. In this case, we - // need a much more compelx analysis to determine the store ownership + // need a much more complex analysis to determine the store ownership // qualifier. Such an analysis is not suitable in the canonicalize pass. So, // bail out. if (baseAddrType.isMoveOnly()) { diff --git a/lib/SILOptimizer/Utils/CanonicalizeOSSALifetime.cpp b/lib/SILOptimizer/Utils/CanonicalizeOSSALifetime.cpp index ea75c13055b03..3a4e17463d469 100644 --- a/lib/SILOptimizer/Utils/CanonicalizeOSSALifetime.cpp +++ b/lib/SILOptimizer/Utils/CanonicalizeOSSALifetime.cpp @@ -28,7 +28,7 @@ /// /// 4. Find the "extended" boundary of liveness by walking out from the boundary /// computed by PrunedLiveness out to destroys which aren't separated from -/// the original destory by "interesting" instructions. +/// the original destroy by "interesting" instructions. /// /// 5. Initializes `consumes` and inserts new destroy_value instructions. /// diff --git a/lib/SILOptimizer/Utils/ConstExpr.cpp b/lib/SILOptimizer/Utils/ConstExpr.cpp index 8cd60a4f018f2..850b3e1f5bb8d 100644 --- a/lib/SILOptimizer/Utils/ConstExpr.cpp +++ b/lib/SILOptimizer/Utils/ConstExpr.cpp @@ -1145,7 +1145,7 @@ ConstExprFunctionState::computeWellKnownCallResult(ApplyInst *apply, return getUnknown(evaluator, apply, UnknownReason::InvalidOperandValue); } - // Replace all precent symbol (%) in the string with double percents (%%) + // Replace all percent symbol (%) in the string with double percents (%%) StringRef stringVal = stringArgument.getStringValue(); SmallString<4> percentEscapedString; for (auto charElem : stringVal) { diff --git a/lib/SILOptimizer/Utils/ConstantFolding.cpp b/lib/SILOptimizer/Utils/ConstantFolding.cpp index 364d66e1c695b..2314b33b191b1 100644 --- a/lib/SILOptimizer/Utils/ConstantFolding.cpp +++ b/lib/SILOptimizer/Utils/ConstantFolding.cpp @@ -1835,7 +1835,7 @@ static bool isFoldable(SILInstruction *I) { isa(I); } -/// Given a buitin instruction calling globalStringTablePointer, check whether +/// Given a builtin instruction calling globalStringTablePointer, check whether /// the string passed to the builtin is constructed from a literal and if so, /// replace the uses of the builtin instruction with the string_literal inst. /// Otherwise, emit diagnostics if the function containing the builtin is not a diff --git a/lib/SILOptimizer/Utils/Existential.cpp b/lib/SILOptimizer/Utils/Existential.cpp index 64655b421c1ba..397f9b3e28a89 100644 --- a/lib/SILOptimizer/Utils/Existential.cpp +++ b/lib/SILOptimizer/Utils/Existential.cpp @@ -211,7 +211,7 @@ OpenedArchetypeInfo::OpenedArchetypeInfo(Operand &use) { // %instance if (auto *initI = getStackInitInst(instance, user, isOpenedValueCopied)) { // init_existential_addr isn't handled here because it isn't considered an - // "opened" archtype. init_existential_addr should be handled by + // "opened" archetype. init_existential_addr should be handled by // ConcreteExistentialInfo. if (auto *CAI = dyn_cast(initI)) @@ -440,9 +440,9 @@ void LLVM_ATTRIBUTE_USED OpenedArchetypeInfo::dump() const { llvm::dbgs() << "invalid OpenedArchetypeInfo\n"; return; } - llvm::dbgs() << "OpendArchetype: "; + llvm::dbgs() << "OpenedArchetype: "; OpenedArchetype->dump(llvm::dbgs()); - llvm::dbgs() << "OpendArchetypeValue: "; + llvm::dbgs() << "OpenedArchetypeValue: "; OpenedArchetypeValue->dump(); llvm::dbgs() << (isOpenedValueCopied ? "copied " : "") << "ExistentialValue: "; ExistentialValue->dump(); diff --git a/lib/SILOptimizer/Utils/InstOptUtils.cpp b/lib/SILOptimizer/Utils/InstOptUtils.cpp index 713eca8cccade..5512a2330a42e 100644 --- a/lib/SILOptimizer/Utils/InstOptUtils.cpp +++ b/lib/SILOptimizer/Utils/InstOptUtils.cpp @@ -2211,7 +2211,7 @@ bool swift::findUnreferenceableStorage(StructDecl *decl, SILType structType, if (decl->hasUnreferenceableStorage()) { return true; } - // Check if any fields have unreferenceable stoage + // Check if any fields have unreferenceable storage for (auto *field : decl->getStoredProperties()) { TypeExpansionContext tec = *func; auto fieldTy = structType.getFieldType(field, func->getModule(), tec); diff --git a/lib/SILOptimizer/Utils/InstructionDeleter.cpp b/lib/SILOptimizer/Utils/InstructionDeleter.cpp index 6e9e178a58101..e2b90d58a5dbd 100644 --- a/lib/SILOptimizer/Utils/InstructionDeleter.cpp +++ b/lib/SILOptimizer/Utils/InstructionDeleter.cpp @@ -125,7 +125,7 @@ static bool isScopeAffectingInstructionDead(SILInstruction *inst, // // FIXME: Even with fixLifetimes enabled, InstructionDeleter does not know // how to cleanup arguments captured by address. This should be as simple - // as inserting a destroy_addr. But the analagous code in + // as inserting a destroy_addr. But the analogous code in // tryDeleteDeadClosure() and keepArgsOfPartialApplyAlive() mysteriously // creates new alloc_stack's and invalidates stack nesting. So we // conservatively bail-out until we understand why that hack exists. diff --git a/lib/SILOptimizer/Utils/OwnershipOptUtils.cpp b/lib/SILOptimizer/Utils/OwnershipOptUtils.cpp index 66e89fef43208..608de06f4ac35 100644 --- a/lib/SILOptimizer/Utils/OwnershipOptUtils.cpp +++ b/lib/SILOptimizer/Utils/OwnershipOptUtils.cpp @@ -1313,7 +1313,7 @@ OwnershipRAUWHelper::OwnershipRAUWHelper(OwnershipFixupContext &inputCtx, // dominating its uses). // // Handling cases where the new value does not dominate the old borrow scope - // would require signficant complexity and such cases are currently impossible + // would require significant complexity and such cases are currently impossible // to test. Consideration would be required for handling a new value within an // inner loop, while the old borrow scope is introduced outside that // loop. Since it generally makes no sense to do this kind of replacement, diff --git a/lib/SILOptimizer/Utils/PartialApplyCombiner.cpp b/lib/SILOptimizer/Utils/PartialApplyCombiner.cpp index 1b2e8a10c5e0c..adf33c9104346 100644 --- a/lib/SILOptimizer/Utils/PartialApplyCombiner.cpp +++ b/lib/SILOptimizer/Utils/PartialApplyCombiner.cpp @@ -161,7 +161,7 @@ bool PartialApplyCombiner::copyArgsToTemporaries( void PartialApplyCombiner::processSingleApply(FullApplySite paiAI) { // The arguments of the final apply instruction. SmallVector argList; - // First, add the arguments of ther original ApplyInst args. + // First, add the arguments of their original ApplyInst args. for (auto Op : paiAI.getArguments()) argList.push_back(Op); diff --git a/lib/SILOptimizer/Utils/SILIsolationInfo.cpp b/lib/SILOptimizer/Utils/SILIsolationInfo.cpp index d33a38702f4f3..dec913be19415 100644 --- a/lib/SILOptimizer/Utils/SILIsolationInfo.cpp +++ b/lib/SILOptimizer/Utils/SILIsolationInfo.cpp @@ -211,7 +211,7 @@ inferIsolationInfoForTempAllocStack(AllocStackInst *asi) { state.asi = asi; AddressWalker walker(state); - // If we fail to walk, emit an unknown patten error. + // If we fail to walk, emit an unknown pattern error. if (AddressUseKind::Unknown == std::move(walker).walk(asi)) { return SILIsolationInfo(); } diff --git a/lib/SILOptimizer/Utils/VariableNameUtils.cpp b/lib/SILOptimizer/Utils/VariableNameUtils.cpp index eb793b06d28ee..9b85d415f79d8 100644 --- a/lib/SILOptimizer/Utils/VariableNameUtils.cpp +++ b/lib/SILOptimizer/Utils/VariableNameUtils.cpp @@ -302,7 +302,7 @@ SILValue VariableNameInferrer::findDebugInfoProvidingValuePhiArg( SILValue incomingValue, ValueSet &visitedValues) { // We use pushSnapShot to run recursively and if we fail to find a // value, we just pop our list to the last snapshot end of list. If we - // succeed, we do not pop and just return recusive value. Our user + // succeed, we do not pop and just return recursive value. Our user // will consume variableNamePath at this point. LLVM_DEBUG(llvm::dbgs() << "Before pushing a snap shot!\n"; variableNamePath.print(llvm::dbgs())); diff --git a/lib/Sema/AssociatedTypeInference.cpp b/lib/Sema/AssociatedTypeInference.cpp index d615f4ddfee64..7627906a5b38f 100644 --- a/lib/Sema/AssociatedTypeInference.cpp +++ b/lib/Sema/AssociatedTypeInference.cpp @@ -1290,7 +1290,7 @@ class TypeReprCycleCheckWalker : private ASTWalker { if (witness->hasInterfaceType()) return false; - // We call checkForPotentailCycle() multiple times with + // We call checkForPotentialCycle() multiple times with // different witnesses. found = false; this->witness = witness; diff --git a/lib/Sema/CSBindings.cpp b/lib/Sema/CSBindings.cpp index 86515b16e4a5f..160464d65e498 100644 --- a/lib/Sema/CSBindings.cpp +++ b/lib/Sema/CSBindings.cpp @@ -703,7 +703,7 @@ bool BindingSet::finalize( // Note that even though key path literal maybe be invalid it's // still the best course of action to use contextual function type // bindings because they allow to propagate type information from - // the key path into the context, so key path bindings are addded + // the key path into the context, so key path bindings are added // only if there is absolutely no other choice. if (updatedBindings.empty()) { auto rootTy = CS.getKeyPathRootType(keyPath); @@ -726,7 +726,7 @@ bool BindingSet::finalize( // If key path is structurally correct and has a resolved root // type, let's promote the fallback type into a binding because // root would have been inferred from explicit type already and - // it's benefitial for diagnostics to assign a non-placeholder + // it's beneficial for diagnostics to assign a non-placeholder // type to key path literal to propagate root/value to the context. if (!keyPath->hasSingleInvalidComponent() && (keyPath->getParsedRoot() || @@ -1321,7 +1321,7 @@ bool BindingSet::favoredOverDisjunction(Constraint *disjunction) const { return boundType->lookThroughAllOptionalTypes()->is(); } - // If this is a collection literal type, it's preferrable to bind it + // If this is a collection literal type, it's preferable to bind it // early (unless it's delayed) to connect all of its elements even // if it doesn't have any bindings. if (TypeVar->getImpl().isCollectionLiteralType()) @@ -2570,7 +2570,7 @@ TypeVariableBinding::fixForHole(ConstraintSystem &cs) const { } // Not being able to infer the type of a variable in a pattern binding // decl is more dramatic than anything that could happen inside the - // expression because we want to preferrably point the diagnostic to a + // expression because we want to preferably point the diagnostic to a // part of the expression that caused us to be unable to infer the // variable's type. ConstraintFix *fix = diff --git a/lib/Sema/CSDiagnostics.cpp b/lib/Sema/CSDiagnostics.cpp index fc1beeed7d75f..598d92e43649f 100644 --- a/lib/Sema/CSDiagnostics.cpp +++ b/lib/Sema/CSDiagnostics.cpp @@ -579,7 +579,7 @@ void RequirementFailure::maybeEmitRequirementNote(const Decl *anchor, Type lhs, if (req.getKind() == RequirementKind::SameShape) { // Same-shape requirements are broken down into two ShapeOf // constraints against the same type variable, so a failure is not - // necessarily ordered to match the original requriement. For now, + // necessarily ordered to match the original requirement. For now, // don't emit a note. return; } diff --git a/lib/Sema/CSSimplify.cpp b/lib/Sema/CSSimplify.cpp index d765f17b33abd..ac2b9593080d5 100644 --- a/lib/Sema/CSSimplify.cpp +++ b/lib/Sema/CSSimplify.cpp @@ -6790,7 +6790,7 @@ bool ConstraintSystem::repairFailures( std::tie(toObjectType, toUnwraps) = getObjectTypeAndNumUnwraps(rhs); // If the bound contextual type is more optional than the binding type, then - // propogate binding type to contextual type and attempt to solve. + // propagate binding type to contextual type and attempt to solve. if (fromUnwraps < toUnwraps) { (void)matchTypes(fromObjectType, toObjectType, ConstraintKind::Bind, TMF_ApplyingFix, locator); @@ -6828,7 +6828,7 @@ bool ConstraintSystem::repairFailures( break; } case ConstraintLocator::GlobalActorType: { - // Drop global actor element as it servers only to indentify the global + // Drop global actor element as it servers only to identify the global // actor matching. path.pop_back(); @@ -7186,12 +7186,12 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind, // match `$T3` and propagate `Pack{Int}` to `$T2`. // // This is also important for situations like: `$T2 conv (Int, $T_exp)` - // becuase expansion could be defaulted to an empty pack which means + // because expansion could be defaulted to an empty pack which means // that under substitution that element would disappear and the type // would be just `(Int)`. // // Notable exception here is `Any` which doesn't require wrapping and - // would be handled by existental promotion in cases where it's allowed. + // would be handled by existential promotion in cases where it's allowed. if (isTupleWithUnresolvedPackExpansion(origType1) || isTupleWithUnresolvedPackExpansion(origType2)) { if (desugar1->is() != desugar2->is() && @@ -7502,7 +7502,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind, } case TypeKind::DynamicSelf: - // FIXME: Deep equality? What is the rule between two DynamicSelfs? + // FIXME: Deep equality? What is the rule between two DynamicSelf? break; case TypeKind::Protocol: @@ -8765,7 +8765,7 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyConformsToConstraint( path.pop_back(); // This is similar to `PackElement` but locator points to the requirement - // associted with pack expansion pattern (i.e. `repeat each T: P`) where + // associated with pack expansion pattern (i.e. `repeat each T: P`) where // the path is something like: // `... -> type req # -> pack expansion pattern`. if (path.back().is()) @@ -10917,7 +10917,7 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyMemberConstraint( auto *baseExpr = memberRef->getBase(); // Handle `makeIterator` reference. if (getContextualTypePurpose(baseExpr) == CTP_ForEachSequence && - isRefTo(memberRef, ctx.Id_makeIterator, /*lables=*/{})) { + isRefTo(memberRef, ctx.Id_makeIterator, /*labels=*/{})) { auto *sequenceProto = cast( getContextualType(baseExpr, /*forConstraint=*/false) ->getAnyNominal()); @@ -13912,11 +13912,11 @@ ConstraintSystem::simplifyMaterializePackExpansionConstraint( auto formUnsolved = [&]() { // If we're supposed to generate constraints, do so. if (flags.contains(TMF_GenerateConstraints)) { - auto *explictGenericArgs = + auto *explicitGenericArgs = Constraint::create(*this, ConstraintKind::MaterializePackExpansion, type1, type2, getConstraintLocator(locator)); - addUnsolvedConstraint(explictGenericArgs); + addUnsolvedConstraint(explicitGenericArgs); return SolutionKind::Solved; } @@ -13943,11 +13943,11 @@ ConstraintSystem::simplifyExplicitGenericArgumentsConstraint( auto formUnsolved = [&]() { // If we're supposed to generate constraints, do so. if (flags.contains(TMF_GenerateConstraints)) { - auto *explictGenericArgs = + auto *explicitGenericArgs = Constraint::create(*this, ConstraintKind::ExplicitGenericArguments, type1, type2, getConstraintLocator(locator)); - addUnsolvedConstraint(explictGenericArgs); + addUnsolvedConstraint(explicitGenericArgs); return SolutionKind::Solved; } diff --git a/lib/Sema/CSSolver.cpp b/lib/Sema/CSSolver.cpp index 9beec72c44a59..76d0cdbfcee69 100644 --- a/lib/Sema/CSSolver.cpp +++ b/lib/Sema/CSSolver.cpp @@ -2519,9 +2519,9 @@ Constraint *ConstraintSystem::selectConjunction() { auto &SM = getASTContext().SourceMgr; - // Conjunctions should be solved in order of their apperance in the source. + // Conjunctions should be solved in order of their appearance in the source. // This is important because once a conjunction is solved, we don't re-visit - // it, so we need to make sure we don't solve it before another conjuntion + // it, so we need to make sure we don't solve it before another conjunction // that could provide it with necessary type information. Source order // provides an easy to reason about and quick way of establishing this. return *std::min_element( diff --git a/lib/Sema/CSSyntacticElement.cpp b/lib/Sema/CSSyntacticElement.cpp index 6662d3b82cdc2..d7ac309e0f75f 100644 --- a/lib/Sema/CSSyntacticElement.cpp +++ b/lib/Sema/CSSyntacticElement.cpp @@ -1040,7 +1040,7 @@ class SyntacticElementConstraintGenerator SmallVector elements; // First, let's record a body of `do` statement. Note we need to add a - // SyntaticElement locator path element here to avoid treating the inner + // SyntacticElement locator path element here to avoid treating the inner // brace conjunction as being isolated if 'doLoc' is for an isolated // conjunction (as is the case with 'do' expressions). auto *doBodyLoc = cs.getConstraintLocator( @@ -1204,7 +1204,7 @@ class SyntacticElementConstraintGenerator !element.isStmt(StmtKind::Guard) && !element.isStmt(StmtKind::Return) && !element.isStmt(StmtKind::Then)) { - // Statements can't influence the expresion that contains the code + // Statements can't influence the expression that contains the code // completion token. // Guard statements might define variables that are used in the code // completion expression. Don't skip them. @@ -1218,7 +1218,7 @@ class SyntacticElementConstraintGenerator continue; } if (element.isExpr(ExprKind::Error)) { - // ErrorExpr can't influcence the expresssion that contains the code + // ErrorExpr can't influcence the expression that contains the code // completion token. Since they are causing type checking to abort // early, just skip them. continue; @@ -1749,7 +1749,7 @@ class SyntacticElementSolutionApplication if (auto patternBinding = dyn_cast(decl)) { SyntacticElementTarget target(patternBinding); - // If this is a placeholder varaible with an initializer, let's set + // If this is a placeholder variable with an initializer, let's set // the inferred type, and ask `typeCheckDecl` to type-check initializer. if (isPlaceholderVar(patternBinding) && patternBinding->getInit(0)) { auto *pattern = patternBinding->getPattern(0); diff --git a/lib/Sema/CodeSynthesis.cpp b/lib/Sema/CodeSynthesis.cpp index efcd4573747ea..aac4b0e683fcd 100644 --- a/lib/Sema/CodeSynthesis.cpp +++ b/lib/Sema/CodeSynthesis.cpp @@ -1129,7 +1129,7 @@ static ValueDecl *findImplementedObjCDecl(ValueDecl *VD) { return VD; } -static void collectNonOveriddenSuperclassInits( +static void collectNonOverriddenSuperclassInits( ClassDecl *subclass, SmallVectorImpl &results) { auto *superclassDecl = subclass->getSuperclassDecl(); assert(superclassDecl); @@ -1218,7 +1218,7 @@ static void addImplicitInheritedConstructorsToClass(ClassDecl *decl) { !defaultInitable && !foundDesignatedInit; SmallVector nonOverriddenSuperclassCtors; - collectNonOveriddenSuperclassInits(decl, nonOverriddenSuperclassCtors); + collectNonOverriddenSuperclassInits(decl, nonOverriddenSuperclassCtors); bool inheritDesignatedInits = canInheritDesignatedInits(ctx.evaluator, decl); for (auto *superclassCtor : nonOverriddenSuperclassCtors) { @@ -1320,7 +1320,7 @@ InheritsSuperclassInitializersRequest::evaluate(Evaluator &eval, // Otherwise we need to check whether the user has overridden all of the // superclass' designed inits. SmallVector nonOverriddenSuperclassCtors; - collectNonOveriddenSuperclassInits(decl, nonOverriddenSuperclassCtors); + collectNonOverriddenSuperclassInits(decl, nonOverriddenSuperclassCtors); auto allDesignatedInitsOverridden = llvm::none_of(nonOverriddenSuperclassCtors, [](ConstructorDecl *ctor) { diff --git a/lib/Sema/ConstraintLocator.cpp b/lib/Sema/ConstraintLocator.cpp index 953d8b015871d..42c56a49277e3 100644 --- a/lib/Sema/ConstraintLocator.cpp +++ b/lib/Sema/ConstraintLocator.cpp @@ -679,7 +679,7 @@ static bool isForSingleValueStmtConjunction(ASTNode anchor, } } - // Other than the trailing SyntaticElement, we must be at the anchor. + // Other than the trailing SyntacticElement, we must be at the anchor. return path.empty(); } @@ -700,7 +700,7 @@ bool ConstraintLocator::isForSingleValueStmtConjunctionOrBrace() const { continue; } - // Ignore a SyntaticElement path element for a case statement of a switch, + // Ignore a SyntacticElement path element for a case statement of a switch, // or the catch of a do-catch, or the brace of a do-statement. if (auto elt = path.back().getAs()) { if (elt->getElement().isStmt(StmtKind::Case)) { diff --git a/lib/Sema/IDETypeCheckingRequests.cpp b/lib/Sema/IDETypeCheckingRequests.cpp index c24a02a433b1f..34fb53bf171e3 100644 --- a/lib/Sema/IDETypeCheckingRequests.cpp +++ b/lib/Sema/IDETypeCheckingRequests.cpp @@ -117,7 +117,7 @@ class ContainsSpecializableArchetype : public TypeWalker { /// that conforms to `PD`. /// /// In these cases, it is possible to access static members defined in the -/// extension when perfoming unresolved member lookup in a type context of +/// extension when performing unresolved member lookup in a type context of /// `PD`. static bool isExtensionWithSelfBound(const ExtensionDecl *ED, ProtocolDecl *PD) { diff --git a/lib/Sema/ImportResolution.cpp b/lib/Sema/ImportResolution.cpp index 487b195ff9229..67dccb4aeee10 100644 --- a/lib/Sema/ImportResolution.cpp +++ b/lib/Sema/ImportResolution.cpp @@ -1080,7 +1080,7 @@ CheckInconsistentAccessLevelOnImport::evaluate( auto diagnose = [mod](const ImportDecl *implicitImport, const ImportDecl *otherImport) { // Ignore files generated by Xcode. We should probably identify them via - // an attribuite or frontend flag, until them match the file by name. + // an attribute or frontend flag, until them match the file by name. SourceFile *implicitSF = implicitImport->getDeclContext()->getParentSourceFile(); StringRef basename = llvm::sys::path::filename(implicitSF->getFilename()); diff --git a/lib/Sema/MiscDiagnostics.cpp b/lib/Sema/MiscDiagnostics.cpp index efd07e5f80675..5f0a88bc6a43c 100644 --- a/lib/Sema/MiscDiagnostics.cpp +++ b/lib/Sema/MiscDiagnostics.cpp @@ -2151,7 +2151,7 @@ static void diagnoseImplicitSelfUseInClosure(const Expr *E, return nullptr; } - /// Determines whether or not this is a simple self capture by retreiving + /// Determines whether or not this is a simple self capture by retrieving /// the `CaptureListEntry` that contains the `selfDecl`. /// - Unlike `selfDecl->isSelfParamCapture()`, this will return true /// for a simple `[weak self]` capture. @@ -5391,7 +5391,7 @@ static bool diagnoseHasSymbolCondition(PoundHasSymbolInfo *info, if (DC->getFragileFunctionKind().kind == FragileFunctionKind::None && !decl->isWeakImported(DC->getParentModule())) { // `if #_hasSymbol(someStronglyLinkedSymbol)` is functionally a no-op - // and may indicate the developer has mis-identified the declaration + // and may indicate the developer has misidentified the declaration // they want to check (or forgot to import the module weakly). ctx.Diags.diagnose(symbolExpr->getLoc(), diag::has_symbol_decl_must_be_weak, decl); @@ -6312,8 +6312,8 @@ diagnoseDictionaryLiteralDuplicateKeyEntries(const Expr *E, // maybe be evaluated to different values. e.g. // "\(a) \(a)" where 'a' is a computed variable. case ExprKind::InterpolatedStringLiteral: - // Also skip object literals as most of them takes paramenters that can - // contain expressions that altough equal may evaluate to different + // Also skip object literals as most of them takes parameters that can + // contain expressions that although equal may evaluate to different // values e.g. #fileLiteral(resourceName: a) where 'a' is a computed // property is valid. case ExprKind::ObjectLiteral: diff --git a/lib/Sema/TypeCheckAttr.cpp b/lib/Sema/TypeCheckAttr.cpp index b89047317aed5..ec7b13415bfab 100644 --- a/lib/Sema/TypeCheckAttr.cpp +++ b/lib/Sema/TypeCheckAttr.cpp @@ -2391,7 +2391,7 @@ void AttributeChecker::visitExternAttr(ExternAttr *attr) { } else if (!attr->Name.has_value() && !clang::isValidAsciiIdentifier(cName)) { // Warn non ASCII identifiers if it's *implicitly* specified. The C standard allows // Universal Character Names in identifiers, but clang doesn't provide - // an easy way to validate them, so we warn identifers that is potentially + // an easy way to validate them, so we warn identifiers that is potentially // invalid. If it's explicitly specified, we assume the user knows what // they are doing, and don't warn. diagnose(attr->getLocation(), diag::extern_c_maybe_invalid_name, cName) diff --git a/lib/Sema/TypeCheckAvailability.cpp b/lib/Sema/TypeCheckAvailability.cpp index 4516942d30107..f0228b807c028 100644 --- a/lib/Sema/TypeCheckAvailability.cpp +++ b/lib/Sema/TypeCheckAvailability.cpp @@ -584,7 +584,7 @@ class TypeRefinementContextBuilder : private ASTWalker { /// Constructs a placeholder TRC node that should be expanded later. This is /// useful for postponing unnecessary work (and request triggers) when - /// initally building out the TRC subtree under a declaration. Lazy nodes + /// initially building out the TRC subtree under a declaration. Lazy nodes /// constructed here will be expanded by /// ExpandChildTypeRefinementContextsRequest. Returns true if a node was /// created. @@ -664,7 +664,7 @@ class TypeRefinementContextBuilder : private ASTWalker { // As a special case, extension decls are treated as effectively as // available as the nominal type they extend, up to the deployment target. // This rule is a convenience for library authors who have written - // extensions without specifying availabilty on the extension itself. + // extensions without specifying availability on the extension itself. if (auto *ED = dyn_cast(D)) { auto ET = ED->getExtendedType(); if (ET && !hasActiveAvailableAttribute(D, Context)) { diff --git a/lib/Sema/TypeCheckConcurrency.cpp b/lib/Sema/TypeCheckConcurrency.cpp index 33d6fa2dad81b..27d6c0942b435 100644 --- a/lib/Sema/TypeCheckConcurrency.cpp +++ b/lib/Sema/TypeCheckConcurrency.cpp @@ -1787,7 +1787,7 @@ static bool isNonInheritedStorage(ValueDecl const *member, } /// Based on the former escaping-use restriction, which was replaced by -/// flow-isolation. We need this to support backwards compatability in the +/// flow-isolation. We need this to support backwards compatibility in the /// type-checker for programs prior to Swift 6. /// \param fn either a constructor or destructor of an actor. static bool wasLegacyEscapingUseRestriction(AbstractFunctionDecl *fn) { @@ -1870,7 +1870,7 @@ static void noteIsolatedActorMember(ValueDecl const *decl, /// An ad-hoc check specific to member isolation checking. assumed to be /// queried when a self-member is being accessed in a context which is not /// isolated to self. The "special permission" is part of a backwards -/// compatability with actor inits and deinits that maintains the +/// compatibility with actor inits and deinits that maintains the /// permissive nature of the escaping-use restriction, which was only /// staged in as a warning. See implementation for more details. /// diff --git a/lib/Sema/TypeCheckGeneric.cpp b/lib/Sema/TypeCheckGeneric.cpp index cfa39fda6cace..3b4232770b269 100644 --- a/lib/Sema/TypeCheckGeneric.cpp +++ b/lib/Sema/TypeCheckGeneric.cpp @@ -1137,7 +1137,7 @@ Type StructuralTypeRequest::evaluate(Evaluator &evaluator, /*packElementOpener*/ nullptr) .resolveType(underlyingTypeRepr); - // Don't build a generic siganture for a protocol extension, because this + // Don't build a generic signature for a protocol extension, because this // request might be evaluated while building a protocol requirement signature. if (parentDC->getSelfProtocolDecl()) return result; diff --git a/lib/Sema/TypeCheckMacros.cpp b/lib/Sema/TypeCheckMacros.cpp index e815bf492dc1f..b8a18681c4e36 100644 --- a/lib/Sema/TypeCheckMacros.cpp +++ b/lib/Sema/TypeCheckMacros.cpp @@ -1990,7 +1990,7 @@ ConcreteDeclRef ResolveMacroRequest::evaluate(Evaluator &evaluator, auto roles = macroRef.getMacroRoles(); // When a macro is not found for a custom attribute, it may be a non-macro. - // So bail out to prevent diagnostics from the contraint system. + // So bail out to prevent diagnostics from the constraint system. if (macroRef.getAttr()) { auto foundMacros = namelookup::lookupMacros(dc, macroRef.getModuleName(), macroRef.getMacroName(), roles); diff --git a/lib/Sema/TypeCheckProtocol.cpp b/lib/Sema/TypeCheckProtocol.cpp index 6463065318c50..672d437f52f0e 100644 --- a/lib/Sema/TypeCheckProtocol.cpp +++ b/lib/Sema/TypeCheckProtocol.cpp @@ -517,7 +517,7 @@ matchWitnessStructureImpl(ValueDecl *req, ValueDecl *witness, // and the payload types and labels match the function and the // function returns `Self` or the type of the enum. // - // If there are any discrepencies, we'll diagnose it later. For now, + // If there are any discrepancies, we'll diagnose it later. For now, // let's assume the match is valid. if (!((isa(req) || isa(req)) && isa(witness))) @@ -3796,7 +3796,7 @@ hasSatisfiedObjCSiblingRequirement(ProtocolDecl *proto, ValueWitnessRequest{conformance, candidate})) return false; - // Otherwise, resolve the sibling cadidate; if its valid, don't + // Otherwise, resolve the sibling candidate; if its valid, don't // record a missing witness. return static_cast(conformance->getWitness(candidate)); })) { diff --git a/lib/Sema/TypeCheckStmt.cpp b/lib/Sema/TypeCheckStmt.cpp index f881ebc2ecbf8..e2297ccf5b024 100644 --- a/lib/Sema/TypeCheckStmt.cpp +++ b/lib/Sema/TypeCheckStmt.cpp @@ -2504,7 +2504,7 @@ bool TypeCheckASTNodeAtLocRequest::evaluate( // Reset the node found in a parent context if it's not part of this // brace statement. - // We must not reset FoundNode if it's inside thei BraceStmt's source + // We must not reset FoundNode if it's inside their BraceStmt's source // range because the found node could be inside a capture list, which is // syntactically part of the brace stmt's range but won't be walked as // a child of the brace stmt. @@ -2691,7 +2691,7 @@ static void addImplicitReturnIfNeeded(BraceStmt *body, DeclContext *dc) { if (body->empty()) return; - // Must have a single active element (which is guarenteed to be the last + // Must have a single active element (which is guaranteed to be the last // element), or we must be allowing implicit last expression results. auto &ctx = dc->getASTContext(); if (!body->getSingleActiveElement() && diff --git a/lib/Sema/TypeCheckType.cpp b/lib/Sema/TypeCheckType.cpp index 3f1e84a691160..ae5f2a9016d4f 100644 --- a/lib/Sema/TypeCheckType.cpp +++ b/lib/Sema/TypeCheckType.cpp @@ -5160,7 +5160,7 @@ NeverNullType TypeResolver::resolveImplicitlyUnwrappedOptionalType( // Prior to Swift 5, we allow 'as T!' and turn it into a disjunction. if (ctx.isSwiftVersionAtLeast(5)) { // Mark this repr as invalid. This is the only way to indicate that - // something went wrong without supressing checking other reprs in + // something went wrong without suppressing checking other reprs in // the same type. For example: // // struct S { ... } @@ -5646,7 +5646,7 @@ TypeResolver::resolveExistentialType(ExistentialTypeRepr *repr, if (constraintType->hasError()) return ErrorType::get(getASTContext()); - //TO-DO: generalize this and emit the same erorr for some P? + //TO-DO: generalize this and emit the same error for some P? if (!constraintType->isConstraintType()) { // Emit a tailored diagnostic for the incorrect optional // syntax 'any P?' with a fix-it to add parenthesis. @@ -5985,7 +5985,7 @@ class ExistentialTypeSyntaxChecker : public ASTWalker { private: /// Returns a Boolean value indicating whether the insertion of `any` before - /// a type representation with the given parent requires paretheses. + /// a type representation with the given parent requires parentheses. static bool anySyntaxNeedsParens(TypeRepr *parent) { switch (parent->getKind()) { case TypeReprKind::Optional: diff --git a/lib/Serialization/DeserializationErrors.h b/lib/Serialization/DeserializationErrors.h index 29bba7a7e7118..f60a8b34d5289 100644 --- a/lib/Serialization/DeserializationErrors.h +++ b/lib/Serialization/DeserializationErrors.h @@ -630,7 +630,7 @@ class InvalidRecordKindError : } }; -// Decl was not deserialized because it's an internal detail maked as unsafe +// Decl was not deserialized because it's an internal detail marked as unsafe // at serialization. class UnsafeDeserializationError : public llvm::ErrorInfo { friend ErrorInfo; diff --git a/lib/Serialization/SILFormat.h b/lib/Serialization/SILFormat.h index 38196e664fb3a..69e1cb552a0c0 100644 --- a/lib/Serialization/SILFormat.h +++ b/lib/Serialization/SILFormat.h @@ -305,7 +305,7 @@ namespace sil_block { BCFixed<1>, // has qualified ownership BCFixed<1>, // force weak linking BC_AVAIL_TUPLE, // availability for weak linking - BCFixed<1>, // is dynamically replacable + BCFixed<1>, // is dynamically replaceable BCFixed<1>, // exact self class BCFixed<1>, // is distributed BCFixed<1>, // is runtime accessible diff --git a/lib/Serialization/Serialization.cpp b/lib/Serialization/Serialization.cpp index 88f44c3710038..b6ce06828ce80 100644 --- a/lib/Serialization/Serialization.cpp +++ b/lib/Serialization/Serialization.cpp @@ -1096,8 +1096,8 @@ void Serializer::writeHeader() { } if (M->allowNonResilientAccess()) { - options_block::AllowNonResilientAccess AllowNonResAcess(Out); - AllowNonResAcess.emit(ScratchRecord); + options_block::AllowNonResilientAccess AllowNonResAccess(Out); + AllowNonResAccess.emit(ScratchRecord); } if (M->serializePackageEnabled()) { diff --git a/lib/Serialization/SerializedModuleLoader.cpp b/lib/Serialization/SerializedModuleLoader.cpp index 080895370af67..2ace4b73228af 100644 --- a/lib/Serialization/SerializedModuleLoader.cpp +++ b/lib/Serialization/SerializedModuleLoader.cpp @@ -372,7 +372,7 @@ std::error_code SerializedModuleLoaderBase::openModuleFile( // mmap to workaround issues on NFS when the swiftmodule file loaded changes // on disk while it's in use. // - // In practice, a swiftmodule file can chane when a client uses a + // In practice, a swiftmodule file can change when a client uses a // swiftmodule file from a framework while the framework is recompiled and // installed over existing files. Or when many processes rebuild the same // module interface. diff --git a/test/Concurrency/Inputs/other_global_actor_inference.swift b/test/Concurrency/Inputs/other_global_actor_inference.swift index b1986da05937e..a589659ecd358 100644 --- a/test/Concurrency/Inputs/other_global_actor_inference.swift +++ b/test/Concurrency/Inputs/other_global_actor_inference.swift @@ -1,5 +1,5 @@ -// dynamically_replaceable +// dynamically_replacable @MainActor public dynamic func dynamicOnMainActor() { } diff --git a/test/IRGen/dynamic_replaceable.sil b/test/IRGen/dynamic_replaceable.sil index 9e4022a38ee77..5f4c81c8ae278 100644 --- a/test/IRGen/dynamic_replaceable.sil +++ b/test/IRGen/dynamic_replaceable.sil @@ -7,8 +7,8 @@ // The arm64e test is in ptrauth-dynamic_replaceable.sil. // UNSUPPORTED: CPU=arm64e -// CHECK: @test_dynamically_replaceableTX = global %swift.dyn_repl_link_entry { ptr @test_dynamically_replaceable, ptr null } -// CHECK: @test_dynamically_replaceableTx = constant %swift.dyn_repl_key { i32{{.*}}ptr @test_dynamically_replaceableTX{{.*}}, i32 0 }, section "__TEXT,__const" +// CHECK: @test_dynamically_replacableTX = global %swift.dyn_repl_link_entry { ptr @test_dynamically_replacable, ptr null } +// CHECK: @test_dynamically_replacableTx = constant %swift.dyn_repl_key { i32{{.*}}ptr @test_dynamically_replacableTX{{.*}}, i32 0 }, section "__TEXT,__const" // CHECK: @test_replacementTX = global %swift.dyn_repl_link_entry zeroinitializer // CHECK: @"\01l_unnamed_dynamic_replacements" = private constant { i32, i32, [1 x { i32, i32, i32, i32 }] } @@ -16,7 +16,7 @@ // CHECK-SAME: i32 1, // CHECK-SAME: [1 x { i32, i32, i32, i32 }] // CHECK-SAME: [{ i32, i32, i32, i32 } -// CHECK-SAME: ptr @test_dynamically_replaceableTx +// CHECK-SAME: ptr @test_dynamically_replacableTx // CHECK-SAME: @test_replacement // CHECK-SAME: ptr @test_replacementTX // CHECK-SAME: i32 0 }] }, section "__TEXT,__const" @@ -26,10 +26,10 @@ // CHECK-SAME: [2 x i32] [{{.*}}@"\01l_unnamed_dynamic_replacements"{{.*}}, i32 0] // CHECK-SAME: }, section "__TEXT, __swift5_replace, regular, no_dead_strip" -// CHECK-LABEL: define swiftcc void @test_dynamically_replaceable() +// CHECK-LABEL: define swiftcc void @test_dynamically_replacable() // CHECK-NEXT: entry: -// COMPAT-NEXT: [[FUN_PTR:%.*]] = call ptr @swift_getFunctionReplacement{{.*}}(ptr @test_dynamically_replaceableTX, ptr @test_dynamically_replaceable) -// NONCOMPAT-NEXT: [[FUN_PTR:%.*]] = call ptr @swift_getFunctionReplacement(ptr @test_dynamically_replaceableTX, ptr @test_dynamically_replaceable) +// COMPAT-NEXT: [[FUN_PTR:%.*]] = call ptr @swift_getFunctionReplacement{{.*}}(ptr @test_dynamically_replacableTX, ptr @test_dynamically_replacable) +// NONCOMPAT-NEXT: [[FUN_PTR:%.*]] = call ptr @swift_getFunctionReplacement(ptr @test_dynamically_replacableTX, ptr @test_dynamically_replacable) // CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr [[FUN_PTR]], null // CHECK-NEXT: br i1 [[CMP]], label %[[ORIGBB:[a-z_]*]], label %[[FWBB:[a-z_]*]] // CHECK: [[FWBB]]: @@ -39,7 +39,7 @@ // CHECK-NEXT: ret void // CHECK-NEXT: } -sil [dynamically_replacable] @test_dynamically_replaceable : $@convention(thin) () -> () { +sil [dynamically_replacable] @test_dynamically_replacable : $@convention(thin) () -> () { bb0: %0 = tuple () return %0 : $() @@ -59,7 +59,7 @@ bb0: // CHECK: call swiftcc void [[FUN_PTR]]() // CHECK: ret void // CHECK: } -sil [dynamic_replacement_for "test_dynamically_replaceable"] @test_replacement : $@convention(thin) () -> () { +sil [dynamic_replacement_for "test_dynamically_replacable"] @test_replacement : $@convention(thin) () -> () { bb0: %0 = prev_dynamic_function_ref @test_replacement : $@convention(thin) () -> () %1 = apply %0() : $@convention(thin) () -> () @@ -69,12 +69,12 @@ bb0: // CHECK-LABEL: define swiftcc void @test_dynamic_call() // CHECK: entry: -// CHECK: call swiftcc void @test_dynamically_replaceable() +// CHECK: call swiftcc void @test_dynamically_replacable() // CHECK: ret void // CHECK: } sil @test_dynamic_call : $@convention(thin) () -> () { bb0: - %0 = dynamic_function_ref @test_dynamically_replaceable : $@convention(thin) () -> () + %0 = dynamic_function_ref @test_dynamically_replacable : $@convention(thin) () -> () %1 = apply %0() : $@convention(thin) () -> () %2 = tuple () return %2 : $() diff --git a/test/IRGen/ptrauth-dynamic_replaceable.sil b/test/IRGen/ptrauth-dynamic_replaceable.sil index d4fa9b6b77c1f..510d748477df3 100644 --- a/test/IRGen/ptrauth-dynamic_replaceable.sil +++ b/test/IRGen/ptrauth-dynamic_replaceable.sil @@ -3,26 +3,26 @@ // REQUIRES: objc_interop // REQUIRES: CPU=arm64e -// CHECK: @test_dynamically_replaceableTX = global %swift.dyn_repl_link_entry { ptr{{.*}} @test_dynamically_replaceable.ptrauth, ptr null } -// CHECK: @test_dynamically_replaceable.ptrauth = private constant { ptr, i32, i64, i64 } { ptr @test_dynamically_replaceable, i32 0, i64 ptrtoint (ptr @test_dynamically_replaceableTX to i64), i64 679 }, section "llvm.ptrauth" -// CHECK: @test_dynamically_replaceableTx = constant %swift.dyn_repl_key { i32 trunc ([[INTPTR:i[0-9]+]] sub ([[INTPTR]] ptrtoint (ptr @test_dynamically_replaceableTX to [[INTPTR]]), [[INTPTR]] ptrtoint (ptr @test_dynamically_replaceableTx to [[INTPTR]])) to i32), i32 679 }, section "__TEXT,__const" +// CHECK: @test_dynamically_replacableTX = global %swift.dyn_repl_link_entry { ptr{{.*}} @test_dynamically_replacable.ptrauth, ptr null } +// CHECK: @test_dynamically_replacable.ptrauth = private constant { ptr, i32, i64, i64 } { ptr @test_dynamically_replacable, i32 0, i64 ptrtoint (ptr @test_dynamically_replacableTX to i64), i64 679 }, section "llvm.ptrauth" +// CHECK: @test_dynamically_replacableTx = constant %swift.dyn_repl_key { i32 trunc ([[INTPTR:i[0-9]+]] sub ([[INTPTR]] ptrtoint (ptr @test_dynamically_replacableTX to [[INTPTR]]), [[INTPTR]] ptrtoint (ptr @test_dynamically_replacableTx to [[INTPTR]])) to i32), i32 679 }, section "__TEXT,__const" // CHECK: @test_replacementTX = global %swift.dyn_repl_link_entry zeroinitializer // CHECK: @test_replacement_for_externalTX = global %swift.dyn_repl_link_entry zeroinitializer -// CHECK: @external_test_dynamically_replaceableTx = external global %swift.dyn_repl_key -// CHECK: @got.external_test_dynamically_replaceableTx = private unnamed_addr constant ptr @external_test_dynamically_replaceableTx.ptrauth -// CHECK: @external_test_dynamically_replaceableTx.ptrauth = private constant { ptr, i32, i64, i64 } { ptr @external_test_dynamically_replaceableTx, i32 2, i64 ptrtoint (ptr @got.external_test_dynamically_replaceableTx to i64), i64 11389 }, section "llvm.ptrauth" +// CHECK: @external_test_dynamically_replacableTx = external global %swift.dyn_repl_key +// CHECK: @got.external_test_dynamically_replacableTx = private unnamed_addr constant ptr @external_test_dynamically_replacableTx.ptrauth +// CHECK: @external_test_dynamically_replacableTx.ptrauth = private constant { ptr, i32, i64, i64 } { ptr @external_test_dynamically_replacableTx, i32 2, i64 ptrtoint (ptr @got.external_test_dynamically_replacableTx to i64), i64 11389 }, section "llvm.ptrauth" // CHECK: @"\01l_unnamed_dynamic_replacements" = private constant { i32, i32, [2 x { i32, i32, i32, i32 }] } // CHECK: { i32 0, // CHECK: i32 2, // CHECK: [2 x { i32, i32, i32, i32 }] // CHECK: [{ i32, i32, i32, i32 } -// CHECK: ptr @test_dynamically_replaceableTx +// CHECK: ptr @test_dynamically_replacableTx // CHECK: @test_replacement // CHECK: ptr @test_replacementTX // CHECK: i32 0 }, // CHECK: { i32, i32, i32, i32 } -// CHECK: ptr @got.external_test_dynamically_replaceableTx +// CHECK: ptr @got.external_test_dynamically_replacableTx // CHECK: @test_replacement_for_external // CHECK: ptr @test_replacement_for_externalTX // CHECK: i32 0 }] }, section "__TEXT,__const" @@ -32,20 +32,20 @@ // CHECK: [2 x i32] [{{.*}}@"\01l_unnamed_dynamic_replacements"{{.*}}, i32 0] // CHECK: }, section "__TEXT, __swift5_replace, regular, no_dead_strip" -// CHECK-LABEL: define swiftcc void @test_dynamically_replaceable() +// CHECK-LABEL: define swiftcc void @test_dynamically_replacable() // CHECK-NEXT: entry: -// CHECK-NEXT: [[FUN_PTR:%.*]] = call ptr @swift_getFunctionReplacement{{.*}}({{.*}} @test_dynamically_replaceableTX +// CHECK-NEXT: [[FUN_PTR:%.*]] = call ptr @swift_getFunctionReplacement{{.*}}({{.*}} @test_dynamically_replacableTX // CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr [[FUN_PTR]], null // CHECK-NEXT: br i1 [[CMP]], label %original_entry, label %forward_to_replaced // CHECK: forward_to_replaced: -// CHECK-NEXT: [[BLEND:%.*]] = call i64 @llvm.ptrauth.blend(i64 ptrtoint (ptr @test_dynamically_replaceableTX to i64), i64 679) +// CHECK-NEXT: [[BLEND:%.*]] = call i64 @llvm.ptrauth.blend(i64 ptrtoint (ptr @test_dynamically_replacableTX to i64), i64 679) // CHECK-NEXT: tail call swiftcc void [[FUN_PTR]]() [ "ptrauth"(i32 0, i64 [[BLEND]]) ] // CHECK-NEXT: ret void // CHECK: original_entry: // CHECK-NEXT: ret void // CHECK-NEXT: } -sil [dynamically_replacable] @test_dynamically_replaceable : $@convention(thin) () -> () { +sil [dynamically_replacable] @test_dynamically_replacable : $@convention(thin) () -> () { bb0: %0 = tuple () return %0 : $() @@ -65,7 +65,7 @@ bb0: // CHECK-NEXT: call swiftcc void [[FUN_PTR]]() [ "ptrauth"(i32 0, i64 [[BLEND]]) ] // CHECK: ret void // CHECK: } -sil [dynamic_replacement_for "test_dynamically_replaceable"] @test_replacement : $@convention(thin) () -> () { +sil [dynamic_replacement_for "test_dynamically_replacable"] @test_replacement : $@convention(thin) () -> () { bb0: %0 = prev_dynamic_function_ref @test_replacement : $@convention(thin) () -> () %1 = apply %0() : $@convention(thin) () -> () @@ -75,21 +75,21 @@ bb0: // CHECK-LABEL: define swiftcc void @test_dynamic_call() // CHECK: entry: -// CHECK: call swiftcc void @test_dynamically_replaceable() +// CHECK: call swiftcc void @test_dynamically_replacable() // CHECK: ret void // CHECK: } sil @test_dynamic_call : $@convention(thin) () -> () { bb0: - %0 = dynamic_function_ref @test_dynamically_replaceable : $@convention(thin) () -> () + %0 = dynamic_function_ref @test_dynamically_replacable : $@convention(thin) () -> () %1 = apply %0() : $@convention(thin) () -> () %2 = tuple () return %2 : $() } -sil [dynamically_replacable] @external_test_dynamically_replaceable : $@convention(thin) () -> () +sil [dynamically_replacable] @external_test_dynamically_replacable : $@convention(thin) () -> () -sil [dynamic_replacement_for "external_test_dynamically_replaceable"] @test_replacement_for_external : $@convention(thin) () -> () { +sil [dynamic_replacement_for "external_test_dynamically_replacable"] @test_replacement_for_external : $@convention(thin) () -> () { bb0: %0 = prev_dynamic_function_ref @test_replacement : $@convention(thin) () -> () %1 = apply %0() : $@convention(thin) () -> () diff --git a/test/Parse/diagnose_dynamicReplacement.swift b/test/Parse/diagnose_dynamicReplacement.swift index 07ab5d1582a52..30882883df89f 100644 --- a/test/Parse/diagnose_dynamicReplacement.swift +++ b/test/Parse/diagnose_dynamicReplacement.swift @@ -14,7 +14,7 @@ func test_dynamic_replacement_for() { func test_dynamic_replacement_for2() { } -@_dynamicReplacement(for: dynamically_replaceable() // expected-note {{to match this opening '('}} +@_dynamicReplacement(for: dynamically_replacable() // expected-note {{to match this opening '('}} func test_dynamic_replacement_for3() { // expected-error@-1 {{expected ')' after function name for @_dynamicReplacement}} } diff --git a/test/SIL/Parser/basic.sil b/test/SIL/Parser/basic.sil index bfe17ad8a4399..63f3aa958505a 100644 --- a/test/SIL/Parser/basic.sil +++ b/test/SIL/Parser/basic.sil @@ -1707,15 +1707,15 @@ bb0(%0 : $A): return %20 : $() } -// CHECK-LABEL: sil [dynamically_replacable] @test_dynamically_replaceable -sil [dynamically_replacable] @test_dynamically_replaceable : $@convention(thin) () -> () { +// CHECK-LABEL: sil [dynamically_replacable] @test_dynamically_replacable +sil [dynamically_replacable] @test_dynamically_replacable : $@convention(thin) () -> () { bb0: %0 = tuple () return %0 : $() } -// CHECK-LABEL: sil [dynamic_replacement_for "test_dynamically_replaceable"] @test_dynamic_replacement_for -sil [dynamic_replacement_for "test_dynamically_replaceable"] @test_dynamic_replacement_for : $@convention(thin) () -> () { +// CHECK-LABEL: sil [dynamic_replacement_for "test_dynamically_replacable"] @test_dynamic_replacement_for +sil [dynamic_replacement_for "test_dynamically_replacable"] @test_dynamic_replacement_for : $@convention(thin) () -> () { bb0: %0 = tuple () return %0 : $() diff --git a/test/SIL/Serialization/dynamically_replaceable.sil b/test/SIL/Serialization/dynamically_replaceable.sil index cdf09a7eda4ca..3491722b2e090 100644 --- a/test/SIL/Serialization/dynamically_replaceable.sil +++ b/test/SIL/Serialization/dynamically_replaceable.sil @@ -2,13 +2,13 @@ // RUN: %target-swift-frontend %s -emit-module -o %t/tmp.swiftmodule // RUN: %target-sil-opt %t/tmp.swiftmodule -emit-sorted-sil | %FileCheck %s -sil [serialized] [dynamically_replacable] @test_dynamically_replaceable : $@convention(thin) () -> () { +sil [serialized] [dynamically_replacable] @test_dynamically_replacable : $@convention(thin) () -> () { bb0: %0 = tuple () return %0 : $() } -sil [serialized] [dynamic_replacement_for "test_dynamically_replaceable"] @test_dynamic_replacement_for : $@convention(thin) () -> () { +sil [serialized] [dynamic_replacement_for "test_dynamically_replacable"] @test_dynamic_replacement_for : $@convention(thin) () -> () { bb0: %0 = prev_dynamic_function_ref @test_dynamic_replacement_for : $@convention(thin) () -> () %1 = apply %0() : $@convention(thin) () -> () @@ -16,18 +16,18 @@ bb0: return %2 : $() } -sil [serialized] @test_dynamically_replaceable_impl : $@convention(thin) () -> () { +sil [serialized] @test_dynamically_replacable_impl : $@convention(thin) () -> () { bb0: - %0 = dynamic_function_ref @test_dynamically_replaceable : $@convention(thin) () -> () + %0 = dynamic_function_ref @test_dynamically_replacable : $@convention(thin) () -> () %1 = apply %0() : $@convention(thin) () -> () %2 = tuple () return %2 : $() } -// CHECK-LABEL: sil [serialized] [dynamic_replacement_for "test_dynamically_replaceable"] [canonical] @test_dynamic_replacement_for +// CHECK-LABEL: sil [serialized] [dynamic_replacement_for "test_dynamically_replacable"] [canonical] @test_dynamic_replacement_for // CHECK: prev_dynamic_function_ref @test_dynamic_replacement_for -// CHECK-LABEL: sil [serialized] [dynamically_replacable] [canonical] @test_dynamically_replaceable +// CHECK-LABEL: sil [serialized] [dynamically_replacable] [canonical] @test_dynamically_replacable -// CHECK-LABEL: sil [serialized] [canonical] @test_dynamically_replaceable_impl -// CHECK: dynamic_function_ref @test_dynamically_replaceable +// CHECK-LABEL: sil [serialized] [canonical] @test_dynamically_replacable_impl +// CHECK: dynamic_function_ref @test_dynamically_replacable diff --git a/test/SILGen/dynamically_replaceable.swift b/test/SILGen/dynamically_replaceable.swift index d684ad21c9869..601e625c3689e 100644 --- a/test/SILGen/dynamically_replaceable.swift +++ b/test/SILGen/dynamically_replaceable.swift @@ -2,29 +2,29 @@ // RUN: %target-swift-emit-silgen -swift-version 5 %s -enable-implicit-dynamic | %FileCheck %s --check-prefix=IMPLICIT // RUN: %target-swift-emit-silgen -swift-version 5 %s -disable-previous-implementation-calls-in-dynamic-replacements | %FileCheck %s --check-prefix=NOPREVIOUS -// IMPLICIT-LABEL: sil private [ossa] @$s23dynamically_replaceable6$deferL_yyF +// IMPLICIT-LABEL: sil private [ossa] @$s23dynamically_replacable6$deferL_yyF var x = 10 defer { let y = x } -// CHECK-LABEL: sil hidden [ossa] @$s23dynamically_replaceable014maybe_dynamic_B0yyF : $@convention(thin) () -> () { -// IMPLICIT-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable014maybe_dynamic_B0yyF : $@convention(thin) () -> () { +// CHECK-LABEL: sil hidden [ossa] @$s23dynamically_replacable014maybe_dynamic_B0yyF : $@convention(thin) () -> () { +// IMPLICIT-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replacable014maybe_dynamic_B0yyF : $@convention(thin) () -> () { func maybe_dynamic_replaceable() { } -// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable08dynamic_B0yyF : $@convention(thin) () -> () { +// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replacable08dynamic_B0yyF : $@convention(thin) () -> () { dynamic func dynamic_replaceable() { } -// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable6StructV1xACSi_tcfC : $@convention(method) (Int, @thin Struct.Type) -> Struct -// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable6StructV08dynamic_B0yyF : $@convention(method) (Struct) -> () { -// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable6StructV08dynamic_B4_varSivg -// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable6StructV08dynamic_B4_varSivs -// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable6StructVyS2icig : $@convention(method) (Int, Struct) -> Int -// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable6StructVyS2icis : $@convention(method) (Int, Int, @inout Struct) -> () -// CHECK-LABEL: sil private [dynamically_replacable] [ossa] @$s23dynamically_replaceable6StructV22property_with_observerSivW -// CHECK-LABEL: sil private [dynamically_replacable] [ossa] @$s23dynamically_replaceable6StructV22property_with_observerSivw +// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replacable6StructV1xACSi_tcfC : $@convention(method) (Int, @thin Struct.Type) -> Struct +// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replacable6StructV08dynamic_B0yyF : $@convention(method) (Struct) -> () { +// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replacable6StructV08dynamic_B4_varSivg +// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replacable6StructV08dynamic_B4_varSivs +// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replacable6StructVyS2icig : $@convention(method) (Int, Struct) -> Int +// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replacable6StructVyS2icis : $@convention(method) (Int, Int, @inout Struct) -> () +// CHECK-LABEL: sil private [dynamically_replacable] [ossa] @$s23dynamically_replacable6StructV22property_with_observerSivW +// CHECK-LABEL: sil private [dynamically_replacable] [ossa] @$s23dynamically_replacable6StructV22property_with_observerSivw struct Struct { dynamic init(x: Int) { } @@ -55,14 +55,14 @@ struct Struct { } } -// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable5KlassC1xACSi_tcfc : $@convention(method) (Int, @owned Klass) -> @owned Klass -// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable5KlassC08dynamic_B0yyF : $@convention(method) (@guaranteed Klass) -> () { -// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable5KlassC08dynamic_B4_varSivg -// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable5KlassC08dynamic_B4_varSivs -// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable5KlassCyS2icig : $@convention(method) (Int, @guaranteed Klass) -> Int -// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable5KlassCyS2icis : $@convention(method) (Int, Int, @guaranteed Klass) -> () -// CHECK-LABEL: sil private [dynamically_replacable] [ossa] @$s23dynamically_replaceable5KlassC22property_with_observerSivW -// CHECK-LABEL: sil private [dynamically_replacable] [ossa] @$s23dynamically_replaceable5KlassC22property_with_observerSivw +// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replacable5KlassC1xACSi_tcfc : $@convention(method) (Int, @owned Klass) -> @owned Klass +// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replacable5KlassC08dynamic_B0yyF : $@convention(method) (@guaranteed Klass) -> () { +// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replacable5KlassC08dynamic_B4_varSivg +// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replacable5KlassC08dynamic_B4_varSivs +// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replacable5KlassCyS2icig : $@convention(method) (Int, @guaranteed Klass) -> Int +// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replacable5KlassCyS2icis : $@convention(method) (Int, Int, @guaranteed Klass) -> () +// CHECK-LABEL: sil private [dynamically_replacable] [ossa] @$s23dynamically_replacable5KlassC22property_with_observerSivW +// CHECK-LABEL: sil private [dynamically_replacable] [ossa] @$s23dynamically_replacable5KlassC22property_with_observerSivw class Klass { dynamic init(x: Int) { } @@ -101,20 +101,20 @@ class Klass { } class SubKlass : Klass { - // CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable8SubKlassC1xACSi_tcfc + // CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replacable8SubKlassC1xACSi_tcfc // CHECK: // dynamic_function_ref Klass.init(x:) - // CHECK: [[FUN:%.*]] = dynamic_function_ref @$s23dynamically_replaceable5KlassC1xACSi_tcfc + // CHECK: [[FUN:%.*]] = dynamic_function_ref @$s23dynamically_replacable5KlassC1xACSi_tcfc // CHECK: apply [[FUN]] dynamic override init(x: Int) { super.init(x: x) } } -// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable6globalSivg : $@convention(thin) () -> Int { +// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replacable6globalSivg : $@convention(thin) () -> Int { dynamic var global : Int { return 1 } -// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable08dynamic_B0yyF"] [ossa] @$s23dynamically_replaceable11replacementyyF : $@convention(thin) () -> () { +// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable08dynamic_B0yyF"] [ossa] @$s23dynamically_replacable11replacementyyF : $@convention(thin) () -> () { @_dynamicReplacement(for: dynamic_replaceable()) func replacement() { } @@ -123,13 +123,13 @@ extension Klass { // Calls to the replaced function inside the replacing function should be // statically dispatched. - // CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable5KlassC08dynamic_B0yyF"] [ossa] @$s23dynamically_replaceable5KlassC11replacementyyF : $@convention(method) (@guaranteed Klass) -> () { - // CHECK: [[FN:%.*]] = prev_dynamic_function_ref @$s23dynamically_replaceable5KlassC11replacementyyF + // CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable5KlassC08dynamic_B0yyF"] [ossa] @$s23dynamically_replacable5KlassC11replacementyyF : $@convention(method) (@guaranteed Klass) -> () { + // CHECK: [[FN:%.*]] = prev_dynamic_function_ref @$s23dynamically_replacable5KlassC11replacementyyF // CHECK: apply [[FN]](%0) : $@convention(method) (@guaranteed Klass) -> () // CHECK: [[METHOD:%.*]] = class_method %0 : $Klass, #Klass.dynamic_replaceable2 : // CHECK: = apply [[METHOD]](%0) : $@convention(method) (@guaranteed Klass) -> () // CHECK: return - // NOPREVIOUS-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable5KlassC08dynamic_B0yyF"] [ossa] @$s23dynamically_replaceable5KlassC11replacementyyF : $@convention(method) (@guaranteed Klass) -> () { + // NOPREVIOUS-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable5KlassC08dynamic_B0yyF"] [ossa] @$s23dynamically_replacable5KlassC11replacementyyF : $@convention(method) (@guaranteed Klass) -> () { // NOPREVIOUS: [[FN:%.*]] = class_method %0 : $Klass, #Klass.dynamic_replaceable // NOPREVIOUS: apply [[FN]](%0) : $@convention(method) (@guaranteed Klass) -> () // NOPREVIOUS: [[METHOD:%.*]] = class_method %0 : $Klass, #Klass.dynamic_replaceable2 : @@ -141,24 +141,24 @@ extension Klass { dynamic_replaceable2() } - // CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable5KlassC1cACSi_tcfC"] [ossa] @$s23dynamically_replaceable5KlassC2crACSi_tcfC : $@convention(method) (Int, @thick Klass.Type) -> @owned Klass { - // CHECK: [[FUN:%.*]] = prev_dynamic_function_ref @$s23dynamically_replaceable5KlassC2crACSi_tcfC + // CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable5KlassC1cACSi_tcfC"] [ossa] @$s23dynamically_replacable5KlassC2crACSi_tcfC : $@convention(method) (Int, @thick Klass.Type) -> @owned Klass { + // CHECK: [[FUN:%.*]] = prev_dynamic_function_ref @$s23dynamically_replacable5KlassC2crACSi_tcfC // CHECK: apply [[FUN]]({{.*}}, %1) - // NOPREVIOUS-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable5KlassC1cACSi_tcfC"] [ossa] @$s23dynamically_replaceable5KlassC2crACSi_tcfC : $@convention(method) (Int, @thick Klass.Type) -> @owned Klass { - // NOPREVIOUS: [[FUN:%.*]] = dynamic_function_ref @$s23dynamically_replaceable5KlassC1cACSi_tcfC + // NOPREVIOUS-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable5KlassC1cACSi_tcfC"] [ossa] @$s23dynamically_replacable5KlassC2crACSi_tcfC : $@convention(method) (Int, @thick Klass.Type) -> @owned Klass { + // NOPREVIOUS: [[FUN:%.*]] = dynamic_function_ref @$s23dynamically_replacable5KlassC1cACSi_tcfC // NOPREVIOUS: apply [[FUN]]({{.*}}, %1) @_dynamicReplacement(for: init(c:)) convenience init(cr: Int) { self.init(c: cr + 1) } - // CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable5KlassC1a1bACSi_SitcfC"] [ossa] @$s23dynamically_replaceable5KlassC2ar2brACSi_SitcfC + // CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable5KlassC1a1bACSi_SitcfC"] [ossa] @$s23dynamically_replacable5KlassC2ar2brACSi_SitcfC // CHECK: // dynamic_function_ref Klass.__allocating_init(c:) - // CHECK: [[FUN:%.*]] = dynamic_function_ref @$s23dynamically_replaceable5KlassC1cACSi_tcfC + // CHECK: [[FUN:%.*]] = dynamic_function_ref @$s23dynamically_replacable5KlassC1cACSi_tcfC // CHECK: apply [[FUN]]({{.*}}, %2) - // NOPREVIOUS-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable5KlassC1a1bACSi_SitcfC"] [ossa] @$s23dynamically_replaceable5KlassC2ar2brACSi_SitcfC + // NOPREVIOUS-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable5KlassC1a1bACSi_SitcfC"] [ossa] @$s23dynamically_replacable5KlassC2ar2brACSi_SitcfC // NOPREVIOUS: // dynamic_function_ref Klass.__allocating_init(c:) - // NOPREVIOUS: [[FUN:%.*]] = dynamic_function_ref @$s23dynamically_replaceable5KlassC1cACSi_tcfC + // NOPREVIOUS: [[FUN:%.*]] = dynamic_function_ref @$s23dynamically_replacable5KlassC1cACSi_tcfC // NOPREVIOUS: apply [[FUN]]({{.*}}, %2) @_dynamicReplacement(for: init(a: b:)) convenience init(ar: Int, br: Int) { @@ -169,20 +169,20 @@ extension Klass { init(xr: Int) { } -// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable5KlassC08dynamic_B4_varSivg"] [ossa] @$s23dynamically_replaceable5KlassC1rSivg : $@convention(method) (@guaranteed Klass) -> Int { +// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable5KlassC08dynamic_B4_varSivg"] [ossa] @$s23dynamically_replacable5KlassC1rSivg : $@convention(method) (@guaranteed Klass) -> Int { // CHECK: bb0([[ARG:%.*]] : @guaranteed $Klass): -// CHECK: [[ORIG:%.*]] = prev_dynamic_function_ref @$s23dynamically_replaceable5KlassC1rSivg +// CHECK: [[ORIG:%.*]] = prev_dynamic_function_ref @$s23dynamically_replacable5KlassC1rSivg // CHECK: apply [[ORIG]]([[ARG]]) : $@convention(method) (@guaranteed Klass) -> Int -// NOPREVIOUS-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable5KlassC08dynamic_B4_varSivg"] [ossa] @$s23dynamically_replaceable5KlassC1rSivg : $@convention(method) (@guaranteed Klass) -> Int { +// NOPREVIOUS-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable5KlassC08dynamic_B4_varSivg"] [ossa] @$s23dynamically_replacable5KlassC1rSivg : $@convention(method) (@guaranteed Klass) -> Int { // NOPREVIOUS: bb0([[ARG:%.*]] : @guaranteed $Klass): // NOPREVIOUS: [[ORIG:%.*]] = class_method [[ARG]] : $Klass, #Klass.dynamic_replaceable_var!getter // NOPREVIOUS: apply [[ORIG]]([[ARG]]) : $@convention(method) (@guaranteed Klass) -> Int -// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable5KlassC08dynamic_B4_varSivs"] [ossa] @$s23dynamically_replaceable5KlassC1rSivs : $@convention(method) (Int, @guaranteed Klass) -> () { +// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable5KlassC08dynamic_B4_varSivs"] [ossa] @$s23dynamically_replacable5KlassC1rSivs : $@convention(method) (Int, @guaranteed Klass) -> () { // CHECK: bb0({{.*}} : $Int, [[SELF:%.*]] : @guaranteed $Klass): -// CHECK: [[ORIG:%.*]] = prev_dynamic_function_ref @$s23dynamically_replaceable5KlassC1rSivs +// CHECK: [[ORIG:%.*]] = prev_dynamic_function_ref @$s23dynamically_replacable5KlassC1rSivs // CHECK: apply [[ORIG]]({{.*}}, [[SELF]]) : $@convention(method) -// NOPREVIOUS-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable5KlassC08dynamic_B4_varSivs"] [ossa] @$s23dynamically_replaceable5KlassC1rSivs : $@convention(method) (Int, @guaranteed Klass) -> () { +// NOPREVIOUS-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable5KlassC08dynamic_B4_varSivs"] [ossa] @$s23dynamically_replacable5KlassC1rSivs : $@convention(method) (Int, @guaranteed Klass) -> () { // NOPREVIOUS: bb0({{.*}} : $Int, [[SELF:%.*]] : @guaranteed $Klass): // NOPREVIOUS: [[ORIG:%.*]] = class_method [[SELF]] : $Klass, #Klass.dynamic_replaceable_var!setter // NOPREVIOUS: apply [[ORIG]]({{.*}}, [[SELF]]) : $@convention(method) @@ -196,14 +196,14 @@ extension Klass { } } -// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable5KlassCyS2icig"] [ossa] @$s23dynamically_replaceable5KlassC1xS2i_tcig +// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable5KlassCyS2icig"] [ossa] @$s23dynamically_replacable5KlassC1xS2i_tcig // CHECK: bb0({{.*}} : $Int, [[SELF:%.*]] : @guaranteed $Klass): -// CHECK: [[ORIG:%.*]] = prev_dynamic_function_ref @$s23dynamically_replaceable5KlassC1xS2i_tcig +// CHECK: [[ORIG:%.*]] = prev_dynamic_function_ref @$s23dynamically_replacable5KlassC1xS2i_tcig // CHECK: apply [[ORIG]]({{.*}}, [[SELF]]) : $@convention(method) (Int, @guaranteed Klass) -> Int -// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable5KlassCyS2icis"] [ossa] @$s23dynamically_replaceable5KlassC1xS2i_tcis +// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable5KlassCyS2icis"] [ossa] @$s23dynamically_replacable5KlassC1xS2i_tcis // CHECK: bb0({{.*}} : $Int, {{.*}} : $Int, [[SELF:%.*]] : @guaranteed $Klass): -// CHECK: [[ORIG:%.*]] = prev_dynamic_function_ref @$s23dynamically_replaceable5KlassC1xS2i_tcis +// CHECK: [[ORIG:%.*]] = prev_dynamic_function_ref @$s23dynamically_replacable5KlassC1xS2i_tcis // CHECK: apply [[ORIG]]({{.*}}, {{.*}}, [[SELF]]) : $@convention(method) (Int, Int, @guaranteed Klass) -> () @_dynamicReplacement(for: subscript(_:)) @@ -219,30 +219,30 @@ extension Klass { extension Struct { - // CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable6StructV08dynamic_B0yyF"] [ossa] @$s23dynamically_replaceable6StructV11replacementyyF : $@convention(method) (Struct) -> () { - // CHECK: [[FUN:%.*]] = prev_dynamic_function_ref @$s23dynamically_replaceable6StructV11replacementyyF + // CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable6StructV08dynamic_B0yyF"] [ossa] @$s23dynamically_replacable6StructV11replacementyyF : $@convention(method) (Struct) -> () { + // CHECK: [[FUN:%.*]] = prev_dynamic_function_ref @$s23dynamically_replacable6StructV11replacementyyF // CHECK: apply [[FUN]](%0) : $@convention(method) (Struct) -> () @_dynamicReplacement(for: dynamic_replaceable()) func replacement() { dynamic_replaceable() } - // CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable6StructV1xACSi_tcfC"] [ossa] @$s23dynamically_replaceable6StructV1yACSi_tcfC : $@convention(method) (Int, @thin Struct.Type) -> Struct { - // CHECK: [[FUN:%.*]] = prev_dynamic_function_ref @$s23dynamically_replaceable6StructV1yACSi_tcfC + // CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable6StructV1xACSi_tcfC"] [ossa] @$s23dynamically_replacable6StructV1yACSi_tcfC : $@convention(method) (Int, @thin Struct.Type) -> Struct { + // CHECK: [[FUN:%.*]] = prev_dynamic_function_ref @$s23dynamically_replacable6StructV1yACSi_tcfC // CHECK: apply [[FUN]]({{.*}}, %1) @_dynamicReplacement(for: init(x:)) init(y: Int) { self.init(x: y + 1) } -// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable6StructV08dynamic_B4_varSivg"] [ossa] @$s23dynamically_replaceable6StructV1rSivg +// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable6StructV08dynamic_B4_varSivg"] [ossa] @$s23dynamically_replacable6StructV1rSivg // CHECK: bb0([[ARG:%.*]] : $Struct): -// CHECK: [[ORIG:%.*]] = prev_dynamic_function_ref @$s23dynamically_replaceable6StructV1rSivg +// CHECK: [[ORIG:%.*]] = prev_dynamic_function_ref @$s23dynamically_replacable6StructV1rSivg // CHECK: apply [[ORIG]]([[ARG]]) : $@convention(method) (Struct) -> Int -// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable6StructV08dynamic_B4_varSivs"] [ossa] @$s23dynamically_replaceable6StructV1rSivs +// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable6StructV08dynamic_B4_varSivs"] [ossa] @$s23dynamically_replacable6StructV1rSivs // CHECK: bb0({{.*}} : $Int, [[ARG:%.*]] : $*Struct): // CHECK: [[BA:%.*]] = begin_access [modify] [unknown] [[ARG]] : $*Struct -// CHECK: [[ORIG:%.*]] = prev_dynamic_function_ref @$s23dynamically_replaceable6StructV1rSivs +// CHECK: [[ORIG:%.*]] = prev_dynamic_function_ref @$s23dynamically_replacable6StructV1rSivs // CHECK: apply [[ORIG]]({{.*}}, [[BA]]) : $@convention(method) (Int, @inout Struct) -> () // CHECK: end_access [[BA]] : $*Struct @_dynamicReplacement(for: dynamic_replaceable_var) @@ -255,15 +255,15 @@ extension Struct { } } -// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable6StructVyS2icig"] [ossa] @$s23dynamically_replaceable6StructV1xS2i_tcig +// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable6StructVyS2icig"] [ossa] @$s23dynamically_replacable6StructV1xS2i_tcig // CHECK: bb0({{.*}} : $Int, [[SELF:%.*]] : $Struct): -// CHECK: [[ORIG:%.*]] = prev_dynamic_function_ref @$s23dynamically_replaceable6StructV1xS2i_tcig +// CHECK: [[ORIG:%.*]] = prev_dynamic_function_ref @$s23dynamically_replacable6StructV1xS2i_tcig // CHECK: apply [[ORIG]]({{.*}}, [[SELF]]) : $@convention(method) (Int, Struct) -> Int -// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable6StructVyS2icis"] [ossa] @$s23dynamically_replaceable6StructV1xS2i_tcis +// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable6StructVyS2icis"] [ossa] @$s23dynamically_replacable6StructV1xS2i_tcis // CHECK: bb0({{.*}} : $Int, {{.*}} : $Int, [[SELF:%.*]] : $*Struct): // CHECK: [[BA:%.*]] = begin_access [modify] [unknown] [[SELF]] : $*Struct -// CHECK: [[ORIG:%.*]] = prev_dynamic_function_ref @$s23dynamically_replaceable6StructV1xS2i_tcis +// CHECK: [[ORIG:%.*]] = prev_dynamic_function_ref @$s23dynamically_replacable6StructV1xS2i_tcis // CHECK: apply [[ORIG]]({{.*}}, {{.*}}, [[BA]]) : $@convention(method) (Int, Int, @inout Struct) -> () // CHECK: end_access [[BA]] : $*Struct @@ -301,8 +301,8 @@ struct GenericS { } } -// CHECK-LABEL: sil private [dynamically_replacable] [ossa] @$s23dynamically_replaceable8GenericSV22property_with_observerSivW -// CHECK-LABEL: sil private [dynamically_replacable] [ossa] @$s23dynamically_replaceable8GenericSV22property_with_observerSivw +// CHECK-LABEL: sil private [dynamically_replacable] [ossa] @$s23dynamically_replacable8GenericSV22property_with_observerSivW +// CHECK-LABEL: sil private [dynamically_replacable] [ossa] @$s23dynamically_replacable8GenericSV22property_with_observerSivw dynamic var property_with_observer : Int { didSet { } @@ -314,24 +314,24 @@ struct GenericS { extension GenericS { -// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable8GenericSV08dynamic_B0yyF"] [ossa] @$s23dynamically_replaceable8GenericSV11replacementyyF -// CHECK: prev_dynamic_function_ref @$s23dynamically_replaceable8GenericSV11replacementyyF +// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable8GenericSV08dynamic_B0yyF"] [ossa] @$s23dynamically_replacable8GenericSV11replacementyyF +// CHECK: prev_dynamic_function_ref @$s23dynamically_replacable8GenericSV11replacementyyF @_dynamicReplacement(for: dynamic_replaceable()) func replacement() { dynamic_replaceable() } -// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable8GenericSV1xACyxGSi_tcfC"] [ossa] @$s23dynamically_replaceable8GenericSV1yACyxGSi_tcfC -// CHECK: prev_dynamic_function_ref @$s23dynamically_replaceable8GenericSV1yACyxGSi_tcfC +// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable8GenericSV1xACyxGSi_tcfC"] [ossa] @$s23dynamically_replacable8GenericSV1yACyxGSi_tcfC +// CHECK: prev_dynamic_function_ref @$s23dynamically_replacable8GenericSV1yACyxGSi_tcfC @_dynamicReplacement(for: init(x:)) init(y: Int) { self.init(x: y + 1) } -// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable8GenericSV08dynamic_B4_varSivg"] [ossa] @$s23dynamically_replaceable8GenericSV1rSivg -// CHECK: prev_dynamic_function_ref @$s23dynamically_replaceable8GenericSV1rSivg +// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable8GenericSV08dynamic_B4_varSivg"] [ossa] @$s23dynamically_replacable8GenericSV1rSivg +// CHECK: prev_dynamic_function_ref @$s23dynamically_replacable8GenericSV1rSivg -// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable8GenericSV08dynamic_B4_varSivs"] [ossa] @$s23dynamically_replaceable8GenericSV1rSivs -// CHECK: prev_dynamic_function_ref @$s23dynamically_replaceable8GenericSV1rSivs +// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable8GenericSV08dynamic_B4_varSivs"] [ossa] @$s23dynamically_replacable8GenericSV1rSivs +// CHECK: prev_dynamic_function_ref @$s23dynamically_replacable8GenericSV1rSivs @_dynamicReplacement(for: dynamic_replaceable_var) var r : Int { get { @@ -342,11 +342,11 @@ extension GenericS { } } -// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable8GenericSVyS2icig"] [ossa] @$s23dynamically_replaceable8GenericSV1xS2i_tcig -// CHECK: prev_dynamic_function_ref @$s23dynamically_replaceable8GenericSV1xS2i_tcig +// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable8GenericSVyS2icig"] [ossa] @$s23dynamically_replacable8GenericSV1xS2i_tcig +// CHECK: prev_dynamic_function_ref @$s23dynamically_replacable8GenericSV1xS2i_tcig -// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replaceable8GenericSVyS2icis"] [ossa] @$s23dynamically_replaceable8GenericSV1xS2i_tcis -// CHECK: prev_dynamic_function_ref @$s23dynamically_replaceable8GenericSV1xS2i_tcis +// CHECK-LABEL: sil hidden [dynamic_replacement_for "$s23dynamically_replacable8GenericSVyS2icis"] [ossa] @$s23dynamically_replacable8GenericSV1xS2i_tcis +// CHECK: prev_dynamic_function_ref @$s23dynamically_replacable8GenericSV1xS2i_tcis @_dynamicReplacement(for: subscript(_:)) subscript(x y: Int) -> Int { get { @@ -357,8 +357,8 @@ extension GenericS { } } -// CHECK-LABEL: sil private [dynamic_replacement_for "$s23dynamically_replaceable8GenericSV22property_with_observerSivW"] [ossa] @$s23dynamically_replaceable8GenericSV34replacement_property_with_observerSivW -// CHECK-LABEL: sil private [dynamic_replacement_for "$s23dynamically_replaceable8GenericSV22property_with_observerSivw"] [ossa] @$s23dynamically_replaceable8GenericSV34replacement_property_with_observerSivw +// CHECK-LABEL: sil private [dynamic_replacement_for "$s23dynamically_replacable8GenericSV22property_with_observerSivW"] [ossa] @$s23dynamically_replacable8GenericSV34replacement_property_with_observerSivW +// CHECK-LABEL: sil private [dynamic_replacement_for "$s23dynamically_replacable8GenericSV22property_with_observerSivw"] [ossa] @$s23dynamically_replacable8GenericSV34replacement_property_with_observerSivw @_dynamicReplacement(for: property_with_observer) var replacement_property_with_observer : Int { didSet { @@ -369,18 +369,18 @@ extension GenericS { } dynamic var globalX = 0 -// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable7globalXSivg : $@convention(thin) () -> Int -// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable7globalXSivs : $@convention(thin) (Int) -> () -// CHECK-LABEL: sil hidden [ossa] @$s23dynamically_replaceable7getsetXyS2iF -// CHECK: dynamic_function_ref @$s23dynamically_replaceable7globalXSivs -// CHECK: dynamic_function_ref @$s23dynamically_replaceable7globalXSivg +// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replacable7globalXSivg : $@convention(thin) () -> Int +// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replacable7globalXSivs : $@convention(thin) (Int) -> () +// CHECK-LABEL: sil hidden [ossa] @$s23dynamically_replacable7getsetXyS2iF +// CHECK: dynamic_function_ref @$s23dynamically_replacable7globalXSivs +// CHECK: dynamic_function_ref @$s23dynamically_replacable7globalXSivg func getsetX(_ x: Int) -> Int { globalX = x return globalX } -// CHECK-LABEL: sil hidden [ossa] @$s23dynamically_replaceable18funcWithDefaultArgyySSFfA_ -// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable18funcWithDefaultArgyySSF +// CHECK-LABEL: sil hidden [ossa] @$s23dynamically_replacable18funcWithDefaultArgyySSFfA_ +// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replacable18funcWithDefaultArgyySSF dynamic func funcWithDefaultArg(_ arg : String = String("hello")) { print("hello") } @@ -390,10 +390,10 @@ dynamic func funcWithDefaultArg(_ arg : String = String("hello")) { func foobar() { } -// IMPLICIT-LABEL: sil [dynamically_replacable] [ossa] @$s23dynamically_replaceable16testWithLocalFunyyF -// IMPLICIT-LABEL: sil private [ossa] @$s23dynamically_replaceable16testWithLocalFunyyF05localF0L_yyF -// IMPLICIT-LABEL: sil private [ossa] @$s23dynamically_replaceable16testWithLocalFunyyF05localF0L_yyF0geF0L_yyF -// IMPLICIT-LABEL: sil private [ossa] @$s23dynamically_replaceable16testWithLocalFunyyFyycfU_ +// IMPLICIT-LABEL: sil [dynamically_replacable] [ossa] @$s23dynamically_replacable16testWithLocalFunyyF +// IMPLICIT-LABEL: sil private [ossa] @$s23dynamically_replacable16testWithLocalFunyyF05localF0L_yyF +// IMPLICIT-LABEL: sil private [ossa] @$s23dynamically_replacable16testWithLocalFunyyF05localF0L_yyF0geF0L_yyF +// IMPLICIT-LABEL: sil private [ossa] @$s23dynamically_replacable16testWithLocalFunyyFyycfU_ public func testWithLocalFun() { func localFun() { func localLocalFun() { print("bar") } @@ -414,7 +414,7 @@ struct WrapperWithInitialValue { } } -// CHECK-NOT: sil hidden [ossa] @$s23dynamically_replaceable10SomeStructV1tSbvpfP +// CHECK-NOT: sil hidden [ossa] @$s23dynamically_replacable10SomeStructV1tSbvpfP public struct SomeStruct { @WrapperWithInitialValue var t = false }