mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #69970 from NuriAmari/swift-ide-test-updates
[swift-ide-test] Add -enable-upcoming-feature ImportObjcForwardDeclarations support
This commit is contained in:
@@ -413,12 +413,6 @@ static llvm::cl::opt<bool> CodeCompleteCallPatternHeuristics(
|
||||
"Use heuristics to guess whether we want call pattern completions"),
|
||||
llvm::cl::cat(Category));
|
||||
|
||||
static llvm::cl::opt<bool>
|
||||
ObjCForwardDeclarations("enable-objc-forward-declarations",
|
||||
llvm::cl::desc("Import Objective-C forward declarations when possible"),
|
||||
llvm::cl::cat(Category),
|
||||
llvm::cl::init(false));
|
||||
|
||||
static llvm::cl::opt<bool>
|
||||
EnableSwift3ObjCInference("enable-swift3-objc-inference",
|
||||
llvm::cl::desc("Enable Swift 3's @objc inference rules"),
|
||||
@@ -870,6 +864,11 @@ static llvm::cl::list<std::string>
|
||||
llvm::cl::desc("Enable an experimental feature"),
|
||||
llvm::cl::cat(Category));
|
||||
|
||||
static llvm::cl::list<std::string>
|
||||
EnableUpcomingFeatures("enable-upcoming-feature",
|
||||
llvm::cl::desc("Enable a feature that will be introduced in an upcoming language version"),
|
||||
llvm::cl::cat(Category));
|
||||
|
||||
static llvm::cl::list<std::string>
|
||||
AccessNotesPath("access-notes-path", llvm::cl::desc("Path to access notes file"),
|
||||
llvm::cl::cat(Category));
|
||||
@@ -4435,6 +4434,12 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto &featureArg : options::EnableUpcomingFeatures) {
|
||||
if (auto feature = getUpcomingFeature(featureArg)) {
|
||||
InitInvok.getLangOptions().Features.insert(*feature);
|
||||
}
|
||||
}
|
||||
|
||||
if (!options::Triple.empty())
|
||||
InitInvok.setTargetTriple(options::Triple);
|
||||
if (!options::SwiftVersion.empty()) {
|
||||
@@ -4489,8 +4494,13 @@ int main(int argc, char *argv[]) {
|
||||
options::EnableDeserializationSafety;
|
||||
InitInvok.getLangOptions().EnableSwift3ObjCInference =
|
||||
options::EnableSwift3ObjCInference;
|
||||
// The manner in which swift-ide-test constructs its CompilerInvocation does
|
||||
// not hit the codepath in arg parsing that would normally construct
|
||||
// ClangImporter options based on enabled language features etc. Explicitly
|
||||
// enable them here.
|
||||
InitInvok.getClangImporterOptions().ImportForwardDeclarations |=
|
||||
options::ObjCForwardDeclarations;
|
||||
InitInvok.getLangOptions().hasFeature(
|
||||
Feature::ImportObjcForwardDeclarations);
|
||||
if (!options::ResourceDir.empty()) {
|
||||
InitInvok.setRuntimeResourcePath(options::ResourceDir);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user