History log of /external/clang/lib/AST/RawCommentList.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
87d948ecccffea9e9e37d0d053b246e2d6d6c47b 04-Mar-2016 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r256229

http://b/26987366

Change-Id: I5d349c9843ea5c24d6e455956f8a446393b6873d
/external/clang/lib/AST/RawCommentList.cpp
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/lib/AST/RawCommentList.cpp
42572f532b99230bf7aa3e3593a0fbb1174bce7c 28-Sep-2013 Benjamin Kramer <benny.kra@googlemail.com> Refactor comment merging.

- We scan for whitespace between comments anyways, remember any newlines seen
along the way.
- Use this newline number to decide whether two comments are adjacent.
- Since the newline check is now free remove the caching and unused code.
- Remove unnecessary boolean state from the comment list.
- No behavioral change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191614 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
ad6fd9f93ce0d328397e8d57ef7117ced24fc8e2 04-May-2013 Fariborz Jahanian <fjahanian@apple.com> [Doc parsing] Provide diagnostics for unknown documentation
commands. // rdar://12381408


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181071 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
002f9281e010202b87cc120195b67df06ef3e17f 26-Apr-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: -fparse-all-comments: recognize empty line comments

In -fparse-all-comments mode empty '//' comments were recognized as
RCK_Invalid, and were not merged with next and previous lines.

Patch by Amin Shali.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180625 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
6fd7d3067dd06584ef3940e88e31fea1a0e83588 10-Apr-2013 Dmitri Gribenko <gribozavr@gmail.com> Add an option to parse all comments as documentation comments

Patch by Amin Shali.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179180 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
55fc873017f10f6f566b182b70f6fc22aefa3464 04-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Sort all of Clang's files under 'lib', and fix up the broken headers
uncovered.

This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.

I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
1952354bd376062c3ab3d328c0fc6c36530c9309 29-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Move the 'find macro by spelling' infrastructure to the Preprocessor class and
use it to suggest appropriate macro for __attribute__((deprecated)) in
-Wdocumentation-deprecated-sync.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
e4330a302ac20b41b9800267ebd4b5b01f8553f8 10-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment AST: TableGen'ize all command lists in CommentCommandTraits.cpp.

Now we have a list of all commands. This is a good thing in itself, but it
also enables us to easily implement typo correction for command names.

With this change we have objects that contain information about each command,
so it makes sense to resolve command name just once during lexing (currently we
store command names as strings and do a linear search every time some property
value is needed). Thus comment token and AST nodes were changed to contain a
command ID -- index into a tables of builtin and registered commands. Unknown
commands are registered during parsing and thus are also uniformly assigned an
ID. Using an ID instead of a StringRef is also a nice memory optimization
since ID is a small integer that fits into a common bitfield in Comment class.

This change implies that to get any information about a command (even a command
name) we need a CommandTraits object to resolve the command ID to CommandInfo*.
Currently a fresh temporary CommandTraits object is created whenever it is
needed since it does not have any state. But with this change it has state --
new commands can be registered, so a CommandTraits object was added to
ASTContext.

Also, in libclang CXComment has to be expanded to include a CXTranslationUnit
so that all functions working on comment AST nodes can get a CommandTraits
object. This breaks binary compatibility of CXComment APIs.

Now clang_FullComment_getAsXML(CXTranslationUnit TU, CXComment CXC) doesn't
need TU parameter anymore, so it was removed. This is a source-incompatible
change for this C API.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163540 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
4a66557c297e1e5a71a3da4ceca1969800e7de70 09-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> RawCommentList: don't copy the whole new RawComment to LastComment each time.
We just need a single SourceLocation for previous comment end.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163482 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
af503a6f218cbef8704609812668360b0cbd0b60 31-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Remove the useless CommentOptions class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162986 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
c88c6a490ee946d80e306efaf83ae41b8f002741 28-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Merging consecutive comments: be more conservative.
Should fix part 2 of PR13374.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162723 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
c41ace950dcf2254c9aa48e73647b89c35109f80 14-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Attaching comments to redeclarations: fix wrong assumptions

The reason for the recent fallout for "attaching comments to any redeclaration"
change are two false assumptions:
(1) a RawComment is attached to a single decl (not true for 'typedef struct X *Y'
where we want the comment to be attached to both X and Y);
(2) the whole redeclaration chain has only a single comment (obviously false, the
user can put a separate comment for each redeclaration).

To fix (1) I revert the part of the recent change where a 'Decl*' member was
introduced to RawComment. Now ASTContext has a separate DenseMap for mapping
'Decl*' to 'FullComment*'.

To fix (2) I just removed the test with this assumption. We might not parse
every comment in redecl chain if we already parsed at least one.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
f50555eedef33fd5a67d369aa0ae8a6f1d201543 11-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Attaching comments to declarations: find comment attached to any redeclaration

