Skip to content

Commit 011b669

Browse files
committed
[swift-ide-test] Add support for -enable-upcoming-feature
1 parent add012c commit 011b669

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tools/swift-ide-test/swift-ide-test.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,11 @@ static llvm::cl::list<std::string>
865865
llvm::cl::desc("Enable an experimental feature"),
866866
llvm::cl::cat(Category));
867867

868+
static llvm::cl::list<std::string>
869+
EnableUpcomingFeatures("enable-upcoming-feature",
870+
llvm::cl::desc("Enable a feature that will be introduced in an upcoming language version"),
871+
llvm::cl::cat(Category));
872+
868873
static llvm::cl::list<std::string>
869874
AccessNotesPath("access-notes-path", llvm::cl::desc("Path to access notes file"),
870875
llvm::cl::cat(Category));
@@ -4421,6 +4426,12 @@ int main(int argc, char *argv[]) {
44214426
}
44224427
}
44234428

4429+
for (const auto &featureArg : options::EnableUpcomingFeatures) {
4430+
if (auto feature = getUpcomingFeature(featureArg)) {
4431+
InitInvok.getLangOptions().Features.insert(*feature);
4432+
}
4433+
}
4434+
44244435
if (!options::Triple.empty())
44254436
InitInvok.setTargetTriple(options::Triple);
44264437
if (!options::SwiftVersion.empty()) {

0 commit comments

Comments
 (0)