Re: [cfe-commits] [Patch] Skip attributes

2013-10-16 Thread Michael Han
Thank you for getting this patch in :) On Mon, Oct 14, 2013 at 6:38 PM, Richard Smith rich...@metafoo.co.ukwrote: Rebased, reworked a little, and submitted as r192666. Thanks! (And sorry for the delay. Ahem.) On Mon, Dec 10, 2012 at 9:50 PM, Michael Han fragmentshad...@gmail.comwrote

r190728 - Fix a comment.

2013-09-13 Thread Michael Han
Author: hanm Date: Fri Sep 13 17:24:50 2013 New Revision: 190728 URL: http://llvm.org/viewvc/llvm-project?rev=190728view=rev Log: Fix a comment. Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h URL:

r190632 - Add a test case to test RAV visits parameters of implicit copy constructor.

2013-09-12 Thread Michael Han
Author: hanm Date: Thu Sep 12 15:59:33 2013 New Revision: 190632 URL: http://llvm.org/viewvc/llvm-project?rev=190632view=rev Log: Add a test case to test RAV visits parameters of implicit copy constructor. Modified: cfe/trunk/unittests/Tooling/RecursiveASTVisitorTest.cpp Modified:

Re: [PATCH] PR16182 - Visit parameter declaration of implicitly declared copy assignment operator.

2013-09-11 Thread Michael Han
Thank you for review. Committed as r190528. On Wed, Sep 11, 2013 at 4:21 AM, Manuel Klimek kli...@google.com wrote: lg for the testing side, with the grammar updates :) Comment at: unittests/Tooling/RecursiveASTVisitorTest.cpp:158 @@ -146,1 +157,3 @@ +// Test RAV

r190528 - Teach RAV to visit parameter variable declarations of implicit functions. Fixes PR16182.

2013-09-11 Thread Michael Han
Author: hanm Date: Wed Sep 11 10:53:29 2013 New Revision: 190528 URL: http://llvm.org/viewvc/llvm-project?rev=190528view=rev Log: Teach RAV to visit parameter variable declarations of implicit functions. Fixes PR16182. Normally RAV visits parameter variable declarations of a function by

Re: [PATCH] PR16182 - Visit parameter declaration of implicitly declared copy assignment operator.

2013-09-10 Thread Michael Han
Update patch based on comments from Richard. Hi klimek, rsmith, http://llvm-reviews.chandlerc.com/D958 CHANGE SINCE LAST DIFF http://llvm-reviews.chandlerc.com/D958?vs=4045id=4182#toc Files: unittests/Tooling/RecursiveASTVisitorTest.cpp unittests/Tooling/TestVisitor.h

Re: [PATCH] PR16182 - Visit parameter declaration of implicitly declared copy assignment operator.

2013-09-09 Thread Michael Han
Ping. OK to commit this one? On Wed, Sep 4, 2013 at 2:27 PM, Michael Han fragmentshad...@gmail.comwrote: Sorry for long delay of this patch. Just had a chance to get back to this. As Richard suggested, RAV now traverses function parameter variable declarations instead of relying

Re: [PATCH] PR16182 - Visit parameter declaration of implicitly declared copy assignment operator.

2013-09-04 Thread Michael Han
Sorry for long delay of this patch. Just had a chance to get back to this. As Richard suggested, RAV now traverses function parameter variable declarations instead of relying on TypeSourceInfo of the function type to visit the parameter variable declarations of a function when RAV is set to

Re: [PATCH] PR16182 - Visit parameter declaration of implicitly declared copy assignment operator.

2013-09-04 Thread Michael Han
Patch updated with comments. http://llvm-reviews.chandlerc.com/D958 ___ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

[PATCH] Comment fix for RecursiveASTVisitor

2013-08-24 Thread Michael Han
The example in the comment has this node visiting order: VisitDecl(), VisitNamedDecl(), VisitNamespaceDecl(), so the type of the given node should be NamespaceDecl, not NamedDecl. OK to commit? comment.patch Description: Binary data ___ cfe-commits

Re: [PATCH] Comment fix for RecursiveASTVisitor

2013-08-24 Thread Michael Han
Thanks. Commit in r189185. Michael On Sat, Aug 24, 2013 at 12:51 PM, James Dennett jdenn...@googlers.comwrote: On Sat, Aug 24, 2013 at 11:07 AM, Michael Han fragmentshad...@gmail.com wrote: The example in the comment has this node visiting order: VisitDecl(), VisitNamedDecl

r189185 - Fix comment.

2013-08-24 Thread Michael Han
Author: hanm Date: Sat Aug 24 20:29:56 2013 New Revision: 189185 URL: http://llvm.org/viewvc/llvm-project?rev=189185view=rev Log: Fix comment. Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h URL:

Re: [PATCH] PR16182 - Visit parameter declaration of implicitly declared copy assignment operator.