Not only look for the comment near the declaration itself, but also walk the
redeclaration chain: the previous declaration might have had a documentation
comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
aa58081902ad31927df02e8537d972eabe29d6df 09-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: extract TableGen'able pieces into new CommandTraits class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161548 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
477a9f58c1b197f315befd03b42a8a0b3a2f0ff9 27-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Implement resolving of HTML character references (named: &amp;, decimal: &#42;,
hex: &#x1a;) during comment parsing.

Now internal representation of plain text in comment AST does not contain
character references, but the characters themselves.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160891 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
a5ef44ff5d93a3be6ca67782828157a71894cf0c 11-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Enable comment parsing and semantic analysis to emit diagnostics. A few
diagnostics implemented -- see testcases.

I created a new TableGen file for comment diagnostics,
DiagnosticCommentKinds.td, because comment diagnostics don't logically
fit into AST diagnostics file. But I don't feel strongly about it.

This also implements support for self-closing HTML tags in comment
lexer and parser (for example, <br />).

In order to issue precise diagnostics CommentSema needs to know the
declaration the comment is attached to. There is no easy way to find a decl by
comment, so we match comments and decls in lockstep: after parsing one
declgroup we check if we have any new, not yet attached comments. If we do --
then we do the usual comment-finding process.

It is interesting that this automatically handles trailing comments.
We pick up not only comments that precede the declaration, but also
comments that *follow* the declaration -- thanks to the lookahead in
the lexer: after parsing the declgroup we've consumed the semicolon
and looked ahead through comments.

Added -Wdocumentation-html flag for semantic HTML errors to allow the user to
disable only HTML warnings (but not HTML parse errors, which we emit as
warnings in -Wdocumentation).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160078 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
811c820257746b1799b790b6adc7804f44154011 06-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Don't store pointers into a std::vector (RawCommentList::Comments). Although
currently we take address of std::vector's contents only after we finished
adding all comments (so no reallocation can happen), this will change in
future.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159845 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
c50a0e3900f1b44503be48457508af372f4dd05a 04-Jul-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Renamed RawComment kinds to avoid name clash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159706 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
d99ef536b241071b6f4c01db6525dc03242ac30b 02-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Add a new libclang completion API to get brief documentation comment that is
attached to a declaration in the completion string.

Since extracting comments isn't free, a new code completion option is
introduced.

A new code completion option that enables including brief comments
into CodeCompletionString should be a, err, code completion option.
But because ASTUnit caches global declarations during parsing before
even completion consumer is created, the option is duplicated as a
translation unit option (in both libclang and ASTUnit, like the option
to cache code completion results).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159539 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
1e15e3b78c396c829789e616b313e656814f5947 27-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Initialize RawComment::BriefTextValid in other constructor, too.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
2d44d77fed3200e2eff289f55493317e90d3398c 26-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Implement a lexer for structured comments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
e601b237e495bb15a5e5df2e20c61fa01a6c4df0 22-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Handle include directive with comments. It turns out that in this case comments are not coming in source order. Instead of trying to std::sort() comments (which can be costly), just remove comments that are not in order.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158940 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
9530a8bf275f91f95147e1fb205dc85bea1ae45c 21-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> VC9 does not like heterogenous compare function objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158936 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
bd1be2c90c6bbc83fe420da51733469a4904831b 21-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> RawCommentList::addComment: fix the assertion so it actually checks that new comment is after the last one (change Comments[0] to Comments.back()), and handle the case of two consecutive comments, e.g. /** *//* */. There is already a testcase for that (but it didn't trigger the assert because the assert itself was wrong).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158882 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
59c30cd804c162dcc1c156bd3bab5c8f1dfd4749 20-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Remove unused ASTContext& arg in RawCommentList::addComment, as pointed out by Chandler in commit message for r158807.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158845 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp
f95d4125c01fa7b98722ae8cfbceac4a87d037b4 20-Jun-2012 Chandler Carruth <chandlerc@gmail.com> Fix a big layering violation introduced by r158771.

That commit added a new library just to hold the RawCommentList. I've
started a discussion on the commit thread about whether that is really
meritted -- it certainly doesn't seem necessary at this stage.

However, the immediate problem is that the AST library has a hard
dependency on the Comment library, but the dependencies were set up
completely backward. In addition to the layering violation, this had an
unfortunate effect if scattering the Comments library dependency
throughout the build system, but inconsistently so -- several parts of
the CMake dependencies were missing and only showed up due to transitive
deps or the fact that the target wasn't being built by tho bots.

It turns out that the Comments library can't (currently) be a well
formed layer *below* the AST library either, as it has an API that
accepts an ASTContext. That parameter is currently unused, so maybe that
was a mistake?

Anyways, it really seems like this is logically part of the AST --
that's the whole point of the ASTContext providing access to it as far
as I can tell -- so I've merged it into the AST library to solve the
immediate layering violation problems and remove some of the churn from
our library dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/AST/RawCommentList.cpp