Merge pull request #14198 from davidungar/PR-18-3c-exp2

[Batch mode] Move frontend main output files to FrontendInputsAndOutputs. (1)
This commit is contained in:
David Ungar
2018-02-01 16:42:10 -08:00
committed by GitHub
39 changed files with 1156 additions and 661 deletions

View File

@@ -773,13 +773,13 @@ private:
static bool makeParserAST(CompilerInstance &CI, StringRef Text,
CompilerInvocation Invocation) {
Invocation.getFrontendOptions().Inputs.clearInputs();
Invocation.getFrontendOptions().InputsAndOutputs.clearInputs();
Invocation.setModuleName("main");
Invocation.setInputKind(InputFileKind::IFK_Swift);
std::unique_ptr<llvm::MemoryBuffer> Buf;
Buf = llvm::MemoryBuffer::getMemBuffer(Text, "<module-interface>");
Invocation.getFrontendOptions().Inputs.addInput(
Invocation.getFrontendOptions().InputsAndOutputs.addInput(
InputFile(Buf.get()->getBufferIdentifier(), false, Buf.get()));
if (CI.setup(Invocation))
return true;
@@ -1094,7 +1094,7 @@ static bool reportSourceDocInfo(CompilerInvocation Invocation,
EditorDiagConsumer DiagConsumer;
CI.addDiagnosticConsumer(&DiagConsumer);
Invocation.getFrontendOptions().Inputs.addInput(
Invocation.getFrontendOptions().InputsAndOutputs.addInput(
InputFile(InputBuf->getBufferIdentifier(), false, InputBuf));
if (CI.setup(Invocation))
return true;
@@ -1367,7 +1367,7 @@ SourceFile *SwiftLangSupport::getSyntacticSourceFile(
return nullptr;
}
Invocation.setInputKind(InputFileKind::IFK_Swift);
Invocation.getFrontendOptions().Inputs.addInput(
Invocation.getFrontendOptions().InputsAndOutputs.addInput(
InputFile(InputBuf->getBufferIdentifier(), false, InputBuf));
if (ParseCI.setup(Invocation)) {
@@ -1443,7 +1443,7 @@ findModuleGroups(StringRef ModuleName, ArrayRef<const char *> Args,
StringRef Error)> Receiver) {
CompilerInvocation Invocation;
Invocation.getClangImporterOptions().ImportForwardDeclarations = true;
Invocation.getFrontendOptions().Inputs.clearInputs();
Invocation.getFrontendOptions().InputsAndOutputs.clearInputs();
CompilerInstance CI;
// Display diagnostics to stderr.