From 4743124370ad4d6988a55c276b83de1705ae5a7f 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 317d0908..f689d48a 100644 --- a/src/clang_complete.cc +++ b/src/clang_complete.cc @@ -332,10 +332,7 @@ void BuildPreamble(CompletionSession &session, CompilerInvocation &CI, return; CI.getDiagnosticOpts().IgnoreWarnings = false; CI.getFrontendOpts().SkipFunctionBodies = true; - CI.getLangOpts()->CommentOpts.ParseAllComments = true; -#if LLVM_VERSION_MAJOR >= 7 - CI.getPreprocessorOpts().WriteCommentListToPCH = false; -#endif + CI.getLangOpts()->CommentOpts.ParseAllComments = g_config->index.comments > 1; StoreDiags DC(main); IntrusiveRefCntPtr DE = diff --git a/src/project.cc b/src/project.cc index 7968b5bb..b1419da8 100644 --- a/src/project.cc +++ b/src/project.cc @@ -136,7 +136,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(),