This commit is contained in:
Jacob Dufault 2017-12-07 11:53:48 -08:00
parent d8d794fb4e
commit 4a7ca6168f
3 changed files with 20 additions and 18 deletions

View File

@ -48,7 +48,8 @@ unsigned GetCompletionPriority(const CXCompletionString& str,
template <typename T>
char* tofixedbase64(T input, char* out) {
const char *digits = "./0123456789"
const char* digits =
"./0123456789"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
int len = (sizeof(T) * 8 - 1) / 6 + 1;
@ -450,9 +451,10 @@ void CompletionQueryMain(ClangCompleteManager* completion_manager) {
char buf[16];
ls_completion_item.sortText =
tofixedbase64(GetCompletionPriority(
result.CompletionString, result.CursorKind,
ls_completion_item.label), buf);
tofixedbase64(GetCompletionPriority(result.CompletionString,
result.CursorKind,
ls_completion_item.label),
buf);
ls_result.push_back(ls_completion_item);
}

View File

@ -6,10 +6,10 @@ ClangIndex::ClangIndex() : ClangIndex(1, 0) {}
ClangIndex::ClangIndex(int exclude_declarations_from_pch,
int display_diagnostics) {
// llvm::InitializeAllTargets (and possibly others) called by clang_createIndex
// transtively modifies/reads lib/Support/TargetRegistry.cpp FirstTarget.
// There will be a race condition if two threads call clang_createIndex
// concurrently.
// llvm::InitializeAllTargets (and possibly others) called by
// clang_createIndex transtively modifies/reads lib/Support/TargetRegistry.cpp
// FirstTarget. There will be a race condition if two threads call
// clang_createIndex concurrently.
static std::mutex mutex_;
std::lock_guard<std::mutex> lock(mutex_);