Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(5330)

Issue 4975049: Added support for late parsing of attribute arguments to GNU attributes.

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 8 months ago by delesley
Modified:
12 years, 7 months ago
Reviewers:
chandlerc, supertri
Visibility:
Public.

Patch Set 1 #

Total comments: 6

Patch Set 2 : Merged in supertri's earlier changes #

Total comments: 52

Patch Set 3 : Various style fixes. #

Total comments: 4

Patch Set 4 : More style fixes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+421 lines, -153 lines) Patch
M include/clang/Basic/Attr.td View 1 2 2 chunks +16 lines, -1 line 0 comments Download
M include/clang/CMakeLists.txt View 1 chunk +1 line, -0 lines 0 comments Download
M include/clang/Makefile View 1 chunk +1 line, -1 line 0 comments Download
A include/clang/Parse/CMakeLists.txt View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
A include/clang/Parse/Makefile View 1 chunk +13 lines, -0 lines 0 comments Download
M include/clang/Parse/Parser.h View 1 2 5 chunks +43 lines, -5 lines 0 comments Download
M include/clang/Sema/Sema.h View 1 chunk +4 lines, -0 lines 0 comments Download
M lib/Parse/CMakeLists.txt View 1 chunk +1 line, -1 line 0 comments Download
M lib/Parse/ParseDecl.cpp View 1 2 3 7 chunks +259 lines, -141 lines 0 comments Download
M lib/Parse/ParseDeclCXX.cpp View 1 2 3 6 chunks +21 lines, -4 lines 0 comments Download
M lib/Sema/AnalysisBasedWarnings.cpp View 1 1 chunk +2 lines, -0 lines 0 comments Download
M lib/Sema/SemaDecl.cpp View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
M test/SemaCXX/warn-thread-safety-analysis.cpp View 1 2 3 1 chunk +25 lines, -0 lines 0 comments Download
M test/SemaCXX/warn-thread-safety-parsing.cpp View 2 chunks +22 lines, -0 lines 0 comments Download

Messages

Total messages: 6
supertri
http://codereview.appspot.com/4975049/diff/1/lib/Parse/ParseDecl.cpp File lib/Parse/ParseDecl.cpp (right): http://codereview.appspot.com/4975049/diff/1/lib/Parse/ParseDecl.cpp#newcode106 lib/Parse/ParseDecl.cpp:106: LateParsedAttrList *LAS) { There was a previous discussion on ...
12 years, 8 months ago (2011-09-01 18:32:38 UTC) #1
delesley
http://codereview.appspot.com/4975049/diff/1/lib/Parse/ParseDecl.cpp File lib/Parse/ParseDecl.cpp (right): http://codereview.appspot.com/4975049/diff/1/lib/Parse/ParseDecl.cpp#newcode106 lib/Parse/ParseDecl.cpp:106: LateParsedAttrList *LAS) { Actually, it looks that this wasn't ...
12 years, 8 months ago (2011-09-01 20:18:23 UTC) #2
chandlerc
http://codereview.appspot.com/4975049/diff/2002/include/clang/Basic/Attr.td File include/clang/Basic/Attr.td (right): http://codereview.appspot.com/4975049/diff/2002/include/clang/Basic/Attr.td#newcode93 include/clang/Basic/Attr.td:93: bit LateParsed=0; spaces around the '=' http://codereview.appspot.com/4975049/diff/2002/include/clang/Basic/Attr.td#newcode570 include/clang/Basic/Attr.td:570: let ...
12 years, 7 months ago (2011-09-01 22:45:45 UTC) #3
delesley
http://codereview.appspot.com/4975049/diff/2002/include/clang/Basic/Attr.td File include/clang/Basic/Attr.td (right): http://codereview.appspot.com/4975049/diff/2002/include/clang/Basic/Attr.td#newcode93 include/clang/Basic/Attr.td:93: bit LateParsed=0; On 2011/09/01 22:45:45, chandlerc wrote: > spaces ...
12 years, 7 months ago (2011-09-02 18:19:07 UTC) #4
chandlerc
http://codereview.appspot.com/4975049/diff/2002/include/clang/Parse/CMakeLists.txt File include/clang/Parse/CMakeLists.txt (right): http://codereview.appspot.com/4975049/diff/2002/include/clang/Parse/CMakeLists.txt#newcode5 include/clang/Parse/CMakeLists.txt:5: DEPENDS AttrLateParsed.inc) On 2011/09/02 18:19:08, delesley wrote: > This ...
12 years, 7 months ago (2011-09-02 18:45:30 UTC) #5
delesley
12 years, 7 months ago (2011-09-07 19:13:27 UTC) #6
http://codereview.appspot.com/4975049/diff/2002/include/clang/Parse/CMakeList...
File include/clang/Parse/CMakeLists.txt (right):

