libSyntax: optionally emit diagnostics for unknown expressions and declarations. (#13973)

With more syntax nodes being specialized, we'd like this
straight-forward way to pinpoint unknown entities. This diagnostics
is only issued in -emit-syntax frontend action and swift-syntax-test
invocation.
This commit is contained in:
Xi Ge
2018-01-16 16:14:57 -08:00
committed by GitHub
parent ce8fb6272d
commit 71af76a87e
8 changed files with 75 additions and 10 deletions

View File

@@ -145,6 +145,7 @@ SourceFile *getSourceFile(CompilerInstance &Instance,
const char *MainExecutablePath) {
CompilerInvocation Invocation;
Invocation.getLangOptions().KeepSyntaxInfoInSourceFile = true;
Invocation.getLangOptions().VerifySyntaxTree = true;
Invocation.getFrontendOptions().Inputs.addInputFile(InputFileName);
Invocation.setMainExecutablePath(
llvm::sys::fs::getMainExecutable(MainExecutablePath,