16 #include "llvm/Support/ErrorHandling.h"
17 #include "llvm/Support/raw_ostream.h"
25 #define ABSTRACT_COMMENT(COMMENT)
26 #define COMMENT(CLASS, PARENT) \
29 #include "clang/AST/CommentNodes.inc"
31 #undef ABSTRACT_COMMENT
33 llvm_unreachable(
"Unknown comment kind!");
46 static inline bad implements_child_begin_end(
51 #define ASSERT_IMPLEMENTS_child_begin(function) \
52 (void) good(implements_child_begin_end(function))
55 static inline void CheckCommentASTNodes() {
56 #define ABSTRACT_COMMENT(COMMENT)
57 #define COMMENT(CLASS, PARENT) \
58 ASSERT_IMPLEMENTS_child_begin(&CLASS::child_begin); \
59 ASSERT_IMPLEMENTS_child_begin(&CLASS::child_end);
60 #include "clang/AST/CommentNodes.inc"
62 #undef ABSTRACT_COMMENT
65 #undef ASSERT_IMPLEMENTS_child_begin
71 case NoCommentKind: llvm_unreachable(
"comment without a kind");
72 #define ABSTRACT_COMMENT(COMMENT)
73 #define COMMENT(CLASS, PARENT) \
75 return static_cast<const CLASS *>(this)->child_begin();
76 #include "clang/AST/CommentNodes.inc"
78 #undef ABSTRACT_COMMENT
80 llvm_unreachable(
"Unknown comment kind!");
85 case NoCommentKind: llvm_unreachable(
"comment without a kind");
86 #define ABSTRACT_COMMENT(COMMENT)
87 #define COMMENT(CLASS, PARENT) \
89 return static_cast<const CLASS *>(this)->child_end();
90 #include "clang/AST/CommentNodes.inc"
92 #undef ABSTRACT_COMMENT
94 llvm_unreachable(
"Unknown comment kind!");
97 bool TextComment::isWhitespaceNoCache()
const {
98 for (StringRef::const_iterator I = Text.begin(), E = Text.end();
106 bool ParagraphComment::isWhitespaceNoCache()
const {
108 if (
const TextComment *TC = dyn_cast<TextComment>(*I)) {
109 if (!TC->isWhitespace())
126 llvm_unreachable(
"unknown PassDirection");
154 case Decl::CXXMethod:
155 case Decl::CXXConstructor:
156 case Decl::CXXDestructor:
157 case Decl::CXXConversion: {
169 if (K == Decl::CXXMethod || K == Decl::CXXConstructor ||
170 K == Decl::CXXDestructor || K == Decl::CXXConversion) {
177 case Decl::ObjCMethod: {
187 case Decl::FunctionTemplate: {
197 case Decl::ClassTemplate: {
204 case Decl::ClassTemplatePartialSpecialization: {
206 cast<ClassTemplatePartialSpecializationDecl>(
CommentDecl);
212 case Decl::ClassTemplateSpecialization:
217 case Decl::CXXRecord:
222 case Decl::EnumConstant:
224 case Decl::ObjCAtDefsField:
227 case Decl::Namespace:
230 case Decl::Typedef: {
258 TL = ATL.getOriginalLoc();
272 TL = ETL.getNamedTypeLoc();
288 if (STL.getNumArgs() != 1)
306 case Decl::TypeAlias:
309 case Decl::TypeAliasTemplate: {
334 for (
unsigned i = 0, e =
getDepth(); i != e; ++i) {
339 dyn_cast<TemplateTemplateParmDecl>(Param))
340 TPL = TTP->getTemplateParameters();
param_const_iterator param_begin() const
Defines the clang::ASTContext interface.
T getAs() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
StringRef getName() const
static LLVM_READONLY bool isWhitespace(unsigned char c)
Defines the C++ template declaration subclasses.
NamedDecl * getParam(unsigned Idx)
A container of type source information.
Wrapper for source info for member pointers.
Wrapper of type source information for a type with non-trivial direct qualifiers. ...
Stores a list of template parameters for a TemplateDecl and its derived classes.
unsigned param_size() const
Base wrapper for a particular "section" of type source info.
QualType getReturnType() const
FunctionDecl * getTemplatedDecl() const
Get the underlying function declaration of the template.
TypeSourceInfo * getTypeSourceInfo() const
Wrapper for source info for functions.
param_iterator param_begin()
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
ArgKind getKind() const
Return the kind of stored template argument.
bool isInstanceMethod() const
Declaration of an alias template.
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
unsigned getNumParams() const
Represents a static or instance method of a struct/union/class.
QualType getReturnType() const
TypeLoc IgnoreParens() const
The template argument is a type.
Declaration of a class template.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Kind
Lists the kind of concrete classes of Decl.
TemplateParameterList * getTemplateParameterList(unsigned index) const
UnqualTypeLoc getUnqualifiedLoc() const
Skips past any qualifiers, if this is qualified.
TypeSourceInfo * getTypeSourceInfo() const
const TemplateArgument & getArgument() const
Wrapper for source info for pointers.
Wrapper for source info for block pointers.
Declaration of a template function.
unsigned getNumTemplateParameterLists() const