Skip to content

Commit 0157631

Browse files
authored
Spelling dependencyscan (#42519)
* spelling: consist Signed-off-by: Josh Soref <[email protected]> * spelling: cross Signed-off-by: Josh Soref <[email protected]> * spelling: diagnose Signed-off-by: Josh Soref <[email protected]> * spelling: distinguished Signed-off-by: Josh Soref <[email protected]> * spelling: dummy Signed-off-by: Josh Soref <[email protected]> * spelling: expect Signed-off-by: Josh Soref <[email protected]> * spelling: individual Signed-off-by: Josh Soref <[email protected]> * spelling: invoke Signed-off-by: Josh Soref <[email protected]> * spelling: occurrences Signed-off-by: Josh Soref <[email protected]> * spelling: parsed Signed-off-by: Josh Soref <[email protected]> * spelling: retrieving Signed-off-by: Josh Soref <[email protected]> * spelling: specific Signed-off-by: Josh Soref <[email protected]> * spelling: underlying Signed-off-by: Josh Soref <[email protected]> Co-authored-by: Josh Soref <[email protected]>
1 parent 04bf10b commit 0157631

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

include/swift/DependencyScan/SerializedModuleDependencyCacheFormat.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ using ContextHashField = IdentifierIDField;
5151
/// A bit that indicates whether or not a module is a framework
5252
using IsFrameworkField = BCFixed<1>;
5353

54-
/// Arrays of various identifiers, distinguised for readability
54+
/// Arrays of various identifiers, distinguished for readability
5555
using IdentifierIDArryField = llvm::BCArray<IdentifierIDField>;
5656

5757
/// Identifiers used to refer to the above arrays
@@ -102,7 +102,7 @@ using IdentifierNodeLayout = BCRecordLayout<IDENTIFIER_NODE, BCBlob>;
102102
//
103103
// These arrays are also referenced by their sequence number,
104104
// starting from 1, similar to identifiers above. Value 0 indicates an
105-
// empty array. This record is used because individiual array fields must
105+
// empty array. This record is used because individual array fields must
106106
// appear as the last field of whatever record they belong to, and several of
107107
// the below record layouts contain multiple arrays.
108108
using IdentifierArrayLayout =

lib/DependencyScan/DependencyScanningTool.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ namespace swift {
2727
namespace dependencies {
2828

2929
llvm::ErrorOr<swiftscan_string_ref_t> getTargetInfo(ArrayRef<const char *> Command) {
30-
// We must reset option occurences because we are handling an unrelated
31-
// command-line to those possibly parsed parsed before using the same tool.
30+
// We must reset option occurrences because we are handling an unrelated
31+
// command-line to those possibly parsed before using the same tool.
3232
// We must do so because LLVM options parsing is done using a managed
3333
// static `GlobalParser`.
3434
llvm::cl::ResetAllOptionOccurrences();
@@ -74,7 +74,7 @@ DependencyScanningTool::getDependencies(
7474

7575
// Local scan cache instance, wrapping the shared global cache.
7676
ModuleDependenciesCache cache(*SharedCache);
77-
// Execute the scanning action, retreiving the in-memory result
77+
// Execute the scanning action, retrieving the in-memory result
7878
auto DependenciesOrErr = performModuleScan(*Instance.get(), cache);
7979
if (DependenciesOrErr.getError())
8080
return std::make_error_code(std::errc::not_supported);
@@ -91,7 +91,7 @@ DependencyScanningTool::getImports(ArrayRef<const char *> Command) {
9191
return EC;
9292
auto Instance = std::move(*InstanceOrErr);
9393

94-
// Execute the scanning action, retreiving the in-memory result
94+
// Execute the scanning action, retrieving the in-memory result
9595
auto DependenciesOrErr = performModulePrescan(*Instance.get());
9696
if (DependenciesOrErr.getError())
9797
return std::make_error_code(std::errc::not_supported);
@@ -175,8 +175,8 @@ DependencyScanningTool::initCompilerInstanceForScan(
175175
SmallString<128> WorkingDirectory;
176176
llvm::sys::fs::current_path(WorkingDirectory);
177177

178-
// We must reset option occurences because we are handling an unrelated
179-
// command-line to those possibly parsed parsed before using the same tool.
178+
// We must reset option occurrences because we are handling an unrelated
179+
// command-line to those possibly parsed before using the same tool.
180180
// We must do so because LLVM options parsing is done using a managed
181181
// static `GlobalParser`.
182182
llvm::cl::ResetAllOptionOccurrences();

lib/DependencyScan/ModuleDependencyCacheSerialization.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ using ModuleIdentifierArrayKey =
589589
template <>
590590
struct llvm::DenseMapInfo<ModuleIdentifierArrayKind> {
591591
using UnderlyingType = std::underlying_type<ModuleIdentifierArrayKind>::type;
592-
using UnerlyingInfo = DenseMapInfo<UnderlyingType>;
592+
using UnderlyingInfo = DenseMapInfo<UnderlyingType>;
593593

594594
static inline ModuleIdentifierArrayKind getEmptyKey() {
595595
return ModuleIdentifierArrayKind::Empty;
@@ -599,7 +599,7 @@ struct llvm::DenseMapInfo<ModuleIdentifierArrayKind> {
599599
}
600600
static unsigned getHashValue(const ModuleIdentifierArrayKind &arrKind) {
601601
auto underlyingValue = static_cast<UnderlyingType>(arrKind);
602-
return UnerlyingInfo::getHashValue(underlyingValue);
602+
return UnderlyingInfo::getHashValue(underlyingValue);
603603
}
604604
static bool isEqual(const ModuleIdentifierArrayKind &LHS,
605605
const ModuleIdentifierArrayKind &RHS) {
@@ -802,7 +802,7 @@ void Serializer::writeModuleInfo(ModuleDependencyID moduleID,
802802
}
803803
case swift::ModuleDependenciesKind::SwiftSource: {
804804
assert(!triple.hasValue() &&
805-
"Did not expecte triple for serializing MODULE_NODE");
805+
"Did not expect triple for serializing MODULE_NODE");
806806
auto swiftSourceDeps = dependencyInfo.getAsSwiftSourceModule();
807807
assert(swiftSourceDeps);
808808
unsigned bridgingHeaderFileId =

lib/DependencyScan/ScanDependencies.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ resolveDirectDependencies(CompilerInstance &instance, ModuleDependencyID module,
245245
return std::vector<ModuleDependencyID>(result.begin(), result.end());
246246
}
247247

248-
static void discoverCrosssImportOverlayDependencies(
248+
static void discoverCrossImportOverlayDependencies(
249249
CompilerInstance &instance, StringRef mainModuleName,
250250
ArrayRef<ModuleDependencyID> allDependencies,
251251
ModuleDependenciesCache &cache, InterfaceSubContextDelegate &ASTDelegate,
@@ -316,7 +316,7 @@ static void discoverCrosssImportOverlayDependencies(
316316
std::set<ModuleDependencyID>>
317317
allModules;
318318

319-
// Seed the all module list from the dummpy main module.
319+
// Seed the all module list from the dummy main module.
320320
allModules.insert({dummyMainName.str(), dummyMainDependencies.getKind()});
321321

322322
// Explore the dependencies of every module.
@@ -1024,9 +1024,9 @@ static void updateCachedInstanceOpts(CompilerInstance &cachedInstance,
10241024
cachedInstance.getASTContext().SearchPathOpts =
10251025
invocationInstance.getASTContext().SearchPathOpts;
10261026

1027-
// The Clang Importer arguments must consiste of a combination of
1027+
// The Clang Importer arguments must consist of a combination of
10281028
// Clang Importer arguments of the current invocation to inherit its Clang-specific
1029-
// search path options, followed by the options speicific to the given batch-entry,
1029+
// search path options, followed by the options specific to the given batch-entry,
10301030
// which may overload some of the invocation's options (e.g. target)
10311031
cachedInstance.getASTContext().ClangImporterOpts =
10321032
invocationInstance.getASTContext().ClangImporterOpts;
@@ -1053,7 +1053,7 @@ forEachBatchEntry(CompilerInstance &invocationInstance,
10531053
llvm::function_ref<void(BatchScanInput, CompilerInstance &,
10541054
ModuleDependenciesCache &)>
10551055
scanningAction) {
1056-
const CompilerInvocation &invok = invocationInstance.getInvocation();
1056+
const CompilerInvocation &invoke = invocationInstance.getInvocation();
10571057
bool localSubInstanceMap = false;
10581058
CompilerArgInstanceCacheMap *subInstanceMap;
10591059
if (versionedPCMInstanceCache)
@@ -1082,7 +1082,7 @@ forEachBatchEntry(CompilerInstance &invocationInstance,
10821082
// those of the current scanner invocation.
10831083
updateCachedInstanceOpts(*pInstance, invocationInstance, entry.arguments);
10841084
} else {
1085-
// We must reset option occurences because we are handling an unrelated command-line
1085+
// We must reset option occurrences because we are handling an unrelated command-line
10861086
// to those parsed before. We must do so because LLVM options parsing is done
10871087
// using a managed static `GlobalParser`.
10881088
llvm::cl::ResetAllOptionOccurrences();
@@ -1100,15 +1100,15 @@ forEachBatchEntry(CompilerInstance &invocationInstance,
11001100
pCache = std::get<2>((*subInstanceMap)[entry.arguments]).get();
11011101
SmallVector<const char *, 4> args;
11021102
llvm::cl::TokenizeGNUCommandLine(entry.arguments, saver, args);
1103-
CompilerInvocation subInvok = invok;
1103+
CompilerInvocation subInvoke = invoke;
11041104
pInstance->addDiagnosticConsumer(&FDC);
1105-
if (subInvok.parseArgs(args, diags)) {
1105+
if (subInvoke.parseArgs(args, diags)) {
11061106
invocationInstance.getDiags().diagnose(
11071107
SourceLoc(), diag::scanner_arguments_invalid, entry.arguments);
11081108
return true;
11091109
}
11101110
std::string InstanceSetupError;
1111-
if (pInstance->setup(subInvok, InstanceSetupError)) {
1111+
if (pInstance->setup(subInvoke, InstanceSetupError)) {
11121112
invocationInstance.getDiags().diagnose(
11131113
SourceLoc(), diag::scanner_arguments_invalid, entry.arguments);
11141114
return true;
@@ -1434,13 +1434,13 @@ swift::dependencies::performModuleScan(CompilerInstance &instance,
14341434
}
14351435

14361436
// We have all explicit imports now, resolve cross import overlays.
1437-
discoverCrosssImportOverlayDependencies(
1437+
discoverCrossImportOverlayDependencies(
14381438
instance, mainModuleName,
14391439
/*All transitive dependencies*/ allModules.getArrayRef().slice(1), cache,
14401440
ASTDelegate, [&](ModuleDependencyID id) { allModules.insert(id); },
14411441
currentImportPathSet);
14421442

1443-
// Dignose cycle in dependency graph.
1443+
// Diagnose cycle in dependency graph.
14441444
if (diagnoseCycle(instance, cache, /*MainModule*/ allModules.front(),
14451445
ASTDelegate))
14461446
return std::make_error_code(std::errc::not_supported);

0 commit comments

Comments
 (0)