Give ASTContext TypeCheckerOptions

Strip TypeChecker of all of this state.
This commit is contained in:
Robert Widmann
2019-11-08 16:34:28 -08:00
parent 422bb372d3
commit 48805b1d44
20 changed files with 101 additions and 124 deletions

View File

@@ -274,6 +274,7 @@ swiftparse_client_node_t SynParser::parse(const char *source) {
SourceManager SM;
unsigned bufID = SM.addNewSourceBuffer(
llvm::MemoryBuffer::getMemBuffer(source, "syntax_parse_source"));
TypeCheckerOptions tyckOpts;
LangOptions langOpts;
langOpts.BuildSyntaxTree = true;
langOpts.CollectParsedToken = false;
@@ -285,7 +286,7 @@ swiftparse_client_node_t SynParser::parse(const char *source) {
std::make_shared<CLibParseActions>(*this, SM, bufID);
// We have to use SourceFileKind::Main to avoid diagnostics like
// illegal_top_level_expr
ParserUnit PU(SM, SourceFileKind::Main, bufID, langOpts,
ParserUnit PU(SM, SourceFileKind::Main, bufID, langOpts, tyckOpts,
"syntax_parse_module", std::move(parseActions),
/*SyntaxCache=*/nullptr);
// Evaluating pound conditions may lead to unknown syntax.