Merge pull request #12920 from davidungar/Move-input-conversion

Move input conversion
This commit is contained in:
David Ungar
2017-11-27 17:13:48 -08:00
committed by GitHub
13 changed files with 283 additions and 130 deletions

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}