Skip to content

Commit 203b9ce

Browse files
authored
Spelling serialization (#42515)
* spelling: absolute Signed-off-by: Josh Soref <[email protected]> * spelling: ambiguous Signed-off-by: Josh Soref <[email protected]> * spelling: attempting Signed-off-by: Josh Soref <[email protected]> * spelling: attrs Signed-off-by: Josh Soref <[email protected]> * spelling: dependency Signed-off-by: Josh Soref <[email protected]> * spelling: extract Signed-off-by: Josh Soref <[email protected]> * spelling: function Signed-off-by: Josh Soref <[email protected]> * spelling: interface Signed-off-by: Josh Soref <[email protected]> * spelling: mandatory Signed-off-by: Josh Soref <[email protected]> * spelling: nonexistent Signed-off-by: Josh Soref <[email protected]> * spelling: particular Signed-off-by: Josh Soref <[email protected]> * spelling: related Signed-off-by: Josh Soref <[email protected]> * spelling: signature Signed-off-by: Josh Soref <[email protected]> * spelling: specifies Signed-off-by: Josh Soref <[email protected]> * spelling: that Signed-off-by: Josh Soref <[email protected]> * spelling: the Signed-off-by: Josh Soref <[email protected]> * spelling: without Signed-off-by: Josh Soref <[email protected]> Co-authored-by: Josh Soref <[email protected]>
1 parent 9773a3c commit 203b9ce

File tree

10 files changed

+20
-20
lines changed

10 files changed

+20
-20
lines changed

include/swift/Serialization/SerializedModuleLoader.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace file_types {
2424
enum ID : uint8_t;
2525
}
2626

27-
/// Spceifies how to load modules when both a module interface and serialized
27+
/// Specifies how to load modules when both a module interface and serialized
2828
/// AST are present, or whether to disallow one format or the other altogether.
2929
enum class ModuleLoadingMode {
3030
PreferInterface,
@@ -36,7 +36,7 @@ enum class ModuleLoadingMode {
3636
/// Helper type used to pass and compute the sets of related filenames used by
3737
/// \c SerializedModuleLoader subclasses.
3838
struct SerializedModuleBaseName {
39-
/// The base filename, wtihout any extension.
39+
/// The base filename, without any extension.
4040
SmallString<256> baseName;
4141

4242
/// Creates a \c SerializedModuleBaseName.

lib/Serialization/Deserialization.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4184,7 +4184,7 @@ class DeclDeserializer {
41844184

41854185
argNameAndDependencyIDs = argNameAndDependencyIDs.slice(numArgNames);
41864186

4187-
// Exctract the accessor IDs.
4187+
// Extract the accessor IDs.
41884188
for (DeclID accessorID : argNameAndDependencyIDs.slice(0, numAccessors)) {
41894189
accessors.IDs.push_back(accessorID);
41904190
}

lib/Serialization/DeserializeSIL.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ SILDeserializer::readSILFunctionChecked(DeclID FID, SILFunction *existingFn,
616616
fn->setSerialized(IsSerialized_t(isSerialized));
617617

618618
// If the serialized function comes from the same module, we're merging
619-
// modules, and can update the the linkage directly. This is needed to
619+
// modules, and can update the linkage directly. This is needed to
620620
// correctly update the linkage for forward declarations to entities defined
621621
// in another file of the same module – we want to ensure the linkage
622622
// reflects the fact that the entity isn't really external and shouldn't be
@@ -697,7 +697,7 @@ SILDeserializer::readSILFunctionChecked(DeclID FID, SILFunction *existingFn,
697697
builder.setHasOwnership(fn, hasQualifiedOwnership);
698698

699699
// Mark this function as deserialized. This avoids rerunning diagnostic
700-
// passes. Certain passes in the madatory pipeline may not work as expected
700+
// passes. Certain passes in the mandatory pipeline may not work as expected
701701
// after arbitrary optimization and lowering.
702702
if (!MF->isSIB())
703703
fn->setWasDeserializedCanonical();
@@ -710,7 +710,7 @@ SILDeserializer::readSILFunctionChecked(DeclID FID, SILFunction *existingFn,
710710
}
711711

712712
// Read and instantiate the specialize attributes.
713-
bool shouldAddSpecAtttrs = fn->getSpecializeAttrs().empty();
713+
bool shouldAddSpecAttrs = fn->getSpecializeAttrs().empty();
714714
bool shouldAddEffectAttrs = !fn->hasArgumentEffects();
715715
for (unsigned attrIdx = 0; attrIdx < numAttrs; ++attrIdx) {
716716
llvm::Expected<llvm::BitstreamEntry> maybeNext =
@@ -777,7 +777,7 @@ SILDeserializer::readSILFunctionChecked(DeclID FID, SILFunction *existingFn,
777777

778778
auto specializedSig = MF->getGenericSignature(specializedSigID);
779779
// Only add the specialize attributes once.
780-
if (shouldAddSpecAtttrs) {
780+
if (shouldAddSpecAttrs) {
781781
// Read the substitution list and construct a SILSpecializeAttr.
782782
fn->addSpecializeAttr(SILSpecializeAttr::create(
783783
SILMod, specializedSig, exported != 0, specializationKind, target,

lib/Serialization/ModuleFormat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@ namespace decls_block {
11281128
BCFixed<1>, // throws?
11291129
DifferentiabilityKindField, // differentiability kind
11301130
TypeIDField, // global actor
1131-
GenericSignatureIDField // generic signture
1131+
GenericSignatureIDField // generic signature
11321132

11331133
// trailed by parameters
11341134
>;

lib/Serialization/Serialization.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ std::pair<StringRef, IdentifierID> Serializer::addUniquedString(StringRef str) {
723723
}
724724

725725
IdentifierID Serializer::addFilename(StringRef filename) {
726-
assert(!filename.empty() && "Attemping to add an empty filename");
726+
assert(!filename.empty() && "Attempting to add an empty filename");
727727

728728
return addUniquedString(filename).second;
729729
}
@@ -1090,7 +1090,7 @@ void Serializer::writeHeader(const SerializationOptions &options) {
10901090
}
10911091
} else if (arg.startswith("-fdebug-prefix-map=")) {
10921092
// We don't serialize the debug prefix map flags as these
1093-
// contain absoute paths that are not usable on different
1093+
// contain absolute paths that are not usable on different
10941094
// machines. These flags are not necessary to compile the
10951095
// clang modules again so are safe to remove.
10961096
continue;
@@ -2855,7 +2855,7 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
28552855
access <= swift::AccessLevel::FilePrivate &&
28562856
!value->getDeclContext()->isLocalContext();
28572857

2858-
// Emit the the filename for private mapping for private decls and
2858+
// Emit the filename for private mapping for private decls and
28592859
// decls with private accessors if compiled with -enable-private-imports.
28602860
bool shouldEmitFilenameForPrivate =
28612861
S.M->arePrivateImportsEnabled() &&
@@ -3150,7 +3150,7 @@ class Serializer::DeclSerializer : public DeclVisitor<DeclSerializer> {
31503150
abbrCode, witnessIDs);
31513151
}
31523152

3153-
/// Writes the body text of the provided funciton, if the function is
3153+
/// Writes the body text of the provided function, if the function is
31543154
/// inlinable and has body text.
31553155
void writeInlinableBodyTextIfNeeded(const AbstractFunctionDecl *AFD) {
31563156
using namespace decls_block;

lib/Serialization/Serialization.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ class Serializer : public SerializerBase {
251251

252252
using DeclMembersData = SmallVector<DeclID, 2>;
253253
// In-memory representation of what will eventually be an on-disk
254-
// hash table of all ValueDecl-members of a paticular DeclBaseName.
254+
// hash table of all ValueDecl-members of a particular DeclBaseName.
255255
using DeclMembersTable = llvm::MapVector<uint32_t, DeclMembersData>;
256256

257257
using DeclMemberNamesData = std::pair<serialization::BitOffset,
@@ -400,7 +400,7 @@ class Serializer : public SerializerBase {
400400
/// Top-level entry point for serializing a module.
401401
void writeAST(ModuleOrSourceFile DC);
402402

403-
/// Serializes the given dependnecy graph into the incremental information
403+
/// Serializes the given dependency graph into the incremental information
404404
/// section of this swift module.
405405
void writeIncrementalInfo(
406406
const fine_grained_dependencies::SourceFileDepGraph *DepGraph);

lib/Serialization/SerializedModuleLoader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ bool swift::extractCompilerFlagsFromInterface(StringRef interfacePath,
11071107
llvm::VersionTuple
11081108
swift::extractUserModuleVersionFromInterface(StringRef moduleInterfacePath) {
11091109
llvm::VersionTuple result;
1110-
// Read the inteface file and extract its compiler arguments line
1110+
// Read the interface file and extract its compiler arguments line
11111111
if (auto file = llvm::MemoryBuffer::getFile(moduleInterfacePath)) {
11121112
llvm::BumpPtrAllocator alloc;
11131113
llvm::StringSaver argSaver(alloc);

test/Serialization/Recovery/rename-across-versions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public func test(
2929

3030
// Test replacements that look like renames.
3131

32-
// Please only include one parameter per function, so that we test that that one
32+
// Please only include one parameter per function, so that we test that one
3333
// parameter is enough to get the function dropped from the recovery interface.
3434
public func testReplacementA(_: BeforeReplacedType) {}
3535

test/Serialization/group_info_diags.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: not %target-swift-frontend -emit-module %s -module-name HasArray -o %t -module-cache-path %t/mcp -group-info-path %t/nonexist.json -emit-module-doc &> %t/result.txt
2+
// RUN: not %target-swift-frontend -emit-module %s -module-name HasArray -o %t -module-cache-path %t/mcp -group-info-path %t/nonexistent.json -emit-module-doc &> %t/result.txt
33
// RUN: %FileCheck %s -check-prefix=MISSING < %t/result.txt
44
// RUN: not %target-swift-frontend -emit-module %s -module-name HasArray -o %t -module-cache-path %t/mcp -group-info-path %S/Inputs/corrupted_group_info.json -emit-module-doc &> %t/result.txt
55
// RUN: %FileCheck %s -check-prefix=CORRUPTED < %t/result.txt

test/Serialization/private_import.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
private func foo() {}
3333
}
3434

35-
public func unreleated() {}
35+
public func unrelated() {}
3636

3737
// This should not conflict with Other from private_import_other_2.swift.
3838
struct Other {}
@@ -51,10 +51,10 @@
5151
}
5252

5353
Base().foo()
54-
// This should not be ambigious.
54+
// This should not be ambiguous.
5555
Base().bar()
5656
// This should not conflict with the second declaration in
5757
// private_import_other_2.swift.
5858
Value().foo()
59-
unreleated()
59+
unrelated()
6060
#endif

0 commit comments

Comments
 (0)