]> granicus.if.org Git - clang/commit
Extend the code-completion caching infrastructure to include global
authorDouglas Gregor <dgregor@apple.com>
Sun, 15 Aug 2010 06:18:01 +0000 (06:18 +0000)
committerDouglas Gregor <dgregor@apple.com>
Sun, 15 Aug 2010 06:18:01 +0000 (06:18 +0000)
commit8071e4212ae08f8014e0c3ae6d18b7388003a5cc
treeea359a2c105912267f6e067eef19639c5fc48cdc
parentde7a0fcdf9f30cb5a97aab614f3975d93cd9926f
Extend the code-completion caching infrastructure to include global
declarations (in addition to macros). Each kind of declaration maps to
a certain set of completion contexts, and the ASTUnit completion logic
introduces the completion strings for those declarations if the actual
code-completion occurs in one of the contexts where it matters.

There are a few new code-completion-context kinds. Without these,
certain completions (e.g., after "using namespace") would need to
suppress all global completions, which would be unfortunate.

Note that we don't get the priorities right for global completions,
because we don't have enough type information. We'll need a way to
compare types in an ASTContext-agnostic way before this can be
implemented.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111093 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
include/clang/Driver/CC1Options.td
include/clang/Frontend/CompilerInstance.h
include/clang/Frontend/FrontendOptions.h
include/clang/Sema/CodeCompleteConsumer.h
include/clang/Sema/Sema.h
lib/Frontend/ASTUnit.cpp
lib/Frontend/CompilerInstance.cpp
lib/Frontend/CompilerInvocation.cpp
lib/Sema/SemaCodeComplete.cpp
lib/Sema/SemaLookup.cpp
test/Index/complete-exprs.c
tools/libclang/CIndexCodeCompletion.cpp