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" 26 class TemplateParameterList;
75 unsigned HasTrailingNewline : 1;
85 mutable unsigned IsWhitespaceValid : 1;
88 mutable unsigned IsWhitespace : 1;
97 unsigned RenderKind : 3;
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)) {
249 return C->
getCommentKind() >= FirstInlineContentCommentConstant &&
295 bool isWhitespaceNoCache()
const;
363 return Args[Idx].Text;
367 return Args[Idx].Range;
386 TagNameRange(TagNameBegin, TagNameEnd) {
397 StringRef
getTagName() const LLVM_READONLY {
return TagName; }
430 NameLocBegin(NameLocBegin), Name(Name),
438 NameLocBegin(NameLocBegin), Name(Name),
439 EqualsLoc(EqualsLoc),
440 ValueRange(ValueRange), Value(Value)
459 LocBegin, LocBegin.getLocWithOffset(1 + TagName.size()),
461 LocBegin.getLocWithOffset(1),
462 LocBegin.getLocWithOffset(1 + TagName.size())) {
475 return Attributes.size();
479 return Attributes[Idx];
484 if (!Attrs.empty()) {
517 LocBegin.getLocWithOffset(2),
518 LocBegin.getLocWithOffset(2 + TagName.size()))
557 if (Content.empty()) {
566 Content.back()->getEndLoc()));
592 bool isWhitespaceNoCache()
const;
665 StringRef Name = getCommandName(Traits);
675 return Args[Idx].Text;
679 return Args[Idx].Range;
684 if (Args.size() > 0) {
720 InvalidParamIndex = ~0U,
721 VarArgParamIndex = ~0U - 1U
729 CommandID, CommandMarker),
730 ParamIndex(InvalidParamIndex) {
761 return getNumArgs() > 0;
764 StringRef getParamName(
const FullComment *FC)
const;
771 return Args[0].Range;
775 return ParamIndex != InvalidParamIndex;
779 return ParamIndex == VarArgParamIndex;
783 ParamIndex = VarArgParamIndex;
784 assert(isParamIndexValid());
788 assert(isParamIndexValid());
789 assert(!isVarArgParam());
795 assert(isParamIndexValid());
796 assert(!isVarArgParam());
831 return getNumArgs() > 0;
834 StringRef getParamName(
const FullComment *FC)
const;
841 return Args[0].Range;
845 return !Position.empty();
849 assert(isPositionValid());
850 return Position.size();
854 assert(isPositionValid());
855 return Position[
Depth];
859 Position = NewPosition;
860 assert(isPositionValid());
871 Comment(VerbatimBlockLineCommentKind,
873 LocBegin.getLocWithOffset(Text.size())),
902 unsigned CommandID) :
904 LocBegin, LocEnd, CommandID,
922 CloseNameLocBegin = LocBegin;
938 return Lines[LineIdx]->getText();
1056 TemplatePartialSpecialization
1100 Blocks(Blocks), ThisDeclInfo(D) {
1105 SourceRange(Blocks.front()->getBeginLoc(), Blocks.back()->getEndLoc()));
1127 ThisDeclInfo->
fill();
1128 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.