@@ -436,7 +436,7 @@ class SameNameNodeMatcher : public NodeMatcher {
436
436
};
437
437
438
438
// Get the priority for the favored name match kind. Favored name match kind
439
- // locats before less favored ones.
439
+ // locals before less favored ones.
440
440
ArrayRef<NameMatchKind> getNameMatchKindPriority (SDKNodeKind Kind) {
441
441
if (Kind == SDKNodeKind::DeclFunction) {
442
442
static NameMatchKind FuncPriority[] = { NameMatchKind::PrintedNameAndUSR,
@@ -1129,13 +1129,13 @@ class InterfaceTypeChangeDetector {
1129
1129
bool HasOptional = L->getTypeKind () == KnownTypeKind::Optional &&
1130
1130
R->getTypeKind () == KnownTypeKind::Optional;
1131
1131
if (HasOptional) {
1132
- // Detect [String: Any]? to [StringRepresentableStruct: Any]? Chnage
1132
+ // Detect [String: Any]? to [StringRepresentableStruct: Any]? Change
1133
1133
KeyChangedTo =
1134
1134
detectDictionaryKeyChangeInternal (L->getOnlyChild ()->getAs <SDKNodeType>(),
1135
1135
R->getOnlyChild ()->getAs <SDKNodeType>(),
1136
1136
Raw);
1137
1137
} else {
1138
- // Detect [String: Any] to [StringRepresentableStruct: Any] Chnage
1138
+ // Detect [String: Any] to [StringRepresentableStruct: Any] Change
1139
1139
KeyChangedTo = detectDictionaryKeyChangeInternal (L, R, Raw);
1140
1140
}
1141
1141
if (!KeyChangedTo.empty ()) {
@@ -1180,13 +1180,13 @@ class InterfaceTypeChangeDetector {
1180
1180
bool HasOptional = L->getTypeKind () == KnownTypeKind::Optional &&
1181
1181
R->getTypeKind () == KnownTypeKind::Optional;
1182
1182
if (HasOptional) {
1183
- // Detect [String]? to [StringRepresentableStruct]? Chnage
1183
+ // Detect [String]? to [StringRepresentableStruct]? Change
1184
1184
KeyChangedTo =
1185
1185
detectArrayMemberChangeInternal (L->getOnlyChild ()->getAs <SDKNodeType>(),
1186
1186
R->getOnlyChild ()->getAs <SDKNodeType>(),
1187
1187
Raw);
1188
1188
} else {
1189
- // Detect [String] to [StringRepresentableStruct] Chnage
1189
+ // Detect [String] to [StringRepresentableStruct] Change
1190
1190
KeyChangedTo = detectArrayMemberChangeInternal (L, R, Raw);
1191
1191
}
1192
1192
if (!KeyChangedTo.empty ()) {
@@ -1618,7 +1618,7 @@ void DiagnosisEmitter::handle(const SDKNodeDecl *Node, NodeAnnotation Anno) {
1618
1618
}
1619
1619
}
1620
1620
1621
- // If we can find a hoisted member for this removed delcaration , we
1621
+ // If we can find a hoisted member for this removed declaration , we
1622
1622
// emit the diagnostics as rename instead of removal.
1623
1623
auto It = std::find_if (MemberChanges.begin (), MemberChanges.end (),
1624
1624
[&](TypeMemberDiffItem &Item) { return Item.usr == Node->getUsr (); });
@@ -1642,7 +1642,7 @@ void DiagnosisEmitter::handle(const SDKNodeDecl *Node, NodeAnnotation Anno) {
1642
1642
return ;
1643
1643
}
1644
1644
1645
- // We should exlude those declarations that are pulled up to the super classes.
1645
+ // We should exclude those declarations that are pulled up to the super classes.
1646
1646
bool FoundInSuperclass = false ;
1647
1647
if (auto PD = dyn_cast<SDKNodeDecl>(Node->getParent ())) {
1648
1648
if (PD->isAnnotatedAs (NodeAnnotation::Updated)) {
@@ -1847,10 +1847,10 @@ static bool readBreakageAllowlist(SDKContext &Ctx, llvm::StringSet<> &lines,
1847
1847
if (BreakageAllowlistPath.empty ())
1848
1848
return 0 ;
1849
1849
CompilerInstance instance;
1850
- CompilerInvocation invok ;
1851
- invok .setModuleName (" ForClangImporter" );
1850
+ CompilerInvocation invoke ;
1851
+ invoke .setModuleName (" ForClangImporter" );
1852
1852
std::string InstanceSetupError;
1853
- if (instance.setup (invok , InstanceSetupError)) {
1853
+ if (instance.setup (invoke , InstanceSetupError)) {
1854
1854
return 1 ;
1855
1855
}
1856
1856
auto importer = ClangImporter::create (instance.getASTContext ());
@@ -2055,19 +2055,19 @@ static int generateMigrationScript(StringRef LeftPath, StringRef RightPath,
2055
2055
return 0 ;
2056
2056
}
2057
2057
2058
- static void setSDKPath (CompilerInvocation &InitInvok , bool IsBaseline,
2058
+ static void setSDKPath (CompilerInvocation &InitInvoke , bool IsBaseline,
2059
2059
StringRef SDK, StringRef BaselineSDK) {
2060
2060
if (IsBaseline) {
2061
2061
// Set baseline SDK
2062
2062
if (!BaselineSDK.empty ()) {
2063
- InitInvok .setSDKPath (BaselineSDK.str ());
2063
+ InitInvoke .setSDKPath (BaselineSDK.str ());
2064
2064
}
2065
2065
} else {
2066
2066
// Set current SDK
2067
2067
if (!SDK.empty ()) {
2068
- InitInvok .setSDKPath (SDK.str ());
2068
+ InitInvoke .setSDKPath (SDK.str ());
2069
2069
} else if (const char *SDKROOT = getenv (" SDKROOT" )) {
2070
- InitInvok .setSDKPath (SDKROOT);
2070
+ InitInvoke .setSDKPath (SDKROOT);
2071
2071
}
2072
2072
}
2073
2073
}
@@ -2185,7 +2185,7 @@ class SwiftAPIDigesterInvocation {
2185
2185
private:
2186
2186
std::string MainExecutablePath;
2187
2187
std::unique_ptr<llvm::opt::OptTable> Table;
2188
- CompilerInvocation InitInvok ;
2188
+ CompilerInvocation InitInvoke ;
2189
2189
ActionType Action = ActionType::None;
2190
2190
CheckerOptions CheckerOpts;
2191
2191
llvm::StringSet<> IgnoredUsrs;
@@ -2379,29 +2379,29 @@ class SwiftAPIDigesterInvocation {
2379
2379
return ComparisonInputMode::BaselineJson;
2380
2380
}
2381
2381
2382
- int prepareForDump (CompilerInvocation &InitInvok , llvm::StringSet<> &Modules,
2382
+ int prepareForDump (CompilerInvocation &InitInvoke , llvm::StringSet<> &Modules,
2383
2383
bool IsBaseline = false ) {
2384
- InitInvok .setMainExecutablePath (MainExecutablePath);
2385
- InitInvok .setModuleName (" swift_ide_test" );
2386
- setSDKPath (InitInvok , IsBaseline, SDK, BaselineSDK);
2384
+ InitInvoke .setMainExecutablePath (MainExecutablePath);
2385
+ InitInvoke .setModuleName (" swift_ide_test" );
2386
+ setSDKPath (InitInvoke , IsBaseline, SDK, BaselineSDK);
2387
2387
2388
2388
if (!Triple.empty ())
2389
- InitInvok .setTargetTriple (Triple);
2389
+ InitInvoke .setTargetTriple (Triple);
2390
2390
2391
2391
// Ensure the tool works on linux properly
2392
- InitInvok .getLangOptions ().EnableObjCInterop =
2393
- InitInvok .getLangOptions ().Target .isOSDarwin ();
2394
- InitInvok .getClangImporterOptions ().ModuleCachePath = ModuleCachePath;
2392
+ InitInvoke .getLangOptions ().EnableObjCInterop =
2393
+ InitInvoke .getLangOptions ().Target .isOSDarwin ();
2394
+ InitInvoke .getClangImporterOptions ().ModuleCachePath = ModuleCachePath;
2395
2395
// Module recovery issue shouldn't bring down the tool.
2396
- InitInvok .getLangOptions ().AllowDeserializingImplementationOnly = true ;
2396
+ InitInvoke .getLangOptions ().AllowDeserializingImplementationOnly = true ;
2397
2397
2398
2398
if (!SwiftVersion.empty ()) {
2399
2399
using version::Version;
2400
2400
bool isValid = false ;
2401
2401
if (auto Version =
2402
2402
Version::parseVersionString (SwiftVersion, SourceLoc (), nullptr )) {
2403
2403
if (auto Effective = Version.getValue ().getEffectiveLanguageVersion ()) {
2404
- InitInvok .getLangOptions ().EffectiveLanguageVersion = *Effective;
2404
+ InitInvoke .getLangOptions ().EffectiveLanguageVersion = *Effective;
2405
2405
isValid = true ;
2406
2406
}
2407
2407
}
@@ -2412,7 +2412,7 @@ class SwiftAPIDigesterInvocation {
2412
2412
}
2413
2413
2414
2414
if (!ResourceDir.empty ()) {
2415
- InitInvok .setRuntimeResourcePath (ResourceDir);
2415
+ InitInvoke .setRuntimeResourcePath (ResourceDir);
2416
2416
}
2417
2417
std::vector<SearchPathOptions::FrameworkSearchPath> FramePaths;
2418
2418
for (const auto &path : CCSystemFrameworkPaths) {
@@ -2422,14 +2422,14 @@ class SwiftAPIDigesterInvocation {
2422
2422
for (const auto &path : BaselineFrameworkPaths) {
2423
2423
FramePaths.push_back ({path, /* isSystem=*/ false });
2424
2424
}
2425
- InitInvok .setImportSearchPaths (BaselineModuleInputPaths);
2425
+ InitInvoke .setImportSearchPaths (BaselineModuleInputPaths);
2426
2426
} else {
2427
2427
for (const auto &path : FrameworkPaths) {
2428
2428
FramePaths.push_back ({path, /* isSystem=*/ false });
2429
2429
}
2430
- InitInvok .setImportSearchPaths (ModuleInputPaths);
2430
+ InitInvoke .setImportSearchPaths (ModuleInputPaths);
2431
2431
}
2432
- InitInvok .setFrameworkSearchPaths (FramePaths);
2432
+ InitInvoke .setFrameworkSearchPaths (FramePaths);
2433
2433
if (!ModuleList.empty ()) {
2434
2434
if (readFileLineByLine (ModuleList, Modules))
2435
2435
exit (1 );
@@ -2438,7 +2438,7 @@ class SwiftAPIDigesterInvocation {
2438
2438
Modules.insert (M);
2439
2439
}
2440
2440
for (auto M : PreferInterfaceForModules) {
2441
- InitInvok .getFrontendOptions ().PreferInterfaceForModules .push_back (M);
2441
+ InitInvoke .getFrontendOptions ().PreferInterfaceForModules .push_back (M);
2442
2442
}
2443
2443
if (Modules.empty ()) {
2444
2444
llvm::errs () << " Need to specify -include-all or -module <name>\n " ;
@@ -2448,19 +2448,19 @@ class SwiftAPIDigesterInvocation {
2448
2448
}
2449
2449
2450
2450
SDKNodeRoot *getSDKRoot (SDKContext &Ctx, bool IsBaseline) {
2451
- CompilerInvocation Invok ;
2451
+ CompilerInvocation Invoke ;
2452
2452
llvm::StringSet<> Modules;
2453
- if (prepareForDump (Invok , Modules, IsBaseline))
2453
+ if (prepareForDump (Invoke , Modules, IsBaseline))
2454
2454
return nullptr ;
2455
- return getSDKNodeRoot (Ctx, Invok , Modules);
2455
+ return getSDKNodeRoot (Ctx, Invoke , Modules);
2456
2456
}
2457
2457
2458
2458
SDKNodeRoot *getBaselineFromJson (SDKContext &Ctx) {
2459
2459
SwiftDeclCollector Collector (Ctx);
2460
- CompilerInvocation Invok ;
2460
+ CompilerInvocation Invoke ;
2461
2461
llvm::StringSet<> Modules;
2462
2462
// We need to call prepareForDump to parse target triple.
2463
- if (prepareForDump (Invok , Modules, true ))
2463
+ if (prepareForDump (Invoke , Modules, true ))
2464
2464
return nullptr ;
2465
2465
2466
2466
assert (Modules.size () == 1 &&
@@ -2470,14 +2470,14 @@ class SwiftAPIDigesterInvocation {
2470
2470
if (!BaselineFilePath.empty ()) {
2471
2471
Path = BaselineFilePath;
2472
2472
} else if (!BaselineDirPath.empty ()) {
2473
- Path = getCustomBaselinePath (Invok .getLangOptions ().Target ,
2473
+ Path = getCustomBaselinePath (Invoke .getLangOptions ().Target ,
2474
2474
Ctx.checkingABI (), BaselineDirPath);
2475
2475
} else if (UseEmptyBaseline) {
2476
2476
Path = getEmptyBaselinePath (MainExecutablePath);
2477
2477
} else {
2478
2478
Path = getDefaultBaselinePath (
2479
2479
MainExecutablePath, Modules.begin ()->getKey (),
2480
- Invok .getLangOptions ().Target , Ctx.checkingABI ());
2480
+ Invoke .getLangOptions ().Target , Ctx.checkingABI ());
2481
2481
}
2482
2482
if (!fs::exists (Path)) {
2483
2483
llvm::errs () << " Baseline at " << Path << " does not exist\n " ;
@@ -2494,11 +2494,11 @@ class SwiftAPIDigesterInvocation {
2494
2494
switch (Action) {
2495
2495
case ActionType::DumpSDK: {
2496
2496
llvm::StringSet<> Modules;
2497
- return (prepareForDump (InitInvok , Modules))
2497
+ return (prepareForDump (InitInvoke , Modules))
2498
2498
? 1
2499
- : dumpSDKContent (InitInvok , Modules,
2499
+ : dumpSDKContent (InitInvoke , Modules,
2500
2500
getJsonOutputFilePath (
2501
- InitInvok .getLangOptions ().Target ,
2501
+ InitInvoke .getLangOptions ().Target ,
2502
2502
CheckerOpts.ABI , OutputFile, OutputDir),
2503
2503
CheckerOpts);
2504
2504
}
0 commit comments