From 40b47f9ca3711c999a49b05ce5c15c47e3c26db5 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 12 Oct 2018 16:36:07 -0700 Subject: [PATCH] Adapt trunk change and write comments to PCH --- src/clang_complete.cc | 5 +---- src/project.cc | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/clang_complete.cc b/src/clang_complete.cc index 25857e7a..499877ef 100644 --- a/src/clang_complete.cc +++ b/src/clang_complete.cc @@ -320,11 +320,8 @@ void BuildPreamble(CompletionSession &session, CompilerInvocation &CI, return; CI.getDiagnosticOpts().IgnoreWarnings = false; CI.getFrontendOpts().SkipFunctionBodies = true; - CI.getLangOpts()->CommentOpts.ParseAllComments = true; + CI.getLangOpts()->CommentOpts.ParseAllComments = g_config->index.comments > 1; CI.getLangOpts()->RetainCommentsFromSystemHeaders = true; -#if LLVM_VERSION_MAJOR >= 7 - CI.getPreprocessorOpts().WriteCommentListToPCH = false; -#endif StoreDiags DC(main); IntrusiveRefCntPtr DE = diff --git a/src/project.cc b/src/project.cc index c97e9aa5..92a7ee61 100644 --- a/src/project.cc +++ b/src/project.cc @@ -124,7 +124,7 @@ struct ProjectProcessor { const driver::JobList &Jobs = C->getJobs(); if (Jobs.size() != 1) return; - const driver::ArgStringList &CCArgs = Jobs.begin()->getArguments(); + const auto &CCArgs = Jobs.begin()->getArguments(); auto CI = std::make_unique(); CompilerInvocation::CreateFromArgs(*CI, CCArgs.data(),