clean up clang_complete found by scturtle; clean up project

This commit is contained in:
Fangrui Song 2018-05-14 09:52:28 -07:00
parent f9e1e8cbdc
commit d2e0c7ca24
3 changed files with 0 additions and 24 deletions

View File

@ -776,7 +776,6 @@ std::shared_ptr<CompletionSession> 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);
}

View File

@ -44,10 +44,6 @@ struct ClangCompleteManager {
using OnDiagnostic =
std::function<void(std::string path,
std::vector<lsDiagnostic> diagnostics)>;
using OnIndex = std::function<void(ClangTranslationUnit* tu,
const std::vector<CXUnsavedFile>& unsaved,
const std::string& path,
const std::vector<std::string>& args)>;
using OnComplete =
std::function<void(const std::vector<lsCompletionItem>& results,
bool is_cached_result)>;

View File

@ -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<OptTable> Opts = driver::createDriverOptTable();
unsigned MissingArgIndex, MissingArgCount;
std::vector<const char*> cargs;