Skip to content

[gardening] Fix recently introduced typos. #3733

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 1 commit into from
Jul 24, 2016
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 cmake/modules/SwiftSharedCMakeConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ macro(swift_common_standalone_build_config_llvm product is_cross_compiling)
include(AddSwiftTableGen) # This imports TableGen from LLVM.
include(HandleLLVMOptions)

# HACK: this ugly tweaking is to prevent the propogation of the flag from LLVM
# HACK: this ugly tweaking is to prevent the propagation of the flag from LLVM
# into swift. The use of this flag pollutes all targets, and we are not able
# to remove it on a per-target basis which breaks cross-compilation.
string(REGEX REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
Expand Down
2 changes: 1 addition & 1 deletion docs/Generics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ is effectively parsed as::

by splitting the '>>' operator token into two '>' operator tokens.

However, this is manageable, and is already implemented for the (now depreacted)
However, this is manageable, and is already implemented for the (now deprecated)
protocol composition syntax (protocol<>). The larger problem occurs at expression
context, where the parser cannot disambiguate the tokens::

Expand Down
2 changes: 1 addition & 1 deletion docs/Lexicon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ source code, tests, and commit messages. See also the `LLVM lexicon`_.

IWYU (include what you use)
The accepted wisdom that implementation files (``.cpp``, ``.c``, ``.m``,
``.mm``) should explicity ``#include`` or ``#import`` the headers they use.
``.mm``) should explicitly ``#include`` or ``#import`` the headers they use.
Doing so prevents compilation errors when header files are included in a
different order, or when header files are modified to use forward
declarations instead of direct includes.
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/PrintOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ struct PrintOptions {
/// \brief The information for converting archetypes to specialized types.
std::shared_ptr<TypeTransformContext> TransformContext;

/// \brief If this is not \c nullptr then functions (incuding accessors and
/// \brief If this is not \c nullptr then functions (including accessors and
/// constructors) will be printed with a body that is determined by this
/// function.
std::function<std::string(const ValueDecl *)> FunctionBody;
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SIL/SILOpenedArchetypesTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class SILOpenedArchetypesTracker : public DeleteNotificationHandler {

const SILFunction &getFunction() const { return F; }

// Register a definiton of a given opened archetype.
// Register a definition of a given opened archetype.
void addOpenedArchetypeDef(Type archetype, SILValue Def);

void removeOpenedArchetypeDef(Type archetype, SILValue Def) {
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SILOptimizer/Analysis/ARCAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ namespace swift {
/// EpilogueARCBlockState - Keep track of whether a epilogue ARC instruction has
/// been found.
struct EpilogueARCBlockState {
/// Keep track of whether a eplogue release has been found before and after
/// Keep track of whether a epilogue release has been found before and after
/// this basic block.
bool BBSetIn;
/// The basic block local SILValue we are interested to find epilogue ARC in.
Expand Down
2 changes: 1 addition & 1 deletion lib/Immediate/ImmediateImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace swift {
namespace immediate {

// Returns a handle to the runtime suitable for other 'dlsym' or 'dlclose'
// calls or 'NULL' if an error occured.
// calls or 'NULL' if an error occurred.
void *loadSwiftRuntime(StringRef runtimeLibPath);
bool tryLoadLibraries(ArrayRef<LinkLibrary> LinkLibraries,
SearchPathOptions SearchPathOpts,
Expand Down
4 changes: 2 additions & 2 deletions lib/Parse/ParseType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ ParserResult<TypeRepr> Parser::parseTypeIdentifierOrTypeComposition() {
SourceLoc RAngleLoc = consumeStartingGreater();
auto AnyRange = SourceRange(ProtocolLoc, RAngleLoc);

// Warn that 'protocol<>' is depreacted and offer to
// repalace with the 'Any' keyword
// Warn that 'protocol<>' is deprecated and offer to
// replace with the 'Any' keyword
diagnose(LAngleLoc, diag::deprecated_any_composition)
.fixItReplace(AnyRange, "Any");

Expand Down
4 changes: 2 additions & 2 deletions lib/SILOptimizer/Transforms/CSE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ bool CSE::processOpenExistentialRef(SILInstruction *Inst, ValueBase *V,
SILOpenedArchetypesTracker OpenedArchetypesTracker(*Inst->getFunction());
// Register the new archetype to be used.
OpenedArchetypesTracker.registerOpenedArchetypes(dyn_cast<SILInstruction>(V));
// Use a cloner. It makes copying the instruction and remaping of
// Use a cloner. It makes copying the instruction and remapping of
// opened archetypes trivial.
InstructionCloner Cloner(I->getFunction());
Cloner.registerOpenedExistentialRemapping(
Expand Down Expand Up @@ -744,7 +744,7 @@ bool CSE::processNode(DominanceInfoNode *Node) {
if (ValueBase *V = AvailableValues->lookup(Inst)) {
DEBUG(llvm::dbgs() << "SILCSE CSE: " << *Inst << " to: " << *V << '\n');
// Instructions producing a new opened archetype need a special handling,
// because replacing these intructions may require a replacement
// because replacing these instructions may require a replacement
// of the opened archetype type operands in some of the uses.
if (!isa<OpenExistentialRefInst>(Inst) ||
processOpenExistentialRef(Inst, V, I)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Sema/CSApply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,7 @@ namespace {
Expr *bridgeErrorToObjectiveC(Expr *value) {
auto &tc = cs.getTypeChecker();

// Use _bridgeErrorToNSError to conver to an NSError.
// Use _bridgeErrorToNSError to convert to an NSError.
auto fn = tc.Context.getBridgeErrorToNSError(&tc);
SourceLoc loc = value->getLoc();
if (!fn) {
Expand Down
4 changes: 2 additions & 2 deletions lib/Sema/CSDiag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2279,7 +2279,7 @@ diagnoseEnumInstanceMemberLookup(EnumElementDecl *enumElementDecl,
if (decl0->getName() == decl0->getASTContext().Id_MatchOperator) {
assert(binaryExpr->getArg()->getElements().size() == 2);

// If the rhs of '~=' is the enum type, a single dot suffices
// If the rhs of '~=' is the enum type, a single dot suffixes
// since the type can be inferred
Type secondArgType = binaryExpr->getArg()->getElement(1)->getType();
if (secondArgType->isEqual(enumMetatype->getInstanceType())) {
Expand Down Expand Up @@ -2580,7 +2580,7 @@ bool FailureDiagnosis::diagnoseConversionToBool(Expr *expr, Type exprType) {
}

// If we're trying to convert something from optional type to Bool, then a
// comparision against nil was probably expected.
// comparison against nil was probably expected.
// TODO: It would be nice to handle "!x" --> x == false, but we have no way
// to get to the parent expr at present.
if (exprType->getAnyOptionalObjectType()) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Sema/TypeCheckProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2007,7 +2007,7 @@ static void diagnoseNoWitness(ValueDecl *Requirement, Type RequirementType,
llvm_unreachable("Unknown adopter kind");
}

// FIXME: Infer body indention from the source rather than hard-coding
// FIXME: Infer body indentation from the source rather than hard-coding
// 4 spaces.
std::string ExtraIndent = " ";
StringRef CurrentIndent = Lexer::getIndentationForLine(TC.Context.SourceMgr,
Expand Down
2 changes: 1 addition & 1 deletion lib/Sema/TypeChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ class TypeRefinementContextBuilder : private ASTWalker {
if (CurrentInfo.isContainedIn(NewConstraint)) {
DiagnosticEngine &Diags = TC.Diags;
// Some availability checks will always pass because the minimum
// deployment target gurantees they will never be false. We don't
// deployment target guarantees they will never be false. We don't
// diagnose these checks as useless because the source file may
// be shared with other projects/targets having older deployment
// targets. We don't currently have a mechanism for the user to
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/SDK/Foundation/NSError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class _NSErrorRecoveryAttempter {
}
}

/// Describes an error that may be recoverably by presenting several
/// Describes an error that may be recoverable by presenting several
/// potential recovery options to the user.
public protocol RecoverableError : Error {
/// Provides a set of possible recovery options to present to the user.
Expand All @@ -93,7 +93,7 @@ public protocol RecoverableError : Error {
///
/// This entry point is used for recovery of errors handled at
/// the "application" granularity, where nothing else in the
/// application can proceed until the attmpted error recovery
/// application can proceed until the attempted error recovery
/// completes.
func attemptRecovery(optionIndex recoveryOptionIndex: Int) -> Bool
}
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/Policy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/// The return type of functions that do not return normally; a type with no
/// values.
///
/// Use `Never` as the return type when declarting a closure, function, or
/// Use `Never` as the return type when declaring a closure, function, or
/// method that unconditionally throws an error, traps, or otherwise does
/// not terminate.
///
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/UnsafeRawPointer.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ public struct Unsafe${Mutable}RawPointer : Strideable, Hashable, _Pointer {
/// - Note: Storing a copy of a nontrivial value into memory
/// requires that the user know the type of value previously in
/// memory, and requires initialization or assignment of the
/// memory. This can be acheived via a typed `UnsafeMutablePointer`
/// memory. This can be achieved via a typed `UnsafeMutablePointer`
/// or via a raw pointer `self`, as follows, where `U` is the
/// previous type and `T` is the copied value's type:
/// `let typedPtr = self.bindMemory(to: U.self, capacity: 1)`
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/stubs/Stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ __muloti4(ti_int a, ti_int b, int* overflow)
// FIXME: ideally we would have a slow path here for Windows which would be
// lowered to instructions as though MSVC had generated. There does not seem to
// be a MSVC provided multiply with overflow detection that I can see, but this
// avoids an unncessary dependency on compiler-rt for a single function.
// avoids an unnecessary dependency on compiler-rt for a single function.
#if (defined(__linux__) && defined(__arm__)) || defined(_MSC_VER)
// Similar to above, but with mulodi4. Perhaps this is
// something that shouldn't be done, and is a bandaid over
Expand Down
4 changes: 2 additions & 2 deletions test/Constraints/diagnostics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ func r24251022() {

func overloadSetResultType(_ a : Int, b : Int) -> Int {
// https://twitter.com/_jlfischer/status/712337382175952896
// TODO: <rdar://problem/27391581> QoI: Nonsensitical "binary operator '&&' cannot be applied to two 'Bool' operands"
// TODO: <rdar://problem/27391581> QoI: Nonsensical "binary operator '&&' cannot be applied to two 'Bool' operands"
return a == b && 1 == 2 // expected-error {{binary operator '&&' cannot be applied to two 'Bool' operands}}
// expected-note @-1 {{expected an argument list of type '(Bool, @autoclosure () throws -> Bool)'}}
}
Expand Down Expand Up @@ -821,7 +821,7 @@ class Foo23752537 {

extension Foo23752537 {
func isEquivalent(other: Foo23752537) {
// TODO: <rdar://problem/27391581> QoI: Nonsensitical "binary operator '&&' cannot be applied to two 'Bool' operands"
// TODO: <rdar://problem/27391581> QoI: Nonsensical "binary operator '&&' cannot be applied to two 'Bool' operands"
// expected-error @+1 {{binary operator '&&' cannot be applied to two 'Bool' operands}}
return (self.title != other.title && self.message != other.message)
// expected-note @-1 {{expected an argument list of type '(Bool, @autoclosure () throws -> Bool)'}}
Expand Down
12 changes: 6 additions & 6 deletions test/Parse/enum.swift
Original file line number Diff line number Diff line change
Expand Up @@ -459,40 +459,40 @@ enum SE0036 {
_ = SE0036.A
}

func staticReferencInInstanceMethod() {
func staticReferenceInInstanceMethod() {
_ = A // expected-error {{enum element 'A' cannot be referenced as an instance member}} {{9-9=SE0036.}}
_ = SE0036.A
}

static func staticReferencInSwitchInStaticMethod() {
static func staticReferenceInSwitchInStaticMethod() {
switch SE0036.A {
case A: break
case B(_): break
}
}

func staticReferencInSwitchInInstanceMethod() {
func staticReferenceInSwitchInInstanceMethod() {
switch self {
case A: break // expected-error {{enum element 'A' cannot be referenced as an instance member}} {{10-10=.}}
case B(_): break // expected-error {{enum element 'B' cannot be referenced as an instance member}} {{10-10=.}}
}
}

func explicitReferencInSwitch() {
func explicitReferenceInSwitch() {
switch SE0036.A {
case SE0036.A: break
case SE0036.B(_): break
}
}

func dotReferencInSwitchInInstanceMethod() {
func dotReferenceInSwitchInInstanceMethod() {
switch self {
case .A: break
case .B(_): break
}
}

static func dotReferencInSwitchInStaticMethod() {
static func dotReferenceInSwitchInStaticMethod() {
switch SE0036.A {
case .A: break
case .B(_): break
Expand Down
2 changes: 1 addition & 1 deletion test/SILOptimizer/swap_refcnt.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %target-swift-frontend -O -emit-sil %s | FileCheck %s
// REQUIRES: rdar:27506150> SILOptimizer/swap_refcnt.swift failes after noreturn -> Never changes
// REQUIRES: rdar:27506150> SILOptimizer/swap_refcnt.swift fails after noreturn -> Never changes

// Make sure we can swap two values in an array without retaining anything.

Expand Down
2 changes: 1 addition & 1 deletion tools/SourceKit/lib/SwiftLang/SwiftEditorInterfaceGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class SwiftInterfaceGenContext::Implementation {
SourceTextInfo Info;
// This is the non-typechecked AST for the generated interface source.
CompilerInstance TextCI;
// Syncronize access to the embedded compiler instance (if we don't have an
// Synchronize access to the embedded compiler instance (if we don't have an
// ASTUnit).
WorkQueue Queue{WorkQueue::Dequeuing::Serial,
"sourcekit.swift.InterfaceGenContext"};
Expand Down
4 changes: 2 additions & 2 deletions tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ static bool passCursorInfoForDecl(const ValueDecl *VD,
llvm::raw_svector_ostream OS(SS);
SwiftLangSupport::printTypeUSR(ContainerTy, OS);
}
unsigned MangedContainerTypeEnd = SS.size();
unsigned MangledContainerTypeEnd = SS.size();

unsigned DocCommentBegin = SS.size();
{
Expand Down Expand Up @@ -791,7 +791,7 @@ static bool passCursorInfoForDecl(const ValueDecl *VD,
MangledTypeEnd - MangledTypeStart);

StringRef ContainerTypeUsr = StringRef(SS.begin()+MangledContainerTypeStart,
MangedContainerTypeEnd - MangledContainerTypeStart);
MangledContainerTypeEnd - MangledContainerTypeStart);
StringRef DocComment = StringRef(SS.begin()+DocCommentBegin,
DocCommentEnd-DocCommentBegin);
StringRef AnnotatedDecl = StringRef(SS.begin()+DeclBegin,
Expand Down