2013-08-01 Thread Michael Han
Ping. To recap: this patch fixes PR16182 ( http://llvm.org/bugs/show_bug.cgi?id=16182). OK to commit? Thanks. On Tue, Jun 11, 2013 at 1:31 PM, Michael Han fragmentshad...@gmail.comwrote: Hi klimek, rsmith, This patch fixes PR16182 http://llvm.org/bugs/show_bug.cgi?id=16182 A valid

Re: [PATCH] PR16182 - Visit parameter declaration of implicitly declared copy assignment operator.

2013-08-01 Thread Michael Han
Make sense, fix the visitor seems better than adding the type nodes to AST that no one would use. Will look into this. Thanks for the pointer. On Thu, Aug 1, 2013 at 3:53 PM, Richard Smith rich...@metafoo.co.uk wrote: It seems strange to me to build a TypeSourceInfo for a type that was not

Re: [PATCH] PR16182 - Visit parameter declaration of implicitly declared copy assignment operator.

2013-06-18 Thread Michael Han
Ping. Hi Richard, do you have a chance to take a look at this patch? Does this patch make sense or there is a better way of creating type nodes for implicit functions? On Wed, Jun 12, 2013 at 10:40 AM, Michael Han fragmentshad...@gmail.comwrote: Hi Manuel, Thank you for the comments

Re: [PATCH] PR16182 - Visit parameter declaration of implicitly declared copy assignment operator.

2013-06-12 Thread Michael Han
Rename VisitsParmVarDecl to VisitsParmVarDeclForImplicitCode and add comments to explain what this test is doing. Hi klimek, rsmith, http://llvm-reviews.chandlerc.com/D958 CHANGE SINCE LAST DIFF http://llvm-reviews.chandlerc.com/D958?vs=2361id=2373#toc Files:

Re: [PATCH] PR16182 - Visit parameter declaration of implicitly declared copy assignment operator.

2013-06-12 Thread Michael Han
Klimek kli...@google.com wrote: On Tue, Jun 11, 2013 at 10:31 PM, Michael Han fragmentshad...@gmail.comwrote: Hi klimek, rsmith, This patch fixes PR16182 http://llvm.org/bugs/show_bug.cgi?id=16182 A valid TypeSourceInfo of a function is required for the RAV to visit the parameter

[PATCH] PR16182 - Visit parameter declaration of implicitly declared copy assignment operator.

2013-06-11 Thread Michael Han
Hi klimek, rsmith, This patch fixes PR16182 http://llvm.org/bugs/show_bug.cgi?id=16182 A valid TypeSourceInfo of a function is required for the RAV to visit the parameter declaration of the function, and previously we don't have a valid TypeSourceInfo when creating the function declaration of

[PATCH] [ms-cxxabi] PR15512 - mangle lambda names.

2013-05-09 Thread Michael Han
This patch is trying to fix PR15512. For lambda with internal linkage, Itanium ABI would mangle the names as anonymous struct and using a unique mangling number to differentiate between different lambdas. This patch takes a similar approach by maintaining a mangling number for local lambdas in

Re: [PATCH] [ms-cxxabi] PR15512 - mangle lambda names.

2013-05-09 Thread Michael Han
Comment at: lib/AST/MicrosoftMangle.cpp:485-492 @@ +484,10 @@ + + // Mangle local lambda in the form + // lambda_n + // where n is the lambda id. + SmallString64 Str; + Str += lambda_; + Str += llvm::utostr(ID); +

Re: [PATCH] Improve attributes printing.

2013-03-21 Thread Michael Han
Slightly change the logic of dealing with each type of attributes and add more test cases :) For C++11 attributes, they could be printed anywhere except at end of declaration; for GNU attributes, we enforce that these attributes only appear at end of declaration to prevent them printing

Re: [PATCH] Improve attributes printing.

2013-03-21 Thread Michael Han
Thanks for pointing this out! Maybe we can always print GNU attributes at the beginning (there are some test cases assume GNU attributes are printed at the end so they need to be updated.). Another idea is instead of hard code the print position of attribute we rely on source locations

Re: [PATCH] Improve attributes printing.

2013-03-19 Thread Michael Han
Update patch to teach printPretty making the decision of print an attribute or not based on an enum value that identifies where the attribute appears around declaration and statement. For C++11 attributes, we always print them at the start of declarations or immediately after declarator-id to

Re: [PATCH] Improve attributes printing.

2013-03-19 Thread Michael Han
Comment at: utils/TableGen/ClangAttrEmitter.cpp:811 @@ +810,3 @@ +if (Variety == CXX11) + OS if (LK == 0 || LK == 1 || LK == 3) {\n; + Richard Smith wrote: Each attribute should only be printed at one location. This seems not possible using

Re: [PATCH] Improve attributes printing.

2013-03-14 Thread Michael Han
Thanks, this sounds good. Rather than passing an enum value to 'printPretty' that indicates where the attributes are, how about passing an enum value to it that indicates the syntax of the attribute so when we ask all attributes to print themselves, only the specified syntax(es) will be

Re: [PATCH] Improve attributes printing.

2013-03-13 Thread Michael Han
Revive an old patch :). Richard, do you have a chance to take a look at this? Michael. On Thu, Feb 28, 2013 at 6:24 PM, Michael Han fragmentshad...@gmail.comwrote: Patch updated. Summary of change: - Introduce a new table-gen generated function isCXX11Syntax to Attr. - Always print

Re: [PATCH] Improve attributes printing.

2013-02-28 Thread Michael Han
Patch updated. Summary of change: - Introduce a new table-gen generated function isCXX11Syntax to Attr. - Always print out C++11 attributes of a function declaration after function declarator-id to make sure they appertain to function itself. Hi rsmith,

Re: [PATCH] Improve attributes printing.

2013-02-26 Thread Michael Han
Ping. Patch is updated to TOT. Hi rsmith, http://llvm-reviews.chandlerc.com/D395 CHANGE SINCE LAST DIFF http://llvm-reviews.chandlerc.com/D395?vs=948id=1120#toc Files: lib/AST/DeclPrinter.cpp test/SemaCXX/attr-print.cpp test/SemaCXX/cxx11-attr-print.cpp test/Sema/attr-print.c

Re: [PATCH] Improve attributes printing.

2013-02-26 Thread Michael Han
Thanks Richard! You are right this is fragile and will break for cases like inheritable attributes, which I overlooked. The primary goal of this patch is to fix C++11 attributes printing, so I am thinking for now we can just check if an attribute is a C++11 attribute and if it is then

r176035 - Fix empty declaration printing.

2013-02-25 Thread Michael Han
Author: hanm Date: Mon Feb 25 12:40:11 2013 New Revision: 176035 URL: http://llvm.org/viewvc/llvm-project?rev=176035view=rev Log: Fix empty declaration printing. Don't print the semicolon when visiting an empty declaration because the semicolon will be printed as a terminator later. Modified:

r176074 - Update tests to do a full match against printed C++11 attributes.

2013-02-25 Thread Michael Han
Author: hanm Date: Mon Feb 25 20:00:13 2013 New Revision: 176074 URL: http://llvm.org/viewvc/llvm-project?rev=176074view=rev Log: Update tests to do a full match against printed C++11 attributes. Modified: cfe/trunk/test/SemaCXX/cxx11-attr-print.cpp Modified:

r175900 - [Sema] Semantic analysis for empty-declaration and attribute-declaration.

2013-02-22 Thread Michael Han
Author: hanm Date: Fri Feb 22 11:15:32 2013 New Revision: 175900 URL: http://llvm.org/viewvc/llvm-project?rev=175900view=rev Log: [Sema] Semantic analysis for empty-declaration and attribute-declaration. Introduce a new AST Decl node EmptyDecl to model empty-declaration. Have attributes from

Re: [PATCH] Represent empty declaration using a new Decl node EmptyDecl and let attribute declarations appertain to EmptyDecl.

2013-02-22 Thread Michael Han
Thanks Richard and Dmitri. Committed as r175900. http://llvm-reviews.chandlerc.com/D448 ___ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Re: r175900 - [Sema] Semantic analysis for empty-declaration and attribute-declaration.

2013-02-22 Thread Michael Han
Hi David, Sorry for breaking the build. Yes I think it is the appropriate fix. Thanks! Michael. On Fri, Feb 22, 2013 at 9:46 AM, David Blaikie dblai...@gmail.com wrote: On Fri, Feb 22, 2013 at 9:15 AM, Michael Han fragmentshad...@gmail.comwrote: Author: hanm Date: Fri Feb 22 11:15:32

[PATCH] Represent empty declaration using a new Decl node EmptyDecl and let attribute declarations appertain to EmptyDecl.

2013-02-21 Thread Michael Han
Hi rsmith, This patch introduces a new type of Decl node Empty to model empty declarations, and let attribute declarations appertain to EmptyDecl so these attributes can be stored in AST. http://llvm-reviews.chandlerc.com/D448 Files: tools/libclang/RecursiveASTVisitor.h

Re: [PATCH] Represent empty declaration using a new Decl node EmptyDecl and let attribute declarations appertain to EmptyDecl.

2013-02-21 Thread Michael Han
Patch updated to address review comments. Thanks! Hi rsmith, http://llvm-reviews.chandlerc.com/D448 CHANGE SINCE LAST DIFF http://llvm-reviews.chandlerc.com/D448?vs=1072id=1073#toc Files: tools/libclang/RecursiveASTVisitor.h lib/Sema/SemaDeclCXX.cpp lib/AST/DeclBase.cpp

Re: r175649 - Process and handle attributes on conditions and for loop variables. Process and

2013-02-20 Thread Michael Han
Hi Richard, For attribute declarations, are they appertaining to the translation unit in which they are declared? If true then maybe TranslationUnitDecl is a place to store the AST nodes for these attributes? If not what would be the right place to store these attributes in AST? I am interested

Re: [PATCH] Improve attributes printing.

2013-02-19 Thread Michael Han
Ping. On Mon, Feb 11, 2013 at 2:24 PM, Michael Han fragmentshad...@gmail.comwrote: Hi rsmith, This patch improves attribute printing by taking the source location of attributes into account when print them out. Previously, we hard code the print out locations for attributes and this has

[PATCH] Improve attributes printing.

2013-02-11 Thread Michael Han
Hi rsmith, This patch improves attribute printing by taking the source location of attributes into account when print them out. Previously, we hard code the print out locations for attributes and this has some issues especially for C++11 attributes for example: void foo [[noreturn]] (); would

[PATCH] Fix alignment attribute printing.

2013-01-31 Thread Michael Han
Hi rsmith, This is the updated patch that fixes alignment attribute printing by removing IsMSDeclSpec argument from alignment attribute and using attribute syntax accessor generated by TableGen to decide if an alignment attribute is a MS declspec attribute.

r174133 - [Sema][Attr]Fix alignment attribute printing.

2013-01-31 Thread Michael Han
Author: hanm Date: Thu Jan 31 19:19:17 2013 New Revision: 174133 URL: http://llvm.org/viewvc/llvm-project?rev=174133view=rev Log: [Sema][Attr]Fix alignment attribute printing. Remove IsMSDeclspec argument from Align attribute since the arguments in Attr.td should only model those appear in

Re: [PATCH] Fix alignment attribute printing.

2013-01-31 Thread Michael Han
Thanks! Committed as r174133 with all suggested fixes. http://llvm-reviews.chandlerc.com/D360 ___ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Re: r173726 - Finish semantic analysis for [[carries_dependency]] attribute.

2013-01-28 Thread Michael Han
[dcl.attr.depend] also requires [[carries_dependency]] appear at most once in an attribute list; same for [[noreturn]]. Should this be implemented as part of semantic analysis for both attributes as well? Michael On Mon, Jan 28, 2013 at 2:42 PM, Richard Smith richard-l...@metafoo.co.ukwrote:

Re: r173726 - Finish semantic analysis for [[carries_dependency]] attribute.

2013-01-28 Thread Michael Han
Ah OK. Thanks! Michael On Mon, Jan 28, 2013 at 3:56 PM, Richard Smith rich...@metafoo.co.ukwrote: This is already implemented, see test in r173645. On Mon, Jan 28, 2013 at 3:42 PM, Michael Han fragmentshad...@gmail.com wrote: [dcl.attr.depend] also requires [[carries_dependency]] appear

r173765 - Add a test case for attribute print.

2013-01-28 Thread Michael Han
Author: hanm Date: Mon Jan 28 22:13:20 2013 New Revision: 173765 URL: http://llvm.org/viewvc/llvm-project?rev=173765view=rev Log: Add a test case for attribute print. Modified: cfe/trunk/test/SemaCXX/attr-print.cpp Modified: cfe/trunk/test/SemaCXX/attr-print.cpp URL:

[PATCH] Alignment attribute printing.

2013-01-28 Thread Michael Han
Hi, Attached patch fixes alignment attribute printing. It removes the IsMSDeclSpec argument of alignment attribute, and uses the spelling list index to decide if an alignment attribute is in the form of __declspec(align()) or not. Please review, thanks! Michael attr-align-print.patch

[cfe-commits] r173597 - Add the missing line return to align parameters of printPretty.

2013-01-26 Thread Michael Han
Author: hanm Date: Sat Jan 26 18:06:24 2013 New Revision: 173597 URL: http://llvm.org/viewvc/llvm-project?rev=173597view=rev Log: Add the missing line return to align parameters of printPretty. Modified: cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp Modified:

Re: [cfe-commits] [Patch] PR14922 - Improve Attr::printPretty

2013-01-24 Thread Michael Han
Committed in r173358. Thanks for the review! Michael On Wed, Jan 23, 2013 at 9:55 PM, Michael Han fragmentshad...@gmail.comwrote: On Wed, Jan 23, 2013 at 9:10 PM, Richard Smith rich...@metafoo.co.ukwrote: On Mon, Jan 21, 2013 at 8:12 PM, Michael Han fragmentshad...@gmail.com wrote

Re: [cfe-commits] [Patch] PR14922 - Improve Attr::printPretty

2013-01-23 Thread Michael Han
On Wed, Jan 23, 2013 at 9:10 PM, Richard Smith rich...@metafoo.co.ukwrote: On Mon, Jan 21, 2013 at 8:12 PM, Michael Han fragmentshad...@gmail.com wrote: Attach updated patch with more tests added; also updated all attributes to include spelling index when their ast nodes are constructed

Re: [cfe-commits] [Patch] PR14922 - Improve Attr::printPretty

2013-01-17 Thread Michael Han
/SemaCXX/ast-print.cpp, and test/SemaCXX/cxx11-ast-print.cpp look like good places to start. On Wed, Jan 16, 2013 at 7:09 PM, Michael Han fragmentshad...@gmail.com wrote: Agree, any suggestions on where / how to add the tests? I don't find any existing regression tests that cover attributes print

Re: [cfe-commits] [Patch] PR14922 - Improve Attr::printPretty

2013-01-16 Thread Michael Han
. Implementation of this method is generated through table-gen. - Teach table-gen to print an attribute based on this index. Michael On Mon, Jan 14, 2013 at 6:55 PM, Richard Smith rich...@metafoo.co.ukwrote: On Mon, Jan 14, 2013 at 11:40 AM, Michael Han fragmentshad...@gmail.comwrote: Hi Richard, I

Re: [cfe-commits] [Patch] PR14922 - Improve Attr::printPretty

