[Frontend] Remove parsing option params from performParseOnly

Lift the `DisablePoundIfEvaluation` parsing option
into `LangOptions` to subsume the need for the
`EvaluateConditionals` parameter, and sink the
computation of `CanDelayBodies` down into
`createSourceFileForMainModule`.
This commit is contained in:
Hamish Knight
2020-06-08 12:44:13 -07:00
parent 81483cc050
commit 5d72c464eb
12 changed files with 47 additions and 33 deletions

View File

@@ -234,6 +234,7 @@ static bool makeParserAST(CompilerInstance &CI, StringRef Text,
Invocation.getFrontendOptions().InputsAndOutputs.clearInputs();
Invocation.setModuleName("main");
Invocation.setInputKind(InputFileKind::Swift);
Invocation.getLangOptions().DisablePoundIfEvaluation = true;
std::unique_ptr<llvm::MemoryBuffer> Buf;
Buf = llvm::MemoryBuffer::getMemBuffer(Text, "<module-interface>");