[Frontend] Remove performParseOnly

Most clients were only using it to populate the
main module with files, which is now done by
`getMainModule`. Instead, they can now just rely
on parsing happening lazily.
This commit is contained in:
Hamish Knight
2020-06-08 12:44:15 -07:00
parent 7824dc1048
commit 1ed810653c
11 changed files with 34 additions and 42 deletions

View File

@@ -814,10 +814,7 @@ static bool makeParserAST(CompilerInstance &CI, StringRef Text,
Buf = llvm::MemoryBuffer::getMemBuffer(Text, "<module-interface>");
Invocation.getFrontendOptions().InputsAndOutputs.addInput(
InputFile(Buf.get()->getBufferIdentifier(), false, Buf.get()));
if (CI.setup(Invocation))
return true;
CI.performParseOnly();
return false;
return CI.setup(Invocation);
}
static void collectFuncEntities(std::vector<TextEntity> &Ents,
@@ -1407,7 +1404,6 @@ SourceFile *SwiftLangSupport::getSyntacticSourceFile(
Error = "Compiler invocation set up failed";
return nullptr;
}
ParseCI.performParseOnly();
SourceFile *SF = nullptr;
unsigned BufferID = ParseCI.getInputBufferIDs().back();