14 #ifndef LLVM_CLANG_AST_COMMENT_H 15 #define LLVM_CLANG_AST_COMMENT_H 21 #include "llvm/ADT/ArrayRef.h" 22 #include "llvm/ADT/StringRef.h" 27 class TemplateParameterList;
76 unsigned HasTrailingNewline : 1;
86 mutable unsigned IsWhitespaceValid : 1;
89 mutable unsigned IsWhitespace : 1;
98 unsigned RenderKind : 2;
110 unsigned IsMalformed : 1;
121 unsigned IsSelfClosing : 1;
131 mutable unsigned IsWhitespaceValid : 1;
134 mutable unsigned IsWhitespace : 1;
147 unsigned CommandMarker : 1;
150 CommandInfo::NumCommandIDBits + 1 };
158 unsigned Direction : 2;
161 unsigned IsDirectionExplicit : 1;
188 #define COMMENT(CLASS, PARENT) CLASS##Kind, 189 #define COMMENT_RANGE(BASE, FIRST, LAST) \ 190 First##BASE##Constant=FIRST##Kind, Last##BASE##Constant=LAST##Kind, 191 #define LAST_COMMENT_RANGE(BASE, FIRST, LAST) \ 192 First##BASE##Constant=FIRST##Kind, Last##BASE##Constant=LAST##Kind 193 #define ABSTRACT_COMMENT(COMMENT) 194 #include "clang/AST/CommentNodes.inc" 200 Loc(LocBegin), Range(
SourceRange(LocBegin, LocEnd)) {
253 return C->
getCommentKind() >= FirstInlineContentCommentConstant &&
299 bool isWhitespaceNoCache()
const;
367 return Args[Idx].Text;
371 return Args[Idx].Range;
390 TagNameRange(TagNameBegin, TagNameEnd) {
401 StringRef
getTagName() const LLVM_READONLY {
return TagName; }
434 NameLocBegin(NameLocBegin), Name(Name),
442 NameLocBegin(NameLocBegin), Name(Name),
443 EqualsLoc(EqualsLoc),
444 ValueRange(ValueRange), Value(Value)
463 LocBegin, LocBegin.getLocWithOffset(1 + TagName.size()),
465 LocBegin.getLocWithOffset(1),
466 LocBegin.getLocWithOffset(1 + TagName.size())) {
479 return Attributes.size();
483 return Attributes[Idx];
488 if (!Attrs.empty()) {
521 LocBegin.getLocWithOffset(2),
522 LocBegin.getLocWithOffset(2 + TagName.size()))
561 if (Content.empty()) {
570 Content.back()->getLocEnd()));
596 bool isWhitespaceNoCache()
const;
669 StringRef Name = getCommandName(Traits);
679 return Args[Idx].Text;
683 return Args[Idx].Range;
688 if (Args.size() > 0) {
724 InvalidParamIndex = ~0U,
725 VarArgParamIndex = ~0U - 1U
733 CommandID, CommandMarker),
734 ParamIndex(InvalidParamIndex) {
765 return getNumArgs() > 0;
768 StringRef getParamName(
const FullComment *FC)
const;
775 return Args[0].Range;
779 return ParamIndex != InvalidParamIndex;
783 return ParamIndex == VarArgParamIndex;
787 ParamIndex = VarArgParamIndex;
788 assert(isParamIndexValid());
792 assert(isParamIndexValid());
793 assert(!isVarArgParam());
799 assert(isParamIndexValid());
800 assert(!isVarArgParam());
835 return getNumArgs() > 0;
838 StringRef getParamName(
const FullComment *FC)
const;
845 return Args[0].Range;
849 return !Position.empty();
853 assert(isPositionValid());
854 return Position.size();
858 assert(isPositionValid());
859 return Position[
Depth];
863 Position = NewPosition;
864 assert(isPositionValid());
875 Comment(VerbatimBlockLineCommentKind,
877 LocBegin.getLocWithOffset(Text.size())),
906 unsigned CommandID) :
908 LocBegin, LocEnd, CommandID,
926 CloseNameLocBegin = LocBegin;
942 return Lines[LineIdx]->getText();
1060 TemplatePartialSpecialization
1104 Blocks(Blocks), ThisDeclInfo(D) {
1109 Blocks.back()->getLocEnd()));
1131 ThisDeclInfo->
fill();
1132 return ThisDeclInfo;
SourceLocation getLocWithOffset(int Offset) const
Return a source location with the specified offset from this SourceLocation.
A (possibly-)qualified type.
C Language Family Type Representation.
Decl - This represents one declaration (or definition), e.g.
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
Stores a list of template parameters for a TemplateDecl and its derived classes.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
SourceLocation getEnd() const
Encodes a location in the source.
Dataflow Directional Tag Classes.
bool isValid() const
Return true if this is a valid SourceLocation object.
Defines the clang::SourceLocation class and associated facilities.
void setEnd(SourceLocation e)
A trivial tuple used to represent a source range.
SourceLocation getBegin() const
This class handles loading and caching of source files into memory.
Attr - This represents one attribute.