2013-01-16 Thread Michael Han
) { default: llvm_unreachable(Unknown attribute syntax!); case AS_GNU: AttrSyntax = GNU; break; ... but, as noted above, don't do this conversion. Thanks! Michael On Wed, Jan 16, 2013 at 1:55 PM, Michael Han fragmentshad...@gmail.com wrote: Cool thanks. Please take a look

Re: [cfe-commits] [Patch] PR14922 - Improve Attr::printPretty

2013-01-16 Thread Michael Han
Attached patch should fix all issues pointed out in last review. Thanks! Michael On Wed, Jan 16, 2013 at 4:01 PM, Richard Smith rich...@metafoo.co.ukwrote: On Wed, Jan 16, 2013 at 3:27 PM, Michael Han fragmentshad...@gmail.com wrote: Thanks! I have some inline comments below. On Wed

Re: [cfe-commits] [Patch] PR14922 - Improve Attr::printPretty

2013-01-16 Thread Michael Han
Agree, any suggestions on where / how to add the tests? I don't find any existing regression tests that cover attributes print. Michael On Wed, Jan 16, 2013 at 6:56 PM, Richard Smith rich...@metafoo.co.ukwrote: On Wed, Jan 16, 2013 at 6:35 PM, Michael Han fragmentshad...@gmail.com wrote

Re: [cfe-commits] [Patch] PR14922 - Improve Attr::printPretty

2013-01-14 Thread Michael Han
11, 2013 at 3:53 PM, Michael Han fragmentshad...@gmail.comwrote: Hi, Attached patch is to fix PR14922. Currently when print an attribute the GNU syntax will always be used, even if the attribute has no GNU syntax.The fix is to pass the syntax flag when constructing the Attr node and take

[cfe-commits] [Patch] PR14922 - Improve Attr::printPretty

2013-01-11 Thread Michael Han
Hi, Attached patch is to fix PR14922. Currently when print an attribute the GNU syntax will always be used, even if the attribute has no GNU syntax.The fix is to pass the syntax flag when constructing the Attr node and take that into consideration when printing the attribute. The name of actual

[cfe-commits] r171757 - in /cfe/trunk: include/clang/Parse/Parser.h lib/Parse/ParseDeclCXX.cpp test/FixIt/fixit-cxx11-attributes.cpp test/Parser/cxx0x-attributes.cpp

2013-01-07 Thread Michael Han
Author: hanm Date: Mon Jan 7 10:57:11 2013 New Revision: 171757 URL: http://llvm.org/viewvc/llvm-project?rev=171757view=rev Log: Add fixit hints for misplaced C++11 attributes around class specifiers. Following r168626, in class declaration or definition, there are a combination of syntactic

Re: [cfe-commits] [PATCH] Add Fixit for C++11 attributes that appertain to class specifiers.

2013-01-07 Thread Michael Han
Committed as r171757 with suggested fixes. Thanks for the review! Michael On Fri, Jan 4, 2013 at 2:39 PM, Richard Smith rich...@metafoo.co.uk wrote: On Fri, Jan 4, 2013 at 11:01 AM, Michael Han fragmentshad...@gmail.com wrote: Hi Richard, Updated patch attached, please take a look

Re: [cfe-commits] [PATCH] Add Fixit for C++11 attributes that appertain to class specifiers.

2013-01-04 Thread Michael Han
to move +// them to right place. ... to *the* right place. +// Parse any C++11 attributes after 'final'keyword Missing space after 'final'. Missing full stop. On Mon, Dec 17, 2012 at 9:56 PM, Michael Han fragmentshad...@gmail.com wrote: Reviving an old patch. Is this patch OK to commit

Re: [cfe-commits] [PATCH] Add Fixit for C++11 attributes that appertain to class specifiers.

2013-01-04 Thread Michael Han
Agreed, that makes code cleaner indeed. Attach revised patch. Michael On Fri, Jan 4, 2013 at 2:39 PM, Richard Smith rich...@metafoo.co.uk wrote: On Fri, Jan 4, 2013 at 11:01 AM, Michael Han fragmentshad...@gmail.com wrote: Hi Richard, Updated patch attached, please take a look. Thanks

Re: [cfe-commits] [PATCH] Add Fixit for C++11 attributes that appertain to class specifiers.

2012-12-17 Thread Michael Han
Reviving an old patch. Is this patch OK to commit? Cheers Michael On Thu, Dec 6, 2012 at 9:39 AM, Michael Han fragmentshad...@gmail.comwrote: Hi Richard, Do you also have a chance to look at this patch? Please let me know if it's OK to commit it. Thanks! Michael On Mon, Dec 3, 2012

Re: [cfe-commits] [Patch] Forbid C++11 attributes on explicit template instantiation.

2012-12-11 Thread Michael Han
=192199r2=192198pathrev=192199 Michael On Tue, Dec 11, 2012 at 8:01 PM, John McCall rjmcc...@apple.com wrote: On Dec 7, 2012, at 3:08 PM, Michael Han fragmentshad...@gmail.com wrote: This small patch forbids C++11 attributes on explicit template instantiations, as required by C++11

Re: [cfe-commits] [Patch] Skip attributes

2012-12-10 Thread Michael Han
at 4:09 PM, Richard Smith rich...@metafoo.co.uk wrote: On Fri, Dec 7, 2012 at 3:08 PM, Michael Han fragmentshad...@gmail.com wrote: Hi, There are a couple of places in parser where we parse attributes, then discard them immediately because these attributes are not allowed to appear

Re: [cfe-commits] [Patch] Forbid C++11 attributes on explicit template instantiation.

2012-12-08 Thread Michael Han
Patch updated. The attributes are dropped by marking as invalid so they don't participate in semantic checking. Cheers Michael On Fri, Dec 7, 2012 at 3:41 PM, Michael Han fragmentshad...@gmail.comwrote: I think we should. I'll update the patch. This reminds me another place that needs a fix

[cfe-commits] [Patch] Forbid C++11 attributes on explicit template instantiation.

2012-12-07 Thread Michael Han
Hi, This small patch forbids C++11 attributes on explicit template instantiations, as required by C++11 [dcl.attr.grammar] p4. Cheers Michael templateattr.patch Description: Binary data ___ cfe-commits mailing list cfe-commits@cs.uiuc.edu

[cfe-commits] [Patch] Skip attributes

2012-12-07 Thread Michael Han
Hi, There are a couple of places in parser where we parse attributes, then discard them immediately because these attributes are not allowed to appear on certain locations. This patch kills the unnecessary parsing by simply skipping these attributes. The existing attribute tests should cover all

Re: [cfe-commits] [Patch] Forbid C++11 attributes on explicit template instantiation.

2012-12-07 Thread Michael Han
the ParsingDeclarator after diagnosing them? On Fri, Dec 7, 2012 at 3:08 PM, Michael Han fragmentshad...@gmail.com wrote: Hi, This small patch forbids C++11 attributes on explicit template instantiations, as required by C++11 [dcl.attr.grammar] p4. Cheers Michael

Re: [cfe-commits] [PATCH] Add Fixit for C++11 attributes that appertain to class specifiers.

2012-12-06 Thread Michael Han
Hi Richard, Do you also have a chance to look at this patch? Please let me know if it's OK to commit it. Thanks! Michael On Mon, Dec 3, 2012 at 11:00 AM, Michael Han fragmentshad...@gmail.comwrote: I see. Thanks for the explanation! Michael On Mon, Dec 3, 2012 at 9:38 AM, Jordan Rose

Re: [cfe-commits] [PATCH] Add Fixit for C++11 attributes that appertain to class specifiers.

2012-12-03 Thread Michael Han
where we're not *just* testing caret fixit emission. Jordan On Dec 1, 2012, at 21:05 , Michael Han fragmentshad...@gmail.com wrote: Hi Dmitri, Thanks! Attach updated patch. I noticed that not all test cases under clang/test/FixIt use -fdiagnostics-parseable-fixits. Is there a reason why

Re: [cfe-commits] [PATCH] Add Fixit for C++11 attributes that appertain to class specifiers.

2012-12-01 Thread Michael Han
: On Sat, Dec 1, 2012 at 6:30 AM, Michael Han fragmentshad...@gmail.com wrote: This patch adds two FixIts to parser when parsing C++11 attributes appertain to class specifier. It is a following up patch of a previous patch [1]. Please review, thanks! Hello Michael, FixIts can be tested

[cfe-commits] [PATCH] Add Fixit for C++11 attributes that appertain to class specifiers.

2012-11-30 Thread Michael Han
Hi, This patch adds two FixIts to parser when parsing C++11 attributes appertain to class specifier. It is a following up patch of a previous patch [1]. Please review, thanks! Michael [1] http://llvm.org/viewvc/llvm-project?view=revrevision=168626 fixit.patch Description: Binary data

[cfe-commits] r169078 - /cfe/trunk/include/clang/Basic/SourceLocation.h

2012-11-30 Thread Michael Han
Author: hanm Date: Fri Nov 30 22:35:48 2012 New Revision: 169078 URL: http://llvm.org/viewvc/llvm-project?rev=169078view=rev Log: Fix a typo in comment. Modified: cfe/trunk/include/clang/Basic/SourceLocation.h Modified: cfe/trunk/include/clang/Basic/SourceLocation.h URL:

Re: [cfe-commits] [PATCH] forbid attributes on friend member function declaration

2012-11-28 Thread Michael Han
of the declarator is finished. Thus, it seems reasonable to put the checks after function declarators are fully parsed. Attach tweaked patch that coveres all cases you mentioned. Cheers Michael On Mon, Nov 26, 2012 at 8:42 PM, Richard Smith rich...@metafoo.co.ukwrote: On Mon, Nov 26, 2012 at 6:43 PM, Michael

[cfe-commits] r168826 - in /cfe/trunk: include/clang/Sema/DeclSpec.h lib/Parse/ParseDeclCXX.cpp test/Parser/cxx0x-attributes.cpp

2012-11-28 Thread Michael Han
Author: hanm Date: Wed Nov 28 17:17:40 2012 New Revision: 168826 URL: http://llvm.org/viewvc/llvm-project?rev=168826view=rev Log: Implement C++11 [dcl.attr.grammar] p4: If an attribute-specifier-seq appertains to a friend declaration, that declaration shall be a definition. Modified:

Re: [cfe-commits] [PATCH] forbid attributes on friend member function declaration

2012-11-28 Thread Michael Han
...@metafoo.co.ukwrote: On Wed, Nov 28, 2012 at 1:38 PM, Michael Han fragmentshad...@gmail.comwrote: Hi Richard, I am not sure if it is possible to reject the attributes before finishing parse of declarators, because we should only reject attributes appertain to declarations, not to definitions, and I

[cfe-commits] r168626 - in /cfe/trunk: include/clang/Parse/Parser.h lib/Parse/ParseDecl.cpp lib/Parse/ParseDeclCXX.cpp test/Parser/cxx0x-attributes.cpp

2012-11-26 Thread Michael Han
Author: hanm Date: Mon Nov 26 16:54:45 2012 New Revision: 168626 URL: http://llvm.org/viewvc/llvm-project?rev=168626view=rev Log: Improve diagnostic on C++11 attribute specifiers that appear at wrong syntactic locations around class specifiers. This change list implemented logic that explicitly

Re: [cfe-commits] [Patch] Fix parser diagnostic on class specifiers following c++11 attributes

2012-11-26 Thread Michael Han
Thanks for all the reviews! Committed as r168626 with recommended fixes. Cheers Michael On Mon, Nov 26, 2012 at 10:43 AM, Richard Smith rich...@metafoo.co.ukwrote: Just some tiny things, then: +// Skip C++11 attribute specifiers. +do { + if (Tok.is(tok::l_square)

Re: [cfe-commits] [PATCH] forbid attributes on friend member function declaration

2012-11-26 Thread Michael Han
? On Fri, Nov 23, 2012 at 3:58 PM, Michael Han fragmentshad...@gmail.comwrote: Sorry missing title in last email; resend patch with title this time.. -- Forwarded message -- From: Michael Han fragmentshad...@gmail.com Date: Fri, Nov 23, 2012 at 3:53 PM Subject: To: cfe-commits

[cfe-commits] (no subject)

2012-11-23 Thread Michael Han
Hi, This patch implements C++11 [dcl.attr.grammar] p4: If an attribute-specifier-seq appertains to a friend declaration, that declaration shall be a definition. Please review. Cheers Michael dcl.attr.grammar.p4.patch Description: Binary data ___

Re: [cfe-commits] [Patch] Fix parser diagnostic on class specifiers following c++11 attributes

2012-11-23 Thread Michael Han
Hi Richard, Is the updated patch ok to commit? Cheers Michael On Tue, Nov 20, 2012 at 7:10 PM, Michael Han fragmentshad...@gmail.comwrote: You are right, we need to process two tokens at once. Good test case :) Attach updated patch, please take a look. Thanks! Cheers Michael On Tue

