[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

@@ -636,9 +636,6 @@ int parseFile(
assert(BufferIDs.size() == 1 && "Only expecting to process one source file");
unsigned BufferID = BufferIDs.front();
// Parse the actual source file
Instance.performParseOnly();
SourceFile *SF = nullptr;
for (auto Unit : Instance.getMainModule()->getFiles()) {
SF = dyn_cast<SourceFile>(Unit);
@@ -648,6 +645,9 @@ int parseFile(
}
assert(SF && "No source file");
// Force parsing to populate the syntax cache.
(void)SF->getSyntaxRoot();
// In case the action specific callback succeeds, we output this error code
int InternalExitCode = EXIT_SUCCESS;