From e49e1c575755fa8d87f9fd00fb92ca97cdecb28d Mon Sep 17 00:00:00 2001 From: Alexander Cyon Date: Wed, 3 Jul 2024 19:58:06 +0200 Subject: [PATCH] Fix thousands of typos across hundreds of files. --- CMakeLists.txt | 2 +- .../FunctionPasses/AsyncDemotion.swift | 6 +- .../FunctionPasses/ComputeSideEffects.swift | 4 +- .../LifetimeDependenceScopeFixup.swift | 8 +- .../FunctionPasses/StackPromotion.swift | 2 +- .../SimplifyBeginBorrow.swift | 2 +- .../SimplifyLoad.swift | 4 +- .../Optimizer/PassManager/Context.swift | 2 +- .../Optimizer/Utilities/AddressUtils.swift | 6 +- .../Optimizer/Utilities/BorrowUtils.swift | 6 +- .../Optimizer/Utilities/EscapeUtils.swift | 2 +- .../Utilities/LifetimeDependenceUtils.swift | 6 +- .../Utilities/LocalVariableUtils.swift | 8 +- .../Optimizer/Utilities/OptUtils.swift | 2 +- .../Utilities/OwnershipLiveness.swift | 6 +- .../Optimizer/Utilities/Verifier.swift | 8 +- .../Sources/SIL/Effects.swift | 6 +- .../Sources/SIL/Operand.swift | 2 +- .../Sources/SIL/Utilities/AccessUtils.swift | 2 +- .../Sources/SIL/Utilities/WalkUtils.swift | 2 +- SwiftCompilerSources/Sources/SIL/Value.swift | 2 +- SwiftCompilerSources/force_lib.c | 2 +- _typos.toml | 263 ++++++++++++++++++ benchmark/scripts/compare_perf_tests.py | 2 +- benchmark/scripts/test_compare_perf_tests.py | 2 +- benchmark/scripts/test_utils.py | 2 +- benchmark/single-source/SortIntPyramids.swift | 2 +- cmake/modules/SwiftConfigureSDK.cmake | 2 +- .../UserGuide-CallingSwiftFromC++.md | 18 +- docs/EmbeddedSwift/UserManual.md | 4 +- docs/Generics/chapters/basic-operation.tex | 2 +- docs/Generics/chapters/completion.tex | 6 +- docs/Generics/chapters/conformance-paths.tex | 2 +- docs/Generics/chapters/declarations.tex | 4 +- docs/Generics/chapters/extensions.tex | 2 +- docs/Generics/chapters/generic-signatures.tex | 2 +- docs/Generics/chapters/monoids.tex | 2 +- .../chapters/symbols-terms-and-rules.tex | 2 +- docs/Generics/chapters/type-resolution.tex | 2 +- docs/SIL.rst | 10 +- docs/Swift3Compatibility.md | 2 +- .../swift-c/DependencyScan/DependencyScan.h | 2 +- include/swift/ABI/GenericContext.h | 8 +- include/swift/ABI/MetadataValues.h | 2 +- include/swift/ABI/Task.h | 2 +- .../swift/APIDigester/ModuleAnalyzerNodes.h | 4 +- include/swift/AST/ASTContext.h | 2 +- include/swift/AST/ASTSynthesis.h | 2 +- include/swift/AST/AccessScope.h | 2 +- include/swift/AST/AutoDiff.h | 2 +- include/swift/AST/Availability.h | 8 +- include/swift/AST/Decl.h | 8 +- include/swift/AST/DeclAttr.def | 2 +- include/swift/AST/DiagnosticsFrontend.def | 2 +- include/swift/AST/DiagnosticsSIL.def | 2 +- include/swift/AST/DiagnosticsSema.def | 10 +- include/swift/AST/Expr.h | 2 +- include/swift/AST/FileUnit.h | 4 +- include/swift/AST/Module.h | 2 +- include/swift/AST/ModuleDependencies.h | 4 +- include/swift/AST/PotentialMacroExpansions.h | 4 +- include/swift/AST/ProtocolConformance.h | 2 +- include/swift/AST/SourceFile.h | 2 +- include/swift/AST/TypeCheckRequests.h | 4 +- include/swift/AST/TypeRepr.h | 2 +- include/swift/AST/Types.h | 2 +- include/swift/Basic/Assertions.h | 4 +- include/swift/Basic/Features.def | 2 +- include/swift/Basic/LangOptions.h | 6 +- include/swift/Basic/MathUtils.h | 2 +- include/swift/Basic/SourceManager.h | 4 +- .../DependencyScan/DependencyScanningTool.h | 2 +- include/swift/Frontend/DiagnosticHelper.h | 2 +- include/swift/Frontend/Frontend.h | 2 +- include/swift/IDE/CancellableResult.h | 2 +- include/swift/IDE/CodeCompletionResultType.h | 2 +- include/swift/IDE/CompletionLookup.h | 4 +- include/swift/IDE/IDEBridging.h | 2 +- include/swift/IDE/PostfixCompletion.h | 6 +- include/swift/IDE/SyntaxModel.h | 2 +- include/swift/IDE/Utils.h | 2 +- include/swift/IDETool/IDEInspectionInstance.h | 6 +- include/swift/Option/Options.td | 4 +- include/swift/Parse/IDEInspectionCallbacks.h | 2 +- include/swift/Parse/Parser.h | 2 +- include/swift/Refactoring/RenameLoc.h | 2 +- .../RuntimeHeaders/llvm-c/Types.h | 2 +- .../llvm/Support/BinaryByteStream.h | 2 +- .../RuntimeHeaders/llvm/Support/ConvertUTF.h | 2 +- .../swift/RemoteInspection/TypeRefBuilder.h | 4 +- include/swift/Runtime/Metadata.h | 2 +- include/swift/SIL/DebugUtils.h | 4 +- include/swift/SIL/InstructionUtils.h | 4 +- include/swift/SIL/OSSALifetimeCompletion.h | 4 +- include/swift/SIL/OwnershipUseVisitor.h | 4 +- include/swift/SIL/OwnershipUtils.h | 4 +- include/swift/SIL/Projection.h | 10 +- include/swift/SIL/PrunedLiveness.h | 6 +- include/swift/SIL/SILBitfield.h | 2 +- include/swift/SIL/SILCloner.h | 2 +- include/swift/SIL/SILInstruction.h | 12 +- include/swift/SIL/SILLinkage.h | 4 +- include/swift/SIL/SILNodes.def | 2 +- include/swift/SIL/SILValue.h | 2 +- include/swift/SIL/ScopedAddressUtils.h | 2 +- include/swift/SIL/Test.h | 2 +- .../SILOptimizer/Analysis/Reachability.h | 2 +- .../SILOptimizer/Analysis/RegionAnalysis.h | 8 +- .../swift/SILOptimizer/OptimizerBridging.h | 6 +- .../SILOptimizer/Utils/InstructionDeleter.h | 2 +- .../swift/SILOptimizer/Utils/PartitionUtils.h | 14 +- include/swift/Sema/ConstraintLocator.h | 2 +- include/swift/Sema/ConstraintSystem.h | 2 +- include/swift/Sema/IDETypeChecking.h | 2 +- include/swift/Serialization/ScanningLoaders.h | 2 +- include/swift/Subsystems.h | 2 +- include/swift/Threading/Impl/chrono_utils.h | 2 +- lib/AST/ASTBridging.cpp | 2 +- lib/AST/ASTContext.cpp | 4 +- lib/AST/ASTPrinter.cpp | 4 +- lib/AST/ASTWalker.cpp | 2 +- lib/AST/Decl.cpp | 4 +- lib/AST/DiagnosticConsumer.cpp | 2 +- lib/AST/GenericSignature.cpp | 2 +- lib/AST/NameLookup.cpp | 2 +- .../RequirementMachine/HomotopyReduction.cpp | 2 +- lib/AST/Type.cpp | 4 +- lib/ASTGen/Package.swift | 8 +- lib/ASTGen/Sources/ASTGen/DeclAttrs.swift | 2 +- .../Sources/ASTGen/DiagnosticsBridge.swift | 2 +- lib/ASTGen/Sources/ASTGen/Macros.swift | 4 +- lib/ASTGen/Sources/ASTGen/PluginHost.swift | 6 +- lib/ASTGen/Sources/ASTGen/Regex.swift | 2 +- lib/Basic/BasicBridging.cpp | 2 +- lib/Basic/Program.cpp | 2 +- lib/ClangImporter/ClangAdapter.h | 2 +- lib/ClangImporter/ClangImporter.cpp | 6 +- lib/ClangImporter/ImportType.cpp | 2 +- lib/ClangImporter/ImporterImpl.h | 2 +- .../ModuleDependencyScanner.cpp | 8 +- lib/Frontend/CASOutputBackends.cpp | 2 +- lib/Frontend/CachingUtils.cpp | 2 +- lib/Frontend/CompilerInvocation.cpp | 12 +- lib/Frontend/DiagnosticHelper.cpp | 2 +- lib/Frontend/ModuleInterfaceLoader.cpp | 2 +- lib/Frontend/ModuleInterfaceSupport.cpp | 2 +- lib/FrontendTool/FrontendTool.cpp | 4 +- lib/IDE/CodeCompletion.cpp | 10 +- lib/IDE/CodeCompletionCache.cpp | 12 +- lib/IDE/CodeCompletionContext.cpp | 2 +- lib/IDE/CodeCompletionDiagnostics.cpp | 4 +- lib/IDE/CodeCompletionDiagnostics.h | 4 +- lib/IDE/CodeCompletionResultPrinter.cpp | 2 +- lib/IDE/CompletionLookup.cpp | 20 +- lib/IDE/CompletionOverrideLookup.cpp | 2 +- lib/IDE/CursorInfo.cpp | 2 +- lib/IDE/ExprContextAnalysis.cpp | 10 +- lib/IDE/ExprContextAnalysis.h | 2 +- lib/IDE/Formatting.cpp | 4 +- lib/IDE/IDETypeChecking.cpp | 2 +- lib/IDE/ModuleInterfacePrinting.cpp | 2 +- lib/IDE/PostfixCompletion.cpp | 4 +- lib/IDE/SyntaxModel.cpp | 2 +- lib/IDE/TypeCheckCompletionCallback.cpp | 4 +- lib/IDE/TypeContextInfo.cpp | 4 +- lib/IDE/Utils.cpp | 2 +- lib/IDETool/CompileInstance.cpp | 8 +- lib/IDETool/DependencyChecking.cpp | 4 +- lib/IDETool/IDEInspectionInstance.cpp | 4 +- lib/IRGen/BitPatternBuilder.h | 2 +- lib/IRGen/ClassLayout.cpp | 2 +- lib/IRGen/Field.h | 2 +- lib/IRGen/GenCall.cpp | 4 +- lib/IRGen/GenConstant.cpp | 2 +- lib/IRGen/GenCoverage.cpp | 2 +- lib/IRGen/GenDecl.cpp | 4 +- lib/IRGen/GenMeta.cpp | 4 +- lib/IRGen/GenObjC.cpp | 2 +- lib/IRGen/GenPack.cpp | 6 +- lib/IRGen/GenProto.cpp | 4 +- lib/IRGen/IRABIDetailsProvider.cpp | 4 +- lib/IRGen/IRGen.cpp | 2 +- lib/IRGen/IRGenDebugInfo.cpp | 2 +- lib/IRGen/IRGenFunction.h | 2 +- lib/IRGen/IRGenSIL.cpp | 12 +- lib/IRGen/Linking.cpp | 2 +- lib/IRGen/LoadableByAddress.cpp | 6 +- lib/IRGen/TBDGen.cpp | 8 +- lib/IRGen/TypeLayout.cpp | 2 +- lib/LLVMPasses/LLVMMergeFunctions.cpp | 2 +- lib/Localization/LocalizationFormat.cpp | 2 +- .../ObservationMacros/Extensions.swift | 4 +- lib/Parse/ParseDecl.cpp | 6 +- lib/Parse/ParsePattern.cpp | 2 +- lib/PrintAsClang/ClangSyntaxPrinter.h | 2 +- lib/PrintAsClang/ModuleContentsWriter.cpp | 2 +- lib/PrintAsClang/PrintClangFunction.cpp | 2 +- lib/PrintAsClang/PrintClangValueType.cpp | 4 +- lib/Refactoring/Async/AsyncConverter.cpp | 20 +- lib/Refactoring/Async/AsyncRefactoring.h | 20 +- lib/Refactoring/Async/CallbackClassifier.cpp | 4 +- lib/Refactoring/Async/CallbackCondition.cpp | 2 +- lib/Refactoring/ConvertToSwitchStmt.cpp | 6 +- lib/Refactoring/FillProtocolStubs.cpp | 2 +- lib/Refactoring/TrailingClosure.cpp | 2 +- lib/SIL/IR/AbstractionPattern.cpp | 2 +- lib/SIL/IR/SILFunction.cpp | 12 +- lib/SIL/IR/SILPrinter.cpp | 2 +- lib/SIL/IR/SILProfiler.cpp | 6 +- lib/SIL/IR/TypeLowering.cpp | 4 +- lib/SIL/Parser/ParseSIL.cpp | 2 +- lib/SIL/Parser/ParseTestSpecification.cpp | 6 +- .../Utils/FieldSensitivePrunedLiveness.cpp | 2 +- lib/SIL/Utils/MemAccessUtils.cpp | 2 +- lib/SIL/Utils/OSSALifetimeCompletion.cpp | 6 +- lib/SIL/Utils/OptimizationRemark.cpp | 6 +- lib/SIL/Utils/OwnershipUtils.cpp | 2 +- lib/SIL/Utils/Projection.cpp | 22 +- lib/SIL/Utils/SILBridging.cpp | 2 +- lib/SIL/Verifier/SILVerifier.cpp | 10 +- lib/SILGen/ManagedValue.h | 2 +- lib/SILGen/RValue.h | 2 +- lib/SILGen/SILGen.cpp | 2 +- lib/SILGen/SILGenApply.cpp | 2 +- lib/SILGen/SILGenConcurrency.cpp | 2 +- lib/SILGen/SILGenConstructor.cpp | 2 +- lib/SILGen/SILGenFunction.h | 8 +- lib/SILGen/SILGenLValue.cpp | 2 +- lib/SILGen/SILGenPattern.cpp | 2 +- lib/SILGen/SILGenPoly.cpp | 2 +- lib/SILGen/SILGenProlog.cpp | 2 +- lib/SILGen/SILGenTopLevel.h | 2 +- lib/SILGen/SILGenType.cpp | 2 +- lib/SILGen/TupleGenerators.h | 2 +- .../Analysis/BasicCalleeAnalysis.cpp | 10 +- lib/SILOptimizer/Analysis/RegionAnalysis.cpp | 14 +- .../Differentiation/JVPCloner.cpp | 4 +- .../Differentiation/LinearMapInfo.cpp | 2 +- .../Differentiation/PullbackCloner.cpp | 8 +- .../Differentiation/VJPCloner.cpp | 2 +- lib/SILOptimizer/IPO/ClosureSpecializer.cpp | 4 +- .../IPO/CrossModuleOptimization.cpp | 8 +- .../LoopTransforms/ForEachLoopUnroll.cpp | 2 +- .../Mandatory/DefiniteInitialization.cpp | 6 +- .../Mandatory/DiagnoseLifetimeIssues.cpp | 2 +- .../Mandatory/DiagnoseUnreachable.cpp | 2 +- lib/SILOptimizer/Mandatory/FlowIsolation.cpp | 2 +- lib/SILOptimizer/Mandatory/IRGenPrepare.cpp | 2 +- .../Mandatory/MoveOnlyAddressCheckerUtils.cpp | 6 +- .../MoveOnlyBorrowToDestructureUtils.cpp | 4 +- .../Mandatory/MoveOnlyDiagnostics.h | 2 +- .../Mandatory/OSLogOptimization.cpp | 2 +- .../Mandatory/PerformanceDiagnostics.cpp | 4 +- .../Mandatory/PredictableMemOpt.cpp | 4 +- .../Mandatory/TransferNonSendable.cpp | 4 +- lib/SILOptimizer/PassManager/PassManager.cpp | 2 +- .../SILCombiner/SILCombinerCastVisitors.cpp | 4 +- .../SemanticARC/OwnedToGuaranteedPhiOpt.cpp | 2 +- .../SemanticARC/SemanticARCOpts.cpp | 2 +- lib/SILOptimizer/Transforms/ARCCodeMotion.cpp | 2 +- .../Transforms/AccessEnforcementDom.cpp | 2 +- .../Transforms/AccessEnforcementOpts.cpp | 2 +- lib/SILOptimizer/Transforms/CSE.cpp | 2 +- .../Transforms/DestroyAddrHoisting.cpp | 2 +- lib/SILOptimizer/Transforms/SILMem2Reg.cpp | 2 +- .../Transforms/StringOptimization.cpp | 18 +- .../Transforms/TempRValueElimination.cpp | 4 +- lib/SILOptimizer/Utils/CFGOptUtils.cpp | 2 +- .../Utils/CanonicalizeInstruction.cpp | 2 +- .../Utils/CanonicalizeOSSALifetime.cpp | 2 +- lib/SILOptimizer/Utils/ConstExpr.cpp | 2 +- lib/SILOptimizer/Utils/ConstantFolding.cpp | 2 +- lib/SILOptimizer/Utils/Existential.cpp | 6 +- lib/SILOptimizer/Utils/InstOptUtils.cpp | 2 +- lib/SILOptimizer/Utils/InstructionDeleter.cpp | 2 +- lib/SILOptimizer/Utils/OwnershipOptUtils.cpp | 2 +- .../Utils/PartialApplyCombiner.cpp | 2 +- lib/SILOptimizer/Utils/SILIsolationInfo.cpp | 2 +- lib/SILOptimizer/Utils/VariableNameUtils.cpp | 2 +- lib/Sema/AssociatedTypeInference.cpp | 2 +- lib/Sema/CSBindings.cpp | 10 +- lib/Sema/CSDiagnostics.cpp | 2 +- lib/Sema/CSGen.cpp | 2 +- lib/Sema/CSSimplify.cpp | 22 +- lib/Sema/CSSolver.cpp | 4 +- lib/Sema/CSSyntacticElement.cpp | 12 +- lib/Sema/CodeSynthesis.cpp | 6 +- lib/Sema/ConstraintLocator.cpp | 4 +- lib/Sema/IDETypeCheckingRequests.cpp | 2 +- lib/Sema/ImportResolution.cpp | 2 +- lib/Sema/MiscDiagnostics.cpp | 8 +- lib/Sema/TypeCheckAttr.cpp | 2 +- lib/Sema/TypeCheckAvailability.cpp | 4 +- lib/Sema/TypeCheckConcurrency.cpp | 4 +- lib/Sema/TypeCheckGeneric.cpp | 2 +- lib/Sema/TypeCheckMacros.cpp | 2 +- lib/Sema/TypeCheckProtocol.cpp | 4 +- lib/Sema/TypeCheckRequestFunctions.cpp | 2 +- lib/Sema/TypeCheckStmt.cpp | 4 +- lib/Sema/TypeCheckType.cpp | 6 +- lib/Serialization/DeserializationErrors.h | 2 +- lib/Serialization/SILFormat.h | 2 +- lib/Serialization/Serialization.cpp | 4 +- lib/Serialization/SerializedModuleLoader.cpp | 2 +- lib/Threading/Win32.cpp | 2 +- stdlib/cmake/modules/SwiftSource.cmake | 2 +- stdlib/include/llvm/ADT/STLExtras.h | 4 +- stdlib/include/llvm/Support/MathExtras.h | 4 +- .../StdlibUnicodeUnittest/WordBreaking.swift | 2 +- stdlib/private/SwiftPrivate/CMakeLists.txt | 14 +- .../SwiftPrivateLibcExtras/CMakeLists.txt | 16 +- .../SwiftPrivateLibcExtras/Subprocess.c | 2 +- .../SwiftPrivateThreadExtras/CMakeLists.txt | 16 +- .../SwiftReflectionTest/CMakeLists.txt | 14 +- stdlib/public/Concurrency/Actor.cpp | 2 +- .../Concurrency/CheckedContinuation.swift | 4 +- .../Deque/_UnsafeWrappedBuffer.swift | 2 +- .../Concurrency/TaskGroup+TaskExecutor.swift | 12 +- stdlib/public/Distributed/CMakeLists.txt | 12 +- .../public/Distributed/DistributedActor.swift | 2 +- stdlib/public/Platform/android.modulemap | 2 +- stdlib/public/RemoteInspection/TypeRef.cpp | 2 +- .../Atomics/AtomicMemoryOrderings.swift | 2 +- .../Synchronization/Mutex/LinuxImpl.swift | 8 +- .../public/Synchronization/Mutex/Mutex.swift | 4 +- .../Mutex/MutexUnavailable.swift | 2 +- stdlib/public/core/DiscontiguousSlice.swift | 2 +- stdlib/public/core/Integers.swift | 2 +- stdlib/public/core/Misc.swift | 2 +- .../public/core/StringGraphemeBreaking.swift | 2 +- .../libexec/swift-backtrace/Utils.swift | 2 +- stdlib/public/runtime/Bincompat.cpp | 2 +- stdlib/public/runtime/Metadata.cpp | 4 +- stdlib/public/stubs/Unicode/UnicodeData.cpp | 4 +- .../Compatibility56/CompatibilityOverride.h | 4 +- .../CompatibilityOverrideConcurrency.def | 2 +- .../Compatibility56/Concurrency/Task.cpp | 8 +- .../include/Concurrency/Task.h | 2 +- test/APIJSON/availability.swift | 4 +- test/ASTGen/stmts.swift | 2 +- .../associated_type_inference.swift | 2 +- ...ssociated_type_inference_tautology_4.swift | 2 +- .../issue-65073-substmap.swift | 2 +- test/CAS/bridging-header.swift | 2 +- .../IncompleteTypes/complete-types.m | 2 +- ...y-forward-declaring-complete-swift-types.h | 2 +- test/Concurrency/isolated_parameters.swift | 2 +- ...c_attr_in_type_context_swift5_strict.swift | 4 +- ...ble_objc_attr_in_type_context_swift6.swift | 4 +- test/Concurrency/sending_mangling.swift | 12 +- ...e_closureliterals_isolationinference.swift | 6 +- .../transfernonsendable_sending_results.swift | 2 +- test/ConstExtraction/ExtractCoerce.swift | 6 +- test/Constraints/closures.swift | 2 +- test/Constraints/diagnostics.swift | 2 +- test/Constraints/dynamic_lookup.swift | 2 +- .../type_inference_from_default_exprs.swift | 4 +- test/DebugInfo/sroa_debug_value.sil | 2 +- test/DebugInfo/sroa_mem2reg.sil | 2 +- test/DebugInfo/sroa_mem2reg_tuple.sil | 2 +- test/DebugInfo/variables.swift | 4 +- .../loaded_module_trace_directness_2.swift | 2 +- test/Generics/conditional_conformances.swift | 2 +- .../foo_swift_module.printed.comments.txt | 2 +- test/IDE/Inputs/foo_swift_module.swift | 2 +- .../IDE/Inputs/foo_swift_module_overlay.swift | 2 +- .../OverlayTest.framework/Headers/Overlayed.h | 10 +- .../mock-sdk/OverlayTest.swiftinterface | 4 +- test/IDE/complete_accessor.swift | 2 +- test/IDE/complete_attributes.swift | 8 +- test/IDE/complete_call_arg.swift | 18 +- test/IDE/complete_call_pattern.swift | 6 +- test/IDE/complete_concurrency_specifier.swift | 16 +- test/IDE/complete_constrained.swift | 2 +- test/IDE/complete_constructor.swift | 2 +- test/IDE/complete_crossmodule.swift | 4 +- test/IDE/complete_decl_attribute.swift | 2 +- test/IDE/complete_expr_after_paren.swift | 2 +- test/IDE/complete_from_reexport.swift | 8 +- test/IDE/complete_from_swift_module.swift | 12 +- test/IDE/complete_in_closures.swift | 6 +- test/IDE/complete_inout.swift | 2 +- ..._multiple_trailingclosure_signatures.swift | 2 +- test/IDE/complete_opaque_result.swift | 8 +- test/IDE/complete_overlaymodule.swift | 12 +- test/IDE/complete_shadowing.swift | 4 +- test/IDE/complete_typerelation.swift | 8 +- test/IDE/complete_unresolved_members.swift | 2 +- test/IDE/complete_value_expr.swift | 4 +- .../IDE/conforming-methods-afterclosure.swift | 2 +- test/IDE/local_types.swift | 6 +- test/IDE/merge_local_types.swift | 6 +- test/IDE/structure.swift | 12 +- .../weak_import_availability_helper.swift | 2 +- test/IRGen/big_types_corner_cases.sil | 4 +- test/IRGen/comdat.swift | 2 +- test/IRGen/debug_fragment_merge.sil | 2 +- test/IRGen/dynamic_replaceable.sil | 2 +- test/IRGen/existentials.sil | 2 +- test/IRGen/keypaths.sil | 4 +- .../opaque_result_type_substitution_2.swift | 2 +- test/IRGen/ptrauth-dynamic_replaceable.sil | 4 +- test/IRGen/typed_throws.swift | 2 +- .../typelayout_based_value_operation.sil | 4 +- test/IRGen/weak_import_availability.swift | 8 +- .../unit-custom-output-path-driver.swift | 2 +- .../Index/Store/unit-custom-output-path.swift | 2 +- test/Inputs/lazy_typecheck_client.swift | 2 +- .../Cxx/class/constructors-silgen.swift | 2 +- .../invalid-unsafe-projection-errors.swift | 4 +- .../Interop/Cxx/extern-c/Inputs/inline-func.h | 4 +- .../invalid-retain-operation-errors.swift | 12 +- ...reference-silgen-cxx-objc-ctors+init.swift | 2 +- .../Inputs/class-template-with-typedef.h | 2 +- .../Cxx/templates/Inputs/function-templates.h | 2 +- ...swift-primitive-functions-c-bridging.swift | 4 +- .../swift-primitive-functions-execution.c | 4 +- ...ift-primitive-functions-cxx-bridging.swift | 6 +- .../swift-primitive-functions-execution.cpp | 2 +- ...in-cxx-no-diagnostics-generated-header.cpp | 2 +- test/Interpreter/SDK/Inputs/OldABI/OldABI.mm | 2 +- test/Interpreter/init_accessors.swift | 20 +- test/Macros/lit.local.cfg | 2 +- test/Macros/macro_expand_closure.swift | 2 +- .../Macros/macro_plugin_disable_sandbox.swift | 2 +- test/Macros/macro_swiftdeps.swift | 2 +- .../async_sequence_conformance.swift | 4 +- test/ModuleInterface/features.swift | 2 +- .../availability_query_unavailability.swift | 2 +- .../diagnostic_missing_func_keyword.swift | 2 +- test/Profiler/coverage_result_builder.swift | 6 +- test/Profiler/unmapped.swift | 4 +- test/Prototypes/BigInt.swift | 6 +- .../borrow_extract_validate.sil | 18 +- .../SIL/OwnershipVerifier/borrow_validate.sil | 20 +- test/SIL/Parser/basic.sil | 4 +- .../Serialization/dynamically_replaceable.sil | 4 +- test/SIL/Serialization/public_external.sil | 2 +- test/SILGen/dynamically_replaceable.swift | 56 ++-- test/SILGen/extern_c.swift | 4 +- test/SILGen/initializers.swift | 2 +- .../noimplicitcopy_borrowing_parameters.swift | 2 +- .../SILGen/objc_dynamic_replacement_ext.swift | 12 +- .../package_allow_non_resilient_access.swift | 16 +- test/SILOptimizer/abcopt_large_cfg.sil.gyb | 2 +- .../access_enforcement_selection.sil | 4 +- test/SILOptimizer/access_storage_analysis.sil | 2 +- test/SILOptimizer/address_lowering.sil | 2 +- test/SILOptimizer/address_lowering_phi.sil | 4 +- test/SILOptimizer/capture_propagation.sil | 2 +- .../devirt_generic_witness_method.sil | 2 +- ...evirt_generic_witness_method_ownership.sil | 2 +- .../dictionary_lookup_with_default.swift | 2 +- .../exclusivity_static_diagnostics.sil | 2 +- test/SILOptimizer/forwarding_utils.sil | 6 +- test/SILOptimizer/function_uses.sil | 2 +- test/SILOptimizer/hoist_destroy_addr.sil | 2 +- test/SILOptimizer/init_accessors.swift | 2 +- test/SILOptimizer/let-property-lowering.swift | 2 +- test/SILOptimizer/licm.sil | 4 +- test/SILOptimizer/moveonly_addresschecker.sil | 2 +- test/SILOptimizer/opaque_values_Onone.swift | 8 +- test/SILOptimizer/side_effects.sil | 12 +- .../sil_combine_concrete_existential.sil | 4 +- test/SILOptimizer/simplify_begin_borrow.sil | 6 +- test/SILOptimizer/simplify_cfg_checkcast.sil | 2 +- .../simplify_cfg_ossa_jump_threading.sil | 4 +- .../specialize_opaque_type_archetypes.swift | 4 +- test/SILOptimizer/stack_protection.swift | 6 +- test/SPI/accidental-reexport.swift | 14 +- ...onal_deps_of_binary_testable_imports.swift | 2 +- .../optional_deps_of_testable_imports.swift | 2 +- .../optional_transitive_dep_load_fail.swift | 2 +- test/Sema/accessibility.swift | 10 +- test/Sema/availability_versions.swift | 2 +- .../Sema/availability_versions_objc_api.swift | 2 +- test/Sema/bitwise_copyable_2.swift | 2 +- test/Sema/diag_constantness_check.swift | 2 +- test/Sema/implicit_lifetime_dependence.swift | 2 +- test/Sema/superfluously-public-imports.swift | 4 +- .../CodeComplete/complete_filter.swift | 16 +- .../CodeComplete/complete_typerelation.swift | 6 +- ...te_typerelation.swift.convertible.response | 24 +- ...lete_typerelation.swift.identical.response | 24 +- .../CodeExpand/code-expand-no-typecheck.swift | 2 +- .../cursor_generated_interface.swift | 14 +- .../InterfaceGen/error_swift_module.swift | 18 +- test/attr/attr_availability_narrow.swift | 2 +- test/decl/var/init_accessors.swift | 6 +- test/embedded/FixedArray.swift | 4 +- .../Inputs/ExperimentalFixedArray.swift | 4 +- .../classes-non-final-method-no-stdlib.swift | 2 +- test/embedded/ouroboros-bug.swift | 2 +- test/expr/unary/if_expr.swift | 6 +- test/expr/unary/switch_expr.swift | 6 +- test/lit.cfg | 6 +- .../simplify_long_number.swift | 12 +- .../Outputs/textual/foo.swift.expected | 2 +- .../refactoring/SyntacticRename/textual.swift | 2 +- test/stdlib/SwiftObjectNSObject.swift | 2 +- test/stdlib/SwiftValueNSObject.swift | 2 +- .../lib/SwiftLang/SwiftASTManager.cpp | 2 +- .../lib/SwiftLang/SwiftLangSupport.cpp | 2 +- .../lib/SwiftLang/SwiftSourceDocInfo.cpp | 4 +- .../sourcekitd/include/sourcekitd/Service.h | 2 +- tools/libMockPlugin/MockPlugin.cpp | 8 +- tools/libSwiftScan/SwiftCaching.cpp | 4 +- .../lldb-moduleimport-test.cpp | 2 +- tools/swift-ide-test/swift-ide-test.cpp | 6 +- .../Operations/DumpConcurrency.swift | 8 +- .../Operations/DumpGenericMetadata.swift | 8 +- unittests/AST/ImportTests.cpp | 2 +- unittests/DependencyScan/Features.cpp | 2 +- utils/api_checker/dump-sdk.sh | 6 +- utils/build.ps1 | 4 +- .../Sources/GenNormalization/Decomp.swift | 2 +- utils/gyb.py | 2 +- utils/line-directive | 10 +- utils/parser-lib/profile-input.swift | 4 +- utils/recursive-lipo | 2 +- utils/swift-bench.py | 2 +- .../swift_build_support/products/product.py | 8 +- .../update_checkout/update_checkout.py | 2 +- .../constant_folded_fp_operations.swift | 2 +- validation-test/SILOptimizer/many_trys.swift | 2 +- .../SILOptimizer/rle_dse_complexity.swift | 2 +- .../SILOptimizer/static_enums_fuzzing.swift | 2 +- .../Sema/SwiftUI/issue-59716.swift | 6 +- .../issue-45240.swift | 4 +- .../stdlib/StringBreadcrumbs.swift | 2 +- .../stdlib/StringSlicesConcurrentAppend.swift | 2 +- .../stdlib/StringWordBreaking.swift | 2 +- 532 files changed, 1419 insertions(+), 1156 deletions(-) create mode 100644 _typos.toml diff --git a/CMakeLists.txt b/CMakeLists.txt index f063b94572e23..440cf49101bda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -936,7 +936,7 @@ if("${SWIFT_NATIVE_SWIFT_TOOLS_PATH}" STREQUAL "") set(SWIFT_NATIVE_SWIFT_TOOLS_PATH "${SWIFT_RUNTIME_OUTPUT_INTDIR}") set(SWIFT_EXEC_FOR_SWIFT_MODULES "${CMAKE_Swift_COMPILER}") if(NOT SWIFT_EXEC_FOR_SWIFT_MODULES) - message(WARNING "BOOSTRAPPING set to OFF because no Swift compiler is defined") + message(WARNING "BOOTSTRAPPING set to OFF because no Swift compiler is defined") set(BOOTSTRAPPING_MODE "OFF") endif() elseif(BOOTSTRAPPING_MODE MATCHES "BOOTSTRAPPING.*") diff --git a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/AsyncDemotion.swift b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/AsyncDemotion.swift index 6bec43afcdde7..ec803c50493a5 100644 --- a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/AsyncDemotion.swift +++ b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/AsyncDemotion.swift @@ -590,7 +590,7 @@ private func analyzeForDemotion(_ function: Function) -> Node? { // because it may be a caller of a function that can be demoted. var executors = Set() - var knownAsyncApplys: [ApplySite] = [] + var knownAsyncApplies: [ApplySite] = [] var hops: [Instruction] = [] var unknownAsyncOp: Instruction? = nil @@ -614,7 +614,7 @@ private func analyzeForDemotion(_ function: Function) -> Node? { if apply.referencedFunction == nil { unknownAsyncOp.setIfUnset(inst) } else { - knownAsyncApplys.append(apply) + knownAsyncApplies.append(apply) stats.tick(.asyncKnownCallsCount) } @@ -630,7 +630,7 @@ private func analyzeForDemotion(_ function: Function) -> Node? { let data: AnalysisResult.Data = (function: function, - knownAsyncCalls: knownAsyncApplys, + knownAsyncCalls: knownAsyncApplies, executors: executors, hops: hops) diff --git a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/ComputeSideEffects.swift b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/ComputeSideEffects.swift index 8e22e7179292b..3208c9c11a0bf 100644 --- a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/ComputeSideEffects.swift +++ b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/ComputeSideEffects.swift @@ -145,7 +145,7 @@ private struct CollectedEffects { // In addition to the effects of the apply, also consider the // effects of the capture, which reads the captured value in // order to move it into the context. This only applies to - // addressible values, because capturing does not dereference + // addressable values, because capturing does not dereference // any class objects. // // Ignore captures for on-stack partial applies. They only @@ -332,7 +332,7 @@ private struct CollectedEffects { /// Adds effects to a specific value. /// /// If the value comes from an argument (or multiple arguments), then the effects are added - /// to the corrseponding `argumentEffects`. Otherwise they are added to the `global` effects. + /// to the corresponding `argumentEffects`. Otherwise they are added to the `global` effects. private mutating func addEffects(_ effects: SideEffects.GlobalEffects, to value: Value) { addEffects(effects, to: value, fromInitialPath: defaultPath(for: value)) } diff --git a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceScopeFixup.swift b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceScopeFixup.swift index fdc6390f30035..59420766f3d3e 100644 --- a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceScopeFixup.swift +++ b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/LifetimeDependenceScopeFixup.swift @@ -112,7 +112,7 @@ private func extendAccessScopes(dependence: LifetimeDependence, /// caller scope, which is handled separately). A nested 'read' access can never interfere with another access in the /// same outer 'read', because it is impossible to nest a 'modify' access within a 'read'. For 'modify' accesses, /// however, the inner scope must be extended for correctness. A 'modify' access can interfere with other 'modify' -/// accesss in the same scope. We rely on exclusivity diagnostics to report these interferences. For example: +/// access in the same scope. We rely on exclusivity diagnostics to report these interferences. For example: /// /// sil @foo : $(@inout C) -> () { /// bb0(%0 : $*C): @@ -133,12 +133,12 @@ private func extendAccessScopes(dependence: LifetimeDependence, /// violation, and that subsequent optimizations do not shrink the inner access `%a1`. private func extendAccessScope(beginAccess: BeginAccessInst, range: inout InstructionRange, _ context: FunctionPassContext) -> FunctionArgument? { - var endAcceses = [Instruction]() + var endAccesses = [Instruction]() // Collect the original end_access instructions and extend the range to to cover them. The resulting access scope must // cover the original scope because it may protect other memory operations. var requiresExtension = false for end in beginAccess.endInstructions { - endAcceses.append(end) + endAccesses.append(end) if range.contains(end) { // If any end_access is inside the new range, then all end_accesses must be rewritten. requiresExtension = true @@ -168,7 +168,7 @@ private func extendAccessScope(beginAccess: BeginAccessInst, range: inout Instru } } // Delete original end_access instructions - for endAccess in endAcceses { + for endAccess in endAccesses { context.erase(instruction: endAccess) } // TODO: Add SIL support for lifetime dependence and write unit test for nested access scopes diff --git a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/StackPromotion.swift b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/StackPromotion.swift index 6b52df5a55fb9..c47cf425d0cd4 100644 --- a/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/StackPromotion.swift +++ b/SwiftCompilerSources/Sources/Optimizer/FunctionPasses/StackPromotion.swift @@ -273,7 +273,7 @@ private struct ComputeOuterBlockrange : EscapeVisitorWithResult { // instructions (for which the `visitUse` closure is not called). result.insert(operandsDefinitionBlock) - // We need to explicitly add predecessor blocks of phis becaues they + // We need to explicitly add predecessor blocks of phis because they // are not necesesarily visited during the down-walk in `isEscaping()`. // This is important for the special case where there is a back-edge from the // inner range to the inner rage's begin-block: diff --git a/SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyBeginBorrow.swift b/SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyBeginBorrow.swift index 0a384464683d2..a68b62e09a0fe 100644 --- a/SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyBeginBorrow.swift +++ b/SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyBeginBorrow.swift @@ -132,7 +132,7 @@ private extension Instruction { // In instruction simplification we don't have a domtree. Therefore do a simple dominance // check based on same-block relations. if parentBlock == value.parentBlock { - // The value and instruction are in the same block. All uses are dominanted by both. + // The value and instruction are in the same block. All uses are dominated by both. return true } let destroys = value.uses.filterUsers(ofType: DestroyValueInst.self) diff --git a/SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyLoad.swift b/SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyLoad.swift index c7e167b83d369..24838cd130fd0 100644 --- a/SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyLoad.swift +++ b/SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyLoad.swift @@ -20,7 +20,7 @@ extension LoadInst : OnoneSimplifyable, SILCombineSimplifyable { if optimizeLoadFromStringLiteral(context) { return } - if optmizeLoadFromEmptyCollection(context) { + if optimizeLoadFromEmptyCollection(context) { return } if replaceLoadOfGlobalLet(context) { @@ -85,7 +85,7 @@ extension LoadInst : OnoneSimplifyable, SILCombineSimplifyable { /// Loading `count` or `capacity` from the empty `Array`, `Set` or `Dictionary` singleton /// is replaced by a 0 literal. - private func optmizeLoadFromEmptyCollection(_ context: SimplifyContext) -> Bool { + private func optimizeLoadFromEmptyCollection(_ context: SimplifyContext) -> Bool { if self.isZeroLoadFromEmptyCollection() { let builder = Builder(before: self, context) let zeroLiteral = builder.createIntegerLiteral(0, type: type) diff --git a/SwiftCompilerSources/Sources/Optimizer/PassManager/Context.swift b/SwiftCompilerSources/Sources/Optimizer/PassManager/Context.swift index 3b4b4bc46a328..efa43b13ea7d2 100644 --- a/SwiftCompilerSources/Sources/Optimizer/PassManager/Context.swift +++ b/SwiftCompilerSources/Sources/Optimizer/PassManager/Context.swift @@ -184,7 +184,7 @@ extension MutatingContext { } func inlineFunction(apply: FullApplySite, mandatoryInline: Bool) { - // This is only a best-effort attempt to notity the new cloned instructions as changed. + // This is only a best-effort attempt to notify the new cloned instructions as changed. // TODO: get a list of cloned instructions from the `inlineFunction` let instAfterInling: Instruction? switch apply { diff --git a/SwiftCompilerSources/Sources/Optimizer/Utilities/AddressUtils.swift b/SwiftCompilerSources/Sources/Optimizer/Utilities/AddressUtils.swift index 0a7985b397667..fae42ac456ed3 100644 --- a/SwiftCompilerSources/Sources/Optimizer/Utilities/AddressUtils.swift +++ b/SwiftCompilerSources/Sources/Optimizer/Utilities/AddressUtils.swift @@ -188,7 +188,7 @@ extension AddressUseVisitor { if operand.instruction.isIncidentalUse { return leafAddressUse(of: operand) } - // Unkown instruction. + // Unknown instruction. return unknownAddressUse(of: operand) } } @@ -283,7 +283,7 @@ extension AddressInitializationWalker { } } -// Implement AddresUseVisitor +// Implement AddressUseVisitor extension AddressInitializationWalker { /// An address projection produces a single address result and does not /// escape its address operand in any other way. @@ -348,7 +348,7 @@ extension AddressInitializationWalker { } } -/// A live range representing the ownership of addressible memory. +/// A live range representing the ownership of addressable memory. /// /// This live range represents the minimal guaranteed lifetime of the object being addressed. Uses of derived addresses /// may be extended up to the ends of this scope without violating ownership. diff --git a/SwiftCompilerSources/Sources/Optimizer/Utilities/BorrowUtils.swift b/SwiftCompilerSources/Sources/Optimizer/Utilities/BorrowUtils.swift index c6cab936f8a5d..b09d338a76dd9 100644 --- a/SwiftCompilerSources/Sources/Optimizer/Utilities/BorrowUtils.swift +++ b/SwiftCompilerSources/Sources/Optimizer/Utilities/BorrowUtils.swift @@ -126,7 +126,7 @@ // // // TODO: These utilities should be integrated with OSSA SIL verification and -// guaranteed to be compelete (produce known results for all legal SIL +// guaranteed to be complete (produce known results for all legal SIL // patterns). // ===----------------------------------------------------------------------===// @@ -211,7 +211,7 @@ enum BorrowingInstruction : CustomStringConvertible, Hashable { /// the last in the function (e.g. a store rather than a destroy or return). /// The client needs to use LifetimeDependenceDefUseWalker to do better. /// - /// TODO: to hande reborrow-extended uses, migrate ExtendedLiveness + /// TODO: to handle reborrow-extended uses, migrate ExtendedLiveness /// to SwiftCompilerSources. /// /// TODO: Handle .partialApply and .markDependence forwarded uses @@ -278,7 +278,7 @@ enum BorrowingInstruction : CustomStringConvertible, Hashable { /// /// If the value is a begin_apply result, then it may be the token or /// one of the yielded values. In any case, the scope ending operands -/// are on the end_apply or abort_apply intructions that use the +/// are on the end_apply or abort_apply instructions that use the /// token. /// /// Note: equivalent to C++ BorrowedValue, but also handles begin_apply. diff --git a/SwiftCompilerSources/Sources/Optimizer/Utilities/EscapeUtils.swift b/SwiftCompilerSources/Sources/Optimizer/Utilities/EscapeUtils.swift index d6624da0d55dd..a3c18621a5aae 100644 --- a/SwiftCompilerSources/Sources/Optimizer/Utilities/EscapeUtils.swift +++ b/SwiftCompilerSources/Sources/Optimizer/Utilities/EscapeUtils.swift @@ -162,7 +162,7 @@ protocol EscapeVisitor { /// If true, the traversals follow values with trivial types. var followTrivialTypes: Bool { get } - /// If true, the traveral follows loaded values. + /// If true, the traversal follows loaded values. var followLoads: Bool { get } } diff --git a/SwiftCompilerSources/Sources/Optimizer/Utilities/LifetimeDependenceUtils.swift b/SwiftCompilerSources/Sources/Optimizer/Utilities/LifetimeDependenceUtils.swift index 4e6109630b3c6..9f04312e2ecc0 100644 --- a/SwiftCompilerSources/Sources/Optimizer/Utilities/LifetimeDependenceUtils.swift +++ b/SwiftCompilerSources/Sources/Optimizer/Utilities/LifetimeDependenceUtils.swift @@ -127,7 +127,7 @@ struct LifetimeDependence : CustomStringConvertible { case yield(Value) /// An owned value whose OSSA lifetime encloses nonescapable values case owned(Value) - /// Singly-initialized addressible storage (likely for an + /// Singly-initialized addressable storage (likely for an /// immutable address-only value). The lifetime extends until the /// memory is destroyed. e.g. A value produced by an @in /// FunctionArgument or @out apply. @inout has caller scope @@ -556,7 +556,7 @@ extension LifetimeDependence { /// This uses LifetimeDependenceUseDefWalker to find the introducers /// of a dependence chain, which represent the value's "inherited" /// dependencies. This stops at an address, unless the address refers -/// to a singly-initialized temprorary, in which case it continues to +/// to a singly-initialized temporary, in which case it continues to /// walk up the stored value. /// /// This overrides LifetimeDependenceUseDefWalker to stop at a value @@ -770,7 +770,7 @@ extension LifetimeDependenceUseDefWalker { /// follows interior pointers using AddressUseVisitor. Handles stores to and loads from local variables using /// LocalVariableReachabilityCache. /// -/// Ignores trivial values (~Escapable types are never trivial. Escapable types may only be lifetime-depenent values if +/// Ignores trivial values (~Escapable types are never trivial. Escapable types may only be lifetime-dependent values if /// they are non-trivial). /// /// Skips uses within nested borrow scopes. diff --git a/SwiftCompilerSources/Sources/Optimizer/Utilities/LocalVariableUtils.swift b/SwiftCompilerSources/Sources/Optimizer/Utilities/LocalVariableUtils.swift index 684052f28d984..17663c23e2920 100644 --- a/SwiftCompilerSources/Sources/Optimizer/Utilities/LocalVariableUtils.swift +++ b/SwiftCompilerSources/Sources/Optimizer/Utilities/LocalVariableUtils.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// /// -/// SIL operates on three kinds of addressible memory: +/// SIL operates on three kinds of addressable memory: /// /// 1. Temporary RValues. These are recognied by AddressInitializationWalker. These largely disappear with opaque SIL /// values. @@ -35,12 +35,12 @@ private func log(_ message: @autoclosure () -> String) { // Local variables are accessed in one of these ways. // -// Note: @in is only immutable up to when it is destroyed, so still requies a local live range. +// Note: @in is only immutable up to when it is destroyed, so still requires a local live range. struct LocalVariableAccess: CustomStringConvertible { enum Kind { case incomingArgument // @in, @inout, @inout_aliasable case outgoingArgument // @inout, @inout_aliasable - case beginAccess // Reading or reassinging a 'var' + case beginAccess // Reading or reassigning a 'var' case load // Reading a 'let'. Returning 'var' from an initializer. case store // 'var' initialization and destruction case apply // indirect arguments @@ -193,7 +193,7 @@ class LocalVariableAccessInfo: CustomStringConvertible { } } -/// Model the formal accesses of an addressible variable introduced by an alloc_box, alloc_stack, or indirect +/// Model the formal accesses of an addressable variable introduced by an alloc_box, alloc_stack, or indirect /// FunctionArgument. /// /// This instantiates a unique LocalVariableAccessInfo instances for each access instruction, caching it an an access diff --git a/SwiftCompilerSources/Sources/Optimizer/Utilities/OptUtils.swift b/SwiftCompilerSources/Sources/Optimizer/Utilities/OptUtils.swift index 5f9be27778c77..c52354483619e 100644 --- a/SwiftCompilerSources/Sources/Optimizer/Utilities/OptUtils.swift +++ b/SwiftCompilerSources/Sources/Optimizer/Utilities/OptUtils.swift @@ -550,7 +550,7 @@ extension BasicBlock { extension SimplifyContext { - /// Replaces a pair of redudant instructions, like + /// Replaces a pair of redundant instructions, like /// ``` /// %first = enum $E, #E.CaseA!enumelt, %replacement /// %second = unchecked_enum_data %first : $E, #E.CaseA!enumelt diff --git a/SwiftCompilerSources/Sources/Optimizer/Utilities/OwnershipLiveness.swift b/SwiftCompilerSources/Sources/Optimizer/Utilities/OwnershipLiveness.swift index eabfae2e05d12..022b961f11757 100644 --- a/SwiftCompilerSources/Sources/Optimizer/Utilities/OwnershipLiveness.swift +++ b/SwiftCompilerSources/Sources/Optimizer/Utilities/OwnershipLiveness.swift @@ -275,10 +275,10 @@ protocol OwnershipUseVisitor { mutating func pointerEscapingUse(of operand: Operand) -> WalkResult /// A use that creates an implicit borrow scope over the lifetime of - /// an owned dependent value. The operand owership is .borrow, but + /// an owned dependent value. The operand ownership is .borrow, but /// there are no explicit scope-ending operations. Instead /// BorrowingInstruction.scopeEndingOperands will return the final - /// consumes in the dependent value's forwaring chain. + /// consumes in the dependent value's forwarding chain. mutating func dependentUse(of operand: Operand, into value: Value) -> WalkResult @@ -490,7 +490,7 @@ extension OwnershipUseVisitor { /// /// - Does not assume the current lifetime is linear. Transitively /// follows guaranteed forwarding and address uses within the current -/// scope. Phis that are not dominanted by definingValue or an outer +/// scope. Phis that are not dominated by definingValue or an outer /// adjacent phi are marked "unenclosed" to signal an incomplete /// lifetime. /// diff --git a/SwiftCompilerSources/Sources/Optimizer/Utilities/Verifier.swift b/SwiftCompilerSources/Sources/Optimizer/Utilities/Verifier.swift index 4b3b5b13cc60f..a5ca2715d150f 100644 --- a/SwiftCompilerSources/Sources/Optimizer/Utilities/Verifier.swift +++ b/SwiftCompilerSources/Sources/Optimizer/Utilities/Verifier.swift @@ -13,7 +13,7 @@ import SIL import OptimizerBridging -private protocol VerifyableInstruction : Instruction { +private protocol VerifiableInstruction : Instruction { func verify(_ context: FunctionPassContext) } @@ -33,8 +33,8 @@ extension Function { inst.checkForwardingConformance() - if let verifyableInst = inst as? VerifyableInstruction { - verifyableInst.verify(context) + if let verifiableInst = inst as? VerifiableInstruction { + verifiableInst.verify(context) } } } @@ -51,7 +51,7 @@ private extension Instruction { } } -extension BorrowedFromInst : VerifyableInstruction { +extension BorrowedFromInst : VerifiableInstruction { func verify(_ context: FunctionPassContext) { var computedEVs = Stack(context) defer { computedEVs.deinitialize() } diff --git a/SwiftCompilerSources/Sources/SIL/Effects.swift b/SwiftCompilerSources/Sources/SIL/Effects.swift index 6a3d5f20d13b9..e1116e83f4d99 100644 --- a/SwiftCompilerSources/Sources/SIL/Effects.swift +++ b/SwiftCompilerSources/Sources/SIL/Effects.swift @@ -162,7 +162,7 @@ extension Function { } if isProgramTerminationPoint { // We can ignore any memory writes in a program termination point, because it's not relevant - // for the caller. But we need to consider memory reads, otherwise preceeding memory writes + // for the caller. But we need to consider memory reads, otherwise preceding memory writes // would be eliminated by dead-store-elimination in the caller. E.g. String initialization // for error strings which are printed by the program termination point. // Regarding ownership: a program termination point must not touch any reference counted objects. @@ -394,7 +394,7 @@ public struct SideEffects : CustomStringConvertible, NoReflectionChildren { /// Returns the effects of an argument. /// - /// In constrast to using `arguments` directly, it's valid to have an `argumentIndex` + /// In contrast to using `arguments` directly, it's valid to have an `argumentIndex` /// which is larger than the number of elements in `arguments`. public func getArgumentEffects(for argumentIndex: Int) -> ArgumentEffects { if argumentIndex < arguments.count { @@ -430,7 +430,7 @@ public struct SideEffects : CustomStringConvertible, NoReflectionChildren { /// Side-effects of a specific function argument. /// - /// The paths describe what (projeted) values of an argument are affected. + /// The paths describe what (projected) values of an argument are affected. /// If a path is nil, than there is no such effect on the argument. /// /// A path can contain any projection or wildcards, as long as there is no load involved. diff --git a/SwiftCompilerSources/Sources/SIL/Operand.swift b/SwiftCompilerSources/Sources/SIL/Operand.swift index ef5c3ea407663..26defd2b441ec 100644 --- a/SwiftCompilerSources/Sources/SIL/Operand.swift +++ b/SwiftCompilerSources/Sources/SIL/Operand.swift @@ -87,7 +87,7 @@ public struct OperandArray : RandomAccessCollection, CustomReflectable { /// Returns a sub-array defined by `bounds`. /// - /// Note: this does not return a Slice. The first index of the returnd array is always 0. + /// Note: this does not return a Slice. The first index of the returned array is always 0. public subscript(bounds: Range) -> OperandArray { assert(bounds.lowerBound >= startIndex && bounds.upperBound <= endIndex) return OperandArray( diff --git a/SwiftCompilerSources/Sources/SIL/Utilities/AccessUtils.swift b/SwiftCompilerSources/Sources/SIL/Utilities/AccessUtils.swift index 348f479e33117..eb26294c3c047 100644 --- a/SwiftCompilerSources/Sources/SIL/Utilities/AccessUtils.swift +++ b/SwiftCompilerSources/Sources/SIL/Utilities/AccessUtils.swift @@ -323,7 +323,7 @@ public struct AccessPath : CustomStringConvertible { /// Returns true if this access addresses the same memory location as `other` or if `other` /// is a sub-field of this access. - /// Note that this access _contains_ `other` if `other` has a _larger_ projection path than this acccess. + /// Note that this access _contains_ `other` if `other` has a _larger_ projection path than this access. /// For example: /// `%value.s0` contains `%value.s0.s1` public func isEqualOrContains(_ other: AccessPath) -> Bool { diff --git a/SwiftCompilerSources/Sources/SIL/Utilities/WalkUtils.swift b/SwiftCompilerSources/Sources/SIL/Utilities/WalkUtils.swift index 3b38916c5f34a..79c750ed18899 100644 --- a/SwiftCompilerSources/Sources/SIL/Utilities/WalkUtils.swift +++ b/SwiftCompilerSources/Sources/SIL/Utilities/WalkUtils.swift @@ -562,7 +562,7 @@ extension AddressDefUseWalker { /// to reflect that a further projection is needed to reach the value of interest from the new initial value. /// 2. If the instruction of the definition is a value construction such as `struct` and /// the head of the path matches the instruction type then the walk continues -/// with a call to `walkUp` with initial value the operand defintion denoted by the path +/// with a call to `walkUp` with initial value the operand definition denoted by the path /// and the suffix path as path since the target value can now be reached with fewer projections. /// If the defining instruction of the value does not match the head of the path as in /// `%t = tuple ...` and `"s0.t1"` then `unmatchedPath(%t, ...)` is called. diff --git a/SwiftCompilerSources/Sources/SIL/Value.swift b/SwiftCompilerSources/Sources/SIL/Value.swift index e96f4109f3424..958505260a9fc 100644 --- a/SwiftCompilerSources/Sources/SIL/Value.swift +++ b/SwiftCompilerSources/Sources/SIL/Value.swift @@ -198,7 +198,7 @@ extension Value { ProjectedValue(value: self, path: path) } - /// Returns a projected value, defined by this value and path containig a single field of `kind` and `index`. + /// Returns a projected value, defined by this value and path containing a single field of `kind` and `index`. public func at(_ kind: SmallProjectionPath.FieldKind, index: Int = 0) -> ProjectedValue { ProjectedValue(value: self, path: SmallProjectionPath(kind, index: index)) } diff --git a/SwiftCompilerSources/force_lib.c b/SwiftCompilerSources/force_lib.c index a66a345c5a76d..0cb510b2a3df7 100644 --- a/SwiftCompilerSources/force_lib.c +++ b/SwiftCompilerSources/force_lib.c @@ -11,5 +11,5 @@ //===----------------------------------------------------------------------===// /// Dummy source file to force CMake generated SwiftInTheCompiler.xcodeproj -/// to successfully build static libraries conatining only object files used +/// to successfully build static libraries containing only object files used /// during "bootstrap" process to link Swift sources into the compiler. diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 0000000000000..668c1a04f0c33 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,263 @@ +[files] +extend-exclude = [ + "CHANGELOG.md", + "benchmark/single-source/CountAlgo.swift", + "benchmark/single-source/FindStringNaive.swift", + "benchmark/single-source/SortStrings.swift", + "docs/ABI/Mangling.rst", + "docs/Generics/chapters/monoids.tex", + "docs/Generics/chapters/substitution-maps.tex", + "docs/SIL.rst", + "include/swift/AST/Builtins.def", + "include/swift/Basic/PrefixMap.h", + "include/swift/RemoteInspection/RuntimeHeaders/*", + "include/swift/SIL/OptimizationRemark.h", + "lib/AST/AccessRequests.cpp", + "lib/IRGen/GenKeyPath.cpp", + "lib/SILOptimizer/Utils/SILIsolationInfo.cpp", + "stdlib/private/StdlibUnicodeUnittest/UnicodeScalarProperties.swift", + "stdlib/public/Backtracing/SymbolicatedBacktrace.swift", + "stdlib/public/Backtracing/modules/ImageFormats/Elf/elf.h", + "stdlib/public/Windows/WinSDK.swift", + "stdlib/public/core/CString.swift", + "stdlib/public/core/String.swift", + "stdlib/public/runtime/SwiftDtoa.cpp", + "test/AutoDiff/compiler_crashers_fixed/tf1160-derivative-usable-from-inline-mismatch.swift", + "test/Backtracing/CrashAsync.swift", + "test/Casting/fast_class_casts.swift", + "test/Concurrency/default_actor_definit.swift", + "test/Concurrency/flow_isolation.swift", + "test/Constraints/closures.swift", + "test/DebugInfo/*", + "test/Demangle/*", + "test/Distributed/*", + "test/Generics/deduction.swift", + "test/IRGen/*", + "test/Index/kinds.swift", + "test/Inputs/*", + "test/Interop/Cxx/foreign-reference/reference-counted-irgen.swift", + "test/Interop/Cxx/foreign-reference/reference-counted-objc-property.swift", + "test/Interop/SwiftToC/functions/swift-function-argument-keyword-in-c.swift", + "test/Interop/SwiftToCxx/cross-module-refs/imported-struct-refs-in-cxx.swift", + "test/Interop/SwiftToCxx/functions/swift-function-argument-keyword-in-cxx.swift", + "test/Interop/SwiftToCxx/functions/swift-functions.swift", + "test/Interop/SwiftToCxx/generics/generic-function-in-cxx.swift", + "test/Interop/SwiftToCxx/structs/small-structs-pass-return-direct-in-cxx.swift", + "test/Interpreter/SDK/objc_nsstring_bridge.swift", + "test/Interpreter/multi_payload_extra_inhabitant.swift", + "test/Macros/macro_expand_closure.swift", + "test/Migrator/Inputs/string-representable.json", + "test/Migrator/rename-func-decl.swift", + "test/Migrator/rename-func-decl.swift.expected", + "test/PrintAsObjC/circularity.swift", + "test/SIL/Parser/generic_signature_with_depth.swift", + "test/SIL/Serialization/deserialize_generic.sil", + "test/SIL/Serialization/deserialize_generic_marker.sil", + "test/SIL/implicit_lifetime_dependence.swift", + "test/SILGen/*", + "lib/SILOptimizer/Utils/OnonePrespecializations.def", + "test/SourceKit/*", + "test/SILOptimizer/*", + "test/Sema/typo_correction_limit.swift", + "test/Serialization/Inputs/def_basic.sil", + "test/Serialization/enum-mutual-circularity.swift", + "test/abi/*", + "test/attr/attr_dynamic_member_lookup.swift", + "test/embedded/*", + "test/expr/cast/array_coerce.swift", + "utils/gen-unicode-data/Data/*", + "validation-test/IDE/crashers_2_fixed", + "validation-test/compiler_crashers_2_fixed", + "validation-test/compiler_crashers_fixed", + "validation-test/stdlib/ArrayTrapsObjC.swift", + "validation-test/stdlib/StringNormalization.swift", + "test/stdlib/Inputs/NormalizationTest.txt", + "test/stdlib/Inputs/NormalizationTest15.txt", + "test/stdlib/runtime_autorelease_optimization.txt", + "test/stdlib/StringCreate.swift", + "unittests/SwiftDemangle/DemangleTest.cpp", + "utils/api_checker/FrameworkABIBaseline/Swift/ABI/macos.json", + "utils/api_checker/FrameworkABIBaseline/Swift/API/macos.json", + "utils/UnicodeData/confusables.txt", + "utils/UnicodeData/GraphemeBreakProperty.txt", + "utils/WindowsSDKVFSOverlay.yaml.in", + "validation-test/IDE/issues_fixed/rdar120798355.swift", + "validation-test/stdlib/Dictionary.swift", + "validation-test/stdlib/Unicode.swift.gyb", + "validation-test/Reflection/reflect_nested_generic.swift", +] + +[default] +check-filename = false + +[default.extend-identifiers] +000000000002afe0 = "000000000002afe0" +ALS = "ALS" +ALS_BOOTSTRAPPING = "ALS_BOOTSTRAPPING" +ALS_DEPENDS = "ALS_DEPENDS" +ALS_SWIFT_EXEC = "ALS_SWIFT_EXEC" +ASO = "ASO" +ASYNC_CLOS = "ASYNC_CLOS" +AllVisibles = "AllVisibles" +ArrayClas = "ArrayClas" +BA = "BA" +BUILTIN_MISC_OPERATIONs = "BUILTIN_MISC_OPERATIONs" +ClangModuleWithOverlayedDep = "ClangModuleWithOverlayedDep" +Clas = "Clas" +DAA = "DAA" +DW_AT_endianity = "DW_AT_endianity" +DW_TAG_formal_parmeter = "DW_TAG_formal_parmeter" +EIS = "EIS" +EIT = "EIT" +EM_COREA_2ND = "EM_COREA_2ND" +Elf32_Rela = "Elf32_Rela" +Elf64_Rela = "Elf64_Rela" +EmitGenericRODatas = "EmitGenericRODatas" +EnableCMOEverything = "EnableCMOEverything" +EnableDefaultCMO = "EnableDefaultCMO" +ExtensionImportVisiblity = "ExtensionImportVisiblity" +FCMP_OLT = "FCMP_OLT" +FLE = "FLE" +FO = "FO" +ForwardScan2nd = "ForwardScan2nd" +GenericRODatas = "GenericRODatas" +HSI = "HSI" +HTE = "HTE" +IITDescriptor = "IITDescriptor" +IMAGE_DLL_CHARACTERISTICS_NO_SEH = "IMAGE_DLL_CHARACTERISTICS_NO_SEH" +IsSer = "IsSer" +KindNd = "KindNd" +MutipleTopLevelWriters = "MutipleTopLevelWriters" +ND = "ND" +Nd = "Nd" +Nd1 = "Nd1" +Nd2 = "Nd2" +NdKind = "NdKind" +OME = "OME" +OT = "OT" +ParmVarDecl = "ParmVarDecl" +OVERLAYED_H = "OVERLAYED_H" +O_WRONLY = "O_WRONLY" +OverridenDeclsOwner = "OverridenDeclsOwner" +PN = "PN" +Parm = "Parm" +Parms = "Parms" +ParmsResult = "ParmsResult" +PlatformConditon = "PlatformConditon" +Pn = "Pn" +RUNTIME_VERSIONs = "RUNTIME_VERSIONs" +SEH = "SEH" +SER = "SER" +SHT_RELA = "SHT_RELA" +SILSer = "SILSer" +selt = "selt" +selt2 = "selt2" +ACN = "ACN" +SWIFT_RUNTIME_MUTEX_PHTREAD_BACKDEPLOY56_H = "SWIFT_RUNTIME_MUTEX_PHTREAD_BACKDEPLOY56_H" +SafeSEH = "SafeSEH" +Ser = "Ser" +SitlF = "SitlF" +Siz = "Siz" +SouceFile = "SouceFile" +SpecNd = "SpecNd" +Strat = "Strat" +Sur = "Sur" +TBE = "TBE" +TRE = "TRE" +TextNd = "TextNd" +TrimedComment = "TrimedComment" +TweedleDum = "TweedleDum" +USED_IN_CPP_SOURC = "USED_IN_CPP_SOURC" +UncompressibleProperty = "UncompressibleProperty" +VABIy = "VABIy" +YOUT = "YOUT" +_O_WRONLY = "_O_WRONLY" +alledge_iterator = "alledge_iterator" +autoClos = "autoClos" +ba = "ba" +baResult1 = "baResult1" +baResult2 = "baResult2" +bitap = "bitap" +cannot_default_generic_parameter_inferrable_from_another_parameter = "cannot_default_generic_parameter_inferrable_from_another_parameter" +cannot_default_generic_parameter_inferrable_through_same_type = "cannot_default_generic_parameter_inferrable_through_same_type" +clos = "clos" +complexy = "complexy" +daa = "daa" +derivedBA = "derivedBA" +desig_init_added = "desig_init_added" +diagnoseRepresenationError = "diagnoseRepresenationError" +doas = "doas" +error_swift_module_file_requires_delimeter = "error_swift_module_file_requires_delimeter" +explosion_size_oveflow = "explosion_size_oveflow" +fcmp_olt = "fcmp_olt" +fcmp_olt_ = "fcmp_olt_" +fcmp_olt_FPIEEE = "fcmp_olt_FPIEEE" +fnd_get_demangled_name = "fnd_get_demangled_name" +preject = "preject" +fo = "fo" +foor = "foor" +fpt = "fpt" +generic_ro_datas = "generic_ro_datas" +getCalleeWithoutImplmentation = "getCalleeWithoutImplmentation" +gir = "gir" +hasMangledNam = "hasMangledNam" +hightlightLength = "hightlightLength" +hsi = "hsi" +inout = "inout" +inout_aliasable = "inout_aliasable" +inouts = "inouts" +isConvertableToGuaranteed = "isConvertableToGuaranteed" +isRela = "isRela" +isSourceLocInOrignalBuffer = "isSourceLocInOrignalBuffer" +ist = "ist" +kindNd = "kindNd" +mone = "mone" +multline = "multline" +nd = "nd" +netinet_in_systm = "netinet_in_systm" +numer = "numer" +ois = "ois" +ome = "ome" +overridenFiles = "overridenFiles" +overridenVFS = "overridenVFS" +parm = "parm" +partially_applyable_to_class = "partially_applyable_to_class" +partially_applyable_to_two_classes = "partially_applyable_to_two_classes" +peform = "peform" +pn = "pn" +primaryNd = "primaryNd" +readed = "readed" +s43_bridgeNonVerbatimFromObjectiveCConditionalySbyXl_xmxSgztlF = "s43_bridgeNonVerbatimFromObjectiveCConditionalySbyXl_xmxSgztlF" +selfs = "selfs" +ser = "ser" +suppress_inferrable_protocol_extension = "suppress_inferrable_protocol_extension" +thr = "thr" +ue = "ue" +usees = "usees" +warn_ignore_option_overriden_by = "warn_ignore_option_overriden_by" +yout = "yout" +TemplateTypeParmType = "TemplateTypeParmType" +ist64 = "ist64" + +[default.extend-words] +ASO = "ASO" +BUILTIN_MISC_OPERATIONs = "BUILTIN_MISC_OPERATIONs" +Bitap = "Bitap" +Frostig = "Frostig" +Inout = "Inout" +Inouts = "Inouts" +KindNd = "KindNd" +OME = "OME" +RELA = "RELA" +SEH = "SEH" +SER = "SER" +Sur = "Sur" +WOH = "WOH" +canonicalizations = "canonicalizations" +dereferencable = "dereferencable" +generic_ro_datas = "generic_ro_datas" +hsi = "hsi" +referencable = "referencable" +rela = "rela" +unparseable = "unparseable" +BA = "BA" \ No newline at end of file diff --git a/benchmark/scripts/compare_perf_tests.py b/benchmark/scripts/compare_perf_tests.py index c22db740aed52..f574191c9b80f 100755 --- a/benchmark/scripts/compare_perf_tests.py +++ b/benchmark/scripts/compare_perf_tests.py @@ -564,7 +564,7 @@ class TestComparator(object): It determines which tests were `added`, `removed` and which can be compared. It then splits the `ResultComparison`s into 3 groups according to the `delta_threshold` by the change in performance: `increased`, - `descreased` and `unchanged`. Whole computation is performed during + `decreased` and `unchanged`. Whole computation is performed during initialization and results are provided as properties on this object. The lists of `added`, `removed` and `unchanged` tests are sorted diff --git a/benchmark/scripts/test_compare_perf_tests.py b/benchmark/scripts/test_compare_perf_tests.py index b575af93fe0f3..72eca5e52b603 100644 --- a/benchmark/scripts/test_compare_perf_tests.py +++ b/benchmark/scripts/test_compare_perf_tests.py @@ -629,7 +629,7 @@ def test_values(self): ) def test_justified_columns(self): - """Table columns are all formated with same width, defined by the + """Table columns are all formatted with same width, defined by the longest value. """ self.assert_markdown_contains( diff --git a/benchmark/scripts/test_utils.py b/benchmark/scripts/test_utils.py index d551a9912871b..52427af72ea6c 100644 --- a/benchmark/scripts/test_utils.py +++ b/benchmark/scripts/test_utils.py @@ -58,7 +58,7 @@ class Mock(object): """ def __init__(self, responses=None): - """Optionaly initialized with a list of expected calls. See expect.""" + """Optionally initialized with a list of expected calls. See expect.""" self.calls = [] self.expected = [] self.respond = dict() diff --git a/benchmark/single-source/SortIntPyramids.swift b/benchmark/single-source/SortIntPyramids.swift index 3efb2af6276f8..e44356314019f 100644 --- a/benchmark/single-source/SortIntPyramids.swift +++ b/benchmark/single-source/SortIntPyramids.swift @@ -37,7 +37,7 @@ let pyramidTemplate: [Int] = (1...pH) + (1...pH).reversed() // A^R - reversed array A, + - array concatenation operator, // A indices are in range 1...A.length. // define adjacent pyramid as A + A^R + A + A^R, -// defne adjacent pyramid hight as A[A.length]. +// defne adjacent pyramid height as A[A.length]. // On 25% of following dataset stdlib sorting function will use heapSort. diff --git a/cmake/modules/SwiftConfigureSDK.cmake b/cmake/modules/SwiftConfigureSDK.cmake index 8a0fc2a21b294..44bb39b4f2669 100644 --- a/cmake/modules/SwiftConfigureSDK.cmake +++ b/cmake/modules/SwiftConfigureSDK.cmake @@ -323,7 +323,7 @@ macro(configure_sdk_unix name architectures) endif() set(SWIFT_SDK_${prefix}_USE_ISYSROOT FALSE) - # Static linking is suported on Linux and WASI + # Static linking is supported on Linux and WASI if("${prefix}" STREQUAL "LINUX" OR "${prefix}" STREQUAL "LINUX_STATIC" OR "${prefix}" STREQUAL "WASI") diff --git a/docs/CppInteroperability/UserGuide-CallingSwiftFromC++.md b/docs/CppInteroperability/UserGuide-CallingSwiftFromC++.md index b29b0d2519b80..f90f2644b9157 100644 --- a/docs/CppInteroperability/UserGuide-CallingSwiftFromC++.md +++ b/docs/CppInteroperability/UserGuide-CallingSwiftFromC++.md @@ -12,7 +12,7 @@ design for the Swift to C++ interoperability layer. **NOTE:** This document does not go over the following Swift language features yet: * Closures -* overriden methods/properties in classes +* overridden methods/properties in classes * Existential types (any P) * Nested types * Operators @@ -72,7 +72,7 @@ Swift functions that are callable from C++ are available in their corresponding Fundamental primitive types have a C++ fundamental type that represents them in C++: -|Swift Type |C++ Type |C Type (if different) | |target specifc | +|Swift Type |C++ Type |C Type (if different) | |target specific | |--- |--- |--- |--- |--- | |Void (or no return) |void | | | | |Int |swift::Int |ptrdiff_t |long or long long (windows) |YES | @@ -295,12 +295,12 @@ As an example, this structure renames its second `init` overload in C++ to expos ```swift // Swift module 'Weather' -struct Celcius { - var temperatureInCelcius: Double +struct Celsius { + var temperatureInCelsius: Double // FEEDBACK: could provide a constructor here? // NOTE: concern about encouraging people not to use labels - init(_ t: Double) { self.temperatureInCelcius = t } + init(_ t: Double) { self.temperatureInCelsius = t } // FEEDBACK: could the compiler construct the 'initFromFahrenheit' c++ name? @expose(c++, initFromFahrenheit) @@ -315,8 +315,8 @@ Both initializers can then be used from C++: using namespace Weather; void makeSunnyDay() { - auto morningTemperature = Celcius::init(25); - auto noonTemperature = Celcius::initFromFahrenheit(90); + auto morningTemperature = Celsius::init(25); + auto noonTemperature = Celsius::initFromFahrenheit(90); } ``` @@ -558,7 +558,7 @@ public: using UpcType = swift::Tuple; - // Extracts the associated valus from Barcode.upc enum case + // Extracts the associated values from Barcode.upc enum case UpcType getUpc() const; bool isQrCode() const; @@ -698,7 +698,7 @@ public final class Bicycle: Vehicle { } ``` -Get a corresponding C++ class hierachy in C++: +Get a corresponding C++ class hierarchy in C++: ```c++ class Vehicle { ... }; diff --git a/docs/EmbeddedSwift/UserManual.md b/docs/EmbeddedSwift/UserManual.md index e7e12012cb52f..7f8d62553aef5 100644 --- a/docs/EmbeddedSwift/UserManual.md +++ b/docs/EmbeddedSwift/UserManual.md @@ -252,11 +252,11 @@ For (2), external dependencies are also triggered by specific code needing them, - dependency: `void *__stack_chk_guard;` - dependency: `void __stack_chk_fail(void);` - stack protectors can be disabled with `-disable-stack-protector` swiftc flag -- **atomics instrinsics** +- **atomics intrinsics** - on CPU architectures that don't have direct load-acquire/store-release support in the ISA, LLVM calls helper functions for atomic operations - needed by refcounting in the Embedded Swift runtime (so any class usage will trigger this dependency) - also needed when using atomics from the Synchronization module -- **multiplication/division/modulo instrinsics** +- **multiplication/division/modulo intrinsics** - on CPU architectures that don't have direct support for the math operations in the ISA - dependency (on Mach-O): `__divti3` - dependency (on Mach-O): `__modti3` diff --git a/docs/Generics/chapters/basic-operation.tex b/docs/Generics/chapters/basic-operation.tex index a2b4b55b6dccf..3a48cfe570a3d 100644 --- a/docs/Generics/chapters/basic-operation.tex +++ b/docs/Generics/chapters/basic-operation.tex @@ -136,7 +136,7 @@ \chapter{Basic Operation}\label{rqm basic operation} \item If a conformance requirement is made redundant by a same-type requirement that fixes a type parameter to a concrete type (such as $\SameReq{T}{S}$ and $\ConfReq{T}{P}$ where \texttt{S} is a concrete type and $\ConfReq{S}{P}$ is a concrete conformance), the rewrite system cannot be reused for technical reasons; we will talk about this in \ChapRef{concrete conformances}. \end{enumerate} -The first three only occur with invalid code, and are accompanied by diagnostics. The fourth is not an error, just a rare edge case where our optimization cannot be performed. All conditions are checked for during minimization, and recorded in the form of a flags field. We cannot install the minimization machine if any of these flags are set; doing so would associate a generic signature with a minimization machine that contains rewrite rules not explained by the generic signature itself. This would confuse subsequent generic signature queries. In the event that the above does not cover some other unforseen scenario where equivalence fails to hold, the \IndexFlag{disable-requirement-machine-reuse}\texttt{-disable-requirement-machine-reuse} frontend flag forces minimization machines to be discarded immediately after use, instead of being installed. +The first three only occur with invalid code, and are accompanied by diagnostics. The fourth is not an error, just a rare edge case where our optimization cannot be performed. All conditions are checked for during minimization, and recorded in the form of a flags field. We cannot install the minimization machine if any of these flags are set; doing so would associate a generic signature with a minimization machine that contains rewrite rules not explained by the generic signature itself. This would confuse subsequent generic signature queries. In the event that the above does not cover some other unforeseen scenario where equivalence fails to hold, the \IndexFlag{disable-requirement-machine-reuse}\texttt{-disable-requirement-machine-reuse} frontend flag forces minimization machines to be discarded immediately after use, instead of being installed. \begin{example} The compiler builds several requirement machines while type checking the code below: diff --git a/docs/Generics/chapters/completion.tex b/docs/Generics/chapters/completion.tex index 75cd8f6b95779..d78b708717b96 100644 --- a/docs/Generics/chapters/completion.tex +++ b/docs/Generics/chapters/completion.tex @@ -742,7 +742,7 @@ \section{Associated Types}\label{critical pairs} \arrow[u, Rightarrow, "\ttgp{0}{0}.(\assocsym{P}{A}.\assocsym{Q}{B}\Rightarrow\assocsym{P}{A}.\texttt{B})"']&& \end{tikzcd} \] -Note that this was an overlap of the first kind, so rule (7) is now marked \index{left-simplified rule}\textbf{left-simplified}. Thus, rule (*8) completely supercedes rule (7). Rule (*8) survives minimization and maps to the requirement $\ConfReq{\ttgp{0}{0}.[P]A.[Q]B}{R}$, which appears in the generic signature that we output for this protocol extension: +Note that this was an overlap of the first kind, so rule (7) is now marked \index{left-simplified rule}\textbf{left-simplified}. Thus, rule (*8) completely supersedes rule (7). Rule (*8) survives minimization and maps to the requirement $\ConfReq{\ttgp{0}{0}.[P]A.[Q]B}{R}$, which appears in the generic signature that we output for this protocol extension: \begin{quote} \begin{verbatim} <τ_0_0 where τ_0_0: P, τ_0_0.[P]A.[Q]B: R> @@ -1075,7 +1075,7 @@ \section{More Critical Pairs}\label{more critical pairs} \end{gather*} We see that applying $\Sigma_{\ConfReq{X}{S}}$ to \texttt{\ttgp{0}{0}.[S]A} and \texttt{\ttgp{0}{0}.[S]C.[S]B} also outputs identical types: $\AssocType{[S]A}\otimes\ConfReq{X}{S}=\AssocType{[S]B}\otimes\ConfReq{Y}{S}=\texttt{Int}$. Is this the case for \emph{every} conformance to \texttt{S}? That is, is it true that $G_\texttt{S}\vDash\SameReq{\texttt{\ttgp{0}{0}.A}}{\texttt{\ttgp{0}{0}.C.B}}$? -We will see the answer is ``yes,'' proving that our function \texttt{f()} type checks. For a visual perspective, we turn to the \index{type parameter graph}type parameter graph\footnote{In our previous formulation, the type parameter graph has a distinguished root node, with every generic parameter as a child of this root. Now, our generic signature only has one generic parameter, so a root node would be superflous; we omit it in what follows.} for $G_\texttt{S}$. \FigRef{protocol s fig} constructs this graph in three steps. Between each step, we have a \index{graph homomorphism}graph homomorphism---in fact, a \index{covering map}covering map, in the sense of \SecRef{protocol component}---transforming one graph into the other: +We will see the answer is ``yes,'' proving that our function \texttt{f()} type checks. For a visual perspective, we turn to the \index{type parameter graph}type parameter graph\footnote{In our previous formulation, the type parameter graph has a distinguished root node, with every generic parameter as a child of this root. Now, our generic signature only has one generic parameter, so a root node would be superfluous; we omit it in what follows.} for $G_\texttt{S}$. \FigRef{protocol s fig} constructs this graph in three steps. Between each step, we have a \index{graph homomorphism}graph homomorphism---in fact, a \index{covering map}covering map, in the sense of \SecRef{protocol component}---transforming one graph into the other: \begin{enumerate} \item The first step shows the graph as it would be without the protocol stating any same-type requirements; we get an infinite tree where each interior node is the parent of one other interior node, and two leaf nodes. @@ -1681,7 +1681,7 @@ \section{Recursive Conformances}\label{recursive conformances redux} \[M_2^{\prime} := \Pres{a,b,n,q}{nn\sim n,\,na\sim b,\,bn\sim b,\,ba\sim bb,\,qb^iq\sim qb^i,\, qb^ia\sim qb^{i+1}}\] However, we then add $c$ with defining rewrite rule $qa\sim c$: \[M_3 := \Pres{a,b,c,n,q}{nn\sim n,\, qq\sim q,\, qn\sim q,\, nan\sim na,\,qaq\sim qa,\,na\sim b,\,qa\sim c}\] -Completion suceeds on $M_3$ using a reduction order where $c} forwards method calls to the underlying \texttt{GenericSignatureImpl}. +The \texttt{CanGenericSignature} class wraps a \texttt{GenericSignatureImpl *} pointer which is known to be canonical. The pointer can be recovered with the \texttt{getPointer()} method. There is an implicit conversion from \texttt{CanGenericSignature} to \texttt{GenericSignature}. The \texttt{operator->} forwards method calls to the underlying \texttt{GenericSignatureImpl}. The \texttt{operator==} and \texttt{operator!=} operators are used to test \texttt{CanGenericSignature} for pointer equality. The \texttt{isEqual()} method of \texttt{GenericSignatureImpl} implements canonical equality on arbitrary generic signatures by first canonicalizing both sides, then checking the resulting canonical signatures for pointer equality. Therefore, the following are equivalent: \begin{Verbatim} diff --git a/docs/Generics/chapters/monoids.tex b/docs/Generics/chapters/monoids.tex index 9978db5a82095..50655b7e0e51f 100644 --- a/docs/Generics/chapters/monoids.tex +++ b/docs/Generics/chapters/monoids.tex @@ -360,7 +360,7 @@ \section{Finitely-Presented Monoids}\label{finitely presented monoids} \item For every pair of distinct prime numbers $p$ and $q$, we have $p\cdot q\sim q\cdot p$, so our binary operation is commutative. \item For every prime number $p$, we have $0\cdot p\sim 0$ and $p\cdot 0\sim 0$, so that zero behaves like the \index{zero element}zero element. \end{itemize} -In fact, no ``smaller'' presentation exists. It is perhaps surprising to constrast this with $(\mathbb{N},+,0)$, which just the free monoid with one generator. +In fact, no ``smaller'' presentation exists. It is perhaps surprising to contrast this with $(\mathbb{N},+,0)$, which just the free monoid with one generator. \end{example} \paragraph{Mathematical aside.} diff --git a/docs/Generics/chapters/symbols-terms-and-rules.tex b/docs/Generics/chapters/symbols-terms-and-rules.tex index 9499551707418..331538127ca70 100644 --- a/docs/Generics/chapters/symbols-terms-and-rules.tex +++ b/docs/Generics/chapters/symbols-terms-and-rules.tex @@ -993,7 +993,7 @@ \subsection*{Symbols} \IndexSource{rule builder} collectRulesFromReferencedProtocols() is actually the algorithm from the previous section. -\apiref{rewriting::Trie}{tempalte class} +\apiref{rewriting::Trie}{template class} \IndexSource{trie} See also \SecRef{completion sourceref}. diff --git a/docs/Generics/chapters/type-resolution.tex b/docs/Generics/chapters/type-resolution.tex index 5630f4dfc3701..71177ff7e39ee 100644 --- a/docs/Generics/chapters/type-resolution.tex +++ b/docs/Generics/chapters/type-resolution.tex @@ -464,7 +464,7 @@ \section{Member Type Representations}\label{member type repr} func celebratePetBirthday(_ age: Pet.Age) {} \end{Verbatim} -Due to pecularities of type substitution, protocol type aliases that are also \index{generic type alias}generic are always considered to depend on \texttt{Self}, even if their underlying type does not reference \texttt{Self}, so they \index{limitation!generic type alias with protocol base}cannot be referenced with a protocol base. (In structural resolution stage, a generic type alias cannot be referenced with a \index{limitation!generic type alias with type parameter base}type parameter base, either. Perhaps it is best not to stick generic type aliases inside protocols, at all.) +Due to peculiarities of type substitution, protocol type aliases that are also \index{generic type alias}generic are always considered to depend on \texttt{Self}, even if their underlying type does not reference \texttt{Self}, so they \index{limitation!generic type alias with protocol base}cannot be referenced with a protocol base. (In structural resolution stage, a generic type alias cannot be referenced with a \index{limitation!generic type alias with type parameter base}type parameter base, either. Perhaps it is best not to stick generic type aliases inside protocols, at all.) \paragraph{General principle.} Let's say that $H$ is the generic signature of the current context, and \texttt{T} is the resolved base type of our member type representation, obtained via a recursive call to type resolution. We perform a \index{qualified lookup}qualified lookup after considering the base type \texttt{T}: \begin{itemize} diff --git a/docs/SIL.rst b/docs/SIL.rst index 75d29dfefff0c..566726c4d5ca5 100644 --- a/docs/SIL.rst +++ b/docs/SIL.rst @@ -1181,7 +1181,7 @@ information when inlined. The function is a compiler generated thunk. :: - sil-function-attribute ::= '[dynamically_replacable]' + sil-function-attribute ::= '[dynamically_replaceable]' The function can be replaced at runtime with a different implementation. Optimizations must not assume anything about such a function, even if the SIL @@ -3747,7 +3747,7 @@ of ``scalar_pack_index``, ``pack_pack_index``, or ``dynamic_pack_index``), and it must index into a pack type with the same shape as the indexed pack type. -Third, additional restrictions must be satisifed depending on which +Third, additional restrictions must be satisfied depending on which pack indexing instruction the pack index is: - For ``scalar_pack_index``, the projected element type must be the @@ -5778,8 +5778,8 @@ dynamic_function_ref // $@convention(thin) T -> U must be a thin function type // %1 has type $T -> U -Creates a reference to a `dynamically_replacable` SIL function. A -`dynamically_replacable` SIL function can be replaced at runtime. +Creates a reference to a `dynamically_replaceable` SIL function. A +`dynamically_replaceable` SIL function can be replaced at runtime. For the following Swift code:: @@ -5791,7 +5791,7 @@ For the following Swift code:: We will generate:: - sil [dynamically_replacable] @test_dynamically_replaceable : $@convention(thin) () -> () { + sil [dynamically_replaceable] @test_dynamically_replaceable : $@convention(thin) () -> () { bb0: %0 = tuple () return %0 : $() diff --git a/docs/Swift3Compatibility.md b/docs/Swift3Compatibility.md index 992702443a4ea..23d52a870a5f3 100644 --- a/docs/Swift3Compatibility.md +++ b/docs/Swift3Compatibility.md @@ -106,7 +106,7 @@ Any other changes are likely to break clients, even more so if overrides are a p - If it's a parameter for a top-level function, a struct or enum method, or a class method you call but don't override, there should be no problem. - If it's an index for a subscript you call but don't override, there should be no problem. -Unfortunately, the remaining changes are clearly unsafe, but may still happen because of APIs that were mis-annotated. +Unfortunately, the remaining changes are clearly unsafe, but may still happen because of APIs that were misannotated. - If it's a property or a subscript element, this change **breaks source compatibility.** - If it's a result type for a top-level function, struct or enum method, or class method, this change **breaks source compatibility.** diff --git a/include/swift-c/DependencyScan/DependencyScan.h b/include/swift-c/DependencyScan/DependencyScan.h index 38c9aca02e278..b5b7fbde7dc1e 100644 --- a/include/swift-c/DependencyScan/DependencyScan.h +++ b/include/swift-c/DependencyScan/DependencyScan.h @@ -725,7 +725,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..fd15138a0a116 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 once /// 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 09787818085a5..c7c209cc64f44 100644 --- a/include/swift/AST/ASTContext.h +++ b/include/swift/AST/ASTContext.h @@ -842,7 +842,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 14262925be73f..94f6912989540 100644 --- a/include/swift/AST/Decl.h +++ b/include/swift/AST/Decl.h @@ -1200,7 +1200,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; @@ -1318,7 +1318,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; @@ -5609,11 +5609,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 a2cd68088a091..99abfccd44d3e 100644 --- a/include/swift/AST/DiagnosticsFrontend.def +++ b/include/swift/AST/DiagnosticsFrontend.def @@ -174,7 +174,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/DiagnosticsSIL.def b/include/swift/AST/DiagnosticsSIL.def index a91cad7008069..d8ec4667c49b2 100644 --- a/include/swift/AST/DiagnosticsSIL.def +++ b/include/swift/AST/DiagnosticsSIL.def @@ -373,7 +373,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 e62a5a6a4ef6f..18b56eba57235 100644 --- a/include/swift/AST/DiagnosticsSema.def +++ b/include/swift/AST/DiagnosticsSema.def @@ -4338,7 +4338,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",()) @@ -7497,12 +7497,12 @@ ERROR(wrap_invalid_attr_added_by_access_note, none, ERROR(cannot_default_generic_parameter_inferrable_from_another_parameter, none, "cannot use default expression for inference of %0 because it " - "is inferrable from parameters %1", + "is inferable from parameters %1", (Type, StringRef)) ERROR(cannot_default_generic_parameter_inferrable_through_same_type, none, "cannot use default expression for inference of %0 because it " - "is inferrable through same-type requirement: '%1'", + "is inferable through same-type requirement: '%1'", (Type, StringRef)) ERROR(cannot_default_generic_parameter_invalid_requirement, none, @@ -7802,7 +7802,7 @@ ERROR(bitwise_copyable_outside_module,none, "conformance to 'BitwiseCopyable' must occur in the same module as %kind0", (const ValueDecl *)) ERROR(suppress_inferrable_protocol_extension,none, - "conformance to inferrable protocol %0 cannot be suppressed in an extension", (const ProtocolDecl *)) + "conformance to inferable protocol %0 cannot be suppressed in an extension", (const ProtocolDecl *)) ERROR(suppress_nonsuppressable_protocol,none, "conformance to %0 cannot be suppressed", (const ProtocolDecl *)) WARNING(suppress_already_suppressed_protocol,none, @@ -7968,7 +7968,7 @@ ERROR(lifetime_dependence_only_on_function_method_init_result, none, ERROR(lifetime_dependence_invalid_return_type, none, "lifetime dependence can only be specified on ~Escapable results", ()) 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 50f141a103f9c..9b6340df50345 100644 --- a/include/swift/AST/Expr.h +++ b/include/swift/AST/Expr.h @@ -3525,7 +3525,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 448e255ceadf6..c64fa23081691 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: @@ -337,7 +337,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/Module.h b/include/swift/AST/Module.h index 42f4a27b669a3..bed8984b93e7e 100644 --- a/include/swift/AST/Module.h +++ b/include/swift/AST/Module.h @@ -1315,7 +1315,7 @@ inline SourceLoc extractNearestSourceLoc(const ModuleDecl *mod) { return extractNearestSourceLoc(static_cast(mod)); } -/// If the import that would make the given declaration visibile is absent, +/// If the import that would make the given declaration visible is absent, /// emit a diagnostic and a fix-it suggesting adding the missing import. bool diagnoseMissingImportForMember(const ValueDecl *decl, const DeclContext *dc, SourceLoc loc); diff --git a/include/swift/AST/ModuleDependencies.h b/include/swift/AST/ModuleDependencies.h index 6c28057e3cfdb..3bdf681f23f08 100644 --- a/include/swift/AST/ModuleDependencies.h +++ b/include/swift/AST/ModuleDependencies.h @@ -90,7 +90,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; @@ -659,7 +659,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 282565053774e..e754fdb99c07e 100644 --- a/include/swift/AST/SourceFile.h +++ b/include/swift/AST/SourceFile.h @@ -253,7 +253,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 78f0df7161384..5049f26b4da2d 100644 --- a/include/swift/AST/TypeCheckRequests.h +++ b/include/swift/AST/TypeCheckRequests.h @@ -1801,7 +1801,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 e46a259106af7..98a0f8a593b2b 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 7f69b94e2401c..70c79f100bb0f 100644 --- a/include/swift/AST/Types.h +++ b/include/swift/AST/Types.h @@ -6072,7 +6072,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 46669234f588c..b6c2b1f2e957e 100644 --- a/include/swift/Basic/Features.def +++ b/include/swift/Basic/Features.def @@ -285,7 +285,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 1401f7324fd0f..938dfd20717e2 100644 --- a/include/swift/Basic/LangOptions.h +++ b/include/swift/Basic/LangOptions.h @@ -207,7 +207,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; @@ -388,7 +388,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; @@ -884,7 +884,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 350ea0744d948..132ecb4e9849e 100644 --- a/include/swift/Basic/SourceManager.h +++ b/include/swift/Basic/SourceManager.h @@ -213,7 +213,7 @@ class SourceManager { 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 @@ -447,7 +447,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 dd74ebe42146e..ccc17588361c0 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. + /// Discarded 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 e60e228fe3e28..ff74fe93817d4 100644 --- a/include/swift/Frontend/Frontend.h +++ b/include/swift/Frontend/Frontend.h @@ -679,7 +679,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..0bb86fe52623d 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 suggestive /// 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 48566a6bb9c23..ae4950b62366e 100644 --- a/include/swift/Option/Options.td +++ b/include/swift/Option/Options.td @@ -1000,11 +1000,11 @@ def ExperimentalPackageCMO : Flag<["-"], "experimental-package-cmo">, Flags<[FrontendOption]>, HelpText<"Enable optimization to perform default CMO within a package boundary">; -def EnbaleDefaultCMO : Flag<["-"], "enable-default-cmo">, +def EnableDefaultCMO : Flag<["-"], "enable-default-cmo">, Flags<[HelpHidden, FrontendOption]>, HelpText<"Perform conservative cross-module optimization">; -def EnbaleCMOEverything : Flag<["-"], "enable-cmo-everything">, +def EnableCMOEverything : Flag<["-"], "enable-cmo-everything">, Flags<[HelpHidden, FrontendOption]>, HelpText<"Perform cross-module optimization on everything (all APIs). " "This is the same level of serialization as Embedded Swift.">; 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 5ab1310ee0e6c..afa914cab2294 100644 --- a/include/swift/Parse/Parser.h +++ b/include/swift/Parse/Parser.h @@ -606,7 +606,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 0a98b782d05c2..b3048e3e5ce02 100644 --- a/include/swift/RemoteInspection/TypeRefBuilder.h +++ b/include/swift/RemoteInspection/TypeRefBuilder.h @@ -999,7 +999,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; @@ -1710,7 +1710,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 8030dc2ab7ba3..16cf528401966 100644 --- a/include/swift/SIL/InstructionUtils.h +++ b/include/swift/SIL/InstructionUtils.h @@ -218,7 +218,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); @@ -226,7 +226,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 2ec078beb6ebf..87b7711e7d133 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) { @@ -754,7 +754,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 @@ -844,7 +844,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/SILCloner.h b/include/swift/SIL/SILCloner.h index aa96a58bb1b3d..79f81ac060c86 100644 --- a/include/swift/SIL/SILCloner.h +++ b/include/swift/SIL/SILCloner.h @@ -414,7 +414,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 9a8d3baa38ba0..b182646616ad2 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; } @@ -5199,7 +5199,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; @@ -5739,7 +5739,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 @@ -7982,7 +7982,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. @@ -9826,7 +9826,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 5dbb3c30e86f0..cc9fc6bdee92e 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 a71321067cf37..3dd91f23d58c9 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 99bc66d531d81..415a55419a90c 100644 --- a/include/swift/SILOptimizer/Analysis/RegionAnalysis.h +++ b/include/swift/SILOptimizer/Analysis/RegionAnalysis.h @@ -108,7 +108,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); }; @@ -357,15 +357,15 @@ 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; - /// Returns the value for this instruction. If it is a fake "representative + /// Returns the value for this instruction. If it is a "fake" representative /// value" returns an empty SILValue. SILValue maybeGetRepresentative(Element trackableValueID) const; - /// Returns the fake "representative value" for this element if it + /// Returns the "fake" representative value for this element if it /// exists. Returns nullptr otherwise. SILInstruction *maybeGetActorIntroducingInst(Element trackableValueID) const; diff --git a/include/swift/SILOptimizer/OptimizerBridging.h b/include/swift/SILOptimizer/OptimizerBridging.h index be849ef3cd965..fb72498f7702b 100644 --- a/include/swift/SILOptimizer/OptimizerBridging.h +++ b/include/swift/SILOptimizer/OptimizerBridging.h @@ -105,11 +105,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 { @@ -412,7 +412,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 a769fac3937c5..a7ba832780e2a 100644 --- a/include/swift/SILOptimizer/Utils/PartitionUtils.h +++ b/include/swift/SILOptimizer/Utils/PartitionUtils.h @@ -347,7 +347,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. @@ -673,7 +673,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 @@ -716,7 +716,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)) @@ -727,7 +727,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) @@ -818,7 +818,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 @@ -1109,7 +1109,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; @@ -1375,7 +1375,7 @@ struct PartitionOpEvaluatorBaseImpl : PartitionOpEvaluator { const PartitionOp &op, Element elt, Element otherElement, SILDynamicMergedIsolationInfo isolationRegionInfo) 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 198a87887947a..e79563e18c457 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 3db029eb5c3c3..2f7d683f6d709 100644 --- a/include/swift/Sema/ConstraintSystem.h +++ b/include/swift/Sema/ConstraintSystem.h @@ -5101,7 +5101,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 c1c5577257f85..c1972b26a2f54 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 64ffa54a54348..b2a7396b58ea9 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 5553bb5d99d21..450733883a598 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -720,7 +720,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)); @@ -4064,7 +4064,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 7386a96a94cde..e2f1a6759669b 100644 --- a/lib/AST/ASTPrinter.cpp +++ b/lib/AST/ASTPrinter.cpp @@ -3581,7 +3581,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; @@ -7042,7 +7042,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 bda9a58a6260c..e3ea117820ada 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 cdf1cabfbea00..7075f259b608a 100644 --- a/lib/AST/NameLookup.cpp +++ b/lib/AST/NameLookup.cpp @@ -3641,7 +3641,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 f420a5eb772f1..0530673bab6d5 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 50d7870a4d094..d759ece241faf 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -3626,9 +3626,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 14b50c1e78e36..4cdc685effc53 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", @@ -68,7 +68,7 @@ let package = Package( "_CompilerRegexParser", ], path: "Sources/ASTGen", - swiftSettings: swiftSetttings + swiftSettings: swiftSettings ), .target( name: "swiftIDEUtilsBridging", @@ -78,13 +78,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 7cc30a47e964a..26a85445f1136 100644 --- a/lib/ASTGen/Sources/ASTGen/DiagnosticsBridge.swift +++ b/lib/ASTGen/Sources/ASTGen/DiagnosticsBridge.swift @@ -334,7 +334,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 291a2f331456f..03f58a67d1248 100644 --- a/lib/Basic/BasicBridging.cpp +++ b/lib/Basic/BasicBridging.cpp @@ -17,7 +17,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 b20b87c98fec7..370f05f437f5d 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -1022,7 +1022,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); @@ -7678,7 +7678,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") @@ -7721,7 +7721,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 39a1ff8540833..6eb6e8cdab169 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 84bb87915e079..7641c39db75d7 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()}; @@ -638,7 +638,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); @@ -710,7 +710,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 @@ -801,7 +801,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 2cf44f03f692a..3417f7ee8ae2b 100644 --- a/lib/Frontend/CASOutputBackends.cpp +++ b/lib/Frontend/CASOutputBackends.cpp @@ -216,7 +216,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 d4a365deb9f82..07580109ffb05 100644 --- a/lib/Frontend/CachingUtils.cpp +++ b/lib/Frontend/CachingUtils.cpp @@ -190,7 +190,7 @@ bool replayCachedCompilerOutputs( return Proxy.takeError(); 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 c44665ab75122..5704d61332a79 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -1988,14 +1988,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; @@ -2596,9 +2596,9 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args, Opts.DisableSILPerfOptimizations |= Args.hasArg(OPT_disable_sil_perf_optzns); if (Args.hasArg(OPT_CrossModuleOptimization)) { Opts.CMOMode = CrossModuleOptimizationMode::Aggressive; - } else if (Args.hasArg(OPT_EnbaleDefaultCMO)) { + } else if (Args.hasArg(OPT_EnableDefaultCMO)) { Opts.CMOMode = CrossModuleOptimizationMode::Default; - } else if (Args.hasArg(OPT_EnbaleCMOEverything)) { + } else if (Args.hasArg(OPT_EnableCMOEverything)) { Opts.CMOMode = CrossModuleOptimizationMode::Everything; } diff --git a/lib/Frontend/DiagnosticHelper.cpp b/lib/Frontend/DiagnosticHelper.cpp index d5b083ac3bf68..e5a3034d12d9a 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 3c46b333373d9..27b0e80e2fc93 100644 --- a/lib/Frontend/ModuleInterfaceLoader.cpp +++ b/lib/Frontend/ModuleInterfaceLoader.cpp @@ -1909,7 +1909,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 118f8ee2635c5..3931327f402b7 100644 --- a/lib/Frontend/ModuleInterfaceSupport.cpp +++ b/lib/Frontend/ModuleInterfaceSupport.cpp @@ -323,7 +323,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 60dc4a30adaea..385a498466803 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 @@ -2035,7 +2035,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 a156d5a3b0098..1e71503c695e0 100644 --- a/lib/IDE/CompletionLookup.cpp +++ b/lib/IDE/CompletionLookup.cpp @@ -1140,7 +1140,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) @@ -1354,8 +1354,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, @@ -1396,14 +1396,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. @@ -1615,8 +1615,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, @@ -1649,7 +1649,7 @@ void CompletionLookup::addSubscriptCall(const SubscriptDecl *SD, resultTy = OptionalType::get(resultTy); } - if (implictlyAsync) + if (implicitlyAsync) Builder.addAnnotatedAsync(); addTypeAnnotation(Builder, resultTy, SD->getGenericSignatureOfContext()); @@ -3326,13 +3326,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 94bfd1cf013c2..f47d5a6d90e77 100644 --- a/lib/IDE/CompletionOverrideLookup.cpp +++ b/lib/IDE/CompletionOverrideLookup.cpp @@ -85,7 +85,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 41289630d0e94..8e6a49a0941d0 100644 --- a/lib/IDE/CursorInfo.cpp +++ b/lib/IDE/CursorInfo.cpp @@ -400,7 +400,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..b6352e1ceea9c 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..7b41e9750b1a8 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 8c2cbb7bb1895..d3eed822c0230 100644 --- a/lib/IDE/IDETypeChecking.cpp +++ b/lib/IDE/IDETypeChecking.cpp @@ -690,7 +690,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 ebce1b84a977c..0976ff7a7f77e 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 57bbe1a92699f..03a8c8396edea 100644 --- a/lib/IDE/TypeContextInfo.cpp +++ b/lib/IDE/TypeContextInfo.cpp @@ -162,7 +162,7 @@ void ContextInfoCallbacks::getImplicitMembers( Type T; SmallVectorImpl &Result; - bool canBeImplictMember(ValueDecl *VD) { + bool canBeImplicitMember(ValueDecl *VD) { if (VD->isOperator()) return false; @@ -190,7 +190,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 a1c5f68f52a7a..4ed1840d2fe23 100644 --- a/lib/IRGen/GenCall.cpp +++ b/lib/IRGen/GenCall.cpp @@ -758,7 +758,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: { auto fnConv = getSILFuncConventions(); @@ -4399,7 +4399,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 d53506d7058cb..90b9314fddf9f 100644 --- a/lib/IRGen/GenDecl.cpp +++ b/lib/IRGen/GenDecl.cpp @@ -588,7 +588,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()); } } @@ -3714,7 +3714,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 252882fa80688..4181a9abc9118 100644 --- a/lib/IRGen/GenMeta.cpp +++ b/lib/IRGen/GenMeta.cpp @@ -1325,7 +1325,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; @@ -6547,7 +6547,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 0811f1475906c..bddd12e3a9122 100644 --- a/lib/IRGen/GenPack.cpp +++ b/lib/IRGen/GenPack.cpp @@ -843,7 +843,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 @@ -912,7 +912,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; @@ -1313,7 +1313,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 458778cccba82..005a340a805c2 100644 --- a/lib/IRGen/GenProto.cpp +++ b/lib/IRGen/GenProto.cpp @@ -1677,7 +1677,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: @@ -2558,7 +2558,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 8ed8b64e89165..e58941ed90cc8 100644 --- a/lib/IRGen/IRGen.cpp +++ b/lib/IRGen/IRGen.cpp @@ -337,7 +337,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 7a28ca2c595c7..b53150b9a262f 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 c9befd0f6268a..69b793b6c775d 100644 --- a/lib/IRGen/IRGenFunction.h +++ b/lib/IRGen/IRGenFunction.h @@ -818,7 +818,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 ba00a0a3296cd..f25475fe3ee2e 100644 --- a/lib/IRGen/IRGenSIL.cpp +++ b/lib/IRGen/IRGenSIL.cpp @@ -4254,7 +4254,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. @@ -5529,7 +5529,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() || @@ -6280,7 +6280,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. @@ -6289,7 +6289,7 @@ void IRGenSILFunction::visitAllocRefInst(swift::AllocRefInst *i) { EstimatedStackSize += StackAllocSize; } Explosion e; - e.add(alloced); + e.add(allocated); setLoweredExplosion(i, e); } @@ -6307,7 +6307,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); @@ -6319,7 +6319,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 2de9a9e9ccb6c..57fc40c9d8d18 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 7b0fe6c480394..4a4463a1838e1 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; @@ -2571,7 +2571,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); @@ -2652,7 +2652,7 @@ Parser::parseMacroRoleAttribute( return status; } - // If the field name is empty and we haved seen "names", or the field name + // 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 268cf0c0bed04..5104c01eb8c05 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 f2e5bb089681d..00af0a7553d6e 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 b391a00c0dafb..3ad6c0b442597 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 2f543d747788d..3948a3854c0e2 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(); @@ -622,7 +622,7 @@ void ClangValueTypePrinter::printTypeGenericTraits( os << "namespace swift SWIFT_PRIVATE_ATTR {\n"; if (typeDecl->hasClangNode()) { - /// Print a reference to the type metadata fucntion for a C++ type. + /// Print a reference to the type metadata function for a C++ type. ClangSyntaxPrinter(os).printNamespace( cxx_synthesis::getCxxImplNamespaceName(), [&](raw_ostream &os) { ClangSyntaxPrinter(os).printCTypeMetadataTypeFunction( 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..855f67201d3a7 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 74c57785d792a..f76034fa60c7a 100644 --- a/lib/SIL/IR/AbstractionPattern.cpp +++ b/lib/SIL/IR/AbstractionPattern.cpp @@ -2015,7 +2015,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 53b1103423b0b..07d459bdf7a10 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/SILPrinter.cpp b/lib/SIL/IR/SILPrinter.cpp index 7f11f138e8a4c..829add89b92aa 100644 --- a/lib/SIL/IR/SILPrinter.cpp +++ b/lib/SIL/IR/SILPrinter.cpp @@ -3380,7 +3380,7 @@ void SILFunction::print(SILPrintContext &PrintCtx) const { case IsReabstractionThunk: OS << "[reabstraction_thunk] "; break; } if (isDynamicallyReplaceable()) { - OS << "[dynamically_replacable] "; + OS << "[dynamically_replaceable] "; } if (isDistributed()) { OS << "[distributed] "; 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 b970fc8e19fa1..8cd99f58b6200 100644 --- a/lib/SIL/IR/TypeLowering.cpp +++ b/lib/SIL/IR/TypeLowering.cpp @@ -3043,7 +3043,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. @@ -4623,7 +4623,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/ParseSIL.cpp b/lib/SIL/Parser/ParseSIL.cpp index 3819f59c19d98..4b91b815a2b77 100644 --- a/lib/SIL/Parser/ParseSIL.cpp +++ b/lib/SIL/Parser/ParseSIL.cpp @@ -699,7 +699,7 @@ static bool parseDeclSILOptional( *serializedKind = IsSerialized; else if (serializedKind && SP.P.Tok.getText() == "serialized_for_package") *serializedKind = IsSerializedForPackage; - else if (isDynamic && SP.P.Tok.getText() == "dynamically_replacable") + else if (isDynamic && SP.P.Tok.getText() == "dynamically_replaceable") *isDynamic = IsDynamic; else if (isDistributed && SP.P.Tok.getText() == "distributed") *isDistributed = IsDistributed; 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 df532afdd2d93..8ac499f613dd5 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 278031799b218..729e9ee9ab21d 100644 --- a/lib/SIL/Utils/OSSALifetimeCompletion.cpp +++ b/lib/SIL/Utils/OSSALifetimeCompletion.cpp @@ -200,7 +200,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); @@ -253,7 +253,7 @@ void AvailabilityBoundaryVisitor::visit(const SSAPrunedLiveness &liveness, Result &result, Visit visit) { computeRegion(liveness); - propagateAvailablity(result); + propagateAvailability(result); visitAvailabilityBoundary(result, visit); } @@ -315,7 +315,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 0f7bdeaba2fac..4d3bd7cb37886 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 86a6a27ea0ed7..df0433d22dca7 100644 --- a/lib/SIL/Verifier/SILVerifier.cpp +++ b/lib/SIL/Verifier/SILVerifier.cpp @@ -6191,7 +6191,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. @@ -6516,7 +6516,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; @@ -6978,7 +6978,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 @@ -7087,12 +7087,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 f5db9de6edd5b..6e990e2b70ff8 100644 --- a/lib/SILGen/SILGen.cpp +++ b/lib/SILGen/SILGen.cpp @@ -476,7 +476,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 1908bf080e934..409f7c100ccaa 100644 --- a/lib/SILGen/SILGenApply.cpp +++ b/lib/SILGen/SILGenApply.cpp @@ -2997,7 +2997,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 1b1b9aade565d..b4fc2c351a57f 100644 --- a/lib/SILGen/SILGenConcurrency.cpp +++ b/lib/SILGen/SILGenConcurrency.cpp @@ -596,7 +596,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 f60f716cf82bf..b61be61cf436a 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 4f2d98d6f8730..9d2bf96f5d6c4 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, @@ -2888,7 +2888,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 a8674a927c427..08b11db99afae 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 5fa41a0eac2a1..ac7b4eafb26a3 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 8590f21ae9681..d11c4dd0d9bcb 100644 --- a/lib/SILGen/SILGenPoly.cpp +++ b/lib/SILGen/SILGenPoly.cpp @@ -2348,7 +2348,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 ff63011856ac1..09ac4c5018989 100644 --- a/lib/SILGen/SILGenType.cpp +++ b/lib/SILGen/SILGenType.cpp @@ -867,7 +867,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 1f1b8009a219c..7300199267c43 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(ApplySite 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 4a43eccc19f62..26a97a557ffe9 100644 --- a/lib/SILOptimizer/Analysis/RegionAnalysis.cpp +++ b/lib/SILOptimizer/Analysis/RegionAnalysis.cpp @@ -1184,7 +1184,7 @@ struct PartitionOpBuilder { lookupValueID(fst), lookupValueID(snd), currentInst)); } - /// 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 value, SILIsolationInfo actorIsolation) { @@ -1288,7 +1288,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, @@ -1606,7 +1606,7 @@ class PartitionOpTranslator { SmallVector 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. @@ -1627,7 +1627,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) { LLVM_DEBUG( llvm::dbgs() << "Merge Failure!\n" @@ -1653,7 +1653,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); } @@ -2646,7 +2646,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) @@ -3274,7 +3274,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); } LLVM_DEBUG(llvm::dbgs() << " Working Partition: "; diff --git a/lib/SILOptimizer/Differentiation/JVPCloner.cpp b/lib/SILOptimizer/Differentiation/JVPCloner.cpp index d06acb21354d5..0b89217717ffb 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 c60fd1a5178eb..b5f57da8e6257 100644 --- a/lib/SILOptimizer/Differentiation/LinearMapInfo.cpp +++ b/lib/SILOptimizer/Differentiation/LinearMapInfo.cpp @@ -349,7 +349,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 e39bcb127b4a3..4194a46450b35 100644 --- a/lib/SILOptimizer/Differentiation/PullbackCloner.cpp +++ b/lib/SILOptimizer/Differentiation/PullbackCloner.cpp @@ -164,8 +164,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() }}); @@ -175,8 +175,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 ec162fdc9ba60..7d6ecf8eb6804 100644 --- a/lib/SILOptimizer/Differentiation/VJPCloner.cpp +++ b/lib/SILOptimizer/Differentiation/VJPCloner.cpp @@ -1254,7 +1254,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 74bf2ac78c2c9..77a5a47e7ad3e 100644 --- a/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp +++ b/lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp @@ -2237,12 +2237,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 b2004810df9e4..6d137586bcc47 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 1a0b3e9773444..c6237d3704548 100644 --- a/lib/SILOptimizer/Mandatory/MoveOnlyAddressCheckerUtils.cpp +++ b/lib/SILOptimizer/Mandatory/MoveOnlyAddressCheckerUtils.cpp @@ -3175,7 +3175,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()) { @@ -3274,7 +3274,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() == @@ -3413,7 +3413,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 b7f3a58c65c02..1366f4759834d 100644 --- a/lib/SILOptimizer/Mandatory/OSLogOptimization.cpp +++ b/lib/SILOptimizer/Mandatory/OSLogOptimization.cpp @@ -810,7 +810,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 12c25571f4ddd..8e6c6ef4587ce 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) : @@ -631,7 +631,7 @@ bool PerformanceDiagnostics::visitInst(SILInstruction *inst, switch (inst->getKind()) { case SILInstructionKind::BeginApplyInst: - // Not all begin_applys necessarily allocate. But it's difficult to + // Not all begin_applies necessarily allocate. But it's difficult to // estimate the effect on SIL level. diagnose(loc, diag::performance_allocating, "co-routine calls"); break; 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 3903c100eafa2..2329a20c30c99 100644 --- a/lib/SILOptimizer/Mandatory/TransferNonSendable.cpp +++ b/lib/SILOptimizer/Mandatory/TransferNonSendable.cpp @@ -358,7 +358,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()) { LLVM_DEBUG( @@ -1412,7 +1412,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 e725ad7f9dbba..bd0407b5186e0 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 f81a4bcad8b9e..a4c43aff1ac18 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 980957f41740d..be40d6c2114b4 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 f0e1e7198133d..0256c27d4b323 100644 --- a/lib/SILOptimizer/Transforms/TempRValueElimination.cpp +++ b/lib/SILOptimizer/Transforms/TempRValueElimination.cpp @@ -405,7 +405,7 @@ bool TempRValueOptPass::extendAccessScopes( if (!aa->isNoAlias(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 8abc9eece29dc..830fefacc439c 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 d057d53dd5f82..b6347cfc0dc40 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 de8a82ea4bafa..994b11e6bf1ec 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)) @@ -441,9 +441,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 2a4b73cf6abe4..6c8c9cf3236f3 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 43726cb0414d3..d78e25eeab50b 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 319a422aac0d2..42bdc67ad5078 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 9a4c3575ebd3f..6239024ba0b8c 100644 --- a/lib/SILOptimizer/Utils/VariableNameUtils.cpp +++ b/lib/SILOptimizer/Utils/VariableNameUtils.cpp @@ -299,7 +299,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 793570acb20ab..38e861c7c75d9 100644 --- a/lib/Sema/AssociatedTypeInference.cpp +++ b/lib/Sema/AssociatedTypeInference.cpp @@ -1292,7 +1292,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 a197f5598fdcd..d8886dcbce9f8 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()) @@ -2291,7 +2291,7 @@ bool TypeVarBindingProducer::computeNext() { newBindings.push_back(std::move(binding)); }; - // Let's attempt only directly inferrable bindings for + // Let's attempt only directly inferable bindings for // a type variable representing a closure type because // such type variables are handled specially and only // bound to a type inferred from their expression, having @@ -2565,7 +2565,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 1ae4aec7d0798..5f3036dd29e9a 100644 --- a/lib/Sema/CSDiagnostics.cpp +++ b/lib/Sema/CSDiagnostics.cpp @@ -578,7 +578,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/CSGen.cpp b/lib/Sema/CSGen.cpp index d64723f07071a..03be836af48ee 100644 --- a/lib/Sema/CSGen.cpp +++ b/lib/Sema/CSGen.cpp @@ -2551,7 +2551,7 @@ namespace { } // Because we are only pulling out the result type from the contextual - // type, we avoid prematurely converting any inferrable types by setting + // type, we avoid prematurely converting any inferable types by setting // forConstraint=false. Later on in inferClosureType we call // replaceInferableTypesWithTypeVars before returning to ensure we don't // introduce any placeholders into the constraint system. diff --git a/lib/Sema/CSSimplify.cpp b/lib/Sema/CSSimplify.cpp index b1c3c103a3c65..88204725b7065 100644 --- a/lib/Sema/CSSimplify.cpp +++ b/lib/Sema/CSSimplify.cpp @@ -6781,7 +6781,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); @@ -6819,7 +6819,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(); @@ -7177,12 +7177,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() && @@ -7493,7 +7493,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: @@ -8757,7 +8757,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()) @@ -10893,7 +10893,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()); @@ -13882,11 +13882,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; } @@ -13913,11 +13913,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 1582f5f4ec3b7..d608b98606f5d 100644 --- a/lib/Sema/CSSyntacticElement.cpp +++ b/lib/Sema/CSSyntacticElement.cpp @@ -82,7 +82,7 @@ class TypeVariableRefFinder : public ASTWalker { if (auto type = CS.getTypeIfAvailable(decl)) { auto &ctx = CS.getASTContext(); // If this is not one of the closure parameters which - // is inferrable from the body, let's replace type + // is inferable from the body, let's replace type // variables with errors to avoid bringing external // information to the element component. if (type->hasTypeVariable() && @@ -233,7 +233,7 @@ class TypeVariableRefFinder : public ASTWalker { // we can bring in scope unrelated type variables passed // into the closure (via parameter/result) from contextual type. // For example `Typealias<$T, $U>.Context` which desugars into - // `_Context<$U>` would bring in `$T` that could be inferrable + // `_Context<$U>` would bring in `$T` that could be inferable // only after the body of the closure is solved. type = type->getCanonicalType(); @@ -1041,7 +1041,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( @@ -1205,7 +1205,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. @@ -1219,7 +1219,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; @@ -1750,7 +1750,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 1c71355c5bf24..373368e35ec19 100644 --- a/lib/Sema/CodeSynthesis.cpp +++ b/lib/Sema/CodeSynthesis.cpp @@ -1132,7 +1132,7 @@ static ValueDecl *findImplementedObjCDecl(ValueDecl *VD) { return VD; } -static void collectNonOveriddenSuperclassInits( +static void collectNonOverriddenSuperclassInits( ClassDecl *subclass, SmallVectorImpl &results) { auto *superclassDecl = subclass->getSuperclassDecl(); assert(superclassDecl); @@ -1220,7 +1220,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) { @@ -1322,7 +1322,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 dd50ec47857f4..2516edf24a08d 100644 --- a/lib/Sema/IDETypeCheckingRequests.cpp +++ b/lib/Sema/IDETypeCheckingRequests.cpp @@ -123,7 +123,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 589b2250a54e6..ea2add988a7f2 100644 --- a/lib/Sema/MiscDiagnostics.cpp +++ b/lib/Sema/MiscDiagnostics.cpp @@ -2091,7 +2091,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. @@ -5332,7 +5332,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); @@ -6256,8 +6256,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 c290cff74024e..bd56f3e744cf8 100644 --- a/lib/Sema/TypeCheckAttr.cpp +++ b/lib/Sema/TypeCheckAttr.cpp @@ -2357,7 +2357,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 dd2b19f03761c..3d0ff5b651526 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 9f1139d378169..904384cd3f3e0 100644 --- a/lib/Sema/TypeCheckConcurrency.cpp +++ b/lib/Sema/TypeCheckConcurrency.cpp @@ -1721,7 +1721,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) { @@ -1804,7 +1804,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 1d2026e370194..87baa16d4282e 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 dd592dbabdefc..c8f053cbce731 100644 --- a/lib/Sema/TypeCheckMacros.cpp +++ b/lib/Sema/TypeCheckMacros.cpp @@ -1970,7 +1970,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 91c5574aa4cbb..5fb891498c738 100644 --- a/lib/Sema/TypeCheckProtocol.cpp +++ b/lib/Sema/TypeCheckProtocol.cpp @@ -519,7 +519,7 @@ RequirementMatch swift::matchWitness( // 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))) @@ -3783,7 +3783,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/TypeCheckRequestFunctions.cpp b/lib/Sema/TypeCheckRequestFunctions.cpp index 41bc6973ed320..03a0845af25b9 100644 --- a/lib/Sema/TypeCheckRequestFunctions.cpp +++ b/lib/Sema/TypeCheckRequestFunctions.cpp @@ -76,7 +76,7 @@ InheritedTypeResult InheritedTypeRequest::evaluate( Type inheritedType; if (auto *typeRepr = inheritedEntry.getTypeRepr()) { - // Check for suppressed inferrable conformances. + // Check for suppressed inferable conformances. if (auto itr = dyn_cast(typeRepr)) { Type inheritedTy = resolution->resolveType(itr->getConstraint()); return InheritedTypeResult::forSuppressed(inheritedTy, itr); diff --git a/lib/Sema/TypeCheckStmt.cpp b/lib/Sema/TypeCheckStmt.cpp index d761d341cc964..275dd2913d7c8 100644 --- a/lib/Sema/TypeCheckStmt.cpp +++ b/lib/Sema/TypeCheckStmt.cpp @@ -2503,7 +2503,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. @@ -2690,7 +2690,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 36836868992c6..47159dc08bd9a 100644 --- a/lib/Sema/TypeCheckType.cpp +++ b/lib/Sema/TypeCheckType.cpp @@ -5135,7 +5135,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 { ... } @@ -5621,7 +5621,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. @@ -5961,7 +5961,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 8413d64d2a89a..d275410d0ddae 100644 --- a/lib/Serialization/Serialization.cpp +++ b/lib/Serialization/Serialization.cpp @@ -1095,8 +1095,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 2335ab400cdd0..61d97e79538dd 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/lib/Threading/Win32.cpp b/lib/Threading/Win32.cpp index 9104b0dc17db8..2a10613e47d5e 100644 --- a/lib/Threading/Win32.cpp +++ b/lib/Threading/Win32.cpp @@ -72,7 +72,7 @@ void swift::threading_impl::once_slow(once_t &predicate, void (*fn)(void *), WakeByAddressAll(&predicate); #else // On Windows 7 and earlier, we use a global lock and condition variable; - // this will wake *all* waiters on *all* onces, which might result in a + // this will wake *all* waiters on *all* once, which might result in a // thundering herd problem, but it's the best we can do. AcquireSRWLockExclusive(&onceMutex); WakeAllConditionVariable(&onceCond); diff --git a/stdlib/cmake/modules/SwiftSource.cmake b/stdlib/cmake/modules/SwiftSource.cmake index 87f63995de40d..3fe4cbe093921 100644 --- a/stdlib/cmake/modules/SwiftSource.cmake +++ b/stdlib/cmake/modules/SwiftSource.cmake @@ -596,7 +596,7 @@ function(_compile_swift_files list(APPEND swift_flags "-swift-version" "5") endif() - # Avoiding emiting ABI descriptor files while building stdlib. + # Avoiding emitting ABI descriptor files while building stdlib. if (SWIFTFILE_IS_STDLIB) list(APPEND swift_flags "-Xfrontend" "-empty-abi-descriptor") endif() diff --git a/stdlib/include/llvm/ADT/STLExtras.h b/stdlib/include/llvm/ADT/STLExtras.h index 4481a60b3faff..d093ad61b996c 100644 --- a/stdlib/include/llvm/ADT/STLExtras.h +++ b/stdlib/include/llvm/ADT/STLExtras.h @@ -529,8 +529,8 @@ make_filter_range(RangeT &&Range, PredicateT Pred) { /// somewhere between them. The constraints of these iterators are: /// /// - On construction or after being incremented, it is comparable and -/// dereferencable. It is *not* incrementable. -/// - After being dereferenced, it is neither comparable nor dereferencable, it +/// dereferenceable. It is *not* incrementable. +/// - After being dereferenced, it is neither comparable nor dereferenceable, it /// is only incrementable. /// /// This means you can only dereference the iterator once, and you can only diff --git a/stdlib/include/llvm/Support/MathExtras.h b/stdlib/include/llvm/Support/MathExtras.h index 7fed6d495389e..6b48ac254adab 100644 --- a/stdlib/include/llvm/Support/MathExtras.h +++ b/stdlib/include/llvm/Support/MathExtras.h @@ -906,7 +906,7 @@ std::enable_if_t::value, T> AddOverflow(T X, T Y, T &Result) { } /// Subtract two signed integers, computing the two's complement truncated -/// result, returning true if an overflow ocurred. +/// result, returning true if an overflow occurred. template std::enable_if_t::value, T> SubOverflow(T X, T Y, T &Result) { #if __has_builtin(__builtin_sub_overflow) @@ -932,7 +932,7 @@ std::enable_if_t::value, T> SubOverflow(T X, T Y, T &Result) { } /// Multiply two signed integers, computing the two's complement truncated -/// result, returning true if an overflow ocurred. +/// result, returning true if an overflow occurred. template std::enable_if_t::value, T> MulOverflow(T X, T Y, T &Result) { // Perform the unsigned multiplication on absolute values. diff --git a/stdlib/private/StdlibUnicodeUnittest/WordBreaking.swift b/stdlib/private/StdlibUnicodeUnittest/WordBreaking.swift index 196e3ee35ca97..01e07acddaf58 100644 --- a/stdlib/private/StdlibUnicodeUnittest/WordBreaking.swift +++ b/stdlib/private/StdlibUnicodeUnittest/WordBreaking.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -// Normalization tests are currently only avaible on Darwin, awaiting a sensible +// Normalization tests are currently only available on Darwin, awaiting a sensible // file API... #if _runtime(_ObjC) import Foundation diff --git a/stdlib/private/SwiftPrivate/CMakeLists.txt b/stdlib/private/SwiftPrivate/CMakeLists.txt index 1e0bbfea54e13..07b8ac7d0033c 100644 --- a/stdlib/private/SwiftPrivate/CMakeLists.txt +++ b/stdlib/private/SwiftPrivate/CMakeLists.txt @@ -3,9 +3,9 @@ set(swift_swiftprivate_compile_flags "-Xfrontend" "-disable-access-control") if(SWIFT_BUILD_SDK_OVERLAY) -set(swift_swiftprivate_darwin_depencencies Darwin) +set(swift_swiftprivate_darwin_dependencies Darwin) else() -set(swift_swiftprivate_darwin_depencencies) +set(swift_swiftprivate_darwin_dependencies) endif() add_swift_target_library(swiftSwiftPrivate ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB @@ -21,11 +21,11 @@ add_swift_target_library(swiftSwiftPrivate ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} I GYB_SOURCES AtomicInt.swift.gyb - SWIFT_MODULE_DEPENDS_OSX ${swift_swiftprivate_darwin_depencencies} - SWIFT_MODULE_DEPENDS_IOS ${swift_swiftprivate_darwin_depencencies} - SWIFT_MODULE_DEPENDS_TVOS ${swift_swiftprivate_darwin_depencencies} - SWIFT_MODULE_DEPENDS_WATCHOS ${swift_swiftprivate_darwin_depencencies} - SWIFT_MODULE_DEPENDS_MACCATALYST ${swift_swiftprivate_darwin_depencencies} + SWIFT_MODULE_DEPENDS_OSX ${swift_swiftprivate_darwin_dependencies} + SWIFT_MODULE_DEPENDS_IOS ${swift_swiftprivate_darwin_dependencies} + SWIFT_MODULE_DEPENDS_TVOS ${swift_swiftprivate_darwin_dependencies} + SWIFT_MODULE_DEPENDS_WATCHOS ${swift_swiftprivate_darwin_dependencies} + SWIFT_MODULE_DEPENDS_MACCATALYST ${swift_swiftprivate_darwin_dependencies} SWIFT_MODULE_DEPENDS_FREESTANDING "${SWIFT_FREESTANDING_TEST_DEPENDENCIES}" SWIFT_MODULE_DEPENDS_ANDROID Android SWIFT_MODULE_DEPENDS_LINUX Glibc diff --git a/stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt b/stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt index 927eae491caa5..83a13affb475d 100644 --- a/stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt +++ b/stdlib/private/SwiftPrivateLibcExtras/CMakeLists.txt @@ -15,9 +15,9 @@ else() endif() if(SWIFT_BUILD_SDK_OVERLAY) -set(swift_private_libc_extras_darwin_depencencies Darwin) +set(swift_private_libc_extras_darwin_dependencies Darwin) else() -set(swift_private_libc_extras_darwin_depencencies) +set(swift_private_libc_extras_darwin_dependencies) endif() add_swift_target_library(swiftSwiftPrivateLibcExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB @@ -31,12 +31,12 @@ add_swift_target_library(swiftSwiftPrivateLibcExtras ${SWIFT_STDLIB_LIBRARY_BUIL SWIFT_MODULE_DEPENDS SwiftPrivate SWIFT_COMPILE_FLAGS ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS} ${swift_private_libc_extras_flags} - SWIFT_MODULE_DEPENDS_OSX ${swift_private_libc_extras_darwin_depencencies} - SWIFT_MODULE_DEPENDS_IOS ${swift_private_libc_extras_darwin_depencencies} - SWIFT_MODULE_DEPENDS_TVOS ${swift_private_libc_extras_darwin_depencencies} - SWIFT_MODULE_DEPENDS_WATCHOS ${swift_private_libc_extras_darwin_depencencies} - SWIFT_MODULE_DEPENDS_XROS ${swift_private_libc_extras_darwin_depencencies} - SWIFT_MODULE_DEPENDS_MACCATALYST ${swift_private_libc_extras_darwin_depencencies} + SWIFT_MODULE_DEPENDS_OSX ${swift_private_libc_extras_darwin_dependencies} + SWIFT_MODULE_DEPENDS_IOS ${swift_private_libc_extras_darwin_dependencies} + SWIFT_MODULE_DEPENDS_TVOS ${swift_private_libc_extras_darwin_dependencies} + SWIFT_MODULE_DEPENDS_WATCHOS ${swift_private_libc_extras_darwin_dependencies} + SWIFT_MODULE_DEPENDS_XROS ${swift_private_libc_extras_darwin_dependencies} + SWIFT_MODULE_DEPENDS_MACCATALYST ${swift_private_libc_extras_darwin_dependencies} SWIFT_MODULE_DEPENDS_FREESTANDING "${SWIFT_FREESTANDING_TEST_DEPENDENCIES}" SWIFT_MODULE_DEPENDS_ANDROID Android SWIFT_MODULE_DEPENDS_LINUX Glibc diff --git a/stdlib/private/SwiftPrivateLibcExtras/Subprocess.c b/stdlib/private/SwiftPrivateLibcExtras/Subprocess.c index 877dcd847b719..a640e7654cfca 100644 --- a/stdlib/private/SwiftPrivateLibcExtras/Subprocess.c +++ b/stdlib/private/SwiftPrivateLibcExtras/Subprocess.c @@ -54,5 +54,5 @@ int _stdlib_posix_spawn(pid_t *__restrict pid, const char * __restrict path, return posix_spawn(pid, path, file_actions, attrp, argv, envp); } -#endif // !defined(__ANDROID__) && !defined(__HAIKU__) && (!defined(_WIN32) || defined(__CGYWIN__)) && !defined(__wasi__) +#endif // !defined(__ANDROID__) && !defined(__HAIKU__) && (!defined(_WIN32) || defined(__CYGWIN__)) && !defined(__wasi__) diff --git a/stdlib/private/SwiftPrivateThreadExtras/CMakeLists.txt b/stdlib/private/SwiftPrivateThreadExtras/CMakeLists.txt index 4002af837db10..124f162220585 100644 --- a/stdlib/private/SwiftPrivateThreadExtras/CMakeLists.txt +++ b/stdlib/private/SwiftPrivateThreadExtras/CMakeLists.txt @@ -1,7 +1,7 @@ if(SWIFT_BUILD_SDK_OVERLAY) -set(swift_private_thread_extras_darwin_depencencies Darwin) +set(swift_private_thread_extras_darwin_dependencies Darwin) else() -set(swift_private_thread_extras_darwin_depencencies) +set(swift_private_thread_extras_darwin_dependencies) endif() add_swift_target_library(swiftSwiftPrivateThreadExtras ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB @@ -12,12 +12,12 @@ add_swift_target_library(swiftSwiftPrivateThreadExtras ${SWIFT_STDLIB_LIBRARY_BU "${SWIFT_SOURCE_DIR}/stdlib/linker-support/magic-symbols-for-install-name.c" - SWIFT_MODULE_DEPENDS_IOS ${swift_private_thread_extras_darwin_depencencies} - SWIFT_MODULE_DEPENDS_OSX ${swift_private_thread_extras_darwin_depencencies} - SWIFT_MODULE_DEPENDS_TVOS ${swift_private_thread_extras_darwin_depencencies} - SWIFT_MODULE_DEPENDS_WATCHOS ${swift_private_thread_extras_darwin_depencencies} - SWIFT_MODULE_DEPENDS_XROS ${swift_private_thread_extras_darwin_depencencies} - SWIFT_MODULE_DEPENDS_MACCATALYST ${swift_private_thread_extras_darwin_depencencies} + SWIFT_MODULE_DEPENDS_IOS ${swift_private_thread_extras_darwin_dependencies} + SWIFT_MODULE_DEPENDS_OSX ${swift_private_thread_extras_darwin_dependencies} + SWIFT_MODULE_DEPENDS_TVOS ${swift_private_thread_extras_darwin_dependencies} + SWIFT_MODULE_DEPENDS_WATCHOS ${swift_private_thread_extras_darwin_dependencies} + SWIFT_MODULE_DEPENDS_XROS ${swift_private_thread_extras_darwin_dependencies} + SWIFT_MODULE_DEPENDS_MACCATALYST ${swift_private_thread_extras_darwin_dependencies} SWIFT_MODULE_DEPENDS_FREESTANDING "${SWIFT_FREESTANDING_TEST_DEPENDENCIES}" SWIFT_MODULE_DEPENDS_ANDROID Android SWIFT_MODULE_DEPENDS_LINUX Glibc diff --git a/stdlib/private/SwiftReflectionTest/CMakeLists.txt b/stdlib/private/SwiftReflectionTest/CMakeLists.txt index 8ad688393765e..6dba4e6ac07fb 100644 --- a/stdlib/private/SwiftReflectionTest/CMakeLists.txt +++ b/stdlib/private/SwiftReflectionTest/CMakeLists.txt @@ -1,7 +1,7 @@ if(SWIFT_BUILD_SDK_OVERLAY) -set(swift_reflection_test_darwin_depencencies Darwin) +set(swift_reflection_test_darwin_dependencies Darwin) else() -set(swift_reflection_test_darwin_depencencies) +set(swift_reflection_test_darwin_dependencies) endif() if (SWIFT_INCLUDE_TESTS AND SWIFT_BUILD_DYNAMIC_STDLIB) @@ -9,11 +9,11 @@ if (SWIFT_INCLUDE_TESTS AND SWIFT_BUILD_DYNAMIC_STDLIB) SwiftReflectionTest.swift SWIFT_COMPILE_FLAGS ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS} SWIFT_COMPILE_FLAGS_LINUX -Xcc -D_GNU_SOURCE - SWIFT_MODULE_DEPENDS_OSX ${swift_reflection_test_darwin_depencencies} - SWIFT_MODULE_DEPENDS_IOS ${swift_reflection_test_darwin_depencencies} - SWIFT_MODULE_DEPENDS_TVOS ${swift_reflection_test_darwin_depencencies} - SWIFT_MODULE_DEPENDS_WATCHOS ${swift_reflection_test_darwin_depencencies} - SWIFT_MODULE_DEPENDS_XROS ${swift_reflection_test_darwin_depencencies} + SWIFT_MODULE_DEPENDS_OSX ${swift_reflection_test_darwin_dependencies} + SWIFT_MODULE_DEPENDS_IOS ${swift_reflection_test_darwin_dependencies} + SWIFT_MODULE_DEPENDS_TVOS ${swift_reflection_test_darwin_dependencies} + SWIFT_MODULE_DEPENDS_WATCHOS ${swift_reflection_test_darwin_dependencies} + SWIFT_MODULE_DEPENDS_XROS ${swift_reflection_test_darwin_dependencies} SWIFT_MODULE_DEPENDS_ANDROID Android SWIFT_MODULE_DEPENDS_LINUX Glibc SWIFT_MODULE_DEPENDS_LINUX_STATIC Musl diff --git a/stdlib/public/Concurrency/Actor.cpp b/stdlib/public/Concurrency/Actor.cpp index 5aa4c0a294a65..2025a17e92a62 100644 --- a/stdlib/public/Concurrency/Actor.cpp +++ b/stdlib/public/Concurrency/Actor.cpp @@ -1195,7 +1195,7 @@ class DefaultActorImpl /// It can be done when actor transitions from Idle to Scheduled or /// when actor gets a priority override and we schedule a stealer. /// - /// When the task executor is `undefined` ths task will be scheduled on the + /// When the task executor is `undefined` the task will be scheduled on the /// default global executor. void scheduleActorProcessJob(JobPriority priority, TaskExecutorRef taskExecutor); diff --git a/stdlib/public/Concurrency/CheckedContinuation.swift b/stdlib/public/Concurrency/CheckedContinuation.swift index c5a218a7ec33f..41686c9023d34 100644 --- a/stdlib/public/Concurrency/CheckedContinuation.swift +++ b/stdlib/public/Concurrency/CheckedContinuation.swift @@ -267,7 +267,7 @@ extension CheckedContinuation { /// indefinitely which will result in the task "hanging" as well as being leaked with /// no possibility to destroy it. /// -/// The checked continuation offers detection of mis-use, and dropping the last reference +/// The checked continuation offers detection of misuse, and dropping the last reference /// to it, without having resumed it will trigger a warning. Resuming a continuation twice /// is also diagnosed and will cause a crash. /// @@ -328,7 +328,7 @@ internal func __abi_withCheckedContinuation( /// indefinitely which will result in the task "hanging" as well as being leaked with /// no possibility to destroy it. /// -/// The checked continuation offers detection of mis-use, and dropping the last reference +/// The checked continuation offers detection of misuse, and dropping the last reference /// to it, without having resumed it will trigger a warning. Resuming a continuation twice /// is also diagnosed and will cause a crash. /// diff --git a/stdlib/public/Concurrency/Deque/_UnsafeWrappedBuffer.swift b/stdlib/public/Concurrency/Deque/_UnsafeWrappedBuffer.swift index 0f13b06fa3df2..ec5eb9f4e44a6 100644 --- a/stdlib/public/Concurrency/Deque/_UnsafeWrappedBuffer.swift +++ b/stdlib/public/Concurrency/Deque/_UnsafeWrappedBuffer.swift @@ -153,7 +153,7 @@ extension _UnsafeMutableWrappedBuffer { // Note: Array._copyContents traps when not given enough space, so we // need to check if we have enough contiguous space available above. // - // FIXME: Add suppport for segmented (a.k.a. piecewise contiguous) + // FIXME: Add support for segmented (a.k.a. piecewise contiguous) // collections to the stdlib. var (it, copied) = elements._copyContents(initializing: first) if copied == first.count, let second = second { diff --git a/stdlib/public/Concurrency/TaskGroup+TaskExecutor.swift b/stdlib/public/Concurrency/TaskGroup+TaskExecutor.swift index aff7581d054e5..97ed67163b10d 100644 --- a/stdlib/public/Concurrency/TaskGroup+TaskExecutor.swift +++ b/stdlib/public/Concurrency/TaskGroup+TaskExecutor.swift @@ -70,7 +70,7 @@ extension TaskGroup { /// /// - Parameters: /// - taskExecutor: The task executor that the child task should be started on and keep using. - /// If `nil` is passed explicitly, tht parent task's executor preference (if any), + /// If `nil` is passed explicitly, that parent task's executor preference (if any), /// will be ignored. In order to inherit the parent task's executor preference /// invoke `addTaskUnlessCancelled()` without passing a value to the `taskExecutor` parameter, /// and it will be inherited automatically. @@ -135,7 +135,7 @@ extension ThrowingTaskGroup { /// /// - Parameters: /// - taskExecutor: The task executor that the child task should be started on and keep using. - /// If `nil` is passed explicitly, tht parent task's executor preference (if any), + /// If `nil` is passed explicitly, that parent task's executor preference (if any), /// will be ignored. In order to inherit the parent task's executor preference /// invoke `addTask()` without passing a value to the `taskExecutor` parameter, /// and it will be inherited automatically. @@ -245,7 +245,7 @@ extension DiscardingTaskGroup { /// /// - Parameters: /// - taskExecutor: The task executor that the child task should be started on and keep using. - /// If `nil` is passed explicitly, tht parent task's executor preference (if any), + /// If `nil` is passed explicitly, that parent task's executor preference (if any), /// will be ignored. In order to inherit the parent task's executor preference /// invoke `addTask()` without passing a value to the `taskExecutor` parameter, /// and it will be inherited automatically. @@ -295,7 +295,7 @@ extension DiscardingTaskGroup { /// /// - Parameters: /// - taskExecutor: The task executor that the child task should be started on and keep using. - /// If `nil` is passed explicitly, tht parent task's executor preference (if any), + /// If `nil` is passed explicitly, that parent task's executor preference (if any), /// will be ignored. In order to inherit the parent task's executor preference /// invoke `addTask()` without passing a value to the `taskExecutor` parameter, /// and it will be inherited automatically. @@ -360,7 +360,7 @@ extension ThrowingDiscardingTaskGroup { /// /// - Parameters: /// - taskExecutor: The task executor that the child task should be started on and keep using. - /// If `nil` is passed explicitly, tht parent task's executor preference (if any), + /// If `nil` is passed explicitly, that parent task's executor preference (if any), /// will be ignored. In order to inherit the parent task's executor preference /// invoke `addTask()` without passing a value to the `taskExecutor` parameter, /// and it will be inherited automatically. @@ -410,7 +410,7 @@ extension ThrowingDiscardingTaskGroup { /// /// - Parameters: /// - taskExecutor: The task executor that the child task should be started on and keep using. - /// If `nil` is passed explicitly, tht parent task's executor preference (if any), + /// If `nil` is passed explicitly, that parent task's executor preference (if any), /// will be ignored. In order to inherit the parent task's executor preference /// invoke `addTask()` without passing a value to the `taskExecutor` parameter, /// and it will be inherited automatically. diff --git a/stdlib/public/Distributed/CMakeLists.txt b/stdlib/public/Distributed/CMakeLists.txt index 5dbea7d12f822..69491582736bc 100644 --- a/stdlib/public/Distributed/CMakeLists.txt +++ b/stdlib/public/Distributed/CMakeLists.txt @@ -11,9 +11,9 @@ #===----------------------------------------------------------------------===# if(SWIFT_BUILD_SDK_OVERLAY) -set(swift_distributed_darwin_depencencies Darwin) +set(swift_distributed_darwin_dependencies Darwin) else() -set(swift_distributed_darwin_depencencies) +set(swift_distributed_darwin_dependencies) endif() set(swift_distributed_link_libraries @@ -30,10 +30,10 @@ add_swift_target_library(swiftDistributed ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS DistributedMetadata.swift LocalTestingDistributedActorSystem.swift - SWIFT_MODULE_DEPENDS_IOS ${swift_distributed_darwin_depencencies} - SWIFT_MODULE_DEPENDS_OSX ${swift_distributed_darwin_depencencies} - SWIFT_MODULE_DEPENDS_TVOS ${swift_distributed_darwin_depencencies} - SWIFT_MODULE_DEPENDS_WATCHOS ${swift_distributed_darwin_depencencies} + SWIFT_MODULE_DEPENDS_IOS ${swift_distributed_darwin_dependencies} + SWIFT_MODULE_DEPENDS_OSX ${swift_distributed_darwin_dependencies} + SWIFT_MODULE_DEPENDS_TVOS ${swift_distributed_darwin_dependencies} + SWIFT_MODULE_DEPENDS_WATCHOS ${swift_distributed_darwin_dependencies} SWIFT_MODULE_DEPENDS_ANDROID Android SWIFT_MODULE_DEPENDS_LINUX Glibc SWIFT_MODULE_DEPENDS_FREEBSD Glibc diff --git a/stdlib/public/Distributed/DistributedActor.swift b/stdlib/public/Distributed/DistributedActor.swift index 871966001c054..fd53d71e71a28 100644 --- a/stdlib/public/Distributed/DistributedActor.swift +++ b/stdlib/public/Distributed/DistributedActor.swift @@ -325,7 +325,7 @@ extension DistributedActor /*: implicitly Decodable */ where Self.ID: Decodable /// on, in order to obtain the instance this initializer should return. /// /// - Parameter decoder: used to decode the ``ID`` of this distributed actor. - /// - Throws: If the actor system value in `decoder.userInfo` is missing or mis-typed; + /// - Throws: If the actor system value in `decoder.userInfo` is missing or mistyped; /// the `ID` fails to decode from the passed `decoder`; // or if the ``DistributedActor/resolve(id:using:)`` method invoked by this initializer throws. nonisolated public init(from decoder: Decoder) throws { diff --git a/stdlib/public/Platform/android.modulemap b/stdlib/public/Platform/android.modulemap index 78e7bda99767c..a1a9010c4a042 100644 --- a/stdlib/public/Platform/android.modulemap +++ b/stdlib/public/Platform/android.modulemap @@ -12,7 +12,7 @@ // The module map for the Android NDK. // A portion of the modules in this file are prefixed // with an underscore, to discourage users from importing them from -// Swift directly, as these modules might be overriden by the C++ stdlib. +// Swift directly, as these modules might be overridden by the C++ stdlib. // Instead, users should import 'Android' or another // umbrella module that includes these headers. diff --git a/stdlib/public/RemoteInspection/TypeRef.cpp b/stdlib/public/RemoteInspection/TypeRef.cpp index d0af3ab9a1459..80b7b851a02b4 100644 --- a/stdlib/public/RemoteInspection/TypeRef.cpp +++ b/stdlib/public/RemoteInspection/TypeRef.cpp @@ -895,7 +895,7 @@ class DemanglingForTypeRef node->addChild(MemberId, Dem); } else { // Otherwise, build up a DependentAssociatedTR node with - // the member Identifer and protocol + // the member Identifier and protocol auto AssocTy = Dem.createNode(Node::Kind::DependentAssociatedTypeRef); AssocTy->addChild(MemberId, Dem); auto Proto = Dem.demangleType(MangledProtocol); diff --git a/stdlib/public/Synchronization/Atomics/AtomicMemoryOrderings.swift b/stdlib/public/Synchronization/Atomics/AtomicMemoryOrderings.swift index 41cbc94501d72..5d8ecdff44177 100644 --- a/stdlib/public/Synchronization/Atomics/AtomicMemoryOrderings.swift +++ b/stdlib/public/Synchronization/Atomics/AtomicMemoryOrderings.swift @@ -245,7 +245,7 @@ extension AtomicUpdateOrdering { /// An acquiring update synchronizes with a releasing operation /// whose value its reads. It ensures that the releasing and /// acquiring threads agree that all subsequent variable accesses on - /// the acquring thread happen after the atomic operation itself. + /// the acquiring thread happen after the atomic operation itself. /// /// This value corresponds to `std::memory_order_acquire` in C++. @available(SwiftStdlib 6.0, *) diff --git a/stdlib/public/Synchronization/Mutex/LinuxImpl.swift b/stdlib/public/Synchronization/Mutex/LinuxImpl.swift index 23536b2345fd4..be165f55deef1 100644 --- a/stdlib/public/Synchronization/Mutex/LinuxImpl.swift +++ b/stdlib/public/Synchronization/Mutex/LinuxImpl.swift @@ -19,13 +19,13 @@ import Glibc extension Atomic where Value == UInt32 { // This returns 'false' on success and 'true' on error. Check 'errno' for the - // specifc error value. + // specific error value. internal borrowing func _futexLock() -> UInt32 { _swift_stdlib_futex_lock(.init(_rawAddress)) } // This returns 'false' on success and 'true' on error. Check 'errno' for the - // specifc error value. + // specific error value. internal borrowing func _futexTryLock() -> UInt32 { _swift_stdlib_futex_trylock(.init(_rawAddress)) } @@ -189,7 +189,7 @@ extension _MutexHandle { // ESRCH - "The thread ID in the futex word at uaddr does not exist." default: // TODO: Replace with a colder function / one that takes a StaticString - fatalError("Unknown error occured while attempting to acquire a Mutex") + fatalError("Unknown error occurred while attempting to acquire a Mutex") } } } @@ -359,7 +359,7 @@ extension _MutexHandle { // space.)" default: // TODO: Replace with a colder function / one that takes a StaticString - fatalError("Unknown error occured while attempting to release a Mutex") + fatalError("Unknown error occurred while attempting to release a Mutex") } } } diff --git a/stdlib/public/Synchronization/Mutex/Mutex.swift b/stdlib/public/Synchronization/Mutex/Mutex.swift index ea91b4d452513..77360042b9529 100644 --- a/stdlib/public/Synchronization/Mutex/Mutex.swift +++ b/stdlib/public/Synchronization/Mutex/Mutex.swift @@ -24,7 +24,7 @@ /// class Manager { /// let cache = Mutex<[Key: Resource]>([:]) /// -/// func saveResouce(_ resource: Resouce, as key: Key) { +/// func saveResource(_ resource: Resource, as key: Key) { /// cache.withLock { /// $0[key] = resource /// } @@ -57,7 +57,7 @@ extension Mutex: @unchecked Sendable where Value: ~Copyable {} @available(SwiftStdlib 6.0, *) extension Mutex where Value: ~Copyable { - /// Calls the given closure after acquring the lock and then releases + /// Calls the given closure after acquiring the lock and then releases /// ownership. /// /// This method is equivalent to the following sequence of code: diff --git a/stdlib/public/Synchronization/Mutex/MutexUnavailable.swift b/stdlib/public/Synchronization/Mutex/MutexUnavailable.swift index e599d01966488..3e622338dfe68 100644 --- a/stdlib/public/Synchronization/Mutex/MutexUnavailable.swift +++ b/stdlib/public/Synchronization/Mutex/MutexUnavailable.swift @@ -24,7 +24,7 @@ /// class Manager { /// let cache = Mutex<[Key: Resource]>([:]) /// -/// func saveResouce(_ resource: Resouce, as key: Key) { +/// func saveResource(_ resource: Resource, as key: Key) { /// cache.withLock { /// $0[key] = resource /// } diff --git a/stdlib/public/core/DiscontiguousSlice.swift b/stdlib/public/core/DiscontiguousSlice.swift index 290b638d1ac26..f8acd76f4a418 100644 --- a/stdlib/public/core/DiscontiguousSlice.swift +++ b/stdlib/public/core/DiscontiguousSlice.swift @@ -45,7 +45,7 @@ extension DiscontiguousSlice: Equatable where Base.Element: Equatable { @available(SwiftStdlib 6.0, *) extension DiscontiguousSlice: Hashable where Base.Element: Hashable { public func hash(into hasher: inout Hasher) { - hasher.combine(count) // delimeter; do not remove + hasher.combine(count) // delimiter; do not remove for element in self { hasher.combine(element) } diff --git a/stdlib/public/core/Integers.swift b/stdlib/public/core/Integers.swift index be16514cfae1a..98101a24c81e6 100644 --- a/stdlib/public/core/Integers.swift +++ b/stdlib/public/core/Integers.swift @@ -1787,7 +1787,7 @@ extension BinaryInteger { //===--- Ambiguity breakers -----------------------------------------------===// // // These two versions of the operators are not ordered with respect to one -// another, but the compiler choses the second one, and that results in infinite +// another, but the compiler chooses the second one, and that results in infinite // recursion. // // (T, T) -> Bool diff --git a/stdlib/public/core/Misc.swift b/stdlib/public/core/Misc.swift index 1dc56ea717c56..4948e201159dd 100644 --- a/stdlib/public/core/Misc.swift +++ b/stdlib/public/core/Misc.swift @@ -200,7 +200,7 @@ func _rethrowsViaClosure(_ fn: () throws -> ()) rethrows { /// all of the following pairs of declarations are equivalent: /// /// struct MyStructure { } -/// struct MyStructere: Copyable { } +/// struct MyStructure: Copyable { } /// /// protocol MyProtocol { } /// protocol MyProtocol: Copyable { } diff --git a/stdlib/public/core/StringGraphemeBreaking.swift b/stdlib/public/core/StringGraphemeBreaking.swift index 6b5c2e9fb5ed1..8c2e6c685811b 100644 --- a/stdlib/public/core/StringGraphemeBreaking.swift +++ b/stdlib/public/core/StringGraphemeBreaking.swift @@ -714,7 +714,7 @@ extension _GraphemeBreakingState { let x = Unicode._GraphemeBreakProperty(from: scalar1) - // GB4 handled here because we don't need to know `y` for this csae + // GB4 handled here because we don't need to know `y` for this case if x == .control { return true } diff --git a/stdlib/public/libexec/swift-backtrace/Utils.swift b/stdlib/public/libexec/swift-backtrace/Utils.swift index cf683c6da03ec..f34977a2e304d 100644 --- a/stdlib/public/libexec/swift-backtrace/Utils.swift +++ b/stdlib/public/libexec/swift-backtrace/Utils.swift @@ -58,7 +58,7 @@ internal func parseUInt64(_ s: S) -> UInt64? { struct PosixError: Error { var errno: Int32 - var desription: String { + var description: String { return String(cString: strerror(self.errno)) } } diff --git a/stdlib/public/runtime/Bincompat.cpp b/stdlib/public/runtime/Bincompat.cpp index 77c8351e3de7b..11806c1172c8e 100644 --- a/stdlib/public/runtime/Bincompat.cpp +++ b/stdlib/public/runtime/Bincompat.cpp @@ -261,7 +261,7 @@ bool useLegacySwiftObjCHashing() { // * The `swift_task_isCurrentExecutorImpl` cannot crash // * This means cases where no "current" executor is present cannot be diagnosed correctly // * The runtime can NOT use 'SerialExecutor/checkIsolated' -// * The runtime can NOT use 'dispatch_precondition' which is able ot handle some dispatch and main actor edge cases +// * The runtime can NOT use 'dispatch_precondition' which is able to handle some dispatch and main actor edge cases // // New behavior in "swift6" "crash" mode: // * The 'swift_task_isCurrentExecutorImpl' will CRASH rather than return 'false' diff --git a/stdlib/public/runtime/Metadata.cpp b/stdlib/public/runtime/Metadata.cpp index 5c75ddc90b1ed..cb1f07685c29d 100644 --- a/stdlib/public/runtime/Metadata.cpp +++ b/stdlib/public/runtime/Metadata.cpp @@ -6201,7 +6201,7 @@ class RelativeWitnessTableCacheEntry : if (req.Flags.getKind() == ProtocolRequirementFlags::Kind::BaseProtocol) { ++result; - // We currently assume that base protocol requirements preceed other + // We currently assume that base protocol requirements precede other // requirements i.e we store the base protocol pointers sequentially in // instantiateRelativeWitnessTable starting at index 1. assert(currIdx == result && @@ -6270,7 +6270,7 @@ using RelativeBaseWitness = RelativeDirectPointer; // // The layout of a dynamically allocated relative witness table is: // [ conditional conformance n] ... private area -// [ conditional conformance 0] (negatively adressed) +// [ conditional conformance 0] (negatively addressed) // pointer -> [ pointer to relative witness table (pattern) ] // [ base protocol witness table pointer 0 ] ... base protocol // [ base protocol witness table pointer n ] pointers diff --git a/stdlib/public/stubs/Unicode/UnicodeData.cpp b/stdlib/public/stubs/Unicode/UnicodeData.cpp index af7ee3d8b33a9..798f1a7b081a5 100644 --- a/stdlib/public/stubs/Unicode/UnicodeData.cpp +++ b/stdlib/public/stubs/Unicode/UnicodeData.cpp @@ -73,7 +73,7 @@ __swift_intptr_t _swift_stdlib_getMphIdx(__swift_uint32_t scalar, // within each bit array every 512 bits. Say our level (bit array) // contains 16 uint64 integers to represent all of the required bits. // There would be a total of 1024 bits, so our rankings for this level - // would contain two values for precomputed counted bits for both halfs + // would contain two values for precomputed counted bits for both halves // of this bit array (1024 / 512 = 2). auto rank = ranks[i][idx / 512]; @@ -189,7 +189,7 @@ __swift_intptr_t _swift_stdlib_getScalarBitArrayIdx(__swift_uint32_t scalar, auto chunkRank = ranks[idx]; // If our specific bit within the chunk isn't the first bit, then count the - // number of bits turned on preceeding our chunk bit. + // number of bits turned on preceding our chunk bit. if (chunkBit != 0) { chunkRank += __builtin_popcountll(quickLook << (64 - chunkBit)); } diff --git a/stdlib/toolchain/Compatibility56/CompatibilityOverride.h b/stdlib/toolchain/Compatibility56/CompatibilityOverride.h index 842447fd0bbe4..ddaa7b2647324 100644 --- a/stdlib/toolchain/Compatibility56/CompatibilityOverride.h +++ b/stdlib/toolchain/Compatibility56/CompatibilityOverride.h @@ -1,4 +1,4 @@ -//===--- CompatibiltyOverride.h - Back-deploying compatibility fixes --*- C++ -*-===// +//===--- CompatibilityOverride.h - Back-deploying compatibility fixes --*- C++ -*-===// // // This source file is part of the Swift.org open source project // @@ -77,7 +77,7 @@ namespace swift { #ifdef SWIFT_RUNTIME_NO_COMPATIBILITY_OVERRIDES -# error Back-deployment library must always be built with compatibilty overrides +# error Back-deployment library must always be built with compatibility overrides #else // #ifdef SWIFT_RUNTIME_NO_COMPATIBILITY_OVERRIDES diff --git a/stdlib/toolchain/Compatibility56/CompatibilityOverrideConcurrency.def b/stdlib/toolchain/Compatibility56/CompatibilityOverrideConcurrency.def index 896217a719019..8d53124180875 100644 --- a/stdlib/toolchain/Compatibility56/CompatibilityOverrideConcurrency.def +++ b/stdlib/toolchain/Compatibility56/CompatibilityOverrideConcurrency.def @@ -343,7 +343,7 @@ OVERRIDE_TASK_STATUS(task_escalate, JobPriority, swift::, (AsyncTask *task, JobPriority newPriority), (task, newPriority)) -/// We need to keep this entry due to ABI requirements but this overrideable +/// We need to keep this entry due to ABI requirements but this overridable /// function is not used at all so we will change the function definition to /// return void instead. OVERRIDE_TASK_STATUS(task_getNearestDeadline, void, diff --git a/stdlib/toolchain/Compatibility56/Concurrency/Task.cpp b/stdlib/toolchain/Compatibility56/Concurrency/Task.cpp index d7d73c1dcc691..821abd32395bf 100644 --- a/stdlib/toolchain/Compatibility56/Concurrency/Task.cpp +++ b/stdlib/toolchain/Compatibility56/Concurrency/Task.cpp @@ -23,7 +23,7 @@ FutureFragment::Status AsyncTask::waitFuture(AsyncTask *waitingTask, auto fragment = futureFragment(); auto queueHead = fragment->waitQueue.load(std::memory_order_acquire); - bool contextIntialized = false; + bool contextInitialized = false; auto escalatedPriority = JobPriority::Unspecified; while (true) { switch (queueHead.getStatus()) { @@ -32,7 +32,7 @@ FutureFragment::Status AsyncTask::waitFuture(AsyncTask *waitingTask, SWIFT_TASK_DEBUG_LOG("task %p waiting on task %p, completed immediately", waitingTask, this); _swift_tsan_acquire(static_cast(this)); - if (contextIntialized) waitingTask->flagAsRunning(); + if (contextInitialized) waitingTask->flagAsRunning(); // The task is done; we don't need to wait. return queueHead.getStatus(); @@ -44,8 +44,8 @@ FutureFragment::Status AsyncTask::waitFuture(AsyncTask *waitingTask, break; } - if (!contextIntialized) { - contextIntialized = true; + if (!contextInitialized) { + contextInitialized = true; auto context = reinterpret_cast(waitingTaskContext); context->errorResult = nullptr; diff --git a/stdlib/toolchain/Compatibility56/include/Concurrency/Task.h b/stdlib/toolchain/Compatibility56/include/Concurrency/Task.h index 7cec0f8802928..33a27c6ddda12 100644 --- a/stdlib/toolchain/Compatibility56/include/Concurrency/Task.h +++ b/stdlib/toolchain/Compatibility56/include/Concurrency/Task.h @@ -313,7 +313,7 @@ class AsyncTask : public Job { void flagAsRunning_slow(); /// Flag that this task is now suspended. This can update the - /// priority stored in the job flags if the priority hsa been + /// priority stored in the job flags if the priority has been /// escalated. Generally this should be done immediately after /// clearing ActiveTask and immediately before enqueuing the task /// somewhere. TODO: record where the task is enqueued if diff --git a/test/APIJSON/availability.swift b/test/APIJSON/availability.swift index f55689d651adb..d726837b5735e 100644 --- a/test/APIJSON/availability.swift +++ b/test/APIJSON/availability.swift @@ -18,7 +18,7 @@ public func callUnavailable() {} public func availableOnlyOnActiveOS() {} @available(tvOS, unavailable) -public func unavailableOnSeperateOS() {} +public func unavailableOnSeparateOS() {} extension A { @available(macOS 12, *) @@ -114,7 +114,7 @@ extension A { // CHECK-NEXT: "introduced": "10.10" // CHECK-NEXT: }, // CHECK-NEXT: { -// CHECK-NEXT: "name": "_$s8MyModule23unavailableOnSeperateOSyyF", +// CHECK-NEXT: "name": "_$s8MyModule23unavailableOnSeparateOSyyF", // CHECK-NEXT: "access": "public", // CHECK-NEXT: "file": "SOURCE_DIR/test/APIJSON/availability.swift", // CHECK-NEXT: "linkage": "exported" diff --git a/test/ASTGen/stmts.swift b/test/ASTGen/stmts.swift index f0f71b20b0574..a850a97198e8e 100644 --- a/test/ASTGen/stmts.swift +++ b/test/ASTGen/stmts.swift @@ -129,7 +129,7 @@ struct GenericTypeWithYields { } } -/* FXIME: yield(...) is parsed as an expression. ASTGen needs to onvert it to a statments. +/* FXIME: yield(...) is parsed as an expression. ASTGen needs to convert it to statements. subscript(u: U) -> (T,U) { _read { yield ((storedProperty!, u)) diff --git a/test/AssociatedTypeInference/associated_type_inference.swift b/test/AssociatedTypeInference/associated_type_inference.swift index 18ad9b35cb5db..a5d8ec801a2ab 100644 --- a/test/AssociatedTypeInference/associated_type_inference.swift +++ b/test/AssociatedTypeInference/associated_type_inference.swift @@ -445,7 +445,7 @@ struct X15d : P15d { } // FIXME: Better diagnostic here? struct X15g : P15g { } // expected-error{{type 'X15g' does not conform to protocol 'P15g'}} -// Associated type defaults in overidden associated types that require +// Associated type defaults in overridden associated types that require // substitution. struct X16 { } diff --git a/test/AssociatedTypeInference/associated_type_inference_tautology_4.swift b/test/AssociatedTypeInference/associated_type_inference_tautology_4.swift index b082a42099a5f..8e470d41112b7 100644 --- a/test/AssociatedTypeInference/associated_type_inference_tautology_4.swift +++ b/test/AssociatedTypeInference/associated_type_inference_tautology_4.swift @@ -9,7 +9,7 @@ protocol P2 { } struct S2: P2 { - // These are not candiate witnesses for the requirement. + // These are not candidate witnesses for the requirement. func f(_: Float, _: Array) {} func f(_: String, _: Array) {} diff --git a/test/AutoDiff/compiler_crashers_fixed/issue-65073-substmap.swift b/test/AutoDiff/compiler_crashers_fixed/issue-65073-substmap.swift index 8fe8e5b870700..8e4d01f1bb234 100644 --- a/test/AutoDiff/compiler_crashers_fixed/issue-65073-substmap.swift +++ b/test/AutoDiff/compiler_crashers_fixed/issue-65073-substmap.swift @@ -4,7 +4,7 @@ // We need to ensure we are not dropping the substitution map during the // derivative type calculation in sil combiner that causes errors in the // subsequent optimizations as we're ending with invalid "recursive" -// subsitutions +// substitutions import _Differentiation; diff --git a/test/CAS/bridging-header.swift b/test/CAS/bridging-header.swift index bc0691e9af0f9..ee4e6e0a4bab0 100644 --- a/test/CAS/bridging-header.swift +++ b/test/CAS/bridging-header.swift @@ -65,7 +65,7 @@ // RUN: %target-swift-frontend -cache-compile-job -module-name Test -O -cas-path %t/cas @%t/MyApp.cmd %t/test.swift \ // RUN: -emit-module -o %t/Test.swiftmodule -/// Importing binary module with bridging header built from CAS from a regluar build. +/// Importing binary module with bridging header built from CAS from a regular build. /// This should succeed even it is also importing a bridging header that shares same header dependencies (with proper header guard). // RUN: %target-swift-frontend -typecheck -module-name User -swift-version 5 \ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \ diff --git a/test/ClangImporter/Inputs/custom-modules/IncompleteTypes/complete-types.m b/test/ClangImporter/Inputs/custom-modules/IncompleteTypes/complete-types.m index 1fefda2370731..e143e2705262a 100644 --- a/test/ClangImporter/Inputs/custom-modules/IncompleteTypes/complete-types.m +++ b/test/ClangImporter/Inputs/custom-modules/IncompleteTypes/complete-types.m @@ -14,6 +14,6 @@ void takeACompleteInterface(ForwardDeclaredInterface *param) { [param doSomethingForwardDeclaredInterfacesCan]; } void takeACompleteProtocol(NSObject *param) { - NSLog(@"takeACompleteProcotol"); + NSLog(@"takeACompleteProtocol"); [param doSomethingForwardDeclaredProtocolsCan]; } diff --git a/test/ClangImporter/Inputs/custom-modules/IncompleteTypes/objc-library-forward-declaring-complete-swift-types.h b/test/ClangImporter/Inputs/custom-modules/IncompleteTypes/objc-library-forward-declaring-complete-swift-types.h index 9f3e440b15bf9..ab8a33f1bafa4 100644 --- a/test/ClangImporter/Inputs/custom-modules/IncompleteTypes/objc-library-forward-declaring-complete-swift-types.h +++ b/test/ClangImporter/Inputs/custom-modules/IncompleteTypes/objc-library-forward-declaring-complete-swift-types.h @@ -17,7 +17,7 @@ void takeASubscript(subscript *param); subscript* returnASubscript(); // There is a Swift protocol, @objc protocol ShadowedProtocol, but -// since here we are refering to a class and not a protocol, this +// since here we are referring to a class and not a protocol, this // shouldn't be an issue. ShadowedProtocol* returnANativeObjCClassShadowedProtocol(); diff --git a/test/Concurrency/isolated_parameters.swift b/test/Concurrency/isolated_parameters.swift index 277bfeb3da7b9..d784de31c2ecf 100644 --- a/test/Concurrency/isolated_parameters.swift +++ b/test/Concurrency/isolated_parameters.swift @@ -131,7 +131,7 @@ actor MyActor { func hello() {} // expected-typechecker-note {{calls to instance method 'hello()' from outside of its actor context are implicitly asynchronous}} } -// Compiler >= 5.3 is eneded to suppress the parser error +// Compiler >= 5.3 is ended to suppress the parser error #if compiler(>=5.3) && ALLOW_TYPECHECKER_ERRORS typealias MyFn = (isolated: Int) -> Void // expected-typechecker-error {{function types cannot have argument labels; use '_' before 'isolated'}} #endif diff --git a/test/Concurrency/sendable_objc_attr_in_type_context_swift5_strict.swift b/test/Concurrency/sendable_objc_attr_in_type_context_swift5_strict.swift index e42cf6d3183f8..13dbc84364877 100644 --- a/test/Concurrency/sendable_objc_attr_in_type_context_swift5_strict.swift +++ b/test/Concurrency/sendable_objc_attr_in_type_context_swift5_strict.swift @@ -103,13 +103,13 @@ func test_sendable_attr_in_type_context(test: Test) { _ = TestWithSendableID() // Ok - // TOOD(diagnostics): Duplicate diagnostics + // TODO(diagnostics): Duplicate diagnostics TestWithSendableID().add(MyValue()) // expected-warning@-1 3 {{type 'MyValue' does not conform to the 'Sendable' protocol}} TestWithSendableSuperclass().add(SendableMyValue()) // Ok - // TOOD(diagnostics): Duplicate diagnostics + // TODO(diagnostics): Duplicate diagnostics TestWithSendableSuperclass().add(MyValue()) // expected-warning@-1 3 {{type 'MyValue' does not conform to the 'Sendable' protocol}} } diff --git a/test/Concurrency/sendable_objc_attr_in_type_context_swift6.swift b/test/Concurrency/sendable_objc_attr_in_type_context_swift6.swift index f5beac018385e..4773367f7f886 100644 --- a/test/Concurrency/sendable_objc_attr_in_type_context_swift6.swift +++ b/test/Concurrency/sendable_objc_attr_in_type_context_swift6.swift @@ -102,13 +102,13 @@ func test_sendable_attr_in_type_context(test: Test) { _ = TestWithSendableID() // Ok - // TOOD(diagnostics): Duplicate diagnostics + // TODO(diagnostics): Duplicate diagnostics TestWithSendableID().add(MyValue()) // expected-error@-1 3 {{type 'MyValue' does not conform to the 'Sendable' protocol}} TestWithSendableSuperclass().add(SendableMyValue()) // Ok - // TOOD(diagnostics): Duplicate diagnostics + // TODO(diagnostics): Duplicate diagnostics TestWithSendableSuperclass().add(MyValue()) // expected-error@-1 3 {{type 'MyValue' does not conform to the 'Sendable' protocol}} } diff --git a/test/Concurrency/sending_mangling.swift b/test/Concurrency/sending_mangling.swift index e9cd48151f34a..90822f991b1e0 100644 --- a/test/Concurrency/sending_mangling.swift +++ b/test/Concurrency/sending_mangling.swift @@ -32,8 +32,8 @@ func testNoRemoveFunctionResultSubTypeResult() -> sending S<() -> sending NonSen // CHECK: sil hidden [ossa] @sending_mangling.testNoRemoveFunctionResultImmediateTypedFunctionWithArg() -> (sending __owned sending_mangling.NonSendableKlass) -> () : $@convention(thin) () -> @owned @callee_guaranteed (@sil_sending @owned NonSendableKlass) -> () { func testNoRemoveFunctionResultImmediateTypedFunctionWithArg() -> ((sending NonSendableKlass) -> ()) { fatalError() } -// CHECK: sil hidden [ossa] @sending_mangling.testNoRemoveFunctionResultImmedateTypedFunctionWithResult() -> () -> sending sending_mangling.NonSendableKlass : $@convention(thin) () -> @owned @callee_guaranteed () -> @sil_sending @owned NonSendableKlass { -func testNoRemoveFunctionResultImmedateTypedFunctionWithResult() -> (() -> sending NonSendableKlass) { fatalError() } +// CHECK: sil hidden [ossa] @sending_mangling.testNoRemoveFunctionResultImmediateTypedFunctionWithResult() -> () -> sending sending_mangling.NonSendableKlass : $@convention(thin) () -> @owned @callee_guaranteed () -> @sil_sending @owned NonSendableKlass { +func testNoRemoveFunctionResultImmediateTypedFunctionWithResult() -> (() -> sending NonSendableKlass) { fatalError() } struct MethodTest { // CHECK: sil hidden [ossa] @sending_mangling.MethodTest.init(__owned sending_mangling.NonSendableKlass) -> sending_mangling.MethodTest : $@convention(method) (@sil_sending @owned NonSendableKlass, @thin MethodTest.Type) -> MethodTest { @@ -61,8 +61,8 @@ struct MethodTest { // CHECK: sil hidden [ossa] @sending_mangling.MethodTest.testNoRemoveFunctionResultImmediateTypedFunctionWithArg() -> (sending __owned sending_mangling.NonSendableKlass) -> () : $@convention(method) (MethodTest) -> @owned @callee_guaranteed (@sil_sending @owned NonSendableKlass) -> () { func testNoRemoveFunctionResultImmediateTypedFunctionWithArg() -> ((sending NonSendableKlass) -> ()) { fatalError() } - // CHECK: sil hidden [ossa] @sending_mangling.MethodTest.testNoRemoveFunctionResultImmedateTypedFunctionWithResult() -> () -> sending sending_mangling.NonSendableKlass : $@convention(method) (MethodTest) -> @owned @callee_guaranteed () -> @sil_sending @owned NonSendableKlass { - func testNoRemoveFunctionResultImmedateTypedFunctionWithResult() -> (() -> sending NonSendableKlass) { fatalError() } + // CHECK: sil hidden [ossa] @sending_mangling.MethodTest.testNoRemoveFunctionResultImmediateTypedFunctionWithResult() -> () -> sending sending_mangling.NonSendableKlass : $@convention(method) (MethodTest) -> @owned @callee_guaranteed () -> @sil_sending @owned NonSendableKlass { + func testNoRemoveFunctionResultImmediateTypedFunctionWithResult() -> (() -> sending NonSendableKlass) { fatalError() } } protocol SendingProtocol { @@ -107,6 +107,6 @@ struct ConstructorSharedTest { // This is a func which takes its parameter at +0 so we should suppress both. // - // CHECK: sil hidden [ossa] @sending_mangling.ConstructorSharedTest.functionSupressed(sending_mangling.NonSendableKlass) -> () : $@convention(method) (@sil_sending @guaranteed NonSendableKlass, ConstructorSharedTest) -> () { - func functionSupressed(_ x: __shared sending NonSendableKlass) {} + // CHECK: sil hidden [ossa] @sending_mangling.ConstructorSharedTest.functionSuppressed(sending_mangling.NonSendableKlass) -> () : $@convention(method) (@sil_sending @guaranteed NonSendableKlass, ConstructorSharedTest) -> () { + func functionSuppressed(_ x: __shared sending NonSendableKlass) {} } diff --git a/test/Concurrency/transfernonsendable_closureliterals_isolationinference.swift b/test/Concurrency/transfernonsendable_closureliterals_isolationinference.swift index 4e8a89274a23d..a6660ec1c7fd4 100644 --- a/test/Concurrency/transfernonsendable_closureliterals_isolationinference.swift +++ b/test/Concurrency/transfernonsendable_closureliterals_isolationinference.swift @@ -121,7 +121,7 @@ func useValue(_ x: T) { } @CustomActor func test_CallerSyncNormal_CalleeSyncNonIsolated() async { - // Just to help start our pattern matchin since the closure #$NUM line + // Just to help start our pattern matching since the closure #$NUM line // appears in other parts of the file. // CHECK-LABEL: } // end sil function '$s54transfernonsendable_closureliterals_isolationinference028test_CallerSyncNormal_CalleeF11NonIsolatedyyYaF' @@ -270,7 +270,7 @@ func test_CallerSyncInheritsActorContext_CalleeAsyncMainActorIsolated() async { @CustomActor func test_CallerAsyncNormal_CalleeSyncNonIsolated() async { - // Just to help start our pattern matchin since the closure #$NUM line + // Just to help start our pattern matching since the closure #$NUM line // appears in other parts of the file. // CHECK-LABEL: } // end sil function '$s54transfernonsendable_closureliterals_isolationinference44test_CallerAsyncNormal_CalleeSyncNonIsolatedyyYaF' @@ -582,7 +582,7 @@ extension MyActor { extension MyActor { func test_CallerAsyncNormal_CalleeSyncNonIsolated() async { - // Just to help start our pattern matchin since the closure #$NUM line + // Just to help start our pattern matching since the closure #$NUM line // appears in other parts of the file. // CHECK-LABEL: } // end sil function '$s54transfernonsendable_closureliterals_isolationinference7MyActorC44test_CallerAsyncNormal_CalleeSyncNonIsolatedyyYaF' diff --git a/test/Concurrency/transfernonsendable_sending_results.swift b/test/Concurrency/transfernonsendable_sending_results.swift index 2067ba447f3b5..405c1dbd50310 100644 --- a/test/Concurrency/transfernonsendable_sending_results.swift +++ b/test/Concurrency/transfernonsendable_sending_results.swift @@ -79,7 +79,7 @@ func simpleTest() async { useValue(y) } -// Since y is transfered, we should emit the error on useValue(x). We generally +// Since y is transferred, we should emit the error on useValue(x). We generally // emit the first seen error on a path, so if we were to emit an error on // useValue(y), we would have emitted that error. func simpleTest2() async { diff --git a/test/ConstExtraction/ExtractCoerce.swift b/test/ConstExtraction/ExtractCoerce.swift index d6cdcb4a4776d..d89be0463aa86 100644 --- a/test/ConstExtraction/ExtractCoerce.swift +++ b/test/ConstExtraction/ExtractCoerce.swift @@ -4,7 +4,7 @@ // RUN: %target-swift-frontend -typecheck -emit-const-values-path %t/ExtractLiterals.swiftconstvalues -const-gather-protocols-file %t/protocols.json -primary-file %s // RUN: cat %t/ExtractLiterals.swiftconstvalues 2>&1 | %FileCheck %s -struct CoercableThing : ExpressibleByStringLiteral { +struct CoercibleThing : ExpressibleByStringLiteral { let thing: String public init(unicodeScalarLiteral value: String) { self.init(stringLiteral: value) @@ -17,8 +17,8 @@ struct CoercableThing : ExpressibleByStringLiteral { protocol MyProto {} public struct TestStruct : MyProto { - let foo: CoercableThing = "foo" - let bar: CoercableThing = CoercableThing("bar") + let foo: CoercibleThing = "foo" + let bar: CoercibleThing = CoercibleThing("bar") } // CHECK: "label": "foo", diff --git a/test/Constraints/closures.swift b/test/Constraints/closures.swift index b79a297961fb1..d56f7e18a9c94 100644 --- a/test/Constraints/closures.swift +++ b/test/Constraints/closures.swift @@ -34,7 +34,7 @@ _ = f0(X2(), {$0.g()}) func inoutToSharedConversions() { func fooOW(_ f : (__owned T) -> U) {} - fooOW({ (x : Int) in return Int(5) }) // defaut-to-'__owned' allowed + fooOW({ (x : Int) in return Int(5) }) // default-to-'__owned' allowed fooOW({ (x : __owned Int) in return Int(5) }) // '__owned'-to-'__owned' allowed fooOW({ (x : __shared Int) in return Int(5) }) // '__shared'-to-'__owned' allowed fooOW({ (x : inout Int) in return Int(5) }) // expected-error {{cannot convert value of type '(inout Int) -> Int' to expected argument type '(__owned Int) -> Int'}} diff --git a/test/Constraints/diagnostics.swift b/test/Constraints/diagnostics.swift index f7e8439a5d8af..a5310a5af1d12 100644 --- a/test/Constraints/diagnostics.swift +++ b/test/Constraints/diagnostics.swift @@ -173,7 +173,7 @@ func rdar21080030() { if s.count() == 0 {} // expected-error {{cannot call value of non-function type 'Int'}} } -// QoI: problem with return type inference mis-diagnosed as invalid arguments +// QoI: problem with return type inference misdiagnosed as invalid arguments func r21248136() -> T { preconditionFailure() } // expected-note 2 {{in call to function 'r21248136()'}} r21248136() // expected-error {{generic parameter 'T' could not be inferred}} diff --git a/test/Constraints/dynamic_lookup.swift b/test/Constraints/dynamic_lookup.swift index b221248786b27..676d6958d9a87 100644 --- a/test/Constraints/dynamic_lookup.swift +++ b/test/Constraints/dynamic_lookup.swift @@ -478,7 +478,7 @@ class AmbiguityA : NSObject { } -class AmbuguityB : NSObject { +class AmbiguityB : NSObject { @objc class var testProp: B { get { B() } } } diff --git a/test/Constraints/type_inference_from_default_exprs.swift b/test/Constraints/type_inference_from_default_exprs.swift index 469a4bcdfc1c5..e4da120d3d927 100644 --- a/test/Constraints/type_inference_from_default_exprs.swift +++ b/test/Constraints/type_inference_from_default_exprs.swift @@ -11,10 +11,10 @@ enum ETest { } func testInferFromOtherPos1(_: T = 42, _: [T]) {} -// expected-error@-1 {{cannot use default expression for inference of 'T' because it is inferrable from parameters #0, #1}} +// expected-error@-1 {{cannot use default expression for inference of 'T' because it is inferable from parameters #0, #1}} func testInferFromOtherPos2(_: T = 42, _: T = 0.0) {} -// expected-error@-1 2 {{cannot use default expression for inference of 'T' because it is inferrable from parameters #0, #1}} +// expected-error@-1 2 {{cannot use default expression for inference of 'T' because it is inferable from parameters #0, #1}} protocol P { associatedtype X diff --git a/test/DebugInfo/sroa_debug_value.sil b/test/DebugInfo/sroa_debug_value.sil index b8fdd4bf5e267..f65d2d4d64ca8 100644 --- a/test/DebugInfo/sroa_debug_value.sil +++ b/test/DebugInfo/sroa_debug_value.sil @@ -28,7 +28,7 @@ sil hidden @foo : $@convention(thin) (Int64, Int64) -> Int64 { bb0(%0 : $Int64, %1 : $Int64): %4 = alloc_stack $MyStruct, var, name "my_struct", loc "sroa.swift":8:9, scope 2 debug_value %4 : $*MyStruct, let, name "my_copy", expr op_deref, loc "sroa.swift":7:10, scope 2 - // Make sure SROA propagate the debug info to the splitted alloc_stack/debug_value instructions + // Make sure SROA propagate the debug info to the split alloc_stack/debug_value instructions // CHECK-SROA: %[[ALLOC_X:[0-9]+]] = alloc_stack $Int64, var // CHECK-SROA-SAME: (name "my_struct", loc "sroa.swift":8:9 // CHECK-SROA-SAME: type $MyStruct, expr op_fragment:#MyStruct.x diff --git a/test/DebugInfo/sroa_mem2reg.sil b/test/DebugInfo/sroa_mem2reg.sil index 2d114bb39b8c7..e0fec259946d6 100644 --- a/test/DebugInfo/sroa_mem2reg.sil +++ b/test/DebugInfo/sroa_mem2reg.sil @@ -32,7 +32,7 @@ bb0(%0 : $Int64, %1 : $Int64): debug_value %0 : $Int64, let, name "in_x", argno 1, loc "sroa.swift":7:10, scope 2 debug_value %1 : $Int64, let, name "in_y", argno 2, loc "sroa.swift":7:21, scope 2 %4 = alloc_stack $MyStruct, var, name "my_struct", loc "sroa.swift":8:9, scope 2 - // Make sure SROA propagate the debug info to the splitted alloc_stack instructions + // Make sure SROA propagate the debug info to the split alloc_stack instructions // CHECK-SROA: alloc_stack $Int64, var // CHECK-SROA-SAME: (name "my_struct", loc "sroa.swift":8:9 // CHECK-SROA-SAME: type $MyStruct, expr op_fragment:#MyStruct.x diff --git a/test/DebugInfo/sroa_mem2reg_tuple.sil b/test/DebugInfo/sroa_mem2reg_tuple.sil index e5926ccfbd1a8..0eb66137c5621 100644 --- a/test/DebugInfo/sroa_mem2reg_tuple.sil +++ b/test/DebugInfo/sroa_mem2reg_tuple.sil @@ -20,7 +20,7 @@ bb0(%0 : $Int64, %1 : $Int64): debug_value %1 : $Int64, let, name "in_y", argno 2, loc "sroa.swift":1:21, scope 2 %4 = alloc_stack $(x: Int64, y: Int64), var, name "my_tup", loc "sroa.swift":2:7, scope 3 - // Make sure SROA propagate the debug info to the splitted alloc_stack instructions + // Make sure SROA propagate the debug info to the split alloc_stack instructions // CHECK-SROA: alloc_stack $Builtin.Int64, var // CHECK-SROA-SAME: (name "my_tup", loc "sroa.swift":2:7 // CHECK-SROA-SAME: type $(x: Int64, y: Int64), expr op_tuple_fragment:$(x: Int64, y: Int64):0:op_fragment:#Int64._value diff --git a/test/DebugInfo/variables.swift b/test/DebugInfo/variables.swift index fe23ee2970d4a..bf2f3945d5049 100644 --- a/test/DebugInfo/variables.swift +++ b/test/DebugInfo/variables.swift @@ -105,8 +105,8 @@ enum TriValue { case true_ case top } -// CHECK-DAG: !DIGlobalVariable(name: "unknown",{{.*}} type: ![[TRIVAL:[0-9]+]] -// CHECK-DAG: ![[TRIVAL]] = !DICompositeType({{.*}}name: "TriValue", +// CHECK-DAG: !DIGlobalVariable(name: "unknown",{{.*}} type: ![[TRIVIAL:[0-9]+]] +// CHECK-DAG: ![[TRIVIAL]] = !DICompositeType({{.*}}name: "TriValue", var unknown = TriValue.top func myprint(_ value: TriValue) { switch value { diff --git a/test/Driver/loaded_module_trace_directness_2.swift b/test/Driver/loaded_module_trace_directness_2.swift index 4fbea42f7daf6..961a12fbc32b0 100644 --- a/test/Driver/loaded_module_trace_directness_2.swift +++ b/test/Driver/loaded_module_trace_directness_2.swift @@ -6,7 +6,7 @@ // Dependency graph: // // * CoreFilesystem - Swift module with generated ObjC header -// * FilesystemKit - ObjC module without overlay, has #import +// * FilesystemKit - ObjC module without overlay, has #import // * TestFilesystem - Swift module, has import CoreFilesystem or FilesystemKit. // // * CoreDaemon - ObjC module with overlay, the overlay has import DaemonKit diff --git a/test/Generics/conditional_conformances.swift b/test/Generics/conditional_conformances.swift index 6932258e5530a..80a9b1c95ee05 100644 --- a/test/Generics/conditional_conformances.swift +++ b/test/Generics/conditional_conformances.swift @@ -387,7 +387,7 @@ extension TwoDisjointConformances: P2 where T == String {} // FIXME: these cases should be equivalent (and both with the same output as the -// first), but the second one choses T as the representative of the +// first), but the second one chooses T as the representative of the // equivalence class containing both T and U in the extension's generic // signature, meaning the stored conditional requirement is T: P1, which isn't // true in the original type's generic signature. diff --git a/test/IDE/Inputs/foo_swift_module.printed.comments.txt b/test/IDE/Inputs/foo_swift_module.printed.comments.txt index 3f4557cea9341..07094ce0d318c 100644 --- a/test/IDE/Inputs/foo_swift_module.printed.comments.txt +++ b/test/IDE/Inputs/foo_swift_module.printed.comments.txt @@ -39,7 +39,7 @@ enum MyQuickLookObject { } var globalVar: Int func hiddenImport() -func overlayedFoo() +func overlaidFoo() func visibleImport() precedencegroup High { associativity: left diff --git a/test/IDE/Inputs/foo_swift_module.swift b/test/IDE/Inputs/foo_swift_module.swift index e9618f575b207..9a89f036588da 100644 --- a/test/IDE/Inputs/foo_swift_module.swift +++ b/test/IDE/Inputs/foo_swift_module.swift @@ -20,7 +20,7 @@ internal postfix func =->(lhs: Int) -> Int { public func visibleImport() {} public func hiddenImport() {} -public func overlayedFoo() {} +public func overlaidFoo() {} public var globalVar: Int = 0 diff --git a/test/IDE/Inputs/foo_swift_module_overlay.swift b/test/IDE/Inputs/foo_swift_module_overlay.swift index 7e4613b9cf4f0..4496520561480 100644 --- a/test/IDE/Inputs/foo_swift_module_overlay.swift +++ b/test/IDE/Inputs/foo_swift_module_overlay.swift @@ -1,5 +1,5 @@ @_exported import FooSwiftModule -public func overlayedFoo() {} +public func overlaidFoo() {} public func onlyInFooOverlay() {} diff --git a/test/IDE/Inputs/mock-sdk/OverlayTest.framework/Headers/Overlayed.h b/test/IDE/Inputs/mock-sdk/OverlayTest.framework/Headers/Overlayed.h index 48336b32085b6..9986ddcd1ecf8 100644 --- a/test/IDE/Inputs/mock-sdk/OverlayTest.framework/Headers/Overlayed.h +++ b/test/IDE/Inputs/mock-sdk/OverlayTest.framework/Headers/Overlayed.h @@ -1,13 +1,13 @@ -#ifndef OVERLAYED_H -#define OVERLAYED_H +#ifndef OVERLAID_H +#define OVERLAID_H -struct __attribute__((swift_name("Overlayed"))) OVOverlayed { +struct __attribute__((swift_name("Overlaid"))) OVOverlaid { double x, y, z; }; -double OVOverlayedInOriginalFunc(struct OVOverlayed s) __attribute__((swift_name("Overlayed.inOriginalFunc(self:)"))); +double OVOverlaidInOriginalFunc(struct OVOverlaid s) __attribute__((swift_name("Overlaid.inOriginalFunc(self:)"))); -struct OVOverlayed createOverlayed(); +struct OVOverlaid createOverlaid(); #endif diff --git a/test/IDE/Inputs/mock-sdk/OverlayTest.swiftinterface b/test/IDE/Inputs/mock-sdk/OverlayTest.swiftinterface index ad75d7f67b6ea..3727cff448652 100644 --- a/test/IDE/Inputs/mock-sdk/OverlayTest.swiftinterface +++ b/test/IDE/Inputs/mock-sdk/OverlayTest.swiftinterface @@ -3,8 +3,8 @@ @_exported import OverlayTest -public extension Overlayed { +public extension Overlaid { public func inOverlayFunc() {} } -public func createOverlayedInOverlay() -> Overlayed +public func createOverlaidInOverlay() -> Overlaid diff --git a/test/IDE/complete_accessor.swift b/test/IDE/complete_accessor.swift index 4645dc88c47d6..33b3ce25b86cb 100644 --- a/test/IDE/complete_accessor.swift +++ b/test/IDE/complete_accessor.swift @@ -116,7 +116,7 @@ extension UNKNOWN_TYPE { get {} #^UNKNOWN_EXT_PROPERTY_SECOND?check=NO_GLOBAL;check=NO_SELF;check=WITH_GETSET;check=WITH_OBSERVER^# } - subscript(_1 index: T) -> T where T: ANOTHER_UNKNWON_TYPE { + subscript(_1 index: T) -> T where T: ANOTHER_UNKNOWN_TYPE { #^UNKNOWN_EXT_SUBSCRIPT_FIRST?check=WITH_GLOBAL;check=WITH_SELF;check=WITH_GETSET;check=NO_OBSERVER^# } subscript(_2 index: Int) -> String { diff --git a/test/IDE/complete_attributes.swift b/test/IDE/complete_attributes.swift index 569a38d91db84..a8a2c635d6251 100644 --- a/test/IDE/complete_attributes.swift +++ b/test/IDE/complete_attributes.swift @@ -23,9 +23,9 @@ struct MyValue { // MEMBER_MyValue-DAG: Decl[Constructor]/CurrNominal: init()[#MyValue#]; // MEMBER_MyValue-DAG: Decl[StaticVar]/CurrNominal: val[#Int#]; -class TestUnkownDanglingAttr1 { - @UknownAttr(arg: MyValue.#^ATTRARG_MEMBER^#) +class TestUnknownDanglingAttr1 { + @UnknownAttr(arg: MyValue.#^ATTRARG_MEMBER^#) } -class TestUnkownDanglingAttr2 { - @UknownAttr(arg: { MyValue.#^ATTRARG_MEMBER_IN_CLOSURE^# }) +class TestUnknownDanglingAttr2 { + @UnknownAttr(arg: { MyValue.#^ATTRARG_MEMBER_IN_CLOSURE^# }) } diff --git a/test/IDE/complete_call_arg.swift b/test/IDE/complete_call_arg.swift index 33acc03d41682..73acf9133bd52 100644 --- a/test/IDE/complete_call_arg.swift +++ b/test/IDE/complete_call_arg.swift @@ -650,7 +650,7 @@ func testImplicitMemberInArrayLiteral() { struct Wrap { func method(_ fn: (T) -> U) -> Wrap {} } -func testGenricMethodOnGenericOfArchetype(value: Wrap) { +func testGenericMethodOnGenericOfArchetype(value: Wrap) { value.method(#^ARCHETYPE_GENERIC_1^#) // ARCHETYPE_GENERIC_1: Decl[InstanceMethod]/CurrNominal/Flair[ArgLabels]: ['(']{#(fn): (Wrapped) -> U##(Wrapped) -> U#}[')'][#Wrap#]; } @@ -780,7 +780,7 @@ func testAfterVariadic() { } } -func testClosurePlaceholderContainsInternalParameterNamesIfPresentInSiganture() { +func testClosurePlaceholderContainsInternalParameterNamesIfPresentInSignature() { func sort(callback: (_ left: Int, _ right: Int) -> Bool) {} sort(#^CLOSURE_PARAM_WITH_INTERNAL_NAME^#) // CLOSURE_PARAM_WITH_INTERNAL_NAME: Begin completions, 1 item @@ -1072,16 +1072,16 @@ func testArgsAfterCompletion() { // INVALID_MISSINGCONFORMANCE-DAG: Pattern/Local/Flair[ArgLabels]: {#p: String#}[#String#]; name=p: // INVALID_MISSINGCONFORMANCE-DAG: Pattern/Local/Flair[ArgLabels]: {#y: String#}[#String#]; name=y: - overloadedGeneric(x: 1, #^INVALID_MISSINGCONFORMANCE_NOCOMMA?check=INVALID_MISSINGCONFORMANCE^# z: MisingConformance(), zz: MissingConformance()) + overloadedGeneric(x: 1, #^INVALID_MISSINGCONFORMANCE_NOCOMMA?check=INVALID_MISSINGCONFORMANCE^# z: MissingConformance(), zz: MissingConformance()) overloadedGeneric(x: 1, #^INVALID_MISSINGCONFORMANCE_INDIRECT?check=INVALID_MISSINGCONFORMANCE^#, z: [MissingConformance()], zz: [MissingConformance()]) - overloadedGeneric(x: 1, #^INVALID_MISSINGCONFORMANCE_CONSTRAINT?check=INVALID_MISSINGCONFORMANCE_CONSTAINT^#, z: [CondConfType("foo")], zz: [CondConfType("bar")]) - SubOverloadedGeneric()[x: 1, #^INVALID_MISSINGCONFORMANCE_NOCOMMA_SUB?check=INVALID_MISSINGCONFORMANCE^# z: MisingConformance(), zz: MissingConformance()] + overloadedGeneric(x: 1, #^INVALID_MISSINGCONFORMANCE_CONSTRAINT?check=INVALID_MISSINGCONFORMANCE_CONSTRAINT^#, z: [CondConfType("foo")], zz: [CondConfType("bar")]) + SubOverloadedGeneric()[x: 1, #^INVALID_MISSINGCONFORMANCE_NOCOMMA_SUB?check=INVALID_MISSINGCONFORMANCE^# z: MissingConformance(), zz: MissingConformance()] SubOverloadedGeneric()[x: 1, #^INVALID_MISSINGCONFORMANCE_INDIRECT_SUB?check=INVALID_MISSINGCONFORMANCE^#, z: [MissingConformance()], zz: [MissingConformance()]] - SubOverloadedGeneric()[x: 1, #^INVALID_MISSINGCONFORMANCE_CONSTRAINT_SUB?check=INVALID_MISSINGCONFORMANCE_CONSTAINT^#, z: [CondConfType("foo")], zz: [CondConfType("bar")]] + SubOverloadedGeneric()[x: 1, #^INVALID_MISSINGCONFORMANCE_CONSTRAINT_SUB?check=INVALID_MISSINGCONFORMANCE_CONSTRAINT^#, z: [CondConfType("foo")], zz: [CondConfType("bar")]] - // INVALID_MISSINGCONFORMANCE_CONSTAINT: Begin completions, 2 items - // INVALID_MISSINGCONFORMANCE_CONSTAINT-DAG: Pattern/Local/Flair[ArgLabels]: {#y: String#}[#String#]; name=y: - // INVALID_MISSINGCONFORMANCE_CONSTAINT-DAG: Pattern/Local/Flair[ArgLabels]: {#p: String#}[#String#]; name=p: + // INVALID_MISSINGCONFORMANCE_CONSTRAINT: Begin completions, 2 items + // INVALID_MISSINGCONFORMANCE_CONSTRAINT-DAG: Pattern/Local/Flair[ArgLabels]: {#y: String#}[#String#]; name=y: + // INVALID_MISSINGCONFORMANCE_CONSTRAINT-DAG: Pattern/Local/Flair[ArgLabels]: {#p: String#}[#String#]; name=p: } func testFuncTyVars(param: (Int, String, Double) -> ()) { diff --git a/test/IDE/complete_call_pattern.swift b/test/IDE/complete_call_pattern.swift index 9dbc0d762bd75..69fd4e071d1ee 100644 --- a/test/IDE/complete_call_pattern.swift +++ b/test/IDE/complete_call_pattern.swift @@ -10,16 +10,16 @@ struct FooStruct { func testInsideFunctionCall_1(_ x: inout FooStruct) { x.instanceFunc(#^BEFORE_COMMA^#, // BEFORE_COMMA-NOT: Pattern/{{.*}}:{{.*}}({{.*}}{#Int#} -// BOFORE_COMMA-NOT: Decl[InstanceMethod]/{{.*}}:{{.*}}({{.*}}{#Int#} +// BEFORE_COMMA-NOT: Decl[InstanceMethod]/{{.*}}:{{.*}}({{.*}}{#Int#} } func testInsideFunctionCall_2(_ x: inout FooStruct) { x.instanceFunc(#^BEFORE_PLACEHOLDER^#<#placeholder#> // BEFORE_PLACEHOLDER-NOT: Pattern/{{.*}}:{{.*}}({{.*}}{#Int#} -// BOFORE_PLACEHOLDER-NOT: Decl[InstanceMethod]/{{.*}}:{{.*}}({{.*}}{#Int#} +// BEFORE_PLACEHOLDER-NOT: Decl[InstanceMethod]/{{.*}}:{{.*}}({{.*}}{#Int#} } func testConstructor() { FooStruct(#^CONSTRUCTOR^#, -// CONSTURCTOR: Begin completions, 3 items +// CONSTRUCTOR: Begin completions, 3 items // CONSTRUCTOR-DAG: Decl[Constructor]/CurrNominal/Flair[ArgLabels]: ['('][')'][#FooStruct#]; // CONSTRUCTOR-DAG: Decl[Constructor]/CurrNominal/Flair[ArgLabels]: ['(']{#a: Int#}[')'][#FooStruct#]; // CONSTRUCTOR-DAG: Decl[Constructor]/CurrNominal/Flair[ArgLabels]: ['(']{#a: Int#}, {#b: Float#}[')'][#FooStruct#]; diff --git a/test/IDE/complete_concurrency_specifier.swift b/test/IDE/complete_concurrency_specifier.swift index 0162ede5d650c..62ead1b4b286c 100644 --- a/test/IDE/complete_concurrency_specifier.swift +++ b/test/IDE/complete_concurrency_specifier.swift @@ -20,14 +20,14 @@ func testSpecifierWithAsync() async #^SPECIFIER_WITHASYNC^# func testSpecifierWithThrows() throws #^SPECIFIER_WITHTHROWS^# func testSpecifierWithAsyncThorws() async throws #^SPECIFIER_WITHASYNCTHROWS^# -func testTypeSpecifier(_: () #^TYPE_SPECIFICER?check=SPECIFIER^#) {} -func testTypeSpecifierWithAsync(_: () async #^TYPE_SPECIFICER_WITHASYNC?check=SPECIFIER_WITHASYNC^#) {} -func testTypeSpecifierWithThrows(_: () throws #^TYPE_SPECIFICER_WITHTHROWS?check=SPECIFIER_WITHTHROWS^#) {} -func testTypeSpecifierWithAsyncThrows(_: () async throws #^TYPE_SPECIFICER_WITHASYNCTHROWS?check=SPECIFIER_WITHASYNCTHROWS^#) {} -func testTypeSpecifierWithArrow(_: () #^TYPE_SPECIFICER_WITHARROW?check=SPECIFIER^#) {} -func testTypeSpecifierWithAsyncArrow(_: () async #^TYPE_SPECIFICER_WITHASYNCARROW?check=SPECIFIER_WITHASYNC^# -> Void) {} -func testTypeSpecifierWithThrowsArrow(_: () throws #^TYPE_SPECIFICER_WITHTHROWSARROW?check=SPECIFIER_WITHTHROWS^# -> Void -func testTypeSpecifierWithAsyncThrowsArrow(_: () async throws #^TYPE_SPECIFICER_WITHASYNCTHROWSARROW?check=SPECIFIER_WITHASYNCTHROWS^# -> Void) {} +func testTypeSpecifier(_: () #^TYPE_SPECIFIER?check=SPECIFIER^#) {} +func testTypeSpecifierWithAsync(_: () async #^TYPE_SPECIFIER_WITHASYNC?check=SPECIFIER_WITHASYNC^#) {} +func testTypeSpecifierWithThrows(_: () throws #^TYPE_SPECIFIER_WITHTHROWS?check=SPECIFIER_WITHTHROWS^#) {} +func testTypeSpecifierWithAsyncThrows(_: () async throws #^TYPE_SPECIFIER_WITHASYNCTHROWS?check=SPECIFIER_WITHASYNCTHROWS^#) {} +func testTypeSpecifierWithArrow(_: () #^TYPE_SPECIFIER_WITHARROW?check=SPECIFIER^#) {} +func testTypeSpecifierWithAsyncArrow(_: () async #^TYPE_SPECIFIER_WITHASYNCARROW?check=SPECIFIER_WITHASYNC^# -> Void) {} +func testTypeSpecifierWithThrowsArrow(_: () throws #^TYPE_SPECIFIER_WITHTHROWSARROW?check=SPECIFIER_WITHTHROWS^# -> Void +func testTypeSpecifierWithAsyncThrowsArrow(_: () async throws #^TYPE_SPECIFIER_WITHASYNCTHROWSARROW?check=SPECIFIER_WITHASYNCTHROWS^# -> Void) {} _ = { () #^CLOSURE?check=SPECIFIER^# in } _ = { () async #^CLOSURE_WITHASYNC?check=SPECIFIER_WITHASYNC^# in } diff --git a/test/IDE/complete_constrained.swift b/test/IDE/complete_constrained.swift index 6e40ef0cc8f43..6e6eba15d3014 100644 --- a/test/IDE/complete_constrained.swift +++ b/test/IDE/complete_constrained.swift @@ -126,7 +126,7 @@ func testVegetarian(chef: Chef) { let _ = chefMeta.init(.#^CONDITIONAL_OVERLOAD_INIT_ARG^#) chef.eat(.#^CONDITIONAL_INAPPLICABLE_ARG^#) -// Note: 'eat' is from an inapplicable constrained extension. We complete as if the user intends to addess that later +// Note: 'eat' is from an inapplicable constrained extension. We complete as if the user intends to address that later // (e.g. by adding the missing 'Meat' conformance to 'Vegetarian' - clearly not the intention here - but replace 'Meat' with 'Equatable'). // CONDITIONAL_INAPPLICABLE_ARG: Begin completions, 2 items // CONDITIONAL_INAPPLICABLE_ARG-DAG: Decl[EnumElement]/CurrNominal/Flair[ExprSpecific]/TypeRelation[Convertible]: chicken[#Meat#]; name=chicken diff --git a/test/IDE/complete_constructor.swift b/test/IDE/complete_constructor.swift index 0727ee358fd64..dc64563bf3ece 100644 --- a/test/IDE/complete_constructor.swift +++ b/test/IDE/complete_constructor.swift @@ -233,7 +233,7 @@ func testHaveComma1() { ExplicitConstructors1(#^HAVE_COMMA_1?check=EXPLICIT_CONSTRUCTORS_1P^#, } -//===--- Test that we show default constuctors inherited from protocols +//===--- Test that we show default constructors inherited from protocols protocol ProtDefaultInit {} extension ProtDefaultInit { init(foo: Int) {}} diff --git a/test/IDE/complete_crossmodule.swift b/test/IDE/complete_crossmodule.swift index bd29b3ec5aaf6..ed91223a46f4e 100644 --- a/test/IDE/complete_crossmodule.swift +++ b/test/IDE/complete_crossmodule.swift @@ -7,8 +7,8 @@ // BEGIN MyModule.swift public protocol HasAssocWithConstraint { - associatedtype AssocWithContraint: HasAssocWithConstraint - var value: AssocWithContraint { get } + associatedtype AssocWithConstraint: HasAssocWithConstraint + var value: AssocWithConstraint { get } } // BEGIN Test.swift diff --git a/test/IDE/complete_decl_attribute.swift b/test/IDE/complete_decl_attribute.swift index 5d656c4e4d5d0..437fb135cbee4 100644 --- a/test/IDE/complete_decl_attribute.swift +++ b/test/IDE/complete_decl_attribute.swift @@ -54,7 +54,7 @@ actor MyGlobalActor { @globalActor actor MyGenericGlobalActor { - static let shared = MyGenricGlobalActor() + static let shared = MyGenericGlobalActor() } @available(#^AVAILABILITY1^#) diff --git a/test/IDE/complete_expr_after_paren.swift b/test/IDE/complete_expr_after_paren.swift index e4bd1e596c7f9..4a4e2cedffb9f 100644 --- a/test/IDE/complete_expr_after_paren.swift +++ b/test/IDE/complete_expr_after_paren.swift @@ -34,7 +34,7 @@ class MyClass: Base, MyProtocol { override func method(method4: Int) {} } -func testConstructer() { +func testConstructor() { MyClass(#^INITIALIZER^#) // INITIALIZER: Begin completions, 4 items // INITIALIZER-DAG: Decl[Constructor]/CurrNominal/Flair[ArgLabels]: ['(']{#init1: Int#}[')'][#MyClass#]; diff --git a/test/IDE/complete_from_reexport.swift b/test/IDE/complete_from_reexport.swift index 352d9df4d5cf1..2205bd389f110 100644 --- a/test/IDE/complete_from_reexport.swift +++ b/test/IDE/complete_from_reexport.swift @@ -7,13 +7,13 @@ // RUN: %FileCheck %s -check-prefix=TOP_LEVEL_1 < %t.txt // RUN: %FileCheck %s -check-prefix=NO_DUPLICATES < %t.txt -// TOP_LEVEL_1-DAG: Decl[FreeFunction]/OtherModule[FooSwiftModuleOverlay]: overlayedFoo()[#Void#]{{; name=.+$}} +// TOP_LEVEL_1-DAG: Decl[FreeFunction]/OtherModule[FooSwiftModuleOverlay]: overlaidFoo()[#Void#]{{; name=.+$}} // TOP_LEVEL_1-DAG: Decl[FreeFunction]/OtherModule[FooSwiftModuleOverlay]: onlyInFooOverlay()[#Void#]{{; name=.+$}} // FIXME: there should be only one instance of this completion result. -// NO_DUPLICATES: overlayedFoo()[#Void#]{{; name=.+$}} -// NO_DUPLICATES: overlayedFoo()[#Void#]{{; name=.+$}} -// NO_DUPLICATES-NOT: overlayedFoo()[#Void#]{{; name=.+$}} +// NO_DUPLICATES: overlaidFoo()[#Void#]{{; name=.+$}} +// NO_DUPLICATES: overlaidFoo()[#Void#]{{; name=.+$}} +// NO_DUPLICATES-NOT: overlaidFoo()[#Void#]{{; name=.+$}} import FooSwiftModuleOverlay diff --git a/test/IDE/complete_from_swift_module.swift b/test/IDE/complete_from_swift_module.swift index cb35bb92a5081..913827c88ba6e 100644 --- a/test/IDE/complete_from_swift_module.swift +++ b/test/IDE/complete_from_swift_module.swift @@ -53,8 +53,8 @@ // rdar://15305873 Code completion: implement proper shadowing of declarations represented by cached results // FIXME: %FileCheck %s -check-prefix=TOP_LEVEL_1_NEGATIVE < %t.compl.txt -// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -code-completion-token=AMBIGOUS_RESULT_BUILER > %t.compl.txt -// RUN: %FileCheck %s -check-prefix=AMBIGOUS_RESULT_BUILER < %t.compl.txt +// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -code-completion-token=AMBIGUOUS_RESULT_BUILER > %t.compl.txt +// RUN: %FileCheck %s -check-prefix=AMBIGUOUS_RESULT_BUILER < %t.compl.txt // ERROR_COMMON: found code completion token @@ -158,11 +158,11 @@ func testAmbiguousResultBuilder() { func test() { Foo { - #^AMBIGOUS_RESULT_BUILER^# + #^AMBIGUOUS_RESULT_BUILER^# } // Results should only contain globalVar once - // AMBIGOUS_RESULT_BUILER-NOT: globalVar - // AMBIGOUS_RESULT_BUILER-DAG: Decl[GlobalVar]/OtherModule[foo_swift_module]/TypeRelation[Convertible]: globalVar[#Int#]; name=globalVar - // AMBIGOUS_RESULT_BUILER-NOT: globalVar + // AMBIGUOUS_RESULT_BUILER-NOT: globalVar + // AMBIGUOUS_RESULT_BUILER-DAG: Decl[GlobalVar]/OtherModule[foo_swift_module]/TypeRelation[Convertible]: globalVar[#Int#]; name=globalVar + // AMBIGUOUS_RESULT_BUILER-NOT: globalVar } } diff --git a/test/IDE/complete_in_closures.swift b/test/IDE/complete_in_closures.swift index f9acd0cffe741..5da2b98c0c8f6 100644 --- a/test/IDE/complete_in_closures.swift +++ b/test/IDE/complete_in_closures.swift @@ -1,6 +1,6 @@ // RUN: %batch-code-completion -// EMTPY: Token +// EMPTY: Token // EMPTY-NOT: Begin completions //===--- Helper types that are used in this test @@ -385,11 +385,11 @@ func testClosureInPatternBindingInit() { case dragging(translation: Int, predictedLocation: Int) } - func pnChanged(_ action: () -> Void) {} + func onChanged(_ action: () -> Void) {} func foo() { var gestureViewState: DragState = .dragging(translation: 0, predictedLocation: 0) - let longPressDrag = pnChanged { + let longPressDrag = onChanged { _ = 1 gestureViewState = .dragging(translation: 0, #^CLOSURE_IN_PATTERN_BINDING^#predictedLocation: 0) } diff --git a/test/IDE/complete_inout.swift b/test/IDE/complete_inout.swift index 038cee8845b22..4390ca282f71c 100644 --- a/test/IDE/complete_inout.swift +++ b/test/IDE/complete_inout.swift @@ -9,7 +9,7 @@ struct Foo { var myInt: Int func bar() { - let context = Bar(wihtInout: &self.#^COMPLETE_INOUT?check=CHECK^#) + let context = Bar(withInout: &self.#^COMPLETE_INOUT?check=CHECK^#) let context = Bar(withPointer: &self.#^COMPLETE_POINTER?check=CHECK^#) } } diff --git a/test/IDE/complete_multiple_trailingclosure_signatures.swift b/test/IDE/complete_multiple_trailingclosure_signatures.swift index cd17fe6196141..605ebb98bf797 100644 --- a/test/IDE/complete_multiple_trailingclosure_signatures.swift +++ b/test/IDE/complete_multiple_trailingclosure_signatures.swift @@ -25,7 +25,7 @@ func test() { // GLOBALFUNC_SAMELINE-DAG: Pattern/Local/Flair[ArgLabels]: {#fn8: (Int...) -> Void {<#Int...#> in|}#}[#(Int...) -> Void#]; } -func testStringAndMulipleTrailingClosures() { +func testStringAndMultipleTrailingClosures() { func stringAndClosure(_ key: String, _ body: () -> Void) {} func takeClosure(_ x: () -> Void) {} diff --git a/test/IDE/complete_opaque_result.swift b/test/IDE/complete_opaque_result.swift index 4b27c1ba58308..a1d02047da9f1 100644 --- a/test/IDE/complete_opaque_result.swift +++ b/test/IDE/complete_opaque_result.swift @@ -1,13 +1,13 @@ // RUN: %batch-code-completion protocol MyProtocol { - associatedtype Mistery + associatedtype Mystery } struct MyStruct {} enum MyEnum {} class MyClass {} struct ConcreteMyProtocol : MyProtocol { - typealias Mistery = MyStruct + typealias Mystery = MyStruct } // MARK: 'some' keyword. @@ -19,7 +19,7 @@ struct ConcreteMyProtocol : MyProtocol { // BEGINNING_WITH_SOME-DAG: Decl[Protocol]/CurrModule: MyProtocol[#MyProtocol#]; name=MyProtocol // BEGINNING_WITH_SOME-DAG: Decl[Struct]/CurrModule: MyStruct[#MyStruct#]; name=MyStruct -func gloabalFunc() -> #^GLOBAL_FUNC?check=BEGINNING_WITH_SOME^# +func globalFunc() -> #^GLOBAL_FUNC?check=BEGINNING_WITH_SOME^# var globalVar: #^GLOBAL_VAR?check=BEGINNING_WITH_SOME^# protocol SomeProto { @@ -129,7 +129,7 @@ class HasTypealias : HasAssocWithConformanceConstraint { // OVERRIDE_HasTypealias-DAG: Decl[InstanceMethod]/Super: func returnAssocWithConformanceConstraint(fn: (Int) -> Int) -> ConcreteMyProtocol {|}; } -// MARK: Postfix expession for opaque result types. +// MARK: Postfix expression for opaque result types. protocol TestProtocol { associatedtype Assoc1 diff --git a/test/IDE/complete_overlaymodule.swift b/test/IDE/complete_overlaymodule.swift index bac7d2bcd386c..61f81fe0465d0 100644 --- a/test/IDE/complete_overlaymodule.swift +++ b/test/IDE/complete_overlaymodule.swift @@ -9,21 +9,21 @@ func testGlobalType() { // TYPE_GLOBAL-NOT: OverlayTest[#Module#] // TYPE_GLOBAL-DAG: Decl[Module]/None: OverlayTest[#Module#]; // TYPE_GLOBAL-NOT: OverlayTest[#Module#] -// TYPE_GLOBAL-DAG: Decl[Struct]/OtherModule[OverlayTest.Overlayed]: Overlayed[#Overlayed#]; +// TYPE_GLOBAL-DAG: Decl[Struct]/OtherModule[OverlayTest.Overlaid]: Overlaid[#Overlaid#]; } func testGlobalExpr() { let _ = #^EXPR_GLOBAL^# // EXPR_GLOBAL-NOT: OverlayTest[#Module#] // EXPR_GLOBAL-DAG: Decl[Module]/None: OverlayTest[#Module#]; // EXPR_GLOBAL-NOT: OverlayTest[#Module#] -// EXPR_GLOBAL-DAG: Decl[Struct]/OtherModule[OverlayTest.Overlayed]: Overlayed[#Overlayed#]; -// EXPR_GLOBAL-DAG: Decl[FreeFunction]/OtherModule[OverlayTest]: createOverlayedInOverlay()[#Overlayed#]; -// EXPR_GLOBAL-DAG: Decl[FreeFunction]/OtherModule[OverlayTest.Overlayed]: createOverlayed()[#Overlayed#]; +// EXPR_GLOBAL-DAG: Decl[Struct]/OtherModule[OverlayTest.Overlaid]: Overlaid[#Overlaid#]; +// EXPR_GLOBAL-DAG: Decl[FreeFunction]/OtherModule[OverlayTest]: createOverlaidInOverlay()[#Overlaid#]; +// EXPR_GLOBAL-DAG: Decl[FreeFunction]/OtherModule[OverlayTest.Overlaid]: createOverlaid()[#Overlaid#]; } -func testGlobalExpr(value: Overlayed) { +func testGlobalExpr(value: Overlaid) { value.#^EXPR_MEMBER^# // EXPR_MEMBER: Begin completions, 6 items -// EXPR_MEMBER-DAG: Keyword[self]/CurrNominal: self[#Overlayed#]; name=self +// EXPR_MEMBER-DAG: Keyword[self]/CurrNominal: self[#Overlaid#]; name=self // EXPR_MEMBER-DAG: Decl[InstanceVar]/CurrNominal: x[#Double#]; name=x // EXPR_MEMBER-DAG: Decl[InstanceVar]/CurrNominal: y[#Double#]; name=y // EXPR_MEMBER-DAG: Decl[InstanceVar]/CurrNominal: z[#Double#]; name=z diff --git a/test/IDE/complete_shadowing.swift b/test/IDE/complete_shadowing.swift index f1cdabe9f8caf..2070b15f98856 100644 --- a/test/IDE/complete_shadowing.swift +++ b/test/IDE/complete_shadowing.swift @@ -151,7 +151,7 @@ var globalTest: Int = 1 func test_Global_Local() { var globalTest: String = "" #^Global_Local^# -// FIXME: currently global varialbles are suggested despite they are shadowed. +// FIXME: currently global variables are suggested despite they are shadowed. // Ideally they should be suggested with the qualification (i.e. 'ModuleName.globalTest') // Global_Local-DAG: Decl[LocalVar]/Local: globalTest[#String#]; name=globalTest // Global_Local-DAG: Decl[GlobalVar]/CurrModule: globalTest[#Int#]; name=globalTest @@ -257,7 +257,7 @@ struct test_InheritedMemberProtoExt_Member: ProtoWithIntTestValueExt { } } -protocol ClassWitnIntTestValue { +protocol ClassWithIntTestValue { var testValue: Int { 1 } } struct test_InheritedMemberSuper_Member: ClassWithIntTestValue { diff --git a/test/IDE/complete_typerelation.swift b/test/IDE/complete_typerelation.swift index 6f5362afdd943..6f4362f225c5c 100644 --- a/test/IDE/complete_typerelation.swift +++ b/test/IDE/complete_typerelation.swift @@ -1,7 +1,7 @@ // RUN: %batch-code-completion -disable-objc-attr-requires-foundation-module // SE-0353 -struct ConstraintedExistentialTest { +struct ConstrainedExistentialTest { protocol Producer { associatedtype Event } @@ -20,8 +20,8 @@ struct ConstraintedExistentialTest { let stringProducer: StringProducer func test() { - takeStringProducer(self.#^IN_CONSTRAINTED_EXISTENTIAL_CONTEXT^#) + takeStringProducer(self.#^IN_CONSTRAINED_EXISTENTIAL_CONTEXT^#) } -// IN_CONSTRAINTED_EXISTENTIAL_CONTEXT-DAG: Decl[InstanceVar]/CurrNominal: intProducer[#IntProducer#]; -// IN_CONSTRAINTED_EXISTENTIAL_CONTEXT-DAG: Decl[InstanceVar]/CurrNominal/TypeRelation[Convertible]: stringProducer[#StringProducer#]; +// IN_CONSTRAINED_EXISTENTIAL_CONTEXT-DAG: Decl[InstanceVar]/CurrNominal: intProducer[#IntProducer#]; +// IN_CONSTRAINED_EXISTENTIAL_CONTEXT-DAG: Decl[InstanceVar]/CurrNominal/TypeRelation[Convertible]: stringProducer[#StringProducer#]; } diff --git a/test/IDE/complete_unresolved_members.swift b/test/IDE/complete_unresolved_members.swift index 5eec08dff6992..e5e5ff065a451 100644 --- a/test/IDE/complete_unresolved_members.swift +++ b/test/IDE/complete_unresolved_members.swift @@ -602,7 +602,7 @@ struct TestingStruct { } func testDefaultArgument(arg: SomeEnum1 = .#^DEFAULT_ARG_1?check=UNRESOLVED_3^#) {} -class TestDefalutArg { +class TestDefaultArg { func method(arg: SomeEnum1 = .#^DEFAULT_ARG_2?check=UNRESOLVED_3^#) {} init(arg: SomeEnum1 = .#^DEFAULT_ARG_3?check=UNRESOLVED_3^#) {} } diff --git a/test/IDE/complete_value_expr.swift b/test/IDE/complete_value_expr.swift index 4d51f98cbedb2..493942a3e61b8 100644 --- a/test/IDE/complete_value_expr.swift +++ b/test/IDE/complete_value_expr.swift @@ -1826,13 +1826,13 @@ protocol MetaProto { static func staticFunc() -> Int static var staticVar: Int { get } func instanceFunc() -> Int - var intanceVar: Int { get } + var instanceVar: Int { get } } extension MetaProto { static func staticFuncExtension() -> Int { 1 } static var staticVarExtension: Int { 1 } func instanceFuncExtension() -> Int { 1 } - var intanceVarExtension: Int { 1 } + var instanceVarExtension: Int { 1 } } func testProtocolMetatype(protoProto: MetaProto.Protocol, protoType: MetaProto.Type) { let _ = BrokenConformanceP.#^PROTOCOLMETA_1^# diff --git a/test/IDE/conforming-methods-afterclosure.swift b/test/IDE/conforming-methods-afterclosure.swift index faa168b12761d..d5ca96ecadc67 100644 --- a/test/IDE/conforming-methods-afterclosure.swift +++ b/test/IDE/conforming-methods-afterclosure.swift @@ -8,7 +8,7 @@ public struct MyStruct { public func returnSomeP -> some TargetP { ConcreteP() } public func returnConcreteP -> ConcreteP { ConcreteP() } - public func reutrnInt -> Int { 1 } + public func returnInt -> Int { 1 } } func test() { diff --git a/test/IDE/local_types.swift b/test/IDE/local_types.swift index baa0a4687a2ea..1c71d0e26187b 100644 --- a/test/IDE/local_types.swift +++ b/test/IDE/local_types.swift @@ -121,18 +121,18 @@ public var singlePattern: Int { // Cannot be public, because inlinable default arguments cannot contain local types func singleDefaultArgument(i: Int = { - //CHECK-DAG: 10LocalTypes21singleDefaultArgument1iySi_tFfA_SiycfU_06SingledE6StructL_V + //CHECK-DAG: 10LocalTypes21singleDefaultArgument1itSi_tFfA_SiycfU_06SingledE6StructL_V struct SingleDefaultArgumentStruct { let sdasi: Int } - // CHECK-DAG: 10LocalTypes21singleDefaultArgument1iySi_tFfA_SiycfU_06SingledE5ClassL_C + // CHECK-DAG: 10LocalTypes21singleDefaultArgument1itSi_tFfA_SiycfU_06SingledE5ClassL_C class SingleDefaultArgumentClass { let sdacs: String init(s: String) { self.sdacs = s } } - // CHECK-DAG: 10LocalTypes21singleDefaultArgument1iySi_tFfA_SiycfU_06SingledE4EnumL_O + // CHECK-DAG: 10LocalTypes21singleDefaultArgument1itSi_tFfA_SiycfU_06SingledE4EnumL_O enum SingleDefaultArgumentEnum { case SDAEI(Int) } diff --git a/test/IDE/merge_local_types.swift b/test/IDE/merge_local_types.swift index c5cb75e5d7774..c2ace99ed3fb5 100644 --- a/test/IDE/merge_local_types.swift +++ b/test/IDE/merge_local_types.swift @@ -29,18 +29,18 @@ public func toMerge() { //CHECK-DAG: 16LocalTypesMerged7toMergeyyF14SingleFuncEnumL_O //CHECK-DAG: 16LocalTypesMerged10singleFuncyyF06SingleE4EnumL_O -//CHECK-DAG: 16LocalTypesMerged21singleDefaultArgument1iySi_tFfA_SiycfU_06SingleeF5ClassL_C +//CHECK-DAG: 16LocalTypesMerged21singleDefaultArgument1itSi_tFfA_SiycfU_06SingleeF5ClassL_C //CHECK-DAG: 16LocalTypesMerged13singlePatternSivg06SingleE4EnumL_O //CHECK-DAG: 16LocalTypesMerged13singleClosureyycvpfiyycfU_06SingleE5ClassL_C //CHECK-DAG: 16LocalTypesMerged10doubleFuncyyF05innerE0L_yyF06DoubleE5ClassL_C //CHECK-DAG: 16LocalTypesMerged13singleClosureyycvpfiyycfU_06SingleE6StructL_V -//CHECK-DAG: 16LocalTypesMerged21singleDefaultArgument1iySi_tFfA_SiycfU_06SingleeF4EnumL_O +//CHECK-DAG: 16LocalTypesMerged21singleDefaultArgument1itSi_tFfA_SiycfU_06SingleeF4EnumL_O //CHECK-DAG: 16LocalTypesMerged13singleClosureyycvpfiyycfU_06SingleE4EnumL_O //CHECK-DAG: 16LocalTypesMerged10singleFuncyyF06SingleE5ClassL_C //CHECK-DAG: 16LocalTypesMerged13singlePatternSivg06SingleE5ClassL_C //CHECK-DAG: 16LocalTypesMerged13doubleClosureyycvpfiyycfU_yycfU_06DoubleE5ClassL_C //CHECK-DAG: 16LocalTypesMerged13doubleClosureyycvpfiyycfU_yycfU_06DoubleE6StructL_V -//CHECK-DAG: 16LocalTypesMerged21singleDefaultArgument1iySi_tFfA_SiycfU_06SingleeF6StructL_V +//CHECK-DAG: 16LocalTypesMerged21singleDefaultArgument1itSi_tFfA_SiycfU_06SingleeF6StructL_V //CHECK-DAG: 16LocalTypesMerged13doubleClosureyycvpfiyycfU_yycfU_06DoubleE4EnumL_O //CHECK-DAG: 16LocalTypesMerged10doubleFuncyyF05innerE0L_yyF06DoubleE6StructL_V //CHECK-DAG: 16LocalTypesMerged10doubleFuncyyF05innerE0L_yyF06DoubleE4EnumL_O diff --git a/test/IDE/structure.swift b/test/IDE/structure.swift index 293ea300c9fdc..66cbebaf7d899 100644 --- a/test/IDE/structure.swift +++ b/test/IDE/structure.swift @@ -31,12 +31,12 @@ class MyCls : OtherClass { // CHECK: } } -// CHECK: struct MyStruc { +// CHECK: struct MyStruct { // CHECK: var myVar: Int // CHECK: static var sbar : Int = 0 // CHECK: static func cfoo() // CHECK: } -struct MyStruc { +struct MyStruct { var myVar: Int static var sbar : Int = 0 static func cfoo() @@ -61,11 +61,11 @@ protocol MyProt { init(a: T) where T: MyProt } -// CHECK: extension MyStruc { +// CHECK: extension MyStruct { // CHECK: func foo() { // CHECK: } // CHECK: } -extension MyStruc { +extension MyStruct { func foo() { } } @@ -299,8 +299,8 @@ enum FooEnum { // CHECK: enum FooEnum { case blah(x: () -> () = { // CHECK: case blah(x: () -> () = { - @Tuples func foo(x: MyStruc) {} - // CHECK: @Tuples func foo(x: MyStruc) {} + @Tuples func foo(x: MyStruct) {} + // CHECK: @Tuples func foo(x: MyStruct) {} }) // CHECK: }) } diff --git a/test/IRGen/Inputs/weak_import_availability_helper.swift b/test/IRGen/Inputs/weak_import_availability_helper.swift index a5d1f1db0e126..31c2acd63e617 100644 --- a/test/IRGen/Inputs/weak_import_availability_helper.swift +++ b/test/IRGen/Inputs/weak_import_availability_helper.swift @@ -26,7 +26,7 @@ extension ConditionallyAvailableStruct { } @available(macOS, unavailable) -public struct UnvailableStruct { +public struct UnavailableStruct { public func unavailableMethod() {} } diff --git a/test/IRGen/big_types_corner_cases.sil b/test/IRGen/big_types_corner_cases.sil index c92af768f3c13..270cd16c66cf1 100644 --- a/test/IRGen/big_types_corner_cases.sil +++ b/test/IRGen/big_types_corner_cases.sil @@ -126,12 +126,12 @@ bb0(%0 : $Builtin.Int64, %1 : $() -> @owned BigStruct): return undef : $BigStruct } -// CHECK-LABEL: define swiftcc void @poninter_to_mod_ret(ptr %0, ptr %1) +// CHECK-LABEL: define swiftcc void @pointer_to_mod_ret(ptr %0, ptr %1) // CHECK: [[CALL:%.*]] = call swiftcc { ptr, ptr } %0(ptr swiftself %1) // CHECK: extractvalue { ptr, ptr } [[CALL]], 0 // CHECK: extractvalue { ptr, ptr } [[CALL]], 1 // CHECK: ret void -sil @poninter_to_mod_ret : $@convention(thin) (@owned @callee_owned () -> @owned @callee_owned (@owned Builtin.Int64) -> @owned BigStruct) -> () { +sil @pointer_to_mod_ret : $@convention(thin) (@owned @callee_owned () -> @owned @callee_owned (@owned Builtin.Int64) -> @owned BigStruct) -> () { bb0(%funcpointer : $@callee_owned () -> @owned @callee_owned (@owned Builtin.Int64) -> @owned BigStruct): %papply = apply %funcpointer() : $@callee_owned () -> @owned @callee_owned (@owned Builtin.Int64) -> @owned BigStruct %ret = tuple () diff --git a/test/IRGen/comdat.swift b/test/IRGen/comdat.swift index e85eb939af45b..ae4007f891f59 100644 --- a/test/IRGen/comdat.swift +++ b/test/IRGen/comdat.swift @@ -9,6 +9,6 @@ // CHECK-1: "$s6comdat1C33_{{.*}}LLCMa" = comdat any // CHECK-1: "$s6comdat1C33_{{.*}}LLCMn" = comdat any -// Ensure that no foward declaration is emitted +// Ensure that no forward declaration is emitted // CHECK-2-NOT: "$s6comdat1C33_{{.*}}LLCMa" = comdat any // CHECK-2-NOT: "$s6comdat1C33_{{.*}}LLCMn" = comdat any diff --git a/test/IRGen/debug_fragment_merge.sil b/test/IRGen/debug_fragment_merge.sil index 3bf615891fc20..0c65e6c093749 100644 --- a/test/IRGen/debug_fragment_merge.sil +++ b/test/IRGen/debug_fragment_merge.sil @@ -2,7 +2,7 @@ // Checking the below on 32 bit architectures would be cumbersome: each // fragment is 32 bits long, which changes the number of checks as well as the -// arithmethic on the bounds of each fragment. +// arithmetic on the bounds of each fragment. // REQUIRES: CPU=arm64 || CPU=x86_64 || CPU=arm64e // CHECK-DAG: llvm.dbg.value{{.*}} metadata ![[VAR:[0-9]+]], metadata !DIExpression(DW_OP_LLVM_fragment, 192, 64){{.*}} !dbg ![[LOC1:[0-9]+]] diff --git a/test/IRGen/dynamic_replaceable.sil b/test/IRGen/dynamic_replaceable.sil index 9e4022a38ee77..646fffcc451c8 100644 --- a/test/IRGen/dynamic_replaceable.sil +++ b/test/IRGen/dynamic_replaceable.sil @@ -39,7 +39,7 @@ // CHECK-NEXT: ret void // CHECK-NEXT: } -sil [dynamically_replacable] @test_dynamically_replaceable : $@convention(thin) () -> () { +sil [dynamically_replaceable] @test_dynamically_replaceable : $@convention(thin) () -> () { bb0: %0 = tuple () return %0 : $() diff --git a/test/IRGen/existentials.sil b/test/IRGen/existentials.sil index f2789a537a036..8c3d3ebe14cac 100644 --- a/test/IRGen/existentials.sil +++ b/test/IRGen/existentials.sil @@ -124,7 +124,7 @@ entry(%arg : $*any Constrained): } // Make sure we don't instantiate metadata for constrained existentials. Metadata -// instatiation is not supported on older runtimes. +// instantiation is not supported on older runtimes. // OPT: define{{.*}} void @constrained_protocol( // OPT: call {{.*}} @"$s12existentials11Constrained_pSi1TAaBPRts_XPWOc" diff --git a/test/IRGen/keypaths.sil b/test/IRGen/keypaths.sil index c8f47b43bcc5f..10d8f183a84a3 100644 --- a/test/IRGen/keypaths.sil +++ b/test/IRGen/keypaths.sil @@ -584,14 +584,14 @@ public class GC2 { public var y: String } -sil @class_constrainted : $@convention(thin) () -> () { +sil @class_constrained : $@convention(thin) () -> () { bb0: %k = keypath $KeyPath, <τ_0_0 where τ_0_0 : C> (root $τ_0_0; stored_property #C.y : $String) %t = tuple () return %t : $() } -sil @generic_class_constrainted : $@convention(thin) > () -> () { +sil @generic_class_constrained : $@convention(thin) > () -> () { bb0: %k = keypath $KeyPath, <τ_0_0, τ_0_1 where τ_0_1 : GC2<τ_0_0>> (root $τ_0_1; stored_property #GC2.y : $String) %t = tuple () diff --git a/test/IRGen/opaque_result_type_substitution_2.swift b/test/IRGen/opaque_result_type_substitution_2.swift index f14ccb78a859a..5de0c45c46372 100644 --- a/test/IRGen/opaque_result_type_substitution_2.swift +++ b/test/IRGen/opaque_result_type_substitution_2.swift @@ -71,7 +71,7 @@ extension Thing { } } -struct OutterThing : Thing { +struct OuterThing : Thing { let content: Content init(_ c: Content) { diff --git a/test/IRGen/ptrauth-dynamic_replaceable.sil b/test/IRGen/ptrauth-dynamic_replaceable.sil index d4fa9b6b77c1f..8f4da5314d332 100644 --- a/test/IRGen/ptrauth-dynamic_replaceable.sil +++ b/test/IRGen/ptrauth-dynamic_replaceable.sil @@ -45,7 +45,7 @@ // CHECK-NEXT: ret void // CHECK-NEXT: } -sil [dynamically_replacable] @test_dynamically_replaceable : $@convention(thin) () -> () { +sil [dynamically_replaceable] @test_dynamically_replaceable : $@convention(thin) () -> () { bb0: %0 = tuple () return %0 : $() @@ -87,7 +87,7 @@ bb0: } -sil [dynamically_replacable] @external_test_dynamically_replaceable : $@convention(thin) () -> () +sil [dynamically_replaceable] @external_test_dynamically_replaceable : $@convention(thin) () -> () sil [dynamic_replacement_for "external_test_dynamically_replaceable"] @test_replacement_for_external : $@convention(thin) () -> () { bb0: diff --git a/test/IRGen/typed_throws.swift b/test/IRGen/typed_throws.swift index a05e261fab2eb..b35083813d4ed 100644 --- a/test/IRGen/typed_throws.swift +++ b/test/IRGen/typed_throws.swift @@ -122,7 +122,7 @@ struct MyError: Error { // CHECK: define hidden swiftcc { float, i64, float } @"$s12typed_throws8mayThrow1x1ySf_s5Int32VSftSb_yXltAA7MyErrorVYKF" // CHECK: [[CONVERTED:%.*]] = ptrtoint ptr {{%.*}} to i64 -// CEHCK: insertvalue { float, i64, float } undef, i64 [[CONVERTED]], 1 +// CHECK: insertvalue { float, i64, float } undef, i64 [[CONVERTED]], 1 // CHECK: } @inline(never) func mayThrow(x: Bool, y: AnyObject) throws(MyError) -> (Float, Int32, Float) { diff --git a/test/IRGen/typelayout_based_value_operation.sil b/test/IRGen/typelayout_based_value_operation.sil index 21b85684dc116..d0fbcfa7fc45e 100644 --- a/test/IRGen/typelayout_based_value_operation.sil +++ b/test/IRGen/typelayout_based_value_operation.sil @@ -16,12 +16,12 @@ public struct A { public class C {} -// CHECK-LABEL: define{{.*}} void @testDestroyValueTrival( +// CHECK-LABEL: define{{.*}} void @testDestroyValueTrivial( // CHECK-NEXT: entry: // CHECK-NEXT: ret void // CHECK-NEXT: } -sil @testDestroyValueTrival : $@convention(thin) (@in A) -> () { +sil @testDestroyValueTrivial : $@convention(thin) (@in A) -> () { entry(%arg : $*A): destroy_addr %arg : $*A %ret = tuple () diff --git a/test/IRGen/weak_import_availability.swift b/test/IRGen/weak_import_availability.swift index 347ebd9f34332..c9d4085777345 100644 --- a/test/IRGen/weak_import_availability.swift +++ b/test/IRGen/weak_import_availability.swift @@ -115,14 +115,14 @@ public func useConditionallyAvailableMethod(s: ConditionallyAvailableStruct) { @available(macOS, unavailable) public func useUnavailableStruct() { - blackHole(UnvailableStruct.self) + blackHole(UnavailableStruct.self) } -// CHECK-LABEL: declare extern_weak swiftcc %swift.metadata_response @"$s31weak_import_availability_helper16UnvailableStructVMa"(i64) +// CHECK-LABEL: declare extern_weak swiftcc %swift.metadata_response @"$s31weak_import_availability_helper16UnavailableStructVMa"(i64) @available(macOS, unavailable) -public func useUnavailableMethod(s: UnvailableStruct) { +public func useUnavailableMethod(s: UnavailableStruct) { s.unavailableMethod() } -// CHECK-LABEL: declare extern_weak swiftcc void @"$s31weak_import_availability_helper16UnvailableStructV17unavailableMethodyyF"(ptr noalias swiftself) +// CHECK-LABEL: declare extern_weak swiftcc void @"$s31weak_import_availability_helper16UnavailableStructV17unavailableMethodyyF"(ptr noalias swiftself) diff --git a/test/Index/Store/unit-custom-output-path-driver.swift b/test/Index/Store/unit-custom-output-path-driver.swift index 52b83767258b5..2e9ffd8de5685 100644 --- a/test/Index/Store/unit-custom-output-path-driver.swift +++ b/test/Index/Store/unit-custom-output-path-driver.swift @@ -139,7 +139,7 @@ // Check the unit output is based on "index-unit-output-path": // RUN: c-index-test core -print-unit %/t/idx_batch_with | %FileCheck -check-prefixes=INDEX_WITH %s // -// Check the unit output is not baed on the "output" values: +// Check the unit output is not based on the "output" values: // RUN: c-index-test core -print-unit %/t/idx_batch_with | %FileCheck -check-prefixes=INDEX_WITH_NEGATIVE %s // // C) Do the above again but with a fresh index store and using file lists. diff --git a/test/Index/Store/unit-custom-output-path.swift b/test/Index/Store/unit-custom-output-path.swift index ee46e228bc422..555a7b0980e7f 100644 --- a/test/Index/Store/unit-custom-output-path.swift +++ b/test/Index/Store/unit-custom-output-path.swift @@ -117,7 +117,7 @@ // Check the unit output is based on -index-unit-output-path: // RUN: c-index-test core -print-unit %t/idx_batch_with | %FileCheck -check-prefixes=INDEX_BATCH_WITH %s // -// Check the unit output is not baed on the -o values: +// Check the unit output is not based on the -o values: // RUN: c-index-test core -print-unit %t/idx_batch_with | %FileCheck -check-prefixes=INDEX_BATCH_WITH_NEGATIVE %s // // INDEX_BATCH_WITH: custom_main.o-{{.*}} diff --git a/test/Inputs/lazy_typecheck_client.swift b/test/Inputs/lazy_typecheck_client.swift index 938960138ae25..bde53360484a9 100644 --- a/test/Inputs/lazy_typecheck_client.swift +++ b/test/Inputs/lazy_typecheck_client.swift @@ -27,7 +27,7 @@ func testGlobalFunctions() { } } -func testGobalVars() { +func testGlobalVars() { let _: Int = publicGlobalVar let _: Int = publicGlobalVarTypealias let _: String = publicGlobalVarInferredType diff --git a/test/Interop/Cxx/class/constructors-silgen.swift b/test/Interop/Cxx/class/constructors-silgen.swift index f0cfcb1600405..f7f7046692ea3 100644 --- a/test/Interop/Cxx/class/constructors-silgen.swift +++ b/test/Interop/Cxx/class/constructors-silgen.swift @@ -23,7 +23,7 @@ public func testConstructorWithParam() { // CHECK: apply [[FN]]([[AS]]) : $@convention(c) () -> @out EmptyStruct // CHECK-LABEL: end sil function '$s4main18emptyTypeNoArgInityyF' -// CHECL-LABEL: sil [clang EmptyStruct.init] @{{_ZN11EmptyStructC1Ev|\?\?0EmptyStruct@@QEAA@XZ}} : $@convention(c) () -> @out EmptyStruct +// CHECK-LABEL: sil [clang EmptyStruct.init] @{{_ZN11EmptyStructC1Ev|\?\?0EmptyStruct@@QEAA@XZ}} : $@convention(c) () -> @out EmptyStruct public func emptyTypeNoArgInit() { let e = EmptyStruct() } diff --git a/test/Interop/Cxx/class/invalid-unsafe-projection-errors.swift b/test/Interop/Cxx/class/invalid-unsafe-projection-errors.swift index 95046f4b59d19..6893d36794d14 100644 --- a/test/Interop/Cxx/class/invalid-unsafe-projection-errors.swift +++ b/test/Interop/Cxx/class/invalid-unsafe-projection-errors.swift @@ -10,7 +10,7 @@ module Test { //--- Inputs/test.h struct Ptr { int *p; }; -struct __attribute__((swift_attr("import_owned"))) StirngLiteral { const char *name; }; +struct __attribute__((swift_attr("import_owned"))) StringLiteral { const char *name; }; struct M { M(const M&); @@ -20,7 +20,7 @@ struct M { int *begin() const; - StirngLiteral stringLiteral() const { return StirngLiteral{"M"}; } + StringLiteral stringLiteral() const { return StringLiteral{"M"}; } }; //--- test.swift diff --git a/test/Interop/Cxx/extern-c/Inputs/inline-func.h b/test/Interop/Cxx/extern-c/Inputs/inline-func.h index e859a17762813..175ee02c8ac32 100644 --- a/test/Interop/Cxx/extern-c/Inputs/inline-func.h +++ b/test/Interop/Cxx/extern-c/Inputs/inline-func.h @@ -2,13 +2,13 @@ extern "C" { inline void inlineFn(); -void cacheMis() { } +void cacheMiss() { } void incorrectCacheHit() { inlineFn(); } static void caller() { - cacheMis(); + cacheMiss(); incorrectCacheHit(); } diff --git a/test/Interop/Cxx/foreign-reference/invalid-retain-operation-errors.swift b/test/Interop/Cxx/foreign-reference/invalid-retain-operation-errors.swift index cf0c3ccca2f65..468107a540b82 100644 --- a/test/Interop/Cxx/foreign-reference/invalid-retain-operation-errors.swift +++ b/test/Interop/Cxx/foreign-reference/invalid-retain-operation-errors.swift @@ -11,9 +11,9 @@ module Test { //--- Inputs/test.h struct __attribute__((swift_attr("import_reference"))) - __attribute__((swift_attr("retain:nonexistant"))) - __attribute__((swift_attr("release:nonexistant"))) -NonExistant {}; + __attribute__((swift_attr("retain:nonexistent"))) + __attribute__((swift_attr("release:nonexistent"))) +NonExistent {}; struct __attribute__((swift_attr("import_reference"))) @@ -32,9 +32,9 @@ void badRelease(BadRetainRelease *v, int i); import Test -// CHECK: error: cannot find retain function 'nonexistant' for reference type 'NonExistant' -// CHECK: error: cannot find release function 'nonexistant' for reference type 'NonExistant' -public func test(x: NonExistant) { } +// CHECK: error: cannot find retain function 'nonexistent' for reference type 'NonExistent' +// CHECK: error: cannot find release function 'nonexistent' for reference type 'NonExistent' +public func test(x: NonExistent) { } // CHECK: error: reference type 'NoRetainRelease' must have 'retain:' swift attribute // CHECK: error: reference type 'NoRetainRelease' must have 'release:' swift attribute diff --git a/test/Interop/Cxx/reference/reference-silgen-cxx-objc-ctors+init.swift b/test/Interop/Cxx/reference/reference-silgen-cxx-objc-ctors+init.swift index e0f8fc992dd1b..730af322c8f74 100644 --- a/test/Interop/Cxx/reference/reference-silgen-cxx-objc-ctors+init.swift +++ b/test/Interop/Cxx/reference/reference-silgen-cxx-objc-ctors+init.swift @@ -7,7 +7,7 @@ var a: Int32 = 32 var b = IntWrapper(a) var c = ObjCSwiftBridge(embedded: b) -// FIXME: the const-ref C++ Consructor here is not getting an @in_guaranteed or even an @in convention here. +// FIXME: the const-ref C++ Constructor here is not getting an @in_guaranteed or even an @in convention here. // CHECK: {{%[0-9]+}} = function_ref @_ZN10IntWrapperC1ERKi : $@convention(c) (@in_guaranteed Int32) -> @out IntWrapper // CHECK: {{%[0-9]+}} = apply {{%[0-9]+}}({{%[0-9]+}}, {{%[0-9]+}}) : $@convention(c) (@in_guaranteed Int32) -> @out IntWrapper // CHECK: alloc_global @$s4main1cSo15ObjCSwiftBridgeCSgvp diff --git a/test/Interop/Cxx/templates/Inputs/class-template-with-typedef.h b/test/Interop/Cxx/templates/Inputs/class-template-with-typedef.h index 937746a57d143..c4263efdb2a18 100644 --- a/test/Interop/Cxx/templates/Inputs/class-template-with-typedef.h +++ b/test/Interop/Cxx/templates/Inputs/class-template-with-typedef.h @@ -11,7 +11,7 @@ struct Lander {}; template struct Lander { typedef unsigned long size_type; // Make sure we don't crash here. Before being specialized, "size_type" is - // technically a depedent type because it expands to "Lander::size_type". + // technically a dependent type because it expands to "Lander::size_type". void test(size_type) { } }; diff --git a/test/Interop/Cxx/templates/Inputs/function-templates.h b/test/Interop/Cxx/templates/Inputs/function-templates.h index 00fb6259e8e0f..28268d38c83b2 100644 --- a/test/Interop/Cxx/templates/Inputs/function-templates.h +++ b/test/Interop/Cxx/templates/Inputs/function-templates.h @@ -106,7 +106,7 @@ template void takesDependent(Dependent d) {} void takesAtomic(_Atomic(int) a) {} -struct HasImposibleMember { +struct HasImpossibleMember { void memberTakesAtomic(_Atomic(int) a) {} }; diff --git a/test/Interop/SwiftToC/functions/swift-primitive-functions-c-bridging.swift b/test/Interop/SwiftToC/functions/swift-primitive-functions-c-bridging.swift index 1241ed8f89ee8..f16370325a8fe 100644 --- a/test/Interop/SwiftToC/functions/swift-primitive-functions-c-bridging.swift +++ b/test/Interop/SwiftToC/functions/swift-primitive-functions-c-bridging.swift @@ -4,7 +4,7 @@ // RUN: %check-interop-c-header-in-clang(%t/functions.h) -// CHECK: SWIFT_EXTERN float $s9Functions16passThrougCFloatyS2fF(float x) SWIFT_NOEXCEPT SWIFT_CALL; +// CHECK: SWIFT_EXTERN float $s9Functions16passThroughCFloatyS2fF(float x) SWIFT_NOEXCEPT SWIFT_CALL; // CHECK-NEXT: SWIFT_EXTERN bool $s9Functions15passThroughBoolyS2bF(bool x) SWIFT_NOEXCEPT SWIFT_CALL; // CHECK-NEXT: SWIFT_EXTERN bool $s9Functions16passThroughCBoolyS2bF(bool x) SWIFT_NOEXCEPT SWIFT_CALL; // CHECK-NEXT: SWIFT_EXTERN char $s9Functions16passThroughCCharys4Int8VADF(char x) SWIFT_NOEXCEPT SWIFT_CALL; @@ -63,7 +63,7 @@ public func passThroughCUnsignedShort(_ x: CUnsignedShort) -> CUnsignedShort { r public func passThroughCUnsignedInt(_ x: CUnsignedInt) -> CUnsignedInt { return x } public func passThroughCUnsignedLongLong(_ x: CUnsignedLongLong) -> CUnsignedLongLong { return x } -public func passThrougCFloat(_ x: CFloat) -> CFloat { return x } +public func passThroughCFloat(_ x: CFloat) -> CFloat { return x } public func passThroughCDouble(_ x: CDouble) -> CDouble { return x } public func passThroughInt8(_ x: Int8) -> Int8 { return x } diff --git a/test/Interop/SwiftToC/functions/swift-primitive-functions-execution.c b/test/Interop/SwiftToC/functions/swift-primitive-functions-execution.c index 27e1c62558706..f4004cbe95f73 100644 --- a/test/Interop/SwiftToC/functions/swift-primitive-functions-execution.c +++ b/test/Interop/SwiftToC/functions/swift-primitive-functions-execution.c @@ -50,8 +50,8 @@ int main() { // passThroughCUnsignedLongLong VERIFY_PASSTHROUGH_VALUE($s9Functions024passThroughCUnsignedLongE0ys6UInt64VADF, 0xFFFFFFFF); - // passThrougCFloat - VERIFY_PASSTHROUGH_VALUE($s9Functions16passThrougCFloatyS2fF, 1.0f); + // passThroughCFloat + VERIFY_PASSTHROUGH_VALUE($s9Functions16passThroughCFloatyS2fF, 1.0f); // passThroughCDouble VERIFY_PASSTHROUGH_VALUE($s9Functions18passThroughCDoubleyS2dF, 42.125f); diff --git a/test/Interop/SwiftToCxx/functions/swift-primitive-functions-cxx-bridging.swift b/test/Interop/SwiftToCxx/functions/swift-primitive-functions-cxx-bridging.swift index d5d57d084b8c6..2a1fd5a4ad7ca 100644 --- a/test/Interop/SwiftToCxx/functions/swift-primitive-functions-cxx-bridging.swift +++ b/test/Interop/SwiftToCxx/functions/swift-primitive-functions-cxx-bridging.swift @@ -4,8 +4,8 @@ // RUN: %check-interop-cxx-header-in-clang(%t/functions.h -DSWIFT_CXX_INTEROP_HIDE_STL_OVERLAY) -// CHECK: SWIFT_INLINE_THUNK float passThrougCFloat(float x) noexcept SWIFT_SYMBOL({{.*}}) SWIFT_WARN_UNUSED_RESULT { -// CHECK-NEXT: return _impl::$s9Functions16passThrougCFloatyS2fF(x); +// CHECK: SWIFT_INLINE_THUNK float passThroughCFloat(float x) noexcept SWIFT_SYMBOL({{.*}}) SWIFT_WARN_UNUSED_RESULT { +// CHECK-NEXT: return _impl::$s9Functions16passThroughCFloatyS2fF(x); // CHECK-NEXT: } // CHECK: SWIFT_INLINE_THUNK bool passThroughBool(bool x) noexcept SWIFT_SYMBOL({{.*}}) SWIFT_WARN_UNUSED_RESULT { @@ -179,7 +179,7 @@ public func passThroughCUnsignedShort(_ x: CUnsignedShort) -> CUnsignedShort { r public func passThroughCUnsignedInt(_ x: CUnsignedInt) -> CUnsignedInt { return x } public func passThroughCUnsignedLongLong(_ x: CUnsignedLongLong) -> CUnsignedLongLong { return x } -public func passThrougCFloat(_ x: CFloat) -> CFloat { return x } +public func passThroughCFloat(_ x: CFloat) -> CFloat { return x } public func passThroughCDouble(_ x: CDouble) -> CDouble { return x } public func passThroughInt8(_ x: Int8) -> Int8 { return x } diff --git a/test/Interop/SwiftToCxx/functions/swift-primitive-functions-execution.cpp b/test/Interop/SwiftToCxx/functions/swift-primitive-functions-execution.cpp index a7328acb53112..0a4ea87eedef4 100644 --- a/test/Interop/SwiftToCxx/functions/swift-primitive-functions-execution.cpp +++ b/test/Interop/SwiftToCxx/functions/swift-primitive-functions-execution.cpp @@ -35,7 +35,7 @@ int main() { VERIFY_PASSTHROUGH_VALUE(passThroughCUnsignedInt, 0xFFFFFFFF); VERIFY_PASSTHROUGH_VALUE(passThroughCUnsignedLongLong, 0xFFFFFFFF); - VERIFY_PASSTHROUGH_VALUE(passThrougCFloat, 1.0f); + VERIFY_PASSTHROUGH_VALUE(passThroughCFloat, 1.0f); VERIFY_PASSTHROUGH_VALUE(passThroughCDouble, 42.125f); VERIFY_PASSTHROUGH_VALUE(passThroughInt8, -1); diff --git a/test/Interop/SwiftToCxx/stdlib/stdlib-in-cxx-no-diagnostics-generated-header.cpp b/test/Interop/SwiftToCxx/stdlib/stdlib-in-cxx-no-diagnostics-generated-header.cpp index d25333e4a277e..719101f9f0d80 100644 --- a/test/Interop/SwiftToCxx/stdlib/stdlib-in-cxx-no-diagnostics-generated-header.cpp +++ b/test/Interop/SwiftToCxx/stdlib/stdlib-in-cxx-no-diagnostics-generated-header.cpp @@ -2,7 +2,7 @@ // RUN: split-file %s %t // RUN: %target-swift-frontend -typecheck %t/print-string.swift -typecheck -module-name Stringer -enable-experimental-cxx-interop -emit-clang-header-path %t/Stringer.h -// Ensure: we don't hit any spurios warnings instantiating +// Ensure: we don't hit any spurious warnings instantiating // C++ standard library templates because of the generated header. // RUN: %target-interop-build-clangxx -std=gnu++20 -fsyntax-only -c %t/test-stdlib.cpp -I %t -Wall -Werror -Werror=ignored-attributes -Wno-error=unused-command-line-argument diff --git a/test/Interpreter/SDK/Inputs/OldABI/OldABI.mm b/test/Interpreter/SDK/Inputs/OldABI/OldABI.mm index 98d561cdec899..6e11717bda231 100644 --- a/test/Interpreter/SDK/Inputs/OldABI/OldABI.mm +++ b/test/Interpreter/SDK/Inputs/OldABI/OldABI.mm @@ -11,7 +11,7 @@ // Implementation of ObjC classes // with bits set to mimic the pre-stable Swift ABI -// and additional memory protection to detect mis-use +// and additional memory protection to detect misuse #if __has_include() #include diff --git a/test/Interpreter/init_accessors.swift b/test/Interpreter/init_accessors.swift index d8e2ee7c2bc64..523ba9f7fe4b1 100644 --- a/test/Interpreter/init_accessors.swift +++ b/test/Interpreter/init_accessors.swift @@ -140,7 +140,7 @@ struct TestNoInitAndInit { var pointX: Int { @storageRestrictions(accesses: x) - init(initalValue) { + init(initialValue) { } get { x } @@ -559,7 +559,7 @@ func test_effects_are_still_supported() { } test_effects_are_still_supported() -// CHEKC: effects-support-test: Test(_a: 42, b: 0) +// CHECK: effects-support-test: Test(_a: 42, b: 0) func test_memberwise_without_stored_properties() { struct Test { @@ -819,9 +819,9 @@ do { print(TestDefaultInitializable()) print(TestDefaultInitializable(a: 42)) - struct TestMixedDefaultInitalizable : CustomStringConvertible { + struct TestMixedDefaultInitializable : CustomStringConvertible { var description: String { - "TestMixedDefaultInitalizable(a: \(a), b: \(b))" + "TestMixedDefaultInitializable(a: \(a), b: \(b))" } var a: Int? { @@ -838,15 +838,15 @@ do { } } - print(TestMixedDefaultInitalizable()) - print(TestMixedDefaultInitalizable(b: "Hello")) - print(TestMixedDefaultInitalizable(a: 42)) + print(TestMixedDefaultInitializable()) + print(TestMixedDefaultInitializable(b: "Hello")) + print(TestMixedDefaultInitializable(a: 42)) } // CHECK: TestDefaultInitializable(a: nil) // CHECK-NEXT: TestDefaultInitializable(a: Optional(42)) -// CHECK-NEXT: TestMixedDefaultInitalizable(a: nil, b: Optional("")) -// CHECK-NEXT: TestMixedDefaultInitalizable(a: nil, b: Optional("Hello")) -// CHECK-NEXT: TestMixedDefaultInitalizable(a: nil, b: Optional("")) +// CHECK-NEXT: TestMixedDefaultInitializable(a: nil, b: Optional("")) +// CHECK-NEXT: TestMixedDefaultInitializable(a: nil, b: Optional("Hello")) +// CHECK-NEXT: TestMixedDefaultInitializable(a: nil, b: Optional("")) do { struct TestNonMutatingSetDefault { diff --git a/test/Macros/lit.local.cfg b/test/Macros/lit.local.cfg index fe1101a502530..da65b67f629b7 100644 --- a/test/Macros/lit.local.cfg +++ b/test/Macros/lit.local.cfg @@ -2,7 +2,7 @@ if 'asserts' not in config.available_features: config.unsupported = True -config.subsitutions = list(config.substitutions) +config.substitutions = list(config.substitutions) def get_target_os(): import re diff --git a/test/Macros/macro_expand_closure.swift b/test/Macros/macro_expand_closure.swift index 28feb98b40d32..432b6c6ac0728 100644 --- a/test/Macros/macro_expand_closure.swift +++ b/test/Macros/macro_expand_closure.swift @@ -17,7 +17,7 @@ func multiStatementInference() -> Int { #multiStatement() } -// The closure intruduced by the macro expansion should not contain any inline +// The closure introduced by the macro expansion should not contain any inline // locations, but instead point directly into the macro buffer. // CHECK-SIL: sil_scope [[S0:[0-9]+]] { loc "@__swiftmacro_9MacroUser0031macro_expand_closureswift_yFFIifMX16_2_14multiStatementfMf_.swift":1:1 parent @$s9MacroUser23multiStatementInferenceSiyFSiyXEfU_ // CHECK-SIL: sil_scope [[S2:[0-9]+]] { loc "@__swiftmacro_9MacroUser0031macro_expand_closureswift_yFFIifMX16_2_14multiStatementfMf_.swift":2:14 parent [[S0]] } diff --git a/test/Macros/macro_plugin_disable_sandbox.swift b/test/Macros/macro_plugin_disable_sandbox.swift index e744554f47286..c12294e486706 100644 --- a/test/Macros/macro_plugin_disable_sandbox.swift +++ b/test/Macros/macro_plugin_disable_sandbox.swift @@ -1,6 +1,6 @@ // REQUIRES: swift_swift_parser -// sandbox-exec is only avaiable in Darwin +// sandbox-exec is only available in Darwin // REQUIRES: OS=macosx // RUN: %empty-directory(%t) diff --git a/test/Macros/macro_swiftdeps.swift b/test/Macros/macro_swiftdeps.swift index 0951863a27c63..911990003fe4e 100644 --- a/test/Macros/macro_swiftdeps.swift +++ b/test/Macros/macro_swiftdeps.swift @@ -103,7 +103,7 @@ // WITHOUT_PLUGIN-NOT: AssertPlugin // WITHOUT_PLUGIN-NOT: mock-plugin -// TRACE_WITH_PLGUIN: "swiftmacros":[ +// TRACE_WITH_PLUGIN: "swiftmacros":[ // TRACE_WITH_PLUGIN-DAG: {"name":"AssertPlugin","path":"{{.*}}AssertPlugin.{{(dylib|so|dll)}}"} // TRACE_WITH_PLUGIN-DAG: {"name":"StringifyPlugin","path":"{{.*}}StringifyPlugin.{{(dylib|so|dll)}}"} // TRACE_WITH_PLUGIN-DAG: {"name":"TestPlugin","path":"{{.*}}mock-plugin"} diff --git a/test/ModuleInterface/async_sequence_conformance.swift b/test/ModuleInterface/async_sequence_conformance.swift index 7200f0a121db6..ece3a0c809918 100644 --- a/test/ModuleInterface/async_sequence_conformance.swift +++ b/test/ModuleInterface/async_sequence_conformance.swift @@ -4,7 +4,7 @@ // REQUIRES: concurrency, OS=macosx -// CHECK: public struct SequenceAdapte +// CHECK: public struct SequenceAdapter @available(SwiftStdlib 5.1, *) public struct SequenceAdapter: AsyncSequence { // CHECK-LABEL: public struct AsyncIterator @@ -33,7 +33,7 @@ public struct SequenceAdapter: AsyncSequence { // CHECK-SAME: public typealias __AsyncSequence_Failure = Base.Failure } -// CHECK: public struct OtherSequenceAdapte +// CHECK: public struct OtherSequenceAdapter @available(SwiftStdlib 5.1, *) public struct OtherSequenceAdapter: AsyncSequence { // CHECK: public typealias Element = Base.Element diff --git a/test/ModuleInterface/features.swift b/test/ModuleInterface/features.swift index ae02eb31ad722..98760d865ea06 100644 --- a/test/ModuleInterface/features.swift +++ b/test/ModuleInterface/features.swift @@ -19,7 +19,7 @@ // the uses of those features are guarded by appropriate #if's that allow older // compilers to skip over the uses of newer features. -// Some feature gaurds are retired when the first compiler that supports the +// Some feature guards are retired when the first compiler that supports the // feature is old enough. The --implicit-check-not arguments to FileCheck above // verify that those guards no longer pollute the emitted interface. diff --git a/test/Parse/availability_query_unavailability.swift b/test/Parse/availability_query_unavailability.swift index 3bba8a978de05..e6642279cd00e 100644 --- a/test/Parse/availability_query_unavailability.swift +++ b/test/Parse/availability_query_unavailability.swift @@ -65,7 +65,7 @@ if #unavailable(iOS 8.0) { if #unavailable(iOSApplicationExtension, unavailable) { // expected-error 2{{expected version number}} } -// Should this be a valid spelling since `#unvailable(*)` cannot be written? +// Should this be a valid spelling since `#unavailable(*)` cannot be written? if #unavailable() { // expected-error {{expected platform name}} } diff --git a/test/Parse/diagnostic_missing_func_keyword.swift b/test/Parse/diagnostic_missing_func_keyword.swift index 2a70cfe37868e..747e799f88980 100644 --- a/test/Parse/diagnostic_missing_func_keyword.swift +++ b/test/Parse/diagnostic_missing_func_keyword.swift @@ -3,7 +3,7 @@ // https://github.com/apple/swift/issues/52877 protocol Brew { // expected-note {{in declaration of 'Brew'}} - tripel() -> Int // expected-error {{expected 'func' keyword in instance method declaration}} {{3-3=func }} + triple() -> Int // expected-error {{expected 'func' keyword in instance method declaration}} {{3-3=func }} quadrupel: Int { get } // expected-error {{expected 'var' keyword in property declaration}} {{3-3=var }} diff --git a/test/Profiler/coverage_result_builder.swift b/test/Profiler/coverage_result_builder.swift index be6874f87f641..e7c6364914432 100644 --- a/test/Profiler/coverage_result_builder.swift +++ b/test/Profiler/coverage_result_builder.swift @@ -1,4 +1,4 @@ -// RUN: %target-swift-frontend -Xllvm -sil-full-demangle -profile-generate -profile-coverage-mapping -emit-sorted-sil -emit-sil -module-name coverage_functon_builder %s | %FileCheck %s +// RUN: %target-swift-frontend -Xllvm -sil-full-demangle -profile-generate -profile-coverage-mapping -emit-sorted-sil -emit-sil -module-name coverage_function_builder %s | %FileCheck %s // RUN: %target-swift-frontend -profile-generate -profile-coverage-mapping -emit-ir %s @resultBuilder @@ -11,7 +11,7 @@ struct Summer { } } -// CHECK-LABEL: sil_coverage_map {{.*}} "$s24coverage_functon_builder5test0SiyF" +// CHECK-LABEL: sil_coverage_map {{.*}} "$s24coverage_function_builder5test0SiyF" @Summer func test0() -> Int { // CHECK: [[@LINE-1]]:21 -> [[@LINE+3]]:2 : 0 @@ -19,7 +19,7 @@ func test0() -> Int { 12 } -// CHECK-LABEL: sil_coverage_map {{.*}} "$s24coverage_functon_builder5test1SiyF" +// CHECK-LABEL: sil_coverage_map {{.*}} "$s24coverage_function_builder5test1SiyF" @Summer func test1() -> Int { // CHECK: [[@LINE-1]]:21 -> [[@LINE+7]]:2 : 0 diff --git a/test/Profiler/unmapped.swift b/test/Profiler/unmapped.swift index 8ea472b527bfc..5911e10f8cd57 100644 --- a/test/Profiler/unmapped.swift +++ b/test/Profiler/unmapped.swift @@ -93,10 +93,10 @@ struct UnavailableType { var storedClosure: Int = { .random() ? 0 : 1 }() @Wrapper - var wrappered = .random() ? 0 : 1 + var wrapped = .random() ? 0 : 1 @Wrapper(wrappedValue: .random() ? 0 : 1) - var alsoWrappered: Int + var alsoWrapped: Int } @available(*, unavailable) diff --git a/test/Prototypes/BigInt.swift b/test/Prototypes/BigInt.swift index ca7725cede255..84b86d8dd3ce1 100644 --- a/test/Prototypes/BigInt.swift +++ b/test/Prototypes/BigInt.swift @@ -459,7 +459,7 @@ public struct _BigInt : return } - // Comare `lhs` and `rhs` so we can use `_unsignedSubtract` to subtract + // Compare `lhs` and `rhs` so we can use `_unsignedSubtract` to subtract // the smaller magnitude from the larger magnitude. switch lhs._compareMagnitude(to: rhs) { case .equal: @@ -1032,7 +1032,7 @@ public struct _BigInt : case lessThan, equal, greaterThan } - /// Returns whether this instance is less than, greather than, or equal to + /// Returns whether this instance is less than, greater than, or equal to /// the given value. func _compare(to rhs: _BigInt) -> _ComparisonResult { // Negative values are less than positive values @@ -1050,7 +1050,7 @@ public struct _BigInt : } } - /// Returns whether the magnitude of this instance is less than, greather + /// Returns whether the magnitude of this instance is less than, greater /// than, or equal to the magnitude of the given value. func _compareMagnitude(to rhs: _BigInt) -> _ComparisonResult { guard _data.count == rhs._data.count else { diff --git a/test/SIL/OwnershipVerifier/borrow_extract_validate.sil b/test/SIL/OwnershipVerifier/borrow_extract_validate.sil index f4f489ef62719..47609eb212d64 100644 --- a/test/SIL/OwnershipVerifier/borrow_extract_validate.sil +++ b/test/SIL/OwnershipVerifier/borrow_extract_validate.sil @@ -55,8 +55,8 @@ bb0(%0 : @guaranteed $WrapperStruct, %1 : @guaranteed $WrapperStruct): return %ret : $() } -// CHECK-NOT: Function: 'borrowed_extract_dominate_discrepency_simple_correct' -sil [ossa] @borrowed_extract_dominate_discrepency_simple_correct : $@convention(thin) (@guaranteed WrapperStruct) -> () { +// CHECK-NOT: Function: 'borrowed_extract_dominate_discrepancy_simple_correct' +sil [ossa] @borrowed_extract_dominate_discrepancy_simple_correct : $@convention(thin) (@guaranteed WrapperStruct) -> () { bb0(%0 : @guaranteed $WrapperStruct): %elem = struct_extract %0 : $WrapperStruct, #WrapperStruct.cls br bb1(%elem : $Klass) @@ -77,14 +77,14 @@ bb1(%newelem : @guaranteed $Klass): return %res : $() } -// CHECK-LABEL: Error#: 0. Begin Error in Function: 'borrowed_extract_dominate_discrepency_incorrect1' +// CHECK-LABEL: Error#: 0. Begin Error in Function: 'borrowed_extract_dominate_discrepancy_incorrect1' // CHECK: Found outside of lifetime use?! // CHECK: Value: %7 = argument of bb1 : $WrapperStruct // CHECK: Consuming User: end_borrow %7 : $WrapperStruct // CHECK: Non Consuming User: %10 = apply %9(%6) : $@convention(thin) (@guaranteed Klass) -> () // CHECK: Block: bb1 -// CHECK-LABEL: Error#: 0. End Error in Function: 'borrowed_extract_dominate_discrepency_incorrect1' -sil [ossa] @borrowed_extract_dominate_discrepency_incorrect1 : $@convention(thin) (@guaranteed WrapperStruct, @guaranteed WrapperStruct) -> () { +// CHECK-LABEL: Error#: 0. End Error in Function: 'borrowed_extract_dominate_discrepancy_incorrect1' +sil [ossa] @borrowed_extract_dominate_discrepancy_incorrect1 : $@convention(thin) (@guaranteed WrapperStruct, @guaranteed WrapperStruct) -> () { bb0(%0 : @guaranteed $WrapperStruct, %1 : @guaranteed $WrapperStruct): %copy0 = copy_value %0 : $WrapperStruct %borrow0 = begin_borrow %copy0 : $WrapperStruct @@ -100,15 +100,15 @@ bb1(%elem : @guaranteed $Klass, %newborrow : @guaranteed $WrapperStruct): return %ret : $() } -// CHECK-LABEL: Error#: 0. Begin Error in Function: 'borrowed_extract_dominate_discrepency_incorrect2' +// CHECK-LABEL: Error#: 0. Begin Error in Function: 'borrowed_extract_dominate_discrepancy_incorrect2' // CHECK: Found outside of lifetime use?! // CHECK: Value: %2 = copy_value %0 : $WrapperStruct // CHECK: Consuming User: destroy_value %2 : $WrapperStruct // CHECK: Non Consuming User: end_borrow %7 : $WrapperStruct // CHECK: Block: bb1 -// CHECK-LABEL: Error#: 0. End Error in Function: 'borrowed_extract_dominate_discrepency_incorrect2' -// CHECK-NOT: Error#: {{[0-9][0-9]*}}. End Error in Function: 'borrowed_extract_dominate_discrepency_incorrect2' -sil [ossa] @borrowed_extract_dominate_discrepency_incorrect2 : $@convention(thin) (@guaranteed WrapperStruct, @guaranteed WrapperStruct) -> () { +// CHECK-LABEL: Error#: 0. End Error in Function: 'borrowed_extract_dominate_discrepancy_incorrect2' +// CHECK-NOT: Error#: {{[0-9][0-9]*}}. End Error in Function: 'borrowed_extract_dominate_discrepancy_incorrect2' +sil [ossa] @borrowed_extract_dominate_discrepancy_incorrect2 : $@convention(thin) (@guaranteed WrapperStruct, @guaranteed WrapperStruct) -> () { bb0(%0 : @guaranteed $WrapperStruct, %1 : @guaranteed $WrapperStruct): %copy0 = copy_value %0 : $WrapperStruct %borrow0 = begin_borrow %copy0 : $WrapperStruct diff --git a/test/SIL/OwnershipVerifier/borrow_validate.sil b/test/SIL/OwnershipVerifier/borrow_validate.sil index 04496e3e8a44c..9f3eecd841b71 100644 --- a/test/SIL/OwnershipVerifier/borrow_validate.sil +++ b/test/SIL/OwnershipVerifier/borrow_validate.sil @@ -239,8 +239,8 @@ bb3(%newborrow : @guaranteed $WrapperStruct, %newowned : @owned $WrapperStruct): return %ret : $() } -// CHECK-NOT: Function: 'borrow_lifetime_discrepency' -sil [ossa] @borrow_lifetime_discrepency : $@convention(thin) (@guaranteed WrapperStruct, @guaranteed WrapperStruct) -> () { +// CHECK-NOT: Function: 'borrow_lifetime_discrepancy' +sil [ossa] @borrow_lifetime_discrepancy : $@convention(thin) (@guaranteed WrapperStruct, @guaranteed WrapperStruct) -> () { bb0(%0 : @guaranteed $WrapperStruct, %1 : @guaranteed $WrapperStruct): %copy0 = copy_value %0 : $WrapperStruct cond_br undef, bb1, bb2 @@ -263,8 +263,8 @@ bb3(%newborrowi : @guaranteed $WrapperStruct, %newborrowo : @guaranteed $Wrapper return %ret : $() } -// CHECK-NOT: Function: 'borrow_lifetime_discrepency_2' -sil [ossa] @borrow_lifetime_discrepency_2 : $@convention(thin) (@guaranteed WrapperStruct, @guaranteed WrapperStruct) -> () { +// CHECK-NOT: Function: 'borrow_lifetime_discrepancy_2' +sil [ossa] @borrow_lifetime_discrepancy_2 : $@convention(thin) (@guaranteed WrapperStruct, @guaranteed WrapperStruct) -> () { bb0(%0 : @guaranteed $WrapperStruct, %1 : @guaranteed $WrapperStruct): cond_br undef, bb1, bb2 @@ -288,15 +288,15 @@ bb3(%newborrowi : @guaranteed $WrapperStruct, %newborrowo : @guaranteed $Wrapper return %ret : $() } -// CHECK-LABEL: Error#: 0. Begin Error in Function: 'borrow_lifetime_discrepency_incorrect_1' +// CHECK-LABEL: Error#: 0. Begin Error in Function: 'borrow_lifetime_discrepancy_incorrect_1' // CHECK: Found outside of lifetime use?! // CHECK: Value: %13 = argument of bb3 : $WrapperStruct // user: %15 // CHECK: Consuming User: destroy_value %13 : $WrapperStruct // id: %15 // CHECK: Non Consuming User: end_borrow %12 : $WrapperStruct // id: %16 // CHECK: Block: bb3 -// CHECK-LABEL: Error#: 0. End Error in Function: 'borrow_lifetime_discrepency_incorrect_1' +// CHECK-LABEL: Error#: 0. End Error in Function: 'borrow_lifetime_discrepancy_incorrect_1' // CHECK-NOT: Error#: 1. -sil [ossa] @borrow_lifetime_discrepency_incorrect_1 : $@convention(thin) (@guaranteed WrapperStruct, @guaranteed WrapperStruct) -> () { +sil [ossa] @borrow_lifetime_discrepancy_incorrect_1 : $@convention(thin) (@guaranteed WrapperStruct, @guaranteed WrapperStruct) -> () { bb0(%0 : @guaranteed $WrapperStruct, %1 : @guaranteed $WrapperStruct): cond_br undef, bb1, bb2 @@ -320,15 +320,15 @@ bb3(%newborrowi : @guaranteed $WrapperStruct, %newborrowo : @guaranteed $Wrapper return %ret : $() } -// CHECK-LABEL: Error#: 0. Begin Error in Function: 'borrow_lifetime_discrepency_incorrect_2' +// CHECK-LABEL: Error#: 0. Begin Error in Function: 'borrow_lifetime_discrepancy_incorrect_2' // CHECK: Found outside of lifetime use?! // CHECK: Value: %12 = argument of bb3 : $WrapperStruct // user: %14 // CHECK: Consuming User: end_borrow %12 : $WrapperStruct // id: %14 // CHECK: Non Consuming User: end_borrow %11 : $WrapperStruct // id: %15 // CHECK: Block: bb3 -// CHECK-LABEL: Error#: 0. End Error in Function: 'borrow_lifetime_discrepency_incorrect_2' +// CHECK-LABEL: Error#: 0. End Error in Function: 'borrow_lifetime_discrepancy_incorrect_2' // CHECK-NOT: Error#: 1. -sil [ossa] @borrow_lifetime_discrepency_incorrect_2 : $@convention(thin) (@guaranteed WrapperStruct, @guaranteed WrapperStruct) -> () { +sil [ossa] @borrow_lifetime_discrepancy_incorrect_2 : $@convention(thin) (@guaranteed WrapperStruct, @guaranteed WrapperStruct) -> () { bb0(%0 : @guaranteed $WrapperStruct, %1 : @guaranteed $WrapperStruct): cond_br undef, bb1, bb2 diff --git a/test/SIL/Parser/basic.sil b/test/SIL/Parser/basic.sil index 4d29c2d87a3c0..fa8b05f0b8aaf 100644 --- a/test/SIL/Parser/basic.sil +++ b/test/SIL/Parser/basic.sil @@ -1707,8 +1707,8 @@ 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_replaceable] @test_dynamically_replaceable +sil [dynamically_replaceable] @test_dynamically_replaceable : $@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..4fadcdd53eafa 100644 --- a/test/SIL/Serialization/dynamically_replaceable.sil +++ b/test/SIL/Serialization/dynamically_replaceable.sil @@ -2,7 +2,7 @@ // 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_replaceable] @test_dynamically_replaceable : $@convention(thin) () -> () { bb0: %0 = tuple () return %0 : $() @@ -27,7 +27,7 @@ bb0: // CHECK-LABEL: sil [serialized] [dynamic_replacement_for "test_dynamically_replaceable"] [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_replaceable] [canonical] @test_dynamically_replaceable // CHECK-LABEL: sil [serialized] [canonical] @test_dynamically_replaceable_impl // CHECK: dynamic_function_ref @test_dynamically_replaceable diff --git a/test/SIL/Serialization/public_external.sil b/test/SIL/Serialization/public_external.sil index 32d6a22f1cc6c..d572022977abf 100644 --- a/test/SIL/Serialization/public_external.sil +++ b/test/SIL/Serialization/public_external.sil @@ -40,7 +40,7 @@ sil hidden @he : $@convention(thin) () -> () { return %0 : $() } -sil hidden [transparent] @tranparent_he : $@convention(thin) () -> () { +sil hidden [transparent] @transparent_he : $@convention(thin) () -> () { %0 = tuple() return %0 : $() } diff --git a/test/SILGen/dynamically_replaceable.swift b/test/SILGen/dynamically_replaceable.swift index 64d2bc44fcf0f..5a8fcfdacd3ac 100644 --- a/test/SILGen/dynamically_replaceable.swift +++ b/test/SILGen/dynamically_replaceable.swift @@ -9,22 +9,22 @@ defer { } // CHECK-LABEL: sil hidden [ossa] @$s23dynamically_replaceable014maybe_dynamic_B0yyF : $@convention(thin) () -> () { -// IMPLICIT-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable014maybe_dynamic_B0yyF : $@convention(thin) () -> () { +// IMPLICIT-LABEL: sil hidden [dynamically_replaceable] [ossa] @$s23dynamically_replaceable014maybe_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_replaceable] [ossa] @$s23dynamically_replaceable08dynamic_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_replaceable] [ossa] @$s23dynamically_replaceable6StructV1xACSi_tcfC : $@convention(method) (Int, @thin Struct.Type) -> Struct +// CHECK-LABEL: sil hidden [dynamically_replaceable] [ossa] @$s23dynamically_replaceable6StructV08dynamic_B0yyF : $@convention(method) (Struct) -> () { +// CHECK-LABEL: sil hidden [dynamically_replaceable] [ossa] @$s23dynamically_replaceable6StructV08dynamic_B4_varSivg +// CHECK-LABEL: sil hidden [dynamically_replaceable] [ossa] @$s23dynamically_replaceable6StructV08dynamic_B4_varSivs +// CHECK-LABEL: sil hidden [dynamically_replaceable] [ossa] @$s23dynamically_replaceable6StructVyS2icig : $@convention(method) (Int, Struct) -> Int +// CHECK-LABEL: sil hidden [dynamically_replaceable] [ossa] @$s23dynamically_replaceable6StructVyS2icis : $@convention(method) (Int, Int, @inout Struct) -> () +// CHECK-LABEL: sil private [dynamically_replaceable] [ossa] @$s23dynamically_replaceable6StructV22property_with_observerSivW +// CHECK-LABEL: sil private [dynamically_replaceable] [ossa] @$s23dynamically_replaceable6StructV22property_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_replaceable] [ossa] @$s23dynamically_replaceable5KlassC1xACSi_tcfc : $@convention(method) (Int, @owned Klass) -> @owned Klass +// CHECK-LABEL: sil hidden [dynamically_replaceable] [ossa] @$s23dynamically_replaceable5KlassC08dynamic_B0yyF : $@convention(method) (@guaranteed Klass) -> () { +// CHECK-LABEL: sil hidden [dynamically_replaceable] [ossa] @$s23dynamically_replaceable5KlassC08dynamic_B4_varSivg +// CHECK-LABEL: sil hidden [dynamically_replaceable] [ossa] @$s23dynamically_replaceable5KlassC08dynamic_B4_varSivs +// CHECK-LABEL: sil hidden [dynamically_replaceable] [ossa] @$s23dynamically_replaceable5KlassCyS2icig : $@convention(method) (Int, @guaranteed Klass) -> Int +// CHECK-LABEL: sil hidden [dynamically_replaceable] [ossa] @$s23dynamically_replaceable5KlassCyS2icis : $@convention(method) (Int, Int, @guaranteed Klass) -> () +// CHECK-LABEL: sil private [dynamically_replaceable] [ossa] @$s23dynamically_replaceable5KlassC22property_with_observerSivW +// CHECK-LABEL: sil private [dynamically_replaceable] [ossa] @$s23dynamically_replaceable5KlassC22property_with_observerSivw class Klass { dynamic init(x: Int) { } @@ -101,7 +101,7 @@ class Klass { } class SubKlass : Klass { - // CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable8SubKlassC1xACSi_tcfc + // CHECK-LABEL: sil hidden [dynamically_replaceable] [ossa] @$s23dynamically_replaceable8SubKlassC1xACSi_tcfc // CHECK: // dynamic_function_ref Klass.init(x:) // CHECK: [[FUN:%.*]] = dynamic_function_ref @$s23dynamically_replaceable5KlassC1xACSi_tcfc // CHECK: apply [[FUN]] @@ -109,7 +109,7 @@ class SubKlass : Klass { super.init(x: x) } } -// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable6globalSivg : $@convention(thin) () -> Int { +// CHECK-LABEL: sil hidden [dynamically_replaceable] [ossa] @$s23dynamically_replaceable6globalSivg : $@convention(thin) () -> Int { dynamic var global : Int { return 1 } @@ -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_replaceable] [ossa] @$s23dynamically_replaceable8GenericSV22property_with_observerSivW +// CHECK-LABEL: sil private [dynamically_replaceable] [ossa] @$s23dynamically_replaceable8GenericSV22property_with_observerSivw dynamic var property_with_observer : Int { didSet { } @@ -369,8 +369,8 @@ 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 [dynamically_replaceable] [ossa] @$s23dynamically_replaceable7globalXSivg : $@convention(thin) () -> Int +// CHECK-LABEL: sil hidden [dynamically_replaceable] [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 @@ -380,7 +380,7 @@ func getsetX(_ x: Int) -> Int { } // CHECK-LABEL: sil hidden [ossa] @$s23dynamically_replaceable18funcWithDefaultArgyySSFfA_ -// CHECK-LABEL: sil hidden [dynamically_replacable] [ossa] @$s23dynamically_replaceable18funcWithDefaultArgyySSF +// CHECK-LABEL: sil hidden [dynamically_replaceable] [ossa] @$s23dynamically_replaceable18funcWithDefaultArgyySSF dynamic func funcWithDefaultArg(_ arg : String = String("hello")) { print("hello") } @@ -390,7 +390,7 @@ dynamic func funcWithDefaultArg(_ arg : String = String("hello")) { func foobar() { } -// IMPLICIT-LABEL: sil [dynamically_replacable] [ossa] @$s23dynamically_replaceable16testWithLocalFunyyF +// IMPLICIT-LABEL: sil [dynamically_replaceable] [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_ @@ -401,8 +401,8 @@ public func testWithLocalFun() { localLocalFun() } localFun() - let unamedClosure = { print("foo") } - unamedClosure() + let unnamedClosure = { print("foo") } + unnamedClosure() } @propertyWrapper diff --git a/test/SILGen/extern_c.swift b/test/SILGen/extern_c.swift index 48015e9dede97..15ef12b3e2eeb 100644 --- a/test/SILGen/extern_c.swift +++ b/test/SILGen/extern_c.swift @@ -14,7 +14,7 @@ public func publicVisibility(_ x: Int) -> Int // CHECK-DAG: sil @private_visible : $@convention(c) (Int) -> Int @_extern(c, "private_visible") -private func privateVisiblity(_ x: Int) -> Int +private func privateVisibility(_ x: Int) -> Int // CHECK-DAG: sil hidden_external @withoutCName : $@convention(c) () -> Int @_extern(c) @@ -35,7 +35,7 @@ func main() { _ = publicVisibility(42) // CHECK-DAG: [[F4:%.+]] = function_ref @private_visible : $@convention(c) (Int) -> Int // CHECK-DAG: apply [[F4]]({{.*}}) : $@convention(c) (Int) -> Int - _ = privateVisiblity(24) + _ = privateVisibility(24) // CHECK-DAG: [[F5:%.+]] = function_ref @withoutCName : $@convention(c) () -> Int // CHECK-DAG: apply [[F5]]() : $@convention(c) () -> Int _ = withoutCName() diff --git a/test/SILGen/initializers.swift b/test/SILGen/initializers.swift index fcb11851a9971..b0c86a7fa23bc 100644 --- a/test/SILGen/initializers.swift +++ b/test/SILGen/initializers.swift @@ -800,7 +800,7 @@ class ThrowDerivedClass : ThrowBaseClass { // CHECK: try_apply [[UNWRAP_FN]]({{%.*}}) : $@convention(thin) (Int) -> (Int, @error any Error), normal [[NORMAL_BB:bb[0-9]+]], error [[ERROR_BB:bb[0-9]+]] // // Now we emit the call to the initializer. Notice how we return self back to - // its memory locatio nbefore any other work is done. + // its memory locations nbefore any other work is done. // CHECK: [[NORMAL_BB]]( // CHECK: [[INIT_FN:%.*]] = function_ref @$s21failable_initializers14ThrowBaseClassC6noFailACSi_tcfc : $@convention(method) // CHECK: [[BASE_SELF_INIT:%.*]] = apply [[INIT_FN]]({{%.*}}, [[BASE_SELF]]) diff --git a/test/SILGen/noimplicitcopy_borrowing_parameters.swift b/test/SILGen/noimplicitcopy_borrowing_parameters.swift index ad679045c193b..fd023dac59ff4 100644 --- a/test/SILGen/noimplicitcopy_borrowing_parameters.swift +++ b/test/SILGen/noimplicitcopy_borrowing_parameters.swift @@ -212,7 +212,7 @@ func testLoadableBorrowingEnum(_ x: borrowing LoadableEnum) { // CHECK: copy_addr [[UNWRAP]] to [init] [[STACK]] // CHECK: destroy_addr [[STACK]] // CHECK: [[UNWRAP:%.*]] = moveonlywrapper_to_copyable_addr [[CHECK]] -// TODO: We probably want the unwrap to be on the struct_element_addr, not the other wya around. +// TODO: We probably want the unwrap to be on the struct_element_addr, not the other way around. // CHECK: [[GEP:%.*]] = struct_element_addr [[UNWRAP]] // CHECK: [[STACK:%.*]] = alloc_stack // CHECK: copy_addr [[GEP]] to [init] [[STACK]] diff --git a/test/SILGen/objc_dynamic_replacement_ext.swift b/test/SILGen/objc_dynamic_replacement_ext.swift index 11097e555d790..67c55f79487f0 100644 --- a/test/SILGen/objc_dynamic_replacement_ext.swift +++ b/test/SILGen/objc_dynamic_replacement_ext.swift @@ -31,13 +31,13 @@ import SomeModule // @objc public dynamic var y: Int = 0 // } -// IMPORT-DAG: sil [dynamically_replacable] [ossa] @$s10SomeModule7GenericC3fooyyF : $@convention(method) (@guaranteed Generic) -> () +// IMPORT-DAG: sil [dynamically_replaceable] [ossa] @$s10SomeModule7GenericC3fooyyF : $@convention(method) (@guaranteed Generic) -> () // IMPORT-DAG: sil private [thunk] [ossa] @$s10SomeModule7GenericC3fooyyFTo : $@convention(objc_method) (Generic) -> () // IMPORT-DAG: sil private [thunk] [ossa] @$s10SomeModule7GenericC1xSivgTo : $@convention(objc_method) (Generic) -> Int -// IMPORT-DAG: sil [dynamically_replacable] [ossa] @$s10SomeModule7GenericC1xSivg : $@convention(method) (@guaranteed Generic) -> Int +// IMPORT-DAG: sil [dynamically_replaceable] [ossa] @$s10SomeModule7GenericC1xSivg : $@convention(method) (@guaranteed Generic) -> Int // IMPORT-DAG: sil private [thunk] [ossa] @$s10SomeModule7GenericC1xSivsTo : $@convention(objc_method) (Int, Generic) -> () -// IMPORT-DAG: sil [dynamically_replacable] [ossa] @$s10SomeModule7GenericC1xSivs : $@convention(method) (Int, @guaranteed Generic) -> () +// IMPORT-DAG: sil [dynamically_replaceable] [ossa] @$s10SomeModule7GenericC1xSivs : $@convention(method) (Int, @guaranteed Generic) -> () // NO-DAG: sil private [thunk] [ossa] @$s10SomeModule7GenericC1xSivgTo : $@convention(objc_method) (Generic) -> Int // NO-DAG: sil [ossa] @$s10SomeModule7GenericC1xSivg : $@convention(method) (@guaranteed Generic) -> Int @@ -45,9 +45,9 @@ import SomeModule // NO-DAG: sil [ossa] @$s10SomeModule7GenericC1xSivs : $@convention(method) (Int, @guaranteed Generic) -> () // IMPORT-DAG: sil private [thunk] [ossa] @$s10SomeModule7GenericC1ySivgTo : $@convention(objc_method) (Generic) -> Int -// IMPORT-DAG: sil [dynamically_replacable] [ossa] @$s10SomeModule7GenericC1ySivg : $@convention(method) (@guaranteed Generic) -> Int +// IMPORT-DAG: sil [dynamically_replaceable] [ossa] @$s10SomeModule7GenericC1ySivg : $@convention(method) (@guaranteed Generic) -> Int // IMPORT-DAG: sil private [thunk] [ossa] @$s10SomeModule7GenericC1ySivsTo : $@convention(objc_method) (Int, Generic) -> () -// IMPORT-DAG: sil [dynamically_replacable] [ossa] @$s10SomeModule7GenericC1ySivs : $@convention(method) (Int, @guaranteed Generic) -> () +// IMPORT-DAG: sil [dynamically_replaceable] [ossa] @$s10SomeModule7GenericC1ySivs : $@convention(method) (Int, @guaranteed Generic) -> () extension Generic { @_dynamicReplacement(for: foo()) public func __replacement__foo() {} @@ -80,7 +80,7 @@ extension Generic { // CHECK-DAG: sil [dynamic_replacement_for "$s10SomeModule7GenericC1ySivs"] [ossa] @$s10SomeModule7GenericC28objc_dynamic_replacement_extE02__F2_ySivs : $@convention(method) (Int, @guaranteed Generic) -> () } -// IMPORT-DAG: sil [dynamically_replacable] [ossa] @$s10SomeModule9MyGenericC4doItyyF +// IMPORT-DAG: sil [dynamically_replaceable] [ossa] @$s10SomeModule9MyGenericC4doItyyF // IMPORT-DAG: sil private [thunk] [ossa] @$s10SomeModule9MyGenericC4doItyyFTo // CHECK-NOT: s10SomeModule9MyGenericC28objc_dynamic_replacement_extE02__G6__doItyyFTo // CHECK-DAG: sil hidden [dynamic_replacement_for "$s10SomeModule9MyGenericC4doItyyF"] [ossa] @$s10SomeModule9MyGenericC28objc_dynamic_replacement_extE02__G6__doItyyF : $@convention(method) diff --git a/test/SILGen/package_allow_non_resilient_access.swift b/test/SILGen/package_allow_non_resilient_access.swift index ce15b4b9ec617..74d9415cad7f7 100644 --- a/test/SILGen/package_allow_non_resilient_access.swift +++ b/test/SILGen/package_allow_non_resilient_access.swift @@ -44,7 +44,7 @@ // RUN: -experimental-allow-non-resilient-access \ // RUN: -emit-module -emit-module-path %t/Utils.swiftmodule \ // RUN: 2>&1 | %FileCheck %s --check-prefix=CHECK-DIAG-1 -// CHECK-DIAG-1: warning: ignoring -experimental-skip-non-exportable-decls (overriden by -experimental-allow-non-resilient-access) +// CHECK-DIAG-1: warning: ignoring -experimental-skip-non-exportable-decls (overridden by -experimental-allow-non-resilient-access) // RUN: llvm-bcanalyzer --dump %t/Utils.swiftmodule | %FileCheck %s --check-prefix=CHECK-ON /// Override -experimental-skip-non-inlinable-function-bodies-without-types with warning @@ -57,7 +57,7 @@ // RUN: -experimental-allow-non-resilient-access \ // RUN: -emit-module -emit-module-path %t/Utils.swiftmodule \ // RUN: 2>&1 | %FileCheck %s --check-prefix=CHECK-DIAG-2 -// CHECK-DIAG-2: warning: ignoring -experimental-skip-non-inlinable-function-bodies-without-types (overriden by -experimental-allow-non-resilient-access) +// CHECK-DIAG-2: warning: ignoring -experimental-skip-non-inlinable-function-bodies-without-types (overridden by -experimental-allow-non-resilient-access) // RUN: llvm-bcanalyzer --dump %t/Utils.swiftmodule | %FileCheck %s --check-prefix=CHECK-ON /// Override -experimental-skip-non-inlinable-function-bodies with warning @@ -70,7 +70,7 @@ // RUN: -experimental-allow-non-resilient-access \ // RUN: -emit-module -emit-module-path %t/Utils.swiftmodule \ // RUN: 2>&1 | %FileCheck %s --check-prefix=CHECK-DIAG-3 -// CHECK-DIAG-3: warning: ignoring -experimental-skip-non-inlinable-function-bodies (overriden by -experimental-allow-non-resilient-access) +// CHECK-DIAG-3: warning: ignoring -experimental-skip-non-inlinable-function-bodies (overridden by -experimental-allow-non-resilient-access) // RUN: llvm-bcanalyzer --dump %t/Utils.swiftmodule | %FileCheck %s --check-prefix=CHECK-ON /// Override -experimental-skip-all-function-bodies with warning @@ -83,7 +83,7 @@ // RUN: -experimental-allow-non-resilient-access \ // RUN: -emit-module -emit-module-path %t/Utils.swiftmodule \ // RUN: 2>&1 | %FileCheck %s --check-prefix=CHECK-DIAG-4 -// CHECK-DIAG-4: warning: ignoring -experimental-skip-all-function-bodies (overriden by -experimental-allow-non-resilient-access) +// CHECK-DIAG-4: warning: ignoring -experimental-skip-all-function-bodies (overridden by -experimental-allow-non-resilient-access) // RUN: llvm-bcanalyzer --dump %t/Utils.swiftmodule | %FileCheck %s --check-prefix=CHECK-ON /// Override -experimental-lazy-typecheck with warning @@ -96,7 +96,7 @@ // RUN: -experimental-allow-non-resilient-access \ // RUN: -emit-module -emit-module-path %t/Utils.swiftmodule \ // RUN: 2>&1 | %FileCheck %s --check-prefix=CHECK-DIAG-5 -// CHECK-DIAG-5: warning: ignoring -experimental-lazy-typecheck (overriden by -experimental-allow-non-resilient-access) +// CHECK-DIAG-5: warning: ignoring -experimental-lazy-typecheck (overridden by -experimental-allow-non-resilient-access) // RUN: llvm-bcanalyzer --dump %t/Utils.swiftmodule | %FileCheck %s --check-prefix=CHECK-ON /// Override -tbd-is-installapi with warning @@ -109,7 +109,7 @@ // RUN: -experimental-allow-non-resilient-access \ // RUN: -emit-module -emit-module-path %t/Utils.swiftmodule \ // RUN: 2>&1 | %FileCheck %s --check-prefix=CHECK-DIAG-TBD -// CHECK-DIAG-TBD: warning: ignoring -tbd-is-installapi (overriden by -experimental-allow-non-resilient-access) +// CHECK-DIAG-TBD: warning: ignoring -tbd-is-installapi (overridden by -experimental-allow-non-resilient-access) // RUN: llvm-bcanalyzer --dump %t/Utils.swiftmodule | %FileCheck %s --check-prefix=CHECK-ON /// Build Utils interface files. @@ -123,14 +123,14 @@ // RUN: -emit-private-module-interface-path %t/Utils.private.swiftinterface \ // RUN: -emit-package-module-interface-path %t/Utils.package.swiftinterface -/// If built from interface, non-resilient access option is ignored with a waring. +/// If built from interface, non-resilient access option is ignored with a warning. // RUN: %target-swift-frontend -compile-module-from-interface \ // RUN: -module-name Utils \ // RUN: -package-name mpkg \ // RUN: -experimental-allow-non-resilient-access \ // RUN: %t/Utils.package.swiftinterface -o %t/Utils.swiftmodule \ // RUN: 2>&1 | %FileCheck %s --check-prefix=CHECK-DIAG-INTERFACE -// CHECK-DIAG-INTERFACE: warning: ignoring -experimental-allow-non-resilient-access (overriden by -compile-module-from-interface or -typecheck-module-from-interface) +// CHECK-DIAG-INTERFACE: warning: ignoring -experimental-allow-non-resilient-access (overridden by -compile-module-from-interface or -typecheck-module-from-interface) // RUN: llvm-bcanalyzer --dump %t/Utils.swiftmodule | %FileCheck %s --check-prefix=CHECK-OFF // CHECK-OFF-NOT: ALLOW_NON_RESILIENT_ACCESS diff --git a/test/SILOptimizer/abcopt_large_cfg.sil.gyb b/test/SILOptimizer/abcopt_large_cfg.sil.gyb index a2d2db24ef130..50cf95d51b0f5 100644 --- a/test/SILOptimizer/abcopt_large_cfg.sil.gyb +++ b/test/SILOptimizer/abcopt_large_cfg.sil.gyb @@ -32,7 +32,7 @@ bb0(%0: $Int32, %1: $Bool, %2: @owned $ArrayInt): // CHECK-LABEL: sil [ossa] @test_very_deep_domtree : -// Currently there is nothing ot check here, because the optimization bails in +// Currently there is nothing to check here, because the optimization bails in // this case. // In future we might check that even with a deep domtree it can hoist the check. diff --git a/test/SILOptimizer/access_enforcement_selection.sil b/test/SILOptimizer/access_enforcement_selection.sil index a9654b7c126af..f0aa02766dde4 100644 --- a/test/SILOptimizer/access_enforcement_selection.sil +++ b/test/SILOptimizer/access_enforcement_selection.sil @@ -67,7 +67,7 @@ sil [ossa] @takesInoutAndClosure : $@convention(thin) (@inout Builtin.Int64, @gu sil [ossa] @closureCapturingByStorageAddress : $@convention(thin) (@inout_aliasable Builtin.Int64) -> () // Test static enforcement of box addresses that escape via closure -// partial_applys. +// partial_applies. // application. // CHECK-LABEL: sil hidden [ossa] @escapeAsArgumentToPartialApply : $@convention(thin) () -> () { // CHECK: bb0: @@ -99,7 +99,7 @@ bb0: return %9 : $() } -sil [dynamically_replacable] [ossa] @closureCapturingByStorageAddress2 : $@convention(thin) (@inout_aliasable Builtin.Int64) -> () +sil [dynamically_replaceable] [ossa] @closureCapturingByStorageAddress2 : $@convention(thin) (@inout_aliasable Builtin.Int64) -> () // Make sure that we handle dynamic_function_ref. sil hidden [ossa] @escapeAsArgumentToPartialApplyDynamic : $@convention(thin) () -> () { diff --git a/test/SILOptimizer/access_storage_analysis.sil b/test/SILOptimizer/access_storage_analysis.sil index c02d2827e6ac7..2894ce1532c22 100644 --- a/test/SILOptimizer/access_storage_analysis.sil +++ b/test/SILOptimizer/access_storage_analysis.sil @@ -690,7 +690,7 @@ bb3(%7 : $Builtin.RawPointer): return %10 : $Int64 } -// Test storage for SIL global variable declations. +// Test storage for SIL global variable declarations. sil_global hidden @testGlobal : $Builtin.Int64 diff --git a/test/SILOptimizer/address_lowering.sil b/test/SILOptimizer/address_lowering.sil index 264cf2d8e93b6..ac28fbd15d378 100644 --- a/test/SILOptimizer/address_lowering.sil +++ b/test/SILOptimizer/address_lowering.sil @@ -1127,7 +1127,7 @@ bb0(%error_exi : @guaranteed $any Error): } // Test a chain of projections multiple nodes of which feature an opened -// archetype AND the archetype-definining instruction for the first projection +// archetype AND the archetype-defining instruction for the first projection // whose type has an opened archetype dominates all blocks but the // archetype-defining instruction for the SECOND projection does not. // diff --git a/test/SILOptimizer/address_lowering_phi.sil b/test/SILOptimizer/address_lowering_phi.sil index 77b42566272f1..c81c298f593bc 100644 --- a/test/SILOptimizer/address_lowering_phi.sil +++ b/test/SILOptimizer/address_lowering_phi.sil @@ -858,7 +858,7 @@ merge(%sp : @owned $Pair): // ^^^ ^^^ ^^^ // %s projects out of %s2's storage // ^^^ ^^^ -// %box projects out of %s's strorage +// %box projects out of %s's storage // ^^^ // %t projects out of %box's storage // There is no interference (and only one incoming phi.) @@ -911,7 +911,7 @@ exit: // ^^^ ^^^ ^^^ // %s projects out of %s2's storage // ^^^ ^^^ -// %box projects out of %s's strorage +// %box projects out of %s's storage // ^^^ // %t projects out of %box's storage // There is interference of the _def_ projection (which can only be detected by diff --git a/test/SILOptimizer/capture_propagation.sil b/test/SILOptimizer/capture_propagation.sil index b7fc978f099be..2d2e6a0347030 100644 --- a/test/SILOptimizer/capture_propagation.sil +++ b/test/SILOptimizer/capture_propagation.sil @@ -392,7 +392,7 @@ bb0(%0 : $Builtin.Int32, %1 : $Builtin.FPIEEE32, %2 : $Builtin.RawPointer, %3 : // CHECK: %[[CONVERTED:[0-9]+]] = thin_to_thick_function %[[FR]] : $@convention(thin) () -> () to $@callee_owned () -> () // CHECK-NOT: partial_apply // CHECK: apply %[[CALLEE]](%[[CONVERTED]]) : $@convention(thin) (@owned @callee_owned () -> ()) -> () -// CHECL-NOT: partial_apply +// CHECK-NOT: partial_apply // CHECK: return sil @test_generic_capture_propagation2_caller : $@convention(thin) () -> () { %0 = integer_literal $Builtin.Int32, 0 diff --git a/test/SILOptimizer/devirt_generic_witness_method.sil b/test/SILOptimizer/devirt_generic_witness_method.sil index 60d30710b13ab..f1f17a438cc87 100644 --- a/test/SILOptimizer/devirt_generic_witness_method.sil +++ b/test/SILOptimizer/devirt_generic_witness_method.sil @@ -29,7 +29,7 @@ bb0(%0 : $*Item, %1 : $Dictionary, %2 : $@thick Item.Type): return %6 : $() } -// Check that it is possible to devirtualize a partial_appy of a generic witness_method. +// Check that it is possible to devirtualize a partial_apply of a generic witness_method. // Since it is a derived class that invokes an implementation from a base class, // make sure that the resulting closure is properly converted into a required type. diff --git a/test/SILOptimizer/devirt_generic_witness_method_ownership.sil b/test/SILOptimizer/devirt_generic_witness_method_ownership.sil index 7698a917cd1ce..5c2ef88856d83 100644 --- a/test/SILOptimizer/devirt_generic_witness_method_ownership.sil +++ b/test/SILOptimizer/devirt_generic_witness_method_ownership.sil @@ -29,7 +29,7 @@ bb0(%0 : $*Item, %1 : @owned $Dictionary, %2 : $@thick Item.Type): return %6 : $() } -// Check that it is possible to devirtualize a partial_appy of a generic witness_method. +// Check that it is possible to devirtualize a partial_apply of a generic witness_method. // Since it is a derived class that invokes an implementation from a base class, // make sure that the resulting closure is properly converted into a required type. diff --git a/test/SILOptimizer/dictionary_lookup_with_default.swift b/test/SILOptimizer/dictionary_lookup_with_default.swift index a2032682fe9d9..93d3e395ccd11 100644 --- a/test/SILOptimizer/dictionary_lookup_with_default.swift +++ b/test/SILOptimizer/dictionary_lookup_with_default.swift @@ -9,7 +9,7 @@ public struct S { mutating func doSomething() { } } -// Check that all partial_applys can be optimized away so that no closure context needs to be allocated. +// Check that all partial_applies can be optimized away so that no closure context needs to be allocated. // CHECK-LABEL: sil @$s4test6testit_1xySDySiAA1SVGz_SitF : // CHECK-NOT: partial_apply diff --git a/test/SILOptimizer/exclusivity_static_diagnostics.sil b/test/SILOptimizer/exclusivity_static_diagnostics.sil index c9be10afe1044..e8ab17d6bd382 100644 --- a/test/SILOptimizer/exclusivity_static_diagnostics.sil +++ b/test/SILOptimizer/exclusivity_static_diagnostics.sil @@ -1479,7 +1479,7 @@ bb0(%0 : $*TestDynamic): // This callee actually accesses different subpaths, but the caller's // diagnostic should not be able to see that. -sil private [dynamically_replacable] [ossa] @testDynamicLocal : $@convention(thin) (@inout Builtin.Int64, @inout_aliasable TestDynamic) -> () { +sil private [dynamically_replaceable] [ossa] @testDynamicLocal : $@convention(thin) (@inout Builtin.Int64, @inout_aliasable TestDynamic) -> () { bb0(%0 : $*Builtin.Int64, %1 : $*TestDynamic): %literal = integer_literal $Builtin.Int64, 1 %access1 = begin_access [modify] [unknown] %0 : $*Builtin.Int64 diff --git a/test/SILOptimizer/forwarding_utils.sil b/test/SILOptimizer/forwarding_utils.sil index aecb0a26f3587..47e96d5ef0310 100644 --- a/test/SILOptimizer/forwarding_utils.sil +++ b/test/SILOptimizer/forwarding_utils.sil @@ -51,7 +51,7 @@ entry(%0 : @owned $C, %1 : @owned $C): return %void : $() } -// In opaque SIL values mode, handle the tuple_pack_extract forwaded operand. +// In opaque SIL values mode, handle the tuple_pack_extract forwarded operand. // // CHECK-LABEL: begin running test 1 of 2 on tuplePackExtractTest: forwarding_def_use_test with: %tuple // CHECK: USE: operand #0 of end_borrow %1 : $(repeat each T) @@ -79,7 +79,7 @@ entry(%tuple_addr : $*(repeat each T)): return %retval : $() } -// Handle forwaded guaranteed values. +// Handle forwarded guaranteed values. // // CHECK-LABEL: begin running test 1 of 2 on forwardingGuaranteedTest: forwarding_def_use_test with: %0 // CHECK: USE: dead value: %5 = tuple (%3 : $C, %4 : $C) @@ -211,7 +211,7 @@ bbExit: return %void : $() } -// Chain of owned values. Needs to resolve in a resonable amount of time. +// Chain of owned values. Needs to resolve in a reasonable amount of time. // // CHECK-LABEL: begin running test 1 of 2 on forwardingTuplesTest: forwarding_def_use_test with: %0 // CHECK: USE: operand #0 of destroy_value %{{.*}} : $(C, C) diff --git a/test/SILOptimizer/function_uses.sil b/test/SILOptimizer/function_uses.sil index 2885e7855cde9..39ccae397cbfa 100644 --- a/test/SILOptimizer/function_uses.sil +++ b/test/SILOptimizer/function_uses.sil @@ -27,7 +27,7 @@ sil @public_func : $@convention(thin) () -> () // CHECK-NEXT: %1 = dynamic_function_ref @internal_func // CHECK-NEXT: ] // CHECK-NEXT: End function internal_func -sil hidden [dynamically_replacable] @internal_func : $@convention(thin) () -> () { +sil hidden [dynamically_replaceable] @internal_func : $@convention(thin) () -> () { bb0: %0 = function_ref @public_func : $@convention(thin) () -> () %1 = function_ref @public_func : $@convention(thin) () -> () diff --git a/test/SILOptimizer/hoist_destroy_addr.sil b/test/SILOptimizer/hoist_destroy_addr.sil index 340b9e824ea67..8dc95dfa0435d 100644 --- a/test/SILOptimizer/hoist_destroy_addr.sil +++ b/test/SILOptimizer/hoist_destroy_addr.sil @@ -590,7 +590,7 @@ entry(%in_addr : $*X): return %retval : $X } -// If a begin_apply uses the address, the end_appy and abort_apply should be +// If a begin_apply uses the address, the end_apply and abort_apply should be // regarded as uses too. Don't hoist over them. // // CHECK-LABEL: sil [ossa] @nohoist_over_end_apply_use : {{.*}} { diff --git a/test/SILOptimizer/init_accessors.swift b/test/SILOptimizer/init_accessors.swift index 43ddbff761410..708cb7ff08c3c 100644 --- a/test/SILOptimizer/init_accessors.swift +++ b/test/SILOptimizer/init_accessors.swift @@ -185,7 +185,7 @@ struct TestNoInitAndInit { var pointX: Int { @storageRestrictions(accesses: x) - init(initalValue) { + init(initialValue) { } get { x } diff --git a/test/SILOptimizer/let-property-lowering.swift b/test/SILOptimizer/let-property-lowering.swift index 5d1b8056d218c..57b5aabc79fac 100644 --- a/test/SILOptimizer/let-property-lowering.swift +++ b/test/SILOptimizer/let-property-lowering.swift @@ -68,7 +68,7 @@ class C { // CHECK: store {{.*}} to [[A]] : $*Int // CHECK: [[EI:%.*]] = end_init_let_ref %1 // CHECK: bb1: - // CHEKC: ref_element_addr [[EI]] : $C, #C.b + // CHECK: ref_element_addr [[EI]] : $C, #C.b // CHECK: return [[EI]] // CHECK: } // end sil function '$s4test1CC1cACSb_tcfc' init(c: Bool) { diff --git a/test/SILOptimizer/licm.sil b/test/SILOptimizer/licm.sil index a6911d5169180..83aacd7901a34 100644 --- a/test/SILOptimizer/licm.sil +++ b/test/SILOptimizer/licm.sil @@ -226,7 +226,7 @@ public protocol P : class { } // Check that LICM does not hoist a metatype instruction before -// the open_existential instruction which creates the archtype, +// the open_existential instruction which creates the archetype, // because this would break the dominance relation between them. // CHECK-LABEL: sil @dont_hoist_metatype // CHECK-NOT: metatype @@ -1096,7 +1096,7 @@ bb3: } // Test multiple stores to disjoint access paths with a single load -// that spans both of them. The load should be split and hosited and +// that spans both of them. The load should be split and hoisted and // and the stores be sunk. // testCommonSplitLoad // CHECK-LABEL: sil shared @testCommonSplitLoad : $@convention(method) (Int64, Builtin.RawPointer) -> (Int64, Int64, Int64) { diff --git a/test/SILOptimizer/moveonly_addresschecker.sil b/test/SILOptimizer/moveonly_addresschecker.sil index 1b969d62a9795..d7481d97bdff4 100644 --- a/test/SILOptimizer/moveonly_addresschecker.sil +++ b/test/SILOptimizer/moveonly_addresschecker.sil @@ -616,7 +616,7 @@ sil @end_addr_see_addr : $@convention(thin) (@in M, @in_guaranteed M) -> () /// A single instruction, apply @end_addr_see_addr, consumes one field and /// borrows another. -/// Varify that the consumed value isn't destroyed twice and that the borrowed +/// Verify that the consumed value isn't destroyed twice and that the borrowed /// value isn't destroyed before it's used. /// /// Note: This test case doesn't have valid SIL (#M2.s1 is consumed twice), but diff --git a/test/SILOptimizer/opaque_values_Onone.swift b/test/SILOptimizer/opaque_values_Onone.swift index dc13b6883a414..f79c20b7a4436 100644 --- a/test/SILOptimizer/opaque_values_Onone.swift +++ b/test/SILOptimizer/opaque_values_Onone.swift @@ -71,8 +71,8 @@ func doit(_ f: () -> T) -> T { // CHECK: [[OUTPUT_TUPLE_ADDR:%[^,]+]] = alloc_stack $(Value, Value) // CHECK: [[DUPLICATE_CLOSURE:%[^,]+]] = function_ref @$s19opaque_values_Onone10duplicate15valuex_xtx_tlFx_xtyXEfU_ // CHECK: [[DUPLICATE_INSTANCE_CLOSURE:%[^,]+]] = partial_apply [callee_guaranteed] [on_stack] [[DUPLICATE_CLOSURE]]([[INSTANCE_ADDR_IN]]) -// CHECK: [[DEPENDENDENCY:%[^,]+]] = mark_dependence [nonescaping] [[DUPLICATE_INSTANCE_CLOSURE]] : $@noescape @callee_guaranteed () -> @out (Value, Value) on [[INSTANCE_ADDR_IN]] : $*Value -// CHECK: [[CONVERTED:%[^,]+]] = convert_function [[DEPENDENDENCY]] +// CHECK: [[DEPENDENCY:%[^,]+]] = mark_dependence [nonescaping] [[DUPLICATE_INSTANCE_CLOSURE]] : $@noescape @callee_guaranteed () -> @out (Value, Value) on [[INSTANCE_ADDR_IN]] : $*Value +// CHECK: [[CONVERTED:%[^,]+]] = convert_function [[DEPENDENCY]] // CHECK: apply {{%[^,]+}}<(Value, Value)>([[OUTPUT_TUPLE_ADDR]], [[CONVERTED]]) // CHECK-LABEL: } // end sil function 'duplicate1' // CHECK-LABEL: sil private @$s19opaque_values_Onone10duplicate15valuex_xtx_tlFx_xtyXEfU_ : {{.*}} { @@ -93,8 +93,8 @@ func duplicate1(value: Value) -> (Value, Value) { // CHECK: [[OUTPUT_TUPLE_ADDR:%[^,]+]] = alloc_stack $(one: Value, two: Value) // CHECK: [[DUPLICATE_CLOSURE:%[^,]+]] = function_ref @$s19opaque_values_Onone10duplicate25valuex3one_x3twotx_tlFxAD_xAEtyXEfU_ // CHECK: [[DUPLICATE_INSTANCE_CLOSURE:%[^,]+]] = partial_apply [callee_guaranteed] [on_stack] [[DUPLICATE_CLOSURE]]([[INSTANCE_ADDR_IN]]) -// CHECK: [[DEPENDENDENCY:%[^,]+]] = mark_dependence [nonescaping] [[DUPLICATE_INSTANCE_CLOSURE]] : $@noescape @callee_guaranteed () -> @out (one: Value, two: Value) on [[INSTANCE_ADDR_IN]] : $*Value -// CHECK: [[CONVERTED:%[^,]+]] = convert_function [[DEPENDENDENCY]] +// CHECK: [[DEPENDENCY:%[^,]+]] = mark_dependence [nonescaping] [[DUPLICATE_INSTANCE_CLOSURE]] : $@noescape @callee_guaranteed () -> @out (one: Value, two: Value) on [[INSTANCE_ADDR_IN]] : $*Value +// CHECK: [[CONVERTED:%[^,]+]] = convert_function [[DEPENDENCY]] // CHECK: apply {{%[^,]+}}<(one: Value, two: Value)>([[OUTPUT_TUPLE_ADDR]], [[CONVERTED]]) // CHECK-LABEL: } // end sil function 'duplicate2' // CHECK-LABEL: sil private @$s19opaque_values_Onone10duplicate25valuex3one_x3twotx_tlFxAD_xAEtyXEfU_ : {{.*}} { diff --git a/test/SILOptimizer/side_effects.sil b/test/SILOptimizer/side_effects.sil index 561e2d58ec677..6592c505878b4 100644 --- a/test/SILOptimizer/side_effects.sil +++ b/test/SILOptimizer/side_effects.sil @@ -447,12 +447,12 @@ bb0(%0 : @owned $SP): return %0 : $SP } -// CHECK-LABEL: sil [ossa] @store_destoys +// CHECK-LABEL: sil [ossa] @store_destroys // CHECK-NEXT: [%0: read v**, write v**, destroy v**] // CHECK-NEXT: [%1: write c*.v**, copy c*.v**] // CHECK-NEXT: [global: write,copy] // CHECK-NEXT: {{^[^[]}} -sil [ossa] @store_destoys : $@convention(thin) (@inout X, @owned X) -> () { +sil [ossa] @store_destroys : $@convention(thin) (@inout X, @owned X) -> () { bb0(%0 : $*X, %1 : @owned $X): store %1 to [assign] %0 : $*X %2 = tuple () @@ -482,24 +482,24 @@ bb0(%0 : $*X, %1 : @owned $X): return %2 : $() } -// CHECK-LABEL: sil [ossa] @copy_destoys +// CHECK-LABEL: sil [ossa] @copy_destroys // CHECK-NEXT: [%0: read v**, write v**, destroy v**] // CHECK-NEXT: [%1: read v**, copy v**] // CHECK-NEXT: [global: write,copy] // CHECK-NEXT: {{^[^[]}} -sil [ossa] @copy_destoys : $@convention(thin) (@inout X, @in_guaranteed X) -> () { +sil [ossa] @copy_destroys : $@convention(thin) (@inout X, @in_guaranteed X) -> () { bb0(%0 : $*X, %1 : $*X): copy_addr %1 to %0 : $*X %2 = tuple () return %2 : $() } -// CHECK-LABEL: sil [ossa] @copy_doesnt_destoy +// CHECK-LABEL: sil [ossa] @copy_doesnt_destroy // CHECK-NEXT: [%0: write v**] // CHECK-NEXT: [%1: read v**, copy v**] // CHECK-NEXT: [global: ] // CHECK-NEXT: {{^[^[]}} -sil [ossa] @copy_doesnt_destoy : $@convention(thin) (@in_guaranteed X) -> @out X { +sil [ossa] @copy_doesnt_destroy : $@convention(thin) (@in_guaranteed X) -> @out X { bb0(%0 : $*X, %1 : $*X): copy_addr %1 to [init] %0 : $*X %2 = tuple () diff --git a/test/SILOptimizer/sil_combine_concrete_existential.sil b/test/SILOptimizer/sil_combine_concrete_existential.sil index c9bcd18c8f024..dc306569c6278 100644 --- a/test/SILOptimizer/sil_combine_concrete_existential.sil +++ b/test/SILOptimizer/sil_combine_concrete_existential.sil @@ -660,7 +660,7 @@ extension MyObject : SubscriptionViewControllerDelegate { } sil @callee2 : $@convention(thin) <τ_0_0 where τ_0_0 : SubscriptionViewControllerDelegate> (@in τ_0_0, @thick SubscriptionViewControllerBuilder.Type) -> @owned SubscriptionViewControllerBuilder -// CHECK: sil @test_opend_archetype_concrete_conformance_substitution : $@convention(method) (@guaranteed any ResourceKitProtocol, @guaranteed ViewController) -> () { +// CHECK: sil @test_opened_archetype_concrete_conformance_substitution : $@convention(method) (@guaranteed any ResourceKitProtocol, @guaranteed ViewController) -> () { // CHECK: bb0([[ARG:%.*]] : $any ResourceKitProtocol, [[ARG2:%.*]] : $ViewController): // CHECK: [[T1:%.*]] = metatype $@thick SubscriptionViewControllerBuilder.Type // CHECK: [[T2:%.*]] = open_existential_ref [[ARG]] : $any ResourceKitProtocol to $@opened("E4D92D2A-8893-11EA-9C89-ACDE48001122", any ResourceKitProtocol) Self @@ -674,7 +674,7 @@ sil @callee2 : $@convention(thin) <τ_0_0 where τ_0_0 : SubscriptionViewControl // CHECK: (normal_conformance type="MyObject" protocol="SubscriptionViewControllerDelegate" // CHECK: apply [[T5]]<@opened("E4D92D2A-8893-11EA-9C89-ACDE48001122", any ResourceKitProtocol) Self>([[T6]], [[T1]]) -sil @test_opend_archetype_concrete_conformance_substitution : $@convention(method) (@guaranteed ResourceKitProtocol, @guaranteed ViewController) -> () { +sil @test_opened_archetype_concrete_conformance_substitution : $@convention(method) (@guaranteed ResourceKitProtocol, @guaranteed ViewController) -> () { bb0(%0 : $ResourceKitProtocol, %1 : $ViewController): %4 = metatype $@thick SubscriptionViewControllerBuilder.Type %5 = open_existential_ref %0 : $ResourceKitProtocol to $@opened("E4D92D2A-8893-11EA-9C89-ACDE48001122", ResourceKitProtocol) Self diff --git a/test/SILOptimizer/simplify_begin_borrow.sil b/test/SILOptimizer/simplify_begin_borrow.sil index fd41fc0c393f6..a2ccb3b861030 100644 --- a/test/SILOptimizer/simplify_begin_borrow.sil +++ b/test/SILOptimizer/simplify_begin_borrow.sil @@ -341,10 +341,10 @@ bb0(%0 : @owned $C): return %0 : $C } -// CHECK-LABEL: sil [ossa] @dont_replace_copy_in_differnt_bb : +// CHECK-LABEL: sil [ossa] @dont_replace_copy_in_different_bb : // CHECK: begin_borrow -// CHECK: } // end sil function 'dont_replace_copy_in_differnt_bb' -sil [ossa] @dont_replace_copy_in_differnt_bb : $@convention(thin) (@owned C) -> @owned C { +// CHECK: } // end sil function 'dont_replace_copy_in_different_bb' +sil [ossa] @dont_replace_copy_in_different_bb : $@convention(thin) (@owned C) -> @owned C { bb0(%0 : @owned $C): %1 = begin_borrow %0 : $C cond_br undef, bb1, bb2 diff --git a/test/SILOptimizer/simplify_cfg_checkcast.sil b/test/SILOptimizer/simplify_cfg_checkcast.sil index 9ed123989f104..35894aeb33931 100644 --- a/test/SILOptimizer/simplify_cfg_checkcast.sil +++ b/test/SILOptimizer/simplify_cfg_checkcast.sil @@ -538,7 +538,7 @@ bb7: // Introduce a copy for the new lifetime. // Simplify down to a single diamond. // -// TODO: Simplify some of the obvisouly dead copy/destroy/borrows +// TODO: Simplify some of the obviously dead copy/destroy/borrows // on-the-fly after each simplify-cfg. Possible using CanonicalizeOSSALifetime. // // TODO-CHECK-LABEL: sil [ossa] @redundant_checked_cast_br_rauw_guaranteed_to_owned_merge : $@convention(method) (@owned Base) -> () { diff --git a/test/SILOptimizer/simplify_cfg_ossa_jump_threading.sil b/test/SILOptimizer/simplify_cfg_ossa_jump_threading.sil index 658fb74890cf2..7a7d031914b1c 100644 --- a/test/SILOptimizer/simplify_cfg_ossa_jump_threading.sil +++ b/test/SILOptimizer/simplify_cfg_ossa_jump_threading.sil @@ -183,7 +183,7 @@ bb9: // not know how to allocate for multiple partial applies. // // rdar://119768691 (OwnershipModelEliminator triggers assertion when -// lowering certain [on_stack] partial_applys in certain +// lowering certain [on_stack] partial_applies in certain // circumstances) sil @test_simple_jump_thread_clone_partial_apply_closure : $@convention(thin) (@inout_aliasable Klass) -> () @@ -194,7 +194,7 @@ sil @test_simple_jump_thread_clone_partial_apply_take_closure : $@convention(thi // CHECK: partial_apply [callee_guaranteed] // CHECK-NEXT: mark_dependence // CHECK-NEXT: begin_borrow [lexical] -// CHECK-NOT: partial_apply [callee_guaranted] +// CHECK-NOT: partial_apply [callee_guaranteed] // CHECK-NOT: begin_borrow // CHECK-LABEL: } // end sil function 'test_simple_jump_thread_clone_partial_apply' sil [ossa] @test_simple_jump_thread_clone_partial_apply : $@convention(thin) (@owned Klass, @inout Klass) -> Builtin.Int1 { diff --git a/test/SILOptimizer/specialize_opaque_type_archetypes.swift b/test/SILOptimizer/specialize_opaque_type_archetypes.swift index 89b874a2ea723..7510b7174cea9 100644 --- a/test/SILOptimizer/specialize_opaque_type_archetypes.swift +++ b/test/SILOptimizer/specialize_opaque_type_archetypes.swift @@ -364,10 +364,10 @@ public func testResilientInlinableProperty2() { } // CHECK-LABEL: sil @$s1A035testResilientInlinablePropertyCallsbC0yyF : $@convention(thin) () -> () { -// CHECK: [[CONTAINTER:%.*]] = alloc_stack [var_decl] $ResilientContainer2 +// CHECK: [[CONTAINER:%.*]] = alloc_stack [var_decl] $ResilientContainer2 // CHECK: [[RES:%.*]] = alloc_stack $Int64 // CHECK: [[FUN:%.*]] = function_ref @$s9External319ResilientContainer2V023inlineablePropertyCallsB10InlineableQrvg -// CHECK: apply [[FUN]]([[RES]], [[CONTAINTER]]) +// CHECK: apply [[FUN]]([[RES]], [[CONTAINER]]) public func testResilientInlinablePropertyCallsResilientInlinable() { let r = ResilientContainer2() useP(r.inlineablePropertyCallsResilientInlineable.myValue3()) diff --git a/test/SILOptimizer/stack_protection.swift b/test/SILOptimizer/stack_protection.swift index 422496c6f67bd..4c5d08becc0ca 100644 --- a/test/SILOptimizer/stack_protection.swift +++ b/test/SILOptimizer/stack_protection.swift @@ -36,10 +36,10 @@ public func overflowWithUnsafeBytes() { } } -// CHECK-LABEL: sil [stack_protection] @$s4test31owerflowWithUnsafeBorrowedBytes5valueySi_tF +// CHECK-LABEL: sil [stack_protection] @$s4test31overflowWithUnsafeBorrowedBytes5valueySi_tF // CHECK-NOT: copy_addr -// CHECK: } // end sil function '$s4test31owerflowWithUnsafeBorrowedBytes5valueySi_tF' -public func owerflowWithUnsafeBorrowedBytes(value: Int) { +// CHECK: } // end sil function '$s4test31overflowWithUnsafeBorrowedBytes5valueySi_tF' +public func overflowWithUnsafeBorrowedBytes(value: Int) { withUnsafeBytes(of: value) { potentiallyBadCFunction($0.bindMemory(to: Int.self).baseAddress!) } diff --git a/test/SPI/accidental-reexport.swift b/test/SPI/accidental-reexport.swift index f7fe43bda198d..15b9dd9fe5f40 100644 --- a/test/SPI/accidental-reexport.swift +++ b/test/SPI/accidental-reexport.swift @@ -4,13 +4,13 @@ // RUN: %empty-directory(%t) // RUN: split-file %s %t -// RUN: %target-swift-frontend -emit-module %t/Overlayed.swift -I %t -o %t +// RUN: %target-swift-frontend -emit-module %t/Overlaid.swift -I %t -o %t // RUN: %target-swift-frontend -typecheck -verify %t/Client.swift -I %t // RUN: %target-swift-frontend -typecheck -verify %t/LowerClient.swift -I %t //--- module.modulemap -module Overlayed { - header "Overlayed.h" +module Overlaid { + header "Overlaid.h" } module Middle { @@ -23,9 +23,9 @@ module LowerMiddle { export * } -//--- Overlayed.h -//--- Overlayed.swift -@_exported import Overlayed +//--- Overlaid.h +//--- Overlaid.swift +@_exported import Overlaid public func funcPublic() {} @@ -33,7 +33,7 @@ public func funcPublic() {} public func funcSPI() {} //--- Middle.h -#include +#include //--- LowerMiddle.h #include diff --git a/test/ScanDependencies/optional_deps_of_binary_testable_imports.swift b/test/ScanDependencies/optional_deps_of_binary_testable_imports.swift index f3642cf19c8aa..0eda73f58e543 100644 --- a/test/ScanDependencies/optional_deps_of_binary_testable_imports.swift +++ b/test/ScanDependencies/optional_deps_of_binary_testable_imports.swift @@ -16,6 +16,6 @@ // The dependency of `Foo` on `A` will not be visible if the scanner simply scans the textual interface // of `Foo`. So we verify that for a `@testable` import, the scanner also opens up the adjacent binary module and -// attemtps to resolve optional dependencies contained within. +// attempts to resolve optional dependencies contained within. // // CHECK: "swift": "A" diff --git a/test/ScanDependencies/optional_deps_of_testable_imports.swift b/test/ScanDependencies/optional_deps_of_testable_imports.swift index 2851b9200ed34..98c331f0e3b2c 100644 --- a/test/ScanDependencies/optional_deps_of_testable_imports.swift +++ b/test/ScanDependencies/optional_deps_of_testable_imports.swift @@ -16,6 +16,6 @@ // The dependency of `Foo` on `A` will not be visible if the scanner simply scans the textual interface // of `Foo`. So we verify that for a `@testable` import, the scanner also opens up the adjacent binary module and -// attemtps to resolve optional dependencies contained within. +// attempts to resolve optional dependencies contained within. // // CHECK: "swift": "A" diff --git a/test/ScanDependencies/optional_transitive_dep_load_fail.swift b/test/ScanDependencies/optional_transitive_dep_load_fail.swift index 6b5ccbb2df19a..698ae416944e9 100644 --- a/test/ScanDependencies/optional_transitive_dep_load_fail.swift +++ b/test/ScanDependencies/optional_transitive_dep_load_fail.swift @@ -37,7 +37,7 @@ // Step 1: build Foo Swift module // RUN: %target-swift-frontend -emit-module %t/Foo.swift -emit-module-path %t/Foo.swiftmodule/%target-swiftmodule-name -module-name Foo -emit-module-interface-path %t/Foo.swiftmodule/%target-swiftinterface-name -enable-library-evolution -I %S/Inputs/CHeaders -I %S/Inputs/Swift -enable-testing -swift-version 5 -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import -// Step 2: scan dependencies and ensure the transitive dependency on "A" is misssing +// Step 2: scan dependencies and ensure the transitive dependency on "A" is missing // RUN: %target-swift-frontend -scan-dependencies %s -o %t/deps.json -I %t -sdk %t -prebuilt-module-cache-path %t/clang-module-cache // RUN: %validate-json %t/deps.json | %FileCheck -check-prefix CHECK_SCAN %s // CHECK_SCAN-NOT: "swift": "A" diff --git a/test/Sema/accessibility.swift b/test/Sema/accessibility.swift index 183d39d2856e8..ee5546f82b809 100644 --- a/test/Sema/accessibility.swift +++ b/test/Sema/accessibility.swift @@ -955,7 +955,7 @@ package enum PackageGenericEnumT { // expected-error {{generic case A } -/// Test setters with less accss level +/// Test setters with less access level public protocol PublicMutationOperations { var size: Int { get set } subscript (_: Int) -> Int { get set } @@ -1482,19 +1482,19 @@ public class DerivedFromInternalConcreteGenericCompositionPkg : InternalConcrete } package typealias PackageConcreteGenericComposition = PublicGenericClass & PublicProto // expected-note {{declared here}} -public class DerivedFromPacakgeConcreteGenericComposition : PackageConcreteGenericComposition { // expected-error {{class cannot be declared public because its superclass is package}} +public class DerivedFromPackageConcreteGenericComposition : PackageConcreteGenericComposition { // expected-error {{class cannot be declared public because its superclass is package}} public func publicReq() {} } package typealias PackageConcreteGenericCompositionStr = PackageGenericClass & PackageProto // expected-note {{declared here}} -public class DerivedFromPacakgeConcreteGenericComposition2 : PackageConcreteGenericCompositionStr { // expected-error {{class cannot be declared public because its superclass is package}} +public class DerivedFromPackageConcreteGenericComposition2 : PackageConcreteGenericCompositionStr { // expected-error {{class cannot be declared public because its superclass is package}} public func packageReq() {} } -package class DerivedFromPacakgeConcreteGenericComposition3 : PackageConcreteGenericCompositionStr { // no-warning +package class DerivedFromPackageConcreteGenericComposition3 : PackageConcreteGenericCompositionStr { // no-warning public func packageReq() {} } -internal class DerivedFromPacakgeConcreteGenericComposition4 : PackageConcreteGenericCompositionStr { // no-warning +internal class DerivedFromPackageConcreteGenericComposition4 : PackageConcreteGenericCompositionStr { // no-warning public func packageReq() {} } diff --git a/test/Sema/availability_versions.swift b/test/Sema/availability_versions.swift index 79cbbad4a4cf4..2fee710cf85c5 100644 --- a/test/Sema/availability_versions.swift +++ b/test/Sema/availability_versions.swift @@ -841,7 +841,7 @@ class SubWithLimitedMemberAvailability : SuperWithAlwaysAvailableMembers { } @available(OSX, introduced: 10.51) -class SubWithLimitedAvailablility : SuperWithAlwaysAvailableMembers { +class SubWithLimitedAvailability : SuperWithAlwaysAvailableMembers { override func shouldAlwaysBeAvailableMethod() {} override var shouldAlwaysBeAvailableProperty: Int { diff --git a/test/Sema/availability_versions_objc_api.swift b/test/Sema/availability_versions_objc_api.swift index 777573c19a014..18ee8cbc5f891 100644 --- a/test/Sema/availability_versions_objc_api.swift +++ b/test/Sema/availability_versions_objc_api.swift @@ -40,7 +40,7 @@ func functionWithObjCParam(o: NSAvailableOn10_51) { // expected-error {{'NSAvail // expected-note@-1 {{add @available attribute to enclosing global function}} } -class ClassExtendingUnvailableClass : NSAvailableOn10_51 { // expected-error {{'NSAvailableOn10_51' is only available in macOS 10.51 or newer}} +class ClassExtendingUnavailableClass : NSAvailableOn10_51 { // expected-error {{'NSAvailableOn10_51' is only available in macOS 10.51 or newer}} // expected-note@-1 {{add @available attribute to enclosing class}} } diff --git a/test/Sema/bitwise_copyable_2.swift b/test/Sema/bitwise_copyable_2.swift index b55eaebeaf006..30a5fcdaac682 100644 --- a/test/Sema/bitwise_copyable_2.swift +++ b/test/Sema/bitwise_copyable_2.swift @@ -73,7 +73,7 @@ func passS_Suppressed(_ s: S_Suppressed) { take(s) } // expected-error{{global f // expected-note@-46{{where 'T' = 'S_Suppressed'}} struct S_Suppressed_Extension {} -extension S_Suppressed_Extension : ~BitwiseCopyable {} // expected-error{{conformance to inferrable protocol 'BitwiseCopyable' cannot be suppressed in an extension}} +extension S_Suppressed_Extension : ~BitwiseCopyable {} // expected-error{{conformance to inferable protocol 'BitwiseCopyable' cannot be suppressed in an extension}} struct S_Explicit_Suppressed : BitwiseCopyable, ~BitwiseCopyable {} // expected-error{{cannot both conform to and suppress conformance to 'BitwiseCopyable'}} diff --git a/test/Sema/diag_constantness_check.swift b/test/Sema/diag_constantness_check.swift index 07a01074c9e9d..7f9a621e392a2 100644 --- a/test/Sema/diag_constantness_check.swift +++ b/test/Sema/diag_constantness_check.swift @@ -198,7 +198,7 @@ func testConstantArgumentWithConstEval(constParam: Int) { constantArgumentFunction(constantEval(constParam, true)) } -// Test parital-apply of constantArgumentFunction. +// Test partial-apply of constantArgumentFunction. @_semantics("oslog.requires_constant_arguments") func constArg2(_ x: Int) -> Int { x } diff --git a/test/Sema/implicit_lifetime_dependence.swift b/test/Sema/implicit_lifetime_dependence.swift index 574a8ffbf62e2..e608f585f1e4a 100644 --- a/test/Sema/implicit_lifetime_dependence.swift +++ b/test/Sema/implicit_lifetime_dependence.swift @@ -18,7 +18,7 @@ struct ImplicitInit2 : ~Escapable, ~Copyable { let mbv: BufferView } -struct ImplicitInit3 : ~Escapable, ~Copyable { // expected-error{{cannot infer lifetime dependence on implicit initializer, multiple parameters qualifiy as a candidate}} +struct ImplicitInit3 : ~Escapable, ~Copyable { // expected-error{{cannot infer lifetime dependence on implicit initializer, multiple parameters qualify as a candidate}} let mbv1: BufferView let mbv2: BufferView } diff --git a/test/Sema/superfluously-public-imports.swift b/test/Sema/superfluously-public-imports.swift index b6e7f137c475d..299c75f7db2b2 100644 --- a/test/Sema/superfluously-public-imports.swift +++ b/test/Sema/superfluously-public-imports.swift @@ -271,7 +271,7 @@ module ClangSubmodule { module ClangSubmoduleUnused { header "ClangSubmoduleUnused.h" - module ClangSubmoduleUnsuedSubmodule { + module ClangSubmoduleUnusedSubmodule { header "ClangSubmoduleUnusedSubmodule.h" } } @@ -302,7 +302,7 @@ struct ClangTopModuleType {}; public import ClangSimple public import ClangSimpleUnused // expected-warning {{public import of 'ClangSimpleUnused' was not used in public declarations or inlinable code}} public import ClangSubmodule.ClangSubmoduleSubmodule -public import ClangSubmoduleUnused.ClangSubmoduleUnsuedSubmodule // expected-warning {{public import of 'ClangSubmoduleUnused' was not used in public declarations or inlinable code}} +public import ClangSubmoduleUnused.ClangSubmoduleUnusedSubmodule // expected-warning {{public import of 'ClangSubmoduleUnused' was not used in public declarations or inlinable code}} // Only the top-level module is used, but we can't detect whether the submodule was used or not. public import ClangTopModule.ClangTopModuleSubmodule diff --git a/test/SourceKit/CodeComplete/complete_filter.swift b/test/SourceKit/CodeComplete/complete_filter.swift index 6b7369832ab0f..82d74549e1061 100644 --- a/test/SourceKit/CodeComplete/complete_filter.swift +++ b/test/SourceKit/CodeComplete/complete_filter.swift @@ -52,14 +52,14 @@ func foo() { // RUN: %sourcekitd-test -req=complete.open -pos=11:5 \ // RUN: -req-opts=filtertext=d %s -- %s > %t.d -// RUN: %FileCheck -check-prefix=CHECKD %s < %t.d - -// CHECKD-NOT: key.name -// CHECKD: ], -// CHECKD-NEXT: key.kind: source.lang.swift.codecomplete.group -// CHECKD-NEXT: key.name: "" -// CHECKD-NEXT: key.nextrequeststart: 0 -// CHECKD-NEXT: } +// RUN: %FileCheck -check-prefix=CHECKED %s < %t.d + +// CHECKED-NOT: key.name +// CHECKED: ], +// CHECKED-NEXT: key.kind: source.lang.swift.codecomplete.group +// CHECKED-NEXT: key.name: "" +// CHECKED-NEXT: key.nextrequeststart: 0 +// CHECKED-NEXT: } // RUN: %complete-test -tok=FOO %s | %FileCheck %s diff --git a/test/SourceKit/CodeComplete/complete_typerelation.swift b/test/SourceKit/CodeComplete/complete_typerelation.swift index 2e3856a7fce75..1c9e9e25eb427 100644 --- a/test/SourceKit/CodeComplete/complete_typerelation.swift +++ b/test/SourceKit/CodeComplete/complete_typerelation.swift @@ -5,10 +5,10 @@ enum MyEnum : MyProto { static func staticReturnVoid() {} static func staticReturnMyEnum() -> MyEnum { return .foo } - func intanceReturnVoid() {} - func intanceReturnMyEnum() -> MyEnum { return .foo } + func instanceReturnVoid() {} + func instanceReturnMyEnum() -> MyEnum { return .foo } @available(*, deprecated) - func intanceReturnVoidDeprecated() {} + func instanceReturnVoidDeprecated() {} } func testIdenticalContext() -> MyEnum { diff --git a/test/SourceKit/CodeComplete/complete_typerelation.swift.convertible.response b/test/SourceKit/CodeComplete/complete_typerelation.swift.convertible.response index 1ae93e005e752..c6ac8e71670cf 100644 --- a/test/SourceKit/CodeComplete/complete_typerelation.swift.convertible.response +++ b/test/SourceKit/CodeComplete/complete_typerelation.swift.convertible.response @@ -26,40 +26,40 @@ }, { key.kind: source.lang.swift.decl.function.method.instance, - key.name: "intanceReturnMyEnum(:)", - key.description: "intanceReturnMyEnum(self: MyEnum)", + key.name: "instanceReturnMyEnum(:)", + key.description: "instanceReturnMyEnum(self: MyEnum)", key.typename: "() -> MyEnum", key.context: source.codecompletion.context.thisclass, key.typerelation: source.codecompletion.typerelation.unrelated, key.num_bytes_to_erase: 0, - key.associated_usrs: "s:21complete_typerelation6MyEnumO013intanceReturncD0ACyF", + key.associated_usrs: "s:21complete_typerelation6MyEnumO013instanceReturncD0ACyF", key.modulename: "complete_typerelation", - key.sourcetext: "intanceReturnMyEnum(<#T##self: MyEnum##MyEnum#>)" + key.sourcetext: "instanceReturnMyEnum(<#T##self: MyEnum##MyEnum#>)" }, { key.kind: source.lang.swift.decl.function.method.instance, - key.name: "intanceReturnVoid(:)", - key.description: "intanceReturnVoid(self: MyEnum)", + key.name: "instanceReturnVoid(:)", + key.description: "instanceReturnVoid(self: MyEnum)", key.typename: "() -> Void", key.context: source.codecompletion.context.thisclass, key.typerelation: source.codecompletion.typerelation.invalid, key.num_bytes_to_erase: 0, - key.associated_usrs: "s:21complete_typerelation6MyEnumO17intanceReturnVoidyyF", + key.associated_usrs: "s:21complete_typerelation6MyEnumO17instanceReturnVoidyyF", key.modulename: "complete_typerelation", - key.sourcetext: "intanceReturnVoid(<#T##self: MyEnum##MyEnum#>)" + key.sourcetext: "instanceReturnVoid(<#T##self: MyEnum##MyEnum#>)" }, { key.kind: source.lang.swift.decl.function.method.instance, - key.name: "intanceReturnVoidDeprecated(:)", - key.description: "intanceReturnVoidDeprecated(self: MyEnum)", + key.name: "instanceReturnVoidDeprecated(:)", + key.description: "instanceReturnVoidDeprecated(self: MyEnum)", key.typename: "() -> Void", key.context: source.codecompletion.context.thisclass, key.typerelation: source.codecompletion.typerelation.invalid, key.num_bytes_to_erase: 0, key.not_recommended: 1, - key.associated_usrs: "s:21complete_typerelation6MyEnumO27intanceReturnVoidDeprecatedyyF", + key.associated_usrs: "s:21complete_typerelation6MyEnumO27instanceReturnVoidDeprecatedyyF", key.modulename: "complete_typerelation", - key.sourcetext: "intanceReturnVoidDeprecated(<#T##self: MyEnum##MyEnum#>)" + key.sourcetext: "instanceReturnVoidDeprecated(<#T##self: MyEnum##MyEnum#>)" }, { key.kind: source.lang.swift.keyword, diff --git a/test/SourceKit/CodeComplete/complete_typerelation.swift.identical.response b/test/SourceKit/CodeComplete/complete_typerelation.swift.identical.response index 1ae93e005e752..c6ac8e71670cf 100644 --- a/test/SourceKit/CodeComplete/complete_typerelation.swift.identical.response +++ b/test/SourceKit/CodeComplete/complete_typerelation.swift.identical.response @@ -26,40 +26,40 @@ }, { key.kind: source.lang.swift.decl.function.method.instance, - key.name: "intanceReturnMyEnum(:)", - key.description: "intanceReturnMyEnum(self: MyEnum)", + key.name: "instanceReturnMyEnum(:)", + key.description: "instanceReturnMyEnum(self: MyEnum)", key.typename: "() -> MyEnum", key.context: source.codecompletion.context.thisclass, key.typerelation: source.codecompletion.typerelation.unrelated, key.num_bytes_to_erase: 0, - key.associated_usrs: "s:21complete_typerelation6MyEnumO013intanceReturncD0ACyF", + key.associated_usrs: "s:21complete_typerelation6MyEnumO013instanceReturncD0ACyF", key.modulename: "complete_typerelation", - key.sourcetext: "intanceReturnMyEnum(<#T##self: MyEnum##MyEnum#>)" + key.sourcetext: "instanceReturnMyEnum(<#T##self: MyEnum##MyEnum#>)" }, { key.kind: source.lang.swift.decl.function.method.instance, - key.name: "intanceReturnVoid(:)", - key.description: "intanceReturnVoid(self: MyEnum)", + key.name: "instanceReturnVoid(:)", + key.description: "instanceReturnVoid(self: MyEnum)", key.typename: "() -> Void", key.context: source.codecompletion.context.thisclass, key.typerelation: source.codecompletion.typerelation.invalid, key.num_bytes_to_erase: 0, - key.associated_usrs: "s:21complete_typerelation6MyEnumO17intanceReturnVoidyyF", + key.associated_usrs: "s:21complete_typerelation6MyEnumO17instanceReturnVoidyyF", key.modulename: "complete_typerelation", - key.sourcetext: "intanceReturnVoid(<#T##self: MyEnum##MyEnum#>)" + key.sourcetext: "instanceReturnVoid(<#T##self: MyEnum##MyEnum#>)" }, { key.kind: source.lang.swift.decl.function.method.instance, - key.name: "intanceReturnVoidDeprecated(:)", - key.description: "intanceReturnVoidDeprecated(self: MyEnum)", + key.name: "instanceReturnVoidDeprecated(:)", + key.description: "instanceReturnVoidDeprecated(self: MyEnum)", key.typename: "() -> Void", key.context: source.codecompletion.context.thisclass, key.typerelation: source.codecompletion.typerelation.invalid, key.num_bytes_to_erase: 0, key.not_recommended: 1, - key.associated_usrs: "s:21complete_typerelation6MyEnumO27intanceReturnVoidDeprecatedyyF", + key.associated_usrs: "s:21complete_typerelation6MyEnumO27instanceReturnVoidDeprecatedyyF", key.modulename: "complete_typerelation", - key.sourcetext: "intanceReturnVoidDeprecated(<#T##self: MyEnum##MyEnum#>)" + key.sourcetext: "instanceReturnVoidDeprecated(<#T##self: MyEnum##MyEnum#>)" }, { key.kind: source.lang.swift.keyword, diff --git a/test/SourceKit/CodeExpand/code-expand-no-typecheck.swift b/test/SourceKit/CodeExpand/code-expand-no-typecheck.swift index 4a20e8d69d1ee..b1109a32254f7 100644 --- a/test/SourceKit/CodeExpand/code-expand-no-typecheck.swift +++ b/test/SourceKit/CodeExpand/code-expand-no-typecheck.swift @@ -1,6 +1,6 @@ // RUN: %sourcekitd-test -req=expand-placeholder %s | %FileCheck %s -// FIXME: Make it acccept '-debug-forbid-typecheck-prefix' and ensure no typecheck happens.' +// FIXME: Make it accept '-debug-forbid-typecheck-prefix' and ensure no typecheck happens.' protocol MyProto {} diff --git a/test/SourceKit/CursorInfo/cursor_generated_interface.swift b/test/SourceKit/CursorInfo/cursor_generated_interface.swift index 81826a37c43c8..8a6a26351fa63 100644 --- a/test/SourceKit/CursorInfo/cursor_generated_interface.swift +++ b/test/SourceKit/CursorInfo/cursor_generated_interface.swift @@ -105,13 +105,13 @@ public class CType {} @interface DType @end -// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=14:57 -print-raw-response | %FileCheck %s --check-prefix=CHECKD -// CHECKD: key.name: "DType" -// CHECKD: key.line: [[@LINE-5]] -// CHECKD: key.column: 12 -// CHECKD: key.filepath: {{.*}}LibD.h -// CHECKD: key.modulename: "LibD" -// CHECKD: key.decl_lang: source.lang.objc +// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=14:57 -print-raw-response | %FileCheck %s --check-prefix=CHECKED +// CHECKED: key.name: "DType" +// CHECKED: key.line: [[@LINE-5]] +// CHECKED: key.column: 12 +// CHECKED: key.filepath: {{.*}}LibD.h +// CHECKED: key.modulename: "LibD" +// CHECKED: key.decl_lang: source.lang.objc //--- mods/module.map module LibD { diff --git a/test/SourceKit/InterfaceGen/error_swift_module.swift b/test/SourceKit/InterfaceGen/error_swift_module.swift index 61ab865b16d58..a01b42025a6fc 100644 --- a/test/SourceKit/InterfaceGen/error_swift_module.swift +++ b/test/SourceKit/InterfaceGen/error_swift_module.swift @@ -13,9 +13,9 @@ import Transitive import WrongName -//--- LibraryNonExistant.swift +//--- LibraryNonExistent.swift -import NonExistant +import NonExistent // RUN: %target-swift-frontend -emit-module %t/Inputs/Transitive.swift -module-name Transitive -o %t/WrongName.swiftmodule // RUN: %target-swift-frontend -emit-module %t/Inputs/Transitive.swift -module-name Transitive -o %t/Transitive.swiftmodule @@ -45,14 +45,14 @@ import NonExistant // RUN: not %sourcekitd-test -req=interface-gen -module LibraryWrong -- -I %t -target %target-triple %s 2>&1 | %FileCheck --check-prefix TRANSITIVE-FAIL %s // TRANSITIVE-FAIL: Could not load module: LibraryWrong (cannot load module 'Transitive' as 'WrongName') -// Try a non-existant module +// Try a non-existent module -// RUN: not %sourcekitd-test -req=interface-gen -module NonExistant -- -I %t -target %target-triple %s 2>&1 | %FileCheck --check-prefix DIRECT-NONEXISTANT %s -// DIRECT-NONEXISTANT: Could not load module: NonExistant +// RUN: not %sourcekitd-test -req=interface-gen -module NonExistent -- -I %t -target %target-triple %s 2>&1 | %FileCheck --check-prefix DIRECT-NONEXISTENT %s +// DIRECT-NONEXISTENT: Could not load module: NonExistent -// RUN: %target-swift-frontend -emit-module %t/Inputs/Transitive.swift -module-name NonExistant -o %t -// RUN: %target-swift-frontend -emit-module %t/Inputs/LibraryNonExistant.swift -module-name LibraryNonExistant -I %t -o %t +// RUN: %target-swift-frontend -emit-module %t/Inputs/Transitive.swift -module-name NonExistent -o %t +// RUN: %target-swift-frontend -emit-module %t/Inputs/LibraryNonExistant.swift -module-name LibraryNonExistent -I %t -o %t // RUN: rm -rf %t/NonExistant.swiftmodule -// RUN: not %sourcekitd-test -req=interface-gen -module LibraryNonExistant -- -I %t -target %target-triple %s 2>&1 | %FileCheck --check-prefix TRANSITIVE-NONEXISTANT %s -// TRANSITIVE-NONEXISTANT: Could not load module: LibraryNonExistant (missing required module 'NonExistant') +// RUN: not %sourcekitd-test -req=interface-gen -module LibraryNonExistent -- -I %t -target %target-triple %s 2>&1 | %FileCheck --check-prefix TRANSITIVE-NONEXISTENT %s +// TRANSITIVE-NONEXISTENT: Could not load module: LibraryNonExistent (missing required module 'NonExistent') diff --git a/test/attr/attr_availability_narrow.swift b/test/attr/attr_availability_narrow.swift index a70fa90a76656..9a534c99f856a 100644 --- a/test/attr/attr_availability_narrow.swift +++ b/test/attr/attr_availability_narrow.swift @@ -1,6 +1,6 @@ // RUN: %target-typecheck-verify-swift // REQUIRES: OS=macosx -// Suggest narrowing the range of bad availabile checks +// Suggest narrowing the range of bad available checks import Foundation diff --git a/test/decl/var/init_accessors.swift b/test/decl/var/init_accessors.swift index b280fe089c624..560ab6a63940a 100644 --- a/test/decl/var/init_accessors.swift +++ b/test/decl/var/init_accessors.swift @@ -446,7 +446,7 @@ func test_memberwise_ordering() { var pair: (Int, Int) { @storageRestrictions(accesses: _a, _b) - init(initalValue) { + init(initialValue) { } get { (_a, _b) } @@ -464,7 +464,7 @@ func test_memberwise_ordering() { var c: Int { @storageRestrictions(initializes: _c, accesses: _a, _b) - init(initalValue) { + init(initialValue) { } get { _c } @@ -494,7 +494,7 @@ func test_default_arguments_are_analyzed() { var otherPair = (0, 1) { // expected-error@-1 {{computed property must have an explicit type}} - init(initalValue) {} + init(initialValue) {} get { 42 } // expected-error@-1 {{cannot convert return expression of type 'Int' to return type '(Int, Int)'}} diff --git a/test/embedded/FixedArray.swift b/test/embedded/FixedArray.swift index ffb8c051b7167..c61a6f287a78f 100644 --- a/test/embedded/FixedArray.swift +++ b/test/embedded/FixedArray.swift @@ -28,7 +28,7 @@ func testDestroyOfElements() { a.append(CheckLifetime(29)) a.append(CheckLifetime(30)) - // The `*` is a prefix operator and serves as syntatic sugar for FixedArray.view. + // The `*` is a prefix operator and serves as syntactic sugar for FixedArray.view. printit(*a) } @@ -58,7 +58,7 @@ struct S { static var a = FixedArray(capacity: 10) // Elements are initialized in the data section. - // The `^` is a prefix operator and serves as syntatic sugar to create a FixedArray literal. + // The `^` is a prefix operator and serves as syntactic sugar to create a FixedArray literal. static let b = ^[1, 2, 3] static let c: FixedArray = ^[10, 20, 30] diff --git a/test/embedded/Inputs/ExperimentalFixedArray.swift b/test/embedded/Inputs/ExperimentalFixedArray.swift index bd5809fa0d500..2a1b0dceb9d8a 100644 --- a/test/embedded/Inputs/ExperimentalFixedArray.swift +++ b/test/embedded/Inputs/ExperimentalFixedArray.swift @@ -93,7 +93,7 @@ public struct FixedArray : ~Copyable { } } -// Syntatic sugar for creating a FixedArray literal +// Syntactic sugar for creating a FixedArray literal prefix operator ^ @_transparent @@ -102,7 +102,7 @@ public prefix func ^(_ literal: FixedArray._Literal) -> FixedArray { return FixedArray(elements: literal.array) } -// Syntatic sugar for getting a BufferView to a FixedArray +// Syntactic sugar for getting a BufferView to a FixedArray prefix operator * @_transparent diff --git a/test/embedded/classes-non-final-method-no-stdlib.swift b/test/embedded/classes-non-final-method-no-stdlib.swift index 96a0ac1512f9c..bbeac21c649cd 100644 --- a/test/embedded/classes-non-final-method-no-stdlib.swift +++ b/test/embedded/classes-non-final-method-no-stdlib.swift @@ -3,6 +3,6 @@ // REQUIRES: swift_in_compiler public class MyClass { - func foo(t: T) { } // expected-error {{classes cannot have non-final generic fuctions in embedded Swift}} + func foo(t: T) { } // expected-error {{classes cannot have non-final generic functions in embedded Swift}} func bar() { } } diff --git a/test/embedded/ouroboros-bug.swift b/test/embedded/ouroboros-bug.swift index cbbddbdac512f..d009421351f5f 100644 --- a/test/embedded/ouroboros-bug.swift +++ b/test/embedded/ouroboros-bug.swift @@ -1,5 +1,5 @@ // Regression test for a "Ouroboros Bug": The ARC optimizer doesn't like the -// presense of a direct call to swift_retain and swift_release in any Swift +// presence of a direct call to swift_retain and swift_release in any Swift // code, but in the embedded Swift's runtime that's somewhat reasonable thing // to do (but is to be avoided because of this). diff --git a/test/expr/unary/if_expr.swift b/test/expr/unary/if_expr.swift index 93ab2969efd2f..5f487efe8b2de 100644 --- a/test/expr/unary/if_expr.swift +++ b/test/expr/unary/if_expr.swift @@ -383,7 +383,7 @@ func throwsError() throws { } // FIXME: If we ever support this, we need to fix the premature inference of '[Any]'/'[AnyHashable: Any]'. -// The issue is that we're attempting to bind defaults to type variables before solving the conjuction. +// The issue is that we're attempting to bind defaults to type variables before solving the conjunction. let g = [if .random() { "a" } else { "b" }] // expected-error@-1 {{'if' may only be used as expression in return, throw, or as the source of an assignment}} // expected-error@-2 {{heterogeneous collection literal could only be inferred to '[Any]'; add explicit type annotation if this is intentional}} @@ -850,7 +850,7 @@ func testPoundIfBranch4() -> Int { } func testPoundIfBranch5() -> Int { - // Not allowed (matches the behavior of implict expression returns) + // Not allowed (matches the behavior of implicit expression returns) if .random() { #if false 0 @@ -862,7 +862,7 @@ func testPoundIfBranch5() -> Int { } func testPoundIfBranch6() -> Int { - // Not allowed (matches the behavior of implict expression returns) + // Not allowed (matches the behavior of implicit expression returns) let x = if .random() { #if false 0 diff --git a/test/expr/unary/switch_expr.swift b/test/expr/unary/switch_expr.swift index cf161341a3556..5181c83331a98 100644 --- a/test/expr/unary/switch_expr.swift +++ b/test/expr/unary/switch_expr.swift @@ -458,7 +458,7 @@ func throwsError() throws { } // FIXME: If we ever support this, we need to fix the premature inference of '[Any]'/'[AnyHashable: Any]'. -// The issue is that we're attempting to bind defaults to type variables before solving the conjuction. +// The issue is that we're attempting to bind defaults to type variables before solving the conjunction. let g = [switch Bool.random() { case true: "a" case false: "b" }] // expected-error@-1 {{'switch' may only be used as expression in return, throw, or as the source of an assignment}} // expected-error@-2 {{heterogeneous collection literal could only be inferred to '[Any]'; add explicit type annotation if this is intentional}} @@ -1078,7 +1078,7 @@ func testPoundIfBranch4() -> Int { } func testPoundIfBranch5() -> Int { - // Not allowed (matches the behavior of implict expression returns) + // Not allowed (matches the behavior of implicit expression returns) switch Bool.random() { case true: #if false @@ -1091,7 +1091,7 @@ func testPoundIfBranch5() -> Int { } func testPoundIfBranch6() -> Int { - // Not allowed (matches the behavior of implict expression returns) + // Not allowed (matches the behavior of implicit expression returns) let x = switch Bool.random() { case true: #if false diff --git a/test/lit.cfg b/test/lit.cfg index 45547c6add5a5..c44456460c292 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -384,7 +384,7 @@ if kIsWindows: config.swift_system_overlay_opt = "-vfsoverlay {} -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules".format( os.path.join(config.swift_obj_root, "stdlib", "windows-vfs-overlay.yaml") ) - # this variant is for extract-symbolgraph which doesn't accept all the same arugments as swiftc + # this variant is for extract-symbolgraph which doesn't accept all the same arguments as swiftc # so the extra ceremony lets us pass in the relevant pieces needed for Windows SDK access. config.windows_vfs_overlay_opt = "-Xcc -vfsoverlay -Xcc {} -Xcc -strict-implicit-module-context -Xcc -Xclang -Xcc -fbuiltin-headers-in-system-modules".format( os.path.join(config.swift_obj_root, "stdlib", "windows-vfs-overlay.yaml") @@ -577,7 +577,7 @@ lit_config.note("Using code completion cache: " + completion_cache_path) if kIsWindows: config.swift_plugin_dir = config.swift_bin_dir - # FIXME: this is a workaround for the collsion between the build toolchain + # FIXME: this is a workaround for the collision between the build toolchain # and the current build, this should be `make_path(config.swift_lib_dir, 'swift')` config.swift_build_lib_dir = make_path(config.swift_lib_dir, 'swift', 'host') else: @@ -2825,7 +2825,7 @@ config.substitutions.append(('%raw-FileCheck', shell_quote(config.filecheck))) config.substitutions.append(('%import-libdispatch', getattr(config, 'import_libdispatch', ''))) # WARNING: the order of components in a substitution name has to be different from the previous one, as lit does # a pure string substitution without understanding that these components are grouped together. That is, the following -# subsitution name can't be `%import-libdispatch-static`, otherwise the first two components will be substituted with +# substitution name can't be `%import-libdispatch-static`, otherwise the first two components will be substituted with # the value of `%import-libdispatch` substitution with `-static` string appended to it. config.substitutions.append(('%import-static-libdispatch', getattr(config, 'import_libdispatch_static', ''))) diff --git a/test/refactoring/RefactoringKind/simplify_long_number.swift b/test/refactoring/RefactoringKind/simplify_long_number.swift index 722b4fffad706..125c655e9ad56 100644 --- a/test/refactoring/RefactoringKind/simplify_long_number.swift +++ b/test/refactoring/RefactoringKind/simplify_long_number.swift @@ -11,16 +11,16 @@ func foo() { _ = 123.123 } -// RUN: %refactor -source-filename %s -pos=4:10 | %FileCheck %s -check-prefix=CHECK-LONG-NUMER -// RUN: %refactor -source-filename %s -pos=5:10 | %FileCheck %s -check-prefix=CHECK-LONG-NUMER -// RUN: %refactor -source-filename %s -pos=6:15 | %FileCheck %s -check-prefix=CHECK-LONG-NUMER -// RUN: %refactor -source-filename %s -pos=7:10 | %FileCheck %s -check-prefix=CHECK-LONG-NUMER -// RUN: %refactor -source-filename %s -pos=8:10 | %FileCheck %s -check-prefix=CHECK-LONG-NUMER +// RUN: %refactor -source-filename %s -pos=4:10 | %FileCheck %s -check-prefix=CHECK-LONG-NUMBER +// RUN: %refactor -source-filename %s -pos=5:10 | %FileCheck %s -check-prefix=CHECK-LONG-NUMBER +// RUN: %refactor -source-filename %s -pos=6:15 | %FileCheck %s -check-prefix=CHECK-LONG-NUMBER +// RUN: %refactor -source-filename %s -pos=7:10 | %FileCheck %s -check-prefix=CHECK-LONG-NUMBER +// RUN: %refactor -source-filename %s -pos=8:10 | %FileCheck %s -check-prefix=CHECK-LONG-NUMBER // RUN: %refactor -source-filename %s -pos=10:8 | %FileCheck %s -check-prefix=CHECK-NONE // RUN: %refactor -source-filename %s -pos=11:8 | %FileCheck %s -check-prefix=CHECK-NONE -// CHECK-LONG-NUMER: Simplify Long Number Literal +// CHECK-LONG-NUMBER: Simplify Long Number Literal // CHECK-NONE: Action begins // CHECK-NONE-NEXT: Action ends diff --git a/test/refactoring/SyntacticRename/Outputs/textual/foo.swift.expected b/test/refactoring/SyntacticRename/Outputs/textual/foo.swift.expected index 0e4464b6ebf50..8ec14f8f52f9a 100644 --- a/test/refactoring/SyntacticRename/Outputs/textual/foo.swift.expected +++ b/test/refactoring/SyntacticRename/Outputs/textual/foo.swift.expected @@ -36,4 +36,4 @@ _ = /*MyClass:unknown*/Mismatch() _ = /*MyClass:unknown*/MyClass() #endif -// All occcurrences of MyClass are outside of comments and string literals, so there's nothing to rename. swift-refactor indicates this by outputing empty results. +// All occcurrences of MyClass are outside of comments and string literals, so there's nothing to rename. swift-refactor indicates this by outputting empty results. diff --git a/test/refactoring/SyntacticRename/textual.swift b/test/refactoring/SyntacticRename/textual.swift index 7a7cd7445756c..4257030ca4b6d 100644 --- a/test/refactoring/SyntacticRename/textual.swift +++ b/test/refactoring/SyntacticRename/textual.swift @@ -41,5 +41,5 @@ _ = /*MyClass:unknown*/MyClass() // RUN: %refactor -find-rename-ranges -source-filename %s -pos="foo" -is-function-like -old-name "foo()" >> %t.ranges/textual_foo.swift // RUN: diff -u %S/Outputs/textual/foo.swift.expected %t.ranges/textual_foo.swift // RUN: %refactor -find-rename-ranges -source-filename %s -pos="MyClass" -is-non-protocol-type -old-name "MyClass" -new-name "YourClass" >> %t.ranges/textual_MyClass.swift -// All occcurrences of MyClass are outside of comments and string literals, so there's nothing to rename. swift-refactor indicates this by outputing empty results. +// All occcurrences of MyClass are outside of comments and string literals, so there's nothing to rename. swift-refactor indicates this by outputting empty results. // RUN: diff -u %t.ranges/textual_MyClass.swift - diff --git a/test/stdlib/SwiftObjectNSObject.swift b/test/stdlib/SwiftObjectNSObject.swift index 841160d3eeaa5..a68edd23174e8 100644 --- a/test/stdlib/SwiftObjectNSObject.swift +++ b/test/stdlib/SwiftObjectNSObject.swift @@ -195,7 +195,7 @@ if #available(OSX 10.12, iOS 10.0, *) { TestNonEquatableEquals(F1(i: 1), E(i: 1)) TestEquatableEquals(H(i:1), E(i:1)) - // Equatable but not Hashable: alway have the same Obj-C hashValue + // Equatable but not Hashable: always have the same Obj-C hashValue TestEquatableHash(E(i: 1)) TestEquatableHash(E1(i: 3)) TestEquatableHash(E2(i: 8)) diff --git a/test/stdlib/SwiftValueNSObject.swift b/test/stdlib/SwiftValueNSObject.swift index 3ac6695cffa37..5013ad3b4e74c 100644 --- a/test/stdlib/SwiftValueNSObject.swift +++ b/test/stdlib/SwiftValueNSObject.swift @@ -140,7 +140,7 @@ if #available(OSX 10.12, iOS 10.0, *) { TestNonEquatableEquals(F(i: 1), F(i: 1)) TestSwiftValueNSObjectNotEquals(H(i:1) as AnyObject, E(i:1) as AnyObject) - // Equatable but not Hashable: alway have the same Obj-C hashValue + // Equatable but not Hashable: always have the same Obj-C hashValue TestEquatableHash(E(i: 1)) TestEquatableHash(E1(i: 17)) diff --git a/tools/SourceKit/lib/SwiftLang/SwiftASTManager.cpp b/tools/SourceKit/lib/SwiftLang/SwiftASTManager.cpp index 652011f5dcea8..f3a90a6b3d436 100644 --- a/tools/SourceKit/lib/SwiftLang/SwiftASTManager.cpp +++ b/tools/SourceKit/lib/SwiftLang/SwiftASTManager.cpp @@ -315,7 +315,7 @@ class ASTBuildOperation const std::vector FileContents; /// Guards \c DependencyStamps. This prevents reading from \c DependencyStamps - /// while it is being modified. It does not provide any ordering gurantees + /// while it is being modified. It does not provide any ordering guarantees /// that \c DependencyStamps have been computed in \c buildASTUnit before they /// are accessed in \c matchesSourceState but that's fine (see comment on /// \c DependencyStamps). diff --git a/tools/SourceKit/lib/SwiftLang/SwiftLangSupport.cpp b/tools/SourceKit/lib/SwiftLang/SwiftLangSupport.cpp index 07ad1a8f8abcc..f072e444cc8b5 100644 --- a/tools/SourceKit/lib/SwiftLang/SwiftLangSupport.cpp +++ b/tools/SourceKit/lib/SwiftLang/SwiftLangSupport.cpp @@ -208,7 +208,7 @@ namespace { /// A simple FileSystemProvider that creates an InMemoryFileSystem for a given /// dictionary of file contents and overlays that on top of the real filesystem. class InMemoryFileSystemProvider: public SourceKit::FileSystemProvider { - /// Provides the real filesystem, overlayed with an InMemoryFileSystem that + /// Provides the real filesystem, overlaid with an InMemoryFileSystem that /// contains specified files at specified locations. llvm::IntrusiveRefCntPtr getFileSystem(OptionsDictionary &options, std::string &error) override { diff --git a/tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp b/tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp index cc11e3b15e124..ed1b496258ccf 100644 --- a/tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp +++ b/tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp @@ -2099,7 +2099,7 @@ void SwiftLangSupport::getCursorInfo( } else { std::string Diagnostic; // Unused. ResolvedValueRefCursorInfoPtr Info = new ResolvedValueRefCursorInfo( - /*SourcFile=*/nullptr, SourceLoc(), + /*SourceFile=*/nullptr, SourceLoc(), const_cast(Entity.Dcl), /*CtorTyRef=*/nullptr, /*ExtTyRef=*/nullptr, Entity.IsRef, @@ -2585,7 +2585,7 @@ void SwiftLangSupport::findRelatedIdentifiersInFile( #ifndef NDEBUG for (auto loc : Locs.getLocations()) { assert(loc.OldName == OldName && - "Found related identfiers with different names?"); + "Found related identifiers with different names?"); } #endif diff --git a/tools/SourceKit/tools/sourcekitd/include/sourcekitd/Service.h b/tools/SourceKit/tools/sourcekitd/include/sourcekitd/Service.h index 0e1e155cafcb8..d99c243104135 100644 --- a/tools/SourceKit/tools/sourcekitd/include/sourcekitd/Service.h +++ b/tools/SourceKit/tools/sourcekitd/include/sourcekitd/Service.h @@ -47,7 +47,7 @@ void disposeCancellationToken(SourceKitCancellationToken CancellationToken); /// Returns \c true if \p Request is of a request kind that should be issued as /// a dispatch barrier of the message handling queue. In practice, this returns -/// \c true for open, edit and close requets. +/// \c true for open, edit and close requests. /// /// This does not check if dispatch barriers have been enabled by the sourckitd /// client. diff --git a/tools/libMockPlugin/MockPlugin.cpp b/tools/libMockPlugin/MockPlugin.cpp index 3cd3b42d64c23..834d097105759 100644 --- a/tools/libMockPlugin/MockPlugin.cpp +++ b/tools/libMockPlugin/MockPlugin.cpp @@ -113,7 +113,7 @@ static const llvm::json::Value substitute(const llvm::json::Value &value, // '.' -> object key. if (path.starts_with(".")) { if (subst->kind() != llvm::json::Value::Object) - return ""; + return ""; path = path.substr(1); auto keyLength = path.find_if([](char c) { return !llvm::isAlnum(c) && c != '_'; }); @@ -125,7 +125,7 @@ static const llvm::json::Value substitute(const llvm::json::Value &value, // '[' + ']' -> array index. if (path.starts_with("[")) { if (subst->kind() != llvm::json::Value::Array) - return ""; + return ""; path = path.substr(1); auto idxlength = path.find_if([](char c) { return !llvm::isDigit(c); }); size_t idx; @@ -133,12 +133,12 @@ static const llvm::json::Value substitute(const llvm::json::Value &value, subst = &(*subst->getAsArray())[idx]; path = path.substr(idxlength); if (!path.starts_with("]")) - return ""; + return ""; path = path.substr(1); continue; } // Malformed. - return ""; + return ""; } return *subst; } diff --git a/tools/libSwiftScan/SwiftCaching.cpp b/tools/libSwiftScan/SwiftCaching.cpp index 464c908c5e2dc..c861ea8ed1245 100644 --- a/tools/libSwiftScan/SwiftCaching.cpp +++ b/tools/libSwiftScan/SwiftCaching.cpp @@ -246,7 +246,7 @@ bool swiftscan_cas_prune_ondisk_data(swiftscan_cas_t cas, return false; } -/// Expand the invocation if there is repsonseFile into Args that are passed in +/// Expand the invocation if there is responseFile into Args that are passed in /// the parameter. Return swift-frontend arguments in an ArrayRef, which has the /// first "-frontend" option dropped if needed. static llvm::ArrayRef @@ -966,7 +966,7 @@ static llvm::Error replayCompilation(SwiftScanReplayInstance &Instance, return Proxy.takeError(); if (Kind == file_types::ID::TY_CachedDiagnostics) { - assert(!DiagnosticsOutput && "more than 1 diagnotics found"); + assert(!DiagnosticsOutput && "more than 1 diagnostics found"); DiagnosticsOutput = std::move(*Proxy); } else OutputProxies.emplace_back( diff --git a/tools/lldb-moduleimport-test/lldb-moduleimport-test.cpp b/tools/lldb-moduleimport-test/lldb-moduleimport-test.cpp index 31b5f99a87cda..e7e7f3698667b 100644 --- a/tools/lldb-moduleimport-test/lldb-moduleimport-test.cpp +++ b/tools/lldb-moduleimport-test/lldb-moduleimport-test.cpp @@ -250,7 +250,7 @@ int main(int argc, char **argv) { desc("Dump the imported module after checking it imports just fine"), cat(Visible)); - opt Verbose("verbose", desc("Dump informations on the loaded module"), + opt Verbose("verbose", desc("Dump information on the loaded module"), cat(Visible)); opt Filter("filter", desc("triple for filtering modules"), diff --git a/tools/swift-ide-test/swift-ide-test.cpp b/tools/swift-ide-test/swift-ide-test.cpp index 7f39e536af13b..a72d2f181714a 100644 --- a/tools/swift-ide-test/swift-ide-test.cpp +++ b/tools/swift-ide-test/swift-ide-test.cpp @@ -508,7 +508,7 @@ static llvm::cl::opt CodeCompletionAddCallWithNoDefaultArgs( static llvm::cl::list ConformingMethodListExpectedTypes("conforming-methods-expected-types", - llvm::cl::desc("Set expected types for comforming method list"), + llvm::cl::desc("Set expected types for conforming method list"), llvm::cl::cat(Category)); // '-syntax-coloring' options. @@ -3050,7 +3050,7 @@ static int doPrintModules(const CompilerInvocation &InitInvok, registerIDERequestFunctions(CI.getASTContext().evaluator); auto &Context = CI.getASTContext(); - // Load implict imports so that Clang importer can use it. + // Load implicit imports so that Clang importer can use it. for (auto unloadedImport : CI.getMainModule()->getImplicitImportInfo().AdditionalUnloadedImports) { (void)Context.getModule(unloadedImport.module.getModulePath()); @@ -3117,7 +3117,7 @@ static int doPrintHeaders(const CompilerInvocation &InitInvok, registerIDERequestFunctions(CI.getASTContext().evaluator); auto &Context = CI.getASTContext(); - // Load implict imports so that Clang importer can use it. + // Load implicit imports so that Clang importer can use it. for (auto unloadedImport : CI.getMainModule()->getImplicitImportInfo().AdditionalUnloadedImports) { (void)Context.getModule(unloadedImport.module.getModulePath()); diff --git a/tools/swift-inspect/Sources/swift-inspect/Operations/DumpConcurrency.swift b/tools/swift-inspect/Sources/swift-inspect/Operations/DumpConcurrency.swift index 661e9a615f673..96fbf82654c72 100644 --- a/tools/swift-inspect/Sources/swift-inspect/Operations/DumpConcurrency.swift +++ b/tools/swift-inspect/Sources/swift-inspect/Operations/DumpConcurrency.swift @@ -313,19 +313,19 @@ fileprivate class ConcurrencyDumper { let taskToThread: [swift_addr_t: UInt64] = Dictionary(threadCurrentTasks.map{ ($1, $0) }, uniquingKeysWith: { $1 }) - var lastChilds: [Bool] = [] + var lastChildren: [Bool] = [] let hierarchy = taskHierarchy() for (i, (level, lastChild, task)) in hierarchy.enumerated() { - lastChilds.removeSubrange(level...) - lastChilds.append(lastChild) + lastChildren.removeSubrange(level...) + lastChildren.append(lastChild) let prevEntry = i > 0 ? hierarchy[i - 1] : nil let levelDidIncrease = level > (prevEntry?.level ?? -1) var prefix = "" - for lastChild in lastChilds { + for lastChild in lastChildren { prefix += lastChild ? " " : " | " } prefix += " " diff --git a/tools/swift-inspect/Sources/swift-inspect/Operations/DumpGenericMetadata.swift b/tools/swift-inspect/Sources/swift-inspect/Operations/DumpGenericMetadata.swift index ba6f115a97de4..d917b50685f26 100644 --- a/tools/swift-inspect/Sources/swift-inspect/Operations/DumpGenericMetadata.swift +++ b/tools/swift-inspect/Sources/swift-inspect/Operations/DumpGenericMetadata.swift @@ -168,7 +168,7 @@ internal struct DumpGenericMetadata: ParsableCommand { } private func dumpText(process: any RemoteProcess, generics: [Metadata]) throws { - var errorneousMetadata: [(ptr: swift_reflection_ptr_t, name: String)] = [] + var erroneousMetadata: [(ptr: swift_reflection_ptr_t, name: String)] = [] var output = try Output(genericMetadataOptions.outputFile) print("\(process.processName)(\(process.processIdentifier)):\n", to: &output) print("Address", "Allocation", "Size", "Offset", "isArrayOfClass", "Name", separator: "\t", to: &output) @@ -178,7 +178,7 @@ internal struct DumpGenericMetadata: ParsableCommand { print("\(hex: allocation.ptr)\t\(allocation.size)\t\(offset)", terminator: "\t", to: &output) } else { if $0.garbage { - errorneousMetadata.append((ptr: $0.ptr, name: $0.name)) + erroneousMetadata.append((ptr: $0.ptr, name: $0.name)) } print("???\t??\t???", terminator: "\t", to: &output) } @@ -189,9 +189,9 @@ internal struct DumpGenericMetadata: ParsableCommand { } } - if errorneousMetadata.count > 0 { + if erroneousMetadata.count > 0 { print("Warning: The following metadata was not found in any DATA or AUTH segments, may be garbage.", to: &output) - errorneousMetadata.forEach { + erroneousMetadata.forEach { print("\(hex: $0.ptr)\t\($0.name)", to: &output) } } diff --git a/unittests/AST/ImportTests.cpp b/unittests/AST/ImportTests.cpp index 096a697f36751..2cabff8e549e5 100644 --- a/unittests/AST/ImportTests.cpp +++ b/unittests/AST/ImportTests.cpp @@ -25,7 +25,7 @@ class ImportPathContext { public: ImportPathContext() = default; - /// Hepler routine for building ImportPath + /// Helper routine for building ImportPath /// Build() /// @see ImportPathBuilder inline ImportPath Build(StringRef Name) noexcept { diff --git a/unittests/DependencyScan/Features.cpp b/unittests/DependencyScan/Features.cpp index a35315819cb8f..8289b8c6d9382 100644 --- a/unittests/DependencyScan/Features.cpp +++ b/unittests/DependencyScan/Features.cpp @@ -64,6 +64,6 @@ TEST_F(ScanTest, TestDoesNotHaveArgumentQuery) { bool hasOption; hasOption = optionSet.find("-clearly-not-a-compiler-flag") != optionSet.end(); EXPECT_EQ(hasOption, false); - hasOption = optionSet.find("-emit-modul") != optionSet.end(); + hasOption = optionSet.find("-emit-module") != optionSet.end(); EXPECT_EQ(hasOption, false); } diff --git a/utils/api_checker/dump-sdk.sh b/utils/api_checker/dump-sdk.sh index 5757eb23bdad4..8eaf8daa8ee96 100755 --- a/utils/api_checker/dump-sdk.sh +++ b/utils/api_checker/dump-sdk.sh @@ -7,7 +7,7 @@ sh "$DIR/sdk-module-lists/create-module-lists.sh" MacSDKPath=$(xcrun -sdk macosx -show-sdk-path) IphoneOSSDKPath=$(xcrun -sdk iphoneos -show-sdk-path) AppleTVOSSDKPath=$(xcrun -sdk appletvos -show-sdk-path) -WathOSSDKPath=$(xcrun -sdk watchos -show-sdk-path) +WatchOSSDKPath=$(xcrun -sdk watchos -show-sdk-path) XCTestMac="$MacSDKPath/../../Library/Frameworks/" XCTestIphone="$IphoneOSSDKPath/../../Library/Frameworks/" @@ -42,7 +42,7 @@ if [[ -z "$MODULE" ]]; then $SWIFT_API_DIGESTER -target x86_64-apple-macosx10.15 -o "$BASEDIR/macos$XCODE_VER.json" -dump-sdk -sdk "$MacSDKPath" -module-list-file "/tmp/modules-osx.txt" -F "$XCTestMac" -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER $SWIFT_API_DIGESTER -target arm64-apple-ios13.5 -o "$BASEDIR/ios$XCODE_VER.json" -dump-sdk -sdk "$IphoneOSSDKPath" -module-list-file "/tmp/modules-iphoneos.txt" -F "$XCTestIphone" -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER $SWIFT_API_DIGESTER -target arm64-apple-tvos13.4 -o "$BASEDIR/tvos$XCODE_VER.json" -dump-sdk -sdk "$AppleTVOSSDKPath" -module-list-file "/tmp/modules-tvos.txt" -F "$XCTestTV" -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER - $SWIFT_API_DIGESTER -target armv7k-apple-watchos6.2 -o "$BASEDIR/watchos$XCODE_VER.json" -dump-sdk -sdk "$WathOSSDKPath" -module-list-file "/tmp/modules-watchos.txt" -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER + $SWIFT_API_DIGESTER -target armv7k-apple-watchos6.2 -o "$BASEDIR/watchos$XCODE_VER.json" -dump-sdk -sdk "$WatchOSSDKPath" -module-list-file "/tmp/modules-watchos.txt" -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER $SWIFT_API_DIGESTER -target x86_64-apple-macosx10.15 -o "$BASEDIR/macos-stdlib$XCODE_VER.json" -dump-sdk -sdk "$MacSDKPath" -module Swift -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER else ALL_MODULE_DIR="$BASEDIR/Xcode$XCODE_VER" @@ -60,6 +60,6 @@ else $SWIFT_API_DIGESTER -target x86_64-apple-macosx10.15 -o "$MODULE_DIR/macos.json" -dump-sdk -sdk "$MacSDKPath" -module "$MODULE" -F "$XCTestMac" -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER $SWIFT_API_DIGESTER -target arm64-apple-ios13.5 -o "$MODULE_DIR/ios.json" -dump-sdk -sdk "$IphoneOSSDKPath" -module "$MODULE" -F "$XCTestIphone" -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER $SWIFT_API_DIGESTER -target arm64-apple-tvos13.4 -o "$MODULE_DIR/tvos.json" -dump-sdk -sdk "$AppleTVOSSDKPath" -module "$MODULE" -F "$XCTestTV" -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER - $SWIFT_API_DIGESTER -target armv7k-apple-watchos6.2 -o "$MODULE_DIR/watchos.json" -dump-sdk -sdk "$WathOSSDKPath" -module "$MODULE" -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER + $SWIFT_API_DIGESTER -target armv7k-apple-watchos6.2 -o "$MODULE_DIR/watchos.json" -dump-sdk -sdk "$WatchOSSDKPath" -module "$MODULE" -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER done fi diff --git a/utils/build.ps1 b/utils/build.ps1 index 726a7e90c8ae7..adea364680cfc 100644 --- a/utils/build.ps1 +++ b/utils/build.ps1 @@ -1026,7 +1026,7 @@ function Build-CMakeProject { if ($Platform -eq "Windows") { $SwiftArgs += @("-Xlinker", "/INCREMENTAL:NO") - # Swift Requries COMDAT folding and de-duplication + # Swift Requires COMDAT folding and de-duplication $SwiftArgs += @("-Xlinker", "/OPT:REF") $SwiftArgs += @("-Xlinker", "/OPT:ICF") } @@ -1193,7 +1193,7 @@ function Build-WiXProject() { if (-not $Bundle) { # WiX v4 will accept a semantic version string for Bundles, # but Packages still require a purely numerical version number, - # so trim any semantic versionning suffixes + # so trim any semantic versioning suffixes $ProductVersionArg = [regex]::Replace($ProductVersion, "[-+].*", "") } diff --git a/utils/gen-unicode-data/Sources/GenNormalization/Decomp.swift b/utils/gen-unicode-data/Sources/GenNormalization/Decomp.swift index 00a3961bc817f..3dbae3aecd522 100644 --- a/utils/gen-unicode-data/Sources/GenNormalization/Decomp.swift +++ b/utils/gen-unicode-data/Sources/GenNormalization/Decomp.swift @@ -34,7 +34,7 @@ func getDecompData( let decomp = components[5] // We either 1. don't have decompositions, or 2. the decompositions is for - // compatibile forms. We only care about NFD, so ignore these cases. + // compatible forms. We only care about NFD, so ignore these cases. if decomp == "" || decomp.hasPrefix("<") { continue } diff --git a/utils/gyb.py b/utils/gyb.py index 520d1dec319ac..2f55987cb8ea1 100755 --- a/utils/gyb.py +++ b/utils/gyb.py @@ -50,7 +50,7 @@ def split_lines(s): # Note: Where "# Absorb" appears below, the regexp attempts to eat up # through the end of ${...} and %{...}% constructs. In reality we -# handle this with the Python tokenizer, which avoids mis-detections +# handle this with the Python tokenizer, which avoids misdetections # due to nesting, comments and strings. This extra absorption in the # regexp facilitates testing the regexp on its own, by preventing the # interior of some of these constructs from being treated as literal diff --git a/utils/line-directive b/utils/line-directive index e55e677197343..4ba0eb91f0e69 100755 --- a/utils/line-directive +++ b/utils/line-directive @@ -340,7 +340,7 @@ def run(): ... // Licensed under Apache License v2.0 with Runtime Library Exception ... // ... // See https://swift.org/LICENSE.txt for license information - ... // See https://swift.org/CONTRIBUTORS.txt for the list of Swift projec + ... // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project ... // ... //===----------------------------------------------------------------- ... @@ -408,7 +408,7 @@ def run(): ... return _base.underestimatedCount ... } ... - ... /// Creates an instance with elements `transform(x)` for each elemen + ... /// Creates an instance with elements `transform(x)` for each element ... /// `x` of base. ... @_inlineable ... @_versioned @@ -433,7 +433,7 @@ def run(): ... // ###sourceLocation(file: "/public/core/Map.swift.gyb", line: 108) ... ... /// A `Collection` whose elements consist of those in a `Base` - ... /// `Collection` passed through a transform function returning `Elemen + ... /// `Collection` passed through a transform function returning `Element ... /// These elements are computed lazily, each time they're read, by ... /// calling the transform function on a base element. ... @_fixed_layout @@ -471,7 +471,7 @@ def run(): ... // ###sourceLocation(file: "/public/core/Map.swift.gyb", line: 108) ... ... /// A `Collection` whose elements consist of those in a `Base` - ... /// `Collection` passed through a transform function returning `Elemen + ... /// `Collection` passed through a transform function returning `Element ... /// These elements are computed lazily, each time they're read, by ... /// calling the transform function on a base element. ... @_fixed_layout @@ -509,7 +509,7 @@ def run(): ... // ###sourceLocation(file: "/public/core/Map.swift.gyb", line: 108) ... ... /// A `Collection` whose elements consist of those in a `Base` - ... /// `Collection` passed through a transform function returning `Elemen + ... /// `Collection` passed through a transform function returning `Element ... /// These elements are computed lazily, each time they're read, by ... /// calling the transform function on a base element. ... @_fixed_layout diff --git a/utils/parser-lib/profile-input.swift b/utils/parser-lib/profile-input.swift index 1a4c50a075228..d2599f796b057 100644 --- a/utils/parser-lib/profile-input.swift +++ b/utils/parser-lib/profile-input.swift @@ -294,7 +294,7 @@ class BrowserViewController: UIViewController { self.displayedPopoverController = nil } - // If we are displying a private tab, hide any elements in the tab that we wouldn't want shown + // If we are displaying a private tab, hide any elements in the tab that we wouldn't want shown // when the app is in the home switcher guard let privateTab = tabManager.selectedTab, privateTab.isPrivate else { return @@ -1104,7 +1104,7 @@ class BrowserViewController: UIViewController { postLocationChangeNotificationForTab(tab, navigation: navigation) // Fire the readability check. This is here and not in the pageShow event handler in ReaderMode.js anymore - // because that event wil not always fire due to unreliable page caching. This will either let us know that + // because that event will not always fire due to unreliable page caching. This will either let us know that // the currently loaded page can be turned into reading mode or if the page already is in reading mode. We // ignore the result because we are being called back asynchronous when the readermode status changes. webView.evaluateJavaScript("\(ReaderModeNamespace).checkReadability()", completionHandler: nil) diff --git a/utils/recursive-lipo b/utils/recursive-lipo index b62ef30428712..4841fb326a61c 100755 --- a/utils/recursive-lipo +++ b/utils/recursive-lipo @@ -128,7 +128,7 @@ def merge_lipo_files(src_root_dirs, file_list, dest_root_dir, verbose=False, "-- Warning: non-executable source files are different, " + "skipping: %s" % file_paths) else: - print("-- Warning: Unsupport file type, skipping: %s" % file_paths) + print("-- Warning: Unsupported file type, skipping: %s" % file_paths) def main(): diff --git a/utils/swift-bench.py b/utils/swift-bench.py index 6302d2252af29..dfdd21d90413f 100644 --- a/utils/swift-bench.py +++ b/utils/swift-bench.py @@ -56,7 +56,7 @@ r"\s*\(\s*\)" # argument list r"\s*->\s*Int\s*" # return type r"({)?" # opening brace of the function body - r"\s*$" # whitespace ot the end of the line + r"\s*$" # whitespace at the end of the line ) diff --git a/utils/swift_build_support/swift_build_support/products/product.py b/utils/swift_build_support/swift_build_support/products/product.py index ababc351f95ee..de813c2bcb58d 100644 --- a/utils/swift_build_support/swift_build_support/products/product.py +++ b/utils/swift_build_support/swift_build_support/products/product.py @@ -81,7 +81,7 @@ def is_ignore_install_all_product(cls): """is_ignore_install_all_product -> bool Whether this product is to ignore the install-all directive - and insted always respect its own should_install. + and instead always respect its own should_install. This is useful when we run -install-all but have products which should never be installed into the toolchain (e.g. earlyswiftdriver) @@ -296,7 +296,7 @@ def target_for_platform(self, platform, arch, include_version=True): def generate_darwin_toolchain_file(self, platform, arch): """ Generates a new CMake tolchain file that specifies Darwin as a target - plaftorm. + platform. Returns: path on the filesystem to the newly generated toolchain file. """ @@ -386,7 +386,7 @@ def get_linux_target(self, platform, arch): def generate_linux_toolchain_file(self, platform, arch): """ Generates a new CMake tolchain file that specifies Linux as a target - plaftorm. + platform. Returns: path on the filesystem to the newly generated toolchain file. """ @@ -432,7 +432,7 @@ def generate_linux_toolchain_file(self, platform, arch): def generate_toolchain_file_for_darwin_or_linux(self, host_target): """ Checks `host_target` platform and generates a new CMake tolchain file - appropriate for that target plaftorm (either Darwin or Linux). Defines + appropriate for that target platform (either Darwin or Linux). Defines `CMAKE_C_FLAGS` and `CMAKE_CXX_FLAGS` as CMake options. Also defines `CMAKE_TOOLCHAIN_FILE` with the path of the generated toolchain file as a CMake option. diff --git a/utils/update_checkout/update_checkout/update_checkout.py b/utils/update_checkout/update_checkout/update_checkout.py index 17dc04abdcaff..01cb9dd0e38be 100755 --- a/utils/update_checkout/update_checkout/update_checkout.py +++ b/utils/update_checkout/update_checkout/update_checkout.py @@ -544,7 +544,7 @@ def full_target_name(repository, target): def skip_list_for_platform(config, all_repos): """Computes a list of repositories to skip when updating or cloning, if not - overriden by `--all-repositories` CLI argument. + overridden by `--all-repositories` CLI argument. Args: config (Dict[str, Any]): deserialized `update-checkout-config.json` diff --git a/validation-test/SILOptimizer/constant_folded_fp_operations.swift b/validation-test/SILOptimizer/constant_folded_fp_operations.swift index 204958c707191..bfafff1671fed 100644 --- a/validation-test/SILOptimizer/constant_folded_fp_operations.swift +++ b/validation-test/SILOptimizer/constant_folded_fp_operations.swift @@ -388,7 +388,7 @@ struct FPConstantFoldedComparisonOpsValidator: FPOptimizedOpsValidator { // Equality comparisons b/w infinity and non-infinity are not constant folded. // In such comparisons, special floating point types - Float80 and Float16, may - // come into play and pattern matching againt them complicates the constant folding + // come into play and pattern matching against them complicates the constant folding // logic more than we'd like. private func checkIfEqCmpBetweenInfAndNonInf(op: FPOperation, op1: FPOperand, op2: FPOperand) -> Bool { if op == .Equal || op == .NotEqual { diff --git a/validation-test/SILOptimizer/many_trys.swift b/validation-test/SILOptimizer/many_trys.swift index ed617813a67a0..b92e686d56582 100644 --- a/validation-test/SILOptimizer/many_trys.swift +++ b/validation-test/SILOptimizer/many_trys.swift @@ -6,7 +6,7 @@ // REQUIRES: tools-release,no_asan -// For some reason this test times out sometimes when bulding for iOS: rdar://106375480 +// For some reason this test times out sometimes when building for iOS: rdar://106375480 // UNSUPPORTED: OS=ios public var gg = false diff --git a/validation-test/SILOptimizer/rle_dse_complexity.swift b/validation-test/SILOptimizer/rle_dse_complexity.swift index 8b33cd2a395e4..707a05aa17cd7 100644 --- a/validation-test/SILOptimizer/rle_dse_complexity.swift +++ b/validation-test/SILOptimizer/rle_dse_complexity.swift @@ -13,7 +13,7 @@ import Darwin // Check that redundant-load-elimination and dead-store-elimination don't take -// extermely long when optimizing statfs, which contains a 1023-element tuple. +// extremely long when optimizing statfs, which contains a 1023-element tuple. // CHECK-LABEL: test_rle_dse_compile_time public func test_rle_dse_compile_time(_ s: statfs) { diff --git a/validation-test/SILOptimizer/static_enums_fuzzing.swift b/validation-test/SILOptimizer/static_enums_fuzzing.swift index 900e2bc188de0..e198e0cdd59c7 100644 --- a/validation-test/SILOptimizer/static_enums_fuzzing.swift +++ b/validation-test/SILOptimizer/static_enums_fuzzing.swift @@ -469,7 +469,7 @@ struct Size24Enum : Value { var containsEnum: Bool { true } } -// Can't use the default random generator becaus we need deterministic results +// Can't use the default random generator because we need deterministic results struct RandomGenerator : RandomNumberGenerator { var state: (UInt64, UInt64, UInt64, UInt64) = (15042304078070129153, 10706435816813474385, 14710304063852993123, 11070704559760783939) diff --git a/validation-test/Sema/SwiftUI/issue-59716.swift b/validation-test/Sema/SwiftUI/issue-59716.swift index de77b30b4ed48..6516b49e1db75 100644 --- a/validation-test/Sema/SwiftUI/issue-59716.swift +++ b/validation-test/Sema/SwiftUI/issue-59716.swift @@ -9,8 +9,8 @@ extension TestLayout { return f() } } -struct EqualWitdthHStack : TestLayout {} -extension EqualWitdthHStack: View { +struct EqualWidthHStack : TestLayout {} +extension EqualWidthHStack: View { var body : some View { Spacer() } @@ -24,7 +24,7 @@ struct EmptyView: View { struct MyView: View { var body : some View { - EqualWitdthHStack { + EqualWidthHStack { EmptyView() } } diff --git a/validation-test/Sema/type_checker_crashers_fixed/issue-45240.swift b/validation-test/Sema/type_checker_crashers_fixed/issue-45240.swift index b5632c6fa075d..5eafd6b5e8c42 100644 --- a/validation-test/Sema/type_checker_crashers_fixed/issue-45240.swift +++ b/validation-test/Sema/type_checker_crashers_fixed/issue-45240.swift @@ -15,9 +15,9 @@ let constante : String = "Hello World" let constante2 = "Hello World" -let caractere : Character = Array(constante)[0] +let character : Character = Array(constante)[0] -let caractere2 : Character = "A" +let character2 : Character = "A" var variable : String diff --git a/validation-test/stdlib/StringBreadcrumbs.swift b/validation-test/stdlib/StringBreadcrumbs.swift index c60684ab665d1..a33e92881fa15 100644 --- a/validation-test/stdlib/StringBreadcrumbs.swift +++ b/validation-test/stdlib/StringBreadcrumbs.swift @@ -88,7 +88,7 @@ StringBreadcrumbsTests.test("largeString") { // aligning StringBreadcrumbsTests.test("surrogates-heavy") { - // Mis-align the hieroglyphics by 1,2,3 UTF-8 and UTF-16 code units + // Misalign the hieroglyphics by 1,2,3 UTF-8 and UTF-16 code units validateBreadcrumbs(nonBMP) validateBreadcrumbs("a" + nonBMP) validateBreadcrumbs("ab" + nonBMP) diff --git a/validation-test/stdlib/StringSlicesConcurrentAppend.swift b/validation-test/stdlib/StringSlicesConcurrentAppend.swift index 432910a39aefb..041e0e73eb5c6 100644 --- a/validation-test/stdlib/StringSlicesConcurrentAppend.swift +++ b/validation-test/stdlib/StringSlicesConcurrentAppend.swift @@ -23,7 +23,7 @@ extension String { } } -// Swift.String used to hsve an optimization that allowed us to append to a +// Swift.String used to have an optimization that allowed us to append to a // shared string buffer. However, as lock-free programming invariably does, it // introduced a race condition [rdar://25398370 Data Race in StringBuffer.append // (found by TSan)]. diff --git a/validation-test/stdlib/StringWordBreaking.swift b/validation-test/stdlib/StringWordBreaking.swift index 2ffbbfa0a4d85..d9e2d7bd7a671 100644 --- a/validation-test/stdlib/StringWordBreaking.swift +++ b/validation-test/stdlib/StringWordBreaking.swift @@ -87,7 +87,7 @@ if #available(SwiftStdlib 5.9, *) { // // We were accidentally hanging when rounding word indices for some concoctions of // strings. In particular, where we had a pair of scalars create a constraint -// for the preceeding pair, but the preceeding extend rules were not taking the +// for the preceding pair, but the preceding extend rules were not taking the // constraint into consideration. if #available(SwiftStdlib 5.10, *) { StringWordBreaking.test("word breaking backward extend constraints") {