http://codereview.appspot.com/4975049/diff/2002/include/clang/Parse/CMakeList...
include/clang/Parse/CMakeLists.txt:5: DEPENDS AttrLateParsed.inc)
On 2011/09/02 18:45:30, chandlerc wrote:
> On 2011/09/02 18:19:08, delesley wrote:
> > This is based off the clang_tablegen rule for AttrSpellings, which does have
> the
> > line.
> 
> That is literally the only use clang_tablegen which has this. If you read the
> actual documentation for clang_tablegen, it clearly lists this field as for
> "extra-dependencies". I'll fix AttrSpellings in a bit.

Done.

http://codereview.appspot.com/4975049/diff/2002/lib/Parse/ParseDecl.cpp
File lib/Parse/ParseDecl.cpp (right):

http://codereview.appspot.com/4975049/diff/2002/lib/Parse/ParseDecl.cpp#newco...
lib/Parse/ParseDecl.cpp:61: static bool isAttributeLateParsed(const
IdentifierInfo *II) {
On 2011/09/02 18:45:30, chandlerc wrote:
> On 2011/09/02 18:19:08, delesley wrote:
> > Adapted from HasAttribute function.
> 
> Ok, but would a const reference make more sense?

Done.

http://codereview.appspot.com/4975049/diff/2002/lib/Parse/ParseDecl.cpp#newco...
lib/Parse/ParseDecl.cpp:768: assert(LA.D);
On 2011/09/02 18:45:30, chandlerc wrote:
> On 2011/09/02 18:19:08, delesley wrote:
> > On 2011/09/01 22:45:45, chandlerc wrote:
> > > add a message for why this should never happen?
> > 
> > Done.
> 
> In general, it helps to condense the message into a string that the assert
> prints out. I was trying to suggest something like:
> 
> assert(LA.D && "No decl attached to late parsed attribute");

Done.

http://codereview.appspot.com/4975049/diff/2002/test/SemaCXX/warn-thread-safe...
File test/SemaCXX/warn-thread-safety-analysis.cpp (right):

http://codereview.appspot.com/4975049/diff/2002/test/SemaCXX/warn-thread-safe...
test/SemaCXX/warn-thread-safety-analysis.cpp:426: }
On 2011/09/02 18:45:30, chandlerc wrote:
> On 2011/09/02 18:19:08, delesley wrote:
> > On 2011/09/01 22:45:45, chandlerc wrote:
> > > It would be good to also test warnings on constructs here that require
> > > attributes that only appear later in the class definition.
> > 
> > Done.
> 
> Er, not really. I said *also*. I liked the test you had with a and b declared
> before the method, and was asking for further testing on some c and d declared
> after the method.

Done.

http://codereview.appspot.com/4975049/diff/14001/lib/Parse/ParseDecl.cpp
File lib/Parse/ParseDecl.cpp (right):

http://codereview.appspot.com/4975049/diff/14001/lib/Parse/ParseDecl.cpp#newc...
lib/Parse/ParseDecl.cpp:738: for (unsigned I = 0, NI =
Class.LateParsedDeclarations.size(); I < NI; ++I) {
On 2011/09/02 18:45:30, chandlerc wrote:
> We commonly use "I" to indicate an iterator. 'i' and 'e' or 'i' and 'size' are
> the idiomatic names for integer indexes.
> 
> Yes, I realize that Clang is particularly bad at following this rule, but I'd
> rather make it better than worse here.

Done.

http://codereview.appspot.com/4975049/diff/14001/lib/Parse/ParseDeclCXX.cpp
File lib/Parse/ParseDeclCXX.cpp (right):

http://codereview.appspot.com/4975049/diff/14001/lib/Parse/ParseDeclCXX.cpp#n...
lib/Parse/ParseDeclCXX.cpp:1787: for (unsigned I = 0, NI =
LateParsedAttrs.size(); I < NI; ++I) {
On 2011/09/02 18:45:30, chandlerc wrote:
> Same comment about the loop.

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b