Skip to content

Spelling dependencyscan #42519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Apr 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ using ContextHashField = IdentifierIDField;
/// A bit that indicates whether or not a module is a framework
using IsFrameworkField = BCFixed<1>;

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

/// Identifiers used to refer to the above arrays
Expand Down Expand Up @@ -102,7 +102,7 @@ using IdentifierNodeLayout = BCRecordLayout<IDENTIFIER_NODE, BCBlob>;
//
// These arrays are also referenced by their sequence number,
// starting from 1, similar to identifiers above. Value 0 indicates an
// empty array. This record is used because individiual array fields must
// empty array. This record is used because individual array fields must
// appear as the last field of whatever record they belong to, and several of
// the below record layouts contain multiple arrays.
using IdentifierArrayLayout =
Expand Down
12 changes: 6 additions & 6 deletions lib/DependencyScan/DependencyScanningTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ namespace swift {
namespace dependencies {

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

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

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

// We must reset option occurences because we are handling an unrelated
// command-line to those possibly parsed parsed before using the same tool.
// We must reset option occurrences because we are handling an unrelated
// command-line to those possibly parsed before using the same tool.
// We must do so because LLVM options parsing is done using a managed
// static `GlobalParser`.
llvm::cl::ResetAllOptionOccurrences();
Expand Down
6 changes: 3 additions & 3 deletions lib/DependencyScan/ModuleDependencyCacheSerialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ using ModuleIdentifierArrayKey =
template <>
struct llvm::DenseMapInfo<ModuleIdentifierArrayKind> {
using UnderlyingType = std::underlying_type<ModuleIdentifierArrayKind>::type;
using UnerlyingInfo = DenseMapInfo<UnderlyingType>;
using UnderlyingInfo = DenseMapInfo<UnderlyingType>;

static inline ModuleIdentifierArrayKind getEmptyKey() {
return ModuleIdentifierArrayKind::Empty;
Expand All @@ -599,7 +599,7 @@ struct llvm::DenseMapInfo<ModuleIdentifierArrayKind> {
}
static unsigned getHashValue(const ModuleIdentifierArrayKind &arrKind) {
auto underlyingValue = static_cast<UnderlyingType>(arrKind);
return UnerlyingInfo::getHashValue(underlyingValue);
return UnderlyingInfo::getHashValue(underlyingValue);
}
static bool isEqual(const ModuleIdentifierArrayKind &LHS,
const ModuleIdentifierArrayKind &RHS) {
Expand Down Expand Up @@ -802,7 +802,7 @@ void Serializer::writeModuleInfo(ModuleDependencyID moduleID,
}
case swift::ModuleDependenciesKind::SwiftSource: {
assert(!triple.hasValue() &&
"Did not expecte triple for serializing MODULE_NODE");
"Did not expect triple for serializing MODULE_NODE");
auto swiftSourceDeps = dependencyInfo.getAsSwiftSourceModule();
assert(swiftSourceDeps);
unsigned bridgingHeaderFileId =
Expand Down
22 changes: 11 additions & 11 deletions lib/DependencyScan/ScanDependencies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ resolveDirectDependencies(CompilerInstance &instance, ModuleDependencyID module,
return std::vector<ModuleDependencyID>(result.begin(), result.end());
}

static void discoverCrosssImportOverlayDependencies(
static void discoverCrossImportOverlayDependencies(
CompilerInstance &instance, StringRef mainModuleName,
ArrayRef<ModuleDependencyID> allDependencies,
ModuleDependenciesCache &cache, InterfaceSubContextDelegate &ASTDelegate,
Expand Down Expand Up @@ -316,7 +316,7 @@ static void discoverCrosssImportOverlayDependencies(
std::set<ModuleDependencyID>>
allModules;

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

// Explore the dependencies of every module.
Expand Down Expand Up @@ -1024,9 +1024,9 @@ static void updateCachedInstanceOpts(CompilerInstance &cachedInstance,
cachedInstance.getASTContext().SearchPathOpts =
invocationInstance.getASTContext().SearchPathOpts;

// The Clang Importer arguments must consiste of a combination of
// The Clang Importer arguments must consist of a combination of
// Clang Importer arguments of the current invocation to inherit its Clang-specific
// search path options, followed by the options speicific to the given batch-entry,
// search path options, followed by the options specific to the given batch-entry,
// which may overload some of the invocation's options (e.g. target)
cachedInstance.getASTContext().ClangImporterOpts =
invocationInstance.getASTContext().ClangImporterOpts;
Expand All @@ -1053,7 +1053,7 @@ forEachBatchEntry(CompilerInstance &invocationInstance,
llvm::function_ref<void(BatchScanInput, CompilerInstance &,
ModuleDependenciesCache &)>
scanningAction) {
const CompilerInvocation &invok = invocationInstance.getInvocation();
const CompilerInvocation &invoke = invocationInstance.getInvocation();
bool localSubInstanceMap = false;
CompilerArgInstanceCacheMap *subInstanceMap;
if (versionedPCMInstanceCache)
Expand Down Expand Up @@ -1082,7 +1082,7 @@ forEachBatchEntry(CompilerInstance &invocationInstance,
// those of the current scanner invocation.
updateCachedInstanceOpts(*pInstance, invocationInstance, entry.arguments);
} else {
// We must reset option occurences because we are handling an unrelated command-line
// We must reset option occurrences because we are handling an unrelated command-line
// to those parsed before. We must do so because LLVM options parsing is done
// using a managed static `GlobalParser`.
llvm::cl::ResetAllOptionOccurrences();
Expand All @@ -1100,15 +1100,15 @@ forEachBatchEntry(CompilerInstance &invocationInstance,
pCache = std::get<2>((*subInstanceMap)[entry.arguments]).get();
SmallVector<const char *, 4> args;
llvm::cl::TokenizeGNUCommandLine(entry.arguments, saver, args);
CompilerInvocation subInvok = invok;
CompilerInvocation subInvoke = invoke;
pInstance->addDiagnosticConsumer(&FDC);
if (subInvok.parseArgs(args, diags)) {
if (subInvoke.parseArgs(args, diags)) {
invocationInstance.getDiags().diagnose(
SourceLoc(), diag::scanner_arguments_invalid, entry.arguments);
return true;
}
std::string InstanceSetupError;
if (pInstance->setup(subInvok, InstanceSetupError)) {
if (pInstance->setup(subInvoke, InstanceSetupError)) {
invocationInstance.getDiags().diagnose(
SourceLoc(), diag::scanner_arguments_invalid, entry.arguments);
return true;
Expand Down Expand Up @@ -1434,13 +1434,13 @@ swift::dependencies::performModuleScan(CompilerInstance &instance,
}

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

// Dignose cycle in dependency graph.
// Diagnose cycle in dependency graph.
if (diagnoseCycle(instance, cache, /*MainModule*/ allModules.front(),
ASTDelegate))
return std::make_error_code(std::errc::not_supported);
Expand Down