13#ifndef LLVM_CLANG_AST_COMMENT_H
14#define LLVM_CLANG_AST_COMMENT_H
20#include "llvm/ADT/ArrayRef.h"
21#include "llvm/ADT/StringRef.h"
22#include "llvm/Support/Compiler.h"
55#define COMMENT(CLASS, PARENT) CLASS,
56#define COMMENT_RANGE(BASE, FIRST, LAST) \
57 First##BASE##Constant = FIRST, Last##BASE##Constant = LAST,
58#define LAST_COMMENT_RANGE(BASE, FIRST, LAST) \
59 First##BASE##Constant = FIRST, Last##BASE##Constant = LAST
60#define ABSTRACT_COMMENT(COMMENT)
61#include "clang/AST/CommentNodes.inc"
91 LLVM_PREFERRED_TYPE(
bool)
92 unsigned HasTrailingNewline : 1;
103 LLVM_PREFERRED_TYPE(
bool)
104 mutable unsigned IsWhitespaceValid : 1;
107 LLVM_PREFERRED_TYPE(
bool)
108 mutable unsigned IsWhitespace : 1;
119 unsigned RenderKind : 3;
127 unsigned CommandMarker : 1;
139 LLVM_PREFERRED_TYPE(
bool)
140 unsigned IsMalformed : 1;
152 LLVM_PREFERRED_TYPE(
bool)
153 unsigned IsSelfClosing : 1;
164 LLVM_PREFERRED_TYPE(
bool)
165 mutable unsigned IsWhitespaceValid : 1;
168 LLVM_PREFERRED_TYPE(
bool)
169 mutable unsigned IsWhitespace : 1;
185 unsigned CommandMarker : 1;
198 unsigned Direction : 2;
201 LLVM_PREFERRED_TYPE(
bool)
202 unsigned IsDirectionExplicit : 1;
282 return C->getCommentKind() >=
283 CommentKind::FirstInlineContentCommentConstant &&
284 C->getCommentKind() <= CommentKind::LastInlineContentCommentConstant;
308 return C->getCommentKind() == CommentKind::TextComment;
315 StringRef
getText() const LLVM_READONLY {
return Text; }
327 bool isWhitespaceNoCache()
const;
359 return C->getCommentKind() == CommentKind::InlineCommandComment;
388 return Args[Idx].Text;
392 return Args[Idx].Range;
423 return C->getCommentKind() >= CommentKind::FirstHTMLTagCommentConstant &&
424 C->getCommentKind() <= CommentKind::LastHTMLTagCommentConstant;
483 LocBegin.getLocWithOffset(1),
484 LocBegin.getLocWithOffset(1 +
TagName.size())) {
489 return C->getCommentKind() == CommentKind::HTMLStartTagComment;
497 return Attributes.size();
501 return Attributes[Idx];
506 if (!Attrs.empty()) {
518 Range.setEnd(GreaterLoc);
536 TagName, LocBegin.getLocWithOffset(2),
537 LocBegin.getLocWithOffset(2 +
TagName.size())) {}
540 return C->getCommentKind() == CommentKind::HTMLEndTagComment;
560 return C->getCommentKind() >=
561 CommentKind::FirstBlockContentCommentConstant &&
562 C->getCommentKind() <= CommentKind::LastBlockContentCommentConstant;
575 if (Content.empty()) {
576 ParagraphCommentBits.IsWhitespace = true;
577 ParagraphCommentBits.IsWhitespaceValid = true;
584 Content.back()->getEndLoc()));
589 return C->getCommentKind() == CommentKind::ParagraphComment;
610 bool isWhitespaceNoCache()
const;
647 return C->getCommentKind() >=
648 CommentKind::FirstBlockCommandCommentConstant &&
649 C->getCommentKind() <= CommentKind::LastBlockCommandCommentConstant;
683 return Args[Idx].Text;
687 return Args[Idx].Range;
692 if (
Args.size() > 0) {
737 CommandID, CommandMarker),
745 return C->getCommentKind() == CommentKind::ParamCommandComment;
775 return Args[0].Range;
825 CommandID, CommandMarker) {}
828 return C->getCommentKind() == CommentKind::TParamCommandComment;
842 return Args[0].Range;
846 return !Position.empty();
851 return Position.size();
856 return Position[Depth];
860 Position = NewPosition;
872 LocBegin.getLocWithOffset(Text.size())),
876 return C->getCommentKind() == CommentKind::VerbatimBlockLineComment;
906 return C->getCommentKind() == CommentKind::VerbatimBlockComment;
935 return Lines[LineIdx]->getText();
957 return C->getCommentKind() == CommentKind::VerbatimLineComment;
1052 LLVM_PREFERRED_TYPE(
bool)
1064 LLVM_PREFERRED_TYPE(
bool)
1070 LLVM_PREFERRED_TYPE(
bool)
1076 LLVM_PREFERRED_TYPE(
bool)
1080 LLVM_PREFERRED_TYPE(
bool)
1104 Blocks(Blocks), ThisDeclInfo(D) {
1109 SourceRange(Blocks.front()->getBeginLoc(), Blocks.back()->getEndLoc()));
1114 return C->getCommentKind() == CommentKind::FullComment;
1126 return ThisDeclInfo->CommentDecl;
1130 if (!ThisDeclInfo->IsFilled)
1131 ThisDeclInfo->
fill();
1132 return ThisDeclInfo;
Defines the clang::SourceLocation class and associated facilities.
C Language Family Type Representation.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Attr - This represents one attribute.
Decl - This represents one declaration (or definition), e.g.
Represents a parameter to a function.
A (possibly-)qualified type.
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
SourceLocation getLocWithOffset(IntTy Offset) const
Return a source location with the specified offset from this SourceLocation.
A trivial tuple used to represent a source range.
Stores a list of template parameters for a TemplateDecl and its derived classes.
The JSON file list parser is used to communicate input to InstallAPI.
nullptr
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...