Skip to content

Commit 092007b

Browse files
[gardening] Fix recently introduced typos.
1 parent 38d95c6 commit 092007b

File tree

7 files changed

+25
-24
lines changed

7 files changed

+25
-24
lines changed

lib/IRGen/GenExistential.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,7 @@ class ErrorExistentialTypeInfo : public HeapTypeInfo<ErrorExistentialTypeInfo>
12671267
Refcounting(refcounting) {}
12681268

12691269
ReferenceCounting getReferenceCounting() const {
1270-
// ErrorProtocol uses its own rc entry points.
1270+
// ErrorProtocol uses its own RC entry points.
12711271
return Refcounting;
12721272
}
12731273

lib/SILOptimizer/ARC/RCStateTransition.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class ConsumedArgToEpilogueReleaseMatcher;
3333

3434
namespace swift {
3535

36-
/// The kind of a RCStateTransition.
36+
/// The kind of an RCStateTransition.
3737
enum class RCStateTransitionKind : uint8_t {
3838
#define KIND(K) K,
3939
#define ABSTRACT_VALUE(Name, StartKind, EndKind) \

lib/SILOptimizer/Transforms/RetainReleaseCodeMotion.cpp

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
///
2323
/// This pass is more sophisticated than SILCodeMotion, as arc optimizations
2424
/// can be very beneficial, use an optimistic global data flow to achieve
25-
/// optimiality.
25+
/// optimality.
2626
///
2727
/// Proof of Correctness:
2828
/// -------------------
@@ -178,7 +178,7 @@ struct BlockState {
178178

179179
/// CodeMotionContext - This is the base class which retain code motion and
180180
/// release code motion inherits from. It defines an interface as to how the
181-
/// code motion precedure should be.
181+
/// code motion procedure should be.
182182
class CodeMotionContext {
183183
protected:
184184
/// Dataflow needs multiple iteration to converge. If this is false, then we
@@ -204,8 +204,8 @@ class CodeMotionContext {
204204
/// All the unique refcount roots retained or released in the function.
205205
llvm::SetVector<SILValue> RCRootVault;
206206

207-
/// Contains a map between rc roots to their index in the RCRootVault.
208-
/// used to facilitate fast rc roots to index lookup.
207+
/// Contains a map between RC roots to their index in the RCRootVault.
208+
/// used to facilitate fast RC roots to index lookup.
209209
llvm::DenseMap<SILValue, unsigned> RCRootIndex;
210210

211211
/// All the retains or releases originally in the function. Eventually
@@ -216,7 +216,7 @@ class CodeMotionContext {
216216
using InsertPointList = llvm::SmallVector<SILInstruction *, 2>;
217217
llvm::SmallDenseMap<SILValue, InsertPointList> InsertPoints;
218218

219-
/// These are the blocks that have a RC instruction to process or it blocks
219+
/// These are the blocks that have an RC instruction to process or it blocks
220220
/// some RC instructions. If the basic block has neither, we do not need to
221221
/// process the block again in the last iteration. We populate this set when
222222
/// we compute the genset and killset.
@@ -234,7 +234,7 @@ class CodeMotionContext {
234234
return RCCache[R] = RCFI->getRCIdentityRoot(R);
235235
}
236236

237-
/// Return the rc-identity root of the rc instruction, i.e.
237+
/// Return the rc-identity root of the RC instruction, i.e.
238238
/// retain or release.
239239
SILValue getRCRoot(SILInstruction *I) {
240240
assert(isRetainInstruction(I) || isReleaseInstruction(I) &&
@@ -255,7 +255,7 @@ class CodeMotionContext {
255255
/// Run the data flow to move retains and releases.
256256
bool run();
257257

258-
/// Check whether we need to run an optimitic iteration data flow.
258+
/// Check whether we need to run an optimistic iteration data flow.
259259
/// or a pessimistic would suffice.
260260
virtual bool requireIteration() = 0;
261261

@@ -347,7 +347,7 @@ class RetainCodeMotionContext : public CodeMotionContext {
347347
// These terminator instructions block.
348348
if (isa<ReturnInst>(II) || isa<ThrowInst>(II) || isa<UnreachableInst>(II))
349349
return true;
350-
// Identical rc root blocks code motion, we will be able to move this retain
350+
// Identical RC root blocks code motion, we will be able to move this retain
351351
// further once we move the blocking retain.
352352
if (isRetainInstruction(II) && getRCRoot(II) == Ptr)
353353
return true;
@@ -455,7 +455,7 @@ void RetainCodeMotionContext::initializeCodeMotionBBMaxSet() {
455455
}
456456

457457
// Process the instructions in the basic block to find what refcounted
458-
// roots are retained. If we know that a rc root cant be retained at a
458+
// roots are retained. If we know that an RC root cant be retained at a
459459
// basic block, then we know we do not need to consider it for the killset.
460460
// NOTE: this is a conservative approximation, because some retains may be
461461
// blocked before it reaches this block.
@@ -491,7 +491,8 @@ void RetainCodeMotionContext::computeCodeMotionGenKillSet() {
491491
}
492492
}
493493

494-
// Is this a block thats interesting to the last iteration of the data flow.
494+
// Is this a block that is interesting to the last iteration of the data
495+
// flow.
495496
if (!InterestBlock)
496497
continue;
497498
InterestBlocks.insert(BB);
@@ -652,7 +653,7 @@ class ReleaseBlockState : public BlockState {
652653
}
653654
};
654655

655-
/// ReleaseCodeMotionContext - Context to peroform release code motion.
656+
/// ReleaseCodeMotionContext - Context to perform release code motion.
656657
class ReleaseCodeMotionContext : public CodeMotionContext {
657658
/// All the release block state for all the basic blocks in the function.
658659
llvm::SmallDenseMap<SILBasicBlock *, ReleaseBlockState *> BlockStates;
@@ -672,7 +673,7 @@ class ReleaseCodeMotionContext : public CodeMotionContext {
672673
// released value.
673674
if (II == Ptr)
674675
return true;
675-
// Identical rc root blocks code motion, we will be able to move this release
676+
// Identical RC root blocks code motion, we will be able to move this release
676677
// further once we move the blocking release.
677678
if (isReleaseInstruction(II) && getRCRoot(II) == Ptr)
678679
return true;
@@ -791,7 +792,7 @@ void ReleaseCodeMotionContext::initializeCodeMotionBBMaxSet() {
791792
}
792793

793794
// Process the instructions in the basic block to find what refcounted
794-
// roots are released. If we know that a rc root cant be released at a
795+
// roots are released. If we know that an RC root cant be released at a
795796
// basic block, then we know we do not need to consider it for the killset.
796797
// NOTE: this is a conservative approximation, because some releases may be
797798
// blocked before it reaches this block.
@@ -812,7 +813,7 @@ void ReleaseCodeMotionContext::computeCodeMotionGenKillSet() {
812813
for (unsigned i = 0; i < RCRootVault.size(); ++i) {
813814
if (!State->BBMaxSet.test(i) || !mayBlockCodeMotion(&*I, RCRootVault[i]))
814815
continue;
815-
// This instruction blocks this rc root.
816+
// This instruction blocks this RC root.
816817
InterestBlock = true;
817818
State->BBKillSet.set(i);
818819
State->BBGenSet.reset(i);
@@ -925,7 +926,7 @@ void ReleaseCodeMotionContext::convergeCodeMotionDataFlow() {
925926

926927
void ReleaseCodeMotionContext::computeCodeMotionInsertPoints() {
927928
// The BBSetIns have converged, run last iteration and figure out insertion
928-
// point for each rc root.
929+
// point for each RC root.
929930
for (SILBasicBlock *BB : PO->getPostOrder()) {
930931
// Intersect in the successor BBSetIns.
931932
mergeBBDataFlowStates(BB);
@@ -951,7 +952,7 @@ void ReleaseCodeMotionContext::computeCodeMotionInsertPoints() {
951952
continue;
952953

953954
// Compute insertion point generated by MayUse terminator inst.
954-
// If terminator instruction can block the rc root. We will have no
955+
// If terminator instruction can block the RC root. We will have no
955956
// choice but to anchor the release instructions in the successor blocks.
956957
for (unsigned i = 0; i < RCRootVault.size(); ++i) {
957958
SILInstruction *Term = BB->getTerminator();

lib/Sema/ConstraintLocator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ class ConstraintLocatorBuilder {
606606
/// Attempt to simplify this locator to a single expression.
607607
Expr *trySimplifyToExpr() const;
608608

609-
/// Retrive the last element in the path, if there is one.
609+
/// Retrieve the last element in the path, if there is one.
610610
Optional<LocatorPathElt> last() const {
611611
// If we stored a path element here, grab it.
612612
if (element) return *element;

lib/Sema/ConstraintSystem.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ Type ConstraintSystem::replaceSelfTypeInArchetype(ArchetypeType *archetype) {
10401040
}
10411041

10421042
/// Determine whether the given locator is for a witness or requirement.
1043-
static bool isRequirementOrWitnesss(const ConstraintLocatorBuilder &locator) {
1043+
static bool isRequirementOrWitness(const ConstraintLocatorBuilder &locator) {
10441044
if (auto last = locator.last()) {
10451045
return last->getKind() == ConstraintLocator::Requirement ||
10461046
last->getKind() == ConstraintLocator::Witness;
@@ -1247,7 +1247,7 @@ ConstraintSystem::getTypeOfMemberReference(
12471247
// optional/dynamic, is settable, or is not.
12481248
auto fnType = openedFnType->getResult()->castTo<FunctionType>();
12491249
auto elementTy = fnType->getResult();
1250-
if (!isRequirementOrWitnesss(locator)) {
1250+
if (!isRequirementOrWitness(locator)) {
12511251
if (subscript->getAttrs().hasAttribute<OptionalAttr>())
12521252
elementTy = OptionalType::get(elementTy->getRValueType());
12531253
else if (isDynamicResult) {
@@ -1387,7 +1387,7 @@ void ConstraintSystem::resolveOverload(ConstraintLocator *locator,
13871387
choice.isSpecialized(), locator);
13881388
}
13891389

1390-
if (!isRequirementOrWitnesss(locator) &&
1390+
if (!isRequirementOrWitness(locator) &&
13911391
choice.getDecl()->getAttrs().hasAttribute<OptionalAttr>() &&
13921392
!isa<SubscriptDecl>(choice.getDecl())) {
13931393
// For a non-subscript declaration that is an optional

test/Prototypes/CollectionsMoveIndices.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@
330330
// current collections model), then an additional design is possible
331331
// -- let's call it (2)(c) for the purpose of discussion. This design
332332
// would be like (2)(b), but won't require extra storage that is used
333-
// only for safety checks. Instead, every index would pay a RC
333+
// only for safety checks. Instead, every index would pay an RC
334334
// penalty and carry a strong reference to the tree node.
335335
//
336336
// Note that (2)(c) is still technically possible to implement in the

utils/build-script

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import swift_build_support.targets # noqa (E402)
5151
# A strict parser for bools (unlike Python's `bool()`, where
5252
# `bool('False')` is `True`).
5353
#
54-
# This function can be pased as `type=` argument to argparse to parse values
54+
# This function can be passed as `type=` argument to argparse to parse values
5555
# passed to command line arguments.
5656
def argparse_bool(string):
5757
if string in ['0', 'false', 'False']:

0 commit comments

Comments
 (0)