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)
309 case Decl::TypeAliasTemplate: {
334 for (
unsigned i = 0, e =
getDepth(); i != e; ++i) {
339 dyn_cast<TemplateTemplateParmDecl>(Param))
340 TPL = TTP->getTemplateParameters();
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...
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
StringRef getName() const
getName - Get the name of identifier for this declaration as a StringRef.
static LLVM_READONLY bool isWhitespace(unsigned char c)
Return true if this character is horizontal or vertical ASCII whitespace: ' ', '\t', '\f', '\v', '\n', '\r'.
TypedefDecl - Represents the declaration of a typedef-name via the 'typedef' type specifier...
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. ...
ObjCMethodDecl - Represents an instance or class method declaration.
Stores a list of template parameters for a TemplateDecl and its derived classes.
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.
detail::InMemoryDirectory::const_iterator I
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.
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
ArrayRef< ParmVarDecl * > parameters() const
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
Represents a static or instance method of a struct/union/class.
ArrayRef< ParmVarDecl * > parameters() const
QualType getReturnType() const
unsigned TypeAlias
Whether this template specialization type is a substituted type alias.
TypeLoc IgnoreParens() const
detail::InMemoryDirectory::const_iterator E
Location wrapper for a TemplateArgument.
The template argument is a type.
Declaration of a class template.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
TemplateParameterList * getTemplateParameterList(unsigned index) const
UnqualTypeLoc getUnqualifiedLoc() const
Skips past any qualifiers, if this is qualified.
NamedDecl - This represents a decl with a name.
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