diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-03-01 22:51:30 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-03-01 22:51:30 +0000 |
commit | c98e9130bcddd0258c110d30749edd2284087e3d (patch) | |
tree | b1bef38e783e38b9a92774dd24175d9a327cbc51 /include/clang/AST | |
parent | fc09336a5965040736f9bc63a70416003972364e (diff) |
comment parsing. Keep the original command format
in AST for source fidelity and use it in diagnostics
to refer to the original format. // rdar://13066276
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176387 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST')
-rw-r--r-- | include/clang/AST/Comment.h | 17 | ||||
-rw-r--r-- | include/clang/AST/CommentLexer.h | 7 |
2 files changed, 21 insertions, 3 deletions
diff --git a/include/clang/AST/Comment.h b/include/clang/AST/Comment.h index 78b703d78a..f00993bf6c 100644 --- a/include/clang/AST/Comment.h +++ b/include/clang/AST/Comment.h @@ -570,13 +570,16 @@ protected: /// Paragraph argument. ParagraphComment *Paragraph; - + + /// Header Doc command, if true + bool HDCommand; + BlockCommandComment(CommentKind K, SourceLocation LocBegin, SourceLocation LocEnd, unsigned CommandID) : BlockContentComment(K, LocBegin, LocEnd), - Paragraph(NULL) { + Paragraph(NULL), HDCommand(false) { setLocation(getCommandNameBeginLoc()); BlockCommandCommentBits.CommandID = CommandID; } @@ -586,7 +589,7 @@ public: SourceLocation LocEnd, unsigned CommandID) : BlockContentComment(BlockCommandCommentKind, LocBegin, LocEnd), - Paragraph(NULL) { + Paragraph(NULL), HDCommand(false) { setLocation(getCommandNameBeginLoc()); BlockCommandCommentBits.CommandID = CommandID; } @@ -657,6 +660,14 @@ public: if (NewLocEnd.isValid()) setSourceRange(SourceRange(getLocStart(), NewLocEnd)); } + + bool getHDCommand() const LLVM_READONLY { + return HDCommand; + } + + void setHDCommand(bool HDC) { + HDCommand = HDC; + } }; /// Doxygen \\param command. diff --git a/include/clang/AST/CommentLexer.h b/include/clang/AST/CommentLexer.h index b90414ba01..240a8eac9a 100644 --- a/include/clang/AST/CommentLexer.h +++ b/include/clang/AST/CommentLexer.h @@ -75,6 +75,9 @@ class Token { /// unused (command spelling can be found with CommandTraits). Otherwise, /// contains the length of the string that starts at TextPtr. unsigned IntVal; + + /// This command is a Header Doc command (command starts with '@'). + bool HDCommand; public: SourceLocation getLocation() const LLVM_READONLY { return Loc; } @@ -122,6 +125,10 @@ public: return IntVal; } + bool getHDCommand() const LLVM_READONLY { + return HDCommand; + } + void setCommandID(unsigned ID) { assert(is(tok::command)); IntVal = ID; |