mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #12920 from davidungar/Move-input-conversion
Move input conversion
This commit is contained in:
@@ -83,7 +83,8 @@ struct InvocationOptions {
|
||||
// Assert invocation with a primary file. We want to avoid full typechecking
|
||||
// for all files.
|
||||
assert(!this->PrimaryFile.empty());
|
||||
assert(this->Invok.getFrontendOptions().Inputs.hasPrimaryInput());
|
||||
assert(this->Invok.getFrontendOptions().Inputs.haveUniquePrimaryInput() &&
|
||||
"Must have exactly one primary input for code completion, etc.");
|
||||
}
|
||||
|
||||
void applyTo(CompilerInvocation &CompInvok) const;
|
||||
@@ -354,7 +355,7 @@ static void setModuleName(CompilerInvocation &Invocation) {
|
||||
|
||||
StringRef Filename = Invocation.getOutputFilename();
|
||||
if (Filename.empty()) {
|
||||
if (!Invocation.getFrontendOptions().Inputs.hasInputFilenames()) {
|
||||
if (!Invocation.getFrontendOptions().Inputs.haveInputFilenames()) {
|
||||
Invocation.setModuleName("__main__");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ static bool swiftCodeCompleteImpl(SwiftLangSupport &Lang,
|
||||
if (Failed) {
|
||||
return false;
|
||||
}
|
||||
if (!Invocation.getFrontendOptions().Inputs.hasInputFilenames()) {
|
||||
if (!Invocation.getFrontendOptions().Inputs.haveInputFilenames()) {
|
||||
Error = "no input filenames specified";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ void SwiftLangSupport::indexSource(StringRef InputFile,
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Invocation.getFrontendOptions().Inputs.hasInputFilenames()) {
|
||||
if (!Invocation.getFrontendOptions().Inputs.haveInputFilenames()) {
|
||||
IdxConsumer.failed("no input filenames specified");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user