Allocate CodeCompletionString and all of its components in a
commit65c9e3aeb94cabc7bb3caefa3221e9b7f9e7fbdf
authorDouglas Gregor <doug.gregor@gmail.com>
Tue, 1 Feb 2011 19:23:04 +0000 (1 19:23 +0000)
committerDouglas Gregor <doug.gregor@gmail.com>
Tue, 1 Feb 2011 19:23:04 +0000 (1 19:23 +0000)
treef965c5449f5d1b9ae07e755f619958abc5db0a44
parent01d240ffc42e250c0d6066574fd665f370c889cc
Allocate CodeCompletionString and all of its components in a
BumpPtrAllocator, rather than manually new/delete'ing them. This
optimization also allows us to avoid allocating memory for and copying
constant strings (e.g., "return", "class").

This also required embedding the priority and availability of results
within the code completion string, to avoid extra memory allocation
within libclang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124673 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Frontend/ASTUnit.h
include/clang/Sema/CodeCompleteConsumer.h
include/clang/Sema/Sema.h
lib/Frontend/ASTUnit.cpp
lib/Sema/CodeCompleteConsumer.cpp
lib/Sema/SemaCodeComplete.cpp
tools/libclang/CIndexCodeCompletion.cpp