@@ -41,7 +41,7 @@ namespace {
41
41
None,
42
42
DumpSDK,
43
43
DumpSwiftModules,
44
- CompareSDKs ,
44
+ MigratorGen ,
45
45
DiagnoseSDKs,
46
46
// The following two are for testing purposes
47
47
DeserializeDiffItems,
@@ -141,9 +141,9 @@ Action(llvm::cl::desc("Mode:"), llvm::cl::init(ActionType::None),
141
141
clEnumValN(ActionType::DumpSwiftModules,
142
142
" dump-swift" ,
143
143
" dump swift modules in SDK" ),
144
- clEnumValN(ActionType::CompareSDKs ,
145
- " compare-sdk " ,
146
- " Compare SDK content in JSON file" ),
144
+ clEnumValN(ActionType::MigratorGen ,
145
+ " generate-migration-script " ,
146
+ " Compare SDK content in JSON file and generate migration script " ),
147
147
clEnumValN(ActionType::DiagnoseSDKs,
148
148
" diagnose-sdk" ,
149
149
" Diagnose SDK content in JSON file" ),
@@ -2128,9 +2128,10 @@ static void populateAliasChanges(NodeMap &AliasMap, DiffVector &AllItems,
2128
2128
}
2129
2129
}
2130
2130
2131
- static int compareSDKs (StringRef LeftPath, StringRef RightPath,
2132
- StringRef DiffPath,
2133
- llvm::StringSet<> &IgnoredRemoveUsrs, CheckerOptions Opts) {
2131
+ static int generateMigrationScript (StringRef LeftPath, StringRef RightPath,
2132
+ StringRef DiffPath,
2133
+ llvm::StringSet<> &IgnoredRemoveUsrs,
2134
+ CheckerOptions Opts) {
2134
2135
if (!fs::exists (LeftPath)) {
2135
2136
llvm::errs () << LeftPath << " does not exist\n " ;
2136
2137
return 1 ;
@@ -2395,7 +2396,7 @@ int main(int argc, char *argv[]) {
2395
2396
case ActionType::DumpSDK:
2396
2397
return (prepareForDump (argv[0 ], InitInvok, Modules)) ? 1 :
2397
2398
dumpSDKContent (InitInvok, Modules, options::OutputFile, Opts);
2398
- case ActionType::CompareSDKs :
2399
+ case ActionType::MigratorGen :
2399
2400
case ActionType::DiagnoseSDKs: {
2400
2401
if (options::SDKJsonPaths.size () != 2 ) {
2401
2402
llvm::errs () << " Only two SDK versions can be compared\n " ;
@@ -2407,9 +2408,10 @@ int main(int argc, char *argv[]) {
2407
2408
if (readFileLineByLine (options::ProtReqWhiteList, protocolWhitelist))
2408
2409
return 1 ;
2409
2410
}
2410
- if (options::Action == ActionType::CompareSDKs)
2411
- return compareSDKs (options::SDKJsonPaths[0 ], options::SDKJsonPaths[1 ],
2412
- options::OutputFile, IgnoredUsrs, Opts);
2411
+ if (options::Action == ActionType::MigratorGen)
2412
+ return generateMigrationScript (options::SDKJsonPaths[0 ],
2413
+ options::SDKJsonPaths[1 ],
2414
+ options::OutputFile, IgnoredUsrs, Opts);
2413
2415
else
2414
2416
return diagnoseModuleChange (options::SDKJsonPaths[0 ],
2415
2417
options::SDKJsonPaths[1 ],
0 commit comments