From 20a9f7b5f4b79a4ffe4b6982b2cc27580f3db77b Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 30 Aug 2020 10:21:58 -0700 Subject: [PATCH] clang_tu: set RecoveryAST & RecoveryASTType --- src/clang_tu.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/clang_tu.cc b/src/clang_tu.cc index 0944547f..2a4ac132 100644 --- a/src/clang_tu.cc +++ b/src/clang_tu.cc @@ -156,6 +156,10 @@ buildCompilerInvocation(const std::string &main, std::vector args, // Enable IndexFrontendAction::shouldSkipFunctionBody. ci->getFrontendOpts().SkipFunctionBodies = true; ci->getLangOpts()->SpellChecking = false; +#if LLVM_VERSION_MAJOR >= 11 + ci->getLangOpts()->RecoveryAST = true; + ci->getLangOpts()->RecoveryASTType = true; +#endif auto &isec = ci->getFrontendOpts().Inputs; if (isec.size()) isec[0] = FrontendInputFile(main, isec[0].getKind(), isec[0].isSystem());