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 : 2;
109 unsigned IsMalformed : 1;
120 unsigned IsSelfClosing : 1;
130 mutable unsigned IsWhitespaceValid : 1;
133 mutable unsigned IsWhitespace : 1;
146 unsigned CommandMarker : 1;
149 CommandInfo::NumCommandIDBits + 1 };
157 unsigned Direction : 2;
160 unsigned IsDirectionExplicit : 1;
187 #define COMMENT(CLASS, PARENT) CLASS##Kind, 188 #define COMMENT_RANGE(BASE, FIRST, LAST) \ 189 First##BASE##Constant=FIRST##Kind, Last##BASE##Constant=LAST##Kind, 190 #define LAST_COMMENT_RANGE(BASE, FIRST, LAST) \ 191 First##BASE##Constant=FIRST##Kind, Last##BASE##Constant=LAST##Kind 192 #define ABSTRACT_COMMENT(COMMENT) 193 #include "clang/AST/CommentNodes.inc" 199 Loc(LocBegin), Range(
SourceRange(LocBegin, LocEnd)) {
248 return C->
getCommentKind() >= FirstInlineContentCommentConstant &&
294 bool isWhitespaceNoCache()
const;
361 return Args[Idx].Text;
365 return Args[Idx].Range;
384 TagNameRange(TagNameBegin, TagNameEnd) {
395 StringRef
getTagName() const LLVM_READONLY {
return TagName; }
428 NameLocBegin(NameLocBegin), Name(Name),
436 NameLocBegin(NameLocBegin), Name(Name),
437 EqualsLoc(EqualsLoc),
438 ValueRange(ValueRange), Value(Value)
457 LocBegin, LocBegin.getLocWithOffset(1 + TagName.size()),
459 LocBegin.getLocWithOffset(1),
460 LocBegin.getLocWithOffset(1 + TagName.size())) {
473 return Attributes.size();
477 return Attributes[Idx];
482 if (!Attrs.empty()) {
515 LocBegin.getLocWithOffset(2),
516 LocBegin.getLocWithOffset(2 + TagName.size()))
555 if (Content.empty()) {
564 Content.back()->getEndLoc()));
590 bool isWhitespaceNoCache()
const;
663 StringRef Name = getCommandName(Traits);
673 return Args[Idx].Text;
677 return Args[Idx].Range;
682 if (Args.size() > 0) {
718 InvalidParamIndex = ~0U,
719 VarArgParamIndex = ~0U - 1U
727 CommandID, CommandMarker),
728 ParamIndex(InvalidParamIndex) {
759 return getNumArgs() > 0;
762 StringRef getParamName(
const FullComment *FC)
const;
769 return Args[0].Range;
773 return ParamIndex != InvalidParamIndex;
777 return ParamIndex == VarArgParamIndex;
781 ParamIndex = VarArgParamIndex;
782 assert(isParamIndexValid());
786 assert(isParamIndexValid());
787 assert(!isVarArgParam());
793 assert(isParamIndexValid());
794 assert(!isVarArgParam());
829 return getNumArgs() > 0;
832 StringRef getParamName(
const FullComment *FC)
const;
839 return Args[0].Range;
843 return !Position.empty();
847 assert(isPositionValid());
848 return Position.size();
852 assert(isPositionValid());
853 return Position[
Depth];
857 Position = NewPosition;
858 assert(isPositionValid());
869 Comment(VerbatimBlockLineCommentKind,
871 LocBegin.getLocWithOffset(Text.size())),
900 unsigned CommandID) :
902 LocBegin, LocEnd, CommandID,
920 CloseNameLocBegin = LocBegin;
936 return Lines[LineIdx]->getText();
1054 TemplatePartialSpecialization
1098 Blocks(Blocks), ThisDeclInfo(D) {
1103 SourceRange(Blocks.front()->getBeginLoc(), Blocks.back()->getEndLoc()));
1125 ThisDeclInfo->
fill();
1126 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.