]> granicus.if.org Git - clang/commit
When caching code completions for global declarations, keep track of
authorDouglas Gregor <dgregor@apple.com>
Mon, 16 Aug 2010 18:08:11 +0000 (18:08 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 16 Aug 2010 18:08:11 +0000 (18:08 +0000)
commitf5586f6b311c98e1022a8fe0609053849b70d323
tree2f64da2075690ef651d55257749ede78b7261277
parentd6577428627bd4b7f8cd87e213151ebe6a587a9f
When caching code completions for global declarations, keep track of
the usage type of each declaration result, then compare those types to
the preferred type of the completion. This provides parity in the
priority calculation between the code-completion results produced
directly from Sema and those cached by ASTUnit.

For the standard Cocoa.h (+ others) example, there's a penalty of 3-4
hundredeths of a second when caching the global results (for ~31,000
results), because we need an ASTContext-agnostic representation of
types for the comparison, and therefore we use... strings. Eventually,
we'd like to implement a more efficient ASTContext-agnostic encoding
of types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111165 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/CanonicalType.h
include/clang/AST/TypeOrdering.h
include/clang/Frontend/ASTUnit.h
lib/Frontend/ASTUnit.cpp
test/Index/complete-exprs.c