Skip to content

Typos batch: lib and include folders #75020

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/SIL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5783,23 +5783,23 @@ Creates a reference to a `dynamically_replacable` SIL function. A

For the following Swift code::

dynamic func test_dynamically_replaceable() {}
dynamic func test_dynamically_replacable() {}

func test_dynamic_call() {
test_dynamically_replaceable()
test_dynamically_replacable()
}

We will generate::

sil [dynamically_replacable] @test_dynamically_replaceable : $@convention(thin) () -> () {
sil [dynamically_replacable] @test_dynamically_replacable : $@convention(thin) () -> () {
bb0:
%0 = tuple ()
return %0 : $()
}

sil @test_dynamic_call : $@convention(thin) () -> () {
bb0:
%0 = dynamic_function_ref @test_dynamically_replaceable : $@convention(thin) () -> ()
%0 = dynamic_function_ref @test_dynamically_replacable : $@convention(thin) () -> ()
%1 = apply %0() : $@convention(thin) () -> ()
%2 = tuple ()
return %2 : $()
Expand All @@ -5820,14 +5820,14 @@ function.

For the following Swift code::

@_dynamicReplacement(for: test_dynamically_replaceable())
@_dynamicReplacement(for: test_dynamically_replacable())
func test_replacement() {
test_dynamically_replaceable() // calls previous implementation
test_dynamically_replacable() // calls previous implementation
}

We will generate::

sil [dynamic_replacement_for "test_dynamically_replaceable"] @test_replacement : $@convention(thin) () -> () {
sil [dynamic_replacement_for "test_dynamically_replacable"] @test_replacement : $@convention(thin) () -> () {
bb0:
%0 = prev_dynamic_function_ref @test_replacement : $@convention(thin) () -> ()
%1 = apply %0() : $@convention(thin) () -> ()
Expand Down
2 changes: 1 addition & 1 deletion include/swift-c/DependencyScan/DependencyScan.h
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ swiftscan_cache_replay_instance_create(int argc, const char **argv,
SWIFTSCAN_PUBLIC void
swiftscan_cache_replay_instance_dispose(swiftscan_cache_replay_instance_t);

/// Replay the cached compilation using cached compliation replay instance.
/// Replay the cached compilation using cached compilation replay instance.
/// Returns replay result or nullptr if output not found or error occurs. If
/// error, the error message is returned via \c error parameter and its caller
/// needs to free the message using `swiftscan_string_dispose`.
Expand Down
8 changes: 4 additions & 4 deletions include/swift/ABI/GenericContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<decltype(*this)>::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<decltype(*this)>::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<decltype(*this)>::type, Param);
Expand Down
2 changes: 1 addition & 1 deletion include/swift/ABI/MetadataValues.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion include/swift/ABI/Task.h
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ class AsyncTask : public Job {
}

/// Returns true if the current task has any task preference record,
/// including if it has an initial task preference record or onces
/// including if it has an initial task preference record or one
/// set during the lifetime of the task.
bool hasTaskExecutorPreferenceRecord() const;

Expand Down
4 changes: 2 additions & 2 deletions include/swift/APIDigester/ModuleAnalyzerNodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down Expand Up @@ -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<uint8_t> FixedBinaryOrder;
PlatformIntroVersion introVersions;
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/ASTContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ class ASTContext final {
AvailabilityContext getSwiftAvailability(unsigned major, unsigned minor) const;

// For each feature defined in FeatureAvailability, define two functions;
// the latter, with the suffix RuntimeAvailabilty, is for use with
// the latter, with the suffix RuntimeAvailability, is for use with
// AvailabilityContext::forRuntimeTarget(), and only looks at the Swift
// runtime version.
#define FEATURE(N, V) \
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/ASTSynthesis.h
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/AccessScope.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class AccessScope {
/// <FileUnit*, true> Private private
///
/// For example, if a decl with `public` access level is referenced outside of
/// its defining module, it will be maped to the <nullptr, false> pair during
/// its defining module, it will be mapped to the <nullptr, false> 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
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/AutoDiff.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions include/swift/AST/Availability.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions include/swift/AST/Decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ class alignas(1 << DeclAlignInBits) Decl : public ASTAllocated<Decl> {
llvm::TinyPtrVector<Decl *> 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;
Expand Down Expand Up @@ -1387,7 +1387,7 @@ class alignas(1 << DeclAlignInBits) Decl : public ASTAllocated<Decl> {
std::optional<std::pair<const AvailableAttr *, const Decl *>>
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;
Expand Down Expand Up @@ -5706,11 +5706,11 @@ enum class StorageMutability {
/// to nor passed inout.
Immutable,

/// The storage is mutable, meaning that it can be assigned and pased
/// The storage is mutable, meaning that it can be assigned and passed
/// inout.
Mutable,

/// The storage is immutable, but can be asigned for the purposes of
/// The storage is immutable, but can be assigned for the purposes of
/// initialization.
Initializable
};
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/DeclAttr.def
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/DiagnosticsFrontend.def
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ WARNING(emit_reference_dependencies_without_primary_file,none,
WARNING(ignoring_option_requires_option,none,
"ignoring %0 (requires %1)", (StringRef, StringRef))
WARNING(warn_ignore_option_overriden_by,none,
"ignoring %0 (overriden by %1)", (StringRef, StringRef))
"ignoring %0 (overridden by %1)", (StringRef, StringRef))

WARNING(warn_implicit_concurrency_import_failed,none,
"unable to perform implicit import of \"_Concurrency\" module: no such module found", ())
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/DiagnosticsParse.def
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ ERROR(function_type_argument_label,none,
"function types cannot have argument labels; use '_' before %0",
(Identifier))
ERROR(expected_dynamic_func_attr,none,
"expected a dynamically_replaceable function", ())
"expected a dynamically_replacable function", ())
ERROR(async_after_throws,none,
"%select{'async'|'reasync'}0 must precede %select{'throws'|'rethrows'}1",
(bool, bool))
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/DiagnosticsSIL.def
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ ERROR(bad_attr_on_non_const_global,none,
ERROR(global_must_be_compile_time_const,none,
"global variable must be a compile-time constant", ())
ERROR(non_final_generic_class_function,none,
"classes cannot have non-final generic fuctions in embedded Swift", ())
"classes cannot have non-final generic functions in embedded Swift", ())
ERROR(cannot_specialize_class,none,
"cannot specialize %0 because class definition is not available (make sure to build with -wmo)", (Type))
ERROR(embedded_swift_existential_type,none,
Expand Down
4 changes: 2 additions & 2 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -4317,7 +4317,7 @@ ERROR(diff_params_clause_param_not_differentiable,none,
"can only differentiate with respect to parameters that conform to "
"'Differentiable', but %0 does not conform to 'Differentiable'", (Type))

// completionHanderAsync attribute
// completionHandlerAsync attribute
WARNING(warn_use_async_alternative,none,
"consider using asynchronous alternative function",())

Expand Down Expand Up @@ -7919,7 +7919,7 @@ ERROR(lifetime_dependence_only_on_function_method_init_result, none,
ERROR(lifetime_dependence_invalid_type, none,
"lifetime dependence can only be specified on ~Escapable types", ())
ERROR(lifetime_dependence_cannot_infer_ambiguous_candidate, none,
"cannot infer lifetime dependence %0, multiple parameters qualifiy as a candidate", (StringRef))
"cannot infer lifetime dependence %0, multiple parameters qualify as a candidate", (StringRef))
ERROR(lifetime_dependence_cannot_infer_no_candidates, none,
"cannot infer lifetime dependence%0, no parameters found that are either "
"~Escapable or Escapable with a borrowing ownership", (StringRef))
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/Expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -3529,7 +3529,7 @@ class ActorIsolationErasureExpr : public ImplicitConversionExpr {
class ExtractFunctionIsolationExpr : public Expr {
/// The function value expression from which to extract the
/// isolation. The type of `fnExpr` must be an ``@isolated(any)`
/// funciton.
/// function.
Expr *fnExpr;

/// The source location of `.isolation`
Expand Down
4 changes: 2 additions & 2 deletions include/swift/AST/FileUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class FileUnit : public DeclContext, public ASTAllocated<FileUnit> {
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<FileUnit *, 3, FileUnitKind> SynthesizedFileAndKind;

protected:
Expand Down Expand Up @@ -326,7 +326,7 @@ class FileUnit : public DeclContext, public ASTAllocated<FileUnit> {
/// 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
Expand Down
4 changes: 2 additions & 2 deletions include/swift/AST/ModuleDependencies.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ enum class ModuleDependencyKind : int8_t {
LastKind = SwiftPlaceholder + 1
};

/// This is used to idenfity a specific macro plugin dependency.
/// This is used to identify a specific macro plugin dependency.
struct MacroPluginDependency {
std::string LibraryPath;
std::string ExecutablePath;
Expand Down Expand Up @@ -672,7 +672,7 @@ class ModuleDependencyInfo {
return storage->optionalModuleImports;
}

/// Retreive the module-level dependencies.
/// Retrieve the module-level dependencies.
const ArrayRef<ModuleDependencyID> getDirectModuleDependencies() const {
assert(storage->resolved);
return storage->resolvedDirectModuleDependencies;
Expand Down
4 changes: 2 additions & 2 deletions include/swift/AST/PotentialMacroExpansions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/ProtocolConformance.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/SourceFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class SourceFile final : public FileUnit {
/// All the \c #if source ranges in this file.
std::vector<IfConfigClauseRangeInfo> 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;
Expand Down
4 changes: 2 additions & 2 deletions include/swift/AST/TypeCheckRequests.h
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,7 @@ class StoredPropertiesAndMissingMembersRequest :
bool isCached() const { return true; }
};

/// Request to obtain a list of computed properties with init accesors
/// Request to obtain a list of computed properties with init accessors
/// in the given nominal type.
class InitAccessorPropertiesRequest :
public SimpleRequest<InitAccessorPropertiesRequest,
Expand Down Expand Up @@ -3537,7 +3537,7 @@ class CheckRedeclarationRequest

// Evaluation.
/// \p SelfNominalType is \c VD->getDeclContext()->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;
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/TypeRepr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -6108,7 +6108,7 @@ class ProtocolCompositionType final : public TypeBase,
/// given set of members.
///
/// This presents a syntactic view of the world, where an empty composition
/// has implicit Copyable and Escapable members, unless they are supressed
/// has implicit Copyable and Escapable members, unless they are suppressed
/// with the Inverses field.
///
/// The list of members consists of zero or more ProtocolType,
Expand Down
Loading