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)) {
251 return C->
getCommentKind() >= FirstInlineContentCommentConstant &&
297 bool isWhitespaceNoCache()
const;
365 return Args[Idx].Text;
369 return Args[Idx].Range;
388 TagNameRange(TagNameBegin, TagNameEnd) {
399 StringRef
getTagName() const LLVM_READONLY {
return TagName; }
432 NameLocBegin(NameLocBegin), Name(Name),
440 NameLocBegin(NameLocBegin), Name(Name),
441 EqualsLoc(EqualsLoc),
442 ValueRange(ValueRange), Value(Value)
461 LocBegin, LocBegin.getLocWithOffset(1 + TagName.size()),
463 LocBegin.getLocWithOffset(1),
464 LocBegin.getLocWithOffset(1 + TagName.size())) {
477 return Attributes.size();
481 return Attributes[Idx];
486 if (!Attrs.empty()) {
519 LocBegin.getLocWithOffset(2),
520 LocBegin.getLocWithOffset(2 + TagName.size()))
559 if (Content.empty()) {
568 Content.back()->getLocEnd()));
594 bool isWhitespaceNoCache()
const;
667 StringRef Name = getCommandName(Traits);
677 return Args[Idx].Text;
681 return Args[Idx].Range;
686 if (Args.size() > 0) {
722 InvalidParamIndex = ~0U,
723 VarArgParamIndex = ~0U - 1U
731 CommandID, CommandMarker),
732 ParamIndex(InvalidParamIndex) {
763 return getNumArgs() > 0;
766 StringRef getParamName(
const FullComment *FC)
const;
773 return Args[0].Range;
777 return ParamIndex != InvalidParamIndex;
781 return ParamIndex == VarArgParamIndex;
785 ParamIndex = VarArgParamIndex;
786 assert(isParamIndexValid());
790 assert(isParamIndexValid());
791 assert(!isVarArgParam());
797 assert(isParamIndexValid());
798 assert(!isVarArgParam());
833 return getNumArgs() > 0;
836 StringRef getParamName(
const FullComment *FC)
const;
843 return Args[0].Range;
847 return !Position.empty();
851 assert(isPositionValid());
852 return Position.size();
856 assert(isPositionValid());
857 return Position[
Depth];
861 Position = NewPosition;
862 assert(isPositionValid());
873 Comment(VerbatimBlockLineCommentKind,
875 LocBegin.getLocWithOffset(Text.size())),
904 unsigned CommandID) :
906 LocBegin, LocEnd, CommandID,
924 CloseNameLocBegin = LocBegin;
940 return Lines[LineIdx]->getText();
1058 TemplatePartialSpecialization
1102 Blocks(Blocks), ThisDeclInfo(D) {
1107 Blocks.back()->getLocEnd()));
1129 ThisDeclInfo->
fill();
1130 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.