diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2012-08-02 21:45:39 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2012-08-02 21:45:39 +0000 |
commit | af19a6aaa2959ef5e76f19d51e87ef523bdeedde (patch) | |
tree | 66274ab4dd32bf0664bccde910a2a411cb9bd13b /include/clang/AST/Comment.h | |
parent | d6261a96cd470c148c474c8ebeacabc40e0ebb37 (diff) |
Comments AST: refactor DeclInfo to use an enum for decl kind instead of
separate flags.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161217 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST/Comment.h')
-rw-r--r-- | include/clang/AST/Comment.h | 43 |
1 files changed, 38 insertions, 5 deletions
diff --git a/include/clang/AST/Comment.h b/include/clang/AST/Comment.h index 32c96a59ec..a4ba14dbcb 100644 --- a/include/clang/AST/Comment.h +++ b/include/clang/AST/Comment.h @@ -923,14 +923,43 @@ struct DeclInfo { /// a template. const TemplateParameterList *TemplateParameters; + /// A simplified description of \c ThisDecl kind that should be good enough + /// for documentation rendering purposes. + enum DeclKind { + /// Something that we consider a "function": + /// \li function, + /// \li function template, + /// \li function template specialization, + /// \li member function, + /// \li member function template, + /// \li member function template specialization, + /// \li ObjC method. + FunctionKind, + + /// Something that we consider a "class": + /// \li class/struct, + /// \li class template, + /// \li class template (partial) specialization. + ClassKind, + + /// Something that we consider a "variable": + /// \li namespace scope variables; + /// \li static and non-static class data members. + VariableKind, + + /// A C++ namespace. + NamespaceKind, + + /// A C++ typedef-name (a 'typedef' decl specifier or alias-declaration), + /// see \c TypedefNameDecl. + TypedefKind + }; + /// If false, only \c ThisDecl is valid. unsigned IsFilled : 1; - /// Is \c ThisDecl something that we consider a "function". - unsigned IsFunctionDecl : 1; - - /// Is \c ThisDecl something that we consider a "class". - unsigned IsClassDecl : 1; + /// Simplified kind of \c ThisDecl, see\c DeclKind enum. + unsigned Kind : 3; /// Is \c ThisDecl a template declaration. unsigned IsTemplateDecl : 1; @@ -953,6 +982,10 @@ struct DeclInfo { unsigned IsClassMethod : 1; void fill(); + + DeclKind getKind() const LLVM_READONLY { + return static_cast<DeclKind>(Kind); + } }; /// A full comment attached to a declaration, contains block content. |