Revert "[CodeComplete] Teach code completion engine to recognize and manifest @recommended and @recommendedover."

This reverts commit 448a23c9af for failing linux bots.
This commit is contained in:
Xi Ge
2015-11-06 19:04:28 -08:00
parent ef8338fe86
commit 0a82a6fa41
8 changed files with 59 additions and 186 deletions

View File

@@ -103,14 +103,6 @@ static ArrayRef<StringRef> copyStringArray(llvm::BumpPtrAllocator &Allocator,
return llvm::makeArrayRef(Buff, Arr.size());
}
static ArrayRef<std::pair<StringRef, StringRef>> copyStringPairArray(
llvm::BumpPtrAllocator &Allocator,
ArrayRef<std::pair<StringRef, StringRef>> Arr) {
auto *Buff = Allocator.Allocate<std::pair<StringRef, StringRef>>(Arr.size());
std::copy(Arr.begin(), Arr.end(), Buff);
return llvm::makeArrayRef(Buff, Arr.size());
}
/// Deserializes CodeCompletionResults from \p in and stores them in \p V.
/// \see writeCacheModule.
static bool readCachedModule(llvm::MemoryBuffer *in,
@@ -220,13 +212,11 @@ static bool readCachedModule(llvm::MemoryBuffer *in,
assocUSRsIndex += usr.size() + IntLength;
}
SmallVector<std::pair<StringRef, StringRef>, 4> declKeywords;
SmallVector<StringRef, 4> declKeywords;
for (unsigned i = 0; i < declKeywordCount; ++i) {
auto first = getString(declKeywordIndex);
declKeywordIndex += first.size() + IntLength;
auto second = getString(declKeywordIndex);
declKeywordIndex += second.size() + IntLength;
declKeywords.push_back(std::make_pair(first, second));
auto kw = getString(declKeywordIndex);
declKeywords.push_back(kw);
declKeywordIndex += kw.size() + IntLength;
}
CodeCompletionResult *result = nullptr;
@@ -235,7 +225,7 @@ static bool readCachedModule(llvm::MemoryBuffer *in,
CodeCompletionResult(context, numBytesToErase, string, declKind,
moduleName, notRecommended, briefDocComment,
copyStringArray(*V.Sink.Allocator, assocUSRs),
copyStringPairArray(*V.Sink.Allocator, declKeywords));
copyStringArray(*V.Sink.Allocator, declKeywords));
} else {
result = new (*V.Sink.Allocator)
CodeCompletionResult(kind, context, numBytesToErase, string);
@@ -364,14 +354,12 @@ static void writeCachedModule(llvm::raw_ostream &out,
if (AllKeywords.empty()) {
LE.write(static_cast<uint32_t>(~0u));
} else {
LE.write(addString(AllKeywords[0].first));
addString(AllKeywords[0].second);
LE.write(addString(AllKeywords[0]));
for (unsigned i = 1; i < AllKeywords.size(); ++i) {
addString(AllKeywords[i].first);
addString(AllKeywords[i].second);
}
addString(AllKeywords[i]);
}
}
}
}
LE.write(static_cast<uint32_t>(results.tell()));
out << results.str();