Swap InputFileKind for ParseInputMode

Tying InputFile to this option meant that every input that was not one of the explictly-blessed kinds was modeled as a Swift file.

With the new InputFile that infers file kinds, we no longer need CompilerInvocation::setInputKind
This commit is contained in:
Robert Widmann
2020-09-11 21:20:28 -06:00
parent ac0814e4c8
commit 9fd5918786
10 changed files with 28 additions and 42 deletions

View File

@@ -850,7 +850,6 @@ static bool makeParserAST(CompilerInstance &CI, StringRef Text,
CompilerInvocation Invocation) {
Invocation.getFrontendOptions().InputsAndOutputs.clearInputs();
Invocation.setModuleName("main");
Invocation.setInputKind(InputFileKind::Swift);
Invocation.getLangOptions().DisablePoundIfEvaluation = true;
std::unique_ptr<llvm::MemoryBuffer> Buf;
@@ -1440,7 +1439,6 @@ SourceFile *SwiftLangSupport::getSyntacticSourceFile(
Error = "Compiler invocation init failed";
return nullptr;
}
Invocation.setInputKind(InputFileKind::Swift);
Invocation.getFrontendOptions().InputsAndOutputs.addInput(
InputFile(InputBuf->getBufferIdentifier(), /*isPrimary*/false, InputBuf,
file_types::TY_Swift));