diff --git a/docs/proposals/OptimizerEffects.rst b/docs/proposals/OptimizerEffects.rst index ae4ec5ded155f..62cda039cbca8 100644 --- a/docs/proposals/OptimizerEffects.rst +++ b/docs/proposals/OptimizerEffects.rst @@ -20,7 +20,7 @@ Introduction This document formalizes the effects that functions have on program state for the purpose of facilitating compiler optimization. By modeling more precise function effects, the optimizer can make more -assumptions leading to more agressive transformation of the program. +assumptions leading to more aggressive transformation of the program. Function effects may be deduced by the compiler during program analyis. However, in certain situations it is helpful to directly @@ -919,5 +919,5 @@ Generally, a default-safe policy provides a much better user model from some effects. For example, we could decide that functions cannot affect unspecified state by default. If the user accesses globals, they then need to annotate their function. However, default safety -dictates that any neccessary annotations should be introduced before +dictates that any necessary annotations should be introduced before declaring API stability. diff --git a/docs/proposals/containers_value_type.html b/docs/proposals/containers_value_type.html index 6599a83cc84c0..ff7855e29e464 100644 --- a/docs/proposals/containers_value_type.html +++ b/docs/proposals/containers_value_type.html @@ -347,7 +347,7 @@

archives is an in-out argument. And just as importantly, that archivePath is not to be modified within _checkPathForArchiveAndAddToArray. However if -archivePath is a mutable object with reference semantics, we loose +archivePath is a mutable object with reference semantics, we lose that ability to locally reason about this code, even in Swift.

diff --git a/docs/proposals/valref.rst b/docs/proposals/valref.rst index 6266129ffd804..0d69d0f82e6ba 100644 --- a/docs/proposals/valref.rst +++ b/docs/proposals/valref.rst @@ -150,7 +150,7 @@ Instance variables can be explicitly declared ``val`` or ``ref``:: When a value is copied, all of its instance variables declared ``val`` (implicitly or explicitly) are copied. Instance variables declared ``ref`` merely have their reference counts incremented (i.e. the -refrence is copied). Therefore, when the defaults are in play, the +reference is copied). Therefore, when the defaults are in play, the semantic rules already defined for Swift are preserved. The new rules are as follows: diff --git a/include/swift/Parse/Lexer.h b/include/swift/Parse/Lexer.h index b1b01802b9092..f6f4afa4d7abe 100644 --- a/include/swift/Parse/Lexer.h +++ b/include/swift/Parse/Lexer.h @@ -241,7 +241,7 @@ class Lexer { } /// \brief Retrieve the source location that points just past the - /// end of the token refered to by \c Loc. + /// end of the token referred to by \c Loc. /// /// \param SM The source manager in which the given source location /// resides. diff --git a/include/swift/SIL/Dominance.h b/include/swift/SIL/Dominance.h index 03a1b307e1136..a98cee032c69f 100644 --- a/include/swift/SIL/Dominance.h +++ b/include/swift/SIL/Dominance.h @@ -41,7 +41,7 @@ class DominanceInfo : public llvm::DominatorTreeBase { /// Return true if the other dominator tree does not match this dominator /// tree. - inline bool errorOccuredOnComparison(const DominanceInfo &Other) const { + inline bool errorOccurredOnComparison(const DominanceInfo &Other) const { const auto *R = getRootNode(); const auto *OtherR = Other.getRootNode(); @@ -131,7 +131,7 @@ class PostDominanceInfo : public llvm::DominatorTreeBase { /// Return true if the other dominator tree does not match this dominator /// tree. - inline bool errorOccuredOnComparison(const PostDominanceInfo &Other) const { + inline bool errorOccurredOnComparison(const PostDominanceInfo &Other) const { const auto *R = getRootNode(); const auto *OtherR = Other.getRootNode(); diff --git a/include/swift/SILAnalysis/LoopRegionAnalysis.h b/include/swift/SILAnalysis/LoopRegionAnalysis.h index 12207027fc995..0ed4474564b83 100644 --- a/include/swift/SILAnalysis/LoopRegionAnalysis.h +++ b/include/swift/SILAnalysis/LoopRegionAnalysis.h @@ -395,7 +395,7 @@ class LoopRegion { llvm::SmallVector Subregions; /// A map from RPO number of a subregion loop's preheader to a subloop - /// regions id. This is neccessary since we represent a loop in the + /// regions id. This is necessary since we represent a loop in the /// Subregions array by the RPO number of its header. llvm::SmallVector, 2> Subloops; diff --git a/lib/IRGen/GenDecl.cpp b/lib/IRGen/GenDecl.cpp index e98663f08961f..6500ca64798d7 100644 --- a/lib/IRGen/GenDecl.cpp +++ b/lib/IRGen/GenDecl.cpp @@ -743,7 +743,7 @@ void IRGenModuleDispatcher::emitGlobalTopLevel() { } void IRGenModule::finishEmitAfterTopLevel() { - // Emit the implicit import of the swift standard libary. + // Emit the implicit import of the swift standard library. if (DebugInfo) { std::pair AccessPath[] = { { Context.StdlibModuleName, swift::SourceLoc() } diff --git a/lib/IRGen/IRGenDebugInfo.h b/lib/IRGen/IRGenDebugInfo.h index 51521bccb33de..611a24c3c00d1 100644 --- a/lib/IRGen/IRGenDebugInfo.h +++ b/lib/IRGen/IRGenDebugInfo.h @@ -100,7 +100,7 @@ class IRGenDebugInfo { Location LastDebugLoc; /// The last location that was emitted. const SILDebugScope *LastScope; /// The scope of that last location. - bool IsLibrary; /// Whether this is a libary or a top level module. + bool IsLibrary; /// Whether this is a library or a top level module. #ifndef NDEBUG /// The basic block where the location was last changed. llvm::BasicBlock *LastBasicBlock; diff --git a/lib/SIL/Dominance.cpp b/lib/SIL/Dominance.cpp index 907b928f0dc6d..7fe21ac8750e8 100644 --- a/lib/SIL/Dominance.cpp +++ b/lib/SIL/Dominance.cpp @@ -55,7 +55,7 @@ void DominanceInfo::verify() const { DominanceInfo OtherDT(F); // And compare. - if (errorOccuredOnComparison(OtherDT)) { + if (errorOccurredOnComparison(OtherDT)) { llvm::errs() << "DominatorTree is not up to date!\nComputed:\n"; print(llvm::errs()); llvm::errs() << "\nActual:\n"; @@ -102,7 +102,7 @@ void PostDominanceInfo::verify() const { PostDominanceInfo OtherDT(F); // And compare. - if (errorOccuredOnComparison(OtherDT)) { + if (errorOccurredOnComparison(OtherDT)) { llvm::errs() << "PostDominatorTree is not up to date!\nComputed:\n"; print(llvm::errs()); llvm::errs() << "\nActual:\n"; diff --git a/lib/SILPasses/ARC/GlobalARCPairingAnalysis.h b/lib/SILPasses/ARC/GlobalARCPairingAnalysis.h index fe7a63a01b13d..3bc6a5b4644f1 100644 --- a/lib/SILPasses/ARC/GlobalARCPairingAnalysis.h +++ b/lib/SILPasses/ARC/GlobalARCPairingAnalysis.h @@ -43,7 +43,7 @@ struct ARCMatchingSet { llvm::SetVector Increments; /// An insertion point for an increment means the earliest point in the - /// program after the increment has occured that the increment can be moved to + /// program after the increment has occurred that the increment can be moved to /// without moving the increment over an instruction that may decrement a /// reference count. llvm::SetVector IncrementInsertPts; diff --git a/lib/SILPasses/IPO/CapturePromotion.cpp b/lib/SILPasses/IPO/CapturePromotion.cpp index cdb534283db52..b23d091768a31 100644 --- a/lib/SILPasses/IPO/CapturePromotion.cpp +++ b/lib/SILPasses/IPO/CapturePromotion.cpp @@ -257,7 +257,7 @@ void ReachabilityInfo::compute() { if (!Changed) { // If we have not detected a change yet, then calculate new // reachabilities into a new bit vector so we can determine if any - // change has occured. + // change has occurred. NewSet = CurSet; for (auto PI = BB.pred_begin(), PE = BB.pred_end(); PI != PE; ++PI) { unsigned PredID = BlockMap[*PI]; diff --git a/lib/SILPasses/Loop/ArrayBoundsCheckOpts.cpp b/lib/SILPasses/Loop/ArrayBoundsCheckOpts.cpp index 47a9d5e3c4ed0..5f4bb296a464c 100644 --- a/lib/SILPasses/Loop/ArrayBoundsCheckOpts.cpp +++ b/lib/SILPasses/Loop/ArrayBoundsCheckOpts.cpp @@ -1069,7 +1069,7 @@ static bool hoistBoundsChecks(SILLoop *Loop, DominanceInfo *DT, SILLoopInfo *LI, auto *Preheader = Loop->getLoopPreheader(); if (!Preheader) { - // TODO: create one if neccessary. + // TODO: create one if necessary. return false; } diff --git a/lib/SILPasses/Loop/COWArrayOpt.cpp b/lib/SILPasses/Loop/COWArrayOpt.cpp index 5584d7c770f42..4a44a5df89dfe 100644 --- a/lib/SILPasses/Loop/COWArrayOpt.cpp +++ b/lib/SILPasses/Loop/COWArrayOpt.cpp @@ -2235,7 +2235,7 @@ void ArrayPropertiesSpecializer::specializeLoopNest() { auto *CheckBlock = splitBasicBlockAndBranch(B, HoistableLoopPreheader->getTerminator(), DomTree, nullptr); - // Get the exit blocks of the orignal loop. + // Get the exit blocks of the original loop. auto *Header = CheckBlock->getSingleSuccessor(); assert(Header); diff --git a/lib/Sema/CSDiag.cpp b/lib/Sema/CSDiag.cpp index ffa25b0bb118b..0a23a1b6d0902 100644 --- a/lib/Sema/CSDiag.cpp +++ b/lib/Sema/CSDiag.cpp @@ -2252,7 +2252,7 @@ diagnoseUnviableLookupResults(MemberLookupResult &result, Type baseObjTy, return; } -// In the absense of a better conversion constraint failure, point out the +// In the absence of a better conversion constraint failure, point out the // inability to find an appropriate overload. bool FailureDiagnosis::diagnoseGeneralOverloadFailure(Constraint *constraint) { Constraint *bindOverload = constraint; diff --git a/lib/Sema/ConstraintSystem.h b/lib/Sema/ConstraintSystem.h index 510a05f37433f..1e5708d2ba4cb 100644 --- a/lib/Sema/ConstraintSystem.h +++ b/lib/Sema/ConstraintSystem.h @@ -1145,7 +1145,7 @@ class ConstraintSystem { Constraint *failedConstraint = nullptr; - /// \brief Failures that occured while solving. + /// \brief Failures that occurred while solving. /// /// FIXME: We really need to track overload sets and type variable bindings /// to make any sense of this data. Also, it probably belongs within diff --git a/lib/Serialization/DeserializeSIL.cpp b/lib/Serialization/DeserializeSIL.cpp index e94c411697285..abad107aa5bb2 100644 --- a/lib/Serialization/DeserializeSIL.cpp +++ b/lib/Serialization/DeserializeSIL.cpp @@ -538,7 +538,7 @@ SILFunction *SILDeserializer::readSILFunction(DeclID FID, // If CurrentBB is empty, just return fn. The code in readSILInstruction // assumes that such a situation means that fn is a declaration. Thus it // is using return false to mean two different things, error a failure - // occured and this is a declaration. Work around that for now. + // occurred and this is a declaration. Work around that for now. if (!CurrentBB) return fn; diff --git a/stdlib/public/stubs/Stubs.cpp b/stdlib/public/stubs/Stubs.cpp index c1307fd12ee17..3dabfad3a09ff 100644 --- a/stdlib/public/stubs/Stubs.cpp +++ b/stdlib/public/stubs/Stubs.cpp @@ -186,7 +186,7 @@ extern "C" uint64_t swift_float80ToString(char *Buffer, size_t BufferLength, /// line. Can be NULL if no characters were read. /// /// \returns Size of character data returned in \c LinePtr, or -1 -/// if an error occured, or EOF was reached. +/// if an error occurred, or EOF was reached. extern "C" ssize_t swift_stdlib_readLine_stdin(char **LinePtr) { size_t Capacity = 0; return getline(LinePtr, &Capacity, stdin); diff --git a/utils/benchmark/Richards/richards.swift b/utils/benchmark/Richards/richards.swift index b5349b0da5602..55518ac0d2fdc 100644 --- a/utils/benchmark/Richards/richards.swift +++ b/utils/benchmark/Richards/richards.swift @@ -339,7 +339,7 @@ struct Richards { if v2.count == 0 { return holdself() } - // Orignal C impl masks with MAXINT. Why? + // Original C impl masks with MAXINT. Why? if (v1.taskid & 1) == 0 { v1 = Task.Val1.TaskID(v1.taskid >> 1) return release(TIDevA)