Skip to content

Commit 38c0de0

Browse files
authored
Spelling frontend (swiftlang#42465)
* spelling: calculated Signed-off-by: Josh Soref <[email protected]> * spelling: compilations Signed-off-by: Josh Soref <[email protected]> * spelling: containing Signed-off-by: Josh Soref <[email protected]> * spelling: dependency Signed-off-by: Josh Soref <[email protected]> * spelling: dependent Signed-off-by: Josh Soref <[email protected]> * spelling: diagnose Signed-off-by: Josh Soref <[email protected]> * spelling: explicit Signed-off-by: Josh Soref <[email protected]> * spelling: explicitly Signed-off-by: Josh Soref <[email protected]> * spelling: feature Signed-off-by: Josh Soref <[email protected]> * spelling: fulfill Signed-off-by: Josh Soref <[email protected]> * spelling: fulfillment Signed-off-by: Josh Soref <[email protected]> * spelling: invoke Signed-off-by: Josh Soref <[email protected]> * spelling: module Signed-off-by: Josh Soref <[email protected]> * spelling: multiple Signed-off-by: Josh Soref <[email protected]> * spelling: nonexistent Signed-off-by: Josh Soref <[email protected]> * spelling: omitted Signed-off-by: Josh Soref <[email protected]> * spelling: optimization Signed-off-by: Josh Soref <[email protected]> * spelling: performing Signed-off-by: Josh Soref <[email protected]> * spelling: primaries Signed-off-by: Josh Soref <[email protected]> * spelling: propagate Signed-off-by: Josh Soref <[email protected]> * spelling: sacrifices Signed-off-by: Josh Soref <[email protected]> * spelling: scanned Signed-off-by: Josh Soref <[email protected]> * spelling: substitution Signed-off-by: Josh Soref <[email protected]> * spelling: successful Signed-off-by: Josh Soref <[email protected]> * spelling: typecheck Signed-off-by: Josh Soref <[email protected]> * spelling: unobtrusive Signed-off-by: Josh Soref <[email protected]> * spelling: utilities Signed-off-by: Josh Soref <[email protected]> Co-authored-by: Josh Soref <[email protected]>
1 parent 4c77c59 commit 38c0de0

21 files changed

+52
-52
lines changed

include/swift/Frontend/Frontend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ class CompilerInstance {
606606
void setupStatsReporter();
607607
void setupDependencyTrackerIfNeeded();
608608

609-
/// \return false if successsful, true on error.
609+
/// \return false if successful, true on error.
610610
bool setupDiagnosticVerifierIfNeeded();
611611

612612
Optional<unsigned> setUpCodeCompletionBuffer();

include/swift/Frontend/FrontendInputsAndOutputs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class FrontendInputsAndOutputs {
142142
assertMustNotBeMoreThanOnePrimaryInputUnlessBatchModeChecksHaveBeenBypassed()
143143
const;
144144

145-
// Count-dependend readers:
145+
// Count-dependent readers:
146146

147147
/// \return the unique primary input, if one exists.
148148
const InputFile *getUniquePrimaryInput() const;

include/swift/Frontend/FrontendOptions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,8 @@ class FrontendOptions {
444444
bool IncludeSPISymbolsInSymbolGraph = false;
445445

446446
/// Whether to reuse a frontend (i.e. compiler instance) for multiple
447-
/// compiletions. This prevents ASTContext being freed.
448-
bool ReuseFrontendForMutipleCompilations = false;
447+
/// compilations. This prevents ASTContext being freed.
448+
bool ReuseFrontendForMultipleCompilations = false;
449449

450450
/// This is used to obfuscate the serialized search paths so we don't have
451451
/// to encode the actual paths into the .swiftmodule file.

lib/Driver/FrontendUtil.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ bool swift::driver::getSingleFrontendInvocationFromDriverArguments(
5252
// frontend command.
5353
Args.push_back("-whole-module-optimization");
5454

55-
// Explictly disable batch mode to avoid a spurious warning when combining
55+
// Explicitly disable batch mode to avoid a spurious warning when combining
5656
// -enable-batch-mode with -whole-module-optimization. This is an
5757
// implementation detail.
5858
Args.push_back("-disable-batch-mode");

lib/Frontend/ArgsToFrontendOptionsConverter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ bool ArgsToFrontendOptionsConverter::convert(
169169
Optional<FrontendInputsAndOutputs> inputsAndOutputs =
170170
ArgsToFrontendInputsConverter(Diags, Args).convert(buffers);
171171

172-
// None here means error, not just "no inputs". Propagage unconditionally.
172+
// None here means error, not just "no inputs". Propagate unconditionally.
173173
if (!inputsAndOutputs)
174174
return true;
175175

lib/Frontend/ArgsToFrontendOptionsConverter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class ModuleAliasesConverter {
8181
/// -module-alias Baz=Qux`, the args are ['Foo=Bar', 'Baz=Qux']. The name
8282
/// Foo is the name that appears in source files, while it maps to Bar, the name
8383
/// of the binary on disk, /path/to/Bar.swiftmodule(interface), under the hood.
84-
/// \param options FrontendOptions containings the module alias map to set args to.
84+
/// \param options FrontendOptions containing the module alias map to set args to.
8585
/// \param diags Used to print diagnostics in case validation of the args fails.
8686
/// \return Whether the validation passed and successfully set the module alias map
8787
static bool computeModuleAliases(std::vector<std::string> args,

lib/Frontend/CompilerInvocation.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
789789

790790
// Collect -clang-target value if specified in the front-end invocation.
791791
// Usually, the driver will pass down a clang target with the
792-
// exactly same value as the main target, so we could dignose the usage of
792+
// exactly same value as the main target, so we could diagnose the usage of
793793
// unavailable APIs.
794794
// The reason we cannot infer clang target from -target is that not all
795795
// front-end invocation will include a -target to start with. For instance,
@@ -2109,7 +2109,7 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
21092109
Opts.UseTypeLayoutValueHandling
21102110
= A->getOption().matches(OPT_enable_type_layouts);
21112111
} else if (Opts.OptMode == OptimizationMode::NoOptimization) {
2112-
// Disable type layouts at Onone except if explictly requested.
2112+
// Disable type layouts at Onone except if explicitly requested.
21132113
Opts.UseTypeLayoutValueHandling = false;
21142114
}
21152115

@@ -2359,7 +2359,7 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
23592359
} else if (Triple.isWatchOS() && !Triple.isSimulatorEnvironment()) {
23602360
// watchOS does not support auto async frame pointers due to bitcode, so
23612361
// silently override "auto" to "never" when back-deploying. This approach
2362-
// sacrifies async backtraces when back-deploying but prevents crashes in
2362+
// sacrifices async backtraces when back-deploying but prevents crashes in
23632363
// older tools that cannot handle the async frame bit in the frame pointer.
23642364
unsigned major, minor, micro;
23652365
Triple.getWatchOSVersion(major, minor, micro);

lib/Frontend/DependencyVerifier.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,13 @@ struct Obligation {
127127
/// A token returned when an \c Obligation is fulfilled or failed. An \c
128128
/// Obligation is the only type that may construct fulfillment tokens.
129129
///
130-
/// \c FullfillmentToken prevents misuse of the \c Obligation
130+
/// \c FulfillmentToken prevents misuse of the \c Obligation
131131
/// structure by requiring its state to be changed along all program paths.
132-
struct FullfillmentToken {
132+
struct FulfillmentToken {
133133
friend Obligation;
134134

135135
private:
136-
FullfillmentToken() = default;
136+
FulfillmentToken() = default;
137137
};
138138

139139
/// An \c Obligation::Key is a reduced set of the common data contained in an
@@ -225,16 +225,16 @@ struct Obligation {
225225

226226
public:
227227
bool isOwed() const { return state == State::Owed; }
228-
FullfillmentToken fullfill() {
228+
FulfillmentToken fulfill() {
229229
assert(state == State::Owed &&
230230
"Cannot fulfill an obligation more than once!");
231231
state = State::Fulfilled;
232-
return FullfillmentToken{};
232+
return FulfillmentToken{};
233233
}
234-
FullfillmentToken fail() {
234+
FulfillmentToken fail() {
235235
assert(state == State::Owed && "Cannot fail an obligation more than once!");
236236
state = State::Failed;
237-
return FullfillmentToken{};
237+
return FulfillmentToken{};
238238
}
239239
};
240240

@@ -278,7 +278,7 @@ class DependencyVerifier {
278278
/// fail is called with the unmatched expectation value.
279279
void matchExpectationOrFail(
280280
ObligationMap &OM, const Expectation &expectation,
281-
llvm::function_ref<Obligation::FullfillmentToken(Obligation &)> fulfill,
281+
llvm::function_ref<Obligation::FulfillmentToken(Obligation &)> fulfill,
282282
llvm::function_ref<void(const Expectation &)> fail) {
283283
auto entry = OM.find(Obligation::Key::forExpectation(expectation));
284284
if (entry == OM.end()) {
@@ -440,13 +440,13 @@ bool DependencyVerifier::verifyObligations(
440440
case Expectation::Kind::Negative:
441441
llvm_unreachable("Should have been handled above!");
442442
case Expectation::Kind::Member:
443-
return O.fullfill();
443+
return O.fulfill();
444444
case Expectation::Kind::PotentialMember:
445445
assert(O.getName().empty());
446-
return O.fullfill();
446+
return O.fulfill();
447447
case Expectation::Kind::Provides:
448448
case Expectation::Kind::DynamicMember:
449-
return O.fullfill();
449+
return O.fulfill();
450450
}
451451

452452
llvm_unreachable("Unhandled expectation kind!");

lib/Frontend/Frontend.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ bool CompilerInstance::setUpASTContextIfNeeded() {
256256
}
257257

258258
void CompilerInstance::setupStatsReporter() {
259-
const auto &Invok = getInvocation();
259+
const auto &Invoke = getInvocation();
260260
const std::string &StatsOutputDir =
261-
Invok.getFrontendOptions().StatsOutputDir;
261+
Invoke.getFrontendOptions().StatsOutputDir;
262262
if (StatsOutputDir.empty())
263263
return;
264264

@@ -281,9 +281,9 @@ void CompilerInstance::setupStatsReporter() {
281281
return nullptr;
282282
};
283283

284-
const auto &FEOpts = Invok.getFrontendOptions();
285-
const auto &LangOpts = Invok.getLangOptions();
286-
const auto &SILOpts = Invok.getSILOptions();
284+
const auto &FEOpts = Invoke.getFrontendOptions();
285+
const auto &LangOpts = Invoke.getLangOptions();
286+
const auto &SILOpts = Invoke.getSILOptions();
287287
const std::string &OutFile =
288288
FEOpts.InputsAndOutputs.lastInputProducingOutput().outputFilename();
289289
auto Reporter = std::make_unique<UnifiedStatsReporter>(
@@ -296,9 +296,9 @@ void CompilerInstance::setupStatsReporter() {
296296
StatsOutputDir,
297297
&getSourceMgr(),
298298
getClangSourceManager(getASTContext()),
299-
Invok.getFrontendOptions().TraceStats,
300-
Invok.getFrontendOptions().ProfileEvents,
301-
Invok.getFrontendOptions().ProfileEntities);
299+
Invoke.getFrontendOptions().TraceStats,
300+
Invoke.getFrontendOptions().ProfileEvents,
301+
Invoke.getFrontendOptions().ProfileEntities);
302302
// Hand the stats reporter down to the ASTContext so the rest of the compiler
303303
// can use it.
304304
getASTContext().setStatsReporter(Reporter.get());
@@ -358,9 +358,9 @@ void CompilerInstance::setupDependencyTrackerIfNeeded() {
358358
DepTracker = std::make_unique<DependencyTracker>(*collectionMode);
359359
}
360360

361-
bool CompilerInstance::setup(const CompilerInvocation &Invok,
361+
bool CompilerInstance::setup(const CompilerInvocation &Invoke,
362362
std::string &Error) {
363-
Invocation = Invok;
363+
Invocation = Invoke;
364364

365365
setupDependencyTrackerIfNeeded();
366366

@@ -1229,7 +1229,7 @@ CompilerInstance::getSourceFileParsingOptions(bool forPrimary) const {
12291229
if (forPrimary ||
12301230
typeOpts.SkipFunctionBodies ==
12311231
FunctionBodySkipping::NonInlinableWithoutTypes ||
1232-
frontendOpts.ReuseFrontendForMutipleCompilations) {
1232+
frontendOpts.ReuseFrontendForMultipleCompilations) {
12331233
opts |= SourceFile::ParsingFlags::EnableInterfaceHash;
12341234
}
12351235
return opts;

lib/Frontend/FrontendInputsAndOutputs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,6 @@ FrontendInputsAndOutputs::primaryInputNamed(StringRef name) const {
570570
if (iterator == PrimaryInputsByName.end())
571571
return nullptr;
572572
const InputFile *f = &AllInputs[iterator->second];
573-
assert(f->isPrimary() && "PrimaryInputsByName should only include primries");
573+
assert(f->isPrimary() && "PrimaryInputsByName should only include primaries");
574574
return f;
575575
}

0 commit comments

Comments
 (0)