[cfe-commits] r82581 - /cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h

Douglas Gregor dgregor at apple.com
Tue Sep 22 15:11:38 PDT 2009


Author: dgregor
Date: Tue Sep 22 17:11:38 2009
New Revision: 82581

URL: http://llvm.org/viewvc/llvm-project?rev=82581&view=rev
Log:
Add getDeclaration()/getKind() accessors to CodeCompleteConsumer::Result

Modified:
    cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h

Modified: cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h?rev=82581&r1=82580&r2=82581&view=diff

==============================================================================
--- cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h (original)
+++ cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h Tue Sep 22 17:11:38 2009
@@ -170,6 +170,18 @@
     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);





More information about the cfe-commits mailing list