Skip to content

Typos (misc): cmake, tools, utils, unittests, validation-test + more #75034

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 5 commits into from
Jul 11, 2024
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ if("${SWIFT_NATIVE_SWIFT_TOOLS_PATH}" STREQUAL "")
set(SWIFT_NATIVE_SWIFT_TOOLS_PATH "${SWIFT_RUNTIME_OUTPUT_INTDIR}")
set(SWIFT_EXEC_FOR_SWIFT_MODULES "${CMAKE_Swift_COMPILER}")
if(NOT SWIFT_EXEC_FOR_SWIFT_MODULES)
message(WARNING "BOOSTRAPPING set to OFF because no Swift compiler is defined")
message(WARNING "BOOTSTRAPPING set to OFF because no Swift compiler is defined")
set(BOOTSTRAPPING_MODE "OFF")
endif()
elseif(BOOTSTRAPPING_MODE MATCHES "BOOTSTRAPPING.*")
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/SwiftConfigureSDK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ macro(configure_sdk_unix name architectures)
endif()
set(SWIFT_SDK_${prefix}_USE_ISYSROOT FALSE)

# Static linking is suported on Linux and WASI
# Static linking is supported on Linux and WASI
if("${prefix}" STREQUAL "LINUX"
OR "${prefix}" STREQUAL "LINUX_STATIC"
OR "${prefix}" STREQUAL "WASI")
Expand Down
2 changes: 1 addition & 1 deletion tools/SourceKit/lib/SwiftLang/SwiftASTManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ class ASTBuildOperation
const std::vector<FileContent> FileContents;

/// Guards \c DependencyStamps. This prevents reading from \c DependencyStamps
/// while it is being modified. It does not provide any ordering gurantees
/// while it is being modified. It does not provide any ordering guarantees
/// that \c DependencyStamps have been computed in \c buildASTUnit before they
/// are accessed in \c matchesSourceState but that's fine (see comment on
/// \c DependencyStamps).
Expand Down
2 changes: 1 addition & 1 deletion tools/SourceKit/lib/SwiftLang/SwiftLangSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ namespace {
/// A simple FileSystemProvider that creates an InMemoryFileSystem for a given
/// dictionary of file contents and overlays that on top of the real filesystem.
class InMemoryFileSystemProvider: public SourceKit::FileSystemProvider {
/// Provides the real filesystem, overlayed with an InMemoryFileSystem that
/// Provides the real filesystem, overlaid with an InMemoryFileSystem that
/// contains specified files at specified locations.
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>
getFileSystem(OptionsDictionary &options, std::string &error) override {
Expand Down
4 changes: 2 additions & 2 deletions tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2099,7 +2099,7 @@ void SwiftLangSupport::getCursorInfo(
} else {
std::string Diagnostic; // Unused.
ResolvedValueRefCursorInfoPtr Info = new ResolvedValueRefCursorInfo(
/*SourcFile=*/nullptr, SourceLoc(),
/*SourceFile=*/nullptr, SourceLoc(),
const_cast<ValueDecl *>(Entity.Dcl),
/*CtorTyRef=*/nullptr,
/*ExtTyRef=*/nullptr, Entity.IsRef,
Expand Down Expand Up @@ -2585,7 +2585,7 @@ void SwiftLangSupport::findRelatedIdentifiersInFile(
#ifndef NDEBUG
for (auto loc : Locs.getLocations()) {
assert(loc.OldName == OldName &&
"Found related identfiers with different names?");
"Found related identifiers with different names?");
}
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void disposeCancellationToken(SourceKitCancellationToken CancellationToken);

/// Returns \c true if \p Request is of a request kind that should be issued as
/// a dispatch barrier of the message handling queue. In practice, this returns
/// \c true for open, edit and close requets.
/// \c true for open, edit and close requests.
///
/// This does not check if dispatch barriers have been enabled by the sourckitd
/// client.
Expand Down
8 changes: 4 additions & 4 deletions tools/libMockPlugin/MockPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static const llvm::json::Value substitute(const llvm::json::Value &value,
// '.' <alphanum> -> object key.
if (path.starts_with(".")) {
if (subst->kind() != llvm::json::Value::Object)
return "<substition error: not an object>";
return "<substitution error: not an object>";
path = path.substr(1);
auto keyLength =
path.find_if([](char c) { return !llvm::isAlnum(c) && c != '_'; });
Expand All @@ -125,20 +125,20 @@ static const llvm::json::Value substitute(const llvm::json::Value &value,
// '[' <digit>+ ']' -> array index.
if (path.starts_with("[")) {
if (subst->kind() != llvm::json::Value::Array)
return "<substition error: not an array>";
return "<substitution error: not an array>";
path = path.substr(1);
auto idxlength = path.find_if([](char c) { return !llvm::isDigit(c); });
size_t idx;
(void)path.slice(0, idxlength).getAsInteger(10, idx);
subst = &(*subst->getAsArray())[idx];
path = path.substr(idxlength);
if (!path.starts_with("]"))
return "<substition error: missing ']' after digits>";
return "<substitution error: missing ']' after digits>";
path = path.substr(1);
continue;
}
// Malformed.
return "<substition error: malformed path>";
return "<substitution error: malformed path>";
}
return *subst;
}
Expand Down
4 changes: 2 additions & 2 deletions tools/libSwiftScan/SwiftCaching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ bool swiftscan_cas_prune_ondisk_data(swiftscan_cas_t cas,
return false;
}

/// Expand the invocation if there is repsonseFile into Args that are passed in
/// Expand the invocation if there is responseFile into Args that are passed in
/// the parameter. Return swift-frontend arguments in an ArrayRef, which has the
/// first "-frontend" option dropped if needed.
static llvm::ArrayRef<const char *>
Expand Down Expand Up @@ -966,7 +966,7 @@ static llvm::Error replayCompilation(SwiftScanReplayInstance &Instance,
return Proxy.takeError();

if (Kind == file_types::ID::TY_CachedDiagnostics) {
assert(!DiagnosticsOutput && "more than 1 diagnotics found");
assert(!DiagnosticsOutput && "more than 1 diagnostics found");
DiagnosticsOutput = std::move(*Proxy);
} else
OutputProxies.emplace_back(
Expand Down
2 changes: 1 addition & 1 deletion tools/lldb-moduleimport-test/lldb-moduleimport-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ int main(int argc, char **argv) {
desc("Dump the imported module after checking it imports just fine"),
cat(Visible));

opt<bool> Verbose("verbose", desc("Dump informations on the loaded module"),
opt<bool> Verbose("verbose", desc("Dump information on the loaded module"),
cat(Visible));

opt<std::string> Filter("filter", desc("triple for filtering modules"),
Expand Down
6 changes: 3 additions & 3 deletions tools/swift-ide-test/swift-ide-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ static llvm::cl::opt<bool> CodeCompletionAddCallWithNoDefaultArgs(

static llvm::cl::list<std::string>
ConformingMethodListExpectedTypes("conforming-methods-expected-types",
llvm::cl::desc("Set expected types for comforming method list"),
llvm::cl::desc("Set expected types for conforming method list"),
llvm::cl::cat(Category));

// '-syntax-coloring' options.
Expand Down Expand Up @@ -3050,7 +3050,7 @@ static int doPrintModules(const CompilerInvocation &InitInvok,
registerIDERequestFunctions(CI.getASTContext().evaluator);
auto &Context = CI.getASTContext();

// Load implict imports so that Clang importer can use it.
// Load implicit imports so that Clang importer can use it.
for (auto unloadedImport :
CI.getMainModule()->getImplicitImportInfo().AdditionalUnloadedImports) {
(void)Context.getModule(unloadedImport.module.getModulePath());
Expand Down Expand Up @@ -3117,7 +3117,7 @@ static int doPrintHeaders(const CompilerInvocation &InitInvok,
registerIDERequestFunctions(CI.getASTContext().evaluator);
auto &Context = CI.getASTContext();

// Load implict imports so that Clang importer can use it.
// Load implicit imports so that Clang importer can use it.
for (auto unloadedImport :
CI.getMainModule()->getImplicitImportInfo().AdditionalUnloadedImports) {
(void)Context.getModule(unloadedImport.module.getModulePath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,20 +313,20 @@ fileprivate class ConcurrencyDumper {
let taskToThread: [swift_addr_t: UInt64] =
Dictionary(threadCurrentTasks.map{ ($1, $0) }, uniquingKeysWith: { $1 })

var lastChilds: [Bool] = []
var lastChildFlags: [Bool] = []

let hierarchy = taskHierarchy()
for (i, (level, lastChild, task)) in hierarchy.enumerated() {
lastChilds.removeSubrange(level...)
lastChilds.append(lastChild)
lastChildFlags.removeSubrange(level...)
lastChildFlags.append(lastChild)

let prevEntry = i > 0 ? hierarchy[i - 1] : nil

let levelDidIncrease = level > (prevEntry?.level ?? -1)

var prefix = ""
for lastChild in lastChilds {
prefix += lastChild ? " " : " | "
for lastChildFlag in lastChildFlags {
prefix += lastChildFlag ? " " : " | "
}
prefix += " "
let firstPrefix = String(prefix.dropLast(5) + (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ internal struct DumpGenericMetadata: ParsableCommand {
}

private func dumpText(process: any RemoteProcess, generics: [Metadata]) throws {
var errorneousMetadata: [(ptr: swift_reflection_ptr_t, name: String)] = []
var erroneousMetadata: [(ptr: swift_reflection_ptr_t, name: String)] = []
var output = try Output(genericMetadataOptions.outputFile)
print("\(process.processName)(\(process.processIdentifier)):\n", to: &output)
print("Address", "Allocation", "Size", "Offset", "isArrayOfClass", "Name", separator: "\t", to: &output)
Expand All @@ -178,7 +178,7 @@ internal struct DumpGenericMetadata: ParsableCommand {
print("\(hex: allocation.ptr)\t\(allocation.size)\t\(offset)", terminator: "\t", to: &output)
} else {
if $0.garbage {
errorneousMetadata.append((ptr: $0.ptr, name: $0.name))
erroneousMetadata.append((ptr: $0.ptr, name: $0.name))
}
print("???\t??\t???", terminator: "\t", to: &output)
}
Expand All @@ -189,9 +189,9 @@ internal struct DumpGenericMetadata: ParsableCommand {
}
}

if errorneousMetadata.count > 0 {
if erroneousMetadata.count > 0 {
print("Warning: The following metadata was not found in any DATA or AUTH segments, may be garbage.", to: &output)
errorneousMetadata.forEach {
erroneousMetadata.forEach {
print("\(hex: $0.ptr)\t\($0.name)", to: &output)
}
}
Expand Down
2 changes: 1 addition & 1 deletion unittests/AST/ImportTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ImportPathContext {
public:
ImportPathContext() = default;

/// Hepler routine for building ImportPath
/// Helper routine for building ImportPath
/// Build()
/// @see ImportPathBuilder
inline ImportPath Build(StringRef Name) noexcept {
Expand Down
6 changes: 3 additions & 3 deletions utils/api_checker/dump-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sh "$DIR/sdk-module-lists/create-module-lists.sh"
MacSDKPath=$(xcrun -sdk macosx -show-sdk-path)
IphoneOSSDKPath=$(xcrun -sdk iphoneos -show-sdk-path)
AppleTVOSSDKPath=$(xcrun -sdk appletvos -show-sdk-path)
WathOSSDKPath=$(xcrun -sdk watchos -show-sdk-path)
WatchOSSDKPath=$(xcrun -sdk watchos -show-sdk-path)

XCTestMac="$MacSDKPath/../../Library/Frameworks/"
XCTestIphone="$IphoneOSSDKPath/../../Library/Frameworks/"
Expand Down Expand Up @@ -42,7 +42,7 @@ if [[ -z "$MODULE" ]]; then
$SWIFT_API_DIGESTER -target x86_64-apple-macosx10.15 -o "$BASEDIR/macos$XCODE_VER.json" -dump-sdk -sdk "$MacSDKPath" -module-list-file "/tmp/modules-osx.txt" -F "$XCTestMac" -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER
$SWIFT_API_DIGESTER -target arm64-apple-ios13.5 -o "$BASEDIR/ios$XCODE_VER.json" -dump-sdk -sdk "$IphoneOSSDKPath" -module-list-file "/tmp/modules-iphoneos.txt" -F "$XCTestIphone" -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER
$SWIFT_API_DIGESTER -target arm64-apple-tvos13.4 -o "$BASEDIR/tvos$XCODE_VER.json" -dump-sdk -sdk "$AppleTVOSSDKPath" -module-list-file "/tmp/modules-tvos.txt" -F "$XCTestTV" -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER
$SWIFT_API_DIGESTER -target armv7k-apple-watchos6.2 -o "$BASEDIR/watchos$XCODE_VER.json" -dump-sdk -sdk "$WathOSSDKPath" -module-list-file "/tmp/modules-watchos.txt" -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER
$SWIFT_API_DIGESTER -target armv7k-apple-watchos6.2 -o "$BASEDIR/watchos$XCODE_VER.json" -dump-sdk -sdk "$WatchOSSDKPath" -module-list-file "/tmp/modules-watchos.txt" -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER
$SWIFT_API_DIGESTER -target x86_64-apple-macosx10.15 -o "$BASEDIR/macos-stdlib$XCODE_VER.json" -dump-sdk -sdk "$MacSDKPath" -module Swift -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER
else
ALL_MODULE_DIR="$BASEDIR/Xcode$XCODE_VER"
Expand All @@ -60,6 +60,6 @@ else
$SWIFT_API_DIGESTER -target x86_64-apple-macosx10.15 -o "$MODULE_DIR/macos.json" -dump-sdk -sdk "$MacSDKPath" -module "$MODULE" -F "$XCTestMac" -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER
$SWIFT_API_DIGESTER -target arm64-apple-ios13.5 -o "$MODULE_DIR/ios.json" -dump-sdk -sdk "$IphoneOSSDKPath" -module "$MODULE" -F "$XCTestIphone" -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER
$SWIFT_API_DIGESTER -target arm64-apple-tvos13.4 -o "$MODULE_DIR/tvos.json" -dump-sdk -sdk "$AppleTVOSSDKPath" -module "$MODULE" -F "$XCTestTV" -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER
$SWIFT_API_DIGESTER -target armv7k-apple-watchos6.2 -o "$MODULE_DIR/watchos.json" -dump-sdk -sdk "$WathOSSDKPath" -module "$MODULE" -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER
$SWIFT_API_DIGESTER -target armv7k-apple-watchos6.2 -o "$MODULE_DIR/watchos.json" -dump-sdk -sdk "$WatchOSSDKPath" -module "$MODULE" -module-cache-path "$DumpDir/ModuleCache" -swift-version $SWIFT_VER
done
fi
4 changes: 2 additions & 2 deletions utils/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ function Build-CMakeProject {

if ($Platform -eq "Windows") {
$SwiftArgs += @("-Xlinker", "/INCREMENTAL:NO")
# Swift Requries COMDAT folding and de-duplication
# Swift requires COMDAT folding and de-duplication
$SwiftArgs += @("-Xlinker", "/OPT:REF")
$SwiftArgs += @("-Xlinker", "/OPT:ICF")
}
Expand Down Expand Up @@ -1193,7 +1193,7 @@ function Build-WiXProject() {
if (-not $Bundle) {
# WiX v4 will accept a semantic version string for Bundles,
# but Packages still require a purely numerical version number,
# so trim any semantic versionning suffixes
# so trim any semantic versioning suffixes
$ProductVersionArg = [regex]::Replace($ProductVersion, "[-+].*", "")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func getDecompData(
let decomp = components[5]

// We either 1. don't have decompositions, or 2. the decompositions is for
// compatibile forms. We only care about NFD, so ignore these cases.
// compatible forms. We only care about NFD, so ignore these cases.
if decomp == "" || decomp.hasPrefix("<") {
continue
}
Expand Down
2 changes: 1 addition & 1 deletion utils/gyb.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def split_lines(s):

# Note: Where "# Absorb" appears below, the regexp attempts to eat up
# through the end of ${...} and %{...}% constructs. In reality we
# handle this with the Python tokenizer, which avoids mis-detections
# handle this with the Python tokenizer, which avoids misdetections
# due to nesting, comments and strings. This extra absorption in the
# regexp facilitates testing the regexp on its own, by preventing the
# interior of some of these constructs from being treated as literal
Expand Down
10 changes: 5 additions & 5 deletions utils/line-directive
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def run():
... // Licensed under Apache License v2.0 with Runtime Library Exception
... //
... // See https://swift.org/LICENSE.txt for license information
... // See https://swift.org/CONTRIBUTORS.txt for the list of Swift projec
... // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project
... //
... //===-----------------------------------------------------------------
...
Expand Down Expand Up @@ -408,7 +408,7 @@ def run():
... return _base.underestimatedCount
... }
...
... /// Creates an instance with elements `transform(x)` for each elemen
... /// Creates an instance with elements `transform(x)` for each element
... /// `x` of base.
... @_inlineable
... @_versioned
Expand All @@ -433,7 +433,7 @@ def run():
... // ###sourceLocation(file: "/public/core/Map.swift.gyb", line: 108)
...
... /// A `Collection` whose elements consist of those in a `Base`
... /// `Collection` passed through a transform function returning `Elemen
... /// `Collection` passed through a transform function returning `Element`
... /// These elements are computed lazily, each time they're read, by
... /// calling the transform function on a base element.
... @_fixed_layout
Expand Down Expand Up @@ -471,7 +471,7 @@ def run():
... // ###sourceLocation(file: "/public/core/Map.swift.gyb", line: 108)
...
... /// A `Collection` whose elements consist of those in a `Base`
... /// `Collection` passed through a transform function returning `Elemen
... /// `Collection` passed through a transform function returning `Element`
... /// These elements are computed lazily, each time they're read, by
... /// calling the transform function on a base element.
... @_fixed_layout
Expand Down Expand Up @@ -509,7 +509,7 @@ def run():
... // ###sourceLocation(file: "/public/core/Map.swift.gyb", line: 108)
...
... /// A `Collection` whose elements consist of those in a `Base`
... /// `Collection` passed through a transform function returning `Elemen
... /// `Collection` passed through a transform function returning `Element`
... /// These elements are computed lazily, each time they're read, by
... /// calling the transform function on a base element.
... @_fixed_layout
Expand Down
4 changes: 2 additions & 2 deletions utils/parser-lib/profile-input.swift
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ class BrowserViewController: UIViewController {
self.displayedPopoverController = nil
}

// If we are displying a private tab, hide any elements in the tab that we wouldn't want shown
// If we are displaying a private tab, hide any elements in the tab that we wouldn't want shown
// when the app is in the home switcher
guard let privateTab = tabManager.selectedTab, privateTab.isPrivate else {
return
Expand Down Expand Up @@ -1104,7 +1104,7 @@ class BrowserViewController: UIViewController {
postLocationChangeNotificationForTab(tab, navigation: navigation)

// Fire the readability check. This is here and not in the pageShow event handler in ReaderMode.js anymore
// because that event wil not always fire due to unreliable page caching. This will either let us know that
// because that event will not always fire due to unreliable page caching. This will either let us know that
// the currently loaded page can be turned into reading mode or if the page already is in reading mode. We
// ignore the result because we are being called back asynchronous when the readermode status changes.
webView.evaluateJavaScript("\(ReaderModeNamespace).checkReadability()", completionHandler: nil)
Expand Down
2 changes: 1 addition & 1 deletion utils/recursive-lipo
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def merge_lipo_files(src_root_dirs, file_list, dest_root_dir, verbose=False,
"-- Warning: non-executable source files are different, " +
"skipping: %s" % file_paths)
else:
print("-- Warning: Unsupport file type, skipping: %s" % file_paths)
print("-- Warning: Unsupported file type, skipping: %s" % file_paths)


def main():
Expand Down
2 changes: 1 addition & 1 deletion utils/swift-bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
r"\s*\(\s*\)" # argument list
r"\s*->\s*Int\s*" # return type
r"({)?" # opening brace of the function body
r"\s*$" # whitespace ot the end of the line
r"\s*$" # whitespace at the end of the line
)


Expand Down
Loading