mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Spelling apidigester (#42542)
* spelling: analyzer Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: considered Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: diagnostic Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: inherited Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: interface Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: invoke Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: populating Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: referenced Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: requirement Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//===--- ModuleAnaluzerNodes.h - Nodes for API differ tool ---------------====//
|
||||
//===--- ModuleAnalyzerNodes.h - Nodes for API differ tool ---------------====//
|
||||
//
|
||||
// This source file is part of the Swift.org open source project
|
||||
//
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
};
|
||||
|
||||
// Describing some attributes with ABI/API impact. The addition or removal of these
|
||||
// attributes is considerred breakage.
|
||||
// attributes is considered breakage.
|
||||
struct BreakingAttributeInfo {
|
||||
const DeclAttrKind Kind;
|
||||
const StringRef Content;
|
||||
@@ -357,7 +357,7 @@ class SDKNodeDecl: public SDKNode {
|
||||
uint8_t ReferenceOwnership;
|
||||
StringRef GenericSig;
|
||||
// In ABI mode, this field is populated as a user-friendly version of GenericSig.
|
||||
// Dignostic preferes the sugared versions if they differ as well.
|
||||
// Diagnostic preferes the sugared versions if they differ as well.
|
||||
StringRef SugaredGenericSig;
|
||||
Optional<uint8_t> FixedBinaryOrder;
|
||||
PlatformIntroVersion introVersions;
|
||||
@@ -571,7 +571,7 @@ public:
|
||||
|
||||
Optional<SDKNodeDeclType*> getSuperclass() const;
|
||||
|
||||
/// Finding the node through all children, including the inheritted ones,
|
||||
/// Finding the node through all children, including the inherited ones,
|
||||
/// whose printed name matches with the given name.
|
||||
Optional<SDKNodeDecl*> lookupChildByPrintedName(StringRef Name) const;
|
||||
SDKNodeType *getRawValueType() const;
|
||||
@@ -797,14 +797,14 @@ public:
|
||||
|
||||
void detectRename(SDKNode *L, SDKNode *R);
|
||||
|
||||
int dumpSwiftModules(const CompilerInvocation &InitInvok,
|
||||
int dumpSwiftModules(const CompilerInvocation &InitInvoke,
|
||||
const llvm::StringSet<> &ModuleNames,
|
||||
StringRef OutputDir,
|
||||
const std::vector<std::string> PrintApis,
|
||||
CheckerOptions Opts);
|
||||
|
||||
SDKNodeRoot *getSDKNodeRoot(SDKContext &SDKCtx,
|
||||
const CompilerInvocation &InitInvok,
|
||||
const CompilerInvocation &InitInvoke,
|
||||
const llvm::StringSet<> &ModuleNames);
|
||||
|
||||
SDKNodeRoot *getEmptySDKNodeRoot(SDKContext &SDKCtx);
|
||||
@@ -812,7 +812,7 @@ SDKNodeRoot *getEmptySDKNodeRoot(SDKContext &SDKCtx);
|
||||
void dumpSDKRoot(SDKNodeRoot *Root, PayLoad load, StringRef OutputFile);
|
||||
void dumpSDKRoot(SDKNodeRoot *Root, StringRef OutputFile);
|
||||
|
||||
int dumpSDKContent(const CompilerInvocation &InitInvok,
|
||||
int dumpSDKContent(const CompilerInvocation &InitInvoke,
|
||||
const llvm::StringSet<> &ModuleNames,
|
||||
StringRef OutputFile, CheckerOptions Opts);
|
||||
|
||||
|
||||
@@ -539,7 +539,7 @@ Optional<SDKNodeDeclType*> SDKNodeDeclType::getSuperclass() const {
|
||||
return None;
|
||||
}
|
||||
|
||||
/// Finding the node through all children, including the inheritted ones,
|
||||
/// Finding the node through all children, including the inherited ones,
|
||||
/// whose printed name matches with the given name.
|
||||
Optional<SDKNodeDecl*>
|
||||
SDKNodeDeclType::lookupChildByPrintedName(StringRef Name) const {
|
||||
@@ -1343,7 +1343,7 @@ static std::vector<DeclAttrKind> collectDeclAttributes(Decl *D) {
|
||||
if (VD->COND && !llvm::is_contained(Results, DeclAttrKind::KIND_NAME)) \
|
||||
Results.emplace_back(DeclAttrKind::KIND_NAME);
|
||||
// These attributes may be semantically applicable to the current decl but absent from
|
||||
// the actual AST. Populting them to the nodes ensure we don't have false positives.
|
||||
// the actual AST. Populating them to the nodes ensure we don't have false positives.
|
||||
HANDLE(isObjC(), DAK_ObjC)
|
||||
HANDLE(isFinal(), DAK_Final)
|
||||
HANDLE(isDynamic(), DAK_Dynamic)
|
||||
@@ -2262,14 +2262,14 @@ class ConstExtractor: public ASTWalker {
|
||||
allConsts.emplace_back(file, kind, offset, length, Value, ReferencedD);
|
||||
}
|
||||
|
||||
void record(Expr *E, Expr *ValueProvider, StringRef ReferecedD = "") {
|
||||
void record(Expr *E, Expr *ValueProvider, StringRef ReferencedD = "") {
|
||||
std::string content;
|
||||
llvm::raw_string_ostream os(content);
|
||||
ValueProvider->printConstExprValue(&os, nullptr);
|
||||
assert(!content.empty());
|
||||
auto buffered = SCtx.buffer(content);
|
||||
switch(ValueProvider->getKind()) {
|
||||
#define CASE(X) case ExprKind::X: record(E, ConstKind::X, buffered, ReferecedD); break;
|
||||
#define CASE(X) case ExprKind::X: record(E, ConstKind::X, buffered, ReferencedD); break;
|
||||
CASE(StringLiteral)
|
||||
CASE(IntegerLiteral)
|
||||
CASE(FloatLiteral)
|
||||
@@ -2397,10 +2397,10 @@ swift::ide::api::getEmptySDKNodeRoot(SDKContext &SDKCtx) {
|
||||
|
||||
SDKNodeRoot*
|
||||
swift::ide::api::getSDKNodeRoot(SDKContext &SDKCtx,
|
||||
const CompilerInvocation &InitInvok,
|
||||
const CompilerInvocation &InitInvoke,
|
||||
const llvm::StringSet<> &ModuleNames) {
|
||||
CheckerOptions Opts = SDKCtx.getOpts();
|
||||
CompilerInvocation Invocation(InitInvok);
|
||||
CompilerInvocation Invocation(InitInvoke);
|
||||
|
||||
CompilerInstance &CI = SDKCtx.newCompilerInstance();
|
||||
// Display diagnostics to stderr.
|
||||
@@ -2467,11 +2467,11 @@ void swift::ide::api::dumpSDKRoot(SDKNodeRoot *Root, StringRef OutputFile) {
|
||||
dumpSDKRoot(Root, PayLoad(), OutputFile);
|
||||
}
|
||||
|
||||
int swift::ide::api::dumpSDKContent(const CompilerInvocation &InitInvok,
|
||||
int swift::ide::api::dumpSDKContent(const CompilerInvocation &InitInvoke,
|
||||
const llvm::StringSet<> &ModuleNames,
|
||||
StringRef OutputFile, CheckerOptions Opts) {
|
||||
SDKContext SDKCtx(Opts);
|
||||
SDKNodeRoot *Root = getSDKNodeRoot(SDKCtx, InitInvok, ModuleNames);
|
||||
SDKNodeRoot *Root = getSDKNodeRoot(SDKCtx, InitInvoke, ModuleNames);
|
||||
if (!Root)
|
||||
return 1;
|
||||
dumpSDKRoot(Root, OutputFile);
|
||||
|
||||
@@ -97,14 +97,14 @@ public class RemoveSetters {
|
||||
}
|
||||
}
|
||||
|
||||
public protocol RequiementChanges {
|
||||
public protocol RequirementChanges {
|
||||
func removedFunc()
|
||||
associatedtype removedType
|
||||
var removedVar: Int {get}
|
||||
}
|
||||
|
||||
/// This protocol shouldn't be complained because its requirements are all derived.
|
||||
public protocol DerivedProtocolRequiementChanges: RequiementChanges {}
|
||||
public protocol DerivedProtocolRequirementChanges: RequirementChanges {}
|
||||
|
||||
public class SuperClassRemoval: C3 {}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ public class RemoveSetters {
|
||||
}
|
||||
}
|
||||
|
||||
public protocol RequiementChanges {
|
||||
public protocol RequirementChanges {
|
||||
associatedtype addedTypeWithDefault = Int
|
||||
associatedtype addedTypeWithoutDefault
|
||||
func addedFunc()
|
||||
@@ -115,7 +115,7 @@ public protocol RequiementChanges {
|
||||
}
|
||||
|
||||
/// This protocol shouldn't be complained because its requirements are all derived.
|
||||
public protocol DerivedProtocolRequiementChanges: RequiementChanges {}
|
||||
public protocol DerivedProtocolRequirementChanges: RequirementChanges {}
|
||||
|
||||
public class SuperClassRemoval {}
|
||||
|
||||
|
||||
@@ -22,13 +22,13 @@ cake: Accessor RemoveSetters.Value.Modify() has been removed
|
||||
cake: Accessor RemoveSetters.Value.Set() has been removed
|
||||
cake: Accessor RemoveSetters.subscript(_:).Modify() has been removed
|
||||
cake: Accessor RemoveSetters.subscript(_:).Set() has been removed
|
||||
cake: AssociatedType RequiementChanges.removedType has been removed
|
||||
cake: AssociatedType RequirementChanges.removedType has been removed
|
||||
cake: Class C3 has been removed
|
||||
cake: Constructor Somestruct2.init(_:) has been removed
|
||||
cake: Func C4.foo() has been removed
|
||||
cake: Func Int.IntEnhancer() has been removed
|
||||
cake: Func RequiementChanges.removedFunc() has been removed
|
||||
cake: Var RequiementChanges.removedVar has been removed
|
||||
cake: Func RequirementChanges.removedFunc() has been removed
|
||||
cake: Var RequirementChanges.removedVar has been removed
|
||||
|
||||
/* Moved Decls */
|
||||
cake: Class ClassToStruct has been changed to a Struct
|
||||
@@ -77,7 +77,7 @@ cake: Func Float.floatHigher() is a new API without @available attribute
|
||||
cake: Func FutureKind.==(_:_:) is a new API without @available attribute
|
||||
cake: Func FutureKind.hash(into:) is a new API without @available attribute
|
||||
cake: Func HasMutatingMethodClone.foo() has self access kind changing from Mutating to NonMutating
|
||||
cake: Func RequiementChanges.addedFunc() is a new API without @available attribute
|
||||
cake: Func RequirementChanges.addedFunc() is a new API without @available attribute
|
||||
cake: Func S1.foo1() has self access kind changing from NonMutating to Mutating
|
||||
cake: Func S1.foo3() is now static
|
||||
cake: Func _NoResilientClass.NoLongerFinalFunc() is now without final
|
||||
@@ -87,7 +87,7 @@ cake: Struct C6 is now with @frozen
|
||||
cake: Var C1.CIIns1 changes from weak to strong
|
||||
cake: Var C1.CIIns2 changes from strong to weak
|
||||
cake: Var FutureKind.hashValue is a new API without @available attribute
|
||||
cake: Var RequiementChanges.addedVar is a new API without @available attribute
|
||||
cake: Var RequirementChanges.addedVar is a new API without @available attribute
|
||||
cake: Var fixedLayoutStruct.$__lazy_storage_$_lazy_d is a new API without @available attribute
|
||||
cake: Var fixedLayoutStruct.c is a new API without @available attribute
|
||||
|
||||
@@ -114,10 +114,10 @@ cake: Struct fixedLayoutStruct has removed conformance to P1
|
||||
/* Protocol Requirement Change */
|
||||
cake: Accessor HasMutatingMethodClone.bar.Get() now requires new witness table entry
|
||||
cake: AssociatedType AssociatedTypePro.T1 has removed default type Swift.Int
|
||||
cake: AssociatedType RequiementChanges.addedTypeWithoutDefault has been added as a protocol requirement
|
||||
cake: AssociatedType RequirementChanges.addedTypeWithoutDefault has been added as a protocol requirement
|
||||
cake: Func HasMutatingMethodClone.foo() now requires new witness table entry
|
||||
cake: Func RequiementChanges.addedFunc() has been added as a protocol requirement
|
||||
cake: Var RequiementChanges.addedVar has been added as a protocol requirement
|
||||
cake: Func RequirementChanges.addedFunc() has been added as a protocol requirement
|
||||
cake: Var RequirementChanges.addedVar has been added as a protocol requirement
|
||||
|
||||
/* Class Inheritance Change */
|
||||
cake: Class SubGenericClass has changed its super class from cake.GenericClass<cake.P1> to cake.GenericClass<cake.P2>
|
||||
|
||||
@@ -9,12 +9,12 @@ cake: Protocol P3 has generic signature change from <Self : cake.P1, Self : cake
|
||||
cake: Accessor GlobalVarChangedToLet.Set() has been removed
|
||||
cake: Accessor RemoveSetters.Value.Set() has been removed
|
||||
cake: Accessor RemoveSetters.subscript(_:).Set() has been removed
|
||||
cake: AssociatedType RequiementChanges.removedType has been removed
|
||||
cake: AssociatedType RequirementChanges.removedType has been removed
|
||||
cake: Constructor Somestruct2.init(_:) has been removed
|
||||
cake: Func C4.foo() has been removed
|
||||
cake: Func Int.IntEnhancer() has been removed
|
||||
cake: Func RequiementChanges.removedFunc() has been removed
|
||||
cake: Var RequiementChanges.removedVar has been removed
|
||||
cake: Func RequirementChanges.removedFunc() has been removed
|
||||
cake: Var RequirementChanges.removedVar has been removed
|
||||
|
||||
/* Moved Decls */
|
||||
cake: Class ClassToStruct has been changed to a Struct
|
||||
@@ -56,9 +56,9 @@ cake: Struct fixedLayoutStruct has removed conformance to P1
|
||||
|
||||
/* Protocol Requirement Change */
|
||||
cake: AssociatedType AssociatedTypePro.T1 has removed default type Swift.Int
|
||||
cake: AssociatedType RequiementChanges.addedTypeWithoutDefault has been added as a protocol requirement
|
||||
cake: Func RequiementChanges.addedFunc() has been added as a protocol requirement
|
||||
cake: Var RequiementChanges.addedVar has been added as a protocol requirement
|
||||
cake: AssociatedType RequirementChanges.addedTypeWithoutDefault has been added as a protocol requirement
|
||||
cake: Func RequirementChanges.addedFunc() has been added as a protocol requirement
|
||||
cake: Var RequirementChanges.addedVar has been added as a protocol requirement
|
||||
cake: Accessor ClassWithOpenMember.property.Get() is no longer open for subclassing
|
||||
|
||||
/* Class Inheritance Change */
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
// Dump Json file for cake ABI via .swiftmodule file
|
||||
// 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
|
||||
|
||||
// Dump Json file for cake ABI via .swiftinteface file
|
||||
// Dump Json file for cake ABI via .swiftinterface file
|
||||
// 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
|
||||
|
||||
// Compare two Json files and we should see some differences.
|
||||
|
||||
Reference in New Issue
Block a user