@@ -436,7 +436,7 @@ class SameNameNodeMatcher : public NodeMatcher {
436436 };
437437
438438 // 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.
440440 ArrayRef<NameMatchKind> getNameMatchKindPriority (SDKNodeKind Kind) {
441441 if (Kind == SDKNodeKind::DeclFunction) {
442442 static NameMatchKind FuncPriority[] = { NameMatchKind::PrintedNameAndUSR,
@@ -1129,13 +1129,13 @@ class InterfaceTypeChangeDetector {
11291129 bool HasOptional = L->getTypeKind () == KnownTypeKind::Optional &&
11301130 R->getTypeKind () == KnownTypeKind::Optional;
11311131 if (HasOptional) {
1132- // Detect [String: Any]? to [StringRepresentableStruct: Any]? Chnage
1132+ // Detect [String: Any]? to [StringRepresentableStruct: Any]? Change
11331133 KeyChangedTo =
11341134 detectDictionaryKeyChangeInternal (L->getOnlyChild ()->getAs <SDKNodeType>(),
11351135 R->getOnlyChild ()->getAs <SDKNodeType>(),
11361136 Raw);
11371137 } else {
1138- // Detect [String: Any] to [StringRepresentableStruct: Any] Chnage
1138+ // Detect [String: Any] to [StringRepresentableStruct: Any] Change
11391139 KeyChangedTo = detectDictionaryKeyChangeInternal (L, R, Raw);
11401140 }
11411141 if (!KeyChangedTo.empty ()) {
@@ -1180,13 +1180,13 @@ class InterfaceTypeChangeDetector {
11801180 bool HasOptional = L->getTypeKind () == KnownTypeKind::Optional &&
11811181 R->getTypeKind () == KnownTypeKind::Optional;
11821182 if (HasOptional) {
1183- // Detect [String]? to [StringRepresentableStruct]? Chnage
1183+ // Detect [String]? to [StringRepresentableStruct]? Change
11841184 KeyChangedTo =
11851185 detectArrayMemberChangeInternal (L->getOnlyChild ()->getAs <SDKNodeType>(),
11861186 R->getOnlyChild ()->getAs <SDKNodeType>(),
11871187 Raw);
11881188 } else {
1189- // Detect [String] to [StringRepresentableStruct] Chnage
1189+ // Detect [String] to [StringRepresentableStruct] Change
11901190 KeyChangedTo = detectArrayMemberChangeInternal (L, R, Raw);
11911191 }
11921192 if (!KeyChangedTo.empty ()) {
@@ -1618,7 +1618,7 @@ void DiagnosisEmitter::handle(const SDKNodeDecl *Node, NodeAnnotation Anno) {
16181618 }
16191619 }
16201620
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
16221622 // emit the diagnostics as rename instead of removal.
16231623 auto It = std::find_if (MemberChanges.begin (), MemberChanges.end (),
16241624 [&](TypeMemberDiffItem &Item) { return Item.usr == Node->getUsr (); });
@@ -1642,7 +1642,7 @@ void DiagnosisEmitter::handle(const SDKNodeDecl *Node, NodeAnnotation Anno) {
16421642 return ;
16431643 }
16441644
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.
16461646 bool FoundInSuperclass = false ;
16471647 if (auto PD = dyn_cast<SDKNodeDecl>(Node->getParent ())) {
16481648 if (PD->isAnnotatedAs (NodeAnnotation::Updated)) {
@@ -1847,10 +1847,10 @@ static bool readBreakageAllowlist(SDKContext &Ctx, llvm::StringSet<> &lines,
18471847 if (BreakageAllowlistPath.empty ())
18481848 return 0 ;
18491849 CompilerInstance instance;
1850- CompilerInvocation invok ;
1851- invok .setModuleName (" ForClangImporter" );
1850+ CompilerInvocation invoke ;
1851+ invoke .setModuleName (" ForClangImporter" );
18521852 std::string InstanceSetupError;
1853- if (instance.setup (invok , InstanceSetupError)) {
1853+ if (instance.setup (invoke , InstanceSetupError)) {
18541854 return 1 ;
18551855 }
18561856 auto importer = ClangImporter::create (instance.getASTContext ());
@@ -2055,19 +2055,19 @@ static int generateMigrationScript(StringRef LeftPath, StringRef RightPath,
20552055 return 0 ;
20562056}
20572057
2058- static void setSDKPath (CompilerInvocation &InitInvok , bool IsBaseline,
2058+ static void setSDKPath (CompilerInvocation &InitInvoke , bool IsBaseline,
20592059 StringRef SDK, StringRef BaselineSDK) {
20602060 if (IsBaseline) {
20612061 // Set baseline SDK
20622062 if (!BaselineSDK.empty ()) {
2063- InitInvok .setSDKPath (BaselineSDK.str ());
2063+ InitInvoke .setSDKPath (BaselineSDK.str ());
20642064 }
20652065 } else {
20662066 // Set current SDK
20672067 if (!SDK.empty ()) {
2068- InitInvok .setSDKPath (SDK.str ());
2068+ InitInvoke .setSDKPath (SDK.str ());
20692069 } else if (const char *SDKROOT = getenv (" SDKROOT" )) {
2070- InitInvok .setSDKPath (SDKROOT);
2070+ InitInvoke .setSDKPath (SDKROOT);
20712071 }
20722072 }
20732073}
@@ -2185,7 +2185,7 @@ class SwiftAPIDigesterInvocation {
21852185private:
21862186 std::string MainExecutablePath;
21872187 std::unique_ptr<llvm::opt::OptTable> Table;
2188- CompilerInvocation InitInvok ;
2188+ CompilerInvocation InitInvoke ;
21892189 ActionType Action = ActionType::None;
21902190 CheckerOptions CheckerOpts;
21912191 llvm::StringSet<> IgnoredUsrs;
@@ -2379,29 +2379,29 @@ class SwiftAPIDigesterInvocation {
23792379 return ComparisonInputMode::BaselineJson;
23802380 }
23812381
2382- int prepareForDump (CompilerInvocation &InitInvok , llvm::StringSet<> &Modules,
2382+ int prepareForDump (CompilerInvocation &InitInvoke , llvm::StringSet<> &Modules,
23832383 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);
23872387
23882388 if (!Triple.empty ())
2389- InitInvok .setTargetTriple (Triple);
2389+ InitInvoke .setTargetTriple (Triple);
23902390
23912391 // 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;
23952395 // Module recovery issue shouldn't bring down the tool.
2396- InitInvok .getLangOptions ().AllowDeserializingImplementationOnly = true ;
2396+ InitInvoke .getLangOptions ().AllowDeserializingImplementationOnly = true ;
23972397
23982398 if (!SwiftVersion.empty ()) {
23992399 using version::Version;
24002400 bool isValid = false ;
24012401 if (auto Version =
24022402 Version::parseVersionString (SwiftVersion, SourceLoc (), nullptr )) {
24032403 if (auto Effective = Version.getValue ().getEffectiveLanguageVersion ()) {
2404- InitInvok .getLangOptions ().EffectiveLanguageVersion = *Effective;
2404+ InitInvoke .getLangOptions ().EffectiveLanguageVersion = *Effective;
24052405 isValid = true ;
24062406 }
24072407 }
@@ -2412,7 +2412,7 @@ class SwiftAPIDigesterInvocation {
24122412 }
24132413
24142414 if (!ResourceDir.empty ()) {
2415- InitInvok .setRuntimeResourcePath (ResourceDir);
2415+ InitInvoke .setRuntimeResourcePath (ResourceDir);
24162416 }
24172417 std::vector<SearchPathOptions::FrameworkSearchPath> FramePaths;
24182418 for (const auto &path : CCSystemFrameworkPaths) {
@@ -2422,14 +2422,14 @@ class SwiftAPIDigesterInvocation {
24222422 for (const auto &path : BaselineFrameworkPaths) {
24232423 FramePaths.push_back ({path, /* isSystem=*/ false });
24242424 }
2425- InitInvok .setImportSearchPaths (BaselineModuleInputPaths);
2425+ InitInvoke .setImportSearchPaths (BaselineModuleInputPaths);
24262426 } else {
24272427 for (const auto &path : FrameworkPaths) {
24282428 FramePaths.push_back ({path, /* isSystem=*/ false });
24292429 }
2430- InitInvok .setImportSearchPaths (ModuleInputPaths);
2430+ InitInvoke .setImportSearchPaths (ModuleInputPaths);
24312431 }
2432- InitInvok .setFrameworkSearchPaths (FramePaths);
2432+ InitInvoke .setFrameworkSearchPaths (FramePaths);
24332433 if (!ModuleList.empty ()) {
24342434 if (readFileLineByLine (ModuleList, Modules))
24352435 exit (1 );
@@ -2438,7 +2438,7 @@ class SwiftAPIDigesterInvocation {
24382438 Modules.insert (M);
24392439 }
24402440 for (auto M : PreferInterfaceForModules) {
2441- InitInvok .getFrontendOptions ().PreferInterfaceForModules .push_back (M);
2441+ InitInvoke .getFrontendOptions ().PreferInterfaceForModules .push_back (M);
24422442 }
24432443 if (Modules.empty ()) {
24442444 llvm::errs () << " Need to specify -include-all or -module <name>\n " ;
@@ -2448,19 +2448,19 @@ class SwiftAPIDigesterInvocation {
24482448 }
24492449
24502450 SDKNodeRoot *getSDKRoot (SDKContext &Ctx, bool IsBaseline) {
2451- CompilerInvocation Invok ;
2451+ CompilerInvocation Invoke ;
24522452 llvm::StringSet<> Modules;
2453- if (prepareForDump (Invok , Modules, IsBaseline))
2453+ if (prepareForDump (Invoke , Modules, IsBaseline))
24542454 return nullptr ;
2455- return getSDKNodeRoot (Ctx, Invok , Modules);
2455+ return getSDKNodeRoot (Ctx, Invoke , Modules);
24562456 }
24572457
24582458 SDKNodeRoot *getBaselineFromJson (SDKContext &Ctx) {
24592459 SwiftDeclCollector Collector (Ctx);
2460- CompilerInvocation Invok ;
2460+ CompilerInvocation Invoke ;
24612461 llvm::StringSet<> Modules;
24622462 // We need to call prepareForDump to parse target triple.
2463- if (prepareForDump (Invok , Modules, true ))
2463+ if (prepareForDump (Invoke , Modules, true ))
24642464 return nullptr ;
24652465
24662466 assert (Modules.size () == 1 &&
@@ -2470,14 +2470,14 @@ class SwiftAPIDigesterInvocation {
24702470 if (!BaselineFilePath.empty ()) {
24712471 Path = BaselineFilePath;
24722472 } else if (!BaselineDirPath.empty ()) {
2473- Path = getCustomBaselinePath (Invok .getLangOptions ().Target ,
2473+ Path = getCustomBaselinePath (Invoke .getLangOptions ().Target ,
24742474 Ctx.checkingABI (), BaselineDirPath);
24752475 } else if (UseEmptyBaseline) {
24762476 Path = getEmptyBaselinePath (MainExecutablePath);
24772477 } else {
24782478 Path = getDefaultBaselinePath (
24792479 MainExecutablePath, Modules.begin ()->getKey (),
2480- Invok .getLangOptions ().Target , Ctx.checkingABI ());
2480+ Invoke .getLangOptions ().Target , Ctx.checkingABI ());
24812481 }
24822482 if (!fs::exists (Path)) {
24832483 llvm::errs () << " Baseline at " << Path << " does not exist\n " ;
@@ -2494,11 +2494,11 @@ class SwiftAPIDigesterInvocation {
24942494 switch (Action) {
24952495 case ActionType::DumpSDK: {
24962496 llvm::StringSet<> Modules;
2497- return (prepareForDump (InitInvok , Modules))
2497+ return (prepareForDump (InitInvoke , Modules))
24982498 ? 1
2499- : dumpSDKContent (InitInvok , Modules,
2499+ : dumpSDKContent (InitInvoke , Modules,
25002500 getJsonOutputFilePath (
2501- InitInvok .getLangOptions ().Target ,
2501+ InitInvoke .getLangOptions ().Target ,
25022502 CheckerOpts.ABI , OutputFile, OutputDir),
25032503 CheckerOpts);
25042504 }
0 commit comments