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)) {
249 return C->
getCommentKind() >= FirstInlineContentCommentConstant &&
295 bool isWhitespaceNoCache()
const;
362 return Args[Idx].Text;
366 return Args[Idx].Range;
385 TagNameRange(TagNameBegin, TagNameEnd) {
396 StringRef
getTagName() const LLVM_READONLY {
return TagName; }
429 NameLocBegin(NameLocBegin), Name(Name),
437 NameLocBegin(NameLocBegin), Name(Name),
438 EqualsLoc(EqualsLoc),
439 ValueRange(ValueRange), Value(Value)
458 LocBegin, LocBegin.getLocWithOffset(1 + TagName.size()),
460 LocBegin.getLocWithOffset(1),
461 LocBegin.getLocWithOffset(1 + TagName.size())) {
474 return Attributes.size();
478 return Attributes[Idx];
483 if (!Attrs.empty()) {
516 LocBegin.getLocWithOffset(2),
517 LocBegin.getLocWithOffset(2 + TagName.size()))
556 if (Content.empty()) {
565 Content.back()->getEndLoc()));
591 bool isWhitespaceNoCache()
const;
664 StringRef Name = getCommandName(Traits);
674 return Args[Idx].Text;
678 return Args[Idx].Range;
683 if (Args.size() > 0) {
719 InvalidParamIndex = ~0U,
720 VarArgParamIndex = ~0U - 1U
728 CommandID, CommandMarker),
729 ParamIndex(InvalidParamIndex) {
760 return getNumArgs() > 0;
763 StringRef getParamName(
const FullComment *FC)
const;
770 return Args[0].Range;
774 return ParamIndex != InvalidParamIndex;
778 return ParamIndex == VarArgParamIndex;
782 ParamIndex = VarArgParamIndex;
783 assert(isParamIndexValid());
787 assert(isParamIndexValid());
788 assert(!isVarArgParam());
794 assert(isParamIndexValid());
795 assert(!isVarArgParam());
830 return getNumArgs() > 0;
833 StringRef getParamName(
const FullComment *FC)
const;
840 return Args[0].Range;
844 return !Position.empty();
848 assert(isPositionValid());
849 return Position.size();
853 assert(isPositionValid());
854 return Position[
Depth];
858 Position = NewPosition;
859 assert(isPositionValid());
870 Comment(VerbatimBlockLineCommentKind,
872 LocBegin.getLocWithOffset(Text.size())),
901 unsigned CommandID) :
903 LocBegin, LocEnd, CommandID,
921 CloseNameLocBegin = LocBegin;
937 return Lines[LineIdx]->getText();
1055 TemplatePartialSpecialization
1099 Blocks(Blocks), ThisDeclInfo(D) {
1104 SourceRange(Blocks.front()->getBeginLoc(), Blocks.back()->getEndLoc()));
1126 ThisDeclInfo->
fill();
1127 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.