diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-09-22 22:11:38 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-09-22 22:11:38 +0000 |
commit | 76e0fece5b0c829ee4c184e78863806d3ca04be8 (patch) | |
tree | 2a6704cee63277e5ebbb5dcd08fe763feedba055 /include/clang/Sema/CodeCompleteConsumer.h | |
parent | 592a2bbc1945358ab8ebf0d74c57f0b23c4434c0 (diff) |
Add getDeclaration()/getKind() accessors to CodeCompleteConsumer::Result
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82581 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Sema/CodeCompleteConsumer.h')
-rw-r--r-- | include/clang/Sema/CodeCompleteConsumer.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/clang/Sema/CodeCompleteConsumer.h b/include/clang/Sema/CodeCompleteConsumer.h index 5db369cc13..68e07e9608 100644 --- a/include/clang/Sema/CodeCompleteConsumer.h +++ b/include/clang/Sema/CodeCompleteConsumer.h @@ -170,6 +170,18 @@ public: Result(const char *Keyword, unsigned Rank) : Kind(RK_Keyword), Keyword(Keyword), Rank(Rank), Hidden(false) { } + /// \brief Retrieve the declaration stored in this result. + NamedDecl *getDeclaration() const { + assert(Kind == RK_Declaration && "Not a declaration result"); + return Declaration; + } + + /// \brief Retrieve the keyword stored in this result. + const char *getKeyword() const { + assert(Kind == RK_Keyword && "Not a keyword result"); + return Keyword; + } + /// \brief Create a new code-completion string that describes how to insert /// this result into a program. CodeCompletionString *CreateCodeCompletionString(Sema &S); |