[cfe-commits] [PATCH] forbid attributes on friend member function declaration

2012-11-23 Thread Michael Han
Sorry missing title in last email; resend patch with title this time.. -- Forwarded message -- From: Michael Han fragmentshad...@gmail.com Date: Fri, Nov 23, 2012 at 3:53 PM Subject: To: cfe-commits@cs.uiuc.edu Hi, This patch implements C++11 [dcl.attr.grammar] p4

Re: [cfe-commits] [Patch] Fix parser diagnostic on class specifiers following c++11 attributes

2012-11-20 Thread Michael Han
You are right, we need to process two tokens at once. Good test case :) Attach updated patch, please take a look. Thanks! Cheers Michael On Tue, Nov 20, 2012 at 4:03 PM, Richard Smith rich...@metafoo.co.ukwrote: On Mon, Nov 19, 2012 at 11:13 AM, Michael Han fragmentshad...@gmail.com wrote

Re: [cfe-commits] [Patch] Fix parser diagnostic on class specifiers following c++11 attributes

2012-11-19 Thread Michael Han
standards: http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly -- Sean Silva On Sun, Nov 18, 2012 at 5:52 PM, Michael Han fragmentshad...@gmail.com wrote: Hi Richard, Thanks for the suggestions! Attached updated patch. The parser now

Re: [cfe-commits] [Patch] Fix parser diagnostic on class specifiers following c++11 attributes

2012-11-18 Thread Michael Han
at 10:33 AM, Michael Han fragmentshad...@gmail.com wrote: Hi, Consider this code class [[foo]] c [[foo]]; Clang generates diagnostic like this: error: an attribute list cannot appear here class [[foo]] c [[foo]]; ^~~~ I think the first attribute is conforming, and it's

[cfe-commits] [Patch] Fix parser diagnostic on class specifiers following c++11 attributes

2012-11-15 Thread Michael Han
Hi, Consider this code class [[foo]] c [[foo]]; Clang generates diagnostic like this: error: an attribute list cannot appear here class [[foo]] c [[foo]]; ^~~~ I think the first attribute is conforming, and it's the second attribute that should be diagnosed. Attached the patch that fixes

Re: [cfe-commits] r167783 - in /cfe/trunk: include/clang/Basic/Attr.td include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDecl.cpp lib/Sema/SemaDeclAttr.cpp test/SemaCXX/warn-unused-result.cpp

2012-11-12 Thread Michael Han
Hi Richard, Shall we use CXX11gnu, warn_unused_result instead? It seems to me that this attribute is not a clang only language extension (e.g. [[clang::fallthrough]]), but a GNU function attribute, and I believe what we plan to do in terms of migrating existing GNU attributes to C++11 syntax

[cfe-commits] r167481 - in /cfe/trunk: include/clang/Parse/Parser.h lib/Parse/ParseDecl.cpp test/CXX/dcl.dcl/dcl.spec/dcl.type/p3-0x.cpp test/CXX/expr/expr.const/p5-0x.cpp test/Parser/cxx0x-attributes

2012-11-06 Thread Michael Han
Author: hanm Date: Tue Nov 6 13:34:54 2012 New Revision: 167481 URL: http://llvm.org/viewvc/llvm-project?rev=167481view=rev Log: Teach Clang parser to reject C++11 attributes that appertain to declaration specifiers. We don't support any C++11 attributes that appertain to declaration

Re: [cfe-commits] [PATCH] Reject C++11 attributes that appertain to decl specifiers

2012-11-06 Thread Michael Han
Thanks for the review! Landed at r167481. Cheers Michael -Original Message- From: meta...@gmail.com [mailto:meta...@gmail.com] On Behalf Of Richard Smith Sent: Tuesday, November 06, 2012 10:36 AM To: Michael Han Cc: cfe-commits@cs.uiuc.edu Subject: Re: [cfe-commits] [PATCH] Reject C++11

[cfe-commits] [PATCH] Reject C++11 attributes that appertain to decl specifiers

2012-11-01 Thread Michael Han
Hi, As previously discussed [1], attached patch enable Clang to reject C++11 attributes that appertain to declaration specifiers. This also conforms to what g++ 4.8 is doing [2]. Please review, thanks! Michael [1]

Re: [cfe-commits] [PATCH] c++11 type attribute fix

2012-10-23 Thread Michael Han
suggestions on the best place to handle C++11 attributes that applies to types? Cheers Michael -Original Message- From: Eli Friedman [mailto:eli.fried...@gmail.com] Sent: Tuesday, October 23, 2012 2:08 PM To: Michael Han Cc: cfe-commits@cs.uiuc.edu Subject: Re: [cfe-commits] [PATCH] c++11 type

Re: [cfe-commits] [PATCH] c++11 type attribute fix

2012-10-23 Thread Michael Han
: Tuesday, October 23, 2012 3:31 PM To: Michael Han Cc: cfe-commits@cs.uiuc.edu Subject: Re: [cfe-commits] [PATCH] c++11 type attribute fix On Tue, Oct 23, 2012 at 3:04 PM, Michael Han michael@autodesk.com wrote: Hi Eli, Thank you for the review! I was using to differentiate case '[[foo

Re: [cfe-commits] [PATCH] c++11 type attribute fix

2012-10-23 Thread Michael Han
:10 PM To: Michael Han Cc: cfe-commits@cs.uiuc.edu Subject: Re: [cfe-commits] [PATCH] c++11 type attribute fix On Tue, Oct 23, 2012 at 4:38 PM, Michael Han michael@autodesk.com wrote: Hi Eli, But something has already gone wrong if in [[foo]] int [[foo]] x;, both attributes end up

Re: [cfe-commits] [PATCH] c++11 type attribute fix

2012-10-22 Thread Michael Han
Ping with updated patch against TOT. Michael -Original Message- From: Michael Han Sent: Thursday, October 18, 2012 11:48 AM To: 'cfe-commits@cs.uiuc.edu' Subject: [PATCH] c++11 type attribute fix Hi, This patch enables Clang to apply C++11 attributes present after declaration

[cfe-commits] [PATCH] c++11 type attribute fix

2012-10-18 Thread Michael Han
Hi, This patch enables Clang to apply C++11 attributes present after declaration specifiers to types instead of declarators, and warn on attributes that appear at wrong place (like carries_dependency which can't be applied to types). Please review, thanks! Michael typeattr.patch

[cfe-commits] r165234 - in /cfe/trunk/lib: Parse/ParseDecl.cpp Sema/SemaDecl.cpp

2012-10-04 Thread Michael Han
Author: hanm Date: Thu Oct 4 11:42:52 2012 New Revision: 165234 URL: http://llvm.org/viewvc/llvm-project?rev=165234view=rev Log: Fix scope location when parsing GNU attributes. For GNU attributes, instead of reusing attribute source location for the scope location, use SourceLocation() since

Re: [cfe-commits] [Patch] correct scope token location when parsing GNU attributes

2012-10-04 Thread Michael Han
Thank you for the review. Committed as r165234 with both fixes. Thanks! Michael From: meta...@gmail.com [mailto:meta...@gmail.com] On Behalf Of Richard Smith Sent: Wednesday, October 03, 2012 10:51 PM To: Michael Han Cc: cfe-commits@cs.uiuc.edu Subject: Re: [Patch] correct scope token location

[cfe-commits] r161963 - /cfe/trunk/lib/Frontend/ASTConsumers.cpp

2012-08-15 Thread Michael Han
Author: hanm Date: Wed Aug 15 12:56:58 2012 New Revision: 161963 URL: http://llvm.org/viewvc/llvm-project?rev=161963view=rev Log: Fix base type of ASTDeclNodeLister. Modified: cfe/trunk/lib/Frontend/ASTConsumers.cpp Modified: cfe/trunk/lib/Frontend/ASTConsumers.cpp URL:

[cfe-commits] r161245 - /cfe/trunk/lib/Sema/SemaDeclAttr.cpp

2012-08-03 Thread Michael Han
Author: hanm Date: Fri Aug 3 12:40:43 2012 New Revision: 161245 URL: http://llvm.org/viewvc/llvm-project?rev=161245view=rev Log: Fix line endings. Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp URL:

[cfe-commits] r160635 - /cfe/trunk/lib/Sema/SemaDeclAttr.cpp

2012-07-23 Thread Michael Han
Author: hanm Date: Mon Jul 23 13:48:41 2012 New Revision: 160635 URL: http://llvm.org/viewvc/llvm-project?rev=160635view=rev Log: Refactor handler functions for thread safety attributes. Make handler functions for thread safety attributes consistent with other attributes handler functions by

Re: [cfe-commits] Refactor thread safety attribute sema checks

2012-07-23 Thread Michael Han
Thanks for the review! Committed as r160635 with stylization fixes. Michael -Original Message- From: Delesley Hutchins [mailto:deles...@google.com] Sent: Monday, July 23, 2012 9:58 AM To: Michael Han Cc: cfe-commits@cs.uiuc.edu Subject: Re: Refactor thread safety attribute sema checks

  1   2   >