Skip to content

Spelling serialization #42515

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 17 commits into from
Apr 25, 2022
4 changes: 2 additions & 2 deletions include/swift/Serialization/SerializedModuleLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace file_types {
enum ID : uint8_t;
}

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

/// Creates a \c SerializedModuleBaseName.
Expand Down
2 changes: 1 addition & 1 deletion lib/Serialization/Deserialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4184,7 +4184,7 @@ class DeclDeserializer {

argNameAndDependencyIDs = argNameAndDependencyIDs.slice(numArgNames);

// Exctract the accessor IDs.
// Extract the accessor IDs.
for (DeclID accessorID : argNameAndDependencyIDs.slice(0, numAccessors)) {
accessors.IDs.push_back(accessorID);
}
Expand Down
8 changes: 4 additions & 4 deletions lib/Serialization/DeserializeSIL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ SILDeserializer::readSILFunctionChecked(DeclID FID, SILFunction *existingFn,
fn->setSerialized(IsSerialized_t(isSerialized));

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

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

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

auto specializedSig = MF->getGenericSignature(specializedSigID);
// Only add the specialize attributes once.
if (shouldAddSpecAtttrs) {
if (shouldAddSpecAttrs) {
// Read the substitution list and construct a SILSpecializeAttr.
fn->addSpecializeAttr(SILSpecializeAttr::create(
SILMod, specializedSig, exported != 0, specializationKind, target,
Expand Down
2 changes: 1 addition & 1 deletion lib/Serialization/ModuleFormat.h
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ namespace decls_block {
BCFixed<1>, // throws?
DifferentiabilityKindField, // differentiability kind
TypeIDField, // global actor
GenericSignatureIDField // generic signture
GenericSignatureIDField // generic signature

// trailed by parameters
>;
Expand Down
8 changes: 4 additions & 4 deletions lib/Serialization/Serialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ std::pair<StringRef, IdentifierID> Serializer::addUniquedString(StringRef str) {
}

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

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

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

/// Writes the body text of the provided funciton, if the function is
/// Writes the body text of the provided function, if the function is
/// inlinable and has body text.
void writeInlinableBodyTextIfNeeded(const AbstractFunctionDecl *AFD) {
using namespace decls_block;
Expand Down
4 changes: 2 additions & 2 deletions lib/Serialization/Serialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class Serializer : public SerializerBase {

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

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

/// Serializes the given dependnecy graph into the incremental information
/// Serializes the given dependency graph into the incremental information
/// section of this swift module.
void writeIncrementalInfo(
const fine_grained_dependencies::SourceFileDepGraph *DepGraph);
Expand Down
2 changes: 1 addition & 1 deletion lib/Serialization/SerializedModuleLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ bool swift::extractCompilerFlagsFromInterface(StringRef interfacePath,
llvm::VersionTuple
swift::extractUserModuleVersionFromInterface(StringRef moduleInterfacePath) {
llvm::VersionTuple result;
// Read the inteface file and extract its compiler arguments line
// Read the interface file and extract its compiler arguments line
if (auto file = llvm::MemoryBuffer::getFile(moduleInterfacePath)) {
llvm::BumpPtrAllocator alloc;
llvm::StringSaver argSaver(alloc);
Expand Down
2 changes: 1 addition & 1 deletion test/Serialization/Recovery/rename-across-versions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public func test(

// Test replacements that look like renames.

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

Expand Down
2 changes: 1 addition & 1 deletion test/Serialization/group_info_diags.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %empty-directory(%t)
// 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
// 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
// RUN: %FileCheck %s -check-prefix=MISSING < %t/result.txt
// 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
// RUN: %FileCheck %s -check-prefix=CORRUPTED < %t/result.txt
Expand Down
6 changes: 3 additions & 3 deletions test/Serialization/private_import.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
private func foo() {}
}

public func unreleated() {}
public func unrelated() {}

// This should not conflict with Other from private_import_other_2.swift.
struct Other {}
Expand All @@ -51,10 +51,10 @@
}

Base().foo()
// This should not be ambigious.
// This should not be ambiguous.
Base().bar()
// This should not conflict with the second declaration in
// private_import_other_2.swift.
Value().foo()
unreleated()
unrelated()
#endif