Skip to content

Commit 55d9c83

Browse files
authored
Spelling apidigester (#42542)
* spelling: analyzer Signed-off-by: Josh Soref <[email protected]> * spelling: considered Signed-off-by: Josh Soref <[email protected]> * spelling: diagnostic Signed-off-by: Josh Soref <[email protected]> * spelling: inherited Signed-off-by: Josh Soref <[email protected]> * spelling: interface Signed-off-by: Josh Soref <[email protected]> * spelling: invoke Signed-off-by: Josh Soref <[email protected]> * spelling: populating Signed-off-by: Josh Soref <[email protected]> * spelling: referenced Signed-off-by: Josh Soref <[email protected]> * spelling: requirement Signed-off-by: Josh Soref <[email protected]> Co-authored-by: Josh Soref <[email protected]>
1 parent 4dde3d0 commit 55d9c83

File tree

7 files changed

+34
-34
lines changed

7 files changed

+34
-34
lines changed

include/swift/APIDigester/ModuleAnalyzerNodes.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- ModuleAnaluzerNodes.h - Nodes for API differ tool ---------------====//
1+
//===--- ModuleAnalyzerNodes.h - Nodes for API differ tool ---------------====//
22
//
33
// This source file is part of the Swift.org open source project
44
//
@@ -142,7 +142,7 @@ class UpdatedNodesMap {
142142
};
143143

144144
// Describing some attributes with ABI/API impact. The addition or removal of these
145-
// attributes is considerred breakage.
145+
// attributes is considered breakage.
146146
struct BreakingAttributeInfo {
147147
const DeclAttrKind Kind;
148148
const StringRef Content;
@@ -357,7 +357,7 @@ class SDKNodeDecl: public SDKNode {
357357
uint8_t ReferenceOwnership;
358358
StringRef GenericSig;
359359
// In ABI mode, this field is populated as a user-friendly version of GenericSig.
360-
// Dignostic preferes the sugared versions if they differ as well.
360+
// Diagnostic preferes the sugared versions if they differ as well.
361361
StringRef SugaredGenericSig;
362362
Optional<uint8_t> FixedBinaryOrder;
363363
PlatformIntroVersion introVersions;
@@ -571,7 +571,7 @@ class SDKNodeDeclType: public SDKNodeDecl {
571571

572572
Optional<SDKNodeDeclType*> getSuperclass() const;
573573

574-
/// Finding the node through all children, including the inheritted ones,
574+
/// Finding the node through all children, including the inherited ones,
575575
/// whose printed name matches with the given name.
576576
Optional<SDKNodeDecl*> lookupChildByPrintedName(StringRef Name) const;
577577
SDKNodeType *getRawValueType() const;
@@ -797,22 +797,22 @@ class SwiftDeclCollector: public VisibleDeclConsumer {
797797

798798
void detectRename(SDKNode *L, SDKNode *R);
799799

800-
int dumpSwiftModules(const CompilerInvocation &InitInvok,
800+
int dumpSwiftModules(const CompilerInvocation &InitInvoke,
801801
const llvm::StringSet<> &ModuleNames,
802802
StringRef OutputDir,
803803
const std::vector<std::string> PrintApis,
804804
CheckerOptions Opts);
805805

806806
SDKNodeRoot *getSDKNodeRoot(SDKContext &SDKCtx,
807-
const CompilerInvocation &InitInvok,
807+
const CompilerInvocation &InitInvoke,
808808
const llvm::StringSet<> &ModuleNames);
809809

810810
SDKNodeRoot *getEmptySDKNodeRoot(SDKContext &SDKCtx);
811811

812812
void dumpSDKRoot(SDKNodeRoot *Root, PayLoad load, StringRef OutputFile);
813813
void dumpSDKRoot(SDKNodeRoot *Root, StringRef OutputFile);
814814

815-
int dumpSDKContent(const CompilerInvocation &InitInvok,
815+
int dumpSDKContent(const CompilerInvocation &InitInvoke,
816816
const llvm::StringSet<> &ModuleNames,
817817
StringRef OutputFile, CheckerOptions Opts);
818818

lib/APIDigester/ModuleAnalyzerNodes.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ Optional<SDKNodeDeclType*> SDKNodeDeclType::getSuperclass() const {
539539
return None;
540540
}
541541

542-
/// Finding the node through all children, including the inheritted ones,
542+
/// Finding the node through all children, including the inherited ones,
543543
/// whose printed name matches with the given name.
544544
Optional<SDKNodeDecl*>
545545
SDKNodeDeclType::lookupChildByPrintedName(StringRef Name) const {
@@ -1343,7 +1343,7 @@ static std::vector<DeclAttrKind> collectDeclAttributes(Decl *D) {
13431343
if (VD->COND && !llvm::is_contained(Results, DeclAttrKind::KIND_NAME)) \
13441344
Results.emplace_back(DeclAttrKind::KIND_NAME);
13451345
// These attributes may be semantically applicable to the current decl but absent from
1346-
// the actual AST. Populting them to the nodes ensure we don't have false positives.
1346+
// the actual AST. Populating them to the nodes ensure we don't have false positives.
13471347
HANDLE(isObjC(), DAK_ObjC)
13481348
HANDLE(isFinal(), DAK_Final)
13491349
HANDLE(isDynamic(), DAK_Dynamic)
@@ -2262,14 +2262,14 @@ class ConstExtractor: public ASTWalker {
22622262
allConsts.emplace_back(file, kind, offset, length, Value, ReferencedD);
22632263
}
22642264

2265-
void record(Expr *E, Expr *ValueProvider, StringRef ReferecedD = "") {
2265+
void record(Expr *E, Expr *ValueProvider, StringRef ReferencedD = "") {
22662266
std::string content;
22672267
llvm::raw_string_ostream os(content);
22682268
ValueProvider->printConstExprValue(&os, nullptr);
22692269
assert(!content.empty());
22702270
auto buffered = SCtx.buffer(content);
22712271
switch(ValueProvider->getKind()) {
2272-
#define CASE(X) case ExprKind::X: record(E, ConstKind::X, buffered, ReferecedD); break;
2272+
#define CASE(X) case ExprKind::X: record(E, ConstKind::X, buffered, ReferencedD); break;
22732273
CASE(StringLiteral)
22742274
CASE(IntegerLiteral)
22752275
CASE(FloatLiteral)
@@ -2397,10 +2397,10 @@ swift::ide::api::getEmptySDKNodeRoot(SDKContext &SDKCtx) {
23972397

23982398
SDKNodeRoot*
23992399
swift::ide::api::getSDKNodeRoot(SDKContext &SDKCtx,
2400-
const CompilerInvocation &InitInvok,
2400+
const CompilerInvocation &InitInvoke,
24012401
const llvm::StringSet<> &ModuleNames) {
24022402
CheckerOptions Opts = SDKCtx.getOpts();
2403-
CompilerInvocation Invocation(InitInvok);
2403+
CompilerInvocation Invocation(InitInvoke);
24042404

24052405
CompilerInstance &CI = SDKCtx.newCompilerInstance();
24062406
// Display diagnostics to stderr.
@@ -2467,11 +2467,11 @@ void swift::ide::api::dumpSDKRoot(SDKNodeRoot *Root, StringRef OutputFile) {
24672467
dumpSDKRoot(Root, PayLoad(), OutputFile);
24682468
}
24692469

2470-
int swift::ide::api::dumpSDKContent(const CompilerInvocation &InitInvok,
2470+
int swift::ide::api::dumpSDKContent(const CompilerInvocation &InitInvoke,
24712471
const llvm::StringSet<> &ModuleNames,
24722472
StringRef OutputFile, CheckerOptions Opts) {
24732473
SDKContext SDKCtx(Opts);
2474-
SDKNodeRoot *Root = getSDKNodeRoot(SDKCtx, InitInvok, ModuleNames);
2474+
SDKNodeRoot *Root = getSDKNodeRoot(SDKCtx, InitInvoke, ModuleNames);
24752475
if (!Root)
24762476
return 1;
24772477
dumpSDKRoot(Root, OutputFile);

test/api-digester/Inputs/cake_baseline/cake.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ public class RemoveSetters {
9797
}
9898
}
9999

100-
public protocol RequiementChanges {
100+
public protocol RequirementChanges {
101101
func removedFunc()
102102
associatedtype removedType
103103
var removedVar: Int {get}
104104
}
105105

106106
/// This protocol shouldn't be complained because its requirements are all derived.
107-
public protocol DerivedProtocolRequiementChanges: RequiementChanges {}
107+
public protocol DerivedProtocolRequirementChanges: RequirementChanges {}
108108

109109
public class SuperClassRemoval: C3 {}
110110

test/api-digester/Inputs/cake_current/cake.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,15 @@ public class RemoveSetters {
107107
}
108108
}
109109

110-
public protocol RequiementChanges {
110+
public protocol RequirementChanges {
111111
associatedtype addedTypeWithDefault = Int
112112
associatedtype addedTypeWithoutDefault
113113
func addedFunc()
114114
var addedVar: Int { get }
115115
}
116116

117117
/// This protocol shouldn't be complained because its requirements are all derived.
118-
public protocol DerivedProtocolRequiementChanges: RequiementChanges {}
118+
public protocol DerivedProtocolRequirementChanges: RequirementChanges {}
119119

120120
public class SuperClassRemoval {}
121121

test/api-digester/Outputs/Cake-abi.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ cake: Accessor RemoveSetters.Value.Modify() has been removed
2222
cake: Accessor RemoveSetters.Value.Set() has been removed
2323
cake: Accessor RemoveSetters.subscript(_:).Modify() has been removed
2424
cake: Accessor RemoveSetters.subscript(_:).Set() has been removed
25-
cake: AssociatedType RequiementChanges.removedType has been removed
25+
cake: AssociatedType RequirementChanges.removedType has been removed
2626
cake: Class C3 has been removed
2727
cake: Constructor Somestruct2.init(_:) has been removed
2828
cake: Func C4.foo() has been removed
2929
cake: Func Int.IntEnhancer() has been removed
30-
cake: Func RequiementChanges.removedFunc() has been removed
31-
cake: Var RequiementChanges.removedVar has been removed
30+
cake: Func RequirementChanges.removedFunc() has been removed
31+
cake: Var RequirementChanges.removedVar has been removed
3232

3333
/* Moved Decls */
3434
cake: Class ClassToStruct has been changed to a Struct
@@ -77,7 +77,7 @@ cake: Func Float.floatHigher() is a new API without @available attribute
7777
cake: Func FutureKind.==(_:_:) is a new API without @available attribute
7878
cake: Func FutureKind.hash(into:) is a new API without @available attribute
7979
cake: Func HasMutatingMethodClone.foo() has self access kind changing from Mutating to NonMutating
80-
cake: Func RequiementChanges.addedFunc() is a new API without @available attribute
80+
cake: Func RequirementChanges.addedFunc() is a new API without @available attribute
8181
cake: Func S1.foo1() has self access kind changing from NonMutating to Mutating
8282
cake: Func S1.foo3() is now static
8383
cake: Func _NoResilientClass.NoLongerFinalFunc() is now without final
@@ -87,7 +87,7 @@ cake: Struct C6 is now with @frozen
8787
cake: Var C1.CIIns1 changes from weak to strong
8888
cake: Var C1.CIIns2 changes from strong to weak
8989
cake: Var FutureKind.hashValue is a new API without @available attribute
90-
cake: Var RequiementChanges.addedVar is a new API without @available attribute
90+
cake: Var RequirementChanges.addedVar is a new API without @available attribute
9191
cake: Var fixedLayoutStruct.$__lazy_storage_$_lazy_d is a new API without @available attribute
9292
cake: Var fixedLayoutStruct.c is a new API without @available attribute
9393

@@ -114,10 +114,10 @@ cake: Struct fixedLayoutStruct has removed conformance to P1
114114
/* Protocol Requirement Change */
115115
cake: Accessor HasMutatingMethodClone.bar.Get() now requires new witness table entry
116116
cake: AssociatedType AssociatedTypePro.T1 has removed default type Swift.Int
117-
cake: AssociatedType RequiementChanges.addedTypeWithoutDefault has been added as a protocol requirement
117+
cake: AssociatedType RequirementChanges.addedTypeWithoutDefault has been added as a protocol requirement
118118
cake: Func HasMutatingMethodClone.foo() now requires new witness table entry
119-
cake: Func RequiementChanges.addedFunc() has been added as a protocol requirement
120-
cake: Var RequiementChanges.addedVar has been added as a protocol requirement
119+
cake: Func RequirementChanges.addedFunc() has been added as a protocol requirement
120+
cake: Var RequirementChanges.addedVar has been added as a protocol requirement
121121

122122
/* Class Inheritance Change */
123123
cake: Class SubGenericClass has changed its super class from cake.GenericClass<cake.P1> to cake.GenericClass<cake.P2>

test/api-digester/Outputs/Cake.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ cake: Protocol P3 has generic signature change from <Self : cake.P1, Self : cake
99
cake: Accessor GlobalVarChangedToLet.Set() has been removed
1010
cake: Accessor RemoveSetters.Value.Set() has been removed
1111
cake: Accessor RemoveSetters.subscript(_:).Set() has been removed
12-
cake: AssociatedType RequiementChanges.removedType has been removed
12+
cake: AssociatedType RequirementChanges.removedType has been removed
1313
cake: Constructor Somestruct2.init(_:) has been removed
1414
cake: Func C4.foo() has been removed
1515
cake: Func Int.IntEnhancer() has been removed
16-
cake: Func RequiementChanges.removedFunc() has been removed
17-
cake: Var RequiementChanges.removedVar has been removed
16+
cake: Func RequirementChanges.removedFunc() has been removed
17+
cake: Var RequirementChanges.removedVar has been removed
1818

1919
/* Moved Decls */
2020
cake: Class ClassToStruct has been changed to a Struct
@@ -56,9 +56,9 @@ cake: Struct fixedLayoutStruct has removed conformance to P1
5656

5757
/* Protocol Requirement Change */
5858
cake: AssociatedType AssociatedTypePro.T1 has removed default type Swift.Int
59-
cake: AssociatedType RequiementChanges.addedTypeWithoutDefault has been added as a protocol requirement
60-
cake: Func RequiementChanges.addedFunc() has been added as a protocol requirement
61-
cake: Var RequiementChanges.addedVar has been added as a protocol requirement
59+
cake: AssociatedType RequirementChanges.addedTypeWithoutDefault has been added as a protocol requirement
60+
cake: Func RequirementChanges.addedFunc() has been added as a protocol requirement
61+
cake: Var RequirementChanges.addedVar has been added as a protocol requirement
6262
cake: Accessor ClassWithOpenMember.property.Get() is no longer open for subclassing
6363

6464
/* Class Inheritance Change */

test/api-digester/compare-dump-binary-vs-interface.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// Dump Json file for cake ABI via .swiftmodule file
2121
// RUN: %api-digester -dump-sdk -module cake -o - -module-cache-path %t.module-cache %clang-importer-sdk-nosource -I %t.mod1 -I %S/Inputs/APINotesLeft -abi > %t.dump1.json
2222

23-
// Dump Json file for cake ABI via .swiftinteface file
23+
// Dump Json file for cake ABI via .swiftinterface file
2424
// RUN: %api-digester -dump-sdk -module cake -o - -module-cache-path %t.module-cache %clang-importer-sdk-nosource -I %t.mod1 -I %S/Inputs/APINotesLeft -abi -use-interface-for-module cake > %t.dump2.json
2525

2626
// Compare two Json files and we should see some differences.

0 commit comments

Comments
 (0)