Skip to content

Commit 25df5d2

Browse files
Fixed some common grammatical errors in the comments. (#38248)
1 parent 8524ea9 commit 25df5d2

File tree

5 files changed

+34
-33
lines changed

5 files changed

+34
-33
lines changed

include/swift/Sema/ConstraintSystem.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,11 +1383,11 @@ enum class ConstraintSystemFlags {
13831383

13841384
/// If set, verbose output is enabled for this constraint system.
13851385
///
1386-
/// Note that this flag is automatically applied to all constraint systems
1386+
/// Note that this flag is automatically applied to all constraint systems,
13871387
/// when \c DebugConstraintSolver is set in \c TypeCheckerOptions. It can be
13881388
/// automatically enabled for select constraint solving attempts by setting
1389-
/// \c DebugConstraintSolverAttempt. Finally, it be automatically enabled
1390-
/// for a pre-configured set of expressions on line numbers by setting
1389+
/// \c DebugConstraintSolverAttempt. Finally, it can also be automatically
1390+
/// enabled for a pre-configured set of expressions on line numbers by setting
13911391
/// \c DebugConstraintSolverOnLines.
13921392
DebugConstraints = 0x10,
13931393

@@ -2374,7 +2374,7 @@ class ConstraintSystem {
23742374
/// The best solution computed so far.
23752375
Optional<Score> BestScore;
23762376

2377-
/// The number of the solution attempt we're looking at.
2377+
/// The number of the solution attempts we're looking at.
23782378
unsigned SolutionAttempt;
23792379

23802380
/// Refers to the innermost partial solution scope.
@@ -2521,8 +2521,8 @@ class ConstraintSystem {
25212521

25222522
private:
25232523
/// The list of constraints that have been retired along the
2524-
/// current path, this list is used in LIFO fashion when constraints
2525-
/// are added back to the circulation.
2524+
/// current path, this list is used in LIFO fashion when
2525+
/// constraints are added back to the circulation.
25262526
ConstraintList retiredConstraints;
25272527

25282528
/// The set of constraints which were active at the time of this state
@@ -2821,8 +2821,8 @@ class ConstraintSystem {
28212821
/// able to emit an error message, or false if none of the fixits worked out.
28222822
bool applySolutionFixes(const Solution &solution);
28232823

2824-
/// If there is more than one viable solution,
2825-
/// attempt to pick the best solution and remove all of the rest.
2824+
/// If there is more than one viable solution, attempt
2825+
/// to pick the best solution and remove all of the rest.
28262826
///
28272827
/// \param solutions The set of solutions to filter.
28282828
///
@@ -2865,7 +2865,7 @@ class ConstraintSystem {
28652865
void addKeyPathApplicationRootConstraint(Type root, ConstraintLocatorBuilder locator);
28662866

28672867
public:
2868-
/// Lookup for a member with the given name in the given base type.
2868+
/// Lookup for a member with the given name which is in the given base type.
28692869
///
28702870
/// This routine caches the results of member lookups in the top constraint
28712871
/// system, to avoid.
@@ -3955,7 +3955,7 @@ class ConstraintSystem {
39553955
}
39563956

39573957
private:
3958-
/// Adjust the constraint system to accomodate the given selected overload, and
3958+
/// Adjust the constraint system to accommodate the given selected overload, and
39593959
/// recompute the type of the referenced declaration.
39603960
///
39613961
/// \returns a pair containing the adjusted opened type of a reference to

lib/SILOptimizer/Transforms/SimplifyCFG.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ STATISTIC(NumSROAArguments, "Number of aggregate argument levels split by "
5757
//===----------------------------------------------------------------------===//
5858

5959
/// dominatorBasedSimplify iterates between dominator based simplification of
60-
/// terminator branch condition values and cfg simplification. This is the
60+
/// terminator branch condition values and CFG simplification. This is the
6161
/// maximum number of iterations we run. The number is the maximum number of
6262
/// iterations encountered when compiling the stdlib on April 2 2015.
6363
///
@@ -386,8 +386,8 @@ bool SimplifyCFG::threadEdge(const ThreadInfo &ti) {
386386
return true;
387387
}
388388

389-
/// Give a cond_br or switch_enum instruction and one successor block return
390-
/// true if we can infer the value of the condition/enum along the edge to this
389+
/// Give a cond_br or switch_enum instruction and one successor block returns
390+
/// true if we can infer the value of the condition/enum along the edge to these
391391
/// successor blocks.
392392
static bool isKnownEdgeValue(TermInst *Term, SILBasicBlock *SuccBB,
393393
EnumElementDecl *&EnumCase) {
@@ -1045,7 +1045,7 @@ bool SimplifyCFG::tryJumpThreading(BranchInst *BI) {
10451045

10461046
// Jump threading only makes sense if there is an argument on the branch
10471047
// (which is reacted on in the DestBB), or if this goes through a memory
1048-
// location (switch_enum_addr is the only adress-instruction which we
1048+
// location (switch_enum_addr is the only address-instruction which we
10491049
// currently handle).
10501050
if (BI->getArgs().empty() && !isa<SwitchEnumAddrInst>(destTerminator))
10511051
return false;
@@ -1976,7 +1976,7 @@ static bool containsOnlyObjMethodCallOnOptional(SILValue optionalValue,
19761976
}
19771977

19781978
/// Check that all that noneBB does is forwarding none.
1979-
/// The only other allowed operation are ref count operations.
1979+
/// The only other allowed operations are ref count operations.
19801980
static bool onlyForwardsNone(SILBasicBlock *noneBB, SILBasicBlock *someBB,
19811981
SwitchEnumInst *SEI) {
19821982
// It all the basic blocks leading up to the ultimate block we only expect
@@ -2054,7 +2054,7 @@ static bool hasSameUltimateSuccessor(SILBasicBlock *noneBB, SILBasicBlock *someB
20542054

20552055
// Otherwise, lets begin a traversal along the successors of noneSuccessorBB,
20562056
// searching for someSuccessorBB, being careful to only allow for blocks to be
2057-
// visited once. This enables us to guarantee that there are not any loops or
2057+
// visited once. This enables us to guarantee that there no loops or
20582058
// any sub-diamonds in the part of the CFG we are traversing. This /does/
20592059
// allow for side-entrances to the region from blocks not reachable from
20602060
// noneSuccessorBB. See function level comment above.
@@ -4048,13 +4048,13 @@ bool SimplifyCFG::simplifyProgramTerminationBlock(SILBasicBlock *BB) {
40484048
//
40494049
// TODO: should we use ProgramTerminationAnalysis ?. The reason we do not
40504050
// use the analysis is because the CFG is likely to be invalidated right
4051-
// after this pass, o we do not really get the benefit of reusing the
4051+
// after this pass, that's why we do not really get the benefit of reusing the
40524052
// computation for the next iteration of the pass.
40534053
if (!isARCInertTrapBB(BB))
40544054
return false;
40554055

40564056
// This is going to be the last basic block this program is going to execute
4057-
// and this block is inert from the ARC's prospective, no point to do any
4057+
// and this block is inert from the ARC's prospective,so there's no point to do any
40584058
// releases at this point.
40594059
bool Changed = false;
40604060
llvm::SmallPtrSet<SILInstruction *, 4> InstsToRemove;

lib/Sema/CSDiagnostics.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212
//
13-
// This file implements diagnostics for constraint system.
13+
// This file implements diagnostics for the constraint system.
1414
//
1515
//===----------------------------------------------------------------------===//
1616

@@ -2790,7 +2790,7 @@ bool ContextualFailure::diagnoseConversionToBool() const {
27902790
// Check if we need the inner parentheses.
27912791
// Technically we only need them if there's something in 'expr' with
27922792
// lower precedence than '!=', but the code actually comes out nicer
2793-
// in most cases with parens on anything non-trivial.
2793+
// in most cases with parens on anything that is non-trivial.
27942794
if (anchor->canAppendPostfixExpression()) {
27952795
prefix = prefix.drop_back();
27962796
suffix = suffix.drop_front();
@@ -4535,7 +4535,7 @@ bool MissingArgumentsFailure::diagnoseSingleMissingArgument() const {
45354535
// corresponding to the missing argument doesn't support a trailing closure,
45364536
// don't provide a Fix-It.
45374537
// FIXME: It's possible to parenthesize and relabel the argument list to
4538-
// accomodate this, but it's tricky.
4538+
// accommodate this, but it's tricky.
45394539
bool shouldEmitFixIt =
45404540
!(insertingTrailingClosure && !paramAcceptsTrailingClosure);
45414541

stdlib/public/runtime/SwiftDtoa.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@
4040
///
4141
/// * Fast. It uses only fixed-width integer arithmetic and has
4242
/// constant memory requirements. For double-precision values on
43-
/// 64-bit processors, it is competitive with Ryu. For double-precision
43+
/// 64-bit processors, it is competitive with Ryu. For double-precision
4444
/// values on 32-bit processors, and higher-precision values on all
4545
/// processors, it is considerably faster.
4646
///
4747
/// * Always Accurate. Converting the decimal form back to binary
48-
/// will always yield exactly the same value. For the IEEE 754
48+
/// will always yield exactly the same value. For the IEEE 754
4949
/// formats, the round-trip will produce exactly the same bit
5050
/// pattern in memory.
5151
///
@@ -125,7 +125,7 @@ static void intervalContainingPowerOf10_Binary32(int p, uint64_t *lower, uint64_
125125
#endif
126126

127127
//
128-
// Helpers used by binary32, binary64, float80, and binary128
128+
// Helpers used by binary32, binary64, float80, and binary128.
129129
//
130130

131131
#if SWIFT_DTOA_BINARY32_SUPPORT || SWIFT_DTOA_BINARY64_SUPPORT || SWIFT_DTOA_FLOAT80_SUPPORT || SWIFT_DTOA_BINARY128_SUPPORT
@@ -782,7 +782,7 @@ size_t swift_dtoa_optimal_binary64_p(const void *d, char *dest, size_t length)
782782
// bias. That's because they treat the significand as a
783783
// fixed-point number with one bit (the hidden bit) integer
784784
// portion. The logic here reconstructs the significand as a
785-
// pure fraction, so we need to accomodate that when
785+
// pure fraction, so we need to accommodate that when
786786
// reconstructing the binary exponent.
787787
static const int64_t exponentBias = (1 << (exponentBitCount - 1)) - 2; // 1022
788788

@@ -911,14 +911,14 @@ size_t swift_dtoa_optimal_binary64_p(const void *d, char *dest, size_t length)
911911
// This ensures accuracy but, as explained in Loitsch' paper,
912912
// this carries a risk that there will be a shorter digit
913913
// sequence outside of our narrowed interval that we will
914-
// miss. This risk obviously gets lower with increased
914+
// miss. This risk obviously gets lower with increased
915915
// precision, but it wasn't until the Errol paper that anyone
916916
// had a good way to test whether a particular implementation
917-
// had sufficient precision. That paper shows a way to enumerate
917+
// had sufficient precision. That paper shows a way to enumerate
918918
// the worst-case numbers; those numbers that are extremely close
919919
// to the mid-points between adjacent floating-point values.
920920
// These are the values that might sit just outside of the
921-
// narrowed interval. By testing these values, we can verify
921+
// narrowed interval. By testing these values, we can verify
922922
// the correctness of our implementation.
923923

924924
// Multiply out the upper midpoint, rounding down...
@@ -1202,7 +1202,8 @@ size_t swift_dtoa_optimal_binary64_p(const void *d, char *dest, size_t length)
12021202
// value 0.1234 and computed u = 0.1257, l = 0.1211. The above
12031203
// digit generation works with `u`, so produces 0.125. But the
12041204
// values 0.122, 0.123, and 0.124 are just as short and 0.123 is
1205-
// the best choice, since it's closest to the original value.
1205+
// therefore the best choice, since it's closest to the original
1206+
// value.
12061207

12071208
// We know delta and t are both less than 10.0 here, so we can
12081209
// shed some excess integer bits to simplify the following:

test/Sanitizers/asan/recover.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// REQUIRES: asan_runtime
33
// UNSUPPORTED: windows
44

5-
// Check with recovery instrumentation and runtime option to continue execution.
5+
// Check with recovery instrumentation and the runtime option to continue execution.
66
// RUN: %target-swiftc_driver %s -target %sanitizers-target-triple -g -sanitize=address -sanitize-recover=address -import-objc-header %S/asan_interface.h -emit-ir -o %t.asan_recover.ll
77
// RUN: %FileCheck -check-prefix=CHECK-IR -input-file=%t.asan_recover.ll %s
88
// RUN: %target-swiftc_driver %s -target %sanitizers-target-triple -g -sanitize=address -sanitize-recover=address -import-objc-header %S/asan_interface.h -o %t_asan_recover
@@ -29,7 +29,7 @@
2929
// CHECK-IR-NOT: call {{.+}} @memcpy
3030

3131
// FIXME: We need this so we can flush stdout but this won't
32-
// work on other Platforms (e.g. Windows).
32+
// work on other Platforms (e.g. Microsoft Windows).
3333
#if canImport(Glibc)
3434
import Glibc
3535
#else
@@ -66,7 +66,7 @@ __asan_poison_memory_region(UnsafeMutableRawPointer(x), size)
6666
// print(x)
6767
// ```
6868
//
69-
// However, this generated code that called into memcpy rather than performing
69+
// However, this generated code that's called into memcpy rather than performing
7070
// a direct read which meant that ASan caught an issue via its interceptors
7171
// rather than from instrumentation, which does not test the right thing here.
7272
//
@@ -88,7 +88,7 @@ fflush(stdout)
8888
// CHECK-RECOVER-STDOUT: Read first element:0
8989

9090
// Second error
91-
// NOTE: Very loose regex is to accomodate if name demangling
91+
// NOTE: Very loose regex is to accommodate if name demangling
9292
// fails. rdar://problem/57235673
9393
// CHECK-RECOVER-STDERR: AddressSanitizer: use-after-poison
9494
// CHECK-RECOVER-STDERR: #0 0x{{.+}} in {{.*}}foo{{.*}}

0 commit comments

Comments
 (0)