From d2e0c7ca241443a47c198418ecc99752447360e3 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 14 May 2018 09:52:28 -0700 Subject: [PATCH] clean up clang_complete found by scturtle; clean up project --- src/clang_complete.cc | 1 - src/clang_complete.h | 4 ---- src/project.cc | 19 ------------------- 3 files changed, 24 deletions(-) diff --git a/src/clang_complete.cc b/src/clang_complete.cc index 6d23be43..6d344da0 100644 --- a/src/clang_complete.cc +++ b/src/clang_complete.cc @@ -776,7 +776,6 @@ std::shared_ptr ClangCompleteManager::TryGetSession( // If this request is for a completion, we should move it to // |completion_sessions|. if (mark_as_completion) { - assert(!completion_sessions_.TryGet(filename)); preloaded_sessions_.TryTake(filename); completion_sessions_.Insert(filename, preloaded_session); } diff --git a/src/clang_complete.h b/src/clang_complete.h index ee0cd6a7..aa471c8e 100644 --- a/src/clang_complete.h +++ b/src/clang_complete.h @@ -44,10 +44,6 @@ struct ClangCompleteManager { using OnDiagnostic = std::function diagnostics)>; - using OnIndex = std::function& unsaved, - const std::string& path, - const std::vector& args)>; using OnComplete = std::function& results, bool is_cached_result)>; diff --git a/src/project.cc b/src/project.cc index 63ed720e..7f8dfbff 100644 --- a/src/project.cc +++ b/src/project.cc @@ -95,25 +95,6 @@ Project::Entry GetCompilationEntryFromCompileCommandEntry( if (args.empty()) return result; - std::string first_arg = args[0]; - // Windows' filesystem is not case sensitive, so we compare only - // the lower case variant. - std::transform(first_arg.begin(), first_arg.end(), first_arg.begin(), - tolower); - bool clang_cl = strstr(first_arg.c_str(), "clang-cl") || - strstr(first_arg.c_str(), "cl.exe"); - // Clang only cares about the last --driver-mode flag, so the loop - // iterates in reverse to find the last one as soon as possible - // in case of multiple --driver-mode flags. - for (int i = args.size() - 1; i >= 0; --i) { - if (strstr(args[i].c_str(), "--dirver-mode=")) { - clang_cl = clang_cl || strstr(args[i].c_str(), "--driver-mode=cl"); - break; - } - } - // Compiler driver. - result.args.push_back(args[0]); - std::unique_ptr Opts = driver::createDriverOptTable(); unsigned MissingArgIndex, MissingArgCount; std::vector cargs;