clang  14.0.0git
Public Types | Public Member Functions | Public Attributes | List of all members
clang::comments::DeclInfo Struct Reference

Information about the declaration, useful to clients of FullComment. More...

#include "clang/AST/Comment.h"

Collaboration diagram for clang::comments::DeclInfo:
Collaboration graph
[legend]

Public Types

enum  DeclKind {
  OtherKind, FunctionKind, ClassKind, VariableKind,
  NamespaceKind, TypedefKind, EnumKind
}
 A simplified description of CommentDecl kind that should be good enough for documentation rendering purposes. More...
 
enum  TemplateDeclKind { NotTemplate, Template, TemplateSpecialization, TemplatePartialSpecialization }
 What kind of template specialization CommentDecl is. More...
 

Public Member Functions

void fill ()
 
DeclKind getKind () const LLVM_READONLY
 
TemplateDeclKind getTemplateKind () const LLVM_READONLY
 
bool involvesFunctionType () const
 

Public Attributes

const DeclCommentDecl
 Declaration the comment is actually attached to (in the source). More...
 
const DeclCurrentDecl
 CurrentDecl is the declaration with which the FullComment is associated. More...
 
ArrayRef< const ParmVarDecl * > ParamVars
 Parameters that can be referenced by \param if CommentDecl is something that we consider a "function". More...
 
QualType ReturnType
 Function return type if CommentDecl is something that we consider a "function". More...
 
const TemplateParameterListTemplateParameters
 Template parameters that can be referenced by \tparam if CommentDecl is a template (IsTemplateDecl or IsTemplatePartialSpecialization is true). More...
 
unsigned IsFilled: 1
 If false, only CommentDecl is valid. More...
 
unsigned Kind: 3
 Simplified kind of CommentDecl, see DeclKind enum. More...
 
unsigned TemplateKind: 2
 Is CommentDecl a template declaration. More...
 
unsigned IsObjCMethod: 1
 Is CommentDecl an ObjCMethodDecl. More...
 
unsigned IsInstanceMethod: 1
 Is CommentDecl a non-static member function of C++ class or instance method of ObjC class. More...
 
unsigned IsClassMethod: 1
 Is CommentDecl a static member function of C++ class or class method of ObjC class. More...
 
unsigned IsVariadic: 1
 Is CommentDecl something we consider a "function" that's variadic. More...
 

Detailed Description

Information about the declaration, useful to clients of FullComment.

Definition at line 980 of file Comment.h.

Member Enumeration Documentation

◆ DeclKind

A simplified description of CommentDecl kind that should be good enough for documentation rendering purposes.

Enumerator
OtherKind 

Everything else not explicitly mentioned below.

FunctionKind 

Something that we consider a "function":

  • function,
  • function template,
  • function template specialization,
  • member function,
  • member function template,
  • member function template specialization,
  • ObjC method,
ClassKind 

Something that we consider a "class":

  • class/struct,
  • class template,
  • class template (partial) specialization.
VariableKind 

Something that we consider a "variable":

  • namespace scope variables and variable templates;
  • static and non-static class data members and member templates;
  • enumerators.
NamespaceKind 

A C++ namespace.

TypedefKind 

A C++ typedef-name (a 'typedef' decl specifier or alias-declaration), see TypedefNameDecl.

EnumKind 

An enumeration or scoped enumeration.

Definition at line 1010 of file Comment.h.

◆ TemplateDeclKind

What kind of template specialization CommentDecl is.

Enumerator
NotTemplate 
Template 
TemplateSpecialization 
TemplatePartialSpecialization 

Definition at line 1048 of file Comment.h.

Member Function Documentation

◆ fill()

void clang::comments::DeclInfo::fill ( )

◆ getKind()

DeclKind clang::comments::DeclInfo::getKind ( ) const
inline

Definition at line 1082 of file Comment.h.

References Kind.

◆ getTemplateKind()

TemplateDeclKind clang::comments::DeclInfo::getTemplateKind ( ) const
inline

Definition at line 1086 of file Comment.h.

References TemplateKind.

◆ involvesFunctionType()

bool clang::comments::DeclInfo::involvesFunctionType ( ) const
inline

Definition at line 1090 of file Comment.h.

References clang::QualType::isNull(), and ReturnType.

Referenced by fill().

Member Data Documentation

◆ CommentDecl

const Decl* clang::comments::DeclInfo::CommentDecl

Declaration the comment is actually attached to (in the source).

Should not be NULL.

Definition at line 983 of file Comment.h.

Referenced by clang::ASTContext::cloneFullComment(), fill(), clang::comments::FullComment::getDecl(), and clang::comments::Sema::setDecl().

◆ CurrentDecl

const Decl* clang::comments::DeclInfo::CurrentDecl

CurrentDecl is the declaration with which the FullComment is associated.

It can be different from CommentDecl. It happens when we decide that the comment originally attached to CommentDecl is fine for CurrentDecl too (for example, for a redeclaration or an overrider of CommentDecl).

The information in the DeclInfo corresponds to CurrentDecl.

Definition at line 993 of file Comment.h.

Referenced by fill().

◆ IsClassMethod

unsigned clang::comments::DeclInfo::IsClassMethod

Is CommentDecl a static member function of C++ class or class method of ObjC class.

Can be true only if IsFunctionDecl is true.

Definition at line 1075 of file Comment.h.

Referenced by fill().

◆ IsFilled

unsigned clang::comments::DeclInfo::IsFilled

If false, only CommentDecl is valid.

Definition at line 1056 of file Comment.h.

Referenced by fill(), clang::comments::FullComment::getDeclInfo(), and clang::comments::Sema::setDecl().

◆ IsInstanceMethod

unsigned clang::comments::DeclInfo::IsInstanceMethod

Is CommentDecl a non-static member function of C++ class or instance method of ObjC class.

Can be true only if IsFunctionDecl is true.

Definition at line 1070 of file Comment.h.

Referenced by fill().

◆ IsObjCMethod

unsigned clang::comments::DeclInfo::IsObjCMethod

Is CommentDecl an ObjCMethodDecl.

Definition at line 1065 of file Comment.h.

Referenced by fill().

◆ IsVariadic

unsigned clang::comments::DeclInfo::IsVariadic

Is CommentDecl something we consider a "function" that's variadic.

Definition at line 1078 of file Comment.h.

Referenced by fill().

◆ Kind

unsigned clang::comments::DeclInfo::Kind

Simplified kind of CommentDecl, see DeclKind enum.

Definition at line 1059 of file Comment.h.

Referenced by fill(), and getKind().

◆ ParamVars

ArrayRef<const ParmVarDecl *> clang::comments::DeclInfo::ParamVars

Parameters that can be referenced by \param if CommentDecl is something that we consider a "function".

Definition at line 997 of file Comment.h.

Referenced by fill(), and clang::comments::ParamCommandComment::getParamName().

◆ ReturnType

QualType clang::comments::DeclInfo::ReturnType

Function return type if CommentDecl is something that we consider a "function".

Definition at line 1001 of file Comment.h.

Referenced by fill(), and involvesFunctionType().

◆ TemplateKind

unsigned clang::comments::DeclInfo::TemplateKind

Is CommentDecl a template declaration.

Definition at line 1062 of file Comment.h.

Referenced by fill(), and getTemplateKind().

◆ TemplateParameters

const TemplateParameterList* clang::comments::DeclInfo::TemplateParameters

Template parameters that can be referenced by \tparam if CommentDecl is a template (IsTemplateDecl or IsTemplatePartialSpecialization is true).

Definition at line 1006 of file Comment.h.

Referenced by clang::comments::Sema::actOnTParamCommandParamNameArg(), clang::ASTContext::cloneFullComment(), fill(), and clang::comments::TParamCommandComment::getParamName().


The documentation for this struct was generated from the following files: