clang  14.0.0git
Comment.cpp
Go to the documentation of this file.
1 //===--- Comment.cpp - Comment AST node implementation --------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "clang/AST/Comment.h"
10 #include "clang/AST/ASTContext.h"
11 #include "clang/AST/Decl.h"
12 #include "clang/AST/DeclObjC.h"
13 #include "clang/AST/DeclTemplate.h"
14 #include "clang/Basic/CharInfo.h"
15 #include "llvm/Support/ErrorHandling.h"
16 #include <type_traits>
17 
18 namespace clang {
19 namespace comments {
20 
21 // Check that no comment class has a non-trival destructor. They are allocated
22 // with a BumpPtrAllocator and therefore their destructor is not executed.
23 #define ABSTRACT_COMMENT(COMMENT)
24 #define COMMENT(CLASS, PARENT) \
25  static_assert(std::is_trivially_destructible<CLASS>::value, \
26  #CLASS " should be trivially destructible!");
27 #include "clang/AST/CommentNodes.inc"
28 #undef COMMENT
29 #undef ABSTRACT_COMMENT
30 
31 // DeclInfo is also allocated with a BumpPtrAllocator.
32 static_assert(std::is_trivially_destructible<DeclInfo>::value,
33  "DeclInfo should be trivially destructible!");
34 
35 const char *Comment::getCommentKindName() const {
36  switch (getCommentKind()) {
37  case NoCommentKind: return "NoCommentKind";
38 #define ABSTRACT_COMMENT(COMMENT)
39 #define COMMENT(CLASS, PARENT) \
40  case CLASS##Kind: \
41  return #CLASS;
42 #include "clang/AST/CommentNodes.inc"
43 #undef COMMENT
44 #undef ABSTRACT_COMMENT
45  }
46  llvm_unreachable("Unknown comment kind!");
47 }
48 
49 namespace {
50 struct good {};
51 struct bad {};
52 
53 template <typename T>
54 good implements_child_begin_end(Comment::child_iterator (T::*)() const) {
55  return good();
56 }
57 
58 LLVM_ATTRIBUTE_UNUSED
59 static inline bad implements_child_begin_end(
60  Comment::child_iterator (Comment::*)() const) {
61  return bad();
62 }
63 
64 #define ASSERT_IMPLEMENTS_child_begin(function) \
65  (void) good(implements_child_begin_end(function))
66 
67 LLVM_ATTRIBUTE_UNUSED
68 static inline void CheckCommentASTNodes() {
69 #define ABSTRACT_COMMENT(COMMENT)
70 #define COMMENT(CLASS, PARENT) \
71  ASSERT_IMPLEMENTS_child_begin(&CLASS::child_begin); \
72  ASSERT_IMPLEMENTS_child_begin(&CLASS::child_end);
73 #include "clang/AST/CommentNodes.inc"
74 #undef COMMENT
75 #undef ABSTRACT_COMMENT
76 }
77 
78 #undef ASSERT_IMPLEMENTS_child_begin
79 
80 } // end unnamed namespace
81 
83  switch (getCommentKind()) {
84  case NoCommentKind: llvm_unreachable("comment without a kind");
85 #define ABSTRACT_COMMENT(COMMENT)
86 #define COMMENT(CLASS, PARENT) \
87  case CLASS##Kind: \
88  return static_cast<const CLASS *>(this)->child_begin();
89 #include "clang/AST/CommentNodes.inc"
90 #undef COMMENT
91 #undef ABSTRACT_COMMENT
92  }
93  llvm_unreachable("Unknown comment kind!");
94 }
95 
97  switch (getCommentKind()) {
98  case NoCommentKind: llvm_unreachable("comment without a kind");
99 #define ABSTRACT_COMMENT(COMMENT)
100 #define COMMENT(CLASS, PARENT) \
101  case CLASS##Kind: \
102  return static_cast<const CLASS *>(this)->child_end();
103 #include "clang/AST/CommentNodes.inc"
104 #undef COMMENT
105 #undef ABSTRACT_COMMENT
106  }
107  llvm_unreachable("Unknown comment kind!");
108 }
109 
110 bool TextComment::isWhitespaceNoCache() const {
111  for (StringRef::const_iterator I = Text.begin(), E = Text.end();
112  I != E; ++I) {
113  if (!clang::isWhitespace(*I))
114  return false;
115  }
116  return true;
117 }
118 
119 bool ParagraphComment::isWhitespaceNoCache() const {
120  for (child_iterator I = child_begin(), E = child_end(); I != E; ++I) {
121  if (const TextComment *TC = dyn_cast<TextComment>(*I)) {
122  if (!TC->isWhitespace())
123  return false;
124  } else
125  return false;
126  }
127  return true;
128 }
129 
131  TypeLoc TL = SrcTL.IgnoreParens();
132 
133  // Look through attribute types.
134  if (AttributedTypeLoc AttributeTL = TL.getAs<AttributedTypeLoc>())
135  return AttributeTL.getModifiedLoc();
136  // Look through qualified types.
137  if (QualifiedTypeLoc QualifiedTL = TL.getAs<QualifiedTypeLoc>())
138  return QualifiedTL.getUnqualifiedLoc();
139  // Look through pointer types.
140  if (PointerTypeLoc PointerTL = TL.getAs<PointerTypeLoc>())
141  return PointerTL.getPointeeLoc().getUnqualifiedLoc();
142  // Look through reference types.
143  if (ReferenceTypeLoc ReferenceTL = TL.getAs<ReferenceTypeLoc>())
144  return ReferenceTL.getPointeeLoc().getUnqualifiedLoc();
145  // Look through adjusted types.
146  if (AdjustedTypeLoc ATL = TL.getAs<AdjustedTypeLoc>())
147  return ATL.getOriginalLoc();
148  if (BlockPointerTypeLoc BlockPointerTL = TL.getAs<BlockPointerTypeLoc>())
149  return BlockPointerTL.getPointeeLoc().getUnqualifiedLoc();
150  if (MemberPointerTypeLoc MemberPointerTL = TL.getAs<MemberPointerTypeLoc>())
151  return MemberPointerTL.getPointeeLoc().getUnqualifiedLoc();
152  if (ElaboratedTypeLoc ETL = TL.getAs<ElaboratedTypeLoc>())
153  return ETL.getNamedTypeLoc();
154 
155  return TL;
156 }
157 
158 static bool getFunctionTypeLoc(TypeLoc TL, FunctionTypeLoc &ResFTL) {
159  TypeLoc PrevTL;
160  while (PrevTL != TL) {
161  PrevTL = TL;
163  }
164 
165  if (FunctionTypeLoc FTL = TL.getAs<FunctionTypeLoc>()) {
166  ResFTL = FTL;
167  return true;
168  }
169 
172  // If we have a typedef to a template specialization with exactly one
173  // template argument of a function type, this looks like std::function,
174  // boost::function, or other function wrapper. Treat these typedefs as
175  // functions.
176  if (STL.getNumArgs() != 1)
177  return false;
178  TemplateArgumentLoc MaybeFunction = STL.getArgLoc(0);
179  if (MaybeFunction.getArgument().getKind() != TemplateArgument::Type)
180  return false;
181  TypeSourceInfo *MaybeFunctionTSI = MaybeFunction.getTypeSourceInfo();
182  TypeLoc TL = MaybeFunctionTSI->getTypeLoc().getUnqualifiedLoc();
183  if (FunctionTypeLoc FTL = TL.getAs<FunctionTypeLoc>()) {
184  ResFTL = FTL;
185  return true;
186  }
187  }
188 
189  return false;
190 }
191 
193  switch (D) {
195  return "[in]";
197  return "[out]";
199  return "[in,out]";
200  }
201  llvm_unreachable("unknown PassDirection");
202 }
203 
205  assert(!IsFilled);
206 
207  // Set defaults.
208  Kind = OtherKind;
210  IsObjCMethod = false;
211  IsInstanceMethod = false;
212  IsClassMethod = false;
213  ParamVars = None;
214  TemplateParameters = nullptr;
215 
216  if (!CommentDecl) {
217  // If there is no declaration, the defaults is our only guess.
218  IsFilled = true;
219  return;
220  }
222 
224  switch (K) {
225  default:
226  // Defaults are should be good for declarations we don't handle explicitly.
227  break;
228  case Decl::Function:
229  case Decl::CXXMethod:
230  case Decl::CXXConstructor:
231  case Decl::CXXDestructor:
232  case Decl::CXXConversion: {
233  const FunctionDecl *FD = cast<FunctionDecl>(CommentDecl);
234  Kind = FunctionKind;
235  ParamVars = FD->parameters();
236  ReturnType = FD->getReturnType();
237  unsigned NumLists = FD->getNumTemplateParameterLists();
238  if (NumLists != 0) {
241  FD->getTemplateParameterList(NumLists - 1);
242  }
243 
244  if (K == Decl::CXXMethod || K == Decl::CXXConstructor ||
245  K == Decl::CXXDestructor || K == Decl::CXXConversion) {
246  const CXXMethodDecl *MD = cast<CXXMethodDecl>(CommentDecl);
249  }
250  break;
251  }
252  case Decl::ObjCMethod: {
253  const ObjCMethodDecl *MD = cast<ObjCMethodDecl>(CommentDecl);
254  Kind = FunctionKind;
255  ParamVars = MD->parameters();
256  ReturnType = MD->getReturnType();
257  IsObjCMethod = true;
260  break;
261  }
262  case Decl::FunctionTemplate: {
263  const FunctionTemplateDecl *FTD = cast<FunctionTemplateDecl>(CommentDecl);
264  Kind = FunctionKind;
266  const FunctionDecl *FD = FTD->getTemplatedDecl();
267  ParamVars = FD->parameters();
268  ReturnType = FD->getReturnType();
270  break;
271  }
272  case Decl::ClassTemplate: {
273  const ClassTemplateDecl *CTD = cast<ClassTemplateDecl>(CommentDecl);
274  Kind = ClassKind;
277  break;
278  }
279  case Decl::ClassTemplatePartialSpecialization: {
281  cast<ClassTemplatePartialSpecializationDecl>(CommentDecl);
282  Kind = ClassKind;
285  break;
286  }
287  case Decl::ClassTemplateSpecialization:
288  Kind = ClassKind;
290  break;
291  case Decl::Record:
292  case Decl::CXXRecord:
293  Kind = ClassKind;
294  break;
295  case Decl::Var:
296  case Decl::Field:
297  case Decl::EnumConstant:
298  case Decl::ObjCIvar:
299  case Decl::ObjCAtDefsField:
300  case Decl::ObjCProperty: {
301  const TypeSourceInfo *TSI;
302  if (const auto *VD = dyn_cast<DeclaratorDecl>(CommentDecl))
303  TSI = VD->getTypeSourceInfo();
304  else if (const auto *PD = dyn_cast<ObjCPropertyDecl>(CommentDecl))
305  TSI = PD->getTypeSourceInfo();
306  else
307  TSI = nullptr;
308  if (TSI) {
309  TypeLoc TL = TSI->getTypeLoc().getUnqualifiedLoc();
310  FunctionTypeLoc FTL;
311  if (getFunctionTypeLoc(TL, FTL)) {
312  ParamVars = FTL.getParams();
313  ReturnType = FTL.getReturnLoc().getType();
314  }
315  }
316  Kind = VariableKind;
317  break;
318  }
319  case Decl::Namespace:
321  break;
322  case Decl::TypeAlias:
323  case Decl::Typedef: {
324  Kind = TypedefKind;
325  // If this is a typedef / using to something we consider a function, extract
326  // arguments and return type.
327  const TypeSourceInfo *TSI =
328  K == Decl::Typedef
329  ? cast<TypedefDecl>(CommentDecl)->getTypeSourceInfo()
330  : cast<TypeAliasDecl>(CommentDecl)->getTypeSourceInfo();
331  if (!TSI)
332  break;
333  TypeLoc TL = TSI->getTypeLoc().getUnqualifiedLoc();
334  FunctionTypeLoc FTL;
335  if (getFunctionTypeLoc(TL, FTL)) {
336  Kind = FunctionKind;
337  ParamVars = FTL.getParams();
338  ReturnType = FTL.getReturnLoc().getType();
339  }
340  break;
341  }
342  case Decl::TypeAliasTemplate: {
343  const TypeAliasTemplateDecl *TAT = cast<TypeAliasTemplateDecl>(CommentDecl);
344  Kind = TypedefKind;
347  TypeAliasDecl *TAD = TAT->getTemplatedDecl();
348  if (!TAD)
349  break;
350 
351  const TypeSourceInfo *TSI = TAD->getTypeSourceInfo();
352  if (!TSI)
353  break;
354  TypeLoc TL = TSI->getTypeLoc().getUnqualifiedLoc();
355  FunctionTypeLoc FTL;
356  if (getFunctionTypeLoc(TL, FTL)) {
357  Kind = FunctionKind;
358  ParamVars = FTL.getParams();
359  ReturnType = FTL.getReturnLoc().getType();
360  }
361  break;
362  }
363  case Decl::Enum:
364  Kind = EnumKind;
365  break;
366  }
367 
368  IsFilled = true;
369 }
370 
371 StringRef ParamCommandComment::getParamName(const FullComment *FC) const {
372  assert(isParamIndexValid());
373  if (isVarArgParam())
374  return "...";
375  return FC->getDeclInfo()->ParamVars[getParamIndex()]->getName();
376 }
377 
379  assert(isPositionValid());
381  for (unsigned i = 0, e = getDepth(); i != e; ++i) {
382  assert(TPL && "Unknown TemplateParameterList");
383  if (i == e - 1)
384  return TPL->getParam(getIndex(i))->getName();
385  const NamedDecl *Param = TPL->getParam(getIndex(i));
386  if (auto *TTP = dyn_cast<TemplateTemplateParmDecl>(Param))
387  TPL = TTP->getTemplateParameters();
388  }
389  return "";
390 }
391 
392 } // end namespace comments
393 } // end namespace clang
394 
clang::comments::DeclInfo::EnumKind
@ EnumKind
An enumeration or scoped enumeration.
Definition: Comment.h:1046
clang::comments::ParamCommandComment::getDirectionAsString
static const char * getDirectionAsString(PassDirection D)
Definition: Comment.cpp:192
clang::TemplateSpecializationTypeLoc
Definition: TypeLoc.h:1573
clang::comments::TParamCommandComment::isPositionValid
bool isPositionValid() const LLVM_READONLY
Definition: Comment.h:842
clang::comments::DeclInfo::NamespaceKind
@ NamespaceKind
A C++ namespace.
Definition: Comment.h:1039
clang::comments::ParamCommandComment::Out
@ Out
Definition: Comment.h:739
clang::comments::Comment::NoCommentKind
@ NoCommentKind
Definition: Comment.h:187
clang::FunctionTypeLoc::getParams
ArrayRef< ParmVarDecl * > getParams() const
Definition: TypeLoc.h:1416
clang::FunctionDecl::getReturnType
QualType getReturnType() const
Definition: Decl.h:2537
clang::BlockPointerTypeLoc
Wrapper for source info for block pointers.
Definition: TypeLoc.h:1238
clang::comments::ParamCommandComment::isParamIndexValid
bool isParamIndexValid() const LLVM_READONLY
Definition: Comment.h:772
clang::PointerTypeLoc
Wrapper for source info for pointers.
Definition: TypeLoc.h:1225
clang::ClassTemplatePartialSpecializationDecl::getTemplateParameters
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Definition: DeclTemplate.h:2132
clang::ReferenceTypeLoc
Definition: TypeLoc.h:1306
clang::comments::DeclInfo::ParamVars
ArrayRef< const ParmVarDecl * > ParamVars
Parameters that can be referenced by \param if CommentDecl is something that we consider a "function"...
Definition: Comment.h:997
clang::comments::ParagraphComment::child_begin
child_iterator child_begin() const
Definition: Comment.h:572
clang::NamedDecl
This represents a decl that may have a name.
Definition: Decl.h:249
clang::TypedefNameDecl::getTypeSourceInfo
TypeSourceInfo * getTypeSourceInfo() const
Definition: Decl.h:3230
clang::comments::DeclInfo::TemplatePartialSpecialization
@ TemplatePartialSpecialization
Definition: Comment.h:1054
clang::comments::TParamCommandComment::getDepth
unsigned getDepth() const
Definition: Comment.h:846
clang::comments::TParamCommandComment::getIndex
unsigned getIndex(unsigned Depth) const
Definition: Comment.h:851
clang::comments::DeclInfo::IsFilled
unsigned IsFilled
If false, only CommentDecl is valid.
Definition: Comment.h:1058
clang::ClassTemplatePartialSpecializationDecl
Definition: DeclTemplate.h:2075
clang::comments::Comment::getCommentKindName
const char * getCommentKindName() const
Definition: Comment.cpp:35
clang::TemplateArgumentLoc::getTypeSourceInfo
TypeSourceInfo * getTypeSourceInfo() const
Definition: TemplateBase.h:515
clang::comments::DeclInfo::CommentDecl
const Decl * CommentDecl
Declaration the comment is actually attached to (in the source).
Definition: Comment.h:983
Decl.h
DeclObjC.h
clang::comments::DeclInfo::CurrentDecl
const Decl * CurrentDecl
CurrentDecl is the declaration with which the FullComment is associated.
Definition: Comment.h:993
clang::FunctionTypeLoc
Wrapper for source info for functions.
Definition: TypeLoc.h:1350
clang::TypeAliasTemplateDecl::getTemplatedDecl
TypeAliasDecl * getTemplatedDecl() const
Get the underlying function declaration of the template.
Definition: DeclTemplate.h:2541
clang::FunctionTemplateDecl
Declaration of a template function.
Definition: DeclTemplate.h:978
clang::Decl::Kind
Kind
Lists the kind of concrete classes of Decl.
Definition: DeclBase.h:92
clang::TemplateArgument::getKind
ArgKind getKind() const
Return the kind of stored template argument.
Definition: TemplateBase.h:245
clang::TemplateParameterList::getParam
NamedDecl * getParam(unsigned Idx)
Definition: DeclTemplate.h:138
DeclTemplate.h
clang::DeclaratorDecl::getTemplateParameterList
TemplateParameterList * getTemplateParameterList(unsigned index) const
Definition: Decl.h:820
clang::QualifiedTypeLoc
Wrapper of type source information for a type with non-trivial direct qualifiers.
Definition: TypeLoc.h:277
clang::CXXMethodDecl::isInstance
bool isInstance() const
Definition: DeclCXX.h:1975
clang::Decl::getKind
Kind getKind() const
Definition: DeclBase.h:433
clang::comments::getFunctionTypeLoc
static bool getFunctionTypeLoc(TypeLoc TL, FunctionTypeLoc &ResFTL)
Definition: Comment.cpp:158
clang::comments::DeclInfo::TypedefKind
@ TypedefKind
A C++ typedef-name (a 'typedef' decl specifier or alias-declaration), see TypedefNameDecl.
Definition: Comment.h:1043
clang::comments::Comment::child_begin
child_iterator child_begin() const
Definition: Comment.cpp:82
clang::comments::lookThroughTypedefOrTypeAliasLocs
static TypeLoc lookThroughTypedefOrTypeAliasLocs(TypeLoc &SrcTL)
Definition: Comment.cpp:130
clang::comments::ParamCommandComment::In
@ In
Definition: Comment.h:738
clang::comments::FullComment
A full comment attached to a declaration, contains block content.
Definition: Comment.h:1091
clang::TemplateArgumentLoc
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:458
clang::comments::DeclInfo::OtherKind
@ OtherKind
Everything else not explicitly mentioned below.
Definition: Comment.h:1012
ASTContext.h
clang::TemplateArgumentLoc::getArgument
const TemplateArgument & getArgument() const
Definition: TemplateBase.h:507
clang::ObjCMethodDecl::getReturnType
QualType getReturnType() const
Definition: DeclObjC.h:332
clang::comments::DeclInfo::TemplateParameters
const TemplateParameterList * TemplateParameters
Template parameters that can be referenced by \tparam if CommentDecl is a template (IsTemplateDecl or...
Definition: Comment.h:1006
clang::comments::ParamCommandComment::isVarArgParam
bool isVarArgParam() const LLVM_READONLY
Definition: Comment.h:776
clang::comments::DeclInfo::FunctionKind
@ FunctionKind
Something that we consider a "function":
Definition: Comment.h:1024
clang::TemplateParameterList
Stores a list of template parameters for a TemplateDecl and its derived classes.
Definition: DeclTemplate.h:69
clang::comments::DeclInfo::Template
@ Template
Definition: Comment.h:1052
clang::comments::DeclInfo::fill
void fill()
Definition: Comment.cpp:204
clang::AttributedTypeLoc
Type source information for an attributed type.
Definition: TypeLoc.h:850
clang::comments::ParamCommandComment::InOut
@ InOut
Definition: Comment.h:740
clang::MemberPointerTypeLoc
Wrapper for source info for member pointers.
Definition: TypeLoc.h:1255
clang::AdjustedTypeLoc
Definition: TypeLoc.h:1158
clang::comments::DeclInfo::IsObjCMethod
unsigned IsObjCMethod
Is CommentDecl an ObjCMethodDecl.
Definition: Comment.h:1067
clang::TemplateDecl::getTemplateParameters
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Definition: DeclTemplate.h:418
clang::comments::DeclInfo::TemplateKind
unsigned TemplateKind
Is CommentDecl a template declaration.
Definition: Comment.h:1064
clang::comments::ParamCommandComment::getParamName
StringRef getParamName(const FullComment *FC) const
Definition: Comment.cpp:371
clang::isWhitespace
LLVM_READONLY bool isWhitespace(unsigned char c)
Return true if this character is horizontal or vertical ASCII whitespace: ' ', '\t',...
Definition: CharInfo.h:92
clang::comments::DeclInfo::IsInstanceMethod
unsigned IsInstanceMethod
Is CommentDecl a non-static member function of C++ class or instance method of ObjC class.
Definition: Comment.h:1072
clang::comments::ParagraphComment::child_end
child_iterator child_end() const
Definition: Comment.h:576
CharInfo.h
clang::comments::DeclInfo::VariableKind
@ VariableKind
Something that we consider a "variable":
Definition: Comment.h:1036
clang::TypeLoc::getUnqualifiedLoc
UnqualTypeLoc getUnqualifiedLoc() const
Skips past any qualifiers, if this is qualified.
Definition: TypeLoc.h:326
clang::ClassTemplateDecl
Declaration of a class template.
Definition: DeclTemplate.h:2247
clang::comments::DeclInfo::Kind
unsigned Kind
Simplified kind of CommentDecl, see DeclKind enum.
Definition: Comment.h:1061
clang::TypeLoc::getAs
T getAs() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
Definition: TypeLoc.h:88
clang::TypeLoc
Base wrapper for a particular "section" of type source info.
Definition: TypeLoc.h:58
clang::ObjCMethodDecl::isInstanceMethod
bool isInstanceMethod() const
Definition: DeclObjC.h:431
clang::comments::FullComment::getDeclInfo
const DeclInfo * getDeclInfo() const LLVM_READONLY
Definition: Comment.h:1123
clang::TypeLoc::getType
QualType getType() const
Get the type for which this source info wrapper provides information.
Definition: TypeLoc.h:132
clang::comments::ParamCommandComment::PassDirection
PassDirection
Definition: Comment.h:737
clang::FunctionTemplateDecl::getTemplatedDecl
FunctionDecl * getTemplatedDecl() const
Get the underlying function declaration of the template.
Definition: DeclTemplate.h:1033
clang::ElaboratedTypeLoc
Definition: TypeLoc.h:2198
clang::TypeLoc::IgnoreParens
TypeLoc IgnoreParens() const
Definition: TypeLoc.h:1150
clang::ObjCMethodDecl
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:139
clang::comments::DeclInfo::TemplateSpecialization
@ TemplateSpecialization
Definition: Comment.h:1053
clang::TemplateArgument::Type
@ Type
The template argument is a type.
Definition: TemplateBase.h:71
clang
Definition: CalledOnceCheck.h:17
clang::comments::ParamCommandComment::getParamIndex
unsigned getParamIndex() const LLVM_READONLY
Definition: Comment.h:785
Comment.h
clang::TypeSourceInfo
A container of type source information.
Definition: Type.h:6396
clang::comments::DeclInfo::ClassKind
@ ClassKind
Something that we consider a "class":
Definition: Comment.h:1030
clang::TypeAliasTemplateDecl
Declaration of an alias template.
Definition: DeclTemplate.h:2520
clang::FunctionTypeLoc::getReturnLoc
TypeLoc getReturnLoc() const
Definition: TypeLoc.h:1434
clang::DeclaratorDecl::getNumTemplateParameterLists
unsigned getNumTemplateParameterLists() const
Definition: Decl.h:816
clang::comments::DeclInfo::ReturnType
QualType ReturnType
Function return type if CommentDecl is something that we consider a "function".
Definition: Comment.h:1001
clang::ObjCMethodDecl::parameters
ArrayRef< ParmVarDecl * > parameters() const
Definition: DeclObjC.h:376
clang::comments::Comment::child_iterator
Comment *const * child_iterator
Definition: Comment.h:222
clang::TypeAliasDecl
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Definition: Decl.h:3302
clang::comments::DeclInfo::IsClassMethod
unsigned IsClassMethod
Is CommentDecl a static member function of C++ class or class method of ObjC class.
Definition: Comment.h:1077
clang::FunctionDecl::parameters
ArrayRef< ParmVarDecl * > parameters() const
Definition: Decl.h:2483
clang::FunctionDecl
Represents a function declaration or definition.
Definition: Decl.h:1856
clang::comments::Comment::child_end
child_iterator child_end() const
Definition: Comment.cpp:96
clang::comments::Comment::getCommentKind
CommentKind getCommentKind() const
Definition: Comment.h:204
clang::TypeSourceInfo::getTypeLoc
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
Definition: TypeLoc.h:244
clang::CXXMethodDecl
Represents a static or instance method of a struct/union/class.
Definition: DeclCXX.h:1948
clang::comments::TParamCommandComment::getParamName
StringRef getParamName(const FullComment *FC) const
Definition: Comment.cpp:378
clang::comments::DeclInfo::NotTemplate
@ NotTemplate
Definition: Comment.h:1051
clang::NamedDecl::getName
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
Definition: Decl.h:276