mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Fixed some common grammatical errors in the comments. (#38248)
This commit is contained in:
@@ -1383,11 +1383,11 @@ enum class ConstraintSystemFlags {
|
|||||||
|
|
||||||
/// If set, verbose output is enabled for this constraint system.
|
/// If set, verbose output is enabled for this constraint system.
|
||||||
///
|
///
|
||||||
/// Note that this flag is automatically applied to all constraint systems
|
/// Note that this flag is automatically applied to all constraint systems,
|
||||||
/// when \c DebugConstraintSolver is set in \c TypeCheckerOptions. It can be
|
/// when \c DebugConstraintSolver is set in \c TypeCheckerOptions. It can be
|
||||||
/// automatically enabled for select constraint solving attempts by setting
|
/// automatically enabled for select constraint solving attempts by setting
|
||||||
/// \c DebugConstraintSolverAttempt. Finally, it be automatically enabled
|
/// \c DebugConstraintSolverAttempt. Finally, it can also be automatically
|
||||||
/// for a pre-configured set of expressions on line numbers by setting
|
/// enabled for a pre-configured set of expressions on line numbers by setting
|
||||||
/// \c DebugConstraintSolverOnLines.
|
/// \c DebugConstraintSolverOnLines.
|
||||||
DebugConstraints = 0x10,
|
DebugConstraints = 0x10,
|
||||||
|
|
||||||
@@ -2374,7 +2374,7 @@ private:
|
|||||||
/// The best solution computed so far.
|
/// The best solution computed so far.
|
||||||
Optional<Score> BestScore;
|
Optional<Score> BestScore;
|
||||||
|
|
||||||
/// The number of the solution attempt we're looking at.
|
/// The number of the solution attempts we're looking at.
|
||||||
unsigned SolutionAttempt;
|
unsigned SolutionAttempt;
|
||||||
|
|
||||||
/// Refers to the innermost partial solution scope.
|
/// Refers to the innermost partial solution scope.
|
||||||
@@ -2521,8 +2521,8 @@ private:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
/// The list of constraints that have been retired along the
|
/// The list of constraints that have been retired along the
|
||||||
/// current path, this list is used in LIFO fashion when constraints
|
/// current path, this list is used in LIFO fashion when
|
||||||
/// are added back to the circulation.
|
/// constraints are added back to the circulation.
|
||||||
ConstraintList retiredConstraints;
|
ConstraintList retiredConstraints;
|
||||||
|
|
||||||
/// The set of constraints which were active at the time of this state
|
/// The set of constraints which were active at the time of this state
|
||||||
@@ -2821,8 +2821,8 @@ private:
|
|||||||
/// able to emit an error message, or false if none of the fixits worked out.
|
/// able to emit an error message, or false if none of the fixits worked out.
|
||||||
bool applySolutionFixes(const Solution &solution);
|
bool applySolutionFixes(const Solution &solution);
|
||||||
|
|
||||||
/// If there is more than one viable solution,
|
/// If there is more than one viable solution, attempt
|
||||||
/// attempt to pick the best solution and remove all of the rest.
|
/// to pick the best solution and remove all of the rest.
|
||||||
///
|
///
|
||||||
/// \param solutions The set of solutions to filter.
|
/// \param solutions The set of solutions to filter.
|
||||||
///
|
///
|
||||||
@@ -2865,7 +2865,7 @@ private:
|
|||||||
void addKeyPathApplicationRootConstraint(Type root, ConstraintLocatorBuilder locator);
|
void addKeyPathApplicationRootConstraint(Type root, ConstraintLocatorBuilder locator);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Lookup for a member with the given name in the given base type.
|
/// Lookup for a member with the given name which is in the given base type.
|
||||||
///
|
///
|
||||||
/// This routine caches the results of member lookups in the top constraint
|
/// This routine caches the results of member lookups in the top constraint
|
||||||
/// system, to avoid.
|
/// system, to avoid.
|
||||||
@@ -3955,7 +3955,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// Adjust the constraint system to accomodate the given selected overload, and
|
/// Adjust the constraint system to accommodate the given selected overload, and
|
||||||
/// recompute the type of the referenced declaration.
|
/// recompute the type of the referenced declaration.
|
||||||
///
|
///
|
||||||
/// \returns a pair containing the adjusted opened type of a reference to
|
/// \returns a pair containing the adjusted opened type of a reference to
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ STATISTIC(NumSROAArguments, "Number of aggregate argument levels split by "
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
/// dominatorBasedSimplify iterates between dominator based simplification of
|
/// dominatorBasedSimplify iterates between dominator based simplification of
|
||||||
/// terminator branch condition values and cfg simplification. This is the
|
/// terminator branch condition values and CFG simplification. This is the
|
||||||
/// maximum number of iterations we run. The number is the maximum number of
|
/// maximum number of iterations we run. The number is the maximum number of
|
||||||
/// iterations encountered when compiling the stdlib on April 2 2015.
|
/// iterations encountered when compiling the stdlib on April 2 2015.
|
||||||
///
|
///
|
||||||
@@ -386,8 +386,8 @@ bool SimplifyCFG::threadEdge(const ThreadInfo &ti) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Give a cond_br or switch_enum instruction and one successor block return
|
/// Give a cond_br or switch_enum instruction and one successor block returns
|
||||||
/// true if we can infer the value of the condition/enum along the edge to this
|
/// true if we can infer the value of the condition/enum along the edge to these
|
||||||
/// successor blocks.
|
/// successor blocks.
|
||||||
static bool isKnownEdgeValue(TermInst *Term, SILBasicBlock *SuccBB,
|
static bool isKnownEdgeValue(TermInst *Term, SILBasicBlock *SuccBB,
|
||||||
EnumElementDecl *&EnumCase) {
|
EnumElementDecl *&EnumCase) {
|
||||||
@@ -1045,7 +1045,7 @@ bool SimplifyCFG::tryJumpThreading(BranchInst *BI) {
|
|||||||
|
|
||||||
// Jump threading only makes sense if there is an argument on the branch
|
// Jump threading only makes sense if there is an argument on the branch
|
||||||
// (which is reacted on in the DestBB), or if this goes through a memory
|
// (which is reacted on in the DestBB), or if this goes through a memory
|
||||||
// location (switch_enum_addr is the only adress-instruction which we
|
// location (switch_enum_addr is the only address-instruction which we
|
||||||
// currently handle).
|
// currently handle).
|
||||||
if (BI->getArgs().empty() && !isa<SwitchEnumAddrInst>(destTerminator))
|
if (BI->getArgs().empty() && !isa<SwitchEnumAddrInst>(destTerminator))
|
||||||
return false;
|
return false;
|
||||||
@@ -1976,7 +1976,7 @@ static bool containsOnlyObjMethodCallOnOptional(SILValue optionalValue,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Check that all that noneBB does is forwarding none.
|
/// Check that all that noneBB does is forwarding none.
|
||||||
/// The only other allowed operation are ref count operations.
|
/// The only other allowed operations are ref count operations.
|
||||||
static bool onlyForwardsNone(SILBasicBlock *noneBB, SILBasicBlock *someBB,
|
static bool onlyForwardsNone(SILBasicBlock *noneBB, SILBasicBlock *someBB,
|
||||||
SwitchEnumInst *SEI) {
|
SwitchEnumInst *SEI) {
|
||||||
// It all the basic blocks leading up to the ultimate block we only expect
|
// 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
|
|||||||
|
|
||||||
// Otherwise, lets begin a traversal along the successors of noneSuccessorBB,
|
// Otherwise, lets begin a traversal along the successors of noneSuccessorBB,
|
||||||
// searching for someSuccessorBB, being careful to only allow for blocks to be
|
// searching for someSuccessorBB, being careful to only allow for blocks to be
|
||||||
// visited once. This enables us to guarantee that there are not any loops or
|
// visited once. This enables us to guarantee that there no loops or
|
||||||
// any sub-diamonds in the part of the CFG we are traversing. This /does/
|
// any sub-diamonds in the part of the CFG we are traversing. This /does/
|
||||||
// allow for side-entrances to the region from blocks not reachable from
|
// allow for side-entrances to the region from blocks not reachable from
|
||||||
// noneSuccessorBB. See function level comment above.
|
// noneSuccessorBB. See function level comment above.
|
||||||
@@ -4048,13 +4048,13 @@ bool SimplifyCFG::simplifyProgramTerminationBlock(SILBasicBlock *BB) {
|
|||||||
//
|
//
|
||||||
// TODO: should we use ProgramTerminationAnalysis ?. The reason we do not
|
// TODO: should we use ProgramTerminationAnalysis ?. The reason we do not
|
||||||
// use the analysis is because the CFG is likely to be invalidated right
|
// use the analysis is because the CFG is likely to be invalidated right
|
||||||
// after this pass, o we do not really get the benefit of reusing the
|
// after this pass, that's why we do not really get the benefit of reusing the
|
||||||
// computation for the next iteration of the pass.
|
// computation for the next iteration of the pass.
|
||||||
if (!isARCInertTrapBB(BB))
|
if (!isARCInertTrapBB(BB))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// This is going to be the last basic block this program is going to execute
|
// This is going to be the last basic block this program is going to execute
|
||||||
// and this block is inert from the ARC's prospective, no point to do any
|
// and this block is inert from the ARC's prospective,so there's no point to do any
|
||||||
// releases at this point.
|
// releases at this point.
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
llvm::SmallPtrSet<SILInstruction *, 4> InstsToRemove;
|
llvm::SmallPtrSet<SILInstruction *, 4> InstsToRemove;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
// This file implements diagnostics for constraint system.
|
// This file implements diagnostics for the constraint system.
|
||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
@@ -2790,7 +2790,7 @@ bool ContextualFailure::diagnoseConversionToBool() const {
|
|||||||
// Check if we need the inner parentheses.
|
// Check if we need the inner parentheses.
|
||||||
// Technically we only need them if there's something in 'expr' with
|
// Technically we only need them if there's something in 'expr' with
|
||||||
// lower precedence than '!=', but the code actually comes out nicer
|
// lower precedence than '!=', but the code actually comes out nicer
|
||||||
// in most cases with parens on anything non-trivial.
|
// in most cases with parens on anything that is non-trivial.
|
||||||
if (anchor->canAppendPostfixExpression()) {
|
if (anchor->canAppendPostfixExpression()) {
|
||||||
prefix = prefix.drop_back();
|
prefix = prefix.drop_back();
|
||||||
suffix = suffix.drop_front();
|
suffix = suffix.drop_front();
|
||||||
@@ -4535,7 +4535,7 @@ bool MissingArgumentsFailure::diagnoseSingleMissingArgument() const {
|
|||||||
// corresponding to the missing argument doesn't support a trailing closure,
|
// corresponding to the missing argument doesn't support a trailing closure,
|
||||||
// don't provide a Fix-It.
|
// don't provide a Fix-It.
|
||||||
// FIXME: It's possible to parenthesize and relabel the argument list to
|
// FIXME: It's possible to parenthesize and relabel the argument list to
|
||||||
// accomodate this, but it's tricky.
|
// accommodate this, but it's tricky.
|
||||||
bool shouldEmitFixIt =
|
bool shouldEmitFixIt =
|
||||||
!(insertingTrailingClosure && !paramAcceptsTrailingClosure);
|
!(insertingTrailingClosure && !paramAcceptsTrailingClosure);
|
||||||
|
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ static void intervalContainingPowerOf10_Binary32(int p, uint64_t *lower, uint64_
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// Helpers used by binary32, binary64, float80, and binary128
|
// Helpers used by binary32, binary64, float80, and binary128.
|
||||||
//
|
//
|
||||||
|
|
||||||
#if SWIFT_DTOA_BINARY32_SUPPORT || SWIFT_DTOA_BINARY64_SUPPORT || SWIFT_DTOA_FLOAT80_SUPPORT || SWIFT_DTOA_BINARY128_SUPPORT
|
#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)
|
|||||||
// bias. That's because they treat the significand as a
|
// bias. That's because they treat the significand as a
|
||||||
// fixed-point number with one bit (the hidden bit) integer
|
// fixed-point number with one bit (the hidden bit) integer
|
||||||
// portion. The logic here reconstructs the significand as a
|
// portion. The logic here reconstructs the significand as a
|
||||||
// pure fraction, so we need to accomodate that when
|
// pure fraction, so we need to accommodate that when
|
||||||
// reconstructing the binary exponent.
|
// reconstructing the binary exponent.
|
||||||
static const int64_t exponentBias = (1 << (exponentBitCount - 1)) - 2; // 1022
|
static const int64_t exponentBias = (1 << (exponentBitCount - 1)) - 2; // 1022
|
||||||
|
|
||||||
@@ -1202,7 +1202,8 @@ size_t swift_dtoa_optimal_binary64_p(const void *d, char *dest, size_t length)
|
|||||||
// value 0.1234 and computed u = 0.1257, l = 0.1211. The above
|
// value 0.1234 and computed u = 0.1257, l = 0.1211. The above
|
||||||
// digit generation works with `u`, so produces 0.125. But the
|
// digit generation works with `u`, so produces 0.125. But the
|
||||||
// values 0.122, 0.123, and 0.124 are just as short and 0.123 is
|
// values 0.122, 0.123, and 0.124 are just as short and 0.123 is
|
||||||
// the best choice, since it's closest to the original value.
|
// therefore the best choice, since it's closest to the original
|
||||||
|
// value.
|
||||||
|
|
||||||
// We know delta and t are both less than 10.0 here, so we can
|
// We know delta and t are both less than 10.0 here, so we can
|
||||||
// shed some excess integer bits to simplify the following:
|
// shed some excess integer bits to simplify the following:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// REQUIRES: asan_runtime
|
// REQUIRES: asan_runtime
|
||||||
// UNSUPPORTED: windows
|
// UNSUPPORTED: windows
|
||||||
|
|
||||||
// Check with recovery instrumentation and runtime option to continue execution.
|
// Check with recovery instrumentation and the runtime option to continue execution.
|
||||||
// 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
|
// 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
|
||||||
// RUN: %FileCheck -check-prefix=CHECK-IR -input-file=%t.asan_recover.ll %s
|
// RUN: %FileCheck -check-prefix=CHECK-IR -input-file=%t.asan_recover.ll %s
|
||||||
// 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
|
// 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 @@
|
|||||||
// CHECK-IR-NOT: call {{.+}} @memcpy
|
// CHECK-IR-NOT: call {{.+}} @memcpy
|
||||||
|
|
||||||
// FIXME: We need this so we can flush stdout but this won't
|
// FIXME: We need this so we can flush stdout but this won't
|
||||||
// work on other Platforms (e.g. Windows).
|
// work on other Platforms (e.g. Microsoft Windows).
|
||||||
#if canImport(Glibc)
|
#if canImport(Glibc)
|
||||||
import Glibc
|
import Glibc
|
||||||
#else
|
#else
|
||||||
@@ -66,7 +66,7 @@ __asan_poison_memory_region(UnsafeMutableRawPointer(x), size)
|
|||||||
// print(x)
|
// print(x)
|
||||||
// ```
|
// ```
|
||||||
//
|
//
|
||||||
// However, this generated code that called into memcpy rather than performing
|
// However, this generated code that's called into memcpy rather than performing
|
||||||
// a direct read which meant that ASan caught an issue via its interceptors
|
// a direct read which meant that ASan caught an issue via its interceptors
|
||||||
// rather than from instrumentation, which does not test the right thing here.
|
// rather than from instrumentation, which does not test the right thing here.
|
||||||
//
|
//
|
||||||
@@ -88,7 +88,7 @@ fflush(stdout)
|
|||||||
// CHECK-RECOVER-STDOUT: Read first element:0
|
// CHECK-RECOVER-STDOUT: Read first element:0
|
||||||
|
|
||||||
// Second error
|
// Second error
|
||||||
// NOTE: Very loose regex is to accomodate if name demangling
|
// NOTE: Very loose regex is to accommodate if name demangling
|
||||||
// fails. rdar://problem/57235673
|
// fails. rdar://problem/57235673
|
||||||
// CHECK-RECOVER-STDERR: AddressSanitizer: use-after-poison
|
// CHECK-RECOVER-STDERR: AddressSanitizer: use-after-poison
|
||||||
// CHECK-RECOVER-STDERR: #0 0x{{.+}} in {{.*}}foo{{.*}}
|
// CHECK-RECOVER-STDERR: #0 0x{{.+}} in {{.*}}foo{{.*}}
|
||||||
|
|||||||
Reference in New Issue
Block a user