Skip to content

Commit 81e7439

Browse files
Fix typos.
1 parent 202fc75 commit 81e7439

34 files changed

+44
-44
lines changed

Diff for: include/swift/AST/ASTPrinter.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class ASTPrinter {
105105
PendingDeclLocCallback = D;
106106
}
107107

108-
/// To sanitize a malformatted utf8 string to a well-formatted one.
108+
/// To sanitize a malformed utf8 string to a well-formed one.
109109
static std::string sanitizeUtf8(StringRef Text);
110110
static bool printTypeInterface(Type Ty, DeclContext *DC, std::string &Result);
111111
static bool printTypeInterface(Type Ty, DeclContext *DC, llvm::raw_ostream &Out);

Diff for: include/swift/AST/Availability.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class VersionRange {
117117
}
118118

119119
/// Mutates this range to be the union of itself and Other. This is the
120-
/// join operator (least upper bound) in the veresion range lattice.
120+
/// join operator (least upper bound) in the version range lattice.
121121
void unionWith(const VersionRange &Other) {
122122
// With the existing lattice this operation is precise. If the lattice
123123
// is ever extended it is important that this operation be an

Diff for: include/swift/AST/Decl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ enum class CircularityCheck {
209209
Checked
210210
};
211211

212-
/// Keeps track of whrther a given class inherits initializers from its
212+
/// Keeps track of whether a given class inherits initializers from its
213213
/// superclass.
214214
enum class StoredInheritsSuperclassInits {
215215
/// We have not yet checked.

Diff for: include/swift/AST/Types.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ class alignas(1 << TypeAlignInBits) TypeBase {
425425
return getRecursiveProperties().hasOpenedExistential();
426426
}
427427

428-
/// Determine whether the type involves the given opend existential
428+
/// Determine whether the type involves the given opened existential
429429
/// archetype.
430430
bool hasOpenedExistential(ArchetypeType *opened);
431431

Diff for: include/swift/SIL/SILInstruction.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -3816,7 +3816,7 @@ class CondBranchInst : public TermInst {
38163816
ConditionIdx
38173817
};
38183818
enum {
3819-
// Map branch targets to block sucessor indices.
3819+
// Map branch targets to block successor indices.
38203820
TrueIdx,
38213821
FalseIdx
38223822
};
@@ -4252,7 +4252,7 @@ class CheckedCastAddrBranchInst : public TermInst {
42524252
class TryApplyInstBase : public TermInst {
42534253
public:
42544254
enum {
4255-
// Map branch targets to block sucessor indices.
4255+
// Map branch targets to block successor indices.
42564256
NormalIdx,
42574257
ErrorIdx
42584258
};

Diff for: include/swift/SIL/SILValueProjection.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ class LSValue : public SILValueProjection {
370370
/// we only need a map between the projection tree of a SILType and the value
371371
/// each leaf node takes. This will be implemented once ProjectionPath memory
372372
/// cost is reduced and made copyable (its copy constructor is deleted at the
373-
/// momemt).
373+
/// moment).
374374
static SILValue reduce(LSLocation &Base, SILModule *Mod,
375375
LSLocationValueMap &LocAndVal,
376376
SILInstruction *InsertPt,

Diff for: include/swift/SILOptimizer/Analysis/EscapeAnalysis.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class EscapeAnalysis : public BottomUpIPAnalysis {
118118
/// pointer points to (see NodeType).
119119
class CGNode {
120120

121-
/// The associated value in the functino. It is only used for debug printing.
121+
/// The associated value in the function. It is only used for debug printing.
122122
/// There may be multiple nodes associated to the same value, e.g. a Content
123123
/// node has the same V as its points-to predecessor.
124124
ValueBase *V;
@@ -341,7 +341,7 @@ class EscapeAnalysis : public BottomUpIPAnalysis {
341341
/// 2) A node can only have a single outgoing points-to edge (is enforced by
342342
/// CGNode::pointsTo being a single pointer and not a vector).
343343
/// 3) The target of a points-to edge must be a Content node.
344-
/// 4) For any node N, all pathes starting at N which consist of only
344+
/// 4) For any node N, all paths starting at N which consist of only
345345
/// defer-edges and a single trailing points-to edge must lead to the same
346346
/// Content node.
347347
class ConnectionGraph {
@@ -679,7 +679,7 @@ class EscapeAnalysis : public BottomUpIPAnalysis {
679679
/// Sets all operands and results of \p I as global escaping.
680680
void setAllEscaping(SILInstruction *I, ConnectionGraph *ConGraph);
681681

682-
/// Recomputes the connection grpah for the function \p Initial and
682+
/// Recomputes the connection graph for the function \p Initial and
683683
/// all called functions, up to a recursion depth of MaxRecursionDepth.
684684
void recompute(FunctionInfo *Initial);
685685

@@ -725,7 +725,7 @@ class EscapeAnalysis : public BottomUpIPAnalysis {
725725

726726
/// Returns true if the value \p V or its content can escape to the
727727
/// function call \p FAS.
728-
/// This is the same as above, execpt that it returns true if an address of
728+
/// This is the same as above, except that it returns true if an address of
729729
/// a contained property escapes.
730730
bool canObjectOrContentEscapeTo(SILValue V, FullApplySite FAS);
731731

Diff for: include/swift/SILOptimizer/Analysis/LoopRegionAnalysis.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
///
6262
/// Then we perform a postorder DFS of the loop nest. The postorder provides the
6363
/// inductive rule that all loops will be visited after all of their subloops
64-
/// hae been visited. If a Loop has no subloops (i.e. all subregions are
64+
/// have been visited. If a Loop has no subloops (i.e. all subregions are
6565
/// blocks), we do nothing. Otherwise, if the loop does have subloops, we visit
6666
/// each subloop and do the following:
6767
///

Diff for: include/swift/SILOptimizer/Analysis/SideEffectAnalysis.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class SideEffectAnalysis : public BottomUpIPAnalysis {
181181
/// release instructions, e.g. isUnique?
182182
bool ReadsRC = false;
183183

184-
/// Returns the effecs for an address or reference. This might be a
184+
/// Returns the effects for an address or reference. This might be a
185185
/// parameter, the LocalEffects or, if the value cannot be associated to one
186186
/// of them, the GlobalEffects.
187187
Effects *getEffectsOn(SILValue Addr);

Diff for: lib/AST/ASTPrinter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ std::string ASTPrinter::sanitizeUtf8(StringRef Text) {
121121
Builder.append(Data, Data + Step);
122122
} else {
123123

124-
// If malformatted, add replacement characters.
124+
// If malformed, add replacement characters.
125125
Builder.append(Replacement);
126126
}
127127
Data += Step;

Diff for: lib/AST/Decl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ ValueDecl::getAccessSemanticsFromContext(const DeclContext *UseDC) const {
11831183

11841184
// "StoredWithTrivialAccessors" are generally always accessed indirectly,
11851185
// but if we know that the trivial accessor will always produce the same
1186-
// thing as the getter/setter (i.e., it can't be overriden), then just do a
1186+
// thing as the getter/setter (i.e., it can't be overridden), then just do a
11871187
// direct access.
11881188
//
11891189
// This is true in structs and for final properties.

Diff for: lib/AST/LookupVisibleDecls.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ class OverrideFilteringConsumer : public VisibleDeclConsumer {
588588
}
589589
auto &PossiblyConflicting = FoundDecls[VD->getName()];
590590

591-
// Check all overriden decls.
591+
// Check all overridden decls.
592592
{
593593
auto *CurrentVD = VD->getOverriddenDecl();
594594
while (CurrentVD) {

Diff for: lib/AST/NameLookup.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ class swift::MemberLookupTable {
698698
/// Update a lookup table with members from newly-added extensions.
699699
void updateLookupTable(NominalTypeDecl *nominal);
700700

701-
/// \brief Add the given member to the lookup tabke.
701+
/// \brief Add the given member to the lookup table.
702702
void addMember(Decl *members);
703703

704704
/// \brief Add the given members to the lookup table.

Diff for: lib/AST/Verifier.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ struct ASTNodeBase {};
674674

675675
if (auto Overridden = D->getOverriddenDecl()) {
676676
if (D->getDeclContext() == Overridden->getDeclContext()) {
677-
PrettyStackTraceDecl debugStack("verifying overriden", D);
677+
PrettyStackTraceDecl debugStack("verifying overridden", D);
678678
Out << "cannot override a decl in the same DeclContext";
679679
D->dump(Out);
680680
Overridden->dump(Out);

Diff for: lib/ClangImporter/ClangImporter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4145,7 +4145,7 @@ ClangImporter::Implementation::createExtensionWriter(clang::ASTWriter &writer) {
41454145
auto named = dyn_cast<clang::NamedDecl>(decl);
41464146
if (!named) continue;
41474147

4148-
// Add this entry to the lookup tabke.
4148+
// Add this entry to the lookup table.
41494149
addEntryToLookupTable(sema, table, named);
41504150
}
41514151

Diff for: lib/ClangImporter/ImporterImpl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ class LLVM_LIBRARY_VISIBILITY ClangImporter::Implementation
421421
/// \brief Check if the declaration is one of the specially handled
422422
/// accessibility APIs.
423423
///
424-
/// These appaer as both properties and methods in ObjC and should be
424+
/// These appear as both properties and methods in ObjC and should be
425425
/// imported as methods into Swift.
426426
static bool isAccessibilityDecl(const clang::Decl *objCMethodOrProp);
427427

Diff for: lib/SILGen/SILGen.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class LLVM_LIBRARY_VISIBILITY SILGenModule : public ASTVisitor<SILGenModule> {
227227
void emitFunction(FuncDecl *fd);
228228

229229
/// \brief Generates code for the given closure expression and adds the
230-
/// SILFunction to the current SILModule under the nane SILDeclRef(ce).
230+
/// SILFunction to the current SILModule under the name SILDeclRef(ce).
231231
SILFunction *emitClosure(AbstractClosureExpr *ce);
232232
/// Generates code for the given ConstructorDecl and adds
233233
/// the SILFunction to the current SILModule under the name SILDeclRef(decl).

Diff for: lib/SILGen/SILGenPoly.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
// parameter of the base with a concrete type, the derived class can override
5050
// methods in the base that involved generic types. In the derived class, a
5151
// method override that involves substituted types will have a different
52-
// SIL lowering than the base method. In this case, the overriden vtable entry
52+
// SIL lowering than the base method. In this case, the overridden vtable entry
5353
// will point to a thunk which transforms parameters and results and invokes
5454
// the derived method.
5555
//
@@ -1310,7 +1310,7 @@ static SILValue getThunkResult(SILGenFunction &gen,
13101310
/// \param inputOrigType Abstraction pattern of function value being thunked
13111311
/// \param inputSubstType Formal AST type of function value being thunked
13121312
/// \param outputOrigType Abstraction pattern of the thunk
1313-
/// \param outputSubstType Formal AST type of the thuk
1313+
/// \param outputSubstType Formal AST type of the thunk
13141314
static void buildThunkBody(SILGenFunction &gen, SILLocation loc,
13151315
AbstractionPattern inputOrigType,
13161316
CanAnyFunctionType inputSubstType,

Diff for: lib/SILOptimizer/ARC/ARCRegionState.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ARCRegionState {
3434
/// The region that this ARCRegionState summarizes information for.
3535
///
3636
/// The only time that the pointer is null is during initialization. Using
37-
/// NullablePtr is just a convient way to make sure that we assert if we
37+
/// NullablePtr is just a convenient way to make sure that we assert if we
3838
/// attempt to use Region during initialization before the pointer is set.
3939
NullablePtr<LoopRegion> Region;
4040

Diff for: lib/SILOptimizer/ARC/GlobalARCPairingAnalysis.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class CodeMotionOrDeleteCallback {
9595
bool madeChange() const { return Changed; }
9696
};
9797

98-
/// A wrapper around the results of the bottomup/topdown dataflow that knows how
98+
/// A wrapper around the results of the bottom-up/top-down dataflow that knows how
9999
/// to pair the retains/releases in those results.
100100
struct ARCPairingContext {
101101
SILFunction &F;

Diff for: lib/SILOptimizer/Analysis/EscapeAnalysis.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ updatePointsTo(CGNode *InitialNode, CGNode *pointsTo) {
297297
}
298298
}
299299
if (isInitialSet) {
300-
// Here we handle a special case: all defer-edge pathes must eventually end
300+
// Here we handle a special case: all defer-edge paths must eventually end
301301
// in a points-to edge to pointsTo. We ensure this by setting the edge on
302302
// nodes which have no defer-successors (see above). But this does not cover
303303
// the case where there is a terminating cyle in the defer-edge path,
@@ -1547,7 +1547,7 @@ bool EscapeAnalysis::canEscapeToUsePoint(SILValue V, ValueBase *UsePoint,
15471547
if (!Node)
15481548
return true;
15491549

1550-
// First check if there are escape pathes which we don't explicitly see
1550+
// First check if there are escape paths which we don't explicitly see
15511551
// in the graph.
15521552
if (Node->escapesInsideFunction(isNotAliasingArgument(V)))
15531553
return true;
@@ -1574,7 +1574,7 @@ bool EscapeAnalysis::canObjectOrContentEscapeTo(SILValue V, FullApplySite FAS) {
15741574
if (!Node)
15751575
return true;
15761576

1577-
// First check if there are escape pathes which we don't explicitly see
1577+
// First check if there are escape paths which we don't explicitly see
15781578
// in the graph.
15791579
if (Node->escapesInsideFunction(isNotAliasingArgument(V)))
15801580
return true;

Diff for: lib/SILOptimizer/IPO/CapturePromotion.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ static llvm::SmallString<64> getSpecializedName(SILFunction *F,
391391

392392
/// \brief Create the function corresponding to the clone of the original
393393
/// closure with the signature modified to reflect promotable captures (which
394-
/// are givien by PromotableIndices, such that each entry in the set is the
394+
/// are given by PromotableIndices, such that each entry in the set is the
395395
/// index of the box containing the variable in the closure's argument list, and
396396
/// the address of the box's contents is the argument immediately following each
397397
/// box argument); does not actually clone the body of the function

Diff for: lib/SILOptimizer/IPO/DeadFunctionElimination.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class FunctionLivenessComputation {
8787

8888
/// Gets or creates the MethodInfo for a vtable or witness table method.
8989
/// \p decl The method declaration. In case of a vtable method this is always
90-
/// the most overriden method.
90+
/// the most overridden method.
9191
MethodInfo *getMethodInfo(AbstractFunctionDecl *decl) {
9292
MethodInfo *&entry = MethodInfos[decl];
9393
if (entry == nullptr) {

Diff for: lib/SILOptimizer/IPO/GlobalPropertyOpt.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace {
3535
/// The GlobalPropertyOpt performs an analysis on the whole module to determine
3636
/// the values of high-level properties.
3737
///
38-
/// Currently only one property is handled and thats the isNativeTypeChecked
38+
/// Currently only one property is handled and that's the isNativeTypeChecked
3939
/// property for arrays. If the property can be proved to be true, the
4040
/// corresponding semantics-call is replaced by a true-literal.
4141
class GlobalPropertyOpt {

Diff for: lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2161,7 +2161,7 @@ computePredsLiveOut(SILBasicBlock *BB) {
21612161
DEBUG(llvm::dbgs() << " Get liveness for block " << BB->getDebugID() << "\n");
21622162

21632163
// Collect blocks for which we have to calculate the out-availability.
2164-
// These are the pathes from blocks with known out-availability to the BB.
2164+
// These are the paths from blocks with known out-availability to the BB.
21652165
WorkListType WorkList;
21662166
for (auto Pred : BB->getPreds()) {
21672167
putIntoWorkList(Pred, WorkList);

Diff for: lib/SILOptimizer/Mandatory/DiagnoseUnreachable.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ struct UnreachableInfo {
6666
/// it possible.
6767
class UnreachableUserCodeReportingState {
6868
public:
69-
/// \brief The set of top-level blocks that became immediately unreachbale due
69+
/// \brief The set of top-level blocks that became immediately unreachable due
7070
/// to conditional branch folding, etc.
7171
///
7272
/// This is a SetVector since several blocks may lead to the same error
@@ -200,7 +200,7 @@ static bool constantFoldTerminator(SILBasicBlock &BB,
200200
SILBuilderWithScope B(&BB, CBI);
201201

202202
// Determine which of the successors is unreachable and create a new
203-
// terminator that only branches to the reachable sucessor.
203+
// terminator that only branches to the reachable successor.
204204
SILBasicBlock *UnreachableBlock = nullptr;
205205
bool CondIsTrue = false;
206206
if (ConstCond->getValue() == APInt(1, /*value*/ 0, false)) {
@@ -645,7 +645,7 @@ static bool diagnoseUnreachableBlock(const SILBasicBlock &B,
645645
HasReachablePred = true;
646646
}
647647

648-
// If all of the predecessors of this sucessor are unreachable, check if
648+
// If all of the predecessors of this successor are unreachable, check if
649649
// it contains user code.
650650
if (!HasReachablePred && diagnoseUnreachableBlock(*SB, M, Reachable,
651651
State, TopLevelB, Visited))

Diff for: lib/SILOptimizer/Transforms/DeadCodeElimination.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ void DCE::markValueLive(ValueBase *V) {
197197
}
198198

199199
/// Gets the producing instruction of a cond_fail condition. Currently these
200-
/// are overflow builtints but may be extended to other instructions in the
200+
/// are overflow builtins but may be extended to other instructions in the
201201
/// future.
202202
static SILInstruction *getProducer(CondFailInst *CFI) {
203203
// Check for the pattern:

Diff for: lib/SILOptimizer/Transforms/MergeCondFail.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace {
3737
///
3838
/// We can merge cond_fail instructions if there is no side-effect or memory
3939
/// write in between them.
40-
/// This pass merges cond_fail instructions by building the disconjunction of
40+
/// This pass merges cond_fail instructions by building the disjunction of
4141
/// their operands.
4242
class MergeCondFailInsts : public SILFunctionTransform {
4343
public:

Diff for: lib/SILOptimizer/Transforms/RedundantLoadElimination.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/// In this case, one can replace the load instruction with the previous
2121
/// results.
2222
///
23-
/// Redudant Load Elimination (RLE) eliminates such loads by:
23+
/// Redundant Load Elimination (RLE) eliminates such loads by:
2424
///
2525
/// 1. Introducing a notion of a LSLocation that is used to model object
2626
/// fields. (See below for more details).
@@ -337,7 +337,7 @@ namespace {
337337

338338
using BBValueMap = llvm::DenseMap<SILBasicBlock *, SILValue>;
339339

340-
/// This class stores global state that we use when computing redudant load and
340+
/// This class stores global state that we use when computing redundant load and
341341
/// their replacement in each basic block.
342342
class RLEContext {
343343
/// Function currently processing.

Diff for: lib/SILOptimizer/Transforms/SILCodeMotion.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ static bool hoistDecrementsToPredecessors(SILBasicBlock *BB, AliasAnalysis *AA,
981981

982982
return HoistedDecrement;
983983
}
984-
/// Try sink a retain as far as possible. This is either to sucessor BBs,
984+
/// Try sink a retain as far as possible. This is either to successor BBs,
985985
/// or as far down the current BB as possible
986986
static bool sinkRefCountIncrement(SILBasicBlock *BB, AliasAnalysis *AA,
987987
RCIdentityFunctionInfo *RCIA) {

Diff for: lib/SILOptimizer/Transforms/SimplifyCFG.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2001,7 +2001,7 @@ bool RemoveUnreachable::run() {
20012001
}
20022002

20032003
/// Checks if the block contains a cond_fail as first side-effect instruction
2004-
/// and trys to move it to the predecessors (if beneficial). A sequence
2004+
/// and tries to move it to the predecessors (if beneficial). A sequence
20052005
///
20062006
/// bb1:
20072007
/// br bb3(%c)

Diff for: lib/SILOptimizer/Transforms/StackPromotion.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ bool StackPromoter::canPromoteAlloc(SILInstruction *AI,
306306
int NumUsePointsToFind = ConGraph->getNumUsePoints(Node);
307307
if (NumUsePointsToFind == 0) {
308308
// There should always be at least one release for an allocated object.
309-
// But in case all pathes from this block end in unreachable then the
309+
// But in case all paths from this block end in unreachable then the
310310
// final release of the object may be optimized away. We bail out in this
311311
// case.
312312
return false;

Diff for: lib/SILOptimizer/Utils/Local.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2301,7 +2301,7 @@ swift::analyzeStaticInitializer(SILValue V,
23012301

23022302
/// Replace load sequence which may contain
23032303
/// a chain of struct_element_addr followed by a load.
2304-
/// The sequence is travered inside out, i.e.
2304+
/// The sequence is traversed inside out, i.e.
23052305
/// starting with the innermost struct_element_addr
23062306
/// Move into utils.
23072307
void swift::replaceLoadSequence(SILInstruction *I,

Diff for: stdlib/public/core/ArrayBuffer.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public struct _ArrayBuffer<Element> : _ArrayBufferType {
4949
var deferredTypeCheckMask : Int { return 1 }
5050

5151
/// Returns an `_ArrayBuffer<U>` containing the same elements,
52-
/// deffering checking each element's `U`-ness until it is accessed.
52+
/// deferring checking each element's `U`-ness until it is accessed.
5353
///
5454
/// - Requires: `U` is a class or `@objc` existential derived from `Element`.
5555
@warn_unused_result

0 commit comments

Comments
 (0)