Skip to content

Commit 2d1e976

Browse files
authored
Merge pull request #19821 from nkcsgexi/remove-3-migrator
migrator: remove migration scripts for migrating from Swift 3.
2 parents f05be88 + 63bfbb5 commit 2d1e976

File tree

7 files changed

+7
-1347
lines changed

7 files changed

+7
-1347
lines changed

lib/Frontend/CompilerInvocation.cpp

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,9 +1047,8 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
10471047
return false;
10481048
}
10491049

1050-
static std::string getScriptFileName(StringRef name, bool isSwiftVersion3) {
1051-
StringRef langVer = isSwiftVersion3 ? "3" : "4";
1052-
return (Twine(name) + langVer + ".json").str();
1050+
static std::string getScriptFileName(StringRef name) {
1051+
return (Twine(name) + "4" + ".json").str();
10531052
}
10541053

10551054
static bool ParseMigratorArgs(MigratorOptions &Opts,
@@ -1082,7 +1081,6 @@ static bool ParseMigratorArgs(MigratorOptions &Opts,
10821081
Opts.APIDigesterDataStorePaths.push_back(DataPath->getValue());
10831082
} else {
10841083
auto &Triple = LangOpts.Target;
1085-
bool isSwiftVersion3 = LangOpts.isSwiftVersion3();
10861084

10871085
llvm::SmallString<128> basePath;
10881086
if (auto DataDir = Args.getLastArg(OPT_api_diff_data_dir)) {
@@ -1096,23 +1094,18 @@ static bool ParseMigratorArgs(MigratorOptions &Opts,
10961094
llvm::SmallString<128> dataPath(basePath);
10971095

10981096
if (Triple.isMacOSX())
1099-
llvm::sys::path::append(dataPath,
1100-
getScriptFileName("macos", isSwiftVersion3));
1097+
llvm::sys::path::append(dataPath, getScriptFileName("macos"));
11011098
else if (Triple.isiOS())
1102-
llvm::sys::path::append(dataPath,
1103-
getScriptFileName("ios", isSwiftVersion3));
1099+
llvm::sys::path::append(dataPath, getScriptFileName("ios"));
11041100
else if (Triple.isTvOS())
1105-
llvm::sys::path::append(dataPath,
1106-
getScriptFileName("tvos", isSwiftVersion3));
1101+
llvm::sys::path::append(dataPath, getScriptFileName("tvos"));
11071102
else if (Triple.isWatchOS())
1108-
llvm::sys::path::append(dataPath,
1109-
getScriptFileName("watchos", isSwiftVersion3));
1103+
llvm::sys::path::append(dataPath, getScriptFileName("watchos"));
11101104
else
11111105
Supported = false;
11121106
if (Supported) {
11131107
llvm::SmallString<128> authoredDataPath(basePath);
1114-
llvm::sys::path::append(authoredDataPath,
1115-
getScriptFileName("overlay", isSwiftVersion3));
1108+
llvm::sys::path::append(authoredDataPath, getScriptFileName("overlay"));
11161109
// Add authored list first to take higher priority.
11171110
Opts.APIDigesterDataStorePaths.push_back(authoredDataPath.str());
11181111
Opts.APIDigesterDataStorePaths.push_back(dataPath.str());

lib/Migrator/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
set(datafiles
2-
macos3.json
32
macos4.json
4-
ios3.json
53
ios4.json
6-
tvos3.json
74
tvos4.json
8-
watchos3.json
95
watchos4.json
10-
overlay3.json
116
overlay4.json
127
)
138
set(SWIFTLIB_DIR

lib/Migrator/ios3.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/Migrator/macos3.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)