Skip to content

[gardening] Fix recently introduced typos #7464

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

Merged
merged 2 commits into from
Feb 14, 2017
Merged
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
2 changes: 1 addition & 1 deletion docs/StringManifesto.md
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ takesAnArrayOfSubstring(arrayOfString.map { $0[] })

As we have seen, all three options above have downsides, but it's possible
these downsides could be eliminated/mitigated by the compiler. We are proposing
one such mitigation--implicit conversion--as part of the the "different type,
one such mitigation--implicit conversion--as part of the "different type,
shared storage" option, to help avoid the cognitive load on developers of
having to deal with a separate `Substring` type.

Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/Decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class alignas(1 << DeclAlignInBits) Decl {
/// the enum type.
unsigned Recursiveness : 2;

/// \brief Whther or not this element has an associated value.
/// \brief Whether or not this element has an associated value.
unsigned HasArgumentType : 1;
};
enum { NumEnumElementDeclBits = NumValueDeclBits + 3 };
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/SubstitutionMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
namespace swift {

class GenericSignature;
class CenericEnvironment;
class GenericEnvironment;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this didn't cause problems before, it can just be removed. Unnecessary forward declarations would make a good category of gardening :)

class SubstitutableType;

template<class Type> class CanTypeWrapper;
Expand Down
6 changes: 3 additions & 3 deletions include/swift/AST/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -2828,7 +2828,7 @@ class SILParameterInfo {
/// storage. Therefore they will be passed using an indirect formal
/// convention, and this method will return an address type. However, in
/// canonical SIL the opaque arguments might not have an address type.
SILType getSILStorageType() const; // in SILFunctioConventions.h
SILType getSILStorageType() const; // in SILFunctionConventions.h

/// Return a version of this parameter info with the type replaced.
SILParameterInfo getWithType(CanType type) const {
Expand Down Expand Up @@ -2925,7 +2925,7 @@ class SILResultInfo {
/// storage. Therefore they will be returned using an indirect formal
/// convention, and this method will return an address type. However, in
/// canonical SIL the opaque results might not have an address type.
SILType getSILStorageType() const; // in SILFunctioConventions.h
SILType getSILStorageType() const; // in SILFunctionConventions.h

/// Return a version of this result info with the type replaced.
SILResultInfo getWithType(CanType type) const {
Expand Down Expand Up @@ -3239,7 +3239,7 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode,
// substituted SIL types match, a formal direct argument may not be passed
// to a formal indirect parameter and vice-versa. Hence, the formally
// indirect property, not the SIL indirect property, should be consulted to
// determine whether function reabstraction is necesary.
// determine whether function reabstraction is necessary.
unsigned getNumIndirectFormalResults() const {
return NumIndirectFormalResults;
}
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Basic/Demangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class Demangler;
/// It owns the allocated nodes which are created during demangling.
/// It is always preferable to use the demangling via this context class as it
/// ensures efficient memory management. Especially if demangling is done for
/// multiple symbols. Typecial usage:
/// multiple symbols. Typical usage:
/// \code
/// Context Ctx;
/// for (...) {
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SIL/SILFunctionConventions.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// The primary purpose of this API is mapping the formal SIL parameter and
// result conventions onto the SIL argument types. The "formal" conventions are
// immutably associated with a SILFunctionType--a SIL function's type
// information never changes. The SIL convenentions determine how those formal
// information never changes. The SIL conventions determine how those formal
// conventions will be represented in the body of SIL functions and at call
// sites.
//
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SIL/SILInstruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -3904,7 +3904,7 @@ class OpenExistentialAddrInst
SILType SelfTy);
};

/// Given an opaque value refering to an existential, "opens" the
/// Given an opaque value referring to an existential, "opens" the
/// existential by returning a pointer to a fresh archetype T, which also
/// captures the (dynamic) conformances.
class OpenExistentialOpaqueInst
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SIL/SILModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===---------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//
//
// This file defines the SILModule class.
//
Expand Down
2 changes: 1 addition & 1 deletion lib/AST/Decl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3018,7 +3018,7 @@ void ProtocolDecl::computeRequirementSignature() {
genericSig->getRequirements().size() == 1;
if (!validSig) {
// This doesn't look like a protocol we can handle, so some other error must
// have occured (usually a protocol nested within another declaration)
// have occurred (usually a protocol nested within another declaration)
return;
}

Expand Down
8 changes: 4 additions & 4 deletions lib/AST/GenericSignatureBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2225,14 +2225,14 @@ static void sameTypeDFS(PotentialArchetype *pa,
/// spanning tree among the connected components formed by only the implied
/// same-type requirements within the equivalence class of \c rep.
///
/// The equivalance class of the given representative potential archetype
/// The equivalence class of the given representative potential archetype
/// (\c rep) contains all potential archetypes that are made equivalent by
/// the known set of same-type constraints, which includes both directly-
/// stated same-type constraints (e.g., \c T.A == T.B) as well as same-type
/// constraints that are implied either because the names coincide (e.g.,
/// \c T[.P1].A == T[.P2].A) or due to a requirement in a protocol.
///
/// The equivalance class of the given representative potential archetype
/// The equivalence class of the given representative potential archetype
/// (\c rep) is formed from a graph whose vertices are the potential archetypes
/// and whose edges are the same-type constraints. These edges include both
/// directly-stated same-type constraints (e.g., \c T.A == T.B) as well as
Expand Down Expand Up @@ -2318,7 +2318,7 @@ void GenericSignatureBuilder::enumerateRequirements(llvm::function_ref<
compareDependentTypes);

// Track the anchors for each of the implied connected components within the
// equivalance class of each representative.
// equivalence class of each representative.
llvm::DenseMap<PotentialArchetype *, SmallVector<PotentialArchetype *, 2>>
sameTypeComponentAnchors;
auto getSameTypeComponentAnchors =
Expand Down Expand Up @@ -2346,7 +2346,7 @@ void GenericSignatureBuilder::enumerateRequirements(llvm::function_ref<
std::function<void()> deferredSameTypeRequirement;

if (knownAnchor != componentAnchors.end()) {
// If this equivalance class is bound to a concrete type, equate the
// If this equivalence class is bound to a concrete type, equate the
// anchor with a concrete type.
if (auto concreteType = rep->getConcreteType()) {
f(RequirementKind::SameType, archetype, concreteType,
Expand Down
14 changes: 7 additions & 7 deletions lib/LLVMPasses/LLVMMergeFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class SwiftFunctionComparator : FunctionComparator {

int cmpBasicBlocksIgnoringConsts(const BasicBlock *BBL, const BasicBlock *BBR);

int compareIngoringConsts();
int compareIgnoringConsts();
};

} // end anonymous namespace
Expand Down Expand Up @@ -179,7 +179,7 @@ cmpBasicBlocksIgnoringConsts(const BasicBlock *BBL, const BasicBlock *BBR) {
}

// Test whether the two functions have equivalent behavior.
int SwiftFunctionComparator::compareIngoringConsts() {
int SwiftFunctionComparator::compareIgnoringConsts() {
beginCompare();

if (int Res = compareSignature())
Expand Down Expand Up @@ -259,7 +259,7 @@ class SwiftMergeFunctions : public ModulePass {
if (LHS.Hash != RHS.Hash)
return LHS.Hash < RHS.Hash;
SwiftFunctionComparator FCmp(LHS.First->F, RHS.First->F, GlobalNumbers);
return FCmp.compareIngoringConsts() == -1;
return FCmp.compareIgnoringConsts() == -1;
}
};
typedef std::set<EquivalenceClass, FunctionNodeCmp> FnTreeType;
Expand Down Expand Up @@ -449,9 +449,9 @@ bool SwiftMergeFunctions::doSanityCheck(std::vector<WeakVH> &Worklist) {
Function *F1 = cast<Function>(*I);
Function *F2 = cast<Function>(*J);
int Res1 = SwiftFunctionComparator(F1, F2, &GlobalNumbers).
compareIngoringConsts();
compareIgnoringConsts();
int Res2 = SwiftFunctionComparator(F2, F1, &GlobalNumbers).
compareIngoringConsts();
compareIgnoringConsts();

// If F1 <= F2, then F2 >= F1, otherwise report failure.
if (Res1 != -Res2) {
Expand All @@ -473,9 +473,9 @@ bool SwiftMergeFunctions::doSanityCheck(std::vector<WeakVH> &Worklist) {

Function *F3 = cast<Function>(*K);
int Res3 = SwiftFunctionComparator(F1, F3, &GlobalNumbers).
compareIngoringConsts();
compareIgnoringConsts();
int Res4 = SwiftFunctionComparator(F2, F3, &GlobalNumbers).
compareIngoringConsts();
compareIgnoringConsts();

bool Transitive = true;

Expand Down
4 changes: 2 additions & 2 deletions lib/SIL/SILOwnershipVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,8 @@ OwnershipUseCheckerResult OwnershipCompatibilityUseChecker::visitNonTrivialEnum(
OwnershipUseCheckerResult
OwnershipCompatibilityUseChecker::visitApplyArgument(ValueOwnershipKind Kind,
bool ShouldCheck) {
// Check if we have an enum. If not, then we just check against the passed inc
// onvention.
// Check if we have an enum. If not, then we just check against the passed in
// convention.
EnumDecl *E = getType().getEnumOrBoundGenericEnum();
if (!E) {
return {compatibleWithOwnership(Kind), ShouldCheck};
Expand Down
3 changes: 1 addition & 2 deletions lib/SIL/TransitivelyUnreachableBlocks.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//===--- TransitivelyUnreachableBlocksInfo.h
//----------------------------------===//
//===--- TransitivelyUnreachableBlocks.h ------------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
6 changes: 3 additions & 3 deletions lib/SILOptimizer/Mandatory/AddressLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
Expand Down Expand Up @@ -487,7 +487,7 @@ void OpaqueStorageAllocation::allocateForResults(SILInstruction *origInst) {
args[firstResultIdx] = addr;
}
// Allocate storage for any unused or concrete results. One for each missing
// entry in the the SIL arguments list.
// entry in the SIL arguments list.
unsigned argIdx = firstResultIdx;
for (SILType resultTy : loweredFnConv.getIndirectSILResultTypes()) {
if (!args[argIdx]) {
Expand Down Expand Up @@ -529,7 +529,7 @@ void OpaqueStorageAllocation::allocateForResults(SILInstruction *origInst) {
}
origInst->replaceAllUsesWith(callInst);
pass.instsToDelete.insert(origInst);
// Load an concrete args, and mark the extract for deletion.
// Load a concrete args, and mark the extract for deletion.
for (TupleExtractInst *extract : concreteResults) {
unsigned argIdx = firstResultIdx + extract->getFieldNo();
SILValue arg = args[argIdx];
Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/Utils/Devirtualize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ DevirtualizationResult swift::devirtualizeClassMethod(FullApplySite AI,
}

auto ParamArgIter = AI.getArgumentsWithoutIndirectResults().begin();
// Skip the last paramater, which is `self`. Add it below.
// Skip the last parameter, which is `self`. Add it below.
for (auto param : substConv.getParameters().drop_back()) {
auto paramType = substConv.getSILType(param);
NewArgs.push_back(
Expand Down
6 changes: 3 additions & 3 deletions lib/SILOptimizer/Utils/Generics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ void ReabstractionInfo::createSubstitutedAndSpecializedTypes() {

// Produce a specialized type, which is the substituted type with
// the parameters/results passing conventions adjusted according
// to the converions selected above.
// to the conversions selected above.
SpecializedType = createSpecializedType(SubstitutedType, M);
}

Expand Down Expand Up @@ -748,7 +748,7 @@ SILArgument *ReabstractionThunkGenerator::convertReabstractionThunkArguments(

assert(specConv.useLoweredAddresses());

// ReInfo.NumIndirectResults correponds to SubstTy's formal indirect
// ReInfo.NumIndirectResults corresponds to SubstTy's formal indirect
// results. SpecTy may have fewer formal indirect results.
assert(SubstType->getNumIndirectFormalResults()
>= SpecType->getNumIndirectFormalResults());
Expand All @@ -763,7 +763,7 @@ SILArgument *ReabstractionThunkGenerator::convertReabstractionThunkArguments(
EntryBB->createFunctionArgument(SpecArg->getType(), SpecArg->getDecl());
Arguments.push_back(NewArg);
};
// ReInfo.NumIndirectResults correponds to SubstTy's formal indirect
// ReInfo.NumIndirectResults corresponds to SubstTy's formal indirect
// results. SpecTy may have fewer formal indirect results.
assert(SubstType->getNumIndirectFormalResults()
>= SpecType->getNumIndirectFormalResults());
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/SDK/os/os_log.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

typedef struct {
os_log_fmt_cmd_flags_t cmd_flags : 4;
os_log_fmt_cmd_type_t cmd_type : 4;
os_log_fmt_cmd_type_t cmd_type : 4;
uint8_t cmd_size;
uint8_t cmd_data[];
} os_log_fmt_cmd_s, *os_log_fmt_cmd_t;
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/Builtin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ func _trueAfterDiagnostics() -> Builtin.Int1 {
/// // Smile! 😀
///
/// In this example, accessing the `text` property of the `smileyType` metatype
/// retrieves the overriden value from the `EmojiSmiley` subclass, instead of
/// retrieves the overridden value from the `EmojiSmiley` subclass, instead of
/// the `Smiley` class's original definition.
///
/// Normally, you don't need to be aware of the difference between concrete and
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/Collection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ public struct IndexingIterator<
/// You can access a slice of a collection through its ranged subscript or by
/// calling methods like `prefix(_:)` or `suffix(from:)`. A slice of a
/// collection can contain zero or more of the original collection's elements
/// and shares the the original collection's semantics.
/// and shares the original collection's semantics.
///
/// The following example, creates a `firstWord` constant by using the
/// `prefix(_:)` method to get a slice of the `text` string's `characters`
Expand Down
6 changes: 3 additions & 3 deletions stdlib/public/runtime/ImageInspectionELF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ static int iteratePHDRCallback(struct dl_phdr_info *info,
// While dl_iterate_phdr() is in progress it holds a lock to prevent other
// images being loaded. The initialize flag is set here inside the callback so
// that addNewDSOImage() sees a consistent state. If it was set outside the
// dl_interate_phdr() call then it could result in images being missed or
// dl_iterate_phdr() call then it could result in images being missed or
// added twice.
inspectArgs->didInitializeLookup = true;

if (fname == nullptr || fname[0] == '\0') {
// The filename may be null for both the dynamic loader and main executable.
// So ignore null image name here and explictly add the main executable
// So ignore null image name here and explicitly add the main executable
// in initialize*Lookup() to avoid adding the data twice.
return 0;
}
Expand Down Expand Up @@ -142,7 +142,7 @@ void swift::initializeTypeMetadataRecordLookup() {

// As ELF images are loaded, ImageInspectionInit:sectionDataInit() will call
// addNewDSOImage() with an address in the image that can later be used via
// dladdr() to dlopen() the image after the appropiate initialize*Lookup()
// dladdr() to dlopen() the image after the appropriate initialize*Lookup()
// function has been called.
SWIFT_RUNTIME_EXPORT
void swift_addNewDSOImage(const void *addr) {
Expand Down
4 changes: 2 additions & 2 deletions test/IRGen/boxed_existential.sil
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ entry(%b : $Error):

struct Str : Error { }

// CHECK-LABEL: define{{( protected)?}} void @alloc_deallc_box_with_concrete_type
sil @alloc_deallc_box_with_concrete_type : $@convention(thin) () -> () {
// CHECK-LABEL: define{{( protected)?}} void @alloc_dealloc_box_with_concrete_type
sil @alloc_dealloc_box_with_concrete_type : $@convention(thin) () -> () {
bb0:
// CHECK: call {{.*}} @swift_allocError
%b = alloc_existential_box $Error, $Str
Expand Down
2 changes: 1 addition & 1 deletion test/SILGen/materializeForSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ func inoutAccessOfStaticProperty<T : Beverage>(_ t: T.Type) {
increment(&t.abv)
}

// Test for materializeForSet vs overriden computed property of classes.
// Test for materializeForSet vs overridden computed property of classes.
class BaseForOverride {
var valueStored: Int
var valueComputed: Int { get { } set { } }
Expand Down