Create a special allocator class for code completion, so that all of

the string copying goes through a single place that can have
associated state.

llvm-svn: 124698
This commit is contained in:
Douglas Gregor
2011-02-01 22:57:45 +00:00
parent 06cebfd9a5
commit bcbf46c7b7
7 changed files with 95 additions and 93 deletions

View File

@@ -230,7 +230,7 @@ struct AllocatedCXCodeCompleteResults : public CXCodeCompleteResults {
llvm::SmallVector<const llvm::MemoryBuffer *, 1> TemporaryBuffers;
/// \brief Allocator used to store code completion results.
llvm::BumpPtrAllocator CodeCompletionAllocator;
CodeCompletionAllocator CodeCompletionAllocator;
};
/// \brief Tracks the number of code-completion result objects that are
@@ -310,7 +310,7 @@ namespace {
}
}
virtual llvm::BumpPtrAllocator &getAllocator() {
virtual CodeCompletionAllocator &getAllocator() {
return AllocatedResults.CodeCompletionAllocator;
}