Skip to content

Commit 7a2851b

Browse files
committed
[swift-ide-test] Add support for -enable-experimental-feature.
1 parent 2679294 commit 7a2851b

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
@@ -826,6 +826,11 @@ static llvm::cl::opt<bool> EnableBareSlashRegexLiterals(
826826
llvm::cl::desc("Enable the ability to write '/.../' regex literals"),
827827
llvm::cl::init(false));
828828

829+
static llvm::cl::list<std::string>
830+
EnableExperimentalFeatures("enable-experimental-feature",
831+
llvm::cl::desc("Enable an experimental feature"),
832+
llvm::cl::cat(Category));
833+
829834
static llvm::cl::list<std::string>
830835
AccessNotesPath("access-notes-path", llvm::cl::desc("Path to access notes file"),
831836
llvm::cl::cat(Category));
@@ -4321,6 +4326,12 @@ int main(int argc, char *argv[]) {
43214326
InitInvok.getLangOptions().EnableExperimentalStringProcessing = true;
43224327
}
43234328

4329+
for (const auto &featureArg : options::EnableExperimentalFeatures) {
4330+
if (auto feature = getExperimentalFeature(featureArg)) {
4331+
InitInvok.getLangOptions().Features.insert(*feature);
4332+
}
4333+
}
4334+
43244335
if (!options::Triple.empty())
43254336
InitInvok.setTargetTriple(options::Triple);
43264337
if (!options::SwiftVersion.empty()) {

0 commit comments

Comments
 (0)