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 | 292b68699d222004e3a7cf814787046ff7540dc6 (patch) | |
| tree | 6307ba195330b564dfee9bec3151e634d5e4010c | |
| parent | 8c978b4fc2cd24a89c50e6319d5feacf88b1f8dc (diff) | |
| download | bcm5719-llvm-292b68699d222004e3a7cf814787046ff7540dc6.tar.gz bcm5719-llvm-292b68699d222004e3a7cf814787046ff7540dc6.zip | |
Add getDeclaration()/getKind() accessors to CodeCompleteConsumer::Result
llvm-svn: 82581
| -rw-r--r-- | clang/include/clang/Sema/CodeCompleteConsumer.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/include/clang/Sema/CodeCompleteConsumer.h b/clang/include/clang/Sema/CodeCompleteConsumer.h index 5db369cc136..68e07e9608e 100644 --- a/clang/include/clang/Sema/CodeCompleteConsumer.h +++ b/clang/